Hummingbird Flight Software
Flight software for the Hummingbird FCU quadcopter flight controller. Designed to run on the Teensy 4.1. Developed with VSCode+PlatformIO.
Public Member Functions | Public Attributes | List of all members
Matrix Class Reference

A matrix object is definied by it's rows and columns. More...

#include <matrices.h>

Public Member Functions

 Matrix (size_t rows=3, size_t cols=3)
 Define a matrix by rows and columns. More...
 
 ~Matrix ()
 

Public Attributes

size_t rows
 
size_t cols
 
float * mat
 

Detailed Description

A matrix object is definied by it's rows and columns.

When a matrix object is created, the array is allocated on the heap (RAM2 for Teensy 4.1) with the C++ 'new' keyword as an array of pointers. See the following resource to learn more: https://www.techiedelight.com/dynamic-memory-allocation-in-c-for-2d-3d-array/ https://dev.to/drakargx/c-contiguous-allocation-of-2-d-arrays-446m

Parameters
rowsMatrix rows. Default = 3
colsMatrix columns. Default = 3

Constructor & Destructor Documentation

◆ Matrix()

Matrix::Matrix ( size_t  rows = 3,
size_t  cols = 3 
)
inline

Define a matrix by rows and columns.

The matrix is allocated on the heap with the C++ 'new' keyword (RAM2 on the Teensy 4.1).

Parameters
rowsMatrix rows. Default = 3
colsMatrix columns. Default = 3

◆ ~Matrix()

Matrix::~Matrix ( )
inline

Member Data Documentation

◆ cols

size_t Matrix::cols

◆ mat

float* Matrix::mat

◆ rows

size_t Matrix::rows

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