Index: trunk/SophyaLib/TArray/basarr.cc
===================================================================
--- trunk/SophyaLib/TArray/basarr.cc	(revision 824)
+++ trunk/SophyaLib/TArray/basarr.cc	(revision 850)
@@ -308,4 +308,8 @@
 void BaseArray::Show(ostream& os, bool si) const
 {
+  if (ndim_ < 1) {
+    os << "\n--- " << BaseArray::InfoString() << " Unallocated Array ! " << endl;
+    return;
+  } 
   os << "\n--- " << InfoString() ; 
   os << " ND=" << ndim_ << " SizeX*Y*...= " ;
Index: trunk/SophyaLib/TArray/sopemtx.h
===================================================================
--- trunk/SophyaLib/TArray/sopemtx.h	(revision 824)
+++ trunk/SophyaLib/TArray/sopemtx.h	(revision 850)
@@ -39,4 +39,25 @@
 }
 
+inline r_4 LinSolve(const TMatrix<r_4>& a, const TVector<r_4>& b, TVector<r_4>& c)
+{ 
+if(a.NCols() != b.NRows() || a.NCols() != a.NRows())
+  throw(SzMismatchError("LinSolve(TMatrix<r_4>,TVector<r_4>) size mismatch"));
+c = b;
+TMatrix<r_4> a1(a);
+return SimpleMatrixOperation<r_4>::GausPiv(a1,c);
+}
+
+// Inverse d'une matrice 
+inline TMatrix<r_8> Inverse(TMatrix<r_8> const & A)
+{
+  return SimpleMatrixOperation<r_8>::Inverse(A);
+}
+
+inline TMatrix<r_4> Inverse(TMatrix<r_4> const & A)
+{
+  return SimpleMatrixOperation<r_4>::Inverse(A);
+}
+
+
 //--------------------------------------
 //        Linear fitting 
Index: trunk/SophyaLib/TArray/tarray.cc
===================================================================
--- trunk/SophyaLib/TArray/tarray.cc	(revision 824)
+++ trunk/SophyaLib/TArray/tarray.cc	(revision 850)
@@ -695,4 +695,5 @@
   int_4 npr = 0;
   Show(os, si);
+  if (ndim_ < 1) return;
   uint_4 k0,k1,k2,k3,k4;
   for(k4=0; k4<size_[4]; k4++) {
Index: trunk/SophyaLib/TArray/tmatrix.cc
===================================================================
--- trunk/SophyaLib/TArray/tmatrix.cc	(revision 824)
+++ trunk/SophyaLib/TArray/tmatrix.cc	(revision 850)
@@ -1,3 +1,3 @@
-// $Id: tmatrix.cc,v 1.4 2000-04-05 15:44:15 ansari Exp $
+// $Id: tmatrix.cc,v 1.5 2000-04-10 12:57:44 ansari Exp $
 //                         C.Magneville          04/99
 #include "machdefs.h"
@@ -232,4 +232,5 @@
   int_4 npr = 0;
   Show(os, si);
+  if (ndim_ < 1)  return;
   uint_4 kc,kr;  
   for(kr=0; kr<size_[marowi_]; kr++) {
Index: trunk/SophyaLib/TArray/utilarr.cc
===================================================================
--- trunk/SophyaLib/TArray/utilarr.cc	(revision 824)
+++ trunk/SophyaLib/TArray/utilarr.cc	(revision 850)
@@ -4,18 +4,49 @@
 #include "machdefs.h"
 #include "utilarr.h"
+#include "srandgen.h"
 
 // Classe utilitaires
+
+RandomSequence::RandomSequence(int typ, double m, double s)
+{
+  typ_ = (typ == Flat) ? Flat : Gaussian;
+  mean_ = m;
+  sig_ = s;
+}
+
+double RandomSequence::Rand()
+{
+  if (typ_ == Flat) 
+    return(drandpm1()*sig_ + mean_);
+  else return(GauRnd(mean_, sig_));
+}
+
+
 Sequence::Sequence(double start, double step, Arr_DoubleFunctionOfX f)
+  : rseq_(RandomSequence::Gaussian)
 {
   start_ = start;
   step_ = step;
   myf_ = f;
+  fgrseq_ = false;
+}
+
+Sequence::Sequence(RandomSequence rseq)
+{
+  start_ = 0.;
+  step_ = 1.;
+  myf_ = NULL;  
+  rseq_ = rseq;
+  fgrseq_ = true;
 }
 
 double Sequence::operator () (uint_4 k)
 {
-  double x = start_+(double)k*step_;
-  if (myf_)  return(myf_(x));
-  return x;
+  if (fgrseq_) return(rseq_.Rand());
+  else {
+    double x = start_+(double)k*step_;
+    if (myf_)  return(myf_(x));
+    else return x;
+  }
 }
 
Index: trunk/SophyaLib/TArray/utilarr.h
===================================================================
--- trunk/SophyaLib/TArray/utilarr.h	(revision 824)
+++ trunk/SophyaLib/TArray/utilarr.h	(revision 850)
@@ -16,7 +16,19 @@
 typedef float  (* Arr_FloatFunctionOfX)  (float x);
 
+class RandomSequence {
+public:
+  enum { Gaussian = 0, Flat = 1 };
+  RandomSequence(int typ = RandomSequence::Gaussian, double m=0., double s=1.);
+  double Rand();
+protected:
+  int typ_;
+  double mean_, sig_;
+};
+
+
 class Sequence {
 public:
   explicit Sequence (double start=0., double step=1., Arr_DoubleFunctionOfX f=NULL);
+  explicit Sequence (RandomSequence rseq);
   inline double & Start() { return start_; }
   inline double & Step() { return step_; }
@@ -25,4 +37,6 @@
   double start_, step_;
   Arr_DoubleFunctionOfX myf_;
+  bool fgrseq_;
+  RandomSequence rseq_; 
 };
 
