AFF --- A container for numbers (array) by Friederich and Forbriger.

◆ viewcommon()

Tzarray f77interface::viewcommon ( )

create view from common

returns direct access to Fortran common block

This function returns a

object, which offers direct read/write access to the array in the Fortran common block f77common.

The concept is discussed on page "\ref page_fortran".

Examples:
tests/f77test.cc.

Definition at line 137 of file f77interface.cc.

References aff::Strided::memory_size().

Referenced by main().

138 {
139  typedef Tzarray::Tvalue Tzvalue;
141  integer maxa,maxb;
142  comdim_(&maxa, &maxb);
143  Tzvalue* p=Tcast::cast(f77common_.array);
144  // create a shape
145  aff::Strided shape(aff::Shaper(1,f77common_.na,maxa)(1,f77common_.nb,maxb));
146  // create a representation
147  aff::SharedHeap<Tzvalue> repr(p, shape.memory_size());
148  // create array and return
149  return Tzarray(shape, repr);
150 }
utility for compile-time checked cast
Definition: checkedcast.h:84
Shape for a rectangular array layout.
Definition: strided.h:117
A template class to share heap memory for different array projections.
Definition: sharedheap.h:252
aff::Array< std::complex< double > > Tzarray
Definition: f77proto.h:59
Shaper class for Fortran layout.
Definition: shaper.h:66
Here is the call graph for this function:
Here is the caller graph for this function: