pub struct Triangular<F> { /* private fields */ }
Expand description

Triangular matrix representation.

As the Markov chain underlying an APH distribution has no cycles, its infinitesimal generator matrix has the form

$$ \begin{pmatrix} d(1) & \lambda_{1,2} & \cdots & \lambda_{1,N} & \lambda_{1,N+1} \\ 0 & d(2) & \cdots & \lambda_{2,N} & \lambda_{2,N+1} \\ \vdots & \vdots & \ddots & \vdots & \vdots \\ 0 & 0 & \cdots & d(N) & \lambda_{N,N+1} \\ 0 & 0 & \cdots & 0 & 0 \end{pmatrix} $$

where the diagonal is given by:

$$ d(i) := -\sum_{k=i + 1}^{N} \lambda_{i,k} $$

To store the matrix, it thus suffices to store the values for all $\lambda_{i,j}$ with $1 \leq i < j \leq N + 1$.

⚠️ Rows and columns are 0-indexed in the implementation.

Implementations

Creates a new triangular representation of the given size.

Sets the value at the given row and column.

Panics

Panics if column is not greater than row or if the access is out-of-bounds.

Returns the value at the given row and column.

Panics

Panics if the access is out-of-bounds.

Computes the value of the diagonal of the given row.

Panics

Panics if the access is out-of-bounds

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

The size $N$ of the APH representation.

Returns the value at the given row and column. Read more

Returns the value at the diagonal of the given row.

The dimension of the generator matrix.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Casts the value.

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Casts the value.

Casts the value.

Casts the value.

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Casts the value.

OverflowingCasts the value.

Casts the value.

Casts the value.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

Casts the value.

UnwrappedCasts the value.

Casts the value.

WrappingCasts the value.