Logo ROOT   6.30.04
Reference Guide
 All Namespaces Files Pages
MnEigen.cxx
Go to the documentation of this file.
1 // @(#)root/minuit2:$Id$
2 // Authors: M. Winkler, F. James, L. Moneta, A. Zsenei 2003-2005
3 
4 /**********************************************************************
5  * *
6  * Copyright (c) 2005 LCG ROOT Math team, CERN/PH-SFT *
7  * *
8  **********************************************************************/
9 
10 #include "Minuit2/MnEigen.h"
12 #include "Minuit2/MnMatrix.h"
13 
14 namespace ROOT {
15 
16  namespace Minuit2 {
17 
18 
19 LAVector eigenvalues(const LASymMatrix&);
20 
21 std::vector<double> MnEigen::operator()(const MnUserCovariance& covar) const {
22  // wrapper to calculate eigenvalues of the covariance matrix using mneigen function
23 
24  LASymMatrix cov(covar.Nrow());
25  for(unsigned int i = 0; i < covar.Nrow(); i++)
26  for(unsigned int j = i; j < covar.Nrow(); j++)
27  cov(i,j) = covar(i,j);
28 
29  LAVector eigen = eigenvalues(cov);
30 
31  std::vector<double> result(eigen.Data(), eigen.Data()+covar.Nrow());
32  return result;
33 }
34 
35  } // namespace Minuit2
36 
37 } // namespace ROOT