Mantid
|
FortranMatrix is a wrapper template for EigenMatrix and EigenComplexMatrix to simplify porting fortran programs to C++. More...
#include <EigenFortranMatrix.h>
Public Member Functions | |
void | allocate (const int iFrom, const int iTo, const int jFrom, const int jTo) |
Resize the matrix. More... | |
void | allocate (const int nx, const int ny) |
Resize the matrix. More... | |
FortranMatrix () | |
Constructor. More... | |
FortranMatrix (const int iFrom, const int iTo, const int jFrom, const int jTo) | |
Constructor. More... | |
FortranMatrix (const int nx, const int ny) | |
Constructor. More... | |
int | len1 () const |
Get the size along the first dimension as an int. More... | |
int | len2 () const |
Get the size along the second dimension as an int. More... | |
MatrixClass | moveToBaseMatrix () |
Move the data to a new matrix of MatrixClass. More... | |
ElementRefType | operator() (const int i, const int j) |
Get the reference to the data element. More... | |
ElementConstType | operator() (const int i, const int j) const |
Index operator. More... | |
FortranMatrix< MatrixClass > & | operator= (const MatrixClass &m) |
Assignment operator - Matrix Class. More... | |
FortranMatrix< MatrixClass > | transpose () const |
copy and transpose the matrix More... | |
Private Types | |
using | ElementConstType = decltype(std::declval< const MatrixClass >().operator()(0, 0)) |
Typedef the types returned by the base class's operators []. More... | |
using | ElementRefType = decltype(std::declval< MatrixClass >().operator()(0, 0)) |
Static Private Member Functions | |
static size_t | makeSize (const int firstIndex, const int lastIndex) |
Calculate the size (1D) of a matrix First. More... | |
Private Attributes | |
int | m_base1 |
Base for the first index. More... | |
int | m_base2 |
Base for the second index. More... | |
FortranMatrix is a wrapper template for EigenMatrix and EigenComplexMatrix to simplify porting fortran programs to C++.
This matrix allows to use arbitrary index bases as they do in fortran. Indexing can begin with any integer number including negative.
Definition at line 21 of file EigenFortranMatrix.h.
|
private |
Typedef the types returned by the base class's operators [].
They aren't necessarily the same as the stored type (double or complex).
Definition at line 28 of file EigenFortranMatrix.h.
|
private |
Definition at line 29 of file EigenFortranMatrix.h.
Mantid::CurveFitting::FortranMatrix< MatrixClass >::FortranMatrix |
Constructor.
Definition at line 74 of file EigenFortranMatrix.h.
Mantid::CurveFitting::FortranMatrix< MatrixClass >::FortranMatrix | ( | const int | nx, |
const int | ny | ||
) |
Constructor.
Definition at line 79 of file EigenFortranMatrix.h.
Mantid::CurveFitting::FortranMatrix< MatrixClass >::FortranMatrix | ( | const int | iFirst, |
const int | iLast, | ||
const int | jFirst, | ||
const int | jLast | ||
) |
Constructor.
Construct a FortranMatrix that has arbitrary index bases.
For example FortranMatrix(1,5, -2,2) creates a 5 x 5 matrix. When accessing elements through operator(i,j) the first index must be in the range 1 <= i <= 5 and the second in the range -2 <= j <= 2. The index ranges defined by this constructor apply only to operator () but not to methods get() and set().
iFirst | :: Lowest value for the first index |
iLast | :: Highest value for the first index |
jFirst | :: Lowest value for the second index |
jLast | :: Highest value for the second index |
Definition at line 94 of file EigenFortranMatrix.h.
void Mantid::CurveFitting::FortranMatrix< MatrixClass >::allocate | ( | const int | iFirst, |
const int | iLast, | ||
const int | jFirst, | ||
const int | jLast | ||
) |
Resize the matrix.
iFirst | :: Lowest value for the first index |
iLast | :: Highest value for the first index |
jFirst | :: Lowest value for the second index |
jLast | :: Highest value for the second index |
Definition at line 103 of file EigenFortranMatrix.h.
Referenced by Mantid::CurveFitting::Functions::calculateEigensystem(), Mantid::CurveFitting::Functions::calculateMagneticMomentMatrix(), Mantid::CurveFitting::Functions::deg_on(), Mantid::CurveFitting::FuncMinimisers::TrustRegionMinimizer::evalHF(), Mantid::CurveFitting::FuncMinimisers::TrustRegionMinimizer::evalJ(), Mantid::CurveFitting::NLLS::NLLS_workspace::initialize(), and Mantid::CurveFitting::NLLS::matmultInner().
void Mantid::CurveFitting::FortranMatrix< MatrixClass >::allocate | ( | const int | nx, |
const int | ny | ||
) |
Resize the matrix.
The index bases are 1.
nx | :: New size along the first index. |
ny | :: New size along the second index. |
Definition at line 112 of file EigenFortranMatrix.h.
int Mantid::CurveFitting::FortranMatrix< MatrixClass >::len1 |
Get the size along the first dimension as an int.
Definition at line 137 of file EigenFortranMatrix.h.
Referenced by Mantid::CurveFitting::NLLS::applyScaling(), Mantid::CurveFitting::FuncMinimisers::TrustRegionMinimizer::evalHF(), Mantid::CurveFitting::FuncMinimisers::TrustRegionMinimizer::evalJ(), and Mantid::CurveFitting::NLLS::multJ().
int Mantid::CurveFitting::FortranMatrix< MatrixClass >::len2 |
Get the size along the second dimension as an int.
Definition at line 140 of file EigenFortranMatrix.h.
Referenced by Mantid::CurveFitting::NLLS::applyScaling(), Mantid::CurveFitting::FuncMinimisers::TrustRegionMinimizer::calculateStep(), Mantid::CurveFitting::FuncMinimisers::TrustRegionMinimizer::evalHF(), Mantid::CurveFitting::FuncMinimisers::TrustRegionMinimizer::evalJ(), Mantid::CurveFitting::NLLS::matmultInner(), and Mantid::CurveFitting::NLLS::multJt().
|
staticprivate |
Calculate the size (1D) of a matrix First.
Definition at line 65 of file EigenFortranMatrix.h.
MatrixClass Mantid::CurveFitting::FortranMatrix< MatrixClass >::moveToBaseMatrix |
Move the data to a new matrix of MatrixClass.
Definition at line 132 of file EigenFortranMatrix.h.
FortranMatrix< MatrixClass >::ElementRefType Mantid::CurveFitting::FortranMatrix< MatrixClass >::operator() | ( | const int | i, |
const int | j | ||
) |
Get the reference to the data element.
Definition at line 127 of file EigenFortranMatrix.h.
FortranMatrix< MatrixClass >::ElementConstType Mantid::CurveFitting::FortranMatrix< MatrixClass >::operator() | ( | const int | i, |
const int | j | ||
) | const |
FortranMatrix< MatrixClass > & Mantid::CurveFitting::FortranMatrix< MatrixClass >::operator= | ( | const MatrixClass & | m | ) |
Assignment operator - Matrix Class.
Definition at line 150 of file EigenFortranMatrix.h.
References Mantid::Geometry::m.
FortranMatrix< MatrixClass > Mantid::CurveFitting::FortranMatrix< MatrixClass >::transpose |
copy and transpose the matrix
Copy matrix, transpose, then return transposed copy.
Definition at line 143 of file EigenFortranMatrix.h.
|
private |
Base for the first index.
Definition at line 23 of file EigenFortranMatrix.h.
|
private |
Base for the second index.
Definition at line 25 of file EigenFortranMatrix.h.