Index: /issm/trunk/src/c/shared/Matrix/MatrixUtils.cpp
===================================================================
--- /issm/trunk/src/c/shared/Matrix/MatrixUtils.cpp	(revision 5370)
+++ /issm/trunk/src/c/shared/Matrix/MatrixUtils.cpp	(revision 5371)
@@ -399,2 +399,20 @@
 
 }/*}}}*/
+/*FUNCTION MatrixTranspose(double* Adet,double* A) {{{1*/
+void MatrixTranspose(double* tA,double* A, int nrows, int ncols){
+	/*Transpose a n*m matrix*/
+
+	int i,j;
+
+	/*Check the the matrix has been allocated*/
+	ISSMASSERT(tA);
+
+	/*Transpose*/
+	for(i=0;i<ncols;i++){
+		for(j=0;j<nrows;j++){
+			tA[i*nrows+j]=A[j*ncols+i];
+		}
+	}
+
+}
+/*}}}*/
Index: /issm/trunk/src/c/shared/Matrix/matrix.h
===================================================================
--- /issm/trunk/src/c/shared/Matrix/matrix.h	(revision 5370)
+++ /issm/trunk/src/c/shared/Matrix/matrix.h	(revision 5371)
@@ -13,4 +13,5 @@
 void Matrix3x3Invert(double* Ainv, double* A);
 void Matrix3x3Determinant(double* Adet,double* A);
+void MatrixTranspose(double* tA,double* A,int nrows, int ncols);
 
 #endif //ifndef _MATRIXUTILS_H_
