mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-01-24 14:45:14 +08:00
Fix bug #454: allow Block/Map objects for solving with SuperLU
This commit is contained in:
parent
fc5f21903b
commit
c58b759865
@ -161,14 +161,14 @@ struct SluMatrix : SuperMatrix
|
||||
}
|
||||
}
|
||||
|
||||
template<typename Scalar, int Rows, int Cols, int Options, int MRows, int MCols>
|
||||
static SluMatrix Map(Matrix<Scalar,Rows,Cols,Options,MRows,MCols>& mat)
|
||||
template<typename MatrixType>
|
||||
static SluMatrix Map(MatrixBase<MatrixType>& _mat)
|
||||
{
|
||||
typedef Matrix<Scalar,Rows,Cols,Options,MRows,MCols> MatrixType;
|
||||
eigen_assert( ((Options&RowMajor)!=RowMajor) && "row-major dense matrices is not supported by SuperLU");
|
||||
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<Scalar>();
|
||||
res.setScalarType<typename MatrixType::Scalar>();
|
||||
res.Mtype = SLU_GE;
|
||||
|
||||
res.nrow = mat.rows();
|
||||
|
Loading…
Reference in New Issue
Block a user