Index: tol/btol/matrix_type/matgra.cpp
===================================================================
--- tol/btol/matrix_type/matgra.cpp	(revision ca981818491b9b64f6327c4a46a9ce42fb6334a4)
+++ tol/btol/matrix_type/matgra.cpp	(revision aedae2f8ecc808bc8dd7376c3aed3c46d60d7a10)
@@ -92,13 +92,12 @@
 {
     BTraceInit("BGraContens<BMat>::InitInstances");
-    BArray<BDat> cell(BDat::Unknown(), 1);
-    BArray< BArray<BDat> > mat(cell, 1);
+    BMatrix<BDat> mat;
     
     BSystemMat* unknown_ = new BSystemMat
-  (
+    (
       "UnknownMatrix",
-      BMat(1, 1, mat),
+      mat,
       I2("The unknown matrix.", "La matriz desconocida.")
-      );
+    );
     OwnGrammar()->PutDefect(unknown_);
 }
@@ -2565,4 +2564,52 @@
 
   
+//--------------------------------------------------------------------
+DeclareContensClass(BMat, BMatTemporary, BMatZeros);
+DefExtOpr(1, BMatZeros, "Zeros",  1, 2, 
+  "Real Real",
+  "(Real nrow [, Real ncol=nrow])",
+  I2("Creates a matrix with all elements equal to zero.",
+     "Devuelve una matriz cuyas celdas son todas cero."),
+    BOperClassify::MatrixAlgebra_);
+//--------------------------------------------------------------------
+void BMatZeros::CalcContens()
+//--------------------------------------------------------------------
+{
+  int r = (BInt)Real(Arg(1));
+  int c = r;
+  if(Arg(2)) { c = (BInt)Real(Arg(2)); }
+  contens_.Alloc(r,c);
+  int k, s= contens_.Data().Size();
+  double* x=(double*)contens_.GetData().GetBuffer();
+  for(k=0; k<s; k++,x++)
+  {
+    *x = 0; 
+  }
+}
+
+//--------------------------------------------------------------------
+DeclareContensClass(BMat, BMatTemporary, BMatConstant);
+DefExtOpr(1, BMatConstant, "Constant",  3, 3, 
+  "Real Real Real",
+  "(Real nrow, Real ncol, Real value])",
+  I2("Creates a matrix with all elements equal to given value.",
+     "Devuelve una matriz cuyas celdas son todas iguales al valor "
+     "especificado."),
+    BOperClassify::MatrixAlgebra_);
+//--------------------------------------------------------------------
+void BMatConstant::CalcContens()
+//--------------------------------------------------------------------
+{
+  int r = (BInt)Real(Arg(1));
+  int c = (BInt)Real(Arg(2));
+  double v = Real(Arg(3));
+  contens_.Alloc(r,c);
+  int k, s= contens_.Data().Size();
+  double* x=(double*)contens_.GetData().GetBuffer();
+  for(k=0; k<s; k++, x++)
+  {
+    *x = v;
+  }
+}
 
 //--------------------------------------------------------------------
@@ -3459,6 +3506,6 @@
   register bool ok = true;
   
+  contens_.Alloc(r,c);
   if(r*c<=0) { return; }
-  contens_.Alloc(r,c);
   if(contens_.Rows()!=r) { return; }
   register const double* x0 = M.Data().Buffer();
@@ -3511,6 +3558,6 @@
   register bool ok = true;
   
+  contens_.Alloc(r,c);
   if(r*c<=0) { return; }
-  contens_.Alloc(r,c);
   register const double* x0 = M.Data().Buffer();
   register const double* x;
@@ -3571,6 +3618,6 @@
   BBool ok = BTRUE;
   
+  contens_.Alloc(r,c);
   if(r*c<=0) { return; }
-  contens_.Alloc(r,c);
   if(contens_.Rows()!=r) { return; }
   for(j=0; ok && j<c; j++)
Index: tol/btol/vmatrix_type/tol_bvmat.h
===================================================================
--- tol/btol/vmatrix_type/tol_bvmat.h	(revision ca981818491b9b64f6327c4a46a9ce42fb6334a4)
+++ tol/btol/vmatrix_type/tol_bvmat.h	(revision aedae2f8ecc808bc8dd7376c3aed3c46d60d7a10)
@@ -272,4 +272,5 @@
   void Copy        (const BVMat& v);
   void BlasRDense  (int nrow, int ncol);
+  void BlasRDense  (int nrow, int ncol, double value);
   void ChlmRSparse (int nrow, int ncol, int nzmax);
   void ChlmRTriplet(int nrow, int ncol, int nzmax);
Index: tol/btol/vmatrix_type/vmat.cpp
===================================================================
--- tol/btol/vmatrix_type/vmat.cpp	(revision ca981818491b9b64f6327c4a46a9ce42fb6334a4)
+++ tol/btol/vmatrix_type/vmat.cpp	(revision aedae2f8ecc808bc8dd7376c3aed3c46d60d7a10)
@@ -471,4 +471,21 @@
 }  
   
+////////////////////////////////////////////////////////////////////////////////
+  void BVMat::BlasRDense(int nrow, int ncol, double value)
+////////////////////////////////////////////////////////////////////////////////
+{
+  BlasRDense(nrow, ncol);
+  double* x = (double*)s_.blasRdense_->x;
+  if(x)
+  {
+    int s = nrow*ncol;
+    int k;
+    for(k=0; k<s; k++, x++)
+    {
+     *x = value;
+    }
+  }
+}  
+
 ////////////////////////////////////////////////////////////////////////////////
   void BVMat::ChlmRSparse(int nrow, int ncol, int nzmax)
Index: tol/btol/vmatrix_type/vmatgra.cpp
===================================================================
--- tol/btol/vmatrix_type/vmatgra.cpp	(revision ca981818491b9b64f6327c4a46a9ce42fb6334a4)
+++ tol/btol/vmatrix_type/vmatgra.cpp	(revision aedae2f8ecc808bc8dd7376c3aed3c46d60d7a10)
@@ -717,4 +717,22 @@
 }
 
+//--------------------------------------------------------------------
+DeclareContensClass(BVMat, BVMatTemporary, BVMatConstant);
+DefExtOpr(1, BVMatConstant, "Constant",  3, 3, 
+  "Real Real Real",
+  "(Real nrow, Real ncol, Real value])",
+  I2("Creates a dense matrix with all elements equal to given value.",
+     "Devuelve una matriz densa cuyas celdas son todas iguales al "
+     "valor especificado."),
+    BOperClassify::MatrixAlgebra_);
+//--------------------------------------------------------------------
+void BVMatConstant::CalcContens()
+//--------------------------------------------------------------------
+{
+  int r = (BInt)Real(Arg(1));
+  int c = (BInt)Real(Arg(2));
+  double v = Real(Arg(3));
+  contens_.BlasRDense(r,c, v);
+}
 
 //--------------------------------------------------------------------
