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.
15
using LibMatrix::mat4;
16
using LibMatrix::mat3;
17
using LibMatrix::mat2;
25
cout << "Starting with mat2 (should be identity): " << endl << endl;
30
cout << endl << "Matrix should now have (0, 1) == -2.500000" << endl << endl;
35
cout << endl << "Copy of previous matrix (should have (0, 1) == -2.500000)" << endl << endl;
40
cout << endl << "Inverse of copy: " << endl << endl;
45
cout << endl << "Product of original and inverse (should be identity): " << endl << endl;
60
cout << "Starting with mat3 (should be identity): " << endl << endl;
65
cout << endl << "Matrix should now have (1, 2) == -2.500000" << endl << endl;
70
cout << endl << "Copy of previous matrix (should have (1, 2) == -2.500000)" << endl << endl;
75
cout << endl << "Inverse of copy: " << endl << endl;
80
cout << endl << "Product of original and inverse (should be identity): " << endl << endl;
95
cout << "Starting with mat4 (should be identity): " << endl << endl;
100
cout << endl << "Matrix should now have (2, 3) == -2.500000" << endl << endl;
105
cout << endl << "Copy of previous matrix (should have (2, 3) == -2.500000)" << endl << endl;
110
cout << endl << "Inverse of copy: " << endl << endl;
115
cout << endl << "Product of original and inverse (should be identity): " << endl << endl;
128
main(int argc, char** argv)
132
cerr << "mat2::inverse() does not work!" << endl;
135
cout << "mat2::inverse() is okay!" << endl << endl;
139
cerr << "mat3::inverse() does not work!" << endl;
142
cout << "mat3::inverse() is okay!" << endl << endl;
146
cerr << "mat4::inverse() does not work!" << endl;
149
cout << "mat4::inverse() is okay!" << endl << endl;