00001 #include <iostream>
00002 #include "GMatrix.h"
00003 #include "GVector.h"
00004 #include "GLinear_Homo_Eq.h"
00005 #include "util/GProgress_Bar.h"
00006
00007
00008 using namespace GMathLib;
00009 using namespace GMathLib::Util;
00010
00011 int main(){
00012 const int N = 3;
00013 double d1[N*N] = {
00014 1, 2, 0,
00015 0, 1, 0,
00016 0, 0, 1
00017 };
00018 double d2[N*N] = {
00019 1, 2, 0,
00020 0, 1, 0,
00021 0, 2, 1
00022 };
00023 double v1[N] = {4, 3, 8};
00024 double v2[N] = {0, 0, 0};
00025
00026
00027 GMatrix matrix1(N, N, d1);
00028 matrix1.Object_Name("matrix1");
00029
00030 GVector *vec1 = new GVector(N, GVector::COLUMN_VECTOR, v1);
00031 vec1->Object_Name("vec1");
00032
00033 GMatrix matrix2(N, N, d2);
00034 matrix2.Object_Name("matrix2");
00035
00036 GMatrix matrix3(N, N);
00037 matrix3.Object_Name("matrix3");
00038
00039 matrix3 = matrix2 * matrix1 + matrix1;
00040 matrix3.Print();
00041
00042 double k=2.0;
00043 matrix3 =matrix3 * k;
00044 matrix3.Print();
00045
00046 delete vec1;
00047
00048 return 0;
00049 }