17 #if defined(DEBUG) || defined(WARNINGMSG) 30 double similarity(
const LAVector&,
const LASymMatrix&);
37 class LASquareMatrix {
39 LASquareMatrix(
unsigned int n) :
41 fData(
std::vector<double> (n*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;
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;
Namespace for new ROOT classes and functions.
const MnAlgebraicVector & Vec() const
double sum_of_elements(const LASymMatrix &)
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;.
Class describing a symmetric matrix of size n.
const MnAlgebraicVector & Vec() const
double inner_product(const LAVector &, const LAVector &)
TRObject operator()(const T1 &t1) const
const FunctionGradient & Gradient() const
unsigned int Nrow() const
unsigned int size() const
static constexpr double m2
static double p1(double t, double a, double b)
const MinimumError & Error() const
double similarity(const LAVector &, const LASymMatrix &)
MinimumError keeps the inv.
virtual MinimumError Update(const MinimumState &, const MinimumParameters &, const FunctionGradient &) const
you should not use this method at all Int_t Int_t Double_t Double_t Double_t Int_t Double_t Double_t Double_t Double_t b
LASquareMatrix MatrixProduct(const LASymMatrix &m1, const LASquareMatrix &m2)
MinimumState keeps the information (position, Gradient, 2nd deriv, etc) after one minimization step (...
LASquareMatrix OuterProduct(const LAVector &v1, const LAVector &v2)
const MnAlgebraicVector & Vec() const
const MnAlgebraicSymMatrix & InvHessian() const