LifeV
FortranMatrix< ScalarType > Class Template Reference

A matrix class for interfacing with fortran. More...

#include <FortranWrapper.hpp>

+ Collaboration diagram for FortranMatrix< ScalarType >:

Data Fields

size_t M_arrayDimensions [7]
 
ScalarType * M_cppRepresentation
 
ScalarType * M_fortranRepresentation
 
const size_t M_numDimensions
 

Public typedefs

typedef ScalarType scalar_Type
 

Constructors and destructor

 FortranMatrix ()
 
 FortranMatrix (size_t dim1, size_t dim2=1)
 
 FortranMatrix (ScalarType *cppArray, size_t dim1, size_t dim2=1)
 
virtual ~FortranMatrix ()
 

Operators

 operator ScalarType * ()
 
ScalarType & operator() (size_t index1, size_t index2=0)
 

Detailed Description

template<class ScalarType>
class LifeV::FortranMatrix< ScalarType >

A matrix class for interfacing with fortran.

A minimal class used when passing multi-dimensional array arguments from C++ to FORTRAN 77 (received as FORTRAN arrays), and subsequently returned back to C++ as properly aranged C++ arrays.

FORTRAN organises data in a "column-first" order, while C++ organises data in a "row-first" order.

(1) The FortranMatrix class can take a C++ array as a constructor parameter. A FORTRAN compatible copy of the array is then made. The destructor will then copy the result back to the original c++ array.

(2) The FortranMatrix class provides "subscript operators" allowing the programmer to read and write from the array, using FORTRAN-like syntax and indexing semantics.

/author Carsten A. Arnholm, 04-MAR-1996 (Modified by L. Formaggia MAR 2002)

Definition at line 95 of file FortranWrapper.hpp.

Member Typedef Documentation

◆ scalar_Type

typedef ScalarType scalar_Type

Definition at line 100 of file FortranWrapper.hpp.

Constructor & Destructor Documentation

◆ FortranMatrix() [1/3]

FortranMatrix ( )
inline

Definition at line 103 of file FortranWrapper.hpp.

◆ FortranMatrix() [2/3]

FortranMatrix ( size_t  dim1,
size_t  dim2 = 1 
)

Definition at line 189 of file FortranWrapper.hpp.

◆ FortranMatrix() [3/3]

FortranMatrix ( ScalarType *  cppArray,
size_t  dim1,
size_t  dim2 = 1 
)

Definition at line 204 of file FortranWrapper.hpp.

◆ ~FortranMatrix()

~FortranMatrix ( )
virtual

Definition at line 231 of file FortranWrapper.hpp.

Member Function Documentation

◆ operator ScalarType *()

operator ScalarType * ( )

Definition at line 257 of file FortranWrapper.hpp.

◆ operator()()

ScalarType & operator() ( size_t  index1,
size_t  index2 = 0 
)

Definition at line 264 of file FortranWrapper.hpp.

Field Documentation

◆ M_arrayDimensions

size_t M_arrayDimensions[7]

Definition at line 116 of file FortranWrapper.hpp.

◆ M_cppRepresentation

ScalarType* M_cppRepresentation

Definition at line 117 of file FortranWrapper.hpp.

◆ M_fortranRepresentation

ScalarType* M_fortranRepresentation

Definition at line 118 of file FortranWrapper.hpp.

◆ M_numDimensions

const size_t M_numDimensions

Definition at line 119 of file FortranWrapper.hpp.


The documentation for this class was generated from the following file: