4 #ifndef ROOT_Math_SVector 5 #define ROOT_Math_SVector 74 template <
class T,
unsigned int D>
106 template<
class InputIterator>
113 template<
class InputIterator>
114 explicit SVector(InputIterator
begin,
unsigned int size);
120 SVector(
const T * a,
unsigned int len);
133 SVector(
const T& a1,
const T& a2,
const T& a3);
135 SVector(
const T& a1,
const T& a2,
const T& a3,
const T& a4);
137 SVector(
const T& a1,
const T& a2,
const T& a3,
const T& a4,
140 SVector(
const T& a1,
const T& a2,
const T& a3,
const T& a4,
141 const T& a5,
const T& a6);
143 SVector(
const T& a1,
const T& a2,
const T& a3,
const T& a4,
144 const T& a5,
const T& a6,
const T& a7);
146 SVector(
const T& a1,
const T& a2,
const T& a3,
const T& a4,
147 const T& a5,
const T& a6,
const T& a7,
const T& a8);
149 SVector(
const T& a1,
const T& a2,
const T& a3,
const T& a4,
150 const T& a5,
const T& a6,
const T& a7,
const T& a8,
153 SVector(
const T& a1,
const T& a2,
const T& a3,
const T& a4,
154 const T& a5,
const T& a6,
const T& a7,
const T& a8,
155 const T& a9,
const T& a10);
177 inline static unsigned int Dim() {
return D; }
179 T apply(
unsigned int i)
const;
195 const_iterator
begin()
const;
198 const_iterator
end()
const;
202 template<
class InputIterator>
203 void SetElements(InputIterator begin, InputIterator end);
207 template<
class InputIterator>
208 void SetElements(InputIterator begin,
unsigned int size);
235 bool operator<(const SVector<T,D>& rhs)
const;
241 bool operator<(const VecExpr<A,T,D>& rhs)
const;
248 const T&
At(
unsigned int i)
const;
254 T&
At(
unsigned int i);
299 template <
unsigned int D2>
302 template <
class A,
unsigned int D2>
310 template <
class SubVector >
311 SubVector
Sub(
unsigned int row)
const;
326 std::ostream&
Print(std::ostream& os)
const;
340 template <
class T,
unsigned int D>
341 std::ostream& operator<<(std::ostream& os, const ROOT::Math::SVector<T,D>& rhs);
const T & operator[](unsigned int i) const
read-only access of vector elements. Index starts from 0.
Namespace for new ROOT classes and functions.
const T * Array() const
return read-only pointer to internal array
SVector< T, D > & operator-=(const T &rhs)
self subtraction with a scalar
static unsigned int Dim()
return dimension $D$
std::ostream & Print(std::ostream &os) const
used by operator<<()
const T & At(unsigned int i) const
read-only access of vector elements with check on index. Index starts from 0.
T * iterator
STL iterator interface.
SVector< T, D > & operator/=(const T &rhs)
self division with a scalar
iterator begin()
STL iterator interface.
SVector< T, D > & operator=(const T &a1)
assignment from a scalar (only for size 1 vector)
const T * const_iterator
STL const_iterator interface.
void SetElements(InputIterator begin, InputIterator end)
set vector elements copying the values iterator size must match vector size
SubVector Sub(unsigned int row) const
return a subvector of size N starting at the value row where N is the size of the returned vector (Su...
T apply(unsigned int i) const
access the parse tree. Index starts from zero
bool operator>(const T &rhs) const
element wise comparison
SVector< T, D > & Place_at(const SVector< T, D2 > &rhs, unsigned int row)
place a sub-vector starting from the given position
Namespace for new Math classes and functions.
Expression wrapper class for Vector objects.
bool operator==(const T &rhs) const
element wise comparison
bool operator<(const T &rhs) const
element wise comparison
SVector< T, D > & Unit()
transform vector into a vector of length 1
bool operator!=(const T &rhs) const
element wise comparison
iterator end()
STL iterator interface.
SVector< T, D > & operator+=(const T &rhs)
self addition with a scalar
bool IsInUse(const T *p) const
Function to check if a vector is sharing same memory location of the passed pointer This function is ...
const T & operator()(unsigned int i) const
read-only access of vector elements. Index starts from 0.
SVector< T, D > & operator*=(const T &rhs)
self multiplication with a scalar
T value_type
contained scalar type
SVector()
Default constructor: vector filled with zero values.
SVector: a generic fixed size Vector class.