Skip to content
Snippets Groups Projects
Commit 0c025c59 authored by Jakhes's avatar Jakhes
Browse files

Adding code snippets to the template

parent 9f79b225
No related branches found
No related tags found
No related merge requests found
...@@ -26,50 +26,14 @@ void sampleFunction() ...@@ -26,50 +26,14 @@ void sampleFunction()
} }
// Basic input parameters
void takeNumberFunction(SP_integer integerNumber, double doubleNumber, char const *string) //
{ // SP_integer integerNumber, double doubleNumber, char const *string
//
} // Snippets
//
SP_integer returnNumberFunction() // Take Matrix: mat-take, take-mat
{ // Take Array: arr-take, take-arr
return 7; //
} // Return Matrix: mat-return, return-mat
// Return Array: arr-return, return-arr
void takeMatrixFunction(float *givenMatArr, SP_integer givenMatSize, SP_integer givenMatRowNum)
{
// convert the Prolog arrays to arma::mat
mat data = convertArrayToMat(givenMatArr, givenMatSize, givenMatRowNum);
}
void takeArrayFunction(float *givenArr, SP_integer givenArrSize)
{
// convert the Prolog arrays to arma::rowvec
rowvec givenVector = convertArrayToRowvec(givenArr, givenArrSize);
}
void returnMatrixFunction(float **returnMatArr, SP_integer *returnMatColNum, SP_integer *returnMatRowNum)
{
// get the ReturnMat
mat toReturnMat = rowvec(3, 3, fill::ones);
// return the Matrix dimensions
*returnMatColNum = toReturnMat.n_cols;
*returnMatRowNum = toReturnMat.n_rows;
// return the Matrix as one long Array
*returnMatArr = convertToArray(toReturnMat);
}
void returnArrayFunction(float **returnArr, SP_integer *returnArrSize)
{
// get the ReturnVector
rowvec toReturnVector = rowvec(3, fill::ones);
// return the Vector lenght
*returnArrSize = toReturnVector.n_elem;
// return the Vector as Array
*returnArr = convertToArray(toReturnVector);
}
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment