aboutsummaryrefslogtreecommitdiffhomepage
path: root/unsupported/doc
diff options
context:
space:
mode:
authorGravatar Jitse Niesen <jitse@maths.leeds.ac.uk>2009-12-07 19:10:11 +0000
committerGravatar Jitse Niesen <jitse@maths.leeds.ac.uk>2009-12-07 19:10:11 +0000
commit39ceba409b4b0295f0c70872cf2592503b54eba2 (patch)
tree3babbe06c6534b9bafb6cebda86ae972e4848ab0 /unsupported/doc
parent36969cc2a5c2d0d3a52510b68c203b920eb4d3de (diff)
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 .
Diffstat (limited to 'unsupported/doc')
-rw-r--r--unsupported/doc/CMakeLists.txt2
-rw-r--r--unsupported/doc/examples/BVH_Example.cpp4
-rw-r--r--unsupported/doc/examples/CMakeLists.txt2
-rw-r--r--unsupported/doc/examples/MatrixExponential.cpp18
-rw-r--r--unsupported/doc/snippets/CMakeLists.txt2
5 files changed, 25 insertions, 3 deletions
diff --git a/unsupported/doc/CMakeLists.txt b/unsupported/doc/CMakeLists.txt
index 2cff2510f..a50d07798 100644
--- a/unsupported/doc/CMakeLists.txt
+++ b/unsupported/doc/CMakeLists.txt
@@ -1,6 +1,8 @@
set_directory_properties(PROPERTIES EXCLUDE_FROM_ALL TRUE)
+
if(NOT MSVC)
add_subdirectory(examples)
+ add_subdirectory(snippets)
endif(NOT MSVC)
diff --git a/unsupported/doc/examples/BVH_Example.cpp b/unsupported/doc/examples/BVH_Example.cpp
index 890eb535b..0fbab5fdb 100644
--- a/unsupported/doc/examples/BVH_Example.cpp
+++ b/unsupported/doc/examples/BVH_Example.cpp
@@ -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());
diff --git a/unsupported/doc/examples/CMakeLists.txt b/unsupported/doc/examples/CMakeLists.txt
index d78af13a9..cb42b2ab9 100644
--- a/unsupported/doc/examples/CMakeLists.txt
+++ b/unsupported/doc/examples/CMakeLists.txt
@@ -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
diff --git a/unsupported/doc/examples/MatrixExponential.cpp b/unsupported/doc/examples/MatrixExponential.cpp
new file mode 100644
index 000000000..86062e3a6
--- /dev/null
+++ b/unsupported/doc/examples/MatrixExponential.cpp
@@ -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";
+}
diff --git a/unsupported/doc/snippets/CMakeLists.txt b/unsupported/doc/snippets/CMakeLists.txt
index fa529d139..19e9b1a1f 100644
--- a/unsupported/doc/snippets/CMakeLists.txt
+++ b/unsupported/doc/snippets/CMakeLists.txt
@@ -7,7 +7,7 @@ FOREACH(snippet_src ${snippets_SRCS})
SET(compile_snippet_target compile_${snippet})
SET(compile_snippet_src ${compile_snippet_target}.cpp)
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})
ADD_EXECUTABLE(${compile_snippet_target}
${CMAKE_CURRENT_BINARY_DIR}/${compile_snippet_src})