mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-06-04 18:54:00 +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:
parent
36969cc2a5
commit
39ceba409b
@ -63,7 +63,7 @@ add_custom_target(
|
|||||||
)
|
)
|
||||||
|
|
||||||
add_dependencies(doc-eigen-prerequisites all_snippets all_examples)
|
add_dependencies(doc-eigen-prerequisites all_snippets all_examples)
|
||||||
# add_dependencies(doc-unsupported-prerequisites unsupported_snippets unsupported_examples)
|
add_dependencies(doc-unsupported-prerequisites unsupported_snippets unsupported_examples)
|
||||||
add_custom_target(doc ALL
|
add_custom_target(doc ALL
|
||||||
COMMAND doxygen Doxyfile-unsupported
|
COMMAND doxygen Doxyfile-unsupported
|
||||||
COMMAND doxygen
|
COMMAND doxygen
|
||||||
|
@ -58,6 +58,22 @@
|
|||||||
* <em>SIAM J. %Matrix Anal. Applic.</em>, <b>26</b>:1179–1193,
|
* <em>SIAM J. %Matrix Anal. Applic.</em>, <b>26</b>:1179–1193,
|
||||||
* 2005.
|
* 2005.
|
||||||
*
|
*
|
||||||
|
* Example: The following program checks that
|
||||||
|
* \f[ \exp \left[ \begin{array}{ccc}
|
||||||
|
* 0 & \frac14\pi & 0 \\
|
||||||
|
* -\frac14\pi & 0 & 0 \\
|
||||||
|
* 0 & 0 & 0
|
||||||
|
* \end{array} \right] = \left[ \begin{array}{ccc}
|
||||||
|
* \frac12\sqrt2 & -\frac12\sqrt2 & 0 \\
|
||||||
|
* \frac12\sqrt2 & \frac12\sqrt2 & 0 \\
|
||||||
|
* 0 & 0 & 1
|
||||||
|
* \end{array} \right]. \f]
|
||||||
|
* This corresponds to a rotation of \f$ \frac14\pi \f$ radians around
|
||||||
|
* the z-axis.
|
||||||
|
|
||||||
|
* \include MatrixExponential.cpp
|
||||||
|
* Output: \verbinclude MatrixExponential.out
|
||||||
|
*
|
||||||
* \note \p M has to be a matrix of \c float, \c double,
|
* \note \p M has to be a matrix of \c float, \c double,
|
||||||
* \c complex<float> or \c complex<double> .
|
* \c complex<float> or \c complex<double> .
|
||||||
*/
|
*/
|
||||||
|
@ -1,6 +1,8 @@
|
|||||||
|
|
||||||
set_directory_properties(PROPERTIES EXCLUDE_FROM_ALL TRUE)
|
set_directory_properties(PROPERTIES EXCLUDE_FROM_ALL TRUE)
|
||||||
|
|
||||||
|
|
||||||
if(NOT MSVC)
|
if(NOT MSVC)
|
||||||
add_subdirectory(examples)
|
add_subdirectory(examples)
|
||||||
|
add_subdirectory(snippets)
|
||||||
endif(NOT MSVC)
|
endif(NOT MSVC)
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
#include <Eigen/StdVector>
|
||||||
#include <unsupported/Eigen/BVH>
|
#include <unsupported/Eigen/BVH>
|
||||||
|
|
||||||
using namespace Eigen;
|
using namespace Eigen;
|
||||||
@ -20,7 +21,8 @@ struct PointPointMinimizer //how to compute squared distances between points and
|
|||||||
|
|
||||||
int main()
|
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
|
for(int i = 0; i < 100; ++i) { //initialize random set of red points and blue points
|
||||||
redPoints.push_back(Vector2d::Random());
|
redPoints.push_back(Vector2d::Random());
|
||||||
bluePoints.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)
|
GET_FILENAME_COMPONENT(example ${example_src} NAME_WE)
|
||||||
ADD_EXECUTABLE(example_${example} ${example_src})
|
ADD_EXECUTABLE(example_${example} ${example_src})
|
||||||
GET_TARGET_PROPERTY(example_executable
|
GET_TARGET_PROPERTY(example_executable
|
||||||
${example} LOCATION)
|
example_${example} LOCATION)
|
||||||
ADD_CUSTOM_COMMAND(
|
ADD_CUSTOM_COMMAND(
|
||||||
TARGET example_${example}
|
TARGET example_${example}
|
||||||
POST_BUILD
|
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";
|
||||||
|
}
|
@ -7,7 +7,7 @@ FOREACH(snippet_src ${snippets_SRCS})
|
|||||||
SET(compile_snippet_target compile_${snippet})
|
SET(compile_snippet_target compile_${snippet})
|
||||||
SET(compile_snippet_src ${compile_snippet_target}.cpp)
|
SET(compile_snippet_src ${compile_snippet_target}.cpp)
|
||||||
FILE(READ ${snippet_src} snippet_source_code)
|
FILE(READ ${snippet_src} snippet_source_code)
|
||||||
CONFIGURE_FILE(${PROJECT_SOURCE_DIR}/doc/compile_snippet.cpp.in
|
CONFIGURE_FILE(${PROJECT_SOURCE_DIR}/doc/snippets/compile_snippet.cpp.in
|
||||||
${CMAKE_CURRENT_BINARY_DIR}/${compile_snippet_src})
|
${CMAKE_CURRENT_BINARY_DIR}/${compile_snippet_src})
|
||||||
ADD_EXECUTABLE(${compile_snippet_target}
|
ADD_EXECUTABLE(${compile_snippet_target}
|
||||||
${CMAKE_CURRENT_BINARY_DIR}/${compile_snippet_src})
|
${CMAKE_CURRENT_BINARY_DIR}/${compile_snippet_src})
|
||||||
|
Loading…
x
Reference in New Issue
Block a user