BAT  0.9.4
The Bayesian analysis toolkit
 All Classes Namespaces Functions Variables Enumerations
BCMVCUncertainty.cxx
1 /*
2  * Copyright (C) 2007-2014, the BAT core developer team
3  * All rights reserved.
4  *
5  * For the licensing terms see doc/COPYING.
6  * For documentation see http://mpp.mpg.de/bat
7  */
8 
9 // ---------------------------------------------------------
10 
11 #include "BCMVCUncertainty.h"
12 
13 #include <cmath>
14 #include <iostream>
15 
16 // ---------------------------------------------------------
17 BCMVCUncertainty::BCMVCUncertainty(std::string name) : fName(name)
18  , fFlagActive(true)
19 {
20 }
21 
22 // ---------------------------------------------------------
23 BCMVCUncertainty::~BCMVCUncertainty()
24 {
25 }
26 
27 // ---------------------------------------------------------
28 void BCMVCUncertainty::SetCorrelationMatrix(const TMatrixT<double> &matrix)
29 {
30  fCorrelationMatrix.ResizeTo(matrix);
31  fCorrelationMatrix=matrix;
32 }
33 
34 // ---------------------------------------------------------
35 void BCMVCUncertainty::SetCovarianceMatrix(const TMatrixT<double> &matrix)
36 {
37  fCovarianceMatrix.ResizeTo(matrix);
38  fCovarianceMatrix = matrix;
39  fInvCovarianceMatrix.ResizeTo(matrix);
40  fInvCovarianceMatrix = fCovarianceMatrix;
41  fInvCovarianceMatrix.Invert();
42 }
43 
44 // ---------------------------------------------------------