WPILibC++ 2027.0.0-alpha-2
Loading...
Searching...
No Matches
slp::VariableMatrix Class Reference

A matrix of autodiff variables. More...

#include </home/runner/work/allwpilib/allwpilib/wpimath/src/main/native/thirdparty/sleipnir/include/sleipnir/autodiff/variable_matrix.hpp>

Classes

class  const_iterator
 
struct  empty_t
 Type tag used to designate an uninitialized VariableMatrix. More...
 
class  iterator
 

Public Member Functions

 VariableMatrix ()=default
 Constructs an empty VariableMatrix.
 
 VariableMatrix (int rows)
 Constructs a VariableMatrix column vector with the given rows.
 
 VariableMatrix (int rows, int cols)
 Constructs a zero-initialized VariableMatrix with the given dimensions.
 
 VariableMatrix (empty_t, int rows, int cols)
 Constructs an empty VariableMatrix with the given dimensions.
 
 VariableMatrix (std::initializer_list< std::initializer_list< Variable > > list)
 Constructs a scalar VariableMatrix from a nested list of Variables.
 
 VariableMatrix (const std::vector< std::vector< double > > &list)
 Constructs a scalar VariableMatrix from a nested list of doubles.
 
 VariableMatrix (const std::vector< std::vector< Variable > > &list)
 Constructs a scalar VariableMatrix from a nested list of Variables.
 
template<typename Derived >
 VariableMatrix (const Eigen::MatrixBase< Derived > &values)
 Constructs a VariableMatrix from an Eigen matrix.
 
template<typename Derived >
 VariableMatrix (const Eigen::DiagonalBase< Derived > &values)
 Constructs a VariableMatrix from an Eigen diagonal matrix.
 
template<typename Derived >
VariableMatrixoperator= (const Eigen::MatrixBase< Derived > &values)
 Assigns an Eigen matrix to a VariableMatrix.
 
VariableMatrixoperator= (ScalarLike auto value)
 Assigns a double to the matrix.
 
template<typename Derived >
requires std::same_as<typename Derived::Scalar, double>
void set_value (const Eigen::MatrixBase< Derived > &values)
 Sets the VariableMatrix's internal values.
 
 VariableMatrix (const Variable &variable)
 Constructs a scalar VariableMatrix from a Variable.
 
 VariableMatrix (Variable &&variable)
 Constructs a scalar VariableMatrix from a Variable.
 
 VariableMatrix (const VariableBlock< VariableMatrix > &values)
 Constructs a VariableMatrix from a VariableBlock.
 
 VariableMatrix (const VariableBlock< const VariableMatrix > &values)
 Constructs a VariableMatrix from a VariableBlock.
 
 VariableMatrix (std::span< const Variable > values)
 Constructs a column vector wrapper around a Variable array.
 
 VariableMatrix (std::span< const Variable > values, int rows, int cols)
 Constructs a matrix wrapper around a Variable array.
 
Variableoperator() (int row, int col)
 Returns a block pointing to the given row and column.
 
const Variableoperator() (int row, int col) const
 Returns a block pointing to the given row and column.
 
Variableoperator[] (int row)
 Returns a block pointing to the given row.
 
const Variableoperator[] (int row) const
 Returns a block pointing to the given row.
 
VariableBlock< VariableMatrixblock (int row_offset, int col_offset, int block_rows, int block_cols)
 Returns a block of the variable matrix.
 
const VariableBlock< const VariableMatrixblock (int row_offset, int col_offset, int block_rows, int block_cols) const
 Returns a block of the variable matrix.
 
VariableBlock< VariableMatrixoperator() (Slice row_slice, Slice col_slice)
 Returns a slice of the variable matrix.
 
const VariableBlock< const VariableMatrixoperator() (Slice row_slice, Slice col_slice) const
 Returns a slice of the variable matrix.
 
VariableBlock< VariableMatrixoperator() (Slice row_slice, int row_slice_length, Slice col_slice, int col_slice_length)
 Returns a slice of the variable matrix.
 
const VariableBlock< const VariableMatrixoperator() (Slice row_slice, int row_slice_length, Slice col_slice, int col_slice_length) const
 Returns a slice of the variable matrix.
 
VariableBlock< VariableMatrixsegment (int offset, int length)
 Returns a segment of the variable vector.
 
const VariableBlock< const VariableMatrixsegment (int offset, int length) const
 Returns a segment of the variable vector.
 
VariableBlock< VariableMatrixrow (int row)
 Returns a row slice of the variable matrix.
 
const VariableBlock< const VariableMatrixrow (int row) const
 Returns a row slice of the variable matrix.
 
VariableBlock< VariableMatrixcol (int col)
 Returns a column slice of the variable matrix.
 
const VariableBlock< const VariableMatrixcol (int col) const
 Returns a column slice of the variable matrix.
 
VariableMatrixoperator*= (const MatrixLike auto &rhs)
 Compound matrix multiplication-assignment operator.
 
VariableMatrixoperator*= (const ScalarLike auto &rhs)
 Compound matrix-scalar multiplication-assignment operator.
 
VariableMatrixoperator/= (const ScalarLike auto &rhs)
 Compound matrix division-assignment operator.
 
VariableMatrixoperator+= (const MatrixLike auto &rhs)
 Compound addition-assignment operator.
 
VariableMatrixoperator+= (const ScalarLike auto &rhs)
 Compound addition-assignment operator.
 
VariableMatrixoperator-= (const MatrixLike auto &rhs)
 Compound subtraction-assignment operator.
 
VariableMatrixoperator-= (const ScalarLike auto &rhs)
 Compound subtraction-assignment operator.
 
 operator Variable () const
 Implicit conversion operator from 1x1 VariableMatrix to Variable.
 
VariableMatrix T () const
 Returns the transpose of the variable matrix.
 
int rows () const
 Returns the number of rows in the matrix.
 
int cols () const
 Returns the number of columns in the matrix.
 
double value (int row, int col)
 Returns an element of the variable matrix.
 
double value (int index)
 Returns a row of the variable column vector.
 
Eigen::MatrixXd value ()
 Returns the contents of the variable matrix.
 
VariableMatrix cwise_transform (function_ref< Variable(const Variable &x)> unary_op) const
 Transforms the matrix coefficient-wise with an unary operator.
 
iterator begin ()
 Returns begin iterator.
 
iterator end ()
 Returns end iterator.
 
const_iterator begin () const
 Returns begin iterator.
 
const_iterator end () const
 Returns end iterator.
 
const_iterator cbegin () const
 Returns begin iterator.
 
const_iterator cend () const
 Returns end iterator.
 
size_t size () const
 Returns number of elements in matrix.
 

Static Public Member Functions

static VariableMatrix zero (int rows, int cols)
 Returns a variable matrix filled with zeroes.
 
static VariableMatrix ones (int rows, int cols)
 Returns a variable matrix filled with ones.
 

Static Public Attributes

static constexpr empty_t empty {}
 Designates an uninitialized VariableMatrix.
 

Friends

template<MatrixLike LHS, MatrixLike RHS>
requires SleipnirMatrixLike<LHS> || SleipnirMatrixLike<RHS>
SLEIPNIR_DLLEXPORT VariableMatrix operator* (const LHS &lhs, const RHS &rhs)
 Matrix multiplication operator.
 
SLEIPNIR_DLLEXPORT VariableMatrix operator* (const SleipnirMatrixLike auto &lhs, const ScalarLike auto &rhs)
 Matrix-scalar multiplication operator.
 
SLEIPNIR_DLLEXPORT VariableMatrix operator* (const MatrixLike auto &lhs, const Variable &rhs)
 Matrix-scalar multiplication operator.
 
SLEIPNIR_DLLEXPORT VariableMatrix operator* (const ScalarLike auto &lhs, const SleipnirMatrixLike auto &rhs)
 Scalar-matrix multiplication operator.
 
SLEIPNIR_DLLEXPORT VariableMatrix operator* (const Variable &lhs, const MatrixLike auto &rhs)
 Scalar-matrix multiplication operator.
 
SLEIPNIR_DLLEXPORT VariableMatrix operator/ (const MatrixLike auto &lhs, const ScalarLike auto &rhs)
 Binary division operator.
 
template<MatrixLike LHS, MatrixLike RHS>
requires SleipnirMatrixLike<LHS> || SleipnirMatrixLike<RHS>
SLEIPNIR_DLLEXPORT VariableMatrix operator+ (const LHS &lhs, const RHS &rhs)
 Binary addition operator.
 
template<MatrixLike LHS, MatrixLike RHS>
requires SleipnirMatrixLike<LHS> || SleipnirMatrixLike<RHS>
SLEIPNIR_DLLEXPORT VariableMatrix operator- (const LHS &lhs, const RHS &rhs)
 Binary subtraction operator.
 
SLEIPNIR_DLLEXPORT VariableMatrix operator- (const SleipnirMatrixLike auto &lhs)
 Unary minus operator.
 

Detailed Description

A matrix of autodiff variables.

Constructor & Destructor Documentation

◆ VariableMatrix() [1/15]

slp::VariableMatrix::VariableMatrix ( )
default

Constructs an empty VariableMatrix.

◆ VariableMatrix() [2/15]

slp::VariableMatrix::VariableMatrix ( int rows)
inlineexplicit

Constructs a VariableMatrix column vector with the given rows.

Parameters
rowsThe number of matrix rows.

◆ VariableMatrix() [3/15]

slp::VariableMatrix::VariableMatrix ( int rows,
int cols )
inline

Constructs a zero-initialized VariableMatrix with the given dimensions.

Parameters
rowsThe number of matrix rows.
colsThe number of matrix columns.

◆ VariableMatrix() [4/15]

slp::VariableMatrix::VariableMatrix ( empty_t ,
int rows,
int cols )
inline

Constructs an empty VariableMatrix with the given dimensions.

Parameters
rowsThe number of matrix rows.
colsThe number of matrix columns.

◆ VariableMatrix() [5/15]

slp::VariableMatrix::VariableMatrix ( std::initializer_list< std::initializer_list< Variable > > list)
inline

Constructs a scalar VariableMatrix from a nested list of Variables.

Parameters
listThe nested list of Variables.

◆ VariableMatrix() [6/15]

slp::VariableMatrix::VariableMatrix ( const std::vector< std::vector< double > > & list)
inline

Constructs a scalar VariableMatrix from a nested list of doubles.

This overload is for Python bindings only.

Parameters
listThe nested list of Variables.

◆ VariableMatrix() [7/15]

slp::VariableMatrix::VariableMatrix ( const std::vector< std::vector< Variable > > & list)
inline

Constructs a scalar VariableMatrix from a nested list of Variables.

This overload is for Python bindings only.

Parameters
listThe nested list of Variables.

◆ VariableMatrix() [8/15]

template<typename Derived >
slp::VariableMatrix::VariableMatrix ( const Eigen::MatrixBase< Derived > & values)
inline

Constructs a VariableMatrix from an Eigen matrix.

Parameters
valuesEigen matrix of values.

◆ VariableMatrix() [9/15]

template<typename Derived >
slp::VariableMatrix::VariableMatrix ( const Eigen::DiagonalBase< Derived > & values)
inline

Constructs a VariableMatrix from an Eigen diagonal matrix.

Parameters
valuesDiagonal matrix of values.

◆ VariableMatrix() [10/15]

slp::VariableMatrix::VariableMatrix ( const Variable & variable)
inline

Constructs a scalar VariableMatrix from a Variable.

Parameters
variableVariable.

◆ VariableMatrix() [11/15]

slp::VariableMatrix::VariableMatrix ( Variable && variable)
inline

Constructs a scalar VariableMatrix from a Variable.

Parameters
variableVariable.

◆ VariableMatrix() [12/15]

slp::VariableMatrix::VariableMatrix ( const VariableBlock< VariableMatrix > & values)
inline

Constructs a VariableMatrix from a VariableBlock.

Parameters
valuesVariableBlock of values.

◆ VariableMatrix() [13/15]

slp::VariableMatrix::VariableMatrix ( const VariableBlock< const VariableMatrix > & values)
inline

Constructs a VariableMatrix from a VariableBlock.

Parameters
valuesVariableBlock of values.

◆ VariableMatrix() [14/15]

slp::VariableMatrix::VariableMatrix ( std::span< const Variable > values)
inlineexplicit

Constructs a column vector wrapper around a Variable array.

Parameters
valuesVariable array to wrap.

◆ VariableMatrix() [15/15]

slp::VariableMatrix::VariableMatrix ( std::span< const Variable > values,
int rows,
int cols )
inline

Constructs a matrix wrapper around a Variable array.

Parameters
valuesVariable array to wrap.
rowsThe number of matrix rows.
colsThe number of matrix columns.

Member Function Documentation

◆ begin() [1/2]

iterator slp::VariableMatrix::begin ( )
inline

Returns begin iterator.

Returns
Begin iterator.

◆ begin() [2/2]

const_iterator slp::VariableMatrix::begin ( ) const
inline

Returns begin iterator.

Returns
Begin iterator.

◆ block() [1/2]

VariableBlock< VariableMatrix > slp::VariableMatrix::block ( int row_offset,
int col_offset,
int block_rows,
int block_cols )
inline

Returns a block of the variable matrix.

Parameters
row_offsetThe row offset of the block selection.
col_offsetThe column offset of the block selection.
block_rowsThe number of rows in the block selection.
block_colsThe number of columns in the block selection.
Returns
A block of the variable matrix.

◆ block() [2/2]

const VariableBlock< const VariableMatrix > slp::VariableMatrix::block ( int row_offset,
int col_offset,
int block_rows,
int block_cols ) const
inline

Returns a block of the variable matrix.

Parameters
row_offsetThe row offset of the block selection.
col_offsetThe column offset of the block selection.
block_rowsThe number of rows in the block selection.
block_colsThe number of columns in the block selection.
Returns
A block of the variable matrix.

◆ cbegin()

const_iterator slp::VariableMatrix::cbegin ( ) const
inline

Returns begin iterator.

Returns
Begin iterator.

◆ cend()

const_iterator slp::VariableMatrix::cend ( ) const
inline

Returns end iterator.

Returns
End iterator.

◆ col() [1/2]

VariableBlock< VariableMatrix > slp::VariableMatrix::col ( int col)
inline

Returns a column slice of the variable matrix.

Parameters
colThe column to slice.
Returns
A column slice of the variable matrix.

◆ col() [2/2]

const VariableBlock< const VariableMatrix > slp::VariableMatrix::col ( int col) const
inline

Returns a column slice of the variable matrix.

Parameters
colThe column to slice.
Returns
A column slice of the variable matrix.

◆ cols()

int slp::VariableMatrix::cols ( ) const
inline

Returns the number of columns in the matrix.

Returns
The number of columns in the matrix.

◆ cwise_transform()

VariableMatrix slp::VariableMatrix::cwise_transform ( function_ref< Variable(const Variable &x)> unary_op) const
inline

Transforms the matrix coefficient-wise with an unary operator.

Parameters
unary_opThe unary operator to use for the transform operation.
Returns
Result of the unary operator.

◆ end() [1/2]

iterator slp::VariableMatrix::end ( )
inline

Returns end iterator.

Returns
End iterator.

◆ end() [2/2]

const_iterator slp::VariableMatrix::end ( ) const
inline

Returns end iterator.

Returns
End iterator.

◆ ones()

static VariableMatrix slp::VariableMatrix::ones ( int rows,
int cols )
inlinestatic

Returns a variable matrix filled with ones.

Parameters
rowsThe number of matrix rows.
colsThe number of matrix columns.
Returns
A variable matrix filled with ones.

◆ operator Variable()

slp::VariableMatrix::operator Variable ( ) const
inline

Implicit conversion operator from 1x1 VariableMatrix to Variable.

◆ operator()() [1/6]

Variable & slp::VariableMatrix::operator() ( int row,
int col )
inline

Returns a block pointing to the given row and column.

Parameters
rowThe block row.
colThe block column.
Returns
A block pointing to the given row and column.

◆ operator()() [2/6]

const Variable & slp::VariableMatrix::operator() ( int row,
int col ) const
inline

Returns a block pointing to the given row and column.

Parameters
rowThe block row.
colThe block column.
Returns
A block pointing to the given row and column.

◆ operator()() [3/6]

VariableBlock< VariableMatrix > slp::VariableMatrix::operator() ( Slice row_slice,
int row_slice_length,
Slice col_slice,
int col_slice_length )
inline

Returns a slice of the variable matrix.

The given slices aren't adjusted. This overload is for Python bindings only.

Parameters
row_sliceThe row slice.
row_slice_lengthThe row slice length.
col_sliceThe column slice.
col_slice_lengthThe column slice length.
Returns
A slice of the variable matrix.

◆ operator()() [4/6]

const VariableBlock< const VariableMatrix > slp::VariableMatrix::operator() ( Slice row_slice,
int row_slice_length,
Slice col_slice,
int col_slice_length ) const
inline

Returns a slice of the variable matrix.

The given slices aren't adjusted. This overload is for Python bindings only.

Parameters
row_sliceThe row slice.
row_slice_lengthThe row slice length.
col_sliceThe column slice.
col_slice_lengthThe column slice length.
Returns
A slice of the variable matrix.

◆ operator()() [5/6]

VariableBlock< VariableMatrix > slp::VariableMatrix::operator() ( Slice row_slice,
Slice col_slice )
inline

Returns a slice of the variable matrix.

Parameters
row_sliceThe row slice.
col_sliceThe column slice.
Returns
A slice of the variable matrix.

◆ operator()() [6/6]

const VariableBlock< const VariableMatrix > slp::VariableMatrix::operator() ( Slice row_slice,
Slice col_slice ) const
inline

Returns a slice of the variable matrix.

Parameters
row_sliceThe row slice.
col_sliceThe column slice.
Returns
A slice of the variable matrix.

◆ operator*=() [1/2]

VariableMatrix & slp::VariableMatrix::operator*= ( const MatrixLike auto & rhs)
inline

Compound matrix multiplication-assignment operator.

Parameters
rhsVariable to multiply.
Returns
Result of multiplication.

◆ operator*=() [2/2]

VariableMatrix & slp::VariableMatrix::operator*= ( const ScalarLike auto & rhs)
inline

Compound matrix-scalar multiplication-assignment operator.

Parameters
rhsVariable to multiply.
Returns
Result of multiplication.

◆ operator+=() [1/2]

VariableMatrix & slp::VariableMatrix::operator+= ( const MatrixLike auto & rhs)
inline

Compound addition-assignment operator.

Parameters
rhsVariable to add.
Returns
Result of addition.

◆ operator+=() [2/2]

VariableMatrix & slp::VariableMatrix::operator+= ( const ScalarLike auto & rhs)
inline

Compound addition-assignment operator.

Parameters
rhsVariable to add.
Returns
Result of addition.

◆ operator-=() [1/2]

VariableMatrix & slp::VariableMatrix::operator-= ( const MatrixLike auto & rhs)
inline

Compound subtraction-assignment operator.

Parameters
rhsVariable to subtract.
Returns
Result of subtraction.

◆ operator-=() [2/2]

VariableMatrix & slp::VariableMatrix::operator-= ( const ScalarLike auto & rhs)
inline

Compound subtraction-assignment operator.

Parameters
rhsVariable to subtract.
Returns
Result of subtraction.

◆ operator/=()

VariableMatrix & slp::VariableMatrix::operator/= ( const ScalarLike auto & rhs)
inline

Compound matrix division-assignment operator.

Parameters
rhsVariable to divide.
Returns
Result of division.

◆ operator=() [1/2]

template<typename Derived >
VariableMatrix & slp::VariableMatrix::operator= ( const Eigen::MatrixBase< Derived > & values)
inline

Assigns an Eigen matrix to a VariableMatrix.

Parameters
valuesEigen matrix of values.
Returns
This VariableMatrix.

◆ operator=() [2/2]

VariableMatrix & slp::VariableMatrix::operator= ( ScalarLike auto value)
inline

Assigns a double to the matrix.

This only works for matrices with one row and one column.

Parameters
valueValue to assign.
Returns
This VariableMatrix.

◆ operator[]() [1/2]

Variable & slp::VariableMatrix::operator[] ( int row)
inline

Returns a block pointing to the given row.

Parameters
rowThe block row.
Returns
A block pointing to the given row.

◆ operator[]() [2/2]

const Variable & slp::VariableMatrix::operator[] ( int row) const
inline

Returns a block pointing to the given row.

Parameters
rowThe block row.
Returns
A block pointing to the given row.

◆ row() [1/2]

VariableBlock< VariableMatrix > slp::VariableMatrix::row ( int row)
inline

Returns a row slice of the variable matrix.

Parameters
rowThe row to slice.
Returns
A row slice of the variable matrix.

◆ row() [2/2]

const VariableBlock< const VariableMatrix > slp::VariableMatrix::row ( int row) const
inline

Returns a row slice of the variable matrix.

Parameters
rowThe row to slice.
Returns
A row slice of the variable matrix.

◆ rows()

int slp::VariableMatrix::rows ( ) const
inline

Returns the number of rows in the matrix.

Returns
The number of rows in the matrix.

◆ segment() [1/2]

VariableBlock< VariableMatrix > slp::VariableMatrix::segment ( int offset,
int length )
inline

Returns a segment of the variable vector.

Parameters
offsetThe offset of the segment.
lengthThe length of the segment.
Returns
A segment of the variable vector.

◆ segment() [2/2]

const VariableBlock< const VariableMatrix > slp::VariableMatrix::segment ( int offset,
int length ) const
inline

Returns a segment of the variable vector.

Parameters
offsetThe offset of the segment.
lengthThe length of the segment.
Returns
A segment of the variable vector.

◆ set_value()

template<typename Derived >
requires std::same_as<typename Derived::Scalar, double>
void slp::VariableMatrix::set_value ( const Eigen::MatrixBase< Derived > & values)
inline

Sets the VariableMatrix's internal values.

Parameters
valuesEigen matrix of values.

◆ size()

size_t slp::VariableMatrix::size ( ) const
inline

Returns number of elements in matrix.

Returns
Number of elements in matrix.

◆ T()

VariableMatrix slp::VariableMatrix::T ( ) const
inline

Returns the transpose of the variable matrix.

Returns
The transpose of the variable matrix.

◆ value() [1/3]

Eigen::MatrixXd slp::VariableMatrix::value ( )
inline

Returns the contents of the variable matrix.

Returns
The contents of the variable matrix.

◆ value() [2/3]

double slp::VariableMatrix::value ( int index)
inline

Returns a row of the variable column vector.

Parameters
indexThe index of the element to return.
Returns
A row of the variable column vector.

◆ value() [3/3]

double slp::VariableMatrix::value ( int row,
int col )
inline

Returns an element of the variable matrix.

Parameters
rowThe row of the element to return.
colThe column of the element to return.
Returns
An element of the variable matrix.

◆ zero()

static VariableMatrix slp::VariableMatrix::zero ( int rows,
int cols )
inlinestatic

Returns a variable matrix filled with zeroes.

Parameters
rowsThe number of matrix rows.
colsThe number of matrix columns.
Returns
A variable matrix filled with zeroes.

Friends And Related Symbol Documentation

◆ operator* [1/5]

template<MatrixLike LHS, MatrixLike RHS>
requires SleipnirMatrixLike<LHS> || SleipnirMatrixLike<RHS>
SLEIPNIR_DLLEXPORT VariableMatrix operator* ( const LHS & lhs,
const RHS & rhs )
friend

Matrix multiplication operator.

Parameters
lhsOperator left-hand side.
rhsOperator right-hand side.

◆ operator* [2/5]

SLEIPNIR_DLLEXPORT VariableMatrix operator* ( const MatrixLike auto & lhs,
const Variable & rhs )
friend

Matrix-scalar multiplication operator.

Parameters
lhsOperator left-hand side.
rhsOperator right-hand side.

◆ operator* [3/5]

SLEIPNIR_DLLEXPORT VariableMatrix operator* ( const ScalarLike auto & lhs,
const SleipnirMatrixLike auto & rhs )
friend

Scalar-matrix multiplication operator.

Parameters
lhsOperator left-hand side.
rhsOperator right-hand side.

◆ operator* [4/5]

SLEIPNIR_DLLEXPORT VariableMatrix operator* ( const SleipnirMatrixLike auto & lhs,
const ScalarLike auto & rhs )
friend

Matrix-scalar multiplication operator.

Parameters
lhsOperator left-hand side.
rhsOperator right-hand side.

◆ operator* [5/5]

SLEIPNIR_DLLEXPORT VariableMatrix operator* ( const Variable & lhs,
const MatrixLike auto & rhs )
friend

Scalar-matrix multiplication operator.

Parameters
lhsOperator left-hand side.
rhsOperator right-hand side.

◆ operator+

template<MatrixLike LHS, MatrixLike RHS>
requires SleipnirMatrixLike<LHS> || SleipnirMatrixLike<RHS>
SLEIPNIR_DLLEXPORT VariableMatrix operator+ ( const LHS & lhs,
const RHS & rhs )
friend

Binary addition operator.

Parameters
lhsOperator left-hand side.
rhsOperator right-hand side.
Returns
Result of addition.

◆ operator- [1/2]

template<MatrixLike LHS, MatrixLike RHS>
requires SleipnirMatrixLike<LHS> || SleipnirMatrixLike<RHS>
SLEIPNIR_DLLEXPORT VariableMatrix operator- ( const LHS & lhs,
const RHS & rhs )
friend

Binary subtraction operator.

Parameters
lhsOperator left-hand side.
rhsOperator right-hand side.
Returns
Result of subtraction.

◆ operator- [2/2]

SLEIPNIR_DLLEXPORT VariableMatrix operator- ( const SleipnirMatrixLike auto & lhs)
friend

Unary minus operator.

Parameters
lhsOperand for unary minus.

◆ operator/

SLEIPNIR_DLLEXPORT VariableMatrix operator/ ( const MatrixLike auto & lhs,
const ScalarLike auto & rhs )
friend

Binary division operator.

Parameters
lhsOperator left-hand side.
rhsOperator right-hand side.
Returns
Result of division.

Member Data Documentation

◆ empty

empty_t slp::VariableMatrix::empty {}
staticconstexpr

Designates an uninitialized VariableMatrix.


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