-
Notifications
You must be signed in to change notification settings - Fork 0
/
ClsqSolver.hh~
60 lines (46 loc) · 1.36 KB
/
ClsqSolver.hh~
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
#ifndef CLSQSOLVER_HH
#define CLSQSOLVER_hh
// Solver for constrained linear least squares
#include "Constraints.hh"
#include "ConstraintFunction.hh"
#include "TVectorD.h"
#include "TMatrixD.h"
#include <string>
#include <map>
#include <vector>
class ClsqSolver {
public:
// Ctor: pass input data, constraint function object and optional
// parameter name maps mapping parameter number (0-n) to names:
ClsqSolver( const TVectorD& d,
const TMatrixDSym& c,
const TVectorD& u,
const ConstraintFunction& cfun,
const std::map<int,std::string>& upn=std::map<int,std::string>(),
const std::map<int,std::string>& mpn=std::map<int,std::string>(),
Int_t nd=0, Int_t mi=100,
Double_t eps=0.0001, Double_t dc=0.0001 );
// Accessors:
std::vector<std::string> getMParNames() const;
std::vector<std::string> getUParNames() const;
private:
// Helper to setup parameter names
std::vector<std::string>
setParameterNames( const std::map<int,std::string>& parnames,
Int_t npar );
// Instance variables:
TVectorD data;
TMatrixDSym covm;
TVectorD upar;
TVectorD mpar;
Constraints constraints;
std::vector<std::string> uparnames;
std::vector<std::string> mparnames;
TMatrixDSym invm;
Int_t ndof;
Int_t maxiterations;
Double_t epsilon;
Double_t deltachi2;
Int_t niterations;
};
#endif