COPP C++ API
C++ interface for COPP trajectory optimization
Loading...
Searching...
No Matches
copp::MatrixRef Class Reference

Mutable column-major matrix view used by callback APIs. More...

#include <core.hpp>

Public Member Functions

constexpr MatrixRef () noexcept=default
constexpr MatrixRef (double *data, std::size_t rows, std::size_t cols, std::size_t leading_dim) noexcept
constexpr double * data () const noexcept
constexpr std::size_t rows () const noexcept
constexpr std::size_t cols () const noexcept
constexpr std::size_t leading_dim () const noexcept
double & operator() (std::size_t row, std::size_t col) const noexcept

Static Public Member Functions

static constexpr MatrixRef column_major (double *data, std::size_t rows, std::size_t cols) noexcept
static constexpr MatrixRef strided_column_major (double *data, std::size_t rows, std::size_t cols, std::size_t leading_dim) noexcept

Detailed Description

Mutable column-major matrix view used by callback APIs.

MatrixRef is a writable borrowed output buffer. It never owns memory. The current callback path uses column-major output buffers with shape (rows x cols) and storage index row + col * leading_dim.

auto evaluator = [](copp::Span<const double> s,
for (std::size_t j = 0; j < s.size(); ++j) {
q(0, j) = s[j];
dq(0, j) = 1.0;
ddq(0, j) = 0.0;
}
};
Mutable column-major matrix view used by callback APIs.
Definition core.hpp:288
Non-owning view of a contiguous one-dimensional array.
Definition core.hpp:139
constexpr std::size_t size() const noexcept
Definition core.hpp:169

Definition at line 287 of file core.hpp.

Constructor & Destructor Documentation

◆ MatrixRef() [1/2]

copp::MatrixRef::MatrixRef ( )
constexprdefaultnoexcept

◆ MatrixRef() [2/2]

copp::MatrixRef::MatrixRef ( double * data,
std::size_t rows,
std::size_t cols,
std::size_t leading_dim )
inlineconstexprnoexcept

Definition at line 292 of file core.hpp.

Member Function Documentation

◆ column_major()

constexpr MatrixRef copp::MatrixRef::column_major ( double * data,
std::size_t rows,
std::size_t cols )
inlinestaticconstexprnoexcept

Definition at line 299 of file core.hpp.

◆ strided_column_major()

constexpr MatrixRef copp::MatrixRef::strided_column_major ( double * data,
std::size_t rows,
std::size_t cols,
std::size_t leading_dim )
inlinestaticconstexprnoexcept

Definition at line 307 of file core.hpp.

◆ data()

double * copp::MatrixRef::data ( ) const
inlineconstexprnoexcept

Definition at line 316 of file core.hpp.

◆ rows()

std::size_t copp::MatrixRef::rows ( ) const
inlineconstexprnoexcept

Definition at line 317 of file core.hpp.

◆ cols()

std::size_t copp::MatrixRef::cols ( ) const
inlineconstexprnoexcept

Definition at line 318 of file core.hpp.

◆ leading_dim()

std::size_t copp::MatrixRef::leading_dim ( ) const
inlineconstexprnoexcept

Definition at line 319 of file core.hpp.

◆ operator()()

double & copp::MatrixRef::operator() ( std::size_t row,
std::size_t col ) const
inlinenoexcept

Definition at line 321 of file core.hpp.


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