Added C functions for linear algebra, to be converted to kraken and used as benchmark

This commit is contained in:
Chris Fadden
2015-03-18 18:35:00 -04:00
parent a268f1b768
commit d2fc32d0fb
12 changed files with 386 additions and 58 deletions

View File

@@ -0,0 +1,36 @@
/*
../build/kraken InputFile.krak ../krakGrammer(tabComplete) OutputFile
*/
import vector:*;
import ChrisVec:*;
import io:*;
|int| main()
{
|vector<double>| aVec.construct();
|vector<double>| bVec.construct();
|double| j;
for(|int| i = 0; i < 4; i++;)
{
j = i + 0.0;
aVec.addEnd(j);
bVec.addEnd(j);
}
bVec.addEnd(12.3);
|double| dotProd = dot<double>(aVec, bVec);
println("Dot Product has completed");
println();
println();
|double| NormSquared = norm2<double>(aVec);
println("Norm has completed");
return 0;
}