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

Borrowed immutable f64 matrix passed from C to COPP. More...

#include <core.h>

Data Fields

const double * data
 Pointer to the first matrix element.
size_t rows
 Number of matrix rows.
size_t cols
 Number of matrix columns.
enum CoppMatrixLayout layout
 Matrix memory layout.
size_t leading_dim
 Leading dimension / physical stride.

Detailed Description

Borrowed immutable f64 matrix passed from C to COPP.

The matrix has shape (rows, cols) and uses the indexing rule selected by layout. For contiguous column-major input, use leading_dim = rows. For contiguous row-major input, use leading_dim = cols.

Column-major input with leading_dim >= rows is the zero-copy path for matrix-view consumers. Strictly contiguous column-major input with leading_dim == rows is also accepted by APIs that require a raw contiguous slice. Row-major input is copied once into column-major temporary storage before COPP uses it.

The pointer must reference enough initialized double values for the selected layout unless rows == 0 or cols == 0, in which case data may be null. Borrowed matrix inputs must remain valid and must not be mutated concurrently for the duration of the call.

Example

The example below declares a borrowed column-major matrix view for a dim x n buffer.

enum { DIM = 3, N = 100 };
double column_major[DIM * N];
struct CoppMatrixViewF64 view =
COPP_MATRIX_VIEW_F64_COLUMN_MAJOR(column_major, DIM, N);
#define COPP_MATRIX_VIEW_F64_COLUMN_MAJOR(data_, rows_, cols_)
Build a contiguous column-major matrix view.
Definition core.h:757
Borrowed immutable f64 matrix passed from C to COPP.
Definition core.h:720

Definition at line 720 of file core.h.

Field Documentation

◆ data

const double* CoppMatrixViewF64::data

Pointer to the first matrix element.

Definition at line 724 of file core.h.

◆ rows

size_t CoppMatrixViewF64::rows

Number of matrix rows.

Definition at line 728 of file core.h.

◆ cols

size_t CoppMatrixViewF64::cols

Number of matrix columns.

Definition at line 732 of file core.h.

◆ layout

enum CoppMatrixLayout CoppMatrixViewF64::layout

Matrix memory layout.

Definition at line 736 of file core.h.

◆ leading_dim

size_t CoppMatrixViewF64::leading_dim

Leading dimension / physical stride.

For column-major input this is the distance between consecutive columns, and must be at least rows for non-empty matrices. For row-major input this is the distance between consecutive rows, and must be at least cols for non-empty matrices.

Definition at line 745 of file core.h.


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