Klang C++
Language Reference (draft)
Loading...
Searching...
No Matches
klang::Matrix

Matrix processor. More...

#include <klang.h>

Public Member Functions

float * operator[] (int col)
 
const float * operator[] (int col) const
 
float & operator() (int col, int row)
 
float operator() (int col, int row) const
 
signals< 4 > operator<< (const signals< 4 > &in) const
 

Public Attributes

float v [4][4] = { 0 }
 

Detailed Description

Definition at line 745 of file klang.h.

Member Function Documentation

◆ operator()() [1/2]

float & klang::Matrix::operator() ( int col,
int row )
inline

Definition at line 751 of file klang.h.

751{ return v[col][row]; }
float v[4][4]
Definition klang.h:746

References v.

◆ operator()() [2/2]

float klang::Matrix::operator() ( int col,
int row ) const
inline

Definition at line 752 of file klang.h.

752{ return v[col][row]; }

References v.

◆ operator<<()

signals< 4 > klang::Matrix::operator<< ( const signals< 4 > & in) const
inline

Definition at line 752 of file klang.h.

754 {
755 return { v[0][0] * in[0] + v[0][1] * in[1] + v[0][2] * in[2] + v[0][3] * in[3],
756 v[1][0] * in[0] + v[1][1] * in[1] + v[1][2] * in[2] + v[1][3] * in[3],
757 v[2][0] * in[0] + v[2][1] * in[1] + v[2][2] * in[2] + v[2][3] * in[3],
758 v[3][0] * in[0] + v[3][1] * in[1] + v[3][2] * in[2] + v[3][3] * in[3] };
759 }

◆ operator[]() [1/2]

float * klang::Matrix::operator[] ( int col)
inline

Definition at line 748 of file klang.h.

748{ return v[col]; }

References v.

◆ operator[]() [2/2]

const float * klang::Matrix::operator[] ( int col) const
inline

Definition at line 749 of file klang.h.

749{ return v[col]; }

References v.

Referenced by klang::operator*().

Member Data Documentation

◆ v

float klang::Matrix::v[4][4] = { 0 }

Definition at line 746 of file klang.h.

746{ 0 };

Referenced by operator()(), operator()(), operator[](), and operator[]().