diff --git a/uppsrc/plugin/Eigen/Eigen.h b/uppsrc/plugin/Eigen/Eigen.h index 76c6345d7..9afee661c 100644 --- a/uppsrc/plugin/Eigen/Eigen.h +++ b/uppsrc/plugin/Eigen/Eigen.h @@ -21,10 +21,33 @@ //#undef Success #include "Eigen/Eigen" - +#include NAMESPACE_UPP +using namespace Eigen; + +template +struct NonLinearOptimizationFunctor { + typedef _Scalar Scalar; + enum { + InputsAtCompileTime = nx, + ValuesAtCompileTime = ny + }; + typedef Matrix InputType; + typedef Matrix ValueType; + typedef Matrix JacobianType; + + int64 unknowns, datasetLen; + + NonLinearOptimizationFunctor() : unknowns(InputsAtCompileTime), datasetLen(ValuesAtCompileTime) {} + NonLinearOptimizationFunctor(int unknowns, int datasetLen) : unknowns(unknowns), datasetLen(datasetLen) {} + + ptrdiff_t inputs() const {return ptrdiff_t(unknowns);} + ptrdiff_t values() const {return ptrdiff_t(datasetLen);} + virtual void operator() (const InputType& x, ValueType* v, JacobianType* j = 0) const {}; +}; + template void Xmlize(XmlIO &xml, Eigen::Matrix &mat) { Size_ sz(mat.cols(), mat.rows()); diff --git a/uppsrc/plugin/Eigen/Eigen/src/QR/ColPivHouseholderQR.h b/uppsrc/plugin/Eigen/Eigen/src/QR/ColPivHouseholderQR.h index 2daa23cc3..cf78aa0e9 100644 --- a/uppsrc/plugin/Eigen/Eigen/src/QR/ColPivHouseholderQR.h +++ b/uppsrc/plugin/Eigen/Eigen/src/QR/ColPivHouseholderQR.h @@ -458,7 +458,7 @@ struct solve_retval, Rhs> { eigen_assert(rhs().rows() == dec().rows()); - const int cols = dec().cols(), + const ptrdiff_t cols = dec().cols(), nonzero_pivots = dec().nonzeroPivots(); if(nonzero_pivots == 0) diff --git a/uppsrc/plugin/Eigen/srcdoc.tpp/Eigen$en-us.tpp b/uppsrc/plugin/Eigen/srcdoc.tpp/Eigen$en-us.tpp index de412ac2e..3cf53f818 100644 --- a/uppsrc/plugin/Eigen/srcdoc.tpp/Eigen$en-us.tpp +++ b/uppsrc/plugin/Eigen/srcdoc.tpp/Eigen$en-us.tpp @@ -25,11 +25,11 @@ is a simple weak copyleft license. Common questions about the MPL2 are answered in the official ][^http`:`/`/www`.mozilla`.org`/MPL`/2`.0`/FAQ`.html^2 M PL2 FAQ][2 .]&] [s0;#2 &] -[s0;# [2 In addition Bazaar/Eigen package includes a sample package -(Eigen`_demo) to ease even more its use for U`+`+ users. It has -many samples from Eigen library and nonlinear equation solving -and optimization like ][^http`:`/`/www`.itl`.nist`.gov`/div898`/strd`/nls`/data`/eckerle4`.shtml^2 E -ckerle4][2 and ][^http`:`/`/www`.itl`.nist`.gov`/div898`/strd`/nls`/data`/thurber`.shtml^2 T +[s0;# [2 Bazaar/Eigen package includes a sample package (Eigen`_demo) +to ease its use for U`+`+ users. It has many samples from Eigen +library and nonlinear equation solving and optimization like +][^http`:`/`/www`.itl`.nist`.gov`/div898`/strd`/nls`/data`/eckerle4`.shtml^2 Eckerl +e4][2 and ][^http`:`/`/www`.itl`.nist`.gov`/div898`/strd`/nls`/data`/thurber`.shtml^2 T hurber][2 (see the graphs).]&] [s0;#2 &] [s0;= [2 @@ -99,9 +99,6 @@ hurber][2 (see the graphs).]&] ]&] [s0;#2 &] [s0;#2 &] -[s0;# [2 It is not necessary to install anything or set `"Build methods`". -As it is a template library no libraries or binaries are required.]&] -[s0;#2 &] [s0;# [2 Eigen packages have been prepared by ][^http`:`/`/www`.ultimatepp`.org`/forum`/index`.php`?t`=usrinfo`&id`=647`&^2 d olik.rce][2 and ][^http`:`/`/www`.ultimatepp`.org`/forum`/index`.php`?t`=usrinfo`&id`=648`&^2 k oldo][2 .]&]