Bug#736985: libeigen3-dev: Spline Module: A call to Spline::derivative fails to compile if dimension=1

2014-01-30 Thread Anton Gladky
reopen 736985
notfixed 736985 eigen3/3.2.0-1
thanks

Hi Philipp,

sorry, I oversaw it and reopen the bug. I will apply your
patch, but, please, report it to upstream as well to get
it fixed in the next eigen3 version.

Thanks,

Anton


2014-01-30 Philipp Büttgenbach philipp.buettgenb...@gmail.com:
 The reported bug is still present in the referenced file:
 DerivativeType is still tagged ColMajor there and also in the eigen
 mercury-repository [1] DerivativeType is tagged ColMajor.
 As well there is nothing else implemented in order to fix this bug:


--
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#736985: libeigen3-dev: Spline Module: A call to Spline::derivative fails to compile if dimension=1

2014-01-29 Thread Anton Gladky
fixed 736985 3.2.0-1
thanks

Hi Philipp,

thanks for your bug-report. Upstream has fixed this issue in 3.2.0 release [1],
which is available in Debian Jessie. Thus I am closing the bug.

I have backported eigen 3.2.0 for Debian Wheezy, so it should probably
be available there soon [2].

[1] 
http://sources.debian.net/src/eigen3/3.2.0-6/unsupported/Eigen/src/Splines/SplineFwd.h#L70
[2] https://ftp-master.debian.org/new/eigen3_3.2.0-6~bpo70+1.html

Cheers,

Anton


-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#736985: libeigen3-dev: Spline Module: A call to Spline::derivative fails to compile if dimension=1

2014-01-28 Thread Philipp Büttgenbach
Package: libeigen3-dev
Version: 3.1.0-1
Severity: normal
Tags: patch

Dear Maintainer,

the bug can be demonstrated using Hauke's example from
http://forum.kde.nl/viewtopic.php?f=74t=98871 (see enclosed file). The call to
Spline2d::derivative1 is an extension of Hauke's example inserted
by me.  This call makes this example fail to compile:

---8-8-8-8-8-8-8-8-8-8
$ LANG=C g++ -I/usr/include/eigen3/ eigen-spline-example-from-hauke.cpp
In file included from /usr/include/eigen3/Eigen/Core:300:0,
 from eigen-spline-example-from-hauke.cpp:4:
/usr/include/eigen3/Eigen/src/Core/PlainObjectBase.h: In instantiation of
'static void Eigen::PlainObjectBaseDerived::_check_template_params() [with
Derived = Eigen::Arraydouble, 1, -1, 0, 1, 2]':
/usr/include/eigen3/Eigen/src/Core/Array.h:127:7:   required from
'Eigen::Array_Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols::Array()
[with _Scalar = double; int _Rows = 1; int _Cols = -1; int _Options = 0; int
_MaxRows = 1; int _MaxCols = 2]'
/usr/include/eigen3/unsupported/Eigen/src/Splines/Spline.h:339:70:   required
from 'typename Eigen::SplineTraitsEigen::SplineScalar, Dim, Degree,
DerivativeOrder::DerivativeType Eigen::SplineScalar, Dim,
Degree::derivatives(Eigen::SplineScalar, Dim, Degree::Scalar,
Eigen::DenseIndex) const [with int DerivativeOrder = 1; _Scalar = double; int
_Dim = 1; int _Degree = -1; typename Eigen::SplineTraitsEigen::SplineScalar,
Dim, Degree, DerivativeOrder::DerivativeType = Eigen::Arraydouble, 1, -1, 0,
1, 2; Eigen::SplineScalar, Dim, Degree::Scalar = double; Eigen::DenseIndex =
int]'
eigen-spline-example-from-hauke.cpp:37:98:   required from here
/usr/include/eigen3/Eigen/src/Core/PlainObjectBase.h:654:7: error:
'INVALID_MATRIX_TEMPLATE_PARAMETERS' is not a member of
'Eigen::internal::static_assertionfalse'
---8-8-8-8-8-8-8-8-8-8

This bug can be fixed by changing in
/usr/include/eigen3/unsupported/Eigen/src/Splines/SplineFwd.h the
DerivativeType from ColMajor to RowMajor (see enclosed patch for details).
With this change everything compiles fine:

---8-8-8-8-8-8-8-8-8-8
$ LANG=C g++ -I/usr/include/eigen3/ -include SplineFwd.h eigen-spline-example-
from-hauke.cpp  echo $?
0
---8-8-8-8-8-8-8-8-8-8









-- System Information:
Debian Release: 7.3
  APT prefers proposed-updates
  APT policy: (500, 'proposed-updates'), (500, 'stable')
Architecture: i386 (i686)

Kernel: Linux 3.2.0-4-686-pae (SMP w/2 CPU cores)
Locale: LANG=de_DE.utf8, LC_CTYPE=de_DE.utf8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

libeigen3-dev depends on no packages.

libeigen3-dev recommends no packages.

Versions of packages libeigen3-dev suggests:
ii  libeigen3-doc  3.1.0-1
#include vector
#include iostream

#include Eigen/Core
#include unsupported/Eigen/Splines

using namespace Eigen;

double uvalue(double x, double low, double high)
{
  return (x - low)/(high-low);
}

VectorXd uvalues(VectorXd xvals)
{
  const double low = xvals.minCoeff();
  const double high = xvals.maxCoeff();
  for (int i=0; ixvals.size(); ++i)
  {
xvals(i) = uvalue(xvals(i), low, high);
  }
  return xvals;
}

int main(int argc, char* argv[])
{
  typedef Splinedouble,1 Spline2d;

  const VectorXd xvals = (VectorXd(5)  1,2,3,4,6).finished();
  const VectorXd yvals = xvals.array().square();
  const Spline2d spline = SplineFittingSpline2d::Interpolate(yvals.transpose(), 3, uvalues(xvals).transpose());

  const double step = 0.1;
  for (double x = 1; x  6 + 0.5*step; x += step)
  {
	const double uv = uvalue(x, xvals.minCoeff(), xvals.maxCoeff());
std::cout  (  x  ,  spline(uv).transpose()  ,  spline.derivatives1(uv)  )\n;
  }
  std::cout  std::endl;
}
--- /usr/include/eigen3/unsupported/Eigen/src/Splines/SplineFwd.h	2012-06-23 19:29:21.0 +0200
+++ ./SplineFwd.h	2014-01-10 00:54:22.872994299 +0100
@@ -82,7 +82,7 @@
   typedef Array_Scalar,Dynamic,Dynamic,RowMajor,NumOfDerivativesAtCompileTime,OrderAtCompileTime BasisDerivativeType;
   
   /** \brief The data type used to store the spline's derivative values. */  
-  typedef Array_Scalar,_Dim,Dynamic,ColMajor,_Dim,NumOfDerivativesAtCompileTime DerivativeType;
+  typedef Array_Scalar,_Dim,Dynamic,RowMajor,_Dim,NumOfDerivativesAtCompileTime DerivativeType;
 };
 
 /** \brief 2D float B-spline with dynamic degree. */