ometah-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[oMetah-devel] ometah/common matrix.hpp


From: NoJhan
Subject: [oMetah-devel] ometah/common matrix.hpp
Date: Thu, 09 Jun 2005 09:55:44 -0400

CVSROOT:        /cvsroot/ometah
Module name:    ometah
Branch:         
Changes by:     NoJhan <address@hidden> 05/06/09 13:55:44

Modified files:
        common         : matrix.hpp 

Log message:
        * correction of the matrixFilled template problem

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/ometah/ometah/common/matrix.hpp.diff?tr1=1.11&tr2=1.12&r1=text&r2=text

Patches:
Index: ometah/common/matrix.hpp
diff -u ometah/common/matrix.hpp:1.11 ometah/common/matrix.hpp:1.12
--- ometah/common/matrix.hpp:1.11       Thu Jun  9 12:56:31 2005
+++ ometah/common/matrix.hpp    Thu Jun  9 13:55:44 2005
@@ -1,5 +1,5 @@
 /***************************************************************************
- *  $Id: matrix.hpp,v 1.11 2005/06/09 12:56:31 nojhan Exp $
+ *  $Id: matrix.hpp,v 1.12 2005/06/09 13:55:44 nojhan Exp $
  *  Copyright : Université Paris 12 Val-de-Marne
  *              (61 avenue du Général de Gaulle, 94010, Créteil, France)
  *  Author : Johann Dréo <address@hidden>
@@ -88,6 +88,23 @@
 }
 
 
+template <class T>
+vector<vector< T > > matrixFilled( unsigned int dimL, unsigned int dimC, T 
fillValue )
+{
+  unsigned int i;
+
+  // make the vector<double> possible at this step
+  vector< T > vec(dimC, fillValue);
+
+  vector<vector< T > >  mat;
+  for(i=0; i<dimL; i++){
+    mat.push_back(vec);
+  }
+
+  return mat;
+}
+
+
 //! Multipliate two 2D matrix
 template<class T>
 T multiply( T matA, T matB)




reply via email to

[Prev in Thread] Current Thread [Next in Thread]