Re: [eigen] How to make optional template parameters in C++ ?

[ Thread Index | Date Index | More Archives ]

Hi Vincent,

in order to write an Eigen-Matrix derived class, you can do something
as I did in the attached file. In order to define default template
parameters you need to add them to the class definition or forward
declarations. The reason why you probably did not see the default
parameter declarations in Eigen is that they are hidden in a separate
file (src\Core\util\ForwardDeclarations.h).

I hope that helps.


On Tue, May 11, 2010 at 11:04 AM,  <vincent.lejeune@xxxxxxxxxx> wrote:
> Hi,
> I'm trying to make my own matrix type, which derivate from the
> Matrix< _Scalar,  _Rows,  _Cols,  _Options,  _MaxRows,  _MaxCols>
> class. However, I don't know how to make the last 3 template parameters
> optionals for my own type, as it is done with the Matrix type.
> I'd like to know what's the trick used to get optional templates
> parameters to
> use it for my own matrix please.

Attachment: main.cpp
Description: Binary data

Mail converted by MHonArc 2.6.19+