Example #1
0
void DataSet::loadstim2(){
   name = "fMRI_stim";
   type = FMRI_STIM;
   dims[3] = 220;
   dims[0] = 3;
   dims[1] = 1;
   dims[2] = 1;
   train = gsl_matrix_float_calloc(dims[3], dims[0]*dims[1]);
   std::cout << "Loading stimulus" << std::endl;
   
   for (int i = 0; i < 220; ++i) {
      if (i%55 < 15)
         gsl_matrix_float_set(train, i, 0, 1);
      else if ((i - 20)%55 < 15 && i >= 20)
         gsl_matrix_float_set(train, i, 1, 1);
      else
         gsl_matrix_float_set(train, i, 2, 1);
   }
}
Example #2
0
int 
Matrix::convertToFloat(gsl_matrix_float* dest,const gsl_matrix* source, int r, int c)
{
	for(int i=0;i<r;i++)
	{
		for(int j=0;j<c;j++)
		{
			float val=gsl_matrix_get(source,i,j);	
			gsl_matrix_float_set(dest,i,j,val);
		}
	}
	return 0;
}