LINE Solver (C++)
Templated C++ port of the LINE queueing solver
Loading...
Searching...
No Matches
line::moment::MomentTensor< T > Struct Template Reference

Joint moment array of size (n_1+1)x...x(n_d+1), stored column major. More...

#include <line/api/moment/moment_tensor.h>

Collaboration diagram for line::moment::MomentTensor< T >:

Public Member Functions

 MomentTensor ()
 MomentTensor (const std::vector< T > &v)
 A plain moment vector, i.e.
 MomentTensor (const std::vector< std::size_t > &extents)
 A zero-filled array of the given extents, with trailing singletons dropped.
std::size_t order () const
std::size_t numel () const
std::size_t stride (std::size_t l) const
 Stride of dimension l in the column-major layout.
std::size_t index (const std::vector< std::size_t > &ord) const
 Linear index of the multi-index ord, whose entries are the moment orders.
const T & at (const std::vector< std::size_t > &ord) const
T & at (const std::vector< std::size_t > &ord)
void normalize ()
 Drops the trailing singleton dimensions, keeping at least one.

Public Attributes

std::vector< std::size_t > sz
std::vector< T > data

Detailed Description

template<class T>
struct line::moment::MomentTensor< T >

Joint moment array of size (n_1+1)x...x(n_d+1), stored column major.

Definition at line 42 of file moment_tensor.h.

Constructor & Destructor Documentation

◆ MomentTensor() [1/3]

template<class T>
line::moment::MomentTensor< T >::MomentTensor ( )
inline

Definition at line 46 of file moment_tensor.h.

References sz.

◆ MomentTensor() [2/3]

template<class T>
line::moment::MomentTensor< T >::MomentTensor ( const std::vector< T > & v)
inlineexplicit

A plain moment vector, i.e.

the d = 1 case.

Definition at line 49 of file moment_tensor.h.

References data, and sz.

◆ MomentTensor() [3/3]

template<class T>
line::moment::MomentTensor< T >::MomentTensor ( const std::vector< std::size_t > & extents)
inlineexplicit

A zero-filled array of the given extents, with trailing singletons dropped.

Definition at line 52 of file moment_tensor.h.

References data, normalize(), numel(), and sz.

Member Function Documentation

◆ at() [1/2]

template<class T>
T & line::moment::MomentTensor< T >::at ( const std::vector< std::size_t > & ord)
inline

Definition at line 85 of file moment_tensor.h.

References data, and index().

◆ at() [2/2]

template<class T>
const T & line::moment::MomentTensor< T >::at ( const std::vector< std::size_t > & ord) const
inline

Definition at line 84 of file moment_tensor.h.

References data, and index().

◆ index()

template<class T>
std::size_t line::moment::MomentTensor< T >::index ( const std::vector< std::size_t > & ord) const
inline

Linear index of the multi-index ord, whose entries are the moment orders.

Definition at line 73 of file moment_tensor.h.

References line::InputError::InputError(), and sz.

Referenced by at(), and at().

◆ normalize()

template<class T>
void line::moment::MomentTensor< T >::normalize ( )
inline

Drops the trailing singleton dimensions, keeping at least one.

Definition at line 88 of file moment_tensor.h.

References sz.

Referenced by MomentTensor().

◆ numel()

template<class T>
std::size_t line::moment::MomentTensor< T >::numel ( ) const
inline

◆ order()

◆ stride()

template<class T>
std::size_t line::moment::MomentTensor< T >::stride ( std::size_t l) const
inline

Stride of dimension l in the column-major layout.

Definition at line 66 of file moment_tensor.h.

References sz.

Referenced by line::moment::moment_joint_central_from_raw(), and line::moment::moment_tensortrans().

Member Data Documentation

◆ data

◆ sz


The documentation for this struct was generated from the following file: