BornAgain  1.19.79
Open-source research software to simulate and fit neutron and x-ray reflectometry and grazing-incidence small-angle scattering
ROOT::Minuit2::LAVector Class Reference

Description

Definition at line 33 of file LAVector.h.

Public Types

typedef vec Type
 

Public Member Functions

template<class A , class T >
 LAVector (const ABObj< vec, ABObj< vec, A, T >, T > &something)
 
template<class T >
 LAVector (const ABObj< vec, ABProd< ABObj< sym, LASymMatrix, T >, ABObj< vec, LAVector, T > >, T > &prod)
 
template<class A , class B , class T >
 LAVector (const ABObj< vec, ABSum< ABObj< vec, A, T >, ABObj< vec, B, T > >, T > &sum)
 
template<class T >
 LAVector (const ABObj< vec, ABSum< ABObj< vec, ABProd< ABObj< sym, LASymMatrix, T >, ABObj< vec, LAVector, T > >, T >, ABObj< vec, LAVector, T > >, T > &prod)
 
template<class A , class T >
 LAVector (const ABObj< vec, ABSum< ABObj< vec, LAVector, T >, ABObj< vec, A, T > >, T > &sum)
 
template<class T >
 LAVector (const ABObj< vec, LAVector, T > &v)
 
 LAVector (const LAVector &v)
 
 LAVector (unsigned int n)
 
 ~LAVector ()
 
double * Data ()
 
const double * Data () const
 
double & operator() (unsigned int i)
 
double operator() (unsigned int i) const
 
LAVectoroperator*= (double scal)
 
template<class A , class T >
LAVectoroperator+= (const ABObj< vec, A, T > &m)
 
template<class T >
LAVectoroperator+= (const ABObj< vec, ABProd< ABObj< sym, LASymMatrix, T >, ABObj< vec, LAVector, T > >, T > &prod)
 
template<class T >
LAVectoroperator+= (const ABObj< vec, LAVector, T > &m)
 
LAVectoroperator+= (const LAVector &m)
 
LAVectoroperator-= (const LAVector &m)
 
template<class A , class T >
LAVectoroperator= (const ABObj< vec, ABObj< vec, A, T >, T > &something)
 
template<class T >
LAVectoroperator= (const ABObj< vec, ABProd< ABObj< sym, LASymMatrix, T >, ABObj< vec, LAVector, T > >, T > &prod)
 
template<class A , class B , class T >
LAVectoroperator= (const ABObj< vec, ABSum< ABObj< vec, A, T >, ABObj< vec, B, T > >, T > &sum)
 
template<class T >
LAVectoroperator= (const ABObj< vec, ABSum< ABObj< vec, ABProd< ABObj< sym, LASymMatrix, T >, ABObj< vec, LAVector, T > >, T >, ABObj< vec, LAVector, T > >, T > &prod)
 
template<class A , class T >
LAVectoroperator= (const ABObj< vec, ABSum< ABObj< vec, LAVector, T >, ABObj< vec, A, T > >, T > &sum)
 
template<class T >
LAVectoroperator= (const ABObj< vec, LAVector, T > &v)
 
LAVectoroperator= (const LAVector &v)
 
double & operator[] (unsigned int i)
 
double operator[] (unsigned int i) const
 
unsigned int size () const
 

Private Member Functions

 LAVector ()
 

Private Attributes

double * fData
 
unsigned int fSize
 

Member Typedef Documentation

◆ Type

Definition at line 41 of file LAVector.h.

Constructor & Destructor Documentation

◆ LAVector() [1/9]

ROOT::Minuit2::LAVector::LAVector ( )
inlineprivate

Definition at line 37 of file LAVector.h.

37 : fSize(0), fData(0) {}
unsigned int fSize
Definition: LAVector.h:202

Referenced by operator+=().

◆ LAVector() [2/9]

ROOT::Minuit2::LAVector::LAVector ( unsigned int  n)
inline

Definition at line 45 of file LAVector.h.

45  : fSize(n), fData((double*)StackAllocatorHolder::Get().Allocate(sizeof(double)*n)) {
46 // assert(fSize>0);
47  memset(fData, 0, size()*sizeof(double));
48 // std::cout<<"LAVector(unsigned int n), n= "<<n<<std::endl;
49  }
unsigned int size() const
Definition: LAVector.h:198
static StackAllocator & Get()

References fData, and size().

Here is the call graph for this function:

◆ ~LAVector()

ROOT::Minuit2::LAVector::~LAVector ( )
inline

Definition at line 51 of file LAVector.h.

51  {
52 // std::cout<<"~LAVector()"<<std::endl;
53 // if(fData) std::cout<<"deleting "<<fSize<<std::endl;
54 // else std::cout<<"no delete"<<std::endl;
55 // if(fData) delete [] fData;
57  }

References ROOT::Minuit2::StackAllocator::Deallocate(), fData, and ROOT::Minuit2::StackAllocatorHolder::Get().

Here is the call graph for this function:

◆ LAVector() [3/9]

ROOT::Minuit2::LAVector::LAVector ( const LAVector v)
inline

Definition at line 59 of file LAVector.h.

59  :
60  fSize(v.size()), fData((double*)StackAllocatorHolder::Get().Allocate(sizeof(double)*v.size())) {
61 // std::cout<<"LAVector(const LAVector& v)"<<std::endl;
62  memcpy(fData, v.Data(), fSize*sizeof(double));
63  }

References Data(), fData, and fSize.

Here is the call graph for this function:

◆ LAVector() [4/9]

template<class T >
ROOT::Minuit2::LAVector::LAVector ( const ABObj< vec, LAVector, T > &  v)
inline

Definition at line 75 of file LAVector.h.

75  :
76  fSize(v.Obj().size()), fData((double*)StackAllocatorHolder::Get().Allocate(sizeof(double)*v.Obj().size())) {
77 // std::cout<<"LAVector(const ABObj<LAVector, T>& v)"<<std::endl;
78 // std::cout<<"allocate "<<fSize<<std::endl;
79  memcpy(fData, v.Obj().Data(), fSize*sizeof(T));
80  (*this) *= T(v.f());
81 // std::cout<<"fData= "<<fData[0]<<" "<<fData[1]<<std::endl;
82  }

References ROOT::Minuit2::ABObj< mtype, M, T >::f(), fData, fSize, and ROOT::Minuit2::ABObj< mtype, M, T >::Obj().

Here is the call graph for this function:

◆ LAVector() [5/9]

template<class A , class B , class T >
ROOT::Minuit2::LAVector::LAVector ( const ABObj< vec, ABSum< ABObj< vec, A, T >, ABObj< vec, B, T > >, T > &  sum)
inline

Definition at line 85 of file LAVector.h.

85  : fSize(0), fData(0) {
86 // std::cout<<"template<class A, class B, class T> LAVector(const ABObj<ABSum<ABObj<A, T>, ABObj<B, T> > >& sum)"<<std::endl;
87  (*this) = sum.Obj().A();
88  (*this) += sum.Obj().B();
89  (*this) *= double(sum.f());
90  }

◆ LAVector() [6/9]

template<class A , class T >
ROOT::Minuit2::LAVector::LAVector ( const ABObj< vec, ABSum< ABObj< vec, LAVector, T >, ABObj< vec, A, T > >, T > &  sum)
inline

Definition at line 93 of file LAVector.h.

93  : fSize(0), fData(0) {
94 // std::cout<<"template<class A, class T> LAVector(const ABObj<ABSum<ABObj<LAVector, T>, ABObj<A, T> >,T>& sum)"<<std::endl;
95 
96  // recursive construction
97 // std::cout<<"(*this)=sum.Obj().B();"<<std::endl;
98  (*this) = sum.Obj().B();
99 // std::cout<<"(*this)+=sum.Obj().A();"<<std::endl;
100  (*this) += sum.Obj().A();
101  (*this) *= double(sum.f());
102 // std::cout<<"leaving template<class A, class T> LAVector(const ABObj<ABSum<ABObj<LAVector,.."<<std::endl;
103  }

◆ LAVector() [7/9]

template<class A , class T >
ROOT::Minuit2::LAVector::LAVector ( const ABObj< vec, ABObj< vec, A, T >, T > &  something)
inline

Definition at line 106 of file LAVector.h.

106  : fSize(0), fData(0) {
107 // std::cout<<"template<class A, class T> LAVector(const ABObj<ABObj<A, T>, T>& something)"<<std::endl;
108  (*this) = something.Obj();
109  (*this) *= something.f();
110  }

◆ LAVector() [8/9]

template<class T >
ROOT::Minuit2::LAVector::LAVector ( const ABObj< vec, ABProd< ABObj< sym, LASymMatrix, T >, ABObj< vec, LAVector, T > >, T > &  prod)
inline

Definition at line 114 of file LAVector.h.

114  : fSize(prod.Obj().B().Obj().size()), fData((double*)StackAllocatorHolder::Get().Allocate(sizeof(double)*prod.Obj().B().Obj().size())) {
115 // std::cout<<"template<class T> LAVector(const ABObj<vec, ABProd<ABObj<sym, LASymMatrix, T>, ABObj<vec, LAVector, T> >, T>& prod)"<<std::endl;
116 
117  Mndspmv("U", fSize, prod.f()*prod.Obj().A().f()*prod.Obj().B().f(), prod.Obj().A().Obj().Data(), prod.Obj().B().Obj().Data(), 1, 0., fData, 1);
118  }
int Mndspmv(const char *, unsigned int, double, const double *, const double *, int, double, double *, int)

References fData, fSize, and ROOT::Minuit2::Mndspmv().

Here is the call graph for this function:

◆ LAVector() [9/9]

template<class T >
ROOT::Minuit2::LAVector::LAVector ( const ABObj< vec, ABSum< ABObj< vec, ABProd< ABObj< sym, LASymMatrix, T >, ABObj< vec, LAVector, T > >, T >, ABObj< vec, LAVector, T > >, T > &  prod)
inline

Definition at line 122 of file LAVector.h.

122  : fSize(0), fData(0) {
123  (*this) = prod.Obj().B();
124  (*this) += prod.Obj().A();
125  (*this) *= double(prod.f());
126  }

Member Function Documentation

◆ Data() [1/2]

double* ROOT::Minuit2::LAVector::Data ( )
inline

Definition at line 196 of file LAVector.h.

196 {return fData;}

References fData.

◆ Data() [2/2]

const double* ROOT::Minuit2::LAVector::Data ( ) const
inline

Definition at line 194 of file LAVector.h.

194 {return fData;}

References fData.

Referenced by LAVector(), operator+=(), operator-=(), and operator=().

◆ operator()() [1/2]

double& ROOT::Minuit2::LAVector::operator() ( unsigned int  i)
inline

Definition at line 179 of file LAVector.h.

179  {
180  assert(i<fSize);
181  return fData[i];
182  }

References fData, and fSize.

◆ operator()() [2/2]

double ROOT::Minuit2::LAVector::operator() ( unsigned int  i) const
inline

Definition at line 174 of file LAVector.h.

174  {
175  assert(i<fSize);
176  return fData[i];
177  }

References fData, and fSize.

◆ operator*=()

LAVector& ROOT::Minuit2::LAVector::operator*= ( double  scal)
inline

Definition at line 169 of file LAVector.h.

169  {
170  Mndscal(fSize, scal, fData, 1);
171  return *this;
172  }
int Mndscal(unsigned int, double, double *, int)

References fData, fSize, and ROOT::Minuit2::Mndscal().

Here is the call graph for this function:

◆ operator+=() [1/4]

template<class A , class T >
LAVector& ROOT::Minuit2::LAVector::operator+= ( const ABObj< vec, A, T > &  m)
inline

Definition at line 157 of file LAVector.h.

157  {
158 // std::cout<<"template<class A, class T> LAVector& operator+=(const ABObj<A,T>& m)"<<std::endl;
159  (*this) += LAVector(m);
160  return *this;
161  }

References LAVector().

Here is the call graph for this function:

◆ operator+=() [2/4]

template<class T >
LAVector& ROOT::Minuit2::LAVector::operator+= ( const ABObj< vec, ABProd< ABObj< sym, LASymMatrix, T >, ABObj< vec, LAVector, T > >, T > &  prod)
inline

Definition at line 164 of file LAVector.h.

164  {
165  Mndspmv("U", fSize, prod.f()*prod.Obj().A().f()*prod.Obj().B().f(), prod.Obj().A().Obj().Data(), prod.Obj().B().Data(), 1, 1., fData, 1);
166  return *this;
167  }

References fData, fSize, and ROOT::Minuit2::Mndspmv().

Here is the call graph for this function:

◆ operator+=() [3/4]

template<class T >
LAVector& ROOT::Minuit2::LAVector::operator+= ( const ABObj< vec, LAVector, T > &  m)
inline

Definition at line 144 of file LAVector.h.

144  {
145 // std::cout<<"template<class T> LAVector& operator+=(const ABObj<LAVector, T>& m)"<<std::endl;
146  assert(fSize==m.Obj().size());
147  if(m.Obj().Data()==fData) {
148  Mndscal(fSize, 1.+double(m.f()), fData, 1);
149  } else {
150  Mndaxpy(fSize, double(m.f()), m.Obj().Data(), 1, fData, 1);
151  }
152 // std::cout<<"fData= "<<fData[0]<<" "<<fData[1]<<std::endl;
153  return *this;
154  }
int Mndaxpy(unsigned int, double, const double *, int, double *, int)

References ROOT::Minuit2::ABObj< mtype, M, T >::f(), fData, fSize, ROOT::Minuit2::Mndaxpy(), ROOT::Minuit2::Mndscal(), and ROOT::Minuit2::ABObj< mtype, M, T >::Obj().

Here is the call graph for this function:

◆ operator+=() [4/4]

LAVector& ROOT::Minuit2::LAVector::operator+= ( const LAVector m)
inline

Definition at line 129 of file LAVector.h.

129  {
130 // std::cout<<"LAVector& operator+=(const LAVector& m)"<<std::endl;
131  assert(fSize==m.size());
132  Mndaxpy(fSize, 1., m.Data(), 1, fData, 1);
133  return *this;
134  }

References Data(), fData, fSize, ROOT::Minuit2::Mndaxpy(), and size().

Here is the call graph for this function:

◆ operator-=()

LAVector& ROOT::Minuit2::LAVector::operator-= ( const LAVector m)
inline

Definition at line 136 of file LAVector.h.

136  {
137 // std::cout<<"LAVector& operator-=(const LAVector& m)"<<std::endl;
138  assert(fSize==m.size());
139  Mndaxpy(fSize, -1., m.Data(), 1, fData, 1);
140  return *this;
141  }

References Data(), fData, fSize, ROOT::Minuit2::Mndaxpy(), and size().

Here is the call graph for this function:

◆ operator=() [1/7]

template<class A , class T >
LAVector& ROOT::Minuit2::LAVector::operator= ( const ABObj< vec, ABObj< vec, A, T >, T > &  something)
inline

Definition at line 222 of file LAVector.h.

222  {
223 // std::cout<<"template<class A, class T> LAVector& operator=(const ABObj<ABObj<A, T>, T>& something)"<<std::endl;
224  if(fSize == 0 && fData == 0) {
225  (*this) = something.Obj();
226  } else {
227  LAVector tmp(something.Obj());
228  assert(fSize == tmp.size());
229  memcpy(fData, tmp.Data(), fSize*sizeof(double));
230  }
231  (*this) *= something.f();
232  return *this;
233  }

References Data(), fData, fSize, and size().

Here is the call graph for this function:

◆ operator=() [2/7]

template<class T >
LAVector& ROOT::Minuit2::LAVector::operator= ( const ABObj< vec, ABProd< ABObj< sym, LASymMatrix, T >, ABObj< vec, LAVector, T > >, T > &  prod)
inline

Definition at line 267 of file LAVector.h.

267  {
268  if(fSize == 0 && fData == 0) {
269  fSize = prod.Obj().B().Obj().size();
270  fData = (double*)StackAllocatorHolder::Get().Allocate(sizeof(double)*fSize);
271  Mndspmv("U", fSize, double(prod.f()*prod.Obj().A().f()*prod.Obj().B().f()), prod.Obj().A().Obj().Data(), prod.Obj().B().Obj().Data(), 1, 0., fData, 1);
272  } else {
273  LAVector tmp(prod.Obj().B());
274  assert(fSize == tmp.size());
275  Mndspmv("U", fSize, double(prod.f()*prod.Obj().A().f()), prod.Obj().A().Obj().Data(), tmp.Data(), 1, 0., fData, 1);
276  }
277  return *this;
278  }
void * Allocate(size_t nBytes)

References ROOT::Minuit2::StackAllocator::Allocate(), Data(), fData, fSize, ROOT::Minuit2::StackAllocatorHolder::Get(), ROOT::Minuit2::Mndspmv(), and size().

Here is the call graph for this function:

◆ operator=() [3/7]

template<class A , class B , class T >
LAVector& ROOT::Minuit2::LAVector::operator= ( const ABObj< vec, ABSum< ABObj< vec, A, T >, ABObj< vec, B, T > >, T > &  sum)
inline

Definition at line 236 of file LAVector.h.

236  {
237  if(fSize == 0 && fData == 0) {
238  (*this) = sum.Obj().A();
239  (*this) += sum.Obj().B();
240  } else {
241  LAVector tmp(sum.Obj().A());
242  tmp += sum.Obj().B();
243  assert(fSize == tmp.size());
244  memcpy(fData, tmp.Data(), fSize*sizeof(double));
245  }
246  (*this) *= sum.f();
247  return *this;
248  }

References Data(), fData, fSize, and size().

Here is the call graph for this function:

◆ operator=() [4/7]

template<class T >
LAVector& ROOT::Minuit2::LAVector::operator= ( const ABObj< vec, ABSum< ABObj< vec, ABProd< ABObj< sym, LASymMatrix, T >, ABObj< vec, LAVector, T > >, T >, ABObj< vec, LAVector, T > >, T > &  prod)
inline

Definition at line 282 of file LAVector.h.

282  {
283  if(fSize == 0 && fData == 0) {
284  (*this) = prod.Obj().B();
285  (*this) += prod.Obj().A();
286  } else {
287  // std::cout<<"creating tmp variable"<<std::endl;
288  LAVector tmp(prod.Obj().B());
289  tmp += prod.Obj().A();
290  assert(fSize == tmp.size());
291  memcpy(fData, tmp.Data(), fSize*sizeof(double));
292  }
293  (*this) *= prod.f();
294  return *this;
295  }

References Data(), fData, fSize, and size().

Here is the call graph for this function:

◆ operator=() [5/7]

template<class A , class T >
LAVector& ROOT::Minuit2::LAVector::operator= ( const ABObj< vec, ABSum< ABObj< vec, LAVector, T >, ABObj< vec, A, T > >, T > &  sum)
inline

Definition at line 251 of file LAVector.h.

251  {
252  if(fSize == 0 && fData == 0) {
253  (*this) = sum.Obj().B();
254  (*this) += sum.Obj().A();
255  } else {
256  LAVector tmp(sum.Obj().A());
257  tmp += sum.Obj().B();
258  assert(fSize == tmp.size());
259  memcpy(fData, tmp.Data(), fSize*sizeof(double));
260  }
261  (*this) *= sum.f();
262  return *this;
263  }

References Data(), fData, fSize, and size().

Here is the call graph for this function:

◆ operator=() [6/7]

template<class T >
LAVector& ROOT::Minuit2::LAVector::operator= ( const ABObj< vec, LAVector, T > &  v)
inline

Definition at line 208 of file LAVector.h.

208  {
209 // std::cout<<"template<class T> LAVector& operator=(ABObj<LAVector, T>& v)"<<std::endl;
210  if(fSize == 0 && fData == 0) {
211  fSize = v.Obj().size();
212  fData = (double*)StackAllocatorHolder::Get().Allocate(sizeof(double)*fSize);
213  } else {
214  assert(fSize == v.Obj().size());
215  }
216  memcpy(fData, v.Obj().Data(), fSize*sizeof(double));
217  (*this) *= T(v.f());
218  return *this;
219  }

References ROOT::Minuit2::StackAllocator::Allocate(), ROOT::Minuit2::ABObj< mtype, M, T >::f(), fData, fSize, ROOT::Minuit2::StackAllocatorHolder::Get(), and ROOT::Minuit2::ABObj< mtype, M, T >::Obj().

Here is the call graph for this function:

◆ operator=() [7/7]

LAVector& ROOT::Minuit2::LAVector::operator= ( const LAVector v)
inline

Definition at line 65 of file LAVector.h.

65  {
66 // std::cout<<"LAVector& operator=(const LAVector& v)"<<std::endl;
67 // std::cout<<"fSize= "<<fSize<<std::endl;
68 // std::cout<<"v.size()= "<<v.size()<<std::endl;
69  assert(fSize == v.size());
70  memcpy(fData, v.Data(), fSize*sizeof(double));
71  return *this;
72  }

References Data(), fData, fSize, and size().

Here is the call graph for this function:

◆ operator[]() [1/2]

double& ROOT::Minuit2::LAVector::operator[] ( unsigned int  i)
inline

Definition at line 189 of file LAVector.h.

189  {
190  assert(i<fSize);
191  return fData[i];
192  }

References fData, and fSize.

◆ operator[]() [2/2]

double ROOT::Minuit2::LAVector::operator[] ( unsigned int  i) const
inline

Definition at line 184 of file LAVector.h.

184  {
185  assert(i<fSize);
186  return fData[i];
187  }

References fData, and fSize.

◆ size()

unsigned int ROOT::Minuit2::LAVector::size ( ) const
inline

Member Data Documentation

◆ fData

double* ROOT::Minuit2::LAVector::fData
private

◆ fSize

unsigned int ROOT::Minuit2::LAVector::fSize
private

The documentation for this class was generated from the following file: