mirror of
https://gitlab.com/libeigen/eigen.git
synced 2024-12-21 07:19:46 +08:00
Revert vec/y to vec*(1/y) in row-major TRSM:
- div is extremely costly - this is consistent with the column-major case - this is consistent with all other BLAS implementations
This commit is contained in:
parent
8365c2c941
commit
eb621413c1
@ -183,7 +183,7 @@ EIGEN_DONT_INLINE void triangular_solve_matrix<Scalar,Index,OnTheLeft,Mode,Conju
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Optimized triangular solver with multiple left hand sides and the trinagular matrix on the right
|
/* Optimized triangular solver with multiple left hand sides and the triangular matrix on the right
|
||||||
*/
|
*/
|
||||||
template <typename Scalar, typename Index, int Mode, bool Conjugate, int TriStorageOrder>
|
template <typename Scalar, typename Index, int Mode, bool Conjugate, int TriStorageOrder>
|
||||||
struct triangular_solve_matrix<Scalar,Index,OnTheRight,Mode,Conjugate,TriStorageOrder,ColMajor>
|
struct triangular_solve_matrix<Scalar,Index,OnTheRight,Mode,Conjugate,TriStorageOrder,ColMajor>
|
||||||
@ -202,6 +202,7 @@ EIGEN_DONT_INLINE void triangular_solve_matrix<Scalar,Index,OnTheRight,Mode,Conj
|
|||||||
level3_blocking<Scalar,Scalar>& blocking)
|
level3_blocking<Scalar,Scalar>& blocking)
|
||||||
{
|
{
|
||||||
Index rows = otherSize;
|
Index rows = otherSize;
|
||||||
|
typedef typename NumTraits<Scalar>::Real RealScalar;
|
||||||
|
|
||||||
typedef blas_data_mapper<Scalar, Index, ColMajor> LhsMapper;
|
typedef blas_data_mapper<Scalar, Index, ColMajor> LhsMapper;
|
||||||
typedef const_blas_data_mapper<Scalar, Index, TriStorageOrder> RhsMapper;
|
typedef const_blas_data_mapper<Scalar, Index, TriStorageOrder> RhsMapper;
|
||||||
@ -306,9 +307,9 @@ EIGEN_DONT_INLINE void triangular_solve_matrix<Scalar,Index,OnTheRight,Mode,Conj
|
|||||||
}
|
}
|
||||||
if((Mode & UnitDiag)==0)
|
if((Mode & UnitDiag)==0)
|
||||||
{
|
{
|
||||||
Scalar b = conj(rhs(j,j));
|
Scalar inv_rjj = RealScalar(1)/conj(rhs(j,j));
|
||||||
for (Index i=0; i<actual_mc; ++i)
|
for (Index i=0; i<actual_mc; ++i)
|
||||||
r[i] /= b;
|
r[i] *= inv_rjj;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user