Eigen::SluMatrix Struct Reference

Inherits SuperMatrix.

Public Member Functions

SluMatrixoperator= (const SluMatrix &other)
 
template<typename Scalar >
void setScalarType ()
 
void setStorageType (Stype_t t)
 
 SluMatrix ()
 
 SluMatrix (const SluMatrix &other)
 

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   lda
 
      int   nnz
 
   } 
 
   int *   innerInd
 
   int *   outerInd
 
   void *   values
 
storage
 

Detailed Description

Definition at line 117 of file SuperLUSupport.h.

Constructor & Destructor Documentation

◆ SluMatrix() [1/2]

Eigen::SluMatrix::SluMatrix ( )
inline

Definition at line 119 of file SuperLUSupport.h.

120  {
121  Store = &storage;
122  }
struct Eigen::SluMatrix::@838 storage

◆ SluMatrix() [2/2]

Eigen::SluMatrix::SluMatrix ( const SluMatrix other)
inline

Definition at line 124 of file SuperLUSupport.h.

125  : SuperMatrix(other)
126  {
127  Store = &storage;
128  storage = other.storage;
129  }

Member Function Documentation

◆ Map() [1/2]

template<typename MatrixType >
static SluMatrix Eigen::SluMatrix::Map ( MatrixBase< MatrixType > &  _mat)
inlinestatic

Definition at line 177 of file SuperLUSupport.h.

178  {
179  MatrixType& mat(_mat.derived());
180  eigen_assert( ((MatrixType::Flags&RowMajorBit)!=RowMajorBit) && "row-major dense matrices are not supported by SuperLU");
181  SluMatrix res;
182  res.setStorageType(SLU_DN);
183  res.setScalarType<typename MatrixType::Scalar>();
184  res.Mtype = SLU_GE;
185 
186  res.nrow = internal::convert_index<int>(mat.rows());
187  res.ncol = internal::convert_index<int>(mat.cols());
188 
189  res.storage.lda = internal::convert_index<int>(MatrixType::IsVectorAtCompileTime ? mat.size() : mat.outerStride());
190  res.storage.values = (void*)(mat.data());
191  return res;
192  }
#define eigen_assert(x)
Definition: Macros.h:902
cout<< "Here is the matrix m:"<< endl<< m<< endl;Matrix< ptrdiff_t, 3, 1 > res
Matrix< float, 1, Dynamic > MatrixType
internal::traits< Derived >::Scalar Scalar
Definition: DenseBase.h:61
const unsigned int RowMajorBit
Definition: Constants.h:68

◆ Map() [2/2]

template<typename MatrixType >
static SluMatrix Eigen::SluMatrix::Map ( SparseMatrixBase< MatrixType > &  a_mat)
inlinestatic

Definition at line 195 of file SuperLUSupport.h.

196  {
197  MatrixType &mat(a_mat.derived());
198  SluMatrix res;
199  if ((MatrixType::Flags&RowMajorBit)==RowMajorBit)
200  {
201  res.setStorageType(SLU_NR);
202  res.nrow = internal::convert_index<int>(mat.cols());
203  res.ncol = internal::convert_index<int>(mat.rows());
204  }
205  else
206  {
207  res.setStorageType(SLU_NC);
208  res.nrow = internal::convert_index<int>(mat.rows());
209  res.ncol = internal::convert_index<int>(mat.cols());
210  }
211 
212  res.Mtype = SLU_GE;
213 
214  res.storage.nnz = internal::convert_index<int>(mat.nonZeros());
215  res.storage.values = mat.valuePtr();
216  res.storage.innerInd = mat.innerIndexPtr();
217  res.storage.outerInd = mat.outerIndexPtr();
218 
219  res.setScalarType<typename MatrixType::Scalar>();
220 
221  // FIXME the following is not very accurate
222  if (int(MatrixType::Flags) & int(Upper))
223  res.Mtype = SLU_TRU;
224  if (int(MatrixType::Flags) & int(Lower))
225  res.Mtype = SLU_TRL;
226 
227  eigen_assert(((int(MatrixType::Flags) & int(SelfAdjoint))==0) && "SelfAdjoint matrix shape not supported by SuperLU");
228 
229  return res;
230  }
if((m *x).isApprox(y))
@ SelfAdjoint
Definition: Constants.h:227
@ Lower
Definition: Constants.h:211
@ Upper
Definition: Constants.h:213

◆ operator=()

SluMatrix& Eigen::SluMatrix::operator= ( const SluMatrix other)
inline

Definition at line 131 of file SuperLUSupport.h.

132  {
133  SuperMatrix::operator=(static_cast<const SuperMatrix&>(other));
134  Store = &storage;
135  storage = other.storage;
136  return *this;
137  }

◆ setScalarType()

template<typename Scalar >
void Eigen::SluMatrix::setScalarType ( )
inline

Definition at line 160 of file SuperLUSupport.h.

161  {
162  if (internal::is_same<Scalar,float>::value)
163  Dtype = SLU_S;
164  else if (internal::is_same<Scalar,double>::value)
165  Dtype = SLU_D;
166  else if (internal::is_same<Scalar,std::complex<float> >::value)
167  Dtype = SLU_C;
168  else if (internal::is_same<Scalar,std::complex<double> >::value)
169  Dtype = SLU_Z;
170  else
171  {
172  eigen_assert(false && "Scalar type not supported by SuperLU");
173  }
174  }

◆ setStorageType()

void Eigen::SluMatrix::setStorageType ( Stype_t  t)
inline

Definition at line 147 of file SuperLUSupport.h.

148  {
149  Stype = t;
150  if (t==SLU_NC || t==SLU_NR || t==SLU_DN)
151  Store = &storage;
152  else
153  {
154  eigen_assert(false && "storage type not supported");
155  Store = 0;
156  }
157  }

Member Data Documentation

◆ innerInd

int* Eigen::SluMatrix::innerInd

Definition at line 143 of file SuperLUSupport.h.

◆ lda

int Eigen::SluMatrix::lda

Definition at line 141 of file SuperLUSupport.h.

◆ nnz

int Eigen::SluMatrix::nnz

Definition at line 141 of file SuperLUSupport.h.

◆ outerInd

int* Eigen::SluMatrix::outerInd

Definition at line 144 of file SuperLUSupport.h.

◆ 

struct { ... } Eigen::SluMatrix::storage

◆ values

void* Eigen::SluMatrix::values

Definition at line 142 of file SuperLUSupport.h.


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