15 template<
typename MatrixType>
17 return m.cwiseAbs().colwise().sum().maxCoeff();
29 if(MatrixType::RowsAtCompileTime==
Dynamic)
35 rows = MatrixType::RowsAtCompileTime;
37 if(MatrixType::ColsAtCompileTime==
Dynamic)
44 cols2 = cols = MatrixType::ColsAtCompileTime;
48 RowsAtCompileTime = MatrixType::RowsAtCompileTime,
49 ColsAtCompileTime = MatrixType::ColsAtCompileTime
51 typedef typename internal::kernel_retval_base<FullPivLU<MatrixType> >::ReturnType KernelMatrixType;
52 typedef typename internal::image_retval_base<FullPivLU<MatrixType> >::ReturnType ImageMatrixType;
58 Index rank = internal::random<Index>(1, (
std::min)(rows, cols)-1);
61 VERIFY((MatrixType::Zero(rows,cols).fullPivLu().image(MatrixType::Zero(rows,cols)).
cols() == 1));
64 KernelMatrixType kernel = MatrixType::Zero(rows,cols).fullPivLu().kernel();
65 VERIFY((kernel.fullPivLu().isInvertible()));
68 CMatrixType
m2(cols, cols2);
80 u = lu.
matrixLU().template triangularView<Upper>();
81 RMatrixType
l = RMatrixType::Identity(rows,rows);
82 l.block(0,0,rows,(
std::min)(rows,cols)).template triangularView<StrictlyLower>()
87 KernelMatrixType m1kernel = lu.
kernel();
88 ImageMatrixType m1image = lu.
image(
m1);
97 VERIFY(m1image.fullPivLu().rank() == rank);
100 check_solverbase<CMatrixType, MatrixType>(
m1,
lu,
rows,
cols, cols2);
102 m2 = CMatrixType::Random(cols,cols2);
104 m2 = CMatrixType::Random(cols,cols2);
106 m2.block(0,0,m2.rows(),m2.cols()) = lu.solve(m3);
116 Index size = MatrixType::RowsAtCompileTime;
124 m1 = MatrixType::Random(size,size);
140 m3 = MatrixType::Random(size,size);
145 const RealScalar rcond_est = lu.rcond();
148 VERIFY(rcond_est > rcond / 10 && rcond_est < rcond * 10);
151 MatrixType m4 = MatrixType::Random(size,size);
170 check_solverbase<MatrixType, MatrixType>(
m1, plu,
size,
size,
size);
173 m3 = MatrixType::Random(size,size);
178 const RealScalar rcond_est = plu.rcond();
180 VERIFY(rcond_est > rcond / 10 && rcond_est < rcond * 10);
const Solve< FullPivLU< _MatrixType >, Rhs > solve(const MatrixBase< Rhs > &b) const
#define VERIFY_RAISES_ASSERT(a)
#define CALL_SUBTEST_9(FUNC)
const internal::image_retval< FullPivLU > image(const MatrixType &originalMatrix) const
#define CALL_SUBTEST_6(FUNC)
#define CALL_SUBTEST_4(FUNC)
FullPivLU & setThreshold(const RealScalar &threshold)
#define CALL_SUBTEST_3(FUNC)
#define CALL_SUBTEST_7(FUNC)
FullPivLU & compute(const EigenBase< InputType > &matrix)
const PermutationQType & permutationQ() const
MatrixType reconstructedMatrix() const
#define STATIC_CHECK(COND)
LU decomposition of a matrix with partial pivoting, and related features.
Holds information about the various numeric (i.e. scalar) types allowed by Eigen. ...
void lu_partial_piv(Index size=MatrixType::ColsAtCompileTime)
#define VERIFY_IS_APPROX(a, b)
static const Line3 l(Rot3(), 1, 1)
internal::traits< MatrixType >::Scalar determinant() const
const MatrixType & matrixLU() const
#define CALL_SUBTEST_1(FUNC)
ConstTransposeReturnType transpose() const
EIGEN_DEFAULT_DENSE_INDEX_TYPE Index
The Index type as used for the API.
const Inverse< FullPivLU > inverse() const
bool isSurjective() const
MatrixType reconstructedMatrix() const
cout<< "Here is the matrix m:"<< endl<< m<< endl;Eigen::FullPivLU< Matrix5x3 > lu(m)
NumTraits< Scalar >::Real RealScalar
bool isInvertible() const
#define VERIFY_IS_MUCH_SMALLER_THAN(a, b)
const internal::kernel_retval< FullPivLU > kernel() const
#define CALL_SUBTEST_5(FUNC)
#define EIGEN_TEST_MAX_SIZE
LU decomposition of a matrix with complete pivoting, and related features.
MatrixType::RealScalar matrix_l1_norm(const MatrixType &m)
void createRandomPIMatrixOfRank(Index desired_rank, Index rows, Index cols, MatrixType &m)
EIGEN_DEVICE_FUNC const PermutationPType & permutationP() const
#define CALL_SUBTEST_2(FUNC)
Index dimensionOfKernel() const
The matrix class, also used for vectors and row-vectors.
AdjointReturnType adjoint() const