COPP C ABI
C interface for COPP trajectory optimization
Loading...
Searching...
No Matches
CoppMatrixF64 Struct Reference

Library-owned column-major f64 matrix returned to C. More...

#include <core.h>

Data Fields

double * data
 Pointer to the first column-major element, or null for an empty matrix.
size_t rows
 Number of matrix rows.
size_t cols
 Number of matrix columns.
size_t capacity
 Allocation capacity in number of double elements, used only by copp_matrix_f64_free.

Detailed Description

Library-owned column-major f64 matrix returned to C.

C callers may read data[0..rows * cols] using column-major indexing and must release the matrix exactly once with copp_matrix_f64_free.

Example

The example below reads a column-major path-evaluation matrix and releases all returned matrices.

struct CoppMatrixF64 q = {0};
struct CoppMatrixF64 dq = {0};
struct CoppMatrixF64 ddq = {0};
check(copp_path_evaluate_up_to_2nd(path, s_slice, &q, &dq, &ddq));
double q_row_i_col_j = q.data[i + j * q.rows];
void copp_matrix_f64_free(struct CoppMatrixF64 matrix)
Release a library-owned f64 matrix returned by COPP.
enum CoppStatus copp_path_evaluate_up_to_2nd(const struct CoppPath *path, struct CoppSliceF64 s, struct CoppMatrixF64 *out_q, struct CoppMatrixF64 *out_dq, struct CoppMatrixF64 *out_ddq)
Evaluate q, dq, and ddq at the supplied path parameters.
Library-owned column-major f64 matrix returned to C.
Definition core.h:886
size_t rows
Number of matrix rows.
Definition core.h:894
double * data
Pointer to the first column-major element, or null for an empty matrix.
Definition core.h:890

Definition at line 886 of file core.h.

Field Documentation

◆ data

double* CoppMatrixF64::data

Pointer to the first column-major element, or null for an empty matrix.

Definition at line 890 of file core.h.

◆ rows

size_t CoppMatrixF64::rows

Number of matrix rows.

Definition at line 894 of file core.h.

◆ cols

size_t CoppMatrixF64::cols

Number of matrix columns.

Definition at line 898 of file core.h.

◆ capacity

size_t CoppMatrixF64::capacity

Allocation capacity in number of double elements, used only by copp_matrix_f64_free.

Definition at line 903 of file core.h.


The documentation for this struct was generated from the following file:
  • bindings/c/include/copp/core.h