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);
Matrix< SCALARB, Dynamic, Dynamic, opt_B > B
HouseholderQR & compute(const EigenBase< InputType > &matrix)
Robust Cholesky decomposition of a matrix with pivoting.
const Solve< LLT< _MatrixType, _UpLo >, Rhs > solve(const MatrixBase< Rhs > &b) const
#define VERIFY_RAISES_ASSERT(a)
#define CALL_SUBTEST_6(FUNC)
#define CALL_SUBTEST_4(FUNC)
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)
#define CALL_SUBTEST_3(FUNC)
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.
#define CALL_SUBTEST_7(FUNC)
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.
Matrix< SCALARA, Dynamic, Dynamic, opt_A > A
ComplexSchur & compute(const EigenBase< InputType > &matrix, bool computeU=true)
Computes Schur decomposition of given matrix.
EIGEN_DECLARE_TEST(nomalloc)
FullPivHouseholderQR & compute(const EigenBase< InputType > &matrix)
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.
#define CALL_SUBTEST_1(FUNC)
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.
Array< int, Dynamic, 1 > v
#define CALL_SUBTEST_8(FUNC)
A matrix or vector expression mapping an existing expression.
#define CALL_SUBTEST_5(FUNC)
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)
#define CALL_SUBTEST_2(FUNC)
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.
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()