|
MOAB
4.9.3pre
|
The base class for the direct and incomplete LU factorization of SuperLU. More...
#include <SuperLUSupport.h>


Public Types | |
| enum | { ColsAtCompileTime = MatrixType::ColsAtCompileTime, MaxColsAtCompileTime = MatrixType::MaxColsAtCompileTime } |
| typedef _MatrixType | MatrixType |
| typedef MatrixType::Scalar | Scalar |
| typedef MatrixType::RealScalar | RealScalar |
| typedef MatrixType::StorageIndex | StorageIndex |
| typedef Matrix< Scalar, Dynamic, 1 > | Vector |
| typedef Matrix< int, 1, MatrixType::ColsAtCompileTime > | IntRowVectorType |
| typedef Matrix< int, MatrixType::RowsAtCompileTime, 1 > | IntColVectorType |
| typedef Map< PermutationMatrix < Dynamic, Dynamic, int > > | PermutationMap |
| typedef SparseMatrix< Scalar > | LUMatrixType |
Public Member Functions | |
| SuperLUBase () | |
| ~SuperLUBase () | |
| Index | rows () const |
| Index | cols () const |
| superlu_options_t & | options () |
| ComputationInfo | info () const |
| Reports whether previous computation was successful. | |
| void | compute (const MatrixType &matrix) |
| void | analyzePattern (const MatrixType &) |
| template<typename Stream > | |
| void | dumpMemory (Stream &) |
Protected Types | |
| typedef SparseSolverBase< Derived > | Base |
Protected Member Functions | |
| void | initFactorization (const MatrixType &a) |
| void | init () |
| void | extractData () const |
| void | clearFactors () |
Protected Attributes | |
| LUMatrixType | m_l |
| LUMatrixType | m_u |
| IntColVectorType | m_p |
| IntRowVectorType | m_q |
| LUMatrixType | m_matrix |
| SluMatrix | m_sluA |
| SuperMatrix | m_sluL |
| SuperMatrix | m_sluU |
| SluMatrix | m_sluB |
| SluMatrix | m_sluX |
| SuperLUStat_t | m_sluStat |
| superlu_options_t | m_sluOptions |
| std::vector< int > | m_sluEtree |
| Matrix< RealScalar, Dynamic, 1 > | m_sluRscale |
| Matrix< RealScalar, Dynamic, 1 > | m_sluCscale |
| Matrix< RealScalar, Dynamic, 1 > | m_sluFerr |
| Matrix< RealScalar, Dynamic, 1 > | m_sluBerr |
| char | m_sluEqued |
| ComputationInfo | m_info |
| int | m_factorizationIsOk |
| int | m_analysisIsOk |
| bool | m_extractedDataAreDirty |
Private Member Functions | |
| SuperLUBase (SuperLUBase &) | |
The base class for the direct and incomplete LU factorization of SuperLU.
Definition at line 291 of file SuperLUSupport.h.
typedef SparseSolverBase<Derived> Eigen::SuperLUBase< _MatrixType, Derived >::Base [protected] |
Reimplemented in Eigen::SuperLU< _MatrixType >.
Definition at line 294 of file SuperLUSupport.h.
| typedef Matrix<int, MatrixType::RowsAtCompileTime, 1> Eigen::SuperLUBase< _MatrixType, Derived >::IntColVectorType |
Reimplemented in Eigen::SuperLU< _MatrixType >.
Definition at line 304 of file SuperLUSupport.h.
| typedef Matrix<int, 1, MatrixType::ColsAtCompileTime> Eigen::SuperLUBase< _MatrixType, Derived >::IntRowVectorType |
Reimplemented in Eigen::SuperLU< _MatrixType >.
Definition at line 303 of file SuperLUSupport.h.
| typedef SparseMatrix<Scalar> Eigen::SuperLUBase< _MatrixType, Derived >::LUMatrixType |
Reimplemented in Eigen::SuperLU< _MatrixType >.
Definition at line 306 of file SuperLUSupport.h.
| typedef _MatrixType Eigen::SuperLUBase< _MatrixType, Derived >::MatrixType |
Reimplemented in Eigen::SuperLU< _MatrixType >.
Definition at line 298 of file SuperLUSupport.h.
| typedef Map<PermutationMatrix<Dynamic,Dynamic,int> > Eigen::SuperLUBase< _MatrixType, Derived >::PermutationMap |
Reimplemented in Eigen::SuperLU< _MatrixType >.
Definition at line 305 of file SuperLUSupport.h.
| typedef MatrixType::RealScalar Eigen::SuperLUBase< _MatrixType, Derived >::RealScalar |
Reimplemented in Eigen::SuperLU< _MatrixType >.
Definition at line 300 of file SuperLUSupport.h.
| typedef MatrixType::Scalar Eigen::SuperLUBase< _MatrixType, Derived >::Scalar |
Reimplemented in Eigen::SuperLU< _MatrixType >.
Definition at line 299 of file SuperLUSupport.h.
| typedef MatrixType::StorageIndex Eigen::SuperLUBase< _MatrixType, Derived >::StorageIndex |
Reimplemented in Eigen::SuperLU< _MatrixType >.
Definition at line 301 of file SuperLUSupport.h.
| typedef Matrix<Scalar,Dynamic,1> Eigen::SuperLUBase< _MatrixType, Derived >::Vector |
Definition at line 302 of file SuperLUSupport.h.
| anonymous enum |
Definition at line 307 of file SuperLUSupport.h.
{
ColsAtCompileTime = MatrixType::ColsAtCompileTime,
MaxColsAtCompileTime = MatrixType::MaxColsAtCompileTime
};
| Eigen::SuperLUBase< _MatrixType, Derived >::SuperLUBase | ( | ) | [inline] |
Definition at line 314 of file SuperLUSupport.h.
{}
| Eigen::SuperLUBase< _MatrixType, Derived >::~SuperLUBase | ( | ) | [inline] |
Definition at line 316 of file SuperLUSupport.h.
{
clearFactors();
}
| Eigen::SuperLUBase< _MatrixType, Derived >::SuperLUBase | ( | SuperLUBase< _MatrixType, Derived > & | ) | [inline, private] |
Definition at line 441 of file SuperLUSupport.h.
{ }
| void Eigen::SuperLUBase< _MatrixType, Derived >::analyzePattern | ( | const MatrixType & | ) | [inline] |
Performs a symbolic decomposition on the sparcity of matrix.
This function is particularly useful when solving for several problems having the same structure.
Reimplemented in Eigen::SuperLU< _MatrixType >.
Definition at line 351 of file SuperLUSupport.h.
{
m_isInitialized = true;
m_info = Success;
m_analysisIsOk = true;
m_factorizationIsOk = false;
}
| void Eigen::SuperLUBase< _MatrixType, Derived >::clearFactors | ( | ) | [inline, protected] |
| Index Eigen::SuperLUBase< _MatrixType, Derived >::cols | ( | void | ) | const [inline] |
Definition at line 322 of file SuperLUSupport.h.
| void Eigen::SuperLUBase< _MatrixType, Derived >::compute | ( | const MatrixType & | matrix | ) | [inline] |
Computes the sparse Cholesky decomposition of matrix
Definition at line 339 of file SuperLUSupport.h.
| void Eigen::SuperLUBase< _MatrixType, Derived >::dumpMemory | ( | Stream & | ) | [inline] |
Definition at line 360 of file SuperLUSupport.h.
{}
| void Eigen::SuperLUBase< MatrixType, Derived >::extractData | ( | ) | const [protected] |
Definition at line 681 of file SuperLUSupport.h.
{
eigen_assert(m_factorizationIsOk && "The decomposition is not in a valid state for extracting factors, you must first call either compute() or analyzePattern()/factorize()");
if (m_extractedDataAreDirty)
{
int upper;
int fsupc, istart, nsupr;
int lastl = 0, lastu = 0;
SCformat *Lstore = static_cast<SCformat*>(m_sluL.Store);
NCformat *Ustore = static_cast<NCformat*>(m_sluU.Store);
Scalar *SNptr;
const Index size = m_matrix.rows();
m_l.resize(size,size);
m_l.resizeNonZeros(Lstore->nnz);
m_u.resize(size,size);
m_u.resizeNonZeros(Ustore->nnz);
int* Lcol = m_l.outerIndexPtr();
int* Lrow = m_l.innerIndexPtr();
Scalar* Lval = m_l.valuePtr();
int* Ucol = m_u.outerIndexPtr();
int* Urow = m_u.innerIndexPtr();
Scalar* Uval = m_u.valuePtr();
Ucol[0] = 0;
Ucol[0] = 0;
/* for each supernode */
for (int k = 0; k <= Lstore->nsuper; ++k)
{
fsupc = L_FST_SUPC(k);
istart = L_SUB_START(fsupc);
nsupr = L_SUB_START(fsupc+1) - istart;
upper = 1;
/* for each column in the supernode */
for (int j = fsupc; j < L_FST_SUPC(k+1); ++j)
{
SNptr = &((Scalar*)Lstore->nzval)[L_NZ_START(j)];
/* Extract U */
for (int i = U_NZ_START(j); i < U_NZ_START(j+1); ++i)
{
Uval[lastu] = ((Scalar*)Ustore->nzval)[i];
/* Matlab doesn't like explicit zero. */
if (Uval[lastu] != 0.0)
Urow[lastu++] = U_SUB(i);
}
for (int i = 0; i < upper; ++i)
{
/* upper triangle in the supernode */
Uval[lastu] = SNptr[i];
/* Matlab doesn't like explicit zero. */
if (Uval[lastu] != 0.0)
Urow[lastu++] = L_SUB(istart+i);
}
Ucol[j+1] = lastu;
/* Extract L */
Lval[lastl] = 1.0; /* unit diagonal */
Lrow[lastl++] = L_SUB(istart + upper - 1);
for (int i = upper; i < nsupr; ++i)
{
Lval[lastl] = SNptr[i];
/* Matlab doesn't like explicit zero. */
if (Lval[lastl] != 0.0)
Lrow[lastl++] = L_SUB(istart+i);
}
Lcol[j+1] = lastl;
++upper;
} /* for j ... */
} /* for k ... */
// squeeze the matrices :
m_l.resizeNonZeros(lastl);
m_u.resizeNonZeros(lastu);
m_extractedDataAreDirty = false;
}
}
| ComputationInfo Eigen::SuperLUBase< _MatrixType, Derived >::info | ( | ) | const [inline] |
Reports whether previous computation was successful.
Success if computation was succesful, NumericalIssue if the matrix.appears to be negative. Definition at line 332 of file SuperLUSupport.h.
{
eigen_assert(m_isInitialized && "Decomposition is not initialized.");
return m_info;
}
| void Eigen::SuperLUBase< _MatrixType, Derived >::init | ( | ) | [inline, protected] |
Reimplemented in Eigen::SuperLU< _MatrixType >.
Definition at line 394 of file SuperLUSupport.h.
{
m_info = InvalidInput;
m_isInitialized = false;
m_sluL.Store = 0;
m_sluU.Store = 0;
}
| void Eigen::SuperLUBase< _MatrixType, Derived >::initFactorization | ( | const MatrixType & | a | ) | [inline, protected] |
Definition at line 365 of file SuperLUSupport.h.
{
set_default_options(&this->m_sluOptions);
const Index size = a.rows();
m_matrix = a;
m_sluA = internal::asSluMatrix(m_matrix);
clearFactors();
m_p.resize(size);
m_q.resize(size);
m_sluRscale.resize(size);
m_sluCscale.resize(size);
m_sluEtree.resize(size);
// set empty B and X
m_sluB.setStorageType(SLU_DN);
m_sluB.setScalarType<Scalar>();
m_sluB.Mtype = SLU_GE;
m_sluB.storage.values = 0;
m_sluB.nrow = 0;
m_sluB.ncol = 0;
m_sluB.storage.lda = internal::convert_index<int>(size);
m_sluX = m_sluB;
m_extractedDataAreDirty = true;
}
| superlu_options_t& Eigen::SuperLUBase< _MatrixType, Derived >::options | ( | ) | [inline] |
Definition at line 325 of file SuperLUSupport.h.
{ return m_sluOptions; }
| Index Eigen::SuperLUBase< _MatrixType, Derived >::rows | ( | void | ) | const [inline] |
Definition at line 321 of file SuperLUSupport.h.
int Eigen::SuperLUBase< _MatrixType, Derived >::m_analysisIsOk [protected] |
Definition at line 437 of file SuperLUSupport.h.
bool Eigen::SuperLUBase< _MatrixType, Derived >::m_extractedDataAreDirty [mutable, protected] |
Definition at line 438 of file SuperLUSupport.h.
int Eigen::SuperLUBase< _MatrixType, Derived >::m_factorizationIsOk [protected] |
Definition at line 436 of file SuperLUSupport.h.
ComputationInfo Eigen::SuperLUBase< _MatrixType, Derived >::m_info [mutable, protected] |
Definition at line 435 of file SuperLUSupport.h.
LUMatrixType Eigen::SuperLUBase< _MatrixType, Derived >::m_l [mutable, protected] |
Definition at line 419 of file SuperLUSupport.h.
LUMatrixType Eigen::SuperLUBase< _MatrixType, Derived >::m_matrix [mutable, protected] |
Definition at line 424 of file SuperLUSupport.h.
IntColVectorType Eigen::SuperLUBase< _MatrixType, Derived >::m_p [mutable, protected] |
Definition at line 421 of file SuperLUSupport.h.
IntRowVectorType Eigen::SuperLUBase< _MatrixType, Derived >::m_q [mutable, protected] |
Definition at line 422 of file SuperLUSupport.h.
SluMatrix Eigen::SuperLUBase< _MatrixType, Derived >::m_sluA [mutable, protected] |
Definition at line 425 of file SuperLUSupport.h.
SluMatrix Eigen::SuperLUBase< _MatrixType, Derived >::m_sluB [mutable, protected] |
Definition at line 427 of file SuperLUSupport.h.
Matrix<RealScalar,Dynamic,1> Eigen::SuperLUBase< _MatrixType, Derived >::m_sluBerr [mutable, protected] |
Definition at line 432 of file SuperLUSupport.h.
Matrix<RealScalar,Dynamic,1> Eigen::SuperLUBase< _MatrixType, Derived >::m_sluCscale [mutable, protected] |
Definition at line 431 of file SuperLUSupport.h.
char Eigen::SuperLUBase< _MatrixType, Derived >::m_sluEqued [mutable, protected] |
Definition at line 433 of file SuperLUSupport.h.
std::vector<int> Eigen::SuperLUBase< _MatrixType, Derived >::m_sluEtree [mutable, protected] |
Definition at line 430 of file SuperLUSupport.h.
Matrix<RealScalar,Dynamic,1> Eigen::SuperLUBase< _MatrixType, Derived >::m_sluFerr [mutable, protected] |
Definition at line 432 of file SuperLUSupport.h.
SuperMatrix Eigen::SuperLUBase< _MatrixType, Derived >::m_sluL [mutable, protected] |
Definition at line 426 of file SuperLUSupport.h.
superlu_options_t Eigen::SuperLUBase< _MatrixType, Derived >::m_sluOptions [mutable, protected] |
Definition at line 429 of file SuperLUSupport.h.
Matrix<RealScalar,Dynamic,1> Eigen::SuperLUBase< _MatrixType, Derived >::m_sluRscale [mutable, protected] |
Definition at line 431 of file SuperLUSupport.h.
SuperLUStat_t Eigen::SuperLUBase< _MatrixType, Derived >::m_sluStat [mutable, protected] |
Definition at line 428 of file SuperLUSupport.h.
SuperMatrix Eigen::SuperLUBase< _MatrixType, Derived >::m_sluU [mutable, protected] |
Definition at line 426 of file SuperLUSupport.h.
SluMatrix Eigen::SuperLUBase< _MatrixType, Derived >::m_sluX [mutable, protected] |
Definition at line 427 of file SuperLUSupport.h.
LUMatrixType Eigen::SuperLUBase< _MatrixType, Derived >::m_u [mutable, protected] |
Definition at line 420 of file SuperLUSupport.h.