summaryrefslogtreecommitdiffhomepage
path: root/eigen/doc/CustomizingEigen_InheritingMatrix.dox
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2017-03-25 14:17:07 +0100
committerStanislaw Halik <sthalik@misaki.pl>2017-03-25 14:17:07 +0100
commit35f7829af10c61e33dd2e2a7a015058e11a11ea0 (patch)
tree7135010dcf8fd0a49f3020d52112709bcb883bd6 /eigen/doc/CustomizingEigen_InheritingMatrix.dox
parent6e8724193e40a932faf9064b664b529e7301c578 (diff)
update
Diffstat (limited to 'eigen/doc/CustomizingEigen_InheritingMatrix.dox')
-rw-r--r--eigen/doc/CustomizingEigen_InheritingMatrix.dox34
1 files changed, 34 insertions, 0 deletions
diff --git a/eigen/doc/CustomizingEigen_InheritingMatrix.dox b/eigen/doc/CustomizingEigen_InheritingMatrix.dox
new file mode 100644
index 0000000..b21e554
--- /dev/null
+++ b/eigen/doc/CustomizingEigen_InheritingMatrix.dox
@@ -0,0 +1,34 @@
+namespace Eigen {
+
+/** \page TopicCustomizing_InheritingMatrix Inheriting from Matrix
+
+Before inheriting from Matrix, be really, I mean REALLY, sure that using
+EIGEN_MATRIX_PLUGIN is not what you really want (see previous section).
+If you just need to add few members to Matrix, this is the way to go.
+
+An example of when you actually need to inherit Matrix, is when you
+have several layers of heritage such as
+MyVerySpecificVector1, MyVerySpecificVector2 -> MyVector1 -> Matrix and
+MyVerySpecificVector3, MyVerySpecificVector4 -> MyVector2 -> Matrix.
+
+In order for your object to work within the %Eigen framework, you need to
+define a few members in your inherited class.
+
+Here is a minimalistic example:
+
+\include CustomizingEigen_Inheritance.cpp
+
+Output: \verbinclude CustomizingEigen_Inheritance.out
+
+This is the kind of error you can get if you don't provide those methods
+\verbatim
+error: no match for ‘operator=’ in ‘v = Eigen::operator*(
+const Eigen::MatrixBase<Eigen::Matrix<double, -0x000000001, 1, 0, -0x000000001, 1> >::Scalar&,
+const Eigen::MatrixBase<Eigen::Matrix<double, -0x000000001, 1> >::StorageBaseType&)
+(((const Eigen::MatrixBase<Eigen::Matrix<double, -0x000000001, 1> >::StorageBaseType&)
+((const Eigen::MatrixBase<Eigen::Matrix<double, -0x000000001, 1> >::StorageBaseType*)(& v))))’
+\endverbatim
+
+*/
+
+}