Illustrated C/C++ source sheets, symbol index, API relationship graph, compiler console and debug trace

LIVE AI / FLEXIBLE SENSING / FLIGHT CONTEXT

Sensoraia API

Live AI and sensing, connected to the flight.
See, listen, inspect and return supported results while airborne.

Loading...
Searching...
No Matches
dipla::aigenlib::Matrix Class Reference

Owning, contiguous, row-major double matrix. More...

#include <aigenlib.hpp>

Inheritance diagram for dipla::aigenlib::Matrix:
Aigen::Matrix

Public Member Functions

 Matrix ()=default
 Construct an empty matrix.
 Matrix (std::size_t rows, std::size_t columns, double value=0.0)
 Allocate initialized storage.
 Matrix (const Matrix &other)=default
 Deep copy.
Matrix & operator= (const Matrix &other)
 Deep assignment with strong exception guarantee.
 Matrix (Matrix &&other) noexcept
 Transfer storage.
Matrix & operator= (Matrix &&other) noexcept
 Transfer storage.
std::size_t rows () const noexcept
 Row count.
std::size_t cols () const noexcept
 Column count.
std::size_t size () const noexcept
 Allocated scalar count.
double & operator() (std::size_t row, std::size_t column)
 Checked access.
double operator() (std::size_t row, std::size_t column) const
 Checked access.
double * row_data (std::size_t row)
 Borrow a row.
const double * row_data (std::size_t row) const
 Borrow a row.
bool finite () const noexcept
 Validate all stored scalars.
double trace () const
 Sum a square matrix's diagonal.

Private Attributes

std::size_t rows_ = 0
 Row extent.
std::size_t columns_ = 0
 Column extent.
Vector values_
 Contiguous owning storage.

Detailed Description

Owning, contiguous, row-major double matrix.

Each extent is at most max_extent. Construction checks before multiplying dimensions. Element/row access is checked, including release builds. A borrowed row pointer is valid until assignment, move, or destruction; callers must bound column accesses. Moved-from matrices are empty 0-by-0.

Constructor & Destructor Documentation

◆ Matrix() [1/4]

dipla::aigenlib::Matrix::Matrix ( )
default

Construct an empty matrix.

◆ Matrix() [2/4]

dipla::aigenlib::Matrix::Matrix ( std::size_t rows,
std::size_t columns,
double value = 0.0 )

Allocate initialized storage.

Parameters
rowsRow count.
columnsColumn count.
valueInitial scalar.

◆ Matrix() [3/4]

dipla::aigenlib::Matrix::Matrix ( const Matrix & other)
default

Deep copy.

Parameters
otherSource.

◆ Matrix() [4/4]

dipla::aigenlib::Matrix::Matrix ( Matrix && other)
noexcept

Transfer storage.

Parameters
otherSource, emptied afterwards.

Member Function Documentation

◆ cols()

std::size_t dipla::aigenlib::Matrix::cols ( ) const
noexcept

Column count.

Returns
Columns.

◆ finite()

bool dipla::aigenlib::Matrix::finite ( ) const
noexcept

Validate all stored scalars.

Returns
True if finite, including empty matrices.

◆ operator()() [1/2]

double & dipla::aigenlib::Matrix::operator() ( std::size_t row,
std::size_t column )

Checked access.

Parameters
rowRow.
columnColumn.
Returns
Mutable scalar.

◆ operator()() [2/2]

double dipla::aigenlib::Matrix::operator() ( std::size_t row,
std::size_t column ) const

Checked access.

Parameters
rowRow.
columnColumn.
Returns
Scalar.

◆ operator=() [1/2]

Matrix & dipla::aigenlib::Matrix::operator= ( const Matrix & other)

Deep assignment with strong exception guarantee.

Parameters
otherSource.
Returns
This matrix.

◆ operator=() [2/2]

Matrix & dipla::aigenlib::Matrix::operator= ( Matrix && other)
noexcept

Transfer storage.

Parameters
otherSource, emptied afterwards.
Returns
This matrix.

◆ row_data() [1/2]

double * dipla::aigenlib::Matrix::row_data ( std::size_t row)

Borrow a row.

Parameters
rowRow.
Returns
Pointer, null for zero columns.

◆ row_data() [2/2]

const double * dipla::aigenlib::Matrix::row_data ( std::size_t row) const

Borrow a row.

Parameters
rowRow.
Returns
Pointer, null for zero columns.

◆ rows()

std::size_t dipla::aigenlib::Matrix::rows ( ) const
noexcept

Row count.

Returns
Rows.

◆ size()

std::size_t dipla::aigenlib::Matrix::size ( ) const
noexcept

Allocated scalar count.

Returns
Rows times columns.

◆ trace()

double dipla::aigenlib::Matrix::trace ( ) const

Sum a square matrix's diagonal.

Returns
Trace.

Member Data Documentation

◆ columns_

std::size_t dipla::aigenlib::Matrix::columns_ = 0
private

Column extent.

◆ rows_

std::size_t dipla::aigenlib::Matrix::rows_ = 0
private

Row extent.

◆ values_

Vector dipla::aigenlib::Matrix::values_
private

Contiguous owning storage.


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