Eigen::SluMatrixMapHelper< SparseMatrixBase< Derived > > Struct Template Reference

#include <SuperLUSupport.h>

Public Types

typedef Derived MatrixType
 

Static Public Member Functions

static void run (MatrixType &mat, SluMatrix &res)
 

Member Typedef Documentation

◆ MatrixType

template<typename Derived >
typedef Derived Eigen::SluMatrixMapHelper< SparseMatrixBase< Derived > >::MatrixType

Member Function Documentation

◆ run()

template<typename Derived >
static void Eigen::SluMatrixMapHelper< SparseMatrixBase< Derived > >::run ( MatrixType mat,
SluMatrix res 
)
inlinestatic
223  {
224  if ((MatrixType::Flags & RowMajorBit) == RowMajorBit) {
225  res.setStorageType(SLU_NR);
226  res.nrow = mat.cols();
227  res.ncol = mat.rows();
228  } else {
229  res.setStorageType(SLU_NC);
230  res.nrow = mat.rows();
231  res.ncol = mat.cols();
232  }
233 
234  res.Mtype = SLU_GE;
235 
236  res.storage.nnz = mat.nonZeros();
237  res.storage.values = mat.valuePtr();
238  res.storage.innerInd = mat.innerIndexPtr();
239  res.storage.outerInd = mat.outerIndexPtr();
240 
241  res.setScalarType<typename MatrixType::Scalar>();
242 
243  // FIXME the following is not very accurate
244  if (MatrixType::Flags & Upper) res.Mtype = SLU_TRU;
245  if (MatrixType::Flags & Lower) res.Mtype = SLU_TRL;
246 
247  eigen_assert(((MatrixType::Flags & SelfAdjoint) == 0) && "SelfAdjoint matrix shape not supported by SuperLU");
248  }
#define eigen_assert(x)
Definition: Macros.h:910
cout<< "Here is the matrix m:"<< endl<< m<< endl;Matrix< ptrdiff_t, 3, 1 > res
Definition: PartialRedux_count.cpp:3
SCALAR Scalar
Definition: bench_gemm.cpp:45
Index nonZeros() const
Definition: SparseCompressedBase.h:64
Index cols() const
Definition: SparseMatrix.h:161
const Scalar * valuePtr() const
Definition: SparseMatrix.h:171
Index rows() const
Definition: SparseMatrix.h:159
const StorageIndex * outerIndexPtr() const
Definition: SparseMatrix.h:189
const StorageIndex * innerIndexPtr() const
Definition: SparseMatrix.h:180
@ SelfAdjoint
Definition: Constants.h:227
@ Lower
Definition: Constants.h:211
@ Upper
Definition: Constants.h:213
const unsigned int RowMajorBit
Definition: Constants.h:70
@ SLU_TRL
Definition: oomph_superlu_4.3/supermatrix.h:35
@ SLU_TRU
Definition: oomph_superlu_4.3/supermatrix.h:36
@ SLU_GE
Definition: oomph_superlu_4.3/supermatrix.h:32
@ SLU_NC
Definition: oomph_superlu_4.3/supermatrix.h:12
@ SLU_NR
Definition: oomph_superlu_4.3/supermatrix.h:16

References Eigen::SparseMatrix< Scalar_, Options_, StorageIndex_ >::cols(), eigen_assert, Eigen::SparseMatrix< Scalar_, Options_, StorageIndex_ >::innerIndexPtr(), Eigen::Lower, Eigen::SparseMatrix< Scalar_, Options_, StorageIndex_ >::nonZeros(), Eigen::SparseMatrix< Scalar_, Options_, StorageIndex_ >::outerIndexPtr(), res, Eigen::RowMajorBit, Eigen::SparseMatrix< Scalar_, Options_, StorageIndex_ >::rows(), Eigen::SelfAdjoint, SLU_GE, SLU_NC, SLU_NR, SLU_TRL, SLU_TRU, Eigen::Upper, and Eigen::SparseMatrix< Scalar_, Options_, StorageIndex_ >::valuePtr().


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