2
// Copyright (c) 2010 Linaro Limited
4
// All rights reserved. This program and the accompanying materials
5
// are made available under the terms of the MIT License which accompanies
6
// this distribution, and is available at
7
// http://www.opensource.org/licenses/mit-license.php
10
// Jesse Barker - original implementation.
13
#include "libmatrix_test.h"
14
#include "inverse_test.h"
17
using LibMatrix::mat2;
18
using LibMatrix::mat3;
19
using LibMatrix::mat4;
24
MatrixTest2x2Inverse::run(const Options& options)
28
if (options.beVerbose())
30
cout << "Starting with mat2 (should be identity): " << endl << endl;
36
if (options.beVerbose())
38
cout << endl << "Matrix should now have (0, 1) == -2.500000" << endl << endl;
44
if (options.beVerbose())
46
cout << endl << "Copy of previous matrix (should have (0, 1) == -2.500000)" << endl << endl;
52
if (options.beVerbose())
54
cout << endl << "Inverse of copy: " << endl << endl;
60
if (options.beVerbose())
62
cout << endl << "Product of original and inverse (should be identity): " << endl << endl;
74
MatrixTest3x3Inverse::run(const Options& options)
78
if (options.beVerbose())
80
cout << "Starting with mat3 (should be identity): " << endl << endl;
86
if (options.beVerbose())
88
cout << endl << "Matrix should now have (1, 2) == -2.500000" << endl << endl;
94
if (options.beVerbose())
96
cout << endl << "Copy of previous matrix (should have (1, 2) == -2.500000)" << endl << endl;
102
if (options.beVerbose())
104
cout << endl << "Inverse of copy: " << endl << endl;
110
if (options.beVerbose())
112
cout << endl << "Product of original and inverse (should be identity): " << endl << endl;
124
MatrixTest4x4Inverse::run(const Options& options)
128
if (options.beVerbose())
130
cout << "Starting with mat4 (should be identity): " << endl << endl;
136
if (options.beVerbose())
138
cout << endl << "Matrix should now have (2, 3) == -2.500000" << endl << endl;
144
if (options.beVerbose())
146
cout << endl << "Copy of previous matrix (should have (2, 3) == -2.500000)" << endl << endl;
152
if (options.beVerbose())
154
cout << endl << "Inverse of copy: " << endl << endl;
160
if (options.beVerbose())
162
cout << endl << "Product of original and inverse (should be identity): " << endl << endl;