Index: /issm/trunk/src/c/io/FetchData.cpp
===================================================================
--- /issm/trunk/src/c/io/FetchData.cpp	(revision 7217)
+++ /issm/trunk/src/c/io/FetchData.cpp	(revision 7218)
@@ -41,5 +41,5 @@
 		else{
 			/*This is an error: we don't have the correct input!: */
-			_error_("  wrong input parameter!");
+			_error_("Input parameter of class %s not supported yet",mxGetClassName(dataref));
 		}
 	}
@@ -79,5 +79,4 @@
 		_error_("Input parameter of class %s not supported yet",mxGetClassName(dataref));
 	}
-
 			
 	/*Assign output pointers:*/
@@ -86,5 +85,88 @@
 	if (pN)*pN=outmatrix_cols;
 
-
+}
+/*}}}*/
+/*FUNCTION FetchData(int** pmatrix,int* pM,int *pN,const mxArray* dataref){{{1*/
+void FetchData(int** pmatrix,int* pM,int *pN,const mxArray* dataref){
+
+	int     i,outmatrix_rows,outmatrix_cols;
+	double *doublematrix=NULL;
+	int    *outmatrix=NULL;
+
+	if(mxIsEmpty(dataref) ){
+		/*Nothing to pick up. Just initialize matrix pointer to NULL: */
+		outmatrix_rows=0;
+		outmatrix_cols=0;
+		outmatrix=NULL;
+	}
+	else if (mxIsDouble(dataref) ){
+
+		/*Check dataref is not pointing to NaN: */
+		if ( mxIsNaN(*(mxGetPr(dataref))) && (mxGetM(dataref)==1) && (mxGetN(dataref)==1) ){
+			outmatrix_rows=0;
+			outmatrix_cols=0;
+			outmatrix=NULL;
+		}
+		else{
+
+			/*Convert matlab matrix to double* matrix: */
+			MatlabMatrixToDoubleMatrix(&doublematrix,&outmatrix_rows,&outmatrix_cols,dataref);
+
+			/*Convert double matrix into integer matrix: */
+			outmatrix=(int*)xmalloc(outmatrix_rows*outmatrix_cols*sizeof(int));
+			for(i=0;i<outmatrix_rows*outmatrix_cols;i++)outmatrix[i]=(int)doublematrix[i];
+		}
+	}
+	else{
+		/*This is an error: we don't have the correct input!: */
+		_error_("Input parameter of class %s not supported yet",mxGetClassName(dataref));
+	}
+
+	/*Assign output pointers:*/
+	*pmatrix=outmatrix;
+	if (pM)*pM=outmatrix_rows;
+	if (pN)*pN=outmatrix_cols;
+}
+/*}}}*/
+/*FUNCTION FetchData(bool** pmatrix,int* pM,int *pN,const mxArray* dataref){{{1*/
+void FetchData(bool** pmatrix,int* pM,int *pN,const mxArray* dataref){
+
+	int     i,outmatrix_rows,outmatrix_cols;
+	double *doublematrix=NULL;
+	bool   *outmatrix=NULL;
+
+	if(mxIsEmpty(dataref) ){
+		/*Nothing to pick up. Just initialize matrix pointer to NULL: */
+		outmatrix_rows=0;
+		outmatrix_cols=0;
+		outmatrix=NULL;
+	}
+	else if (mxIsDouble(dataref) ){
+
+		/*Check dataref is not pointing to NaN: */
+		if ( mxIsNaN(*(mxGetPr(dataref))) && (mxGetM(dataref)==1) && (mxGetN(dataref)==1) ){
+			outmatrix_rows=0;
+			outmatrix_cols=0;
+			outmatrix=NULL;
+		}
+		else{
+
+			/*Convert matlab matrix to double* matrix: */
+			MatlabMatrixToDoubleMatrix(&doublematrix,&outmatrix_rows,&outmatrix_cols,dataref);
+
+			/*Convert double matrix into integer matrix: */
+			outmatrix=(bool*)xmalloc(outmatrix_rows*outmatrix_cols*sizeof(bool));
+			for(i=0;i<outmatrix_rows;i++)outmatrix[i]=(bool)doublematrix[i];
+		}
+	}
+	else{
+		/*This is an error: we don't have the correct input!: */
+		_error_("Input parameter of class %s not supported yet",mxGetClassName(dataref));
+	}
+
+	/*Assign output pointers:*/
+	*pmatrix=outmatrix;
+	if (pM)*pM=outmatrix_rows;
+	if (pN)*pN=outmatrix_cols;
 }
 /*}}}*/
@@ -109,5 +191,5 @@
 	else{
 		/*This is an error: we don't have the correct input!: */
-		_error_("wrong input parameter");
+		_error_("Input parameter of class %s not supported yet",mxGetClassName(dataref));
 	}
 
@@ -135,5 +217,5 @@
 	else{
 		/*This is an error: we don't have the correct input!: */
-		_error_("wrong input parameter");
+		_error_("Input parameter of class %s not supported yet",mxGetClassName(dataref));
 	}
 
@@ -167,5 +249,37 @@
 	else{
 		/*This is an error: we don't have the correct input!: */
-		_error_("wrong input parameter");
+		_error_("Input parameter of class %s not supported yet",mxGetClassName(dataref));
+	}
+
+	/*Assign output pointers:*/
+	*pvector=outvector;
+	if (pM)*pM=outvector_rows;
+}
+/*}}}*/
+/*FUNCTION FetchData(bool** pvector,int* pM,const mxArray* dataref){{{1*/
+void FetchData(bool** pvector,int* pM,const mxArray* dataref){
+
+	int    i;
+	double *doublevector   = NULL;
+	bool   *outvector      = NULL;
+	int     outvector_rows;
+
+	if(mxIsEmpty(dataref)){
+		/*Nothing to pick up. Just initialize matrix pointer to NULL: */
+		outvector_rows=0;
+		outvector=NULL;
+	}
+	else if (mxIsDouble(dataref) ){
+
+		/*Convert matlab vector to double*  vector: */
+		MatlabVectorToDoubleVector(&doublevector,&outvector_rows,dataref);
+
+		/*Convert double vector into integer vector: */
+		outvector=(bool*)xmalloc(outvector_rows*sizeof(bool));
+		for(i=0;i<outvector_rows;i++)outvector[i]=(bool)doublevector[i];
+	}
+	else{
+		/*This is an error: we don't have the correct input!: */
+		_error_("Input parameter of class %s not supported yet",mxGetClassName(dataref));
 	}
 
@@ -199,5 +313,5 @@
 	else{
 		/*This is an error: we don't have the correct input!: */
-		_error_("wrong input parameter");
+		_error_("Input parameter of class %s not supported yet",mxGetClassName(dataref));
 	}
 
@@ -224,5 +338,5 @@
 	else{
 		/*This is an error: we don't have the correct input!: */
-		_error_("wrong input parameter");
+		_error_("Input parameter of class %s not supported yet",mxGetClassName(dataref));
 	}
 
Index: /issm/trunk/src/c/io/io.h
===================================================================
--- /issm/trunk/src/c/io/io.h	(revision 7217)
+++ /issm/trunk/src/c/io/io.h	(revision 7218)
@@ -33,8 +33,11 @@
 void FetchData(DataSet** pdataset,const mxArray* dataref);
 void FetchData(double** pmatrix,int* pM,int *pN,const mxArray* dataref);
+void FetchData(int** pmatrix,int* pM,int *pN,const mxArray* dataref);
+void FetchData(bool** pmatrix,int* pM,int *pN,const mxArray* dataref);
 void FetchData(Mat* pmatrix,const mxArray* dataref);
 void FetchData(int** pvector,int* pM,const mxArray* dataref);
 void FetchData(float** pvector,int* pM,const mxArray* dataref);
 void FetchData(double** pvector,int* pM,const mxArray* dataref);
+void FetchData(bool** pvector,int* pM,const mxArray* dataref);
 void FetchData(Vec* pvector,const mxArray* dataref);
 void FetchData(char** pstring,const mxArray* dataref);
