This forum has been archived. All content is frozen. Please use KDE Discuss instead.

Spline module Assertion failed[SOLVED]

Tags: None
(comma "," separated)
steveshi
Registered Member
Posts
8
Karma
0
Hi , I'm using spline module in Eigen, and Assertion failed when I set the type of Spline<double, 1> as member variables.
this is a example,
Code: Select all
#include "Eigen/eigen"
#include "unsupported/Eigen/splines"
using namespace Eigen;
class Spline1d
{
   Spline<double, 1> spl1d;
public:
   ~Spline1d() {};
   Spline1d() {};
   Spline1d(const MatrixXd &input) {
      spl1d = SplineFitting<Spline<double, 1> >::Interpolate(input.row(1), 1, input.row(0));
   }
};
int main()
{
   MatrixXd vals(2, 5);
   vals << 1.0, 2.0, 3.0, 4.0, 5.0,
          1.0, 2.0, 3.0, 4.0, 5.0;

   // Spline1d spl(vals);                  // case 1
   Spline<double, 1> spl1d =       // case 2
         SplineFitting<Spline<double, 1>>::Interpolate(vals.row(1), 1, vals.row(0));
   return 0;
}


comment case 1 , using case 2, it works fine.
but comment case 2, using case 1, it fails, and it is run time error.
this is the Error message in command line
Code: Select all
Assertion failed: v == T(Value), file d:\onedrive\documents\codes\library\eigen\
src/Core/util/XprHelper.h, line 53


is anyone who can help me? thanks
steveshi
Registered Member
Posts
8
Karma
0
Spline<> should be initilized at declaration


Bookmarks



Who is online

Registered users: bartoloni, Bing [Bot], Evergrowing, Google [Bot]