Index: /issm/trunk-jpl/src/c/classes/matrix/Matrix.cpp
===================================================================
--- /issm/trunk-jpl/src/c/classes/matrix/Matrix.cpp	(revision 12859)
+++ /issm/trunk-jpl/src/c/classes/matrix/Matrix.cpp	(revision 12860)
@@ -168,5 +168,7 @@
 		this->smatrix->Assemble();
 	}
-	else _error2_("Matrix type: " << type << " not supported yet!");
+	else{
+		_error2_("Matrix type: " << type << " not supported yet!");
+	}
 }
 /*}}}*/
@@ -302,18 +304,20 @@
 /*}}}*/
 /*FUNCTION Matrix::Convert{{{*/
-void Matrix::Convert(MatrixType type){
-
-	if((int)type==(int)PetscMatType){
-		#ifdef _HAVE_PETSC_
-		this->pmatrix->Convert(type);
-		#else
-		_error2_("Petsc matrix format not usable, as Petsc has not been compiled!");
-		#endif
-	}
-	else if((int)type==(int)SeqMatType){
-		this->smatrix->Convert(type);
-	}
-	else _error2_("Matrix type: " << type << " not supported yet!");
-
-}
-/*}}}*/
+void Matrix::Convert(MatrixType newtype){
+
+	if(type==PetscMatType){
+		#ifdef _HAVE_PETSC_
+		this->pmatrix->Convert(newtype);
+		#else
+		_error2_("Petsc matrix format not usable, as Petsc has not been compiled!");
+		#endif
+	}
+	else if(type==SeqMatType){
+		this->smatrix->Convert(newtype);
+	}
+	else{
+		_error2_("Matrix type: " << type << " not supported yet!");
+	}
+
+}
+/*}}}*/
Index: /issm/trunk-jpl/src/c/classes/matrix/Matrix.h
===================================================================
--- /issm/trunk-jpl/src/c/classes/matrix/Matrix.h	(revision 12859)
+++ /issm/trunk-jpl/src/c/classes/matrix/Matrix.h	(revision 12860)
@@ -16,9 +16,7 @@
 #include "../../toolkits/toolkits.h"
 #include "../../EnumDefinitions/EnumDefinitions.h"
-
+/*}}}*/
 class Vector;
-/*}}}*/
-
-enum matrixtype { PetscMatType, SeqMatType };
+enum matrixtype{PetscMatType, SeqMatType};
 
 class Matrix{
@@ -27,8 +25,8 @@
 
 		#ifdef _HAVE_PETSC_
-		PetscMat* pmatrix;
+		PetscMat *pmatrix;
 		#endif
-		SeqMat* smatrix; 
-		int     type;
+		SeqMat   *smatrix;
+		int       type;
 
 		/*Matrix constructors, destructors {{{*/
@@ -41,16 +39,15 @@
 		/*}}}*/
 		/*Matrix specific routines {{{*/
-		void Echo(void);
-		void Assemble(void);
-		IssmDouble Norm(NormMode norm_type);
-		void GetSize(int* pM,int* pN);
-		void GetLocalSize(int* pM,int* pN);
-		void MatMult(Vector* X,Vector* AX);
-		Matrix* Duplicate(void);
-		IssmDouble* ToSerial(void);
-		void SetValues(int m,int* idxm,int n,int* idxn,IssmDouble* values,InsMode mode);
-		void Convert(MatrixType type);
+		void        Echo(void);
+		void        Assemble(void);
+		IssmDouble  Norm(NormMode norm_type);
+		void        GetSize(int *pM,int*pN);
+		void        GetLocalSize(int *pM,int*pN);
+		void        MatMult(Vector *X,Vector*AX);
+		Matrix     *Duplicate(void);
+		IssmDouble *ToSerial(void);
+		void        SetValues(int m,int *idxm,int n,int*idxn,IssmDouble*values,InsMode mode);
+		void        Convert(MatrixType newtype);
 		/*}}}*/
-
 };
 
Index: /issm/trunk-jpl/src/c/modules/TriMeshx/TriMeshx.cpp
===================================================================
--- /issm/trunk-jpl/src/c/modules/TriMeshx/TriMeshx.cpp	(revision 12859)
+++ /issm/trunk-jpl/src/c/modules/TriMeshx/TriMeshx.cpp	(revision 12860)
@@ -192,13 +192,12 @@
 
 	/*Output : */
-	index_matrix=new Matrix(index,out.numberoftriangles,3,1); 
-	index_matrix->Convert(DENSE_SEQUENTIAL);
+	index_matrix=new Matrix(index,out.numberoftriangles,3,1,SeqMatType);
 	*pindex=index_matrix;
 	
-	segments_matrix=new Matrix(segments,out.numberofsegments,3,1); segments_matrix->Convert(DENSE_SEQUENTIAL);
+	segments_matrix=new Matrix(segments,out.numberofsegments,3,1,SeqMatType);
 	*psegments=segments_matrix;
 
-	*px=new Vector(x,out.numberofpoints);
-	*py=new Vector(y,out.numberofpoints);
-	*psegmentmarkerlist=new Vector(segmentmarkerlist,out.numberofsegments);
+	*px=new Vector(x,out.numberofpoints,SeqMatType);
+	*py=new Vector(y,out.numberofpoints,SeqMatType);
+	*psegmentmarkerlist=new Vector(segmentmarkerlist,out.numberofsegments,SeqMatType);
 }
Index: /issm/trunk-jpl/src/c/toolkits/issm/SeqMat.cpp
===================================================================
--- /issm/trunk-jpl/src/c/toolkits/issm/SeqMat.cpp	(revision 12859)
+++ /issm/trunk-jpl/src/c/toolkits/issm/SeqMat.cpp	(revision 12860)
@@ -45,5 +45,5 @@
 }
 /*}}}*/
-/*FUNCTION SeqMat(IssmDouble* serial_mat,int M,int N,IssmDouble sparsity){{{*/
+/*FUNCTION SeqMat::SeqMat(IssmDouble* serial_mat,int M,int N,IssmDouble sparsity){{{*/
 SeqMat::SeqMat(IssmDouble* serial_mat,int pM,int pN,IssmDouble sparsity){
 
