MOAB
4.9.3pre
|
#include <SuperLUSupport.h>
Public Member Functions | |
SluMatrix () | |
SluMatrix (const SluMatrix &other) | |
SluMatrix & | operator= (const SluMatrix &other) |
void | setStorageType (Stype_t t) |
template<typename Scalar > | |
void | setScalarType () |
Static Public Member Functions | |
template<typename MatrixType > | |
static SluMatrix | Map (MatrixBase< MatrixType > &_mat) |
template<typename MatrixType > | |
static SluMatrix | Map (SparseMatrixBase< MatrixType > &a_mat) |
Public Attributes | |
struct { | |
union { | |
int nnz | |
int lda | |
} | |
void * values | |
int * innerInd | |
int * outerInd | |
} | storage |
A wrapper class for SuperLU matrices. It supports only compressed sparse matrices and dense matrices. Supernodal and other fancy format are not supported by this wrapper.
This wrapper class mainly aims to avoids the need of dynamic allocation of the storage structure.
Definition at line 89 of file SuperLUSupport.h.
Eigen::SluMatrix::SluMatrix | ( | ) | [inline] |
Definition at line 91 of file SuperLUSupport.h.
{ Store = &storage; }
Eigen::SluMatrix::SluMatrix | ( | const SluMatrix & | other | ) | [inline] |
Definition at line 96 of file SuperLUSupport.h.
static SluMatrix Eigen::SluMatrix::Map | ( | MatrixBase< MatrixType > & | _mat | ) | [inline, static] |
Definition at line 149 of file SuperLUSupport.h.
{ MatrixType& mat(_mat.derived()); eigen_assert( ((MatrixType::Flags&RowMajorBit)!=RowMajorBit) && "row-major dense matrices are not supported by SuperLU"); SluMatrix res; res.setStorageType(SLU_DN); res.setScalarType<typename MatrixType::Scalar>(); res.Mtype = SLU_GE; res.nrow = internal::convert_index<int>(mat.rows()); res.ncol = internal::convert_index<int>(mat.cols()); res.storage.lda = internal::convert_index<int>(MatrixType::IsVectorAtCompileTime ? mat.size() : mat.outerStride()); res.storage.values = (void*)(mat.data()); return res; }
static SluMatrix Eigen::SluMatrix::Map | ( | SparseMatrixBase< MatrixType > & | a_mat | ) | [inline, static] |
Definition at line 167 of file SuperLUSupport.h.
{ MatrixType &mat(a_mat.derived()); SluMatrix res; if ((MatrixType::Flags&RowMajorBit)==RowMajorBit) { res.setStorageType(SLU_NR); res.nrow = internal::convert_index<int>(mat.cols()); res.ncol = internal::convert_index<int>(mat.rows()); } else { res.setStorageType(SLU_NC); res.nrow = internal::convert_index<int>(mat.rows()); res.ncol = internal::convert_index<int>(mat.cols()); } res.Mtype = SLU_GE; res.storage.nnz = internal::convert_index<int>(mat.nonZeros()); res.storage.values = mat.valuePtr(); res.storage.innerInd = mat.innerIndexPtr(); res.storage.outerInd = mat.outerIndexPtr(); res.setScalarType<typename MatrixType::Scalar>(); // FIXME the following is not very accurate if (MatrixType::Flags & Upper) res.Mtype = SLU_TRU; if (MatrixType::Flags & Lower) res.Mtype = SLU_TRL; eigen_assert(((MatrixType::Flags & SelfAdjoint)==0) && "SelfAdjoint matrix shape not supported by SuperLU"); return res; }
Definition at line 103 of file SuperLUSupport.h.
{ SuperMatrix::operator=(static_cast<const SuperMatrix&>(other)); Store = &storage; storage = other.storage; return *this; }
void Eigen::SluMatrix::setScalarType | ( | ) | [inline] |
Definition at line 132 of file SuperLUSupport.h.
{ if (internal::is_same<Scalar,float>::value) Dtype = SLU_S; else if (internal::is_same<Scalar,double>::value) Dtype = SLU_D; else if (internal::is_same<Scalar,std::complex<float> >::value) Dtype = SLU_C; else if (internal::is_same<Scalar,std::complex<double> >::value) Dtype = SLU_Z; else { eigen_assert(false && "Scalar type not supported by SuperLU"); } }
void Eigen::SluMatrix::setStorageType | ( | Stype_t | t | ) | [inline] |
Definition at line 119 of file SuperLUSupport.h.
Definition at line 115 of file SuperLUSupport.h.
Definition at line 113 of file SuperLUSupport.h.
Definition at line 113 of file SuperLUSupport.h.
Definition at line 116 of file SuperLUSupport.h.
struct { ... } Eigen::SluMatrix::storage |
void* Eigen::SluMatrix::values |
Definition at line 114 of file SuperLUSupport.h.