openMSX
Functions
gl_mat_Test.cc File Reference
#include "gl_mat.hh"
#include <cassert>
#include <iostream>
Include dependency graph for gl_mat_Test.cc:

Go to the source code of this file.

Functions

template<int N, typename T >
void print (const vecN< N, T > &x)
 
template<int M, int N, typename T >
void print (const matMxN< M, N, T > &A)
 
bool approxEq (const mat4 &x, const mat4 &y)
 
int main ()
 
void test_constr (mat4 &A)
 
void test_constr (const vec4 &x, mat4 &A)
 
void test_constr (const vec4 &x, const vec4 &y, const vec4 &z, const vec4 &w, mat4 &A)
 
void test_constr (const mat4 &A, mat3 &B)
 
void test_change0 (const vec4 &x, mat4 &A)
 
void test_change2 (const vec4 &x, mat4 &A)
 
void test_extr0 (const mat4 &A, vec4 &x)
 
void test_extr2 (const mat4 &A, vec4 &x)
 
bool test_equal (const mat4 &A, const mat4 &B)
 
bool test_not_equal (const mat4 &A, const mat4 &B)
 
void test_add (const mat4 &A, const mat4 &B, mat4 &C)
 
void test_add (const mat4 &A, mat4 &B)
 
void test_sub (const mat4 &A, const mat4 &B, mat4 &C)
 
void test_negate (const mat4 &A, mat4 &B)
 
void test_mul (float x, const mat4 &A, mat4 &B)
 
void test_mul (const mat4 &A, const vec4 &x, vec4 &y)
 
void test_mul (const mat4 &A, const mat4 &B, mat4 &C)
 
void test_transpose (const mat4 &A, mat4 &B)
 
void test_determinant (const mat4 &A, float &x)
 
void test_inverse (const mat4 &A, mat4 &B)
 
void test_norm (const mat4 &A, float &x)
 

Function Documentation

◆ approxEq()

bool approxEq ( const mat4 x,
const mat4 y 
)

Definition at line 27 of file gl_mat_Test.cc.

Referenced by main().

◆ main()

int main ( )

Definition at line 32 of file gl_mat_Test.cc.

References approxEq(), gl::determinant(), gl::inverse(), gl::norm2_2(), and gl::transpose().

◆ print() [1/2]

template<int N, typename T >
void print ( const vecN< N, T > &  x)

Definition at line 8 of file gl_mat_Test.cc.

Referenced by openmsx::CommandConsole::getRows(), and AdhocCliCommParser::parse().

◆ print() [2/2]

template<int M, int N, typename T >
void print ( const matMxN< M, N, T > &  A)

Definition at line 15 of file gl_mat_Test.cc.

◆ test_add() [1/2]

void test_add ( const mat4 A,
const mat4 B,
mat4 C 
)

Definition at line 606 of file gl_mat_Test.cc.

References openmsx::B.

◆ test_add() [2/2]

void test_add ( const mat4 A,
mat4 B 
)

Definition at line 610 of file gl_mat_Test.cc.

References openmsx::A.

◆ test_change0()

void test_change0 ( const vec4 x,
mat4 A 
)

Definition at line 580 of file gl_mat_Test.cc.

◆ test_change2()

void test_change2 ( const vec4 x,
mat4 A 
)

Definition at line 584 of file gl_mat_Test.cc.

◆ test_constr() [1/4]

void test_constr ( mat4 A)

Definition at line 563 of file gl_mat_Test.cc.

◆ test_constr() [2/4]

void test_constr ( const vec4 x,
mat4 A 
)

Definition at line 567 of file gl_mat_Test.cc.

◆ test_constr() [3/4]

void test_constr ( const vec4 x,
const vec4 y,
const vec4 z,
const vec4 w,
mat4 A 
)

Definition at line 571 of file gl_mat_Test.cc.

◆ test_constr() [4/4]

void test_constr ( const mat4 A,
mat3 B 
)

Definition at line 575 of file gl_mat_Test.cc.

◆ test_determinant()

void test_determinant ( const mat4 A,
float &  x 
)

Definition at line 641 of file gl_mat_Test.cc.

◆ test_equal()

bool test_equal ( const mat4 A,
const mat4 B 
)

Definition at line 597 of file gl_mat_Test.cc.

References openmsx::B.

◆ test_extr0()

void test_extr0 ( const mat4 A,
vec4 x 
)

Definition at line 588 of file gl_mat_Test.cc.

◆ test_extr2()

void test_extr2 ( const mat4 A,
vec4 x 
)

Definition at line 592 of file gl_mat_Test.cc.

◆ test_inverse()

void test_inverse ( const mat4 A,
mat4 B 
)

Definition at line 646 of file gl_mat_Test.cc.

References gl::inverse().

◆ test_mul() [1/3]

void test_mul ( float  x,
const mat4 A,
mat4 B 
)

Definition at line 623 of file gl_mat_Test.cc.

◆ test_mul() [2/3]

void test_mul ( const mat4 A,
const vec4 x,
vec4 y 
)

Definition at line 627 of file gl_mat_Test.cc.

◆ test_mul() [3/3]

void test_mul ( const mat4 A,
const mat4 B,
mat4 C 
)

Definition at line 631 of file gl_mat_Test.cc.

References openmsx::B.

◆ test_negate()

void test_negate ( const mat4 A,
mat4 B 
)

Definition at line 618 of file gl_mat_Test.cc.

References openmsx::A.

◆ test_norm()

void test_norm ( const mat4 A,
float &  x 
)

Definition at line 651 of file gl_mat_Test.cc.

◆ test_not_equal()

bool test_not_equal ( const mat4 A,
const mat4 B 
)

Definition at line 601 of file gl_mat_Test.cc.

References openmsx::B.

◆ test_sub()

void test_sub ( const mat4 A,
const mat4 B,
mat4 C 
)

Definition at line 614 of file gl_mat_Test.cc.

References openmsx::B.

◆ test_transpose()

void test_transpose ( const mat4 A,
mat4 B 
)

Definition at line 636 of file gl_mat_Test.cc.

References gl::transpose().