12 #define EIGEN_STACK_ALLOCATION_LIMIT 0 14 #define EIGEN_RUNTIME_NO_MALLOC 17 #include <Eigen/Cholesky> 18 #include <Eigen/Eigenvalues> 33 m2 = MatrixType::Random(rows, cols),
36 Scalar s1 = internal::random<Scalar>();
38 Index r = internal::random<Index>(0, rows-1),
39 c = internal::random<Index>(0, cols-1);
46 m2.col(0).noalias() = m1 * m1.col(0);
47 m2.col(0).noalias() -= m1.adjoint() * m1.col(0);
48 m2.col(0).noalias() -= m1 * m1.row(0).adjoint();
49 m2.col(0).noalias() -= m1.adjoint() * m1.row(0).adjoint();
51 m2.row(0).noalias() = m1.row(0) *
m1;
52 m2.row(0).noalias() -= m1.row(0) * m1.adjoint();
53 m2.row(0).noalias() -= m1.col(0).adjoint() *
m1;
54 m2.row(0).noalias() -= m1.col(0).adjoint() * m1.adjoint();
57 m2.col(0).noalias() = m1.template triangularView<Upper>() * m1.col(0);
58 m2.col(0).noalias() -= m1.adjoint().template triangularView<Upper>() * m1.col(0);
59 m2.col(0).noalias() -= m1.template triangularView<Upper>() * m1.row(0).adjoint();
60 m2.col(0).noalias() -= m1.adjoint().template triangularView<Upper>() * m1.row(0).adjoint();
62 m2.row(0).noalias() = m1.row(0) * m1.template triangularView<Upper>();
63 m2.row(0).noalias() -= m1.row(0) * m1.adjoint().template triangularView<Upper>();
64 m2.row(0).noalias() -= m1.col(0).adjoint() * m1.template triangularView<Upper>();
65 m2.row(0).noalias() -= m1.col(0).adjoint() * m1.adjoint().template triangularView<Upper>();
68 m2.col(0).noalias() = m1.template selfadjointView<Upper>() * m1.col(0);
69 m2.col(0).noalias() -= m1.adjoint().template selfadjointView<Upper>() * m1.col(0);
70 m2.col(0).noalias() -= m1.template selfadjointView<Upper>() * m1.row(0).adjoint();
71 m2.col(0).noalias() -= m1.adjoint().template selfadjointView<Upper>() * m1.row(0).adjoint();
73 m2.row(0).noalias() = m1.row(0) * m1.template selfadjointView<Upper>();
74 m2.row(0).noalias() -= m1.row(0) * m1.adjoint().template selfadjointView<Upper>();
75 m2.row(0).noalias() -= m1.col(0).adjoint() * m1.template selfadjointView<Upper>();
76 m2.row(0).noalias() -= m1.col(0).adjoint() * m1.adjoint().template selfadjointView<Upper>();
79 m2.template selfadjointView<Lower>().rankUpdate(m1.col(0),-1);
80 m2.template selfadjointView<Upper>().rankUpdate(m1.row(0),-1);
81 m2.template selfadjointView<Lower>().rankUpdate(m1.col(0), m1.col(0));
84 m2.template selfadjointView<Lower>().rankUpdate(m1);
85 m2 += m2.template triangularView<Upper>() * m1;
86 m2.template triangularView<Upper>() = m2 * m2;
87 m1 += m1.template selfadjointView<Lower>() * m2;
91 template<
typename Scalar>
94 const int maxSize = 16;
110 maxSize, maxSize> ComplexMatrix;
112 const Matrix
A(Matrix::Random(size, size)),
B(Matrix::Random(size, size));
114 const ComplexMatrix complexA(ComplexMatrix::Random(size, size));
115 const Matrix saA =
A.adjoint() *
A;
116 const Vector
b(Vector::Random(size));
163 Eigen::ArrayXXd A0(0,0);
164 Eigen::ArrayXd
v0(0);
183 Ref
r2(m.block(rows/3,
cols/4, rows/2,
cols/2));
184 RefT
r3(m.transpose());
185 RefT r4(m.topLeftCorner(rows/2,
cols/2).transpose());
208 Eigen::MatrixXd
M1 = MatrixXd::Random(3,3);
212 Eigen::internal::set_is_malloc_allowed(
false);
217 CALL_SUBTEST_2(
nomalloc(Matrix4d()) );
221 CALL_SUBTEST_4(ctms_decompositions<float>());
HouseholderQR & compute(const EigenBase< InputType > &matrix)
Robust Cholesky decomposition of a matrix with pivoting.
#define VERIFY_RAISES_ASSERT(a)
EigenSolver & compute(const EigenBase< InputType > &matrix, bool computeEigenvectors=true)
Computes eigendecomposition of given matrix.
PartialPivLU & compute(const EigenBase< InputType > &matrix)
Householder rank-revealing QR decomposition of a matrix with full pivoting.
LDLT & compute(const EigenBase< InputType > &matrix)
const Solve< ColPivHouseholderQR, Rhs > solve(const MatrixBase< Rhs > &b) const
ComplexEigenSolver & compute(const EigenBase< InputType > &matrix, bool computeEigenvectors=true)
Computes eigendecomposition of given matrix.
EIGEN_DEVICE_FUNC SelfAdjointEigenSolver & compute(const EigenBase< InputType > &matrix, int options=ComputeEigenvectors)
Computes eigendecomposition of given matrix.
FullPivLU & compute(const EigenBase< InputType > &matrix)
Computes eigenvalues and eigenvectors of selfadjoint matrices.
LU decomposition of a matrix with partial pivoting, and related features.
Tridiagonalization & compute(const EigenBase< InputType > &matrix)
Computes tridiagonal decomposition of given matrix.
void nomalloc(const MatrixType &m)
Tridiagonal decomposition of a selfadjoint matrix.
const Solve< LLT, Rhs > solve(const MatrixBase< Rhs > &b) const
Matrix< SCALARA, Dynamic, Dynamic > A
Matrix< SCALARB, Dynamic, Dynamic > B
ComplexSchur & compute(const EigenBase< InputType > &matrix, bool computeU=true)
Computes Schur decomposition of given matrix.
FullPivHouseholderQR & compute(const EigenBase< InputType > &matrix)
const Solve< FullPivHouseholderQR, Rhs > solve(const MatrixBase< Rhs > &b) const
void test_reference(const MatrixType &m)
#define VERIFY_IS_APPROX(a, b)
ColPivHouseholderQR & compute(const EigenBase< InputType > &matrix)
HessenbergDecomposition & compute(const EigenBase< InputType > &matrix)
Computes Hessenberg decomposition of given matrix.
Householder rank-revealing QR decomposition of a matrix with column-pivoting.
Standard Cholesky decomposition (LL^T) of a matrix and associated features.
EIGEN_DEFAULT_DENSE_INDEX_TYPE Index
The Index type as used for the API.
Q R1(Eigen::AngleAxisd(1, Q_z_axis))
A matrix or vector expression mapping an existing expression.
const Solve< LDLT, Rhs > solve(const MatrixBase< Rhs > &b) const
Reduces a square matrix to Hessenberg form by an orthogonal similarity transformation.
LU decomposition of a matrix with complete pivoting, and related features.
Householder QR decomposition of a matrix.
Two-sided Jacobi SVD decomposition of a rectangular matrix.
JacobiSVD & compute(const MatrixType &matrix, unsigned int computationOptions)
Method performing the decomposition of given matrix using custom options.
LLT & compute(const EigenBase< InputType > &matrix)
const Solve< HouseholderQR, Rhs > solve(const MatrixBase< Rhs > &b) const
Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic, Eigen::RowMajor > Matrix
Computes eigenvalues and eigenvectors of general matrices.
Map< Matrix< T, Dynamic, Dynamic, ColMajor >, 0, OuterStride<> > matrix(T *data, int rows, int cols, int stride)
The matrix class, also used for vectors and row-vectors.
const Solve< PartialPivLU, Rhs > solve(const MatrixBase< Rhs > &b) const
Performs a complex Schur decomposition of a real or complex square matrix.
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
Computes eigenvalues and eigenvectors of general complex matrices.
Eigen::Matrix< double, Eigen::Dynamic, 1 > Vector
void ctms_decompositions()
Q R2(Eigen::AngleAxisd(2, Vector3(0, 1, 0)))
const Solve< FullPivLU, Rhs > solve(const MatrixBase< Rhs > &b) const