class Rivet::Vector

Rivet::Vector

A minimal base class for ( N )-dimensional vectors. More…

#include <VectorN.hh>

Public Types

Name
using Eigen::Matrix< double, N, 1 >EVector
Vector.

Public Functions

Name
Vector()
Vector(const Vector< N > & other)
const double &get(const size_t index) const
double &get(const size_t index)
const double &operator[](const size_t index) const
Direct access to vector elements by index.
double &operator[](const size_t index)
Direct access to vector elements by index.
Vector< N > &set(const size_t index, const double value)
Set indexed value.
constexpr size_tsize() const
Vector dimensionality.
boolisZero(double tolerance =1E-5) const
Check for nullness, allowing for numerical precision.
doublemod2() const
Calculate the modulus-squared of a vector. ( \sum_{i=1}^N x_i^2 ).
doublemod() const
Calculate the modulus of a vector. ( \sqrt{\sum_{i=1}^N x_i^2} ).
Vector< N >operator-() const
Invert the vector.
booloperator==(const Vector< N > & a) const
booloperator!=(const Vector< N > & a) const

Friends

Name
Vector< M >multiply(const Matrix< M > & a, const Vector< M > & b)

Detailed Description

template <size_t N>
class Rivet::Vector;

A minimal base class for ( N )-dimensional vectors.

Public Types Documentation

using EVector

using Rivet::Vector< N >::EVector =  Eigen::Matrix<double,N,1>;

Vector.

Public Functions Documentation

function Vector

inline Vector()

function Vector

inline Vector(
    const Vector< N > & other
)

function get

inline const double & get(
    const size_t index
) const

function get

inline double & get(
    const size_t index
)

function operator[]

inline const double & operator[](
    const size_t index
) const

Direct access to vector elements by index.

function operator[]

inline double & operator[](
    const size_t index
)

Direct access to vector elements by index.

function set

inline Vector< N > & set(
    const size_t index,
    const double value
)

Set indexed value.

function size

inline constexpr size_t size() const

Vector dimensionality.

function isZero

inline bool isZero(
    double tolerance =1E-5
) const

Check for nullness, allowing for numerical precision.

function mod2

inline double mod2() const

Calculate the modulus-squared of a vector. ( \sum_{i=1}^N x_i^2 ).

function mod

inline double mod() const

Calculate the modulus of a vector. ( \sqrt{\sum_{i=1}^N x_i^2} ).

function operator-

inline Vector< N > operator-() const

Invert the vector.

function operator==

inline bool operator==(
    const Vector< N > & a
) const

function operator!=

inline bool operator!=(
    const Vector< N > & a
) const

Friends

friend multiply

friend Vector< M > multiply(
    const Matrix< M > & a,

    const Vector< M > & b
);

Updated on 2022-08-07 at 20:17:17 +0100