ATLAS Offline Software
Loading...
Searching...
No Matches
sincos_poly.cxx File Reference
#include "GeoSpecialShapes/LArWheelCalculator.h"
#include "CxxUtils/sincos.h"
#include "TMath.h"
#include "TMatrixD.h"
#include "TVectorD.h"
#include "TMatrixDLazy.h"
#include "TDecompLU.h"
#include "TDecompSVD.h"
#include <sys/time.h>
#include <iostream>
#include <iomanip>
#include <math.h>
#include <mutex>
#include "GeoModelKernel/Units.h"

Go to the source code of this file.

Macros

#define DEBUGPRINT   0

Typedefs

typedef TVectorD VECTOR
typedef TMatrixD MATRIX
typedef TMatrixDSym SYMMATRIX

Functions

template<typename T, typename Q>
std::ostream & operator<< (std::ostream &ostr, const TVectorT< T > &v)
static VECTOR findLinearApproximation (const Int_t dataLen, const Int_t nBasisFuntions, const VECTOR &y, const MATRIX &bf)

Macro Definition Documentation

◆ DEBUGPRINT

#define DEBUGPRINT   0

Definition at line 38 of file sincos_poly.cxx.

Typedef Documentation

◆ MATRIX

typedef TMatrixD MATRIX

Definition at line 21 of file sincos_poly.cxx.

◆ SYMMATRIX

typedef TMatrixDSym SYMMATRIX

Definition at line 22 of file sincos_poly.cxx.

◆ VECTOR

typedef TVectorD VECTOR

Definition at line 20 of file sincos_poly.cxx.

Function Documentation

◆ findLinearApproximation()

VECTOR findLinearApproximation ( const Int_t dataLen,
const Int_t nBasisFuntions,
const VECTOR & y,
const MATRIX & bf )
static

Definition at line 60 of file sincos_poly.cxx.

63{
64#ifndef SINCOSPOLY_USE_EIGEN
65 SYMMATRIX A(nBasisFuntions);
66 VECTOR vY(nBasisFuntions);
67#else
68 SYMMATRIX A=SYMMATRIX::Zero(nBasisFuntions,nBasisFuntions);
69 VECTOR vY=VECTOR::Zero(nBasisFuntions);
70#endif
71 for(Int_t j = 0; j < nBasisFuntions; ++ j){
72 for(Int_t k = 0; k < nBasisFuntions; ++ k){
73 Double_t Ajk = 0.0;
74 for(Int_t i = 0; i < dataLen; ++ i){
75 Ajk += bf(j, i) * bf(k, i);
76 }
77 A(j, k) = Ajk;
78 }
79 }
80
81 for(Int_t k = 0; k < nBasisFuntions; ++ k){
82 Double_t vYk = 0.0;
83 for(Int_t i = 0; i < dataLen; ++ i){
84 vYk += y[i]*bf(k,i);
85 }
86 vY[k] = vYk;
87 }
88#ifndef SINCOSPOLY_USE_EIGEN
89 SYMMATRIX Ainv(A);
90 Ainv.Invert();
91 return Ainv*vY;
92#else
93 return A.inverse()*vY;
94#endif
95}
#define y
TMatrixDSym SYMMATRIX
TVectorD VECTOR
hold the test vectors and ease the comparison

◆ operator<<()

template<typename T, typename Q>
std::ostream & operator<< ( std::ostream & ostr,
const TVectorT< T > & v )

Definition at line 44 of file sincos_poly.cxx.

45{
46 std::ios_base::fmtflags save_flags(ostr.flags());
47 ostr << '[';
48 ostr << std::scientific;
49 for(Int_t idx=v.GetLwb();idx<v.GetUpb();idx++) {
50 ostr << v[idx] << ", ";
51 }
52 ostr << v[v.GetUpb()];
53 ostr << ']';
54 ostr.flags(save_flags);
55 return ostr;
56}