mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-04-20 16:49:38 +08:00
now gemv supports strides
This commit is contained in:
parent
157a5040d5
commit
6e67d15795
@ -167,11 +167,9 @@ template<typename XprType> struct blas_traits
|
|||||||
IsTransposed = false,
|
IsTransposed = false,
|
||||||
NeedToConjugate = false,
|
NeedToConjugate = false,
|
||||||
HasUsableDirectAccess = ( (int(XprType::Flags)&DirectAccessBit)
|
HasUsableDirectAccess = ( (int(XprType::Flags)&DirectAccessBit)
|
||||||
&& ( /* Uncomment this when the low-level matrix-vector product functions support strided vectors
|
&& ( bool(XprType::IsVectorAtCompileTime)
|
||||||
bool(XprType::IsVectorAtCompileTime)
|
|| int(inner_stride_at_compile_time<XprType>::ret) == 1)
|
||||||
|| */
|
) ? 1 : 0
|
||||||
int(inner_stride_at_compile_time<XprType>::ret) == 1)
|
|
||||||
) ? 1 : 0
|
|
||||||
};
|
};
|
||||||
typedef typename conditional<bool(HasUsableDirectAccess),
|
typedef typename conditional<bool(HasUsableDirectAccess),
|
||||||
ExtractType,
|
ExtractType,
|
||||||
|
@ -60,7 +60,7 @@ template<typename MatrixType> void product_notemporary(const MatrixType& m)
|
|||||||
m2 = MatrixType::Random(rows, cols),
|
m2 = MatrixType::Random(rows, cols),
|
||||||
m3(rows, cols);
|
m3(rows, cols);
|
||||||
RowVectorType rv1 = RowVectorType::Random(rows), rvres(rows);
|
RowVectorType rv1 = RowVectorType::Random(rows), rvres(rows);
|
||||||
ColVectorType vc2 = ColVectorType::Random(cols), cvres(cols);
|
ColVectorType cv1 = ColVectorType::Random(cols), cvres(cols);
|
||||||
RowMajorMatrixType rm3(rows, cols);
|
RowMajorMatrixType rm3(rows, cols);
|
||||||
|
|
||||||
Scalar s1 = internal::random<Scalar>(),
|
Scalar s1 = internal::random<Scalar>(),
|
||||||
@ -128,6 +128,13 @@ template<typename MatrixType> void product_notemporary(const MatrixType& m)
|
|||||||
// Zero temporaries for ... CoeffBasedProductMode
|
// Zero temporaries for ... CoeffBasedProductMode
|
||||||
// - does not work with GCC because of the <..>, we'ld need variadic macros ...
|
// - does not work with GCC because of the <..>, we'ld need variadic macros ...
|
||||||
//VERIFY_EVALUATION_COUNT( m3.col(0).head<5>() * m3.col(0).transpose() + m3.col(0).head<5>() * m3.col(0).transpose(), 0 );
|
//VERIFY_EVALUATION_COUNT( m3.col(0).head<5>() * m3.col(0).transpose() + m3.col(0).head<5>() * m3.col(0).transpose(), 0 );
|
||||||
|
|
||||||
|
// Check matrix * vectors
|
||||||
|
VERIFY_EVALUATION_COUNT( cvres.noalias() = m1 * cv1, 0 );
|
||||||
|
VERIFY_EVALUATION_COUNT( cvres.noalias() -= m1 * cv1, 0 );
|
||||||
|
VERIFY_EVALUATION_COUNT( cvres.noalias() -= m1 * m2.col(0), 0 );
|
||||||
|
VERIFY_EVALUATION_COUNT( cvres.noalias() -= m1 * rv1.adjoint(), 0 );
|
||||||
|
VERIFY_EVALUATION_COUNT( cvres.noalias() -= m1 * m2.row(0).transpose(), 0 );
|
||||||
}
|
}
|
||||||
|
|
||||||
void test_product_notemporary()
|
void test_product_notemporary()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user