mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-01-18 14:34:17 +08:00
Fix compilation.
The Matrix is required to be mutable but it also needs to be a reference and temporaries do not bind to non-const references - thus we need a hack and cast away the constness.
This commit is contained in:
parent
51b361b3bb
commit
8f4d93a4b7
@ -426,7 +426,6 @@ struct matrix_function_compute<MatrixType, 1>
|
|||||||
static void run(const MatrixType& A, AtomicType& atomic, ResultType &result)
|
static void run(const MatrixType& A, AtomicType& atomic, ResultType &result)
|
||||||
{
|
{
|
||||||
typedef internal::traits<MatrixType> Traits;
|
typedef internal::traits<MatrixType> Traits;
|
||||||
typedef typename MatrixType::Scalar Scalar;
|
|
||||||
typedef typename MatrixType::Index Index;
|
typedef typename MatrixType::Index Index;
|
||||||
|
|
||||||
// compute Schur decomposition of A
|
// compute Schur decomposition of A
|
||||||
|
@ -97,8 +97,12 @@ void testGeneral(const MatrixType& m, double tol)
|
|||||||
}
|
}
|
||||||
|
|
||||||
template<typename MatrixType>
|
template<typename MatrixType>
|
||||||
void testSingular(const MatrixType& m, double tol)
|
void testSingular(const MatrixType& m_const, double tol)
|
||||||
{
|
{
|
||||||
|
// we need to pass by reference in order to prevent errors with
|
||||||
|
// MSVC for aligned data types ...
|
||||||
|
MatrixType& m = const_cast<MatrixType&>(m_const);
|
||||||
|
|
||||||
const int IsComplex = NumTraits<typename internal::traits<MatrixType>::Scalar>::IsComplex;
|
const int IsComplex = NumTraits<typename internal::traits<MatrixType>::Scalar>::IsComplex;
|
||||||
typedef typename internal::conditional<IsComplex, TriangularView<MatrixType,Upper>, const MatrixType&>::type TriangularType;
|
typedef typename internal::conditional<IsComplex, TriangularView<MatrixType,Upper>, const MatrixType&>::type TriangularType;
|
||||||
typename internal::conditional< IsComplex, ComplexSchur<MatrixType>, RealSchur<MatrixType> >::type schur;
|
typename internal::conditional< IsComplex, ComplexSchur<MatrixType>, RealSchur<MatrixType> >::type schur;
|
||||||
@ -126,8 +130,12 @@ void testSingular(const MatrixType& m, double tol)
|
|||||||
}
|
}
|
||||||
|
|
||||||
template<typename MatrixType>
|
template<typename MatrixType>
|
||||||
void testLogThenExp(const MatrixType& m, double tol)
|
void testLogThenExp(const MatrixType& m_const, double tol)
|
||||||
{
|
{
|
||||||
|
// we need to pass by reference in order to prevent errors with
|
||||||
|
// MSVC for aligned data types ...
|
||||||
|
MatrixType& m = const_cast<MatrixType&>(m_const);
|
||||||
|
|
||||||
typedef typename MatrixType::Scalar Scalar;
|
typedef typename MatrixType::Scalar Scalar;
|
||||||
Scalar x;
|
Scalar x;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user