12 template<
typename Scalar>
void 19 refMat = refMat * refMat.adjoint();
20 for (
int k=0; k<2; ++k)
23 refMat += aux * aux.adjoint();
26 for (
int j=0 ;
j<sparseMat.
cols(); ++
j)
27 for (
int i=
j ;
i<sparseMat.
rows(); ++
i)
35 double density = (
std::max)(8./(rows*cols), 0.01);
40 DenseVector
vec1 = DenseVector::Random(rows);
42 std::vector<Vector2i> zeroCoords;
43 std::vector<Vector2i> nonzeroCoords;
49 DenseMatrix refMat2 = DenseMatrix::Zero(rows, cols);
59 m2.template triangularView<Upper>().solve(vec3));
60 VERIFY_IS_APPROX(refMat2.conjugate().template triangularView<Upper>().solve(vec2),
61 m2.conjugate().template triangularView<Upper>().solve(vec3));
66 VERIFY_IS_APPROX(refMat2.conjugate().template triangularView<Upper>().solve(vec2),
67 mm2.conjugate().template triangularView<Upper>().solve(vec3));
72 VERIFY_IS_APPROX(refMat2.transpose().template triangularView<Upper>().solve(vec2),
73 m2.transpose().template triangularView<Upper>().solve(vec3));
81 DenseMatrix refMatB = DenseMatrix::Zero(rows, rows);
85 initSparse<Scalar>(density, refMatB,
matB);
92 initSparse<Scalar>(density, refMatB,
matB);
93 refMat2.template triangularView<Upper>().solveInPlace(refMatB);
94 m2.template triangularView<Upper>().solveInPlace(matB);
107 CALL_SUBTEST_1(sparse_solvers<double>(8, 8) );
108 int s = internal::random<int>(1,300);
110 CALL_SUBTEST_1(sparse_solvers<double>(s,s) );
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Index cols() const
Matrix< Scalar, Dynamic, Dynamic > DenseMatrix
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Index rows() const
const Scalar * valuePtr() const
void sparse_solvers(int rows, int cols)
Matrix< Scalar, Dynamic, 1 > DenseVector
#define VERIFY_IS_APPROX(a, b)
Scalar & insert(Index row, Index col)
void initSparse(double density, Matrix< Scalar, Dynamic, Dynamic, Opt1 > &refMat, SparseMatrix< Scalar, Opt2, StorageIndex > &sparseMat, int flags=0, std::vector< Matrix< StorageIndex, 2, 1 > > *zeroCoords=0, std::vector< Matrix< StorageIndex, 2, 1 > > *nonzeroCoords=0)
const StorageIndex * outerIndexPtr() const
A triangularView< Lower >().adjoint().solveInPlace(B)
void test_sparse_solvers()
static Vector9 vec3(const Matrix3 &R)
const StorageIndex * innerIndexPtr() const
void initSPD(double density, Matrix< Scalar, Dynamic, Dynamic > &refMat, SparseMatrix< Scalar > &sparseMat)