Added C functions for linear algebra, to be converted to kraken and used as benchmark
This commit is contained in:
37
ChrisTest/ChrisMatrix/ChrisMatrix.krak
Normal file
37
ChrisTest/ChrisMatrix/ChrisMatrix.krak
Normal file
@@ -0,0 +1,37 @@
|
||||
import vector:*;
|
||||
import io:*;
|
||||
|
||||
typedef ChrisMatrix(Destructable)
|
||||
{
|
||||
/***************
|
||||
* Member Data
|
||||
**************/
|
||||
|double**| data;
|
||||
|int| rowSize;
|
||||
|int| columnSize;
|
||||
|
||||
/**************************
|
||||
* Constructor/Destructor
|
||||
*************************/
|
||||
|double***| construct()
|
||||
{
|
||||
rowSize = 0;
|
||||
colSize = 0;
|
||||
//data = NULL; Will this work?
|
||||
return this;
|
||||
}
|
||||
|
||||
|bool| Initialize(|int| m, |int| n)
|
||||
{
|
||||
data = malloc(sizeof(double*)*m);
|
||||
for(|int| i = 0; i < m; i++)
|
||||
{
|
||||
data[i] = malloc(sizeof(double)*n);
|
||||
}
|
||||
|
||||
rowSize = m;
|
||||
colSize = n;
|
||||
|
||||
}//end itialize function
|
||||
|
||||
}//end Matrix class
|
||||
Reference in New Issue
Block a user