61 TVectorT(
const TMatrixTRow_const <Element> &mr);
63 TVectorT(
const TMatrixTDiag_const <Element> &md);
92 inline operator std::span<Element>()
94 return std::span<Element>{
data(),
size()};
96 inline operator std::span<const Element>()
const
98 return std::span<const Element>{
data(),
size()};
153 Error(
"operator=(const TVectorT2 &)",
"vectors not compatible");
160 for (
Int_t i = 0; i < this->fNrows; i++)
222 return Use(
v.GetLwb(),
v.GetUpb(),
v.GetMatrixArray());
227 return Use(
v.GetLwb(),
v.GetUpb(),
v.GetMatrixArray());
232 this->
GetSub(row_lwb,row_upb,tmp,option);
242 if (aind >=
fNrows || aind < 0) {
255 if (aind >=
fNrows || aind < 0) {
264template<
class Element>
Bool_t operator== (
const TVectorT <Element> &source1,
const TVectorT <Element> &source2);
267template<
class Element> Element
operator* (
const TVectorT <Element> &source1,
const TVectorT <Element> &source2);
272template<
class Element>
276template<
class Element> Element
Dot (
const TVectorT <Element> &source1,
const TVectorT <Element> &source2);
277template <
class Element1,
class Element2>
278 TMatrixT<Element1>
OuterProduct(
const TVectorT <Element1> &
v1,
const TVectorT <Element2> &
v2);
279template <
class Element1,
class Element2,
class Element3>
280 TMatrixT<Element1> &
OuterProduct( TMatrixT <Element1> &target,
const TVectorT <Element2> &
v1,
const TVectorT <Element3> &
v2);
281template <
class Element1,
class Element2,
class Element3>
282 Element1
Mult (
const TVectorT <Element1> &
v1,
const TMatrixT <Element2> &
m,
const TVectorT <Element3> &
v2);
284template<
class Element> TVectorT<Element> &
Add ( TVectorT <Element> &target, Element scalar,
const TVectorT <Element> &source);
285template<
class Element> TVectorT<Element> &
Add ( TVectorT <Element> &target, Element scalar,
const TMatrixT <Element> &
a,
286 const TVectorT<Element> &source);
287template<
class Element> TVectorT<Element> &
Add ( TVectorT <Element> &target, Element scalar,
const TMatrixTSym <Element> &
a,
288 const TVectorT<Element> &source);
289template<
class Element> TVectorT<Element> &
Add ( TVectorT <Element> &target, Element scalar,
const TMatrixTSparse<Element> &
a,
290 const TVectorT<Element> &source);
291template<
class Element> TVectorT<Element> &
AddElemMult ( TVectorT <Element> &target, Element scalar,
const TVectorT <Element> &source1,
292 const TVectorT <Element> &source2);
293template<
class Element> TVectorT<Element> &
AddElemMult ( TVectorT <Element> &target, Element scalar,
const TVectorT <Element> &source1,
294 const TVectorT <Element> &source2,
const TVectorT <Element> &select);
295template<
class Element> TVectorT<Element> &
AddElemDiv ( TVectorT <Element> &target, Element scalar,
const TVectorT <Element> &source1,
296 const TVectorT <Element> &source2);
297template<
class Element> TVectorT<Element> &
AddElemDiv ( TVectorT <Element> &target, Element scalar,
const TVectorT <Element> &source1,
298 const TVectorT <Element> &source2,
const TVectorT <Element> &select);
299template<
class Element> TVectorT<Element> &
ElementMult ( TVectorT <Element> &target,
const TVectorT <Element> &source);
300template<
class Element> TVectorT<Element> &
ElementMult ( TVectorT <Element> &target,
const TVectorT <Element> &source,
const TVectorT <Element> &select);
301template<
class Element> TVectorT<Element> &
ElementDiv ( TVectorT <Element> &target,
const TVectorT <Element> &source);
302template<
class Element> TVectorT<Element> &
ElementDiv ( TVectorT <Element> &target,
const TVectorT <Element> &source,
const TVectorT <Element> &select);
306template<
class Element1,
class Element2>
Bool_t AreCompatible(
const TMatrixT<Element1> &
m,
const TVectorT<Element2> &
v,
Int_t verbose=0);
307template<
class Element1,
class Element2>
Bool_t AreCompatible(
const TVectorT<Element1> &
v,
const TMatrixT<Element2> &
m,
Int_t verbose=0);
309template<
class Element>
void Compare (
const TVectorT <Element> &source1,
const TVectorT <Element> &source2);
int Int_t
Signed integer 4 bytes (int).
bool Bool_t
Boolean (0=false, 1=true) (bool).
double Double_t
Double 8 bytes.
const char Option_t
Option string (const char).
#define ClassDefOverride(name, id)
Error("WriteTObject","The current directory (%s) is not associated with a file. The object (%s) has not been written.", GetName(), objname)
#define R__ASSERT(e)
Checks condition e and reports a fatal error if it's false.
TClass instances represent classes, structs and namespaces in the ROOT type system.
static Element & NaNValue()
TObject & operator=(const TObject &rhs) noexcept
TObject assignment operator.
Bool_t TestBit(UInt_t f) const
void SetBit(UInt_t f, Bool_t set)
Set or unset the user status bits as specified in f.
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
TObject()
TObject constructor.
TVectorT< Element > & Zero()
Set vector elements to zero.
Bool_t operator>=(Element val) const
Are all vector elements >= val?
Element * New_m(Int_t size)
Return data pointer .
TVectorT< Element > & Apply(const TElementActionT< Element > &action)
Apply action to each element of the vector.
void SetElements(const Element *elements)
const Element * data() const
void Allocate(Int_t nrows, Int_t row_lwb=0, Int_t init=0)
Allocate new vector.
TVectorT< Element > & Sqr()
Square each element of the vector.
TVectorT< Element > & operator-=(const TVectorT< Element > &source)
Subtract vector source.
Element & operator[](Int_t index)
Element Min() const
return minimum vector element value
void Add(const TVectorT< Element > &v1, const TVectorT< Element > &v2)
Set this vector to v1+v2.
Int_t Memcpy_m(Element *newp, const Element *oldp, Int_t copySize, Int_t newSize, Int_t oldSize)
Copy copySize doubles from *oldp to *newp .
Element & operator()(Int_t index)
TVectorT< Element > & Use(TVectorT< Element > &v)
Element Norm1() const
Compute the 1-norm of the vector SUM{ |v[i]| }.
void Delete_m(Int_t size, Element *&)
Delete data pointer m, if it was assigned on the heap.
TVectorT(const TVectorT< Element2 > &another)
Element NormInf() const
Compute the infinity-norm of the vector MAX{ |v[i]| }.
Element Sum() const
Compute sum of elements.
TVectorT(Int_t lwb, Int_t upb, const Element *elements)
Constructor [lwb..upb]-vector with data copied from array elements.
void AddSomeConstant(Element val, const TVectorT< Element > &select)
Add to vector elements as selected through array select the value val.
Bool_t operator!=(Element val) const
Are all vector elements not equal to val?
TVectorT(const TMatrixTRow_const< Element > &mr)
Constructor : create vector from matrix row.
TVectorT< Element > & operator+=(const TVectorT< Element > &source)
Add vector source.
Bool_t MatchesNonZeroPattern(const TVectorT< Element > &select)
Check if vector elements as selected through array select are non-zero.
TVectorT< Element > & GetSub(Int_t row_lwb, Int_t row_upb, TVectorT< Element > &target, Option_t *option="S") const
Get subvector [row_lwb..row_upb]; The indexing range of the returned vector depends on the argument o...
TVectorT< Element > & Shift(Int_t row_shift)
TVectorT< Element > & Abs()
Take an absolute value of a vector, i.e. apply Abs() to each element.
Bool_t operator==(Element val) const
Are all vector elements equal to val?
Bool_t operator>(Element val) const
Are all vector elements > val?
TVectorT< Element > & ResizeTo(Int_t n)
TVectorT< Element > & ResizeTo(Int_t lwb, Int_t upb)
Resize the vector to [lwb:upb] .
TVectorT< Element > & operator=(const TVectorT< Element > &source)
Notice that this assignment does NOT change the ownership : if the storage space was adopted,...
TVectorT< Element > & SetSub(Int_t row_lwb, const TVectorT< Element > &source)
Insert vector source starting at [row_lwb], thereby overwriting the part [row_lwb....
void Randomize(Element alpha, Element beta, Double_t &seed)
randomize vector elements value
TVectorT< Element > & Use(Int_t n, Element *data)
TVectorT(const TVectorT< Element > &another)
Copy constructor.
void Add(const TVectorT< Element > &v)
Add vector v to this vector.
const Element & operator()(Int_t index) const
TVectorT< Element > & operator+=(Element val)
Add val to every element of the vector.
TVectorT< Element > & Use(Int_t lwb, Int_t upb, Element *data)
Use the array data to fill the vector lwb..upb].
const TVectorT< Element > & Use(Int_t lwb, Int_t upb, const Element *data) const
TVectorT(Int_t lwb, Int_t upb)
Constructor [lwb..upb]-vector.
void Clear(Option_t *="") override
TVectorT< Element > & SelectNonZeros(const TVectorT< Element > &select)
Keep only element as selected through array select non-zero.
TVectorT< Element > & operator*=(const TMatrixTSparse< Element > &a)
"Inplace" multiplication target = A*target.
Element Max() const
return maximum vector element value
Bool_t operator<(Element val) const
Are all vector elements < val?
TVectorT< Element > & operator*=(const TMatrixT< Element > &a)
"Inplace" multiplication target = A*target.
TVectorT(const TMatrixTDiag_const< Element > &md)
Constructor : create vector from matrix diagonal.
TVectorT< Element > & Apply(const TElementPosActionT< Element > &action)
Apply action to each element of the vector.
Bool_t operator<=(Element val) const
Are all vector elements <= val?
TVectorT(Int_t n, const Element *elements)
Constructor n-vector with data copied from array elements.
TVectorT< Element > & operator*=(Element val)
Multiply every element of the vector with val.
const TVectorT< Element > & Use(const TVectorT< Element > &v) const
Bool_t SomePositive(const TVectorT< Element > &select)
Check if vector elements as selected through array select are all positive.
const Element & operator[](Int_t index) const
Int_t NonZeros() const
Compute the number of elements != 0.0.
TVectorT< Element > & ResizeTo(const TVectorT< Element > &v)
TVectorT< Element > & operator*=(const TMatrixTSym< Element > &a)
"Inplace" multiplication target = A*target.
TVectorT(Int_t n)
Constructor n-vector.
const TVectorT< Element > & Use(Int_t n, const Element *data) const
TVectorT< Element > & Invert()
v[i] = 1/v[i]
Int_t GetNoElements() const
TVectorT(Int_t lwb, Int_t upb, Double_t iv1,...)
Make a vector and assign initial values.
Element Norm2Sqr() const
Compute the square of the 2-norm SUM{ v[i]^2 }.
void Print(Option_t *option="") const override
Print the vector as a list of elements.
Element * GetMatrixArray()
const Element * GetMatrixArray() const
TVectorT< Element > & operator-=(Element val)
Subtract val from every element of the vector.
Double_t fDataStack[kSizeMax]
TVectorT(const TMatrixTColumn_const< Element > &mc)
Constructor : create vector from matrix column.
TVectorT< Element > GetSub(Int_t row_lwb, Int_t row_upb, Option_t *option="S") const
void Draw(Option_t *option="") override
Draw this vector The histogram is named "TVectorT" by default and no title.
TVectorT< Element > & Sqrt()
Take square root of all elements.
Bool_t VerifyVectorValue(const TVectorT< Element > &m, Element val, Int_t verbose, Element maxDevAllow)
Validate that all elements of vector have value val within maxDevAllow .
TVectorT< Element > & AddElemDiv(TVectorT< Element > &target, Element scalar, const TVectorT< Element > &source1, const TVectorT< Element > &source2)
Modify addition: target += scalar * ElementDiv(source1,source2) .
TMatrixT< Element > operator+(const TMatrixT< Element > &source1, const TMatrixT< Element > &source2)
operation this = source1+source2
void Compare(const TMatrixTBase< Element > &m1, const TMatrixTBase< Element > &m2)
Compare two matrices and print out the result of the comparison.
TMatrixT< Element > & ElementMult(TMatrixT< Element > &target, const TMatrixT< Element > &source)
Multiply target by the source, element-by-element.
TVectorT< Element > & AddElemMult(TVectorT< Element > &target, Element scalar, const TVectorT< Element > &source1, const TVectorT< Element > &source2)
Modify addition: target += scalar * ElementMult(source1,source2) .
TMatrixT< Element > & Add(TMatrixT< Element > &target, Element scalar, const TMatrixT< Element > &source)
Modify addition: target += scalar * source.
TMatrixT< Element1 > OuterProduct(const TVectorT< Element1 > &v1, const TVectorT< Element2 > &v2)
Return the matrix M = v1 * v2'.
Element Dot(const TVectorT< Element > &source1, const TVectorT< Element > &source2)
return inner-produvt v1 . v2
Bool_t VerifyVectorIdentity(const TVectorT< Element > &m1, const TVectorT< Element > &m2, Int_t verbose, Element maxDevAllow)
Verify that elements of the two vectors are equal within maxDevAllow .
TMatrixT< Element > & ElementDiv(TMatrixT< Element > &target, const TMatrixT< Element > &source)
Divide target by the source, element-by-element.
Element1 Mult(const TVectorT< Element1 > &v1, const TMatrixT< Element2 > &m, const TVectorT< Element3 > &v2)
Perform v1 * M * v2, a scalar result.
TMatrixT< Element > operator-(const TMatrixT< Element > &source1, const TMatrixT< Element > &source2)
operation this = source1-source2
Bool_t AreCompatible(const TVectorT< Element1 > &v1, const TVectorT< Element2 > &v2, Int_t verbose=0)
Check if v1 and v2 are both valid and have the same shape.
Bool_t operator==(const TMatrixTBase< Element > &m1, const TMatrixTBase< Element > &m2)
Check to see if two matrices are identical.
TMatrixT< Element > operator*(Element val, const TMatrixT< Element > &source)
operation this = val*source
Bool_t AreCompatible(const TMatrixTBase< Element1 > &m1, const TMatrixTBase< Element2 > &m2, Int_t verbose=0)
Check that matrice sm1 and m2 areboth valid and have identical shapes .