Added C functions for linear algebra, to be converted to kraken and used as benchmark
This commit is contained in:
36
ChrisTest/ChrisVec/ChrisVecTest.krak
Normal file
36
ChrisTest/ChrisVec/ChrisVecTest.krak
Normal 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;
|
||||
}
|
||||
Reference in New Issue
Block a user