mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-09-15 02:43:14 +08:00
Use an aligned IOFormat in the docs
This commit is contained in:
parent
2b20da624a
commit
93c1f62979
@ -118,6 +118,10 @@ using Eigen::ei_cos;
|
|||||||
#define EIGEN_DEFAULT_IO_FORMAT Eigen::IOFormat()
|
#define EIGEN_DEFAULT_IO_FORMAT Eigen::IOFormat()
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
// format used in Eigen's documentation
|
||||||
|
// needed to define it here as escaping characters in CMake add_definition's argument seems very problematic.
|
||||||
|
#define EIGEN_DOCS_IO_FORMAT IOFormat(3, AlignCols, " ", "\n", "", "")
|
||||||
|
|
||||||
#define EIGEN_INHERIT_ASSIGNMENT_OPERATOR(Derived, Op) \
|
#define EIGEN_INHERIT_ASSIGNMENT_OPERATOR(Derived, Op) \
|
||||||
template<typename OtherDerived> \
|
template<typename OtherDerived> \
|
||||||
Derived& operator Op(const Eigen::MatrixBase<OtherDerived>& other) \
|
Derived& operator Op(const Eigen::MatrixBase<OtherDerived>& other) \
|
||||||
|
@ -25,6 +25,8 @@ configure_file(
|
|||||||
set(examples_targets "")
|
set(examples_targets "")
|
||||||
set(snippets_targets "")
|
set(snippets_targets "")
|
||||||
|
|
||||||
|
add_definitions("-DEIGEN_DEFAULT_IO_FORMAT=EIGEN_DOCS_IO_FORMAT")
|
||||||
|
|
||||||
add_subdirectory(examples)
|
add_subdirectory(examples)
|
||||||
add_subdirectory(snippets)
|
add_subdirectory(snippets)
|
||||||
|
|
||||||
|
@ -158,8 +158,11 @@ Eigen::LUDecomposition<MatrixXf> lu(A);
|
|||||||
cout << "The rank of A is" << lu.rank() << endl;
|
cout << "The rank of A is" << lu.rank() << endl;
|
||||||
if(lu.isInvertible()) {
|
if(lu.isInvertible()) {
|
||||||
cout << "A is invertible, its inverse is:" << endl << lu.inverse() << endl;
|
cout << "A is invertible, its inverse is:" << endl << lu.inverse() << endl;
|
||||||
cout << "Here's a matrix whose columns form a basis of the kernel a.k.a. nullspace of A:"
|
}
|
||||||
<< endl << lu.kernel() << endl;
|
else {
|
||||||
|
cout << "Here's a matrix whose columns form a basis of the kernel a.k.a. nullspace of A:"
|
||||||
|
<< endl << lu.kernel() << endl;
|
||||||
|
}
|
||||||
\endcode
|
\endcode
|
||||||
|
|
||||||
\sa LU_Module, LU::solve(), class LU
|
\sa LU_Module, LU::solve(), class LU
|
||||||
|
@ -4,13 +4,11 @@
|
|||||||
#include <Eigen/Cholesky>
|
#include <Eigen/Cholesky>
|
||||||
#include <Eigen/Geometry>
|
#include <Eigen/Geometry>
|
||||||
|
|
||||||
USING_PART_OF_NAMESPACE_EIGEN
|
|
||||||
using namespace Eigen;
|
using namespace Eigen;
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
||||||
int main(int, char**)
|
int main(int, char**)
|
||||||
{
|
{
|
||||||
cout.precision(3);
|
|
||||||
${snippet_source_code}
|
${snippet_source_code}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user