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)
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);
105 refMatB.resize(0,refMatB.cols());
121 int s = internal::random<int>(1,300);
EIGEN_DECLARE_TEST(sparse_solvers)
Matrix< Scalar, Dynamic, Dynamic > DenseMatrix
const StorageIndex * outerIndexPtr() const
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE EIGEN_CONSTEXPR Index rows() const EIGEN_NOEXCEPT
void sparse_solvers(int rows, int cols)
cout<< "Here is the matrix m:"<< endl<< m<< endl;Matrix< ptrdiff_t, 3, 1 > res
Matrix< Scalar, Dynamic, 1 > DenseVector
#define VERIFY_IS_APPROX(a, b)
#define VERIFY_IS_EQUAL(a, b)
#define CALL_SUBTEST_1(FUNC)
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 * innerIndexPtr() const
A triangularView< Lower >().adjoint().solveInPlace(B)
static Vector9 vec3(const Matrix3 &R)
#define CALL_SUBTEST_2(FUNC)
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE EIGEN_CONSTEXPR Index cols() const EIGEN_NOEXCEPT
void initSPD(double density, Matrix< Scalar, Dynamic, Dynamic > &refMat, SparseMatrix< Scalar > &sparseMat)
const Scalar * valuePtr() const