LINE Solver (C++)
Templated C++ port of the LINE queueing solver
Loading...
Searching...
No Matches
moment_tensor.h File Reference

Joint moment arrays and the mode products used by every joint conversion. More...

#include <vector>
#include "line/api/moment/moment_housematrix.h"
#include "line/num/number.h"
#include "line/util/error.h"
#include "line/util/matrix.h"
Include dependency graph for moment_tensor.h:

Go to the source code of this file.

Classes

struct  line::moment::MomentTensor< T >
 Joint moment array of size (n_1+1)x...x(n_d+1), stored column major. More...

Namespaces

namespace  line
namespace  line::moment

Functions

template<class T>
std::vector< std::size_t > line::moment::moment_tensorsize (const MomentTensor< T > &A)
 Extents with the trailing singleton dimensions removed.
template<class T>
MomentTensor< T > line::moment::moment_tensortrans (const MomentTensor< T > &A, const Matrix< T > &Tm, std::size_t mode)
 Mode product: every fibre of A along dimension mode is replaced by Tm times that fibre.
template<class T>
MomentTensor< T > line::moment::moment_jointtrans (const MomentTensor< T > &A, MomentEdge edge)
 Applies the conversion matrix of one edge along every dimension of A.
template<class T>
MomentTensor< T > line::moment::moment_jointtrans (const MomentTensor< T > &A, const std::string &edge)
 String overload matching the MATLAB call signature.

Detailed Description

Joint moment arrays and the mode products used by every joint conversion.

Templated port of matlab/src/api/moment/moment_tensorsize.m, moment_tensortrans.m and moment_jointtrans.m.

The storage is COLUMN MAJOR, matching the MATLAB linear index exactly, so the stride of dimension l is prod(sz(1:l-1)). Trailing singleton dimensions are dropped on construction, which is the MATLAB convention that moment_tensorsize enforces: a column vector of n+1 entries and an (n+1)x1 array of a degenerate second class are the same object, and both are read as the d = 1 case.

The mode argument here is 0-BASED, unlike the 1-based MATLAB argument.

Reference: A. Heindl and A. van de Liefvoort. Moment conversions for discrete distributions. PMCCS, 2003.

Definition in file moment_tensor.h.