* Find SuperLU also when it is installed without a superlu/ prefix

* Some more CoeffReturnType changes
This commit is contained in:
Benoit Jacob 2009-04-01 14:07:38 +00:00
parent 113fc3a260
commit 0f8e692b3f
6 changed files with 22 additions and 19 deletions

View File

@ -46,21 +46,21 @@
#ifdef EIGEN_SUPERLU_SUPPORT #ifdef EIGEN_SUPERLU_SUPPORT
typedef int int_t; typedef int int_t;
#include "superlu/slu_Cnames.h" #include "slu_Cnames.h"
#include "superlu/supermatrix.h" #include "supermatrix.h"
#include "superlu/slu_util.h" #include "slu_util.h"
namespace SuperLU_S { namespace SuperLU_S {
#include "superlu/slu_sdefs.h" #include "slu_sdefs.h"
} }
namespace SuperLU_D { namespace SuperLU_D {
#include "superlu/slu_ddefs.h" #include "slu_ddefs.h"
} }
namespace SuperLU_C { namespace SuperLU_C {
#include "superlu/slu_cdefs.h" #include "slu_cdefs.h"
} }
namespace SuperLU_Z { namespace SuperLU_Z {
#include "superlu/slu_zdefs.h" #include "slu_zdefs.h"
} }
namespace Eigen { struct SluMatrix; } namespace Eigen { struct SluMatrix; }
#endif #endif

View File

@ -152,7 +152,7 @@ template<typename MatrixType, int BlockRows, int BlockCols, int PacketAccess, in
.coeffRef(row + m_startRow.value(), col + m_startCol.value()); .coeffRef(row + m_startRow.value(), col + m_startCol.value());
} }
inline const Scalar coeff(int row, int col) const inline const CoeffReturnType coeff(int row, int col) const
{ {
return m_matrix.coeff(row + m_startRow.value(), col + m_startCol.value()); return m_matrix.coeff(row + m_startRow.value(), col + m_startCol.value());
} }
@ -164,7 +164,7 @@ template<typename MatrixType, int BlockRows, int BlockCols, int PacketAccess, in
m_startCol.value() + (RowsAtCompileTime == 1 ? index : 0)); m_startCol.value() + (RowsAtCompileTime == 1 ? index : 0));
} }
inline const Scalar coeff(int index) const inline const CoeffReturnType coeff(int index) const
{ {
return m_matrix return m_matrix
.coeff(m_startRow.value() + (RowsAtCompileTime == 1 ? 0 : index), .coeff(m_startRow.value() + (RowsAtCompileTime == 1 ? 0 : index),

View File

@ -54,7 +54,7 @@ template<typename ExpressionType> class NestByValue
inline int cols() const { return m_expression.cols(); } inline int cols() const { return m_expression.cols(); }
inline int stride() const { return m_expression.stride(); } inline int stride() const { return m_expression.stride(); }
inline const Scalar coeff(int row, int col) const inline const CoeffReturnType coeff(int row, int col) const
{ {
return m_expression.coeff(row, col); return m_expression.coeff(row, col);
} }
@ -64,7 +64,7 @@ template<typename ExpressionType> class NestByValue
return m_expression.const_cast_derived().coeffRef(row, col); return m_expression.const_cast_derived().coeffRef(row, col);
} }
inline const Scalar coeff(int index) const inline const CoeffReturnType coeff(int index) const
{ {
return m_expression.coeff(index); return m_expression.coeff(index);
} }

View File

@ -77,21 +77,21 @@ template<typename MatrixType> class Transpose
return m_matrix.const_cast_derived().coeffRef(col, row); return m_matrix.const_cast_derived().coeffRef(col, row);
} }
inline const Scalar coeff(int row, int col) const inline Scalar& coeffRef(int index)
{
return m_matrix.const_cast_derived().coeffRef(index);
}
inline const CoeffReturnType coeff(int row, int col) const
{ {
return m_matrix.coeff(col, row); return m_matrix.coeff(col, row);
} }
inline const Scalar coeff(int index) const inline const CoeffReturnType coeff(int index) const
{ {
return m_matrix.coeff(index); return m_matrix.coeff(index);
} }
inline Scalar& coeffRef(int index)
{
return m_matrix.const_cast_derived().coeffRef(index);
}
template<int LoadMode> template<int LoadMode>
inline const PacketScalar packet(int row, int col) const inline const PacketScalar packet(int row, int col) const
{ {

View File

@ -245,6 +245,7 @@ typedef BaseClass Base; \
typedef typename Eigen::ei_traits<Derived>::Scalar Scalar; \ typedef typename Eigen::ei_traits<Derived>::Scalar Scalar; \
typedef typename Eigen::NumTraits<Scalar>::Real RealScalar; \ typedef typename Eigen::NumTraits<Scalar>::Real RealScalar; \
typedef typename Base::PacketScalar PacketScalar; \ typedef typename Base::PacketScalar PacketScalar; \
typedef typename Base::CoeffReturnType CoeffReturnType; \
typedef typename Eigen::ei_nested<Derived>::type Nested; \ typedef typename Eigen::ei_nested<Derived>::type Nested; \
enum { RowsAtCompileTime = Eigen::ei_traits<Derived>::RowsAtCompileTime, \ enum { RowsAtCompileTime = Eigen::ei_traits<Derived>::RowsAtCompileTime, \
ColsAtCompileTime = Eigen::ei_traits<Derived>::ColsAtCompileTime, \ ColsAtCompileTime = Eigen::ei_traits<Derived>::ColsAtCompileTime, \

View File

@ -9,10 +9,12 @@ if(BLAS_FOUND)
find_path(SUPERLU_INCLUDES find_path(SUPERLU_INCLUDES
NAMES NAMES
superlu/supermatrix.h supermatrix.h
PATHS PATHS
$ENV{SUPERLUDIR} $ENV{SUPERLUDIR}
${INCLUDE_INSTALL_DIR} ${INCLUDE_INSTALL_DIR}
PATH_SUFFIXES
superlu
) )
find_library(SUPERLU_LIBRARIES superlu PATHS $ENV{SUPERLUDIR} ${LIB_INSTALL_DIR}) find_library(SUPERLU_LIBRARIES superlu PATHS $ENV{SUPERLUDIR} ${LIB_INSTALL_DIR})