aboutsummaryrefslogtreecommitdiffhomepage
path: root/doc/StructHavingEigenMembers.dox
diff options
context:
space:
mode:
authorGravatar Christoph Hertzberg <chtz@informatik.uni-bremen.de>2015-05-01 22:10:41 +0200
committerGravatar Christoph Hertzberg <chtz@informatik.uni-bremen.de>2015-05-01 22:10:41 +0200
commit28a4c92cbff88c75b932ce0d091ccaa2b6010724 (patch)
tree75eb0f8005954c5049f050e45bfcb2d8173c5671 /doc/StructHavingEigenMembers.dox
parent173b34e9abd06202d3df8ba07686b874115956b7 (diff)
bug #998: Started fixing doxygen warnings
Diffstat (limited to 'doc/StructHavingEigenMembers.dox')
-rw-r--r--doc/StructHavingEigenMembers.dox18
1 files changed, 9 insertions, 9 deletions
diff --git a/doc/StructHavingEigenMembers.dox b/doc/StructHavingEigenMembers.dox
index 74a8d5217..bd4fa7599 100644
--- a/doc/StructHavingEigenMembers.dox
+++ b/doc/StructHavingEigenMembers.dox
@@ -4,11 +4,11 @@ namespace Eigen {
\eigenAutoToc
-\section summary Executive Summary
+\section StructHavingEigenMembers_summary Executive Summary
If you define a structure having members of \ref TopicFixedSizeVectorizable "fixed-size vectorizable Eigen types", you must overload its "operator new" so that it generates 16-bytes-aligned pointers. Fortunately, Eigen provides you with a macro EIGEN_MAKE_ALIGNED_OPERATOR_NEW that does that for you.
-\section what What kind of code needs to be changed?
+\section StructHavingEigenMembers_what What kind of code needs to be changed?
The kind of code that needs to be changed is this:
@@ -27,7 +27,7 @@ Foo *foo = new Foo;
In other words: you have a class that has as a member a \ref TopicFixedSizeVectorizable "fixed-size vectorizable Eigen object", and then you dynamically create an object of that class.
-\section how How should such code be modified?
+\section StructHavingEigenMembers_how How should such code be modified?
Very easy, you just need to put a EIGEN_MAKE_ALIGNED_OPERATOR_NEW macro in a public part of your class, like this:
@@ -50,7 +50,7 @@ This macro makes "new Foo" always return an aligned pointer.
If this approach is too intrusive, see also the \ref othersolutions.
-\section why Why is this needed?
+\section StructHavingEigenMembers_why Why is this needed?
OK let's say that your code looks like this:
@@ -81,7 +81,7 @@ The alignment attribute of the member v is then relative to the start of the cla
The solution is to let class Foo have an aligned "operator new", as we showed in the previous section.
-\section movetotop Should I then put all the members of Eigen types at the beginning of my class?
+\section StructHavingEigenMembers_movetotop Should I then put all the members of Eigen types at the beginning of my class?
That's not required. Since Eigen takes care of declaring 128-bit alignment, all members that need it are automatically 128-bit aligned relatively to the class. So code like this works fine:
@@ -95,15 +95,15 @@ public:
};
\endcode
-\section dynamicsize What about dynamic-size matrices and vectors?
+\section StructHavingEigenMembers_dynamicsize What about dynamic-size matrices and vectors?
Dynamic-size matrices and vectors, such as Eigen::VectorXd, allocate dynamically their own array of coefficients, so they take care of requiring absolute alignment automatically. So they don't cause this issue. The issue discussed here is only with \ref TopicFixedSizeVectorizable "fixed-size vectorizable matrices and vectors".
-\section bugineigen So is this a bug in Eigen?
+\section StructHavingEigenMembers_bugineigen So is this a bug in Eigen?
No, it's not our bug. It's more like an inherent problem of the C++98 language specification, and seems to be taken care of in the upcoming language revision: <a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2341.pdf">see this document</a>.
-\section conditional What if I want to do this conditionnally (depending on template parameters) ?
+\section StructHavingEigenMembers_conditional What if I want to do this conditionnally (depending on template parameters) ?
For this situation, we offer the macro EIGEN_MAKE_ALIGNED_OPERATOR_NEW_IF(NeedsToAlign). It will generate aligned operators like EIGEN_MAKE_ALIGNED_OPERATOR_NEW if NeedsToAlign is true. It will generate operators with the default alignment if NeedsToAlign is false.
@@ -128,7 +128,7 @@ Foo<3> *foo3 = new Foo<3>; // foo3 has only the system default alignment guarant
\endcode
-\section othersolutions Other solutions
+\section StructHavingEigenMembers_othersolutions Other solutions
In case putting the EIGEN_MAKE_ALIGNED_OPERATOR_NEW macro everywhere is too intrusive, there exists at least two other solutions.