36 lines
722 B
C++
36 lines
722 B
C++
|
|
#define EIGEN_USE_MKL_ALL
|
||
|
|
|
||
|
|
#include <iostream>
|
||
|
|
#include <algorithm>
|
||
|
|
|
||
|
|
|
||
|
|
#include <complex>
|
||
|
|
|
||
|
|
|
||
|
|
#include "Matrix.h"
|
||
|
|
|
||
|
|
#include "spdlog/spdlog.h"
|
||
|
|
#include "spdlog/sinks/stdout_color_sinks.h"
|
||
|
|
#include "spdlog/sinks/basic_file_sink.h"
|
||
|
|
|
||
|
|
int main() {
|
||
|
|
double * dataA =new double[9];
|
||
|
|
double * dataB =new double[9];
|
||
|
|
for (int i = 0; i < 9; ++i) {
|
||
|
|
dataA[i]=(double)(i+1);
|
||
|
|
dataB[i]=(double)(i+2);
|
||
|
|
}
|
||
|
|
Aurora::Matrix A = Aurora::Matrix::New(dataA,3,3);
|
||
|
|
A.printf();
|
||
|
|
Aurora::Matrix B = Aurora::Matrix::New(dataB,3,3);
|
||
|
|
printf("B:\r\n");
|
||
|
|
B.printf();
|
||
|
|
printf("A*B:\r\n");
|
||
|
|
(A*B).printf();
|
||
|
|
printf("A*B+A:\r\n");
|
||
|
|
(A*B+A).printf();
|
||
|
|
A = (A*B+A)+3.;
|
||
|
|
A.printf();
|
||
|
|
return 0;
|
||
|
|
}
|