mirror of
https://gitlab.com/libeigen/eigen.git
synced 2026-04-10 11:34:33 +08:00
Add cholesky's members to MatrixBase
Various documentation improvements including new snippets (AngleAxis and Cholesky)
This commit is contained in:
@@ -199,6 +199,7 @@ TAB_SIZE = 8
|
||||
ALIASES = "only_for_vectors=This is only for vectors (either row-vectors or column-vectors), i.e. matrices which are known at compile-time to have either one row or one column." \
|
||||
"array_module=This is defined in the %Array module. \code #include <Eigen/Array> \endcode" \
|
||||
"lu_module=This is defined in the %LU module. \code #include <Eigen/LU> \endcode" \
|
||||
"cholesky_module=This is defined in the %Cholesky module. \code #include <Eigen/Cholesky> \endcode" \
|
||||
"qr_module=This is defined in the %QR module. \code #include <Eigen/QR> \endcode" \
|
||||
"geometry_module=This is defined in the %Geometry module. \code #include <Eigen/Geometry> \endcode" \
|
||||
"addexample=\anchor" \
|
||||
|
||||
@@ -4,7 +4,7 @@ echo "namespace Eigen {"
|
||||
echo "/** \page ExampleList"
|
||||
echo "<h1>Selected list of examples</h1>"
|
||||
|
||||
grep \\addexample $1/Eigen/* -R | cut -d \\ -f 2- | \
|
||||
grep \\addexample $1/Eigen/src/*/*.h -R | cut -d \\ -f 2- | \
|
||||
while read example;
|
||||
do
|
||||
anchor=`echo "$example" | cut -d " " -f 2`
|
||||
|
||||
4
doc/snippets/AngleAxis_mimic_euler.cpp
Normal file
4
doc/snippets/AngleAxis_mimic_euler.cpp
Normal file
@@ -0,0 +1,4 @@
|
||||
Matrix3f m = AngleAxisf(0.25*M_PI, Vector3f::UnitX())
|
||||
* AngleAxisf(0.5*M_PI, Vector3f::UnitY())
|
||||
* AngleAxisf(0.33*M_PI, Vector3f::UnitZ());
|
||||
cout << m << endl;
|
||||
@@ -20,4 +20,6 @@ ADD_CUSTOM_COMMAND(
|
||||
ARGS >${CMAKE_CURRENT_BINARY_DIR}/${snippet}.out
|
||||
)
|
||||
ADD_DEPENDENCIES(all_snippets ${compile_snippet_target})
|
||||
set_source_files_properties(${CMAKE_CURRENT_BINARY_DIR}/${compile_snippet_src}
|
||||
PROPERTIES OBJECT_DEPENDS ${snippet_src})
|
||||
ENDFOREACH(snippet_src)
|
||||
|
||||
6
doc/snippets/Cholesky_solve.cpp
Normal file
6
doc/snippets/Cholesky_solve.cpp
Normal file
@@ -0,0 +1,6 @@
|
||||
typedef Matrix<float,Dynamic,2> DataMatrix;
|
||||
// let's generate some samples on the 3D plane of equation z = 2x+3y (with some noise)
|
||||
DataMatrix samples = DataMatrix::random(12,2);
|
||||
VectorXf elevations = 2*samples.col(0) + 3*samples.col(1) + VectorXf::random(12)*0.1;
|
||||
// and let's solve samples * x = elevations in least square sense:
|
||||
cout << (samples.adjoint() * samples).cholesky().solve((samples.adjoint()*elevations).eval()) << endl;
|
||||
@@ -1,8 +1,11 @@
|
||||
#include <Eigen/Core>
|
||||
#include <Eigen/Array>
|
||||
#include <Eigen/LU>
|
||||
#include <Eigen/Cholesky>
|
||||
#include <Eigen/Geometry>
|
||||
|
||||
USING_PART_OF_NAMESPACE_EIGEN
|
||||
using namespace Eigen;
|
||||
using namespace std;
|
||||
|
||||
int main(int, char**)
|
||||
|
||||
Reference in New Issue
Block a user