WPILibC++ 2027.0.0-alpha-5
Loading...
Searching...
No Matches
append_as_triplets.hpp File Reference
#include <initializer_list>
#include <Eigen/SparseCore>
#include <gch/small_vector.hpp>

Go to the source code of this file.

Functions

template<typename Scalar>
void append_as_triplets (gch::small_vector< Eigen::Triplet< Scalar > > &triplets, int row_offset, int col_offset, std::initializer_list< Eigen::SparseMatrix< Scalar > > mats)
 Appends sparse matrices to list of triplets at the given offset.
template<typename Scalar>
void append_diagonal_as_triplets (gch::small_vector< Eigen::Triplet< Scalar > > &triplets, int row_offset, int col_offset, const Eigen::Vector< Scalar, Eigen::Dynamic > &diag)
 Append diagonal matrix to list of triplets at the given offset.

Function Documentation

◆ append_as_triplets()

template<typename Scalar>
void append_as_triplets ( gch::small_vector< Eigen::Triplet< Scalar > > & triplets,
int row_offset,
int col_offset,
std::initializer_list< Eigen::SparseMatrix< Scalar > > mats )

Appends sparse matrices to list of triplets at the given offset.

The triplets are appended in column-major order (e.g., first column of mat1, first column of mat2 underneath first column of mat1, second column of mat1, second column of mat2 underneath second column of mat1).

Template Parameters
ScalarScalar type.
Parameters
tripletsList of triplets.
row_offsetRow offset for first matrix.
col_offsetColumn offset for first matrix.
matsSparse matrices to append.

◆ append_diagonal_as_triplets()

template<typename Scalar>
void append_diagonal_as_triplets ( gch::small_vector< Eigen::Triplet< Scalar > > & triplets,
int row_offset,
int col_offset,
const Eigen::Vector< Scalar, Eigen::Dynamic > & diag )

Append diagonal matrix to list of triplets at the given offset.

Template Parameters
ScalarScalar type.
Parameters
tripletsList of triplets.
row_offsetRow offset for first matrix.
col_offsetColumn offset for first matrix.
diagDiagonal of matrix.