Skip to content
Snippets Groups Projects
Commit 05d70c14 authored by Jakhes's avatar Jakhes
Browse files

Updating helper functions

parent 71231678
No related branches found
No related tags found
No related merge requests found
...@@ -75,6 +75,16 @@ rowvec convertArrayToRowvec(float *arr, int vecSize) ...@@ -75,6 +75,16 @@ rowvec convertArrayToRowvec(float *arr, int vecSize)
return rVector; return rVector;
} }
Row<size_t> convertArrayToVec(float *arr, int vecSize)
{
Row<size_t> rVector(vecSize);
for(int i = 0; i < vecSize; i++)
{
rVector[i] = arr[i];
}
return rVector;
}
mat convertArrayToMat(float *arr, int vecSize, int rowCount) mat convertArrayToMat(float *arr, int vecSize, int rowCount)
{ {
mat matrix(rowCount,(vecSize/rowCount)); mat matrix(rowCount,(vecSize/rowCount));
......
...@@ -24,6 +24,8 @@ float *convertToArray(vector<vec> vec); ...@@ -24,6 +24,8 @@ float *convertToArray(vector<vec> vec);
rowvec convertArrayToRowvec(float *arr, int vecSize); rowvec convertArrayToRowvec(float *arr, int vecSize);
Row<size_t> convertArrayToVec(float *arr, int vecSize);
mat convertArrayToMat(float *arr, int vecSize, int rowCount); mat convertArrayToMat(float *arr, int vecSize, int rowCount);
#endif #endif
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment