mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-09-15 02:43:14 +08:00
Use conj_expr_if to clarify what it's doing.
This commit is contained in:
parent
669db3d776
commit
2828c995c5
@ -21,9 +21,10 @@ struct general_rank1_update<Scalar,Index,ColMajor,ConjLhs,ConjRhs>
|
|||||||
{
|
{
|
||||||
static void run(Index rows, Index cols, Scalar* mat, Index stride, const Scalar* u, const Scalar* v, Scalar alpha)
|
static void run(Index rows, Index cols, Scalar* mat, Index stride, const Scalar* u, const Scalar* v, Scalar alpha)
|
||||||
{
|
{
|
||||||
internal::conj_if<ConjRhs> cj;
|
|
||||||
typedef Map<const Matrix<Scalar,Dynamic,1> > OtherMap;
|
typedef Map<const Matrix<Scalar,Dynamic,1> > OtherMap;
|
||||||
typedef typename internal::conditional<ConjLhs,typename OtherMap::ConjugateReturnType,const OtherMap&>::type ConjRhsType;
|
typedef typename conj_expr_if<ConjLhs,OtherMap>::type ConjRhsType;
|
||||||
|
conj_if<ConjRhs> cj;
|
||||||
|
|
||||||
for (Index i=0; i<cols; ++i)
|
for (Index i=0; i<cols; ++i)
|
||||||
Map<Matrix<Scalar,Dynamic,1> >(mat+stride*i,rows) += alpha * cj(v[i]) * ConjRhsType(OtherMap(u,rows));
|
Map<Matrix<Scalar,Dynamic,1> >(mat+stride*i,rows) += alpha * cj(v[i]) * ConjRhsType(OtherMap(u,rows));
|
||||||
}
|
}
|
||||||
|
@ -17,9 +17,9 @@ namespace internal {
|
|||||||
*
|
*
|
||||||
* FIXME I always fail tests for complex self-adjoint matrices.
|
* FIXME I always fail tests for complex self-adjoint matrices.
|
||||||
*
|
*
|
||||||
******* FATAL ERROR - PARAMETER NUMBER 6 WAS CHANGED INCORRECTLY *******
|
* ******* FATAL ERROR - PARAMETER NUMBER 6 WAS CHANGED INCORRECTLY *******
|
||||||
******* xHPR FAILED ON CALL NUMBER:
|
* ******* xHPR FAILED ON CALL NUMBER:
|
||||||
2: xHPR ('U', 1, 0.0, X, 1, AP)
|
* 2: xHPR ('U', 1, 0.0, X, 1, AP)
|
||||||
*/
|
*/
|
||||||
template<typename Scalar, typename Index, int StorageOrder, int UpLo, bool ConjLhs, bool ConjRhs>
|
template<typename Scalar, typename Index, int StorageOrder, int UpLo, bool ConjLhs, bool ConjRhs>
|
||||||
struct selfadjoint_packed_rank1_update;
|
struct selfadjoint_packed_rank1_update;
|
||||||
@ -29,9 +29,9 @@ struct selfadjoint_packed_rank1_update<Scalar,Index,ColMajor,UpLo,ConjLhs,ConjRh
|
|||||||
{
|
{
|
||||||
static void run(Index size, Scalar* mat, const Scalar* vec, Scalar alpha)
|
static void run(Index size, Scalar* mat, const Scalar* vec, Scalar alpha)
|
||||||
{
|
{
|
||||||
internal::conj_if<ConjRhs> cj;
|
|
||||||
typedef Map<const Matrix<Scalar,Dynamic,1> > OtherMap;
|
typedef Map<const Matrix<Scalar,Dynamic,1> > OtherMap;
|
||||||
typedef typename internal::conditional<ConjLhs,typename OtherMap::ConjugateReturnType,const OtherMap&>::type ConjRhsType;
|
typedef typename conj_expr_if<ConjLhs,OtherMap>::type ConjRhsType;
|
||||||
|
conj_if<ConjRhs> cj;
|
||||||
Index offset = 0;
|
Index offset = 0;
|
||||||
|
|
||||||
for (Index i=0; i<size; ++i)
|
for (Index i=0; i<size; ++i)
|
||||||
|
@ -242,8 +242,8 @@ int EIGEN_BLAS_FUNC(spr)(char *uplo, int *n, Scalar *palpha, Scalar *px, int *in
|
|||||||
for(int k=0; k<2; ++k)
|
for(int k=0; k<2; ++k)
|
||||||
func[k] = 0;
|
func[k] = 0;
|
||||||
|
|
||||||
func[UP] = (internal::selfadjoint_packed_rank1_update<Scalar,int,ColMajor,Upper,false,Conj>::run);
|
func[UP] = (internal::selfadjoint_packed_rank1_update<Scalar,int,ColMajor,Upper,false,false>::run);
|
||||||
func[LO] = (internal::selfadjoint_packed_rank1_update<Scalar,int,ColMajor,Lower,false,Conj>::run);
|
func[LO] = (internal::selfadjoint_packed_rank1_update<Scalar,int,ColMajor,Lower,false,false>::run);
|
||||||
|
|
||||||
init = true;
|
init = true;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user