////////////////////////////////////////////////////////////////////////// // // // RhoError // // // // Error matrix class // // // // Author: Marcel Kunze, RUB, Nov. 99 // // Copyright (C) 1999-2001, Ruhr-University Bochum. // // Ralf Kliemt, HIM/GSI Feb.2013 (Cleanup & Restructuring) // // // ////////////////////////////////////////////////////////////////////////// #include #include #include "RhoError.h" ClassImp ( RhoError ) #include using namespace std; const Double_t RhoError::chisqUndef = -1.; RhoError::RhoError ( Int_t n, Double_t init ) { TMatrixD::Allocate ( n,n ); for ( int i1=0; i1> ( std::istream& in, RhoError& mat ) { // Peek at the next non-space character: char nextChar = ' '; while ( isspace ( nextChar ) ) { nextChar = in.get(); } in.putback ( nextChar ); if ( EOF != nextChar ) { if ( !isdigit ( nextChar ) ) { // Remove the "Bbr Covariance Matrix:" line: const int DUMMY_SIZE = 1000; char dummy[DUMMY_SIZE]; in.getline ( dummy, DUMMY_SIZE ); } // Read in the matrix: for ( int row = 1; row <= mat.GetNrows(); ++row ) { for ( int col = 1; col <= mat.GetNcols(); ++col ) { in >> mat ( row, col ); } } } return in; } RhoError operator* ( Double_t t, const RhoError& m1 ) { RhoError mret ( m1 ); //mret.ResizeTo ( m1 ); //mret = m1; mret *= t; return mret; } RhoError operator* ( const RhoError& m1, Double_t t ) { RhoError mret ( m1 ); //mret.ResizeTo ( m1 ); //mret = m1; mret *= t; return mret; } /* TError operator/(Double_t t, const TError& m1) { TError mret = m1; mret /= t; return mret; } TError operator/(const TError& m1, Double_t t) { TError mret = m1; mret /= t; return mret; } */ RhoError operator+ ( const RhoError& m1, const RhoError& m2 ) { RhoError mret ( m1 ); //mret.ResizeTo ( m1 ); //mret = m1; mret += m2; //std::cout<<" -- Adding two matrices: -- m1:"<<&m1<<" m2:"<<&m2<