Logo ROOT  
Reference Guide
LaEigenValues.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/LAVector.h"
11 #include "Minuit2/LASymMatrix.h"
12 
13 namespace ROOT {
14 
15 namespace Minuit2 {
16 
17 int mneigen(double *, unsigned int, unsigned int, unsigned int, double *, double);
18 
20 {
21  // calculate eigenvalues of symmetric matrices using mneigen function (transalte from fortran Minuit)
22  unsigned int nrow = mat.Nrow();
23 
24  LAVector tmp(nrow * nrow);
25  LAVector work(2 * nrow);
26 
27  for (unsigned int i = 0; i < nrow; i++)
28  for (unsigned int j = 0; j <= i; j++) {
29  tmp(i + j * nrow) = mat(i, j);
30  tmp(i * nrow + j) = mat(i, j);
31  }
32 
33  int info = mneigen(tmp.Data(), nrow, nrow, work.size(), work.Data(), 1.e-6);
34  (void)info;
35  assert(info == 0);
36 
37  LAVector result(nrow);
38  for (unsigned int i = 0; i < nrow; i++)
39  result(i) = work(i);
40 
41  return result;
42 }
43 
44 } // namespace Minuit2
45 
46 } // namespace ROOT
LASymMatrix.h
ROOT::Minuit2::LAVector
Definition: LAVector.h:32
ROOT::Minuit2::eigenvalues
LAVector eigenvalues(const LASymMatrix &mat)
Definition: LaEigenValues.cxx:19
ROOT::Minuit2::LAVector::Data
const double * Data() const
Definition: LAVector.h:223
ROOT::Minuit2::LASymMatrix
Class describing a symmetric matrix of size n.
Definition: LASymMatrix.h:45
ROOT::Minuit2::mneigen
int mneigen(double *, unsigned int, unsigned int, unsigned int, double *, double)
Definition: mnteigen.cxx:21
LAVector.h
void
typedef void((*Func_t)())
ROOT::Minuit2::LASymMatrix::Nrow
unsigned int Nrow() const
Definition: LASymMatrix.h:274
ROOT::Minuit2::LAVector::size
unsigned int size() const
Definition: LAVector.h:227
ROOT
tbb::task_arena is an alias of tbb::interface7::task_arena, which doesn't allow to forward declare tb...
Definition: EExecutionPolicy.hxx:4