[eigen] Problem extending MatrixBase |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/eigen Archives
]
- To: eigen@xxxxxxxxxxxxxxxxxxx
- Subject: [eigen] Problem extending MatrixBase
- From: Raphaël Poncet <raphael.poncet@xxxxxxxxx>
- Date: Sun, 17 Jan 2010 11:46:06 +0100
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject :from:to:content-type; bh=mX5WzsGjTiQXkHqcpZEbE0aejfEANFrTydtjgfsj0nQ=; b=O/DI+wtHaR9Apx/5MCdYoQGY9ZGyRwVooDD+dvvNMOCO6WMgJtC3s8Vax/9t3ADt4A iArmo673CLR7RZJ/9fMTV0a6hwJndPRms2y7hGEIFhwgaapLDCSVYoA4W8/tUbxVXLFR EXMZSiwJI65EtPOpDLxMERx4s2Dc9r4rnWUEM=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=RAjVq6ZAGJG/nampXU6sFB+nioaUapkHreFB9eRbviyg3TkFjrdI8J/gBIdRdQNrky 0bqOuk/sG1InTxPk44cumhwqVwHywMY1OnEuW3TfB+WKlfkzxf6b1JVOyGL9MwpSNXlB BzitcyoNbw2jLSVvf/4TuaIhQY1h8aw0CxcCk=
Hello list,
I'm running into problems while trying to extending MatrixBase as explained in the wiki:
http://eigen.tuxfamily.org/dox/CustomizingEigen.html#ExtendingMatrixBase
I copied/pasted MatrixBaseAddons.h in my working directory. This code doesn't compile
(with g++-4.4 or g++-4.3, using Eigen 2.0.5, the version packaged in my Ubuntu distro) :
**************************************************************************************************************
#define EIGEN_MATRIXBASE_PLUGIN "/home/raphael/code/snippets/eigen/MatrixBaseAddons.h"
#include <Eigen/Core>
#include <Eigen/Array>
typedef Eigen::Matrix<float,1,Eigen::Dynamic> ArrayF;
int main(int argc, char *argv[]) {
ArrayF a = ArrayF::Zero(100);
return 0;
}
*****************************************************************************************************************
Error message follows :
*****************************************************************************************************************
In file included from /usr/include/eigen2/Eigen/Array:27,
from main.cpp:3:
/usr/include/eigen2/Eigen/src/Array/CwiseOperators.h: In instantiation of ‘Eigen::Cwise<Eigen::Matrix<float, 1, 10000, 2, 1, 10000> >’:
/home/raphael/code/snippets/eigen/MatrixBaseAddons.hpp:31: instantiated from ‘Eigen::MatrixBase<Eigen::Matrix<float, 1, 10000, 2, 1, 10000> >’
/usr/include/eigen2/Eigen/src/Core/Matrix.h:124: instantiated from ‘Eigen::Matrix<float, 1, 10000, 2, 1, 10000>’
main.cpp:9: instantiated from here
/usr/include/eigen2/Eigen/src/Array/CwiseOperators.h:302: error: no type named ‘ConstantReturnType’ in ‘class Eigen::Matrix<float, 1, 10000, 2, 1, 10000>’
/usr/include/eigen2/Eigen/src/Array/CwiseOperators.h:316: error: no type named ‘ConstantReturnType’ in ‘class Eigen::Matrix<float, 1, 10000, 2, 1, 10000>’
/usr/include/eigen2/Eigen/src/Array/CwiseOperators.h:330: error: no type named ‘ConstantReturnType’ in ‘class Eigen::Matrix<float, 1, 10000, 2, 1, 10000>’
/usr/include/eigen2/Eigen/src/Array/CwiseOperators.h:344: error: no type named ‘ConstantReturnType’ in ‘class Eigen::Matrix<float, 1, 10000, 2, 1, 10000>’
/usr/include/eigen2/Eigen/src/Array/CwiseOperators.h:363: error: no type named ‘ConstantReturnType’ in ‘class Eigen::Matrix<float, 1, 10000, 2, 1, 10000>’
/usr/include/eigen2/Eigen/src/Array/CwiseOperators.h:382: error: no type named ‘ConstantReturnType’ in ‘class Eigen::Matrix<float, 1, 10000, 2, 1, 10000>’
/usr/include/eigen2/Eigen/src/Array/CwiseOperators.h: In instantiation of ‘Eigen::Cwise<Eigen::CwiseNullaryOp<Eigen::ei_scalar_constant_op<float>, Eigen::Matrix<float, 1, 10000, 2, 1, 10000> > >’:
/home/raphael/code/snippets/eigen/MatrixBaseAddons.hpp:31: instantiated from ‘Eigen::MatrixBase<Eigen::CwiseNullaryOp<Eigen::ei_scalar_constant_op<float>, Eigen::Matrix<float, 1, 10000, 2, 1, 10000> > >’
/usr/include/eigen2/Eigen/src/Core/CwiseNullaryOp.h:59: instantiated from ‘Eigen::CwiseNullaryOp<Eigen::ei_scalar_constant_op<float>, Eigen::Matrix<float, 1, 10000, 2, 1, 10000> >’
main.cpp:9: instantiated from here
/usr/include/eigen2/Eigen/src/Array/CwiseOperators.h:302: error: no type named ‘ConstantReturnType’ in ‘class Eigen::CwiseNullaryOp<Eigen::ei_scalar_constant_op<float>, Eigen::Matrix<float, 1, 10000, 2, 1, 10000> >’
/usr/include/eigen2/Eigen/src/Array/CwiseOperators.h:316: error: no type named ‘ConstantReturnType’ in ‘class Eigen::CwiseNullaryOp<Eigen::ei_scalar_constant_op<float>, Eigen::Matrix<float, 1, 10000, 2, 1, 10000> >’
/usr/include/eigen2/Eigen/src/Array/CwiseOperators.h:330: error: no type named ‘ConstantReturnType’ in ‘class Eigen::CwiseNullaryOp<Eigen::ei_scalar_constant_op<float>, Eigen::Matrix<float, 1, 10000, 2, 1, 10000> >’
/usr/include/eigen2/Eigen/src/Array/CwiseOperators.h:344: error: no type named ‘ConstantReturnType’ in ‘class Eigen::CwiseNullaryOp<Eigen::ei_scalar_constant_op<float>, Eigen::Matrix<float, 1, 10000, 2, 1, 10000> >’
/usr/include/eigen2/Eigen/src/Array/CwiseOperators.h:363: error: no type named ‘ConstantReturnType’ in ‘class Eigen::CwiseNullaryOp<Eigen::ei_scalar_constant_op<float>, Eigen::Matrix<float, 1, 10000, 2, 1, 10000> >’
/usr/include/eigen2/Eigen/src/Array/CwiseOperators.h:382: error: no type named ‘ConstantReturnType’ in ‘class Eigen::CwiseNullaryOp<Eigen::ei_scalar_constant_op<float>, Eigen::Matrix<float, 1, 10000, 2, 1, 10000> >’
****************************************************************************************************************************
However, If i comment out the last 2 declarations in MatrixBaseAddons.h (the ones with operator+),
it does compile. What am I doing wrong ?
Thanks,
Raphaël
P.S. Btw, I want to extend MatrixBase because I'm only using Array capabilities in Eigen
in my code atm, and want to get rid of all the cwise()