[eigen] Eigen Needs Forward Declaration Files

[ Thread Index | Date Index | More lists.tuxfamily.org/eigen Archives ]


The standard library file
    # include <iosfwd>
is a forward declarations file for the objects defined in <iostream>.

I have a need of such a file for the object
    class Eigen::SimplicialLDLT;
Here is my reason.

Compiling with eigen and g++ requires one to suppress certain warnings as follows:
     -Wno-shadow -Wno-deprecated-declarations
I wish to limit the amount of source code that these warnings are suppressed for.

In order to reduce the amount of source code that requires one to include the eigen headers, I am using the ideas in the pimpl idom. To be specific, I am using a forward declaration of the SimplicialLDLT class in most of my code. Only the code that actually does Eigen calculations is including the Eigen headers. For details, see the file
https://github.com/bradbell/cppad_mixed/blob/0b3d3a461c62c052405e31d164b6bb9643b064f1/include/cppad/mixed/cholesky.hpp

There is a problem with this. It seems that the number of template parameters in the SimplicialLDLT class changed. To be specific:

In eigen-3.2.1 I find two template parameters
    template<typename _MatrixType, int _UpLo = Lower> class SimplicialLDLT;

In eigen-3.2.5 I find three template parameters
template<typename _MatrixType, int _UpLo = Lower, typename _Ordering = AMDOrdering<typename _MatrixType::Index> > class SimplicialLDLT;

Since eigen has no forward declarations file, this represents a change the the Eigen API.




Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/