Dura2D  v0.1.0
An educational 2D game physics library
Loading...
Searching...
No Matches
d2MatMN Struct Reference

Represents an MxN matrix. More...

#include <d2Math.h>

Public Member Functions

 d2MatMN ()
 
 d2MatMN (int M, int N)
 Constructor that initializes the matrix with given number of rows and columns.
 
 d2MatMN (const d2MatMN &m)
 
 ~d2MatMN ()
 
void Zero ()
 Sets all components of the matrix to zero.
 
d2MatMN Transpose () const
 Transposes the matrix.
 
const d2MatMNoperator= (const d2MatMN &m)
 
d2VecN operator* (const d2VecN &v) const
 
d2MatMN operator* (const d2MatMN &m) const
 

Static Public Member Functions

static d2VecN SolveGaussSeidel (const d2MatMN &A, const d2VecN &b)
 Solves a system of linear equations using the Gauss-Seidel method.
 

Public Attributes

int M
 The number of rows in the matrix.
 
int N
 The number of columns in the matrix.
 
d2VecNrows
 The rows of the matrix.
 

Detailed Description

Represents an MxN matrix.

Constructor & Destructor Documentation

◆ d2MatMN() [1/3]

d2MatMN::d2MatMN ( )

◆ d2MatMN() [2/3]

d2MatMN::d2MatMN ( int M,
int N )

Constructor that initializes the matrix with given number of rows and columns.

Parameters
MThe number of rows in the matrix.
NThe number of columns in the matrix.

◆ d2MatMN() [3/3]

d2MatMN::d2MatMN ( const d2MatMN & m)

◆ ~d2MatMN()

d2MatMN::~d2MatMN ( )

Member Function Documentation

◆ operator*() [1/2]

d2MatMN d2MatMN::operator* ( const d2MatMN & m) const

◆ operator*() [2/2]

d2VecN d2MatMN::operator* ( const d2VecN & v) const

◆ operator=()

const d2MatMN & d2MatMN::operator= ( const d2MatMN & m)

◆ SolveGaussSeidel()

static d2VecN d2MatMN::SolveGaussSeidel ( const d2MatMN & A,
const d2VecN & b )
static

Solves a system of linear equations using the Gauss-Seidel method.

Parameters
AThe matrix of coefficients.
bThe vector of constants.
Returns
The solution vector.

◆ Transpose()

d2MatMN d2MatMN::Transpose ( ) const

Transposes the matrix.

Returns
The transposed matrix.

◆ Zero()

void d2MatMN::Zero ( )

Sets all components of the matrix to zero.

Member Data Documentation

◆ M

int d2MatMN::M

The number of rows in the matrix.

◆ N

int d2MatMN::N

The number of columns in the matrix.

◆ rows

d2VecN* d2MatMN::rows

The rows of the matrix.


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