#include <MatrixFuncs.h>
|
static unsigned int | GetRequiredStorageSize (unsigned int rows, unsigned int columns) |
|
static unsigned int | CalculateIndex (unsigned int totalRows, unsigned int totalColumns, unsigned int curRow, unsigned int curColumn) |
|
static boost::tuples::tuple
< unsigned int, unsigned int > | Advance (const unsigned int totalRows, const unsigned int totalColumns, const unsigned int curRow, const unsigned int curColumn) |
|
template<typename DataType > |
static void | Invert (unsigned int rows, unsigned int columns, Array< OneD, DataType > &data, const char transpose) |
|
static void | EigenSolve (unsigned int n, const Array< OneD, const double > &A, Array< OneD, NekDouble > &EigValReal, Array< OneD, NekDouble > &EigValImag, Array< OneD, NekDouble > &EigVecs=NullNekDouble1DArray) |
|
Definition at line 74 of file MatrixFuncs.h.
boost::tuples::tuple< unsigned int, unsigned int > Nektar::FullMatrixFuncs::Advance |
( |
const unsigned int |
totalRows, |
|
|
const unsigned int |
totalColumns, |
|
|
const unsigned int |
curRow, |
|
|
const unsigned int |
curColumn |
|
) |
| |
|
static |
Definition at line 133 of file MatrixFuncs.cpp.
Referenced by Nektar::NekMatrix< DataType, StandardMatrixTag >::Advance().
136 unsigned int nextRow = curRow;
137 unsigned int nextColumn = curColumn;
139 if( nextRow < totalRows )
144 if( nextRow >= totalRows )
150 if( nextColumn >= totalColumns )
152 nextRow = std::numeric_limits<unsigned int>::max();
153 nextColumn = std::numeric_limits<unsigned int>::max();
156 return boost::tuples::tuple<unsigned int, unsigned int>(nextRow, nextColumn);
unsigned int Nektar::FullMatrixFuncs::CalculateIndex |
( |
unsigned int |
totalRows, |
|
|
unsigned int |
totalColumns, |
|
|
unsigned int |
curRow, |
|
|
unsigned int |
curColumn |
|
) |
| |
|
static |
Definition at line 133 of file MatrixFuncs.h.
References ASSERTL0, and Nektar::NullNekDouble1DArray.
Referenced by Nektar::NekMatrix< DataType, StandardMatrixTag >::EigenSolve().
139 int lda = n,info = 0;
146 Array<OneD,NekDouble> work(4*lda);
148 Lapack::Dgeev(uplo,lrev,lda, A.get(),lda,
153 &work[0],lwork,info);
158 Array<OneD,NekDouble> work(3*lda);
160 Lapack::Dgeev(uplo,lrev,lda,
165 &work[0],lwork,info);
167 ASSERTL0(info == 0,
"Info is not zero");
#define ASSERTL0(condition, msg)
static Array< OneD, NekDouble > NullNekDouble1DArray
unsigned int Nektar::FullMatrixFuncs::GetRequiredStorageSize |
( |
unsigned int |
rows, |
|
|
unsigned int |
columns |
|
) |
| |
|
static |
template<typename DataType >
static void Nektar::FullMatrixFuncs::Invert |
( |
unsigned int |
rows, |
|
|
unsigned int |
columns, |
|
|
Array< OneD, DataType > & |
data, |
|
|
const char |
transpose |
|
) |
| |
|
inlinestatic |
Definition at line 86 of file MatrixFuncs.h.
References ASSERTL0, and Nektar::Array< OneD, DataType >::get().
Referenced by Nektar::NekMatrix< DataType, StandardMatrixTag >::Invert().
90 #ifdef NEKTAR_USING_BLAS
91 ASSERTL0(rows==columns,
"Only square matrices can be inverted.");
92 ASSERTL0(transpose==
'N',
"Only untransposed matrices may be inverted.");
97 Array<OneD, int> ipivot(n);
98 Array<OneD, DataType> work(n);
100 Lapack::Dgetrf(m, n, data.get(), m, ipivot.get(), info);
104 std::string message =
"ERROR: The " + boost::lexical_cast<std::string>(-info) +
"th parameter had an illegal parameter for dgetrf";
109 std::string message =
"ERROR: Element u_" + boost::lexical_cast<std::string>(info) + boost::lexical_cast<std::string>(info) +
" is 0 from dgetrf";
113 Lapack::Dgetri(n, data.get(), n, ipivot.get(),
114 work.get(), n, info);
118 std::string message =
"ERROR: The " + boost::lexical_cast<std::string>(-info) +
"th parameter had an illegal parameter for dgetri";
123 std::string message =
"ERROR: Element u_" + boost::lexical_cast<std::string>(info) + boost::lexical_cast<std::string>(info) +
" is 0 from dgetri";
129 BOOST_STATIC_ASSERT(
sizeof(DataType) == 0);
#define ASSERTL0(condition, msg)