Add fromRawData & copyFromRawData to Matrix class.
This commit is contained in:
@@ -41,6 +41,27 @@ TEST_F(FunctionTester, matrixSlice) {
|
||||
B.printf();
|
||||
}
|
||||
|
||||
TEST_F(FunctionTester, RawDataMatrix) {
|
||||
double * dataA =new double[8];
|
||||
double * dataB =new double[8];
|
||||
for (int i = 0; i < 8; ++i) {
|
||||
dataA[i]=(double)(i-3);
|
||||
dataB[i]=(double)(i+2);
|
||||
}
|
||||
Aurora::Matrix A = Aurora::Matrix::fromRawData(dataA,2,2,2);
|
||||
printf("A:\r\n");
|
||||
A.printf();
|
||||
Aurora::Matrix B = Aurora::Matrix::copyFromRawData(dataB,2,2,2);
|
||||
delete [] dataB;
|
||||
printf("B:\r\n");
|
||||
B.printf();
|
||||
A(Aurora::$,Aurora::$,1) = B(Aurora::$,Aurora::$,0);
|
||||
printf("New A:\r\n");
|
||||
A.printf();
|
||||
printf("New B:\r\n");
|
||||
B.printf();
|
||||
}
|
||||
|
||||
TEST_F(FunctionTester, sign) {
|
||||
double * dataA =Aurora::malloc(9);
|
||||
double * dataB =Aurora::malloc(9);
|
||||
|
||||
Reference in New Issue
Block a user