c_physics_engine
A custom physics engine written in C/C++
Loading...
Searching...
No Matches
cpp_physics Namespace Reference

Classes

class  Matrix
 

Functions

std::ostream & operator<< (std::ostream &flux, const Matrix &mat)
 Print a matrix.
 
Matrix operator* (float scalar, const Matrix &mat)
 Scale a matrix.
 

Variables

const std::out_of_range OOB = std::out_of_range("Row or column index out of bounds.")
 
const std::out_of_range SUBMAT_OOB = std::out_of_range("Submatrix exceeds bounds of original matrix.")
 
const std::invalid_argument SHAPE_MISMATCH = std::invalid_argument("Matrix-shapes don't match.")
 
const std::invalid_argument INNERDIM_MISMATCH = std::invalid_argument("Inner matrix-dimensions don't align.")
 
const std::invalid_argument DIM_MISMATCH = std::invalid_argument("Matrix-columns or -rows don't match.")
 
const std::invalid_argument TOO_FEW = std::invalid_argument("Too few matrices, minimum 1.")
 
const std::invalid_argument DIV_ZERO = std::invalid_argument("Division by 0.")
 

Function Documentation

◆ operator*()

Matrix cpp_physics::operator* ( float scalar,
const Matrix & mat )

Scale a matrix.

Parameters
scalarThe scalar to scale by.
matThe matrix to scale.
Returns
A new matrix containing the result.

◆ operator<<()

std::ostream & cpp_physics::operator<< ( std::ostream & flux,
const Matrix & mat )

Print a matrix.

Parameters
fluxcout-voodoo
matThe matrix to print.
Returns
cout-voodoo

Variable Documentation

◆ DIM_MISMATCH

const std::invalid_argument cpp_physics::DIM_MISMATCH = std::invalid_argument("Matrix-columns or -rows don't match.")

◆ DIV_ZERO

const std::invalid_argument cpp_physics::DIV_ZERO = std::invalid_argument("Division by 0.")

◆ INNERDIM_MISMATCH

const std::invalid_argument cpp_physics::INNERDIM_MISMATCH = std::invalid_argument("Inner matrix-dimensions don't align.")

◆ OOB

const std::out_of_range cpp_physics::OOB = std::out_of_range("Row or column index out of bounds.")

◆ SHAPE_MISMATCH

const std::invalid_argument cpp_physics::SHAPE_MISMATCH = std::invalid_argument("Matrix-shapes don't match.")

◆ SUBMAT_OOB

const std::out_of_range cpp_physics::SUBMAT_OOB = std::out_of_range("Submatrix exceeds bounds of original matrix.")

◆ TOO_FEW

const std::invalid_argument cpp_physics::TOO_FEW = std::invalid_argument("Too few matrices, minimum 1.")