Index: /issm/trunk/src/mex/SparseToVector/SparseToVector.c
===================================================================
--- /issm/trunk/src/mex/SparseToVector/SparseToVector.c	(revision 4747)
+++ /issm/trunk/src/mex/SparseToVector/SparseToVector.c	(revision 4748)
@@ -1,36 +1,19 @@
+/*\file SparseToVector.cpp
+ *\brief: extract from a sparse matlab matrix ir, jc, and other information 
+ */
 
-#define THISFUNCTION "SparseToVector"
+#include "./SparseToVector.h"
 
-#include <stdio.h>
-#include <string.h>    /*  strcasecmp  */
-#include <time.h>      /*  clock,time,difftime  */
-#include "mex.h"
-
-
-/* Input Arguments */
-
-#define    A_IN         prhs[0]
-
-/* Output Arguments */
-
-#define    IR_OUT       plhs[0]
-#define    JC_OUT       plhs[1]
-#define    PR_OUT       plhs[2]
-#define    M_OUT        plhs[3]
-#define    N_OUT        plhs[4]
-#define    NZMAX_OUT    plhs[5]
-
-
-void SparseToVectorUsage( void );
-
-
-void mexFunction( int nlhs,
-				  mxArray *plhs[],
-				  int nrhs,
-				  const mxArray *prhs[] )
-{
-	mwIndex *ir =NULL,*jc =NULL;
-	double  *ird=NULL,*jcd=NULL,*pr=NULL,*prd=NULL;
+void mexFunction( int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[] ) {
+	
 	int     i;
+	
+	/*Output: */
+	mwIndex *ir =NULL;
+	mwIndex *jc =NULL;
+	double  *ird=NULL;
+	double  *jcd=NULL;
+	double   *pr=NULL;
+	double   *prd=NULL;
 
 	/* Check for proper number of arguments */
@@ -48,5 +31,5 @@
 
 	if (!mxIsNumeric(A_IN) || !mxIsSparse(A_IN)) {
-		mexPrintf("%s -- Input matrix must be numeric and sparse.\n",THISFUNCTION);
+		mexPrintf("%s -- Input matrix must be numeric and sparse.\n",__FUNCT__);
 		mexErrMsgTxt(" ");
 	}
@@ -95,18 +78,13 @@
 		}
 		mexPrintf("%s -- Input matrix is of size %d by %d with %d non-zeroes.\n",
-				  THISFUNCTION,mxGetM(A_IN),mxGetN(A_IN),mxGetNzmax(A_IN));
+				  __FUNCT__,mxGetM(A_IN),mxGetN(A_IN),mxGetNzmax(A_IN));
 	}
-
-	return;
 }
 
-void SparseToVectorUsage( void )
-{
+void SparseToVectorUsage( void ){
 
     mexPrintf("\n");
     mexPrintf("Usage: [ir,jc,pr,m,n,nzmax]=SparseToVector(a);\n");
     mexPrintf("\n");
-
-    return;
 }
 
Index: /issm/trunk/src/mex/SparseToVector/SparseToVector.h
===================================================================
--- /issm/trunk/src/mex/SparseToVector/SparseToVector.h	(revision 4748)
+++ /issm/trunk/src/mex/SparseToVector/SparseToVector.h	(revision 4748)
@@ -0,0 +1,39 @@
+/*
+	SparseToVector.h
+*/
+
+#ifndef _SPARSETOVECTOR_H
+#define _SPARSETOVECTOR_H
+
+/* local prototypes: */
+void SparseToVectorUsage(void);
+
+#include <stdio.h>
+#include <string.h>    /*  strcasecmp  */
+#include <time.h>      /*  clock,time,difftime  */
+
+#include "../../c/modules/modules.h"
+#include "../../c/Container/Container.h"
+#include "../../c/shared/shared.h"
+
+#undef __FUNCT__ 
+#define __FUNCT__  "SparseToVector"
+
+/* serial input macros: */
+#define    A_IN         prhs[0]
+
+/* serial output macros: */
+#define    IR_OUT       plhs[0]
+#define    JC_OUT       plhs[1]
+#define    PR_OUT       plhs[2]
+#define    M_OUT        plhs[3]
+#define    N_OUT        plhs[4]
+#define    NZMAX_OUT    plhs[5]
+
+/* serial arg counts: */
+#undef NLHS
+#define NLHS  1
+#undef NRHS
+#define NRHS  6
+
+#endif  /* _SPARSETOVECTOR_H */
