mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-08-11 11:19:02 +08:00
Fix #69 for the second time, and add the respective regression test
This commit is contained in:
parent
80d1f9e966
commit
826bff58c6
@ -25,13 +25,27 @@
|
||||
#ifndef EIGEN_SOLVETRIANGULAR_H
|
||||
#define EIGEN_SOLVETRIANGULAR_H
|
||||
|
||||
template<typename Lhs, typename Rhs, int Side>
|
||||
class ei_trsolve_traits
|
||||
{
|
||||
private:
|
||||
enum {
|
||||
RhsIsVectorAtCompileTime = (Side==OnTheLeft ? Rhs::ColsAtCompileTime : Rhs::RowsAtCompileTime)==1
|
||||
};
|
||||
public:
|
||||
enum {
|
||||
Unrolling = (RhsIsVectorAtCompileTime && Rhs::SizeAtCompileTime <= 8)
|
||||
? CompleteUnrolling : NoUnrolling,
|
||||
RhsVectors = RhsIsVectorAtCompileTime ? 1 : Dynamic
|
||||
};
|
||||
};
|
||||
|
||||
template<typename Lhs, typename Rhs,
|
||||
int Mode, // can be Upper/Lower | UnitDiag
|
||||
int Side, // can be OnTheLeft/OnTheRight
|
||||
int Unrolling = Rhs::IsVectorAtCompileTime && Rhs::SizeAtCompileTime <= 8 // FIXME
|
||||
? CompleteUnrolling : NoUnrolling,
|
||||
int Mode, // can be Upper/Lower | UnitDiag
|
||||
int Unrolling = ei_trsolve_traits<Lhs,Rhs,Side>::Unrolling,
|
||||
int StorageOrder = (int(Lhs::Flags) & RowMajorBit) ? RowMajor : ColMajor,
|
||||
int RhsVectors = Rhs::IsVectorAtCompileTime ? 1 : Dynamic
|
||||
int RhsVectors = ei_trsolve_traits<Lhs,Rhs,Side>::RhsVectors
|
||||
>
|
||||
struct ei_triangular_solver_selector;
|
||||
|
||||
|
@ -84,6 +84,7 @@ void test_product_trsolve()
|
||||
// vectors
|
||||
CALL_SUBTEST_3((trsolve<std::complex<double>,Dynamic,1>(ei_random<int>(1,320))));
|
||||
CALL_SUBTEST_4((trsolve<float,1,1>()));
|
||||
CALL_SUBTEST_5((trsolve<std::complex<float>,4,1>()));
|
||||
CALL_SUBTEST_5((trsolve<float,1,2>()));
|
||||
CALL_SUBTEST_6((trsolve<std::complex<float>,4,1>()));
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user