17#if defined(DEBUG) || defined(WARNINGMSG)
30double similarity(
const LAVector&,
const LASymMatrix&);
39 LASquareMatrix(
unsigned int n) :
44 double operator()(
unsigned int row,
unsigned int col)
const {
45 assert(row<fNRow && col < fNRow);
46 return fData[col+row*fNRow];
49 double&
operator()(
unsigned int row,
unsigned int col) {
50 assert(row<fNRow && col < fNRow);
51 return fData[col+row*fNRow];
54 unsigned int Nrow()
const {
return fNRow; }
57 std::vector<double> fData;
62 assert(
v1.size() ==
v2.size() );
63 LASquareMatrix
a(
v1.size() );
64 for (
unsigned int i = 0; i <
v1.size() ; ++i) {
65 for (
unsigned int j = 0; j <
v2.size() ; ++j) {
74 unsigned int n = m1.
Nrow();
75 assert(
n ==
m2.Nrow() );
76 LASquareMatrix
a(
n );
77 for (
unsigned int i = 0; i <
n ; ++i) {
78 for (
unsigned int j = 0; j <
n ; ++j) {
80 for (
unsigned int k = 0; k <
n ; ++k) {
81 a(i,j) += m1(i,k)*
m2(k,j);
107 std::cout <<
"dx = " << dx << std::endl;
108 std::cout <<
"dg = " << dg << std::endl;
109 std::cout<<
"delgam= "<<delgam<<
" gvg= "<<gvg<<std::endl;
114 MN_INFO_MSG(
"BFGSErrorUpdator: delgam = 0 : cannot update - return same matrix ");
119 if (delgam < 0)
MN_INFO_MSG(
"BFGSErrorUpdator: delgam < 0 : first derivatives increasing along search line");
138 unsigned int n =
v0.Nrow();
140 for (
unsigned int i = 0; i <
n; ++i) {
141 for (
unsigned int j = i; j <
n; ++j) {
142 v2(i,j) = (
b(i,j) +
b(j,i))/(delgam);
156 std::cout <<
"BFGSErrorUpdator - dcov is " << dcov << std::endl;
TRObject operator()(const T1 &t1) const
virtual MinimumError Update(const MinimumState &, const MinimumParameters &, const FunctionGradient &) const
const MnAlgebraicVector & Vec() const
Class describing a symmetric matrix of size n.
unsigned int Nrow() const
MinimumError keeps the inv.
const MnAlgebraicVector & Vec() const
MinimumState keeps the information (position, Gradient, 2nd deriv, etc) after one minimization step (...
ABObj< sym, VectorOuterProduct< ABObj< vec, LAVector, double >, double >, double > Outer_product(const ABObj< vec, LAVector, double > &obj)
LAPACK Algebra function specialize the Outer_product function for LAVector;.
double sum_of_elements(const LASymMatrix &)
double similarity(const LAVector &, const LASymMatrix &)
LASquareMatrix OuterProduct(const LAVector &v1, const LAVector &v2)
double inner_product(const LAVector &, const LAVector &)
LASquareMatrix MatrixProduct(const LASymMatrix &m1, const LASquareMatrix &m2)
tbb::task_arena is an alias of tbb::interface7::task_arena, which doesn't allow to forward declare tb...
static constexpr double m2