Vital
Loading...
Searching...
No Matches
vital::matrix Struct Reference

A structure representing a 4x1 matrix of poly_float rows. More...

#include <matrix.h>

Public Member Functions

 matrix ()
 Default constructor leaves rows uninitialized.
 
 matrix (poly_float r0, poly_float r1, poly_float r2, poly_float r3)
 Constructs a matrix with specified rows.
 
force_inline void transpose ()
 Transposes the matrix in-place.
 
force_inline void interpolateColumns (const matrix &other, poly_float t)
 Linearly interpolates each column of the matrix towards another matrix.
 
force_inline void interpolateRows (const matrix &other, poly_float t)
 Performs row-wise interpolation, using a separate interpolation factor from each row of t.
 
force_inline poly_float sumRows ()
 Sums all the rows together.
 
force_inline poly_float multiplyAndSumRows (const matrix &other)
 Multiplies and sums corresponding rows of this matrix with another matrix.
 

Public Attributes

poly_float row0
 
poly_float row1
 
poly_float row2
 
poly_float row3
 The four rows of the matrix as poly_float values.
 

Detailed Description

A structure representing a 4x1 matrix of poly_float rows.

This structure holds four poly_float rows and provides utility functions for operations such as transposing and interpolating between matrix states. It is designed to work with poly_float, a SIMD-friendly vector type used throughout Vital's DSP code.

Each rowN is a poly_float vector representing one row of the matrix. Although named "matrix," it essentially acts as a 4-row structure that can be manipulated for certain vectorized math operations, including transposing these rows into columns and performing interpolations.

Constructor & Destructor Documentation

◆ matrix() [1/2]

vital::matrix::matrix ( )
inline

Default constructor leaves rows uninitialized.

◆ matrix() [2/2]

vital::matrix::matrix ( poly_float r0,
poly_float r1,
poly_float r2,
poly_float r3 )
inline

Constructs a matrix with specified rows.

Parameters
r0The first row.
r1The second row.
r2The third row.
r3The fourth row.

Member Function Documentation

◆ interpolateColumns()

force_inline void vital::matrix::interpolateColumns ( const matrix & other,
poly_float t )
inline

Linearly interpolates each column of the matrix towards another matrix.

The same interpolation factor t is applied to each column.

Parameters
otherThe target matrix to interpolate towards.
tThe interpolation factor (0.0 = original, 1.0 = other).

◆ interpolateRows()

force_inline void vital::matrix::interpolateRows ( const matrix & other,
poly_float t )
inline

Performs row-wise interpolation, using a separate interpolation factor from each row of t.

Each element of t corresponds to one row.

Parameters
otherThe target matrix to interpolate towards.
tA poly_float containing individual interpolation factors per row.

◆ multiplyAndSumRows()

force_inline poly_float vital::matrix::multiplyAndSumRows ( const matrix & other)
inline

Multiplies and sums corresponding rows of this matrix with another matrix.

Parameters
otherThe other matrix to multiply and sum rows with.
Returns
A poly_float representing the sum of the element-wise products of corresponding rows.

◆ sumRows()

force_inline poly_float vital::matrix::sumRows ( )
inline

Sums all the rows together.

Returns
A poly_float representing the element-wise sum of row0, row1, row2, and row3.

◆ transpose()

force_inline void vital::matrix::transpose ( )
inline

Transposes the matrix in-place.

This uses poly_float's static transpose function, effectively transposing 4x1 vectors treating them as a 4x4 set of values for vector operations.

Member Data Documentation

◆ row0

poly_float vital::matrix::row0

◆ row1

poly_float vital::matrix::row1

◆ row2

poly_float vital::matrix::row2

◆ row3

poly_float vital::matrix::row3

The four rows of the matrix as poly_float values.


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