16#ifndef ALICEO2_FWDALIGN_MATRIXSQ_H
17#define ALICEO2_FWDALIGN_MATRIXSQ_H
19#include <TMatrixDBase.h>
39 virtual Int_t
GetSize()
const {
return fNcols; }
42 void Clear(Option_t* option =
"")
override = 0;
44 virtual Double_t
Query(Int_t rown, Int_t coln)
const {
return operator()(rown, coln); }
45 Double_t
operator()(Int_t rown, Int_t coln)
const override = 0;
46 Double_t&
operator()(Int_t rown, Int_t coln)
override = 0;
51 virtual void AddToRow(Int_t
r, Double_t* valc, Int_t* indc, Int_t
n) = 0;
53 void Print(Option_t* option =
"")
const override = 0;
60 virtual void MultiplyByVec(
const Double_t* vecIn, Double_t* vecOut)
const;
62 virtual void MultiplyByVec(
const TVectorD& vecIn, TVectorD& vecOut)
const;
70 Error(
"GetMatrixArray",
"Dummy");
75 Error(
"GetMatrixArray",
"Dummy");
80 Error(
"GetRowIndexArray",
"Dummy");
85 Error(
"GetRowIndexArray",
"Dummy");
90 Error(
"GetColIndexArray",
"Dummy");
95 Error(
"GetColIndexArray",
"Dummy");
100 Error(
"SetRowIndexArray",
"Dummy");
105 Error(
"SetColIndexArray",
"Dummy");
110 Error(
"GetSub",
"Dummy");
115 Error(
"GetSub",
"Dummy");
120 Error(
"ResizeTo",
"Dummy");
125 Error(
"ResizeTo",
"Dummy");
128 virtual void Allocate(Int_t, Int_t, Int_t, Int_t, Int_t, Int_t)
130 Error(
"Allocate",
"Dummy");
134 static Bool_t
IsZero(Double_t
x, Double_t thresh = 1e-64) {
return x > 0 ? (
x < thresh) : (
x > -thresh); }
153 MultiplyByVec(vecIn.GetMatrixArray(), vecOut.GetMatrixArray());
void Print(Option_t *option="") const override=0
void Swap(int &r, int &c) const
static Bool_t IsZero(Double_t x, Double_t thresh=1e-64)
Bool_t IsSymmetric() const override
Int_t * GetColIndexArray() override
ClassDefOverride(MatrixSq, 1)
TMatrixDBase & SetSub(Int_t, Int_t, const TMatrixDBase &) override
virtual Int_t GetSize() const
const Int_t * GetRowIndexArray() const override
TMatrixDBase & ResizeTo(Int_t, Int_t, Int_t) override
Double_t * GetMatrixArray() override
TMatrixDBase & GetSub(Int_t, Int_t, Int_t, Int_t, TMatrixDBase &, Option_t *) const override
TMatrixDBase & SetColIndexArray(Int_t *) override
const Int_t * GetColIndexArray() const override
virtual void Allocate(Int_t, Int_t, Int_t, Int_t, Int_t, Int_t)
virtual Double_t Query(Int_t rown, Int_t coln) const
virtual void AddToRow(Int_t r, Double_t *valc, Int_t *indc, Int_t n)=0
const Double_t * GetMatrixArray() const override
void Clear(Option_t *option="") override=0
Bool_t fSymmetric
is the matrix symmetric? Only lower triangle is filled
Double_t & operator()(Int_t rown, Int_t coln) override=0
virtual void PrintCOO() const
print matrix in COO sparse format
virtual Float_t GetDensity() const =0
virtual Double_t QueryDiag(Int_t rc) const
virtual void MultiplyByVec(const Double_t *vecIn, Double_t *vecOut) const
fill vecOut by matrix * vecIn (vector should be of the same size as the matrix)
virtual Double_t & DiagElem(Int_t r)=0
virtual Double_t DiagElem(Int_t r) const =0
MatrixSq & operator=(const MatrixSq &src)
= operator
~MatrixSq() override=default
void SetSymmetric(Bool_t v=kTRUE)
TMatrixDBase & SetRowIndexArray(Int_t *) override
TMatrixDBase & ResizeTo(Int_t, Int_t, Int_t, Int_t, Int_t) override
Double_t operator()(Int_t rown, Int_t coln) const override=0
Int_t * GetRowIndexArray() override
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...