MOAB  4.9.3pre
Eigen::SluMatrix Struct Reference

#include <SuperLUSupport.h>

List of all members.

Public Member Functions

 SluMatrix ()
 SluMatrix (const SluMatrix &other)
SluMatrixoperator= (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

Detailed Description

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.


Constructor & Destructor Documentation

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.

    : SuperMatrix(other)
  {
    Store = &storage;
    storage = other.storage;
  }

Member Function Documentation

template<typename MatrixType >
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;
  }
template<typename MatrixType >
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;
  }
SluMatrix& Eigen::SluMatrix::operator= ( const SluMatrix other) [inline]

Definition at line 103 of file SuperLUSupport.h.

  {
    SuperMatrix::operator=(static_cast<const SuperMatrix&>(other));
    Store = &storage;
    storage = other.storage;
    return *this;
  }
template<typename Scalar >
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.

  {
    Stype = t;
    if (t==SLU_NC || t==SLU_NR || t==SLU_DN)
      Store = &storage;
    else
    {
      eigen_assert(false && "storage type not supported");
      Store = 0;
    }
  }

Member Data Documentation

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

Definition at line 114 of file SuperLUSupport.h.


The documentation for this struct was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines