cepgen is hosted by Hepforge, IPPP Durham
CepGen N/A
Central exclusive processes event generator

Specialisation of an \(m\times 1\) matrix. More...

#include <include/CepGen/Utils/Algebra.h>

+ Inheritance diagram for Vector:
+ Collaboration diagram for Vector:

Public Types

using Indices = std::pair<size_t, size_t>
 

Public Member Functions

 Vector (size_t num_coord, double def=0.)
 Object constructor.
 
 Vector (const std::initializer_list< double > &)
 Build a vector from a {...} list of double precision floats.
 
 Vector (const VectorRef &)
 Build a vector from a GSL vector view.
 
 Vector (const gsl_vector_const_view &)
 Build a vector from a constant GSL vector view.
 
size_t size () const
 Vector multiplicity (number of lines)
 
Vector subset (size_t min, size_t max=0ull) const
 Extract a subset of the vector.
 
double & operator() (size_t)
 Component access operator.
 
double operator() (size_t) const
 Component retrieval operator.
 
double dot (const Vector &) const
 Scalar product of two vectors.
 
Vector cross (const Vector &) const
 Vector product of two vectors.
 
 operator Vector () const
 Implicit conversion to vector.
 
VectorRef diagonal ()
 Return the diagonal components of the matrix.
 
Vector diagonal () const
 Return the diagonal components of the matrix.
 
size_t numColumns () const
 Number of (vertical) columns.
 
size_t numRows () const
 Number of (horizontal) rows.
 
bool operator== (const Matrix &) const
 Equality operator.
 
bool operator!= (const Matrix &oth) const
 Inequality operator.
 
Matrix subset (size_t min_y, size_t min_x, size_t max_y=0ull, size_t max_x=0ull) const
 Extract a subset of the matrix as a new object.
 
Matrixoperator*= (double)
 Multiplication by a scalar operator.
 
Matrixoperator*= (const Vector &)
 Multiplication by a vector operator.
 
Matrixoperator*= (const Matrix &)
 Multiplication by a matrix operator.
 
Matrixoperator/= (double)
 Division by a scalar operator.
 
Matrix operator- () const
 Unary inverse operator.
 
Matrixoperator+= (const Matrix &)
 Addition of another matrix.
 
Matrixoperator-= (const Matrix &)
 Subtraction of another matrix.
 
double & operator() (size_t, size_t)
 Component access operator.
 
double operator() (size_t, size_t) const
 Component retrieval operator.
 
Vector operator% (const Vector &) const
 Solving operator (from LU decomposition)
 
Indices imin () const
 Index (row, column) of the minimum matrix element.
 
Indices imax () const
 Index (row, column) of the maximum matrix element.
 
double min () const
 Minimum matrix element.
 
double max () const
 Maximum matrix element.
 
bool null () const
 Is the matrix uniformly null?
 
bool positive () const
 Is the matrix positive-defined?
 
bool negative () const
 Is the matrix negative-defined?
 
bool nonNegative () const
 Is the matrix non-negative-defined?
 
Matrixtruncate (double min=1.e-14)
 Truncate (specify minimum non-zero value) for all matrix components.
 
Matrixtranspose ()
 Transpose the matrix.
 
Matrix transposed () const
 Return a transposition of this matrix.
 
Matrixinvert ()
 Invert the matrix.
 
Matrix inverted () const
 Return the inverse of this matrix (LU decomposition)
 
VectorRef column (size_t)
 Return whole column of the matrix.
 
Vector column (size_t) const
 Return whole column of the matrix.
 
VectorRef row (size_t)
 Return whole row of the matrix.
 
Vector row (size_t) const
 Return whole row of the matrix.
 

Static Public Member Functions

static Matrix zero (size_t num_rows, size_t num_cols=0ull)
 Build a zeroed matrix.
 
static Matrix uniform (size_t num_rows, size_t num_cols, double value=1.)
 Build a uniform matrix.
 
static Matrix identity (size_t)
 Build a (square) identity matrix.
 
static Matrix diagonal (const Vector &)
 Build a (square) diagonal matrix from its diagonal vector.
 

Friends

std::ostream & operator<< (std::ostream &, const Vector &)
 Printout of vector components.
 

Detailed Description

Definition at line 139 of file Algebra.h.

Member Typedef Documentation

◆ Indices

using Indices = std::pair<size_t, size_t>
inherited

Definition at line 90 of file Algebra.h.

Constructor & Destructor Documentation

◆ Vector() [1/4]

Vector ( size_t num_coord,
double def = 0. )
explicit
Parameters
[in]num_coordvector multiplicity
[in]defdefault value for all components

◆ Vector() [2/4]

Vector ( const std::initializer_list< double > & )

◆ Vector() [3/4]

Vector ( const VectorRef & )

◆ Vector() [4/4]

Vector ( const gsl_vector_const_view & )

Member Function Documentation

◆ column() [1/2]

VectorRef column ( size_t )
inherited

◆ column() [2/2]

Vector column ( size_t ) const
inherited

◆ cross()

Vector cross ( const Vector & ) const

◆ diagonal() [1/3]

VectorRef diagonal ( )
inherited

◆ diagonal() [2/3]

Vector diagonal ( ) const
inherited

◆ diagonal() [3/3]

static Matrix diagonal ( const Vector & )
staticinherited

◆ dot()

double dot ( const Vector & ) const

◆ identity()

static Matrix identity ( size_t )
staticinherited

◆ imax()

Indices imax ( ) const
inherited

◆ imin()

Indices imin ( ) const
inherited

◆ invert()

Matrix & invert ( )
inherited

◆ inverted()

Matrix inverted ( ) const
inherited

◆ max()

double max ( ) const
inherited

◆ min()

double min ( ) const
inherited

◆ negative()

bool negative ( ) const
inherited

◆ nonNegative()

bool nonNegative ( ) const
inherited

◆ null()

bool null ( ) const
inherited

◆ numColumns()

size_t numColumns ( ) const
inherited

◆ numRows()

size_t numRows ( ) const
inherited

◆ operator Vector()

operator Vector ( ) const
inherited

◆ operator!=()

bool operator!= ( const Matrix & oth) const
inherited

Definition at line 61 of file Algebra.h.

◆ operator%()

Vector operator% ( const Vector & ) const
inherited

◆ operator()() [1/4]

double & operator() ( size_t )

◆ operator()() [2/4]

double operator() ( size_t ) const

◆ operator()() [3/4]

double & operator() ( size_t ,
size_t  )
inherited

◆ operator()() [4/4]

double operator() ( size_t ,
size_t  ) const
inherited

◆ operator*=() [1/3]

Matrix & operator*= ( const Matrix & )
inherited

◆ operator*=() [2/3]

Matrix & operator*= ( const Vector & )
inherited

◆ operator*=() [3/3]

Matrix & operator*= ( double )
inherited

◆ operator+=()

Matrix & operator+= ( const Matrix & )
inherited

◆ operator-()

Matrix operator- ( ) const
inherited

◆ operator-=()

Matrix & operator-= ( const Matrix & )
inherited

◆ operator/=()

Matrix & operator/= ( double )
inherited

◆ operator==()

bool operator== ( const Matrix & ) const
inherited

◆ positive()

bool positive ( ) const
inherited

◆ row() [1/2]

VectorRef row ( size_t )
inherited

◆ row() [2/2]

Vector row ( size_t ) const
inherited

◆ size()

size_t size ( ) const

◆ subset() [1/2]

Vector subset ( size_t min,
size_t max = 0ull ) const
Parameters
[in]minfirst index for the subset
[in]maxlast index for the subset (last element if not specified)

◆ subset() [2/2]

Matrix subset ( size_t min_y,
size_t min_x,
size_t max_y = 0ull,
size_t max_x = 0ull ) const
inherited
Parameters
[in]min_yfirst vertical index for the subset
[in]min_xfirst horizontal index for the subset
[in]max_ylast vertical index for the subset
[in]max_xlast horizontal index for the subset

◆ transpose()

Matrix & transpose ( )
inherited

◆ transposed()

Matrix transposed ( ) const
inherited

◆ truncate()

Matrix & truncate ( double min = 1.e-14)
inherited

◆ uniform()

static Matrix uniform ( size_t num_rows,
size_t num_cols,
double value = 1. )
staticinherited
Parameters
[in]num_rowsnumber of (horizontal) rows for the matrix
[in]num_colsnumber of (vertical) columns for the matrix
[in]valueuniform value for all the matrix components

◆ zero()

static Matrix zero ( size_t num_rows,
size_t num_cols = 0ull )
staticinherited
Parameters
[in]num_rowsnumber of (horizontal) rows for the matrix
[in]num_colsnumber of (vertical) columns for the matrix

Friends And Related Symbol Documentation

◆ operator<<

std::ostream & operator<< ( std::ostream & ,
const Vector &  )
friend