Go to the documentation of this file.
10 #include <Eigen/SparseQR>
12 template<
typename MatrixType,
typename DenseMat>
17 int rows = internal::random<int>(1,maxRows);
18 int cols = internal::random<int>(1,maxCols);
25 int nop = internal::random<int>(0, internal::random<double>(0,1) > 0.5 ?
cols/2 : 0);
26 for(
int k=0; k<nop; ++k)
28 int j0 = internal::random<int>(0,
cols-1);
29 int j1 = internal::random<int>(0,
cols-1);
30 Scalar s = internal::random<Scalar>();
32 dA.col(
j0) =
s * dA.col(
j1);
56 b = dA * DenseVector::Random(
A.cols());
68 DenseMat recoveredA =
solver.matrixQ()
69 * DenseMat(
solver.matrixR().template triangularView<Upper>())
70 *
solver.colsPermutation().transpose();
80 if(internal::random<float>(0,1)>0.5
f)
84 std::cerr <<
"sparse QR factorization failed\n";
91 std::cerr <<
"sparse QR factorization failed\n";
100 bool rank_deficient =
A.cols()>
A.rows() || dqr.
rank()<
A.cols();
109 solver.setPivotThreshold(th);
132 QtQ =
Q *
Q.adjoint();
133 idM.resize(
Q.rows(),
Q.rows()); idM.setIdentity();
134 VERIFY(idM.isApprox(QtQ));
#define VERIFY_IS_EQUAL(a, b)
set noclip points set clip one set noclip two set bar set border lt lw set xdata set ydata set zdata set x2data set y2data set boxwidth set dummy x
int generate_sparse_rectangular_problem(MatrixType &A, DenseMat &dA, int maxRows=300, int maxCols=150)
BiCGSTAB< SparseMatrix< double > > solver
Matrix< SCALARA, Dynamic, Dynamic, opt_A > A
bool test_isApprox(const AnnoyingScalar &a, const AnnoyingScalar &b)
#define CALL_SUBTEST_1(FUNC)
Householder rank-revealing QR decomposition of a matrix with column-pivoting.
#define CALL_SUBTEST_2(FUNC)
Matrix< Scalar, Dynamic, 1 > DenseVector
Point2(* f)(const Point3 &, OptionalJacobian< 2, 3 >)
#define VERIFY_IS_APPROX(a, b)
NumTraits< Scalar >::Real RealScalar
The quaternion class used to represent 3D orientations and rotations.
void test_sparseqr_scalar()
EIGEN_DECLARE_TEST(sparseqr)
Sparse left-looking QR factorization with numerical column pivoting.
Holds information about the various numeric (i.e. scalar) types allowed by Eigen.
EIGEN_DEFAULT_DENSE_INDEX_TYPE Index
The Index type as used for the API.
gtsam
Author(s):
autogenerated on Fri Nov 1 2024 03:36:01