// RegressionTest.cpp : Defines the entry point for the console application. // Copyright (c) 2015 Nonki Takahashi. The MIT License. // Version 0.2 // /** * @author Nonki Takahashi * @version 0.2 */ #include "stdafx.h" #include <iostream> #include "../BMatrix/BMatrix.h" int _tmain(int argc, _TCHAR* argv[]) { CBVector a(4, "a"); a.setValue(3, 1); a.setValue(4, 1); cout << "a=" << a.toString() << endl; int v[] = { 0, 1, 0, 1 }; CBVector b(4, v, "b"); cout << "b=" << b.toString() << endl; cout << "a.getValue(3)=" << to_string(a.getValue(3)) << endl; cout << "a.or(b)=" << a.or(b).toString() << endl; cout << "a.and(b)=" << a.and(b).toString() << endl; cout << "a.abs()=" << to_string(a.abs()) << endl; cout << "a.inv()=" << a.inv().toString() << endl; cout << "a.diff(b)=" << a.diff(b).toString() << endl; cout << "a.xor(b)=" << a.xor(b).toString() << endl; cout << "a.mul(0)=" << a.mul(0).toString() << endl; cout << "a.dot(b)=" << to_string(a.dot(b)) << endl; cout << endl; CBMatrix A(4, 4); A.setValue(1, 4, 1); A.setValue(2, 4, 1); A.setValue(3, 4, 1); A.setValue(4, 4, 1); cout << "A=" << endl << A.toString() << endl; CBMatrix B(4, 4); B.setValue(1, 4, 1); B.setValue(2, 3, 1); B.setValue(3, 2, 1); B.setValue(4, 1, 1); cout << "B=" << endl << B.toString() << endl; cout << "A.getValue(4, 3)=" << to_string(A.getValue(4, 3)) << endl; cout << "A.or(B)=" << endl << A.or(B).toString() << endl; cout << "A.and(B)=" << endl << A.and(B).toString() << endl; cout << "A.abs()=" << to_string(A.abs()) << endl; cout << "A.inv()=" << endl << A.inv().toString() << endl; cout << "A.tran()=" << endl << A.tran().toString() << endl; cout << "A.diff(B)=" << endl << A.diff(B).toString() << endl; cout << "A.xor(B)=" << endl << A.xor(B).toString() << endl; cout << "A.mul(B)=" << endl << A.mul(B).toString() << endl; int v2[] = { 0, 0, 1, 1 }; CBVector c(4, v2, "c"); cout << "c=" << c.toString() << endl; cout << "A.mul(c)=" << A.mul(c).toString() << endl; cout << endl; CBVector::releaseMem(); system("pause"); return 0; }