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
13namespace ROOT {
14
15namespace Minuit2 {
16
17int 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
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t result
Class describing a symmetric matrix of size n.
Definition: LASymMatrix.h:45
unsigned int Nrow() const
Definition: LASymMatrix.h:273
const double * Data() const
Definition: LAVector.h:227
unsigned int size() const
Definition: LAVector.h:231
void(off) SmallVectorTemplateBase< T
LAVector eigenvalues(const LASymMatrix &mat)
int mneigen(double *, unsigned int, unsigned int, unsigned int, double *, double)
Definition: mnteigen.cxx:21
This file contains a specialised ROOT message handler to test for diagnostic in unit tests.