mirror of
https://gitlab.com/libeigen/eigen.git
synced 2026-04-10 11:34:33 +08:00
Various improvements to the docs for unsupported.
* Enable compilation of examples for unsupported.
* Fix use of std::vector in BVH example.
* Add an example for the matrix exponential.
* Bug fixes in unsupported/doc/{examples,snippets}/CMakeLists.txt .
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
#include <Eigen/StdVector>
|
||||
#include <unsupported/Eigen/BVH>
|
||||
|
||||
using namespace Eigen;
|
||||
@@ -20,7 +21,8 @@ struct PointPointMinimizer //how to compute squared distances between points and
|
||||
|
||||
int main()
|
||||
{
|
||||
std::vector<Vector2d> redPoints, bluePoints;
|
||||
typedef std::vector<Vector2d, aligned_allocator<Vector2d> > StdVectorOfVector2d;
|
||||
StdVectorOfVector2d redPoints, bluePoints;
|
||||
for(int i = 0; i < 100; ++i) { //initialize random set of red points and blue points
|
||||
redPoints.push_back(Vector2d::Random());
|
||||
bluePoints.push_back(Vector2d::Random());
|
||||
|
||||
@@ -6,7 +6,7 @@ FOREACH(example_src ${examples_SRCS})
|
||||
GET_FILENAME_COMPONENT(example ${example_src} NAME_WE)
|
||||
ADD_EXECUTABLE(example_${example} ${example_src})
|
||||
GET_TARGET_PROPERTY(example_executable
|
||||
${example} LOCATION)
|
||||
example_${example} LOCATION)
|
||||
ADD_CUSTOM_COMMAND(
|
||||
TARGET example_${example}
|
||||
POST_BUILD
|
||||
|
||||
18
unsupported/doc/examples/MatrixExponential.cpp
Normal file
18
unsupported/doc/examples/MatrixExponential.cpp
Normal file
@@ -0,0 +1,18 @@
|
||||
#include <unsupported/Eigen/MatrixFunctions>
|
||||
|
||||
using namespace Eigen;
|
||||
|
||||
int main()
|
||||
{
|
||||
const double pi = std::acos(-1);
|
||||
|
||||
MatrixXd A(3,3);
|
||||
A << 0, -pi/4, 0,
|
||||
pi/4, 0, 0,
|
||||
0, 0, 0;
|
||||
std::cout << "The matrix A is:\n" << A << "\n\n";
|
||||
|
||||
MatrixXd B;
|
||||
ei_matrix_exponential(A, &B);
|
||||
std::cout << "The matrix exponential of A is:\n" << B << "\n\n";
|
||||
}
|
||||
Reference in New Issue
Block a user