Index: trunk/SophyaLib/NTools/Makefile
===================================================================
--- trunk/SophyaLib/NTools/Makefile	(revision 3601)
+++ trunk/SophyaLib/NTools/Makefile	(revision 3608)
@@ -4,8 +4,8 @@
  
 clean:
-	 rm -f $(SOPHYAOBJP)FSAppIrrSmpl.o $(SOPHYAOBJP)cimage.o $(SOPHYAOBJP)cspline.o $(SOPHYAOBJP)datatypes.o $(SOPHYAOBJP)dates.o $(SOPHYAOBJP)difeq.o $(SOPHYAOBJP)dynccd.o $(SOPHYAOBJP)fct1dfit.o $(SOPHYAOBJP)fct2dfit.o $(SOPHYAOBJP)fftmserver.o $(SOPHYAOBJP)fftpserver.o $(SOPHYAOBJP)fftservintf.o $(SOPHYAOBJP)functab.o $(SOPHYAOBJP)generaldata.o $(SOPHYAOBJP)generalfit.o $(SOPHYAOBJP)generalfunc.o $(SOPHYAOBJP)imageop.o $(SOPHYAOBJP)integ.o $(SOPHYAOBJP)median.o $(SOPHYAOBJP)ntoolsinit.o $(SOPHYAOBJP)objfitter.o $(SOPHYAOBJP)perandom.o $(SOPHYAOBJP)poly.o $(SOPHYAOBJP)rk4cdifeq.o $(SOPHYAOBJP)simplesort.o $(SOPHYAOBJP)simplex.o $(SOPHYAOBJP)slinparbuff.o $(SOPHYAOBJP)tabmath.o $(SOPHYAOBJP)toeplitzMatrix.o $(SOPHYAOBJP)tsfunran.o $(SOPHYAOBJP)datime.o $(SOPHYAOBJP)fftmayer_r4.o $(SOPHYAOBJP)fftmayer_r8.o $(SOPHYAOBJP)fftpackc.o $(SOPHYAOBJP)matxop.o $(SOPHYAOBJP)nbmath.o $(SOPHYAOBJP)nbtri.o
+	 rm -f $(SOPHYAOBJP)FSAppIrrSmpl.o $(SOPHYAOBJP)cimage.o $(SOPHYAOBJP)cspline.o $(SOPHYAOBJP)datatypes.o $(SOPHYAOBJP)dates.o $(SOPHYAOBJP)difeq.o $(SOPHYAOBJP)dynccd.o $(SOPHYAOBJP)fct1dfit.o $(SOPHYAOBJP)fct2dfit.o $(SOPHYAOBJP)fftmserver.o $(SOPHYAOBJP)fftpserver.o $(SOPHYAOBJP)fftservintf.o $(SOPHYAOBJP)functab.o $(SOPHYAOBJP)generaldata.o $(SOPHYAOBJP)generalfit.o $(SOPHYAOBJP)generalfunc.o $(SOPHYAOBJP)imageop.o $(SOPHYAOBJP)integ.o $(SOPHYAOBJP)median.o $(SOPHYAOBJP)ntoolsinit.o $(SOPHYAOBJP)objfitter.o $(SOPHYAOBJP)perandom.o $(SOPHYAOBJP)poly.o $(SOPHYAOBJP)rk4cdifeq.o $(SOPHYAOBJP)simplesort.o $(SOPHYAOBJP)simplex.o $(SOPHYAOBJP)slinparbuff.o $(SOPHYAOBJP)tabmath.o $(SOPHYAOBJP)toeplitzMatrix.o $(SOPHYAOBJP)datime.o $(SOPHYAOBJP)fftmayer_r4.o $(SOPHYAOBJP)fftmayer_r8.o $(SOPHYAOBJP)fftpackc.o $(SOPHYAOBJP)matxop.o $(SOPHYAOBJP)nbmath.o $(SOPHYAOBJP)nbtri.o
 	rm -f $(SOPHYALIBP)libNTools.a
  
-$(SOPHYALIBP)libNTools.a : $(SOPHYAOBJP)cimage.o $(SOPHYAOBJP)cspline.o $(SOPHYAOBJP)datatypes.o $(SOPHYAOBJP)dates.o $(SOPHYAOBJP)datime.o $(SOPHYAOBJP)difeq.o $(SOPHYAOBJP)dynccd.o $(SOPHYAOBJP)fct1dfit.o $(SOPHYAOBJP)fct2dfit.o $(SOPHYAOBJP)fftmayer_r4.o $(SOPHYAOBJP)fftmayer_r8.o $(SOPHYAOBJP)fftmserver.o $(SOPHYAOBJP)fftpackc.o $(SOPHYAOBJP)fftpserver.o $(SOPHYAOBJP)fftservintf.o $(SOPHYAOBJP)FSAppIrrSmpl.o $(SOPHYAOBJP)functab.o $(SOPHYAOBJP)generaldata.o $(SOPHYAOBJP)generalfit.o $(SOPHYAOBJP)generalfunc.o $(SOPHYAOBJP)integ.o $(SOPHYAOBJP)matxop.o $(SOPHYAOBJP)median.o $(SOPHYAOBJP)nbmath.o $(SOPHYAOBJP)nbtri.o $(SOPHYAOBJP)ntoolsinit.o $(SOPHYAOBJP)objfitter.o $(SOPHYAOBJP)perandom.o $(SOPHYAOBJP)poly.o $(SOPHYAOBJP)rk4cdifeq.o $(SOPHYAOBJP)simplesort.o $(SOPHYAOBJP)simplex.o $(SOPHYAOBJP)slinparbuff.o $(SOPHYAOBJP)tabmath.o $(SOPHYAOBJP)toeplitzMatrix.o $(SOPHYAOBJP)tsfunran.o
+$(SOPHYALIBP)libNTools.a : $(SOPHYAOBJP)cimage.o $(SOPHYAOBJP)cspline.o $(SOPHYAOBJP)datatypes.o $(SOPHYAOBJP)dates.o $(SOPHYAOBJP)datime.o $(SOPHYAOBJP)difeq.o $(SOPHYAOBJP)dynccd.o $(SOPHYAOBJP)fct1dfit.o $(SOPHYAOBJP)fct2dfit.o $(SOPHYAOBJP)fftmayer_r4.o $(SOPHYAOBJP)fftmayer_r8.o $(SOPHYAOBJP)fftmserver.o $(SOPHYAOBJP)fftpackc.o $(SOPHYAOBJP)fftpserver.o $(SOPHYAOBJP)fftservintf.o $(SOPHYAOBJP)FSAppIrrSmpl.o $(SOPHYAOBJP)functab.o $(SOPHYAOBJP)generaldata.o $(SOPHYAOBJP)generalfit.o $(SOPHYAOBJP)generalfunc.o $(SOPHYAOBJP)integ.o $(SOPHYAOBJP)matxop.o $(SOPHYAOBJP)median.o $(SOPHYAOBJP)nbmath.o $(SOPHYAOBJP)nbtri.o $(SOPHYAOBJP)ntoolsinit.o $(SOPHYAOBJP)objfitter.o $(SOPHYAOBJP)perandom.o $(SOPHYAOBJP)poly.o $(SOPHYAOBJP)rk4cdifeq.o $(SOPHYAOBJP)simplesort.o $(SOPHYAOBJP)simplex.o $(SOPHYAOBJP)slinparbuff.o $(SOPHYAOBJP)tabmath.o $(SOPHYAOBJP)toeplitzMatrix.o
 	$(AR) $(ARFLAGS) $@ $? 
 	touch $(SOPHYAINCP)/SophyaConfInfo/libsophya.objlist
@@ -121,14 +121,25 @@
 $(SOPHYAOBJP)dynccd.o: dynccd.cc $(SOPHYAINCP)sopnamsp.h \
   $(SOPHYAINCP)machdefs.h fmath.h perandom.h \
+  $(SOPHYAINCP)tvector.h \
+  $(SOPHYAINCP)tmatrix.h \
+  $(SOPHYAINCP)machdefs.h \
+  $(SOPHYAINCP)tarray.h \
+  $(SOPHYAINCP)basarr.h \
+  $(SOPHYAINCP)anydataobj.h \
+  $(SOPHYAINCP)mutyv.h \
+  $(SOPHYAINCP)timestamp.h \
+  $(SOPHYAINCP)objfio.h \
+  $(SOPHYAINCP)ppersist.h \
+  $(SOPHYAINCP)pexceptions.h \
+  $(SOPHYAINCP)gnumd5.h \
+  $(SOPHYAINCP)ppfbinstream.h \
+  $(SOPHYAINCP)rawstream.h \
+  $(SOPHYAINCP)ppfnametag.h \
+  $(SOPHYAINCP)dvlist.h \
+  $(SOPHYAINCP)ndatablock.h \
+  $(SOPHYAINCP)utilarr.h \
+  $(SOPHYAINCP)tmatrix_tsnl.h \
+  $(SOPHYAINCP)tvector_tsnl.h \
   $(SOPHYAINCP)histos.h \
-  $(SOPHYAINCP)objfio.h \
-  $(SOPHYAINCP)machdefs.h \
-  $(SOPHYAINCP)anydataobj.h \
-  $(SOPHYAINCP)ppersist.h \
-  $(SOPHYAINCP)pexceptions.h \
-  $(SOPHYAINCP)gnumd5.h \
-  $(SOPHYAINCP)ppfbinstream.h \
-  $(SOPHYAINCP)rawstream.h \
-  $(SOPHYAINCP)ppfnametag.h \
   $(SOPHYAINCP)peida.h \
   $(SOPHYAINCP)utils.h \
@@ -136,14 +147,4 @@
   $(SOPHYAINCP)fmath.h \
   $(SOPHYAINCP)tvector.h \
-  $(SOPHYAINCP)tmatrix.h \
-  $(SOPHYAINCP)tarray.h \
-  $(SOPHYAINCP)basarr.h \
-  $(SOPHYAINCP)mutyv.h \
-  $(SOPHYAINCP)timestamp.h \
-  $(SOPHYAINCP)dvlist.h \
-  $(SOPHYAINCP)ndatablock.h \
-  $(SOPHYAINCP)utilarr.h \
-  $(SOPHYAINCP)tmatrix_tsnl.h \
-  $(SOPHYAINCP)tvector_tsnl.h \
   $(SOPHYAINCP)srandgen.h classfunc.h cimage.h \
   $(SOPHYAINCP)tmatrix.h \
@@ -512,13 +513,24 @@
   $(SOPHYAINCP)pexceptions.h \
   $(SOPHYAINCP)machdefs.h perandom.h \
+  $(SOPHYAINCP)tvector.h \
+  $(SOPHYAINCP)tmatrix.h \
+  $(SOPHYAINCP)tarray.h \
+  $(SOPHYAINCP)basarr.h \
+  $(SOPHYAINCP)anydataobj.h \
+  $(SOPHYAINCP)mutyv.h \
+  $(SOPHYAINCP)timestamp.h \
+  $(SOPHYAINCP)objfio.h \
+  $(SOPHYAINCP)ppersist.h \
+  $(SOPHYAINCP)pexceptions.h \
+  $(SOPHYAINCP)gnumd5.h \
+  $(SOPHYAINCP)ppfbinstream.h \
+  $(SOPHYAINCP)rawstream.h \
+  $(SOPHYAINCP)ppfnametag.h \
+  $(SOPHYAINCP)dvlist.h \
+  $(SOPHYAINCP)ndatablock.h \
+  $(SOPHYAINCP)utilarr.h \
+  $(SOPHYAINCP)tmatrix_tsnl.h \
+  $(SOPHYAINCP)tvector_tsnl.h \
   $(SOPHYAINCP)histos.h \
-  $(SOPHYAINCP)objfio.h \
-  $(SOPHYAINCP)anydataobj.h \
-  $(SOPHYAINCP)ppersist.h \
-  $(SOPHYAINCP)pexceptions.h \
-  $(SOPHYAINCP)gnumd5.h \
-  $(SOPHYAINCP)ppfbinstream.h \
-  $(SOPHYAINCP)rawstream.h \
-  $(SOPHYAINCP)ppfnametag.h \
   $(SOPHYAINCP)peida.h \
   $(SOPHYAINCP)utils.h \
@@ -526,14 +538,4 @@
   $(SOPHYAINCP)fmath.h \
   $(SOPHYAINCP)tvector.h \
-  $(SOPHYAINCP)tmatrix.h \
-  $(SOPHYAINCP)tarray.h \
-  $(SOPHYAINCP)basarr.h \
-  $(SOPHYAINCP)mutyv.h \
-  $(SOPHYAINCP)timestamp.h \
-  $(SOPHYAINCP)dvlist.h \
-  $(SOPHYAINCP)ndatablock.h \
-  $(SOPHYAINCP)utilarr.h \
-  $(SOPHYAINCP)tmatrix_tsnl.h \
-  $(SOPHYAINCP)tvector_tsnl.h \
   $(SOPHYAINCP)srandgen.h classfunc.h pemath.h
 	$(CXXCOMPILE) $(CXXTEMPFLG) -o $@  perandom.cc
@@ -691,38 +693,4 @@
 	$(CXXCOMPILE) $(CXXTEMPFLG) -o $@  toeplitzMatrix.cc
  
-$(SOPHYAOBJP)tsfunran.o: tsfunran.cc $(SOPHYAINCP)sopnamsp.h \
-  $(SOPHYAINCP)machdefs.h \
-  $(SOPHYAINCP)pexceptions.h \
-  $(SOPHYAINCP)machdefs.h \
-  $(SOPHYAINCP)randr48.h \
-  $(SOPHYAINCP)objfio.h \
-  $(SOPHYAINCP)anydataobj.h \
-  $(SOPHYAINCP)ppersist.h \
-  $(SOPHYAINCP)pexceptions.h \
-  $(SOPHYAINCP)gnumd5.h \
-  $(SOPHYAINCP)ppfbinstream.h \
-  $(SOPHYAINCP)rawstream.h \
-  $(SOPHYAINCP)ppfnametag.h \
-  $(SOPHYAINCP)ndatablock.h \
-  $(SOPHYAINCP)randinterf.h tsfunran.h \
-  $(SOPHYAINCP)histos.h \
-  $(SOPHYAINCP)peida.h \
-  $(SOPHYAINCP)utils.h \
-  $(SOPHYAINCP)perrors.h \
-  $(SOPHYAINCP)fmath.h \
-  $(SOPHYAINCP)tvector.h \
-  $(SOPHYAINCP)tmatrix.h \
-  $(SOPHYAINCP)tarray.h \
-  $(SOPHYAINCP)basarr.h \
-  $(SOPHYAINCP)mutyv.h \
-  $(SOPHYAINCP)timestamp.h \
-  $(SOPHYAINCP)dvlist.h \
-  $(SOPHYAINCP)utilarr.h \
-  $(SOPHYAINCP)tmatrix_tsnl.h \
-  $(SOPHYAINCP)tvector_tsnl.h \
-  $(SOPHYAINCP)tvector.h \
-  $(SOPHYAINCP)randinterf.h classfunc.h
-	$(CXXCOMPILE) $(CXXTEMPFLG) -o $@  tsfunran.cc
- 
 $(SOPHYAOBJP)datime.o: datime.c $(SOPHYAINCP)machdefs.h \
   $(SOPHYAINCP)strutil.h nbconst.h datime.h
Index: trunk/SophyaLib/NTools/objlist.list
===================================================================
--- trunk/SophyaLib/NTools/objlist.list	(revision 3601)
+++ trunk/SophyaLib/NTools/objlist.list	(revision 3608)
@@ -34,3 +34,2 @@
 tabmath.o
 toeplitzMatrix.o
-tsfunran.o
Index: trunk/SophyaLib/NTools/perandom.cc
===================================================================
--- trunk/SophyaLib/NTools/perandom.cc	(revision 3601)
+++ trunk/SophyaLib/NTools/perandom.cc	(revision 3608)
@@ -99,4 +99,28 @@
 
 /********* Methode *********/
+/*! Creator from a TVector
+*/
+FunRan::FunRan(TVector<r_8>& tab, bool pdf)
+: Histo(-0.5,tab.Size()-0.5,tab.Size())
+{
+  if(tab.Size()<=1)
+   throw RangeCheckError("TsFunRan::TsFunRan less than 2 bins requested");
+ for(int_4 i=0;i<tab.Size();i++) (*this)(i) = tab(i);
+ create_DF(pdf);
+}
+
+/********* Methode *********/
+/*! Creator from a TVector
+*/
+FunRan::FunRan(TVector<r_8>& tab, r_8 xMin, r_8 xMax, bool pdf)
+: Histo(xMin,xMax,tab.Size())
+{
+ if(tab.Size()<=1)
+   throw RangeCheckError("TsFunRan::TsFunRan less than 2 bins requested");
+ for(int_4 i=0;i<tab.Size();i++) (*this)(i) = tab(i);
+ create_DF(pdf);
+}
+
+/********* Methode *********/
 /*! Creator from an histogram
 If pdf=true, h is a probability density fonction (not necessary normalised).
Index: trunk/SophyaLib/NTools/perandom.h
===================================================================
--- trunk/SophyaLib/NTools/perandom.h	(revision 3601)
+++ trunk/SophyaLib/NTools/perandom.h	(revision 3608)
@@ -10,4 +10,5 @@
 #include <stdlib.h>
 #include <math.h>
+#include "tvector.h"
 #include "histos.h"
 #include "srandgen.h"
@@ -24,4 +25,6 @@
   FunRan(r_8 *tab, int_4 nBin, bool pdf=true);
   FunRan(r_8 *tab, int_4 nBin, r_8 xMin, r_8 xMax, bool pdf=true);
+  FunRan(TVector<r_8>& tab, bool pdf=true);
+  FunRan(TVector<r_8>& tab, r_8 xMin, r_8 xMax, bool pdf=true);
   FunRan(Histo &h, bool pdf=true);
   FunRan(const FunRan& fh);
Index: trunk/SophyaLib/NTools/smakefile
===================================================================
--- trunk/SophyaLib/NTools/smakefile	(revision 3601)
+++ trunk/SophyaLib/NTools/smakefile	(revision 3608)
@@ -4,8 +4,8 @@
  
 clean:
-	 rm -f $(SOPHYAOBJP)FSAppIrrSmpl.o $(SOPHYAOBJP)cimage.o $(SOPHYAOBJP)cspline.o $(SOPHYAOBJP)datatypes.o $(SOPHYAOBJP)dates.o $(SOPHYAOBJP)difeq.o $(SOPHYAOBJP)dynccd.o $(SOPHYAOBJP)fct1dfit.o $(SOPHYAOBJP)fct2dfit.o $(SOPHYAOBJP)fftmserver.o $(SOPHYAOBJP)fftpserver.o $(SOPHYAOBJP)fftservintf.o $(SOPHYAOBJP)functab.o $(SOPHYAOBJP)generaldata.o $(SOPHYAOBJP)generalfit.o $(SOPHYAOBJP)generalfunc.o $(SOPHYAOBJP)imageop.o $(SOPHYAOBJP)integ.o $(SOPHYAOBJP)median.o $(SOPHYAOBJP)ntoolsinit.o $(SOPHYAOBJP)objfitter.o $(SOPHYAOBJP)perandom.o $(SOPHYAOBJP)poly.o $(SOPHYAOBJP)rk4cdifeq.o $(SOPHYAOBJP)simplesort.o $(SOPHYAOBJP)simplex.o $(SOPHYAOBJP)slinparbuff.o $(SOPHYAOBJP)tabmath.o $(SOPHYAOBJP)toeplitzMatrix.o $(SOPHYAOBJP)tsfunran.o $(SOPHYAOBJP)datime.o $(SOPHYAOBJP)fftmayer_r4.o $(SOPHYAOBJP)fftmayer_r8.o $(SOPHYAOBJP)fftpackc.o $(SOPHYAOBJP)matxop.o $(SOPHYAOBJP)nbmath.o $(SOPHYAOBJP)nbtri.o
+	 rm -f $(SOPHYAOBJP)FSAppIrrSmpl.o $(SOPHYAOBJP)cimage.o $(SOPHYAOBJP)cspline.o $(SOPHYAOBJP)datatypes.o $(SOPHYAOBJP)dates.o $(SOPHYAOBJP)difeq.o $(SOPHYAOBJP)dynccd.o $(SOPHYAOBJP)fct1dfit.o $(SOPHYAOBJP)fct2dfit.o $(SOPHYAOBJP)fftmserver.o $(SOPHYAOBJP)fftpserver.o $(SOPHYAOBJP)fftservintf.o $(SOPHYAOBJP)functab.o $(SOPHYAOBJP)generaldata.o $(SOPHYAOBJP)generalfit.o $(SOPHYAOBJP)generalfunc.o $(SOPHYAOBJP)imageop.o $(SOPHYAOBJP)integ.o $(SOPHYAOBJP)median.o $(SOPHYAOBJP)ntoolsinit.o $(SOPHYAOBJP)objfitter.o $(SOPHYAOBJP)perandom.o $(SOPHYAOBJP)poly.o $(SOPHYAOBJP)rk4cdifeq.o $(SOPHYAOBJP)simplesort.o $(SOPHYAOBJP)simplex.o $(SOPHYAOBJP)slinparbuff.o $(SOPHYAOBJP)tabmath.o $(SOPHYAOBJP)toeplitzMatrix.o $(SOPHYAOBJP)datime.o $(SOPHYAOBJP)fftmayer_r4.o $(SOPHYAOBJP)fftmayer_r8.o $(SOPHYAOBJP)fftpackc.o $(SOPHYAOBJP)matxop.o $(SOPHYAOBJP)nbmath.o $(SOPHYAOBJP)nbtri.o
 	rm -f $(SOPHYALIBP)libNTools.a
  
-$(SOPHYALIBP)libNTools.a : $(SOPHYAOBJP)cimage.o $(SOPHYAOBJP)cspline.o $(SOPHYAOBJP)datatypes.o $(SOPHYAOBJP)dates.o $(SOPHYAOBJP)datime.o $(SOPHYAOBJP)difeq.o $(SOPHYAOBJP)dynccd.o $(SOPHYAOBJP)fct1dfit.o $(SOPHYAOBJP)fct2dfit.o $(SOPHYAOBJP)fftmayer_r4.o $(SOPHYAOBJP)fftmayer_r8.o $(SOPHYAOBJP)fftmserver.o $(SOPHYAOBJP)fftpackc.o $(SOPHYAOBJP)fftpserver.o $(SOPHYAOBJP)fftservintf.o $(SOPHYAOBJP)FSAppIrrSmpl.o $(SOPHYAOBJP)functab.o $(SOPHYAOBJP)generaldata.o $(SOPHYAOBJP)generalfit.o $(SOPHYAOBJP)generalfunc.o $(SOPHYAOBJP)integ.o $(SOPHYAOBJP)matxop.o $(SOPHYAOBJP)median.o $(SOPHYAOBJP)nbmath.o $(SOPHYAOBJP)nbtri.o $(SOPHYAOBJP)ntoolsinit.o $(SOPHYAOBJP)objfitter.o $(SOPHYAOBJP)perandom.o $(SOPHYAOBJP)poly.o $(SOPHYAOBJP)rk4cdifeq.o $(SOPHYAOBJP)simplesort.o $(SOPHYAOBJP)simplex.o $(SOPHYAOBJP)slinparbuff.o $(SOPHYAOBJP)tabmath.o $(SOPHYAOBJP)toeplitzMatrix.o $(SOPHYAOBJP)tsfunran.o
+$(SOPHYALIBP)libNTools.a : $(SOPHYAOBJP)cimage.o $(SOPHYAOBJP)cspline.o $(SOPHYAOBJP)datatypes.o $(SOPHYAOBJP)dates.o $(SOPHYAOBJP)datime.o $(SOPHYAOBJP)difeq.o $(SOPHYAOBJP)dynccd.o $(SOPHYAOBJP)fct1dfit.o $(SOPHYAOBJP)fct2dfit.o $(SOPHYAOBJP)fftmayer_r4.o $(SOPHYAOBJP)fftmayer_r8.o $(SOPHYAOBJP)fftmserver.o $(SOPHYAOBJP)fftpackc.o $(SOPHYAOBJP)fftpserver.o $(SOPHYAOBJP)fftservintf.o $(SOPHYAOBJP)FSAppIrrSmpl.o $(SOPHYAOBJP)functab.o $(SOPHYAOBJP)generaldata.o $(SOPHYAOBJP)generalfit.o $(SOPHYAOBJP)generalfunc.o $(SOPHYAOBJP)integ.o $(SOPHYAOBJP)matxop.o $(SOPHYAOBJP)median.o $(SOPHYAOBJP)nbmath.o $(SOPHYAOBJP)nbtri.o $(SOPHYAOBJP)ntoolsinit.o $(SOPHYAOBJP)objfitter.o $(SOPHYAOBJP)perandom.o $(SOPHYAOBJP)poly.o $(SOPHYAOBJP)rk4cdifeq.o $(SOPHYAOBJP)simplesort.o $(SOPHYAOBJP)simplex.o $(SOPHYAOBJP)slinparbuff.o $(SOPHYAOBJP)tabmath.o $(SOPHYAOBJP)toeplitzMatrix.o
 	$(AR) $(ARFLAGS) $@ $? 
 	touch $(SOPHYAINCP)/SophyaConfInfo/libsophya.objlist
@@ -121,14 +121,25 @@
 $(SOPHYAOBJP)dynccd.o: dynccd.cc $(SOPHYAINCP)sopnamsp.h \
   $(SOPHYAINCP)machdefs.h fmath.h perandom.h \
+  $(SOPHYAINCP)tvector.h \
+  $(SOPHYAINCP)tmatrix.h \
+  $(SOPHYAINCP)machdefs.h \
+  $(SOPHYAINCP)tarray.h \
+  $(SOPHYAINCP)basarr.h \
+  $(SOPHYAINCP)anydataobj.h \
+  $(SOPHYAINCP)mutyv.h \
+  $(SOPHYAINCP)timestamp.h \
+  $(SOPHYAINCP)objfio.h \
+  $(SOPHYAINCP)ppersist.h \
+  $(SOPHYAINCP)pexceptions.h \
+  $(SOPHYAINCP)gnumd5.h \
+  $(SOPHYAINCP)ppfbinstream.h \
+  $(SOPHYAINCP)rawstream.h \
+  $(SOPHYAINCP)ppfnametag.h \
+  $(SOPHYAINCP)dvlist.h \
+  $(SOPHYAINCP)ndatablock.h \
+  $(SOPHYAINCP)utilarr.h \
+  $(SOPHYAINCP)tmatrix_tsnl.h \
+  $(SOPHYAINCP)tvector_tsnl.h \
   $(SOPHYAINCP)histos.h \
-  $(SOPHYAINCP)objfio.h \
-  $(SOPHYAINCP)machdefs.h \
-  $(SOPHYAINCP)anydataobj.h \
-  $(SOPHYAINCP)ppersist.h \
-  $(SOPHYAINCP)pexceptions.h \
-  $(SOPHYAINCP)gnumd5.h \
-  $(SOPHYAINCP)ppfbinstream.h \
-  $(SOPHYAINCP)rawstream.h \
-  $(SOPHYAINCP)ppfnametag.h \
   $(SOPHYAINCP)peida.h \
   $(SOPHYAINCP)utils.h \
@@ -136,14 +147,4 @@
   $(SOPHYAINCP)fmath.h \
   $(SOPHYAINCP)tvector.h \
-  $(SOPHYAINCP)tmatrix.h \
-  $(SOPHYAINCP)tarray.h \
-  $(SOPHYAINCP)basarr.h \
-  $(SOPHYAINCP)mutyv.h \
-  $(SOPHYAINCP)timestamp.h \
-  $(SOPHYAINCP)dvlist.h \
-  $(SOPHYAINCP)ndatablock.h \
-  $(SOPHYAINCP)utilarr.h \
-  $(SOPHYAINCP)tmatrix_tsnl.h \
-  $(SOPHYAINCP)tvector_tsnl.h \
   $(SOPHYAINCP)srandgen.h classfunc.h cimage.h \
   $(SOPHYAINCP)tmatrix.h \
@@ -512,13 +513,24 @@
   $(SOPHYAINCP)pexceptions.h \
   $(SOPHYAINCP)machdefs.h perandom.h \
+  $(SOPHYAINCP)tvector.h \
+  $(SOPHYAINCP)tmatrix.h \
+  $(SOPHYAINCP)tarray.h \
+  $(SOPHYAINCP)basarr.h \
+  $(SOPHYAINCP)anydataobj.h \
+  $(SOPHYAINCP)mutyv.h \
+  $(SOPHYAINCP)timestamp.h \
+  $(SOPHYAINCP)objfio.h \
+  $(SOPHYAINCP)ppersist.h \
+  $(SOPHYAINCP)pexceptions.h \
+  $(SOPHYAINCP)gnumd5.h \
+  $(SOPHYAINCP)ppfbinstream.h \
+  $(SOPHYAINCP)rawstream.h \
+  $(SOPHYAINCP)ppfnametag.h \
+  $(SOPHYAINCP)dvlist.h \
+  $(SOPHYAINCP)ndatablock.h \
+  $(SOPHYAINCP)utilarr.h \
+  $(SOPHYAINCP)tmatrix_tsnl.h \
+  $(SOPHYAINCP)tvector_tsnl.h \
   $(SOPHYAINCP)histos.h \
-  $(SOPHYAINCP)objfio.h \
-  $(SOPHYAINCP)anydataobj.h \
-  $(SOPHYAINCP)ppersist.h \
-  $(SOPHYAINCP)pexceptions.h \
-  $(SOPHYAINCP)gnumd5.h \
-  $(SOPHYAINCP)ppfbinstream.h \
-  $(SOPHYAINCP)rawstream.h \
-  $(SOPHYAINCP)ppfnametag.h \
   $(SOPHYAINCP)peida.h \
   $(SOPHYAINCP)utils.h \
@@ -526,14 +538,4 @@
   $(SOPHYAINCP)fmath.h \
   $(SOPHYAINCP)tvector.h \
-  $(SOPHYAINCP)tmatrix.h \
-  $(SOPHYAINCP)tarray.h \
-  $(SOPHYAINCP)basarr.h \
-  $(SOPHYAINCP)mutyv.h \
-  $(SOPHYAINCP)timestamp.h \
-  $(SOPHYAINCP)dvlist.h \
-  $(SOPHYAINCP)ndatablock.h \
-  $(SOPHYAINCP)utilarr.h \
-  $(SOPHYAINCP)tmatrix_tsnl.h \
-  $(SOPHYAINCP)tvector_tsnl.h \
   $(SOPHYAINCP)srandgen.h classfunc.h pemath.h
 	$(CXXCOMPILE) $(CXXTEMPFLG) -o $@  perandom.cc
@@ -691,38 +693,4 @@
 	$(CXXCOMPILE) $(CXXTEMPFLG) -o $@  toeplitzMatrix.cc
  
-$(SOPHYAOBJP)tsfunran.o: tsfunran.cc $(SOPHYAINCP)sopnamsp.h \
-  $(SOPHYAINCP)machdefs.h \
-  $(SOPHYAINCP)pexceptions.h \
-  $(SOPHYAINCP)machdefs.h \
-  $(SOPHYAINCP)randr48.h \
-  $(SOPHYAINCP)objfio.h \
-  $(SOPHYAINCP)anydataobj.h \
-  $(SOPHYAINCP)ppersist.h \
-  $(SOPHYAINCP)pexceptions.h \
-  $(SOPHYAINCP)gnumd5.h \
-  $(SOPHYAINCP)ppfbinstream.h \
-  $(SOPHYAINCP)rawstream.h \
-  $(SOPHYAINCP)ppfnametag.h \
-  $(SOPHYAINCP)ndatablock.h \
-  $(SOPHYAINCP)randinterf.h tsfunran.h \
-  $(SOPHYAINCP)histos.h \
-  $(SOPHYAINCP)peida.h \
-  $(SOPHYAINCP)utils.h \
-  $(SOPHYAINCP)perrors.h \
-  $(SOPHYAINCP)fmath.h \
-  $(SOPHYAINCP)tvector.h \
-  $(SOPHYAINCP)tmatrix.h \
-  $(SOPHYAINCP)tarray.h \
-  $(SOPHYAINCP)basarr.h \
-  $(SOPHYAINCP)mutyv.h \
-  $(SOPHYAINCP)timestamp.h \
-  $(SOPHYAINCP)dvlist.h \
-  $(SOPHYAINCP)utilarr.h \
-  $(SOPHYAINCP)tmatrix_tsnl.h \
-  $(SOPHYAINCP)tvector_tsnl.h \
-  $(SOPHYAINCP)tvector.h \
-  $(SOPHYAINCP)randinterf.h classfunc.h
-	$(CXXCOMPILE) $(CXXTEMPFLG) -o $@  tsfunran.cc
- 
 $(SOPHYAOBJP)datime.o: datime.c $(SOPHYAINCP)machdefs.h \
   $(SOPHYAINCP)strutil.h nbconst.h datime.h
Index: trunk/SophyaLib/NTools/tsfunran.cc
===================================================================
--- trunk/SophyaLib/NTools/tsfunran.cc	(revision 3601)
+++ 	(revision )
@@ -1,228 +1,0 @@
-#include "sopnamsp.h"
-#include "machdefs.h"
-#include <iostream>
-#include "pexceptions.h"
-#include "randr48.h"
-#include "tsfunran.h"
-
-
-////////////////////////////////////////////////////////////////////////////
-/*!
-  \class SOPHYA::TsFunRan
-  \ingroup NTools
-  Classe for generating random variables from 1D function
-*/
-
-
-/********* Methode *********/
-/*! Creator from a function.
-\verbatim
- - if pdf==true: f est une densite de probabilite (PDF)
-                 non necessairement normalisee
-   if pdf==false: f est  une fonction de distribution (DF).
-                  non necessairement normalisee
- - Le tirage aleatoire est fait sur un histogramme
-   Histo(xMin,xMax,nBin) (voir convention dans Histo).
- - Chaque bin de l'histogramme contient la valeur de la PDF
-   (ou de la DF) au centre du bin: h(i)=f(BinCenter(i))
- - Les valeurs retournees sont les valeurs du centre des bins
-   pour le tirage non interpole et toutes les valeurs
-   entre [xmin,xmax] pour le tirage interpole
- - La pdf doit etre interpretee comme etant nulle
-   pour des x<=xmin et x>=xmax
- - Dans le bin "i" entre [x1,x2[ et de centre x0, h(i)=pdf(x0).
-   Pour le tirage interpole, la DF est approximee par un segment
-   et pdf(x0) est l'exces de proba entre x1 et x2:
-   bin 0 entre [xmin,BinHighEdge(0)[ :
-               la pdf va de 0 a pdf(BinCenter(0))
-   bin 1 entre [BinLowEdge(1),BinHighEdge(1)[:
-               la pdf va de pdf(BinCenter(0)) a pdf(BinCenter(1))
-   ...
-   bin n-1 entre [BinLowEdge(n-1),xmax[:
-               la pdf va de pdf(BinCenter(n-2)) a pdf(BinCenter(n-1))
-\endverbatim
-*/
-TsFunRan::TsFunRan(TsFunRan::Func f, r_8 xMin, r_8 xMax, int_4 nBin, bool pdf)
-  : Histo(xMin,xMax,nBin), rg_(NULL), internal_rg_(false)
-{
- if(nBin<=1)
-   throw RangeCheckError("TsFunRan::TsFunRan less than 2 bins requested");
- for(int_4 i=0;i<nBin;i++) (*this)(i) = f(BinCenter(i));
- rg_ = new DR48RandGen();
- create_DF(pdf);
-}
-
-/********* Methode *********/
-/*! Creator from a ClassFunc
-See TsFunRan::TsFunRan(TsFunRan::Func...) for further comments.
-*/
-TsFunRan::TsFunRan(ClassFunc& f, r_8 xMin, r_8 xMax, int_4 nBin, bool pdf)
-  : Histo(xMin,xMax,nBin), rg_(NULL), internal_rg_(false)
-{
- if(nBin<=1)
-   throw RangeCheckError("TsFunRan::TsFunRan less than 2 bins requested");
- for(int_4 i=0;i<nBin;i++) (*this)(i) = f(BinCenter(i));
- rg_ = new DR48RandGen();
- create_DF(pdf);
-}
-
-/********* Methode *********/
-/*! Creator from an table.
-If pdf=true, tab is a probability density fonction (not necessary normalised).
-If pdf=false, tab is a distribution function (not necessarly normalized to 1).
-The return random values will be between 0 and nBin-1.
-See TsFunRan::TsFunRan(TsFunRan::Func...) for further comments.
-*/
-TsFunRan::TsFunRan(r_8 *tab, int_4 nBin, bool pdf)
-: Histo(-0.5,nBin-0.5,nBin), rg_(NULL), internal_rg_(false)
-{
- if(nBin<=1)
-   throw RangeCheckError("TsFunRan::TsFunRan less than 2 bins requested");
- for(int_4 i=0;i<nBin;i++) (*this)(i) = tab[i];
- rg_ = new DR48RandGen();
- create_DF(pdf);
-}
-
-/********* Methode *********/
-/*! Creator from an table.
-If pdf=true, tab is a probability density fonction (not necessary normalised).
-If pdf=false, tab is a distribution function (not necessarly normalized to 1).
-The content of tab is identified has the content of
-an Histogram define by Histo(xMin,xMax,nBin).
-See FunRan::TsFunRan(TsFunRan::Func...) for further comments.
-*/
-TsFunRan::TsFunRan(r_8 *tab, int_4 nBin, r_8 xMin, r_8 xMax, bool pdf)
-: Histo(xMin,xMax,nBin), rg_(NULL), internal_rg_(false)
-{
- if(nBin<=1)
-   throw RangeCheckError("TsFunRan::TsFunRan less than 2 bins requested");
- for(int_4 i=0;i<nBin;i++) (*this)(i) = tab[i];
- rg_ = new DR48RandGen();
- create_DF(pdf);
-}
-
-/********* Methode *********/
-/*! Creator from a TVector
-*/
-TsFunRan::TsFunRan(TVector<r_8>& tab, int_4 nBin, bool pdf)
-: Histo(-0.5,nBin-0.5,nBin), rg_(NULL), internal_rg_(false)
-{
- if(nBin<=1)
-   throw RangeCheckError("TsFunRan::TsFunRan less than 2 bins requested");
- for(int_4 i=0;i<nBin;i++) (*this)(i) = tab(i);
- rg_ = new DR48RandGen();
- create_DF(pdf);
-}
-
-/********* Methode *********/
-/*! Creator from a TVector
-*/
-TsFunRan::TsFunRan(TVector<r_8>& tab, int_4 nBin, r_8 xMin, r_8 xMax, bool pdf)
-: Histo(xMin,xMax,nBin), rg_(NULL), internal_rg_(false)
-{
- if(nBin<=1)
-   throw RangeCheckError("TsFunRan::TsFunRan less than 2 bins requested");
- for(int_4 i=0;i<nBin;i++) (*this)(i) = tab(i);
- rg_ = new DR48RandGen();
- create_DF(pdf);
-}
-
-/********* Methode *********/
-/*! Creator from an histogram
-If pdf=true, h is a probability density fonction (not necessary normalised).
-If pdf=false, h is a distribution function (not necessarly normalized to 1).
-See TsFunRan::TsFunRan(TsFunRan::Func...) for further comments.
-*/
-TsFunRan::TsFunRan(Histo &h, bool pdf)
-  : Histo(h), rg_(NULL), internal_rg_(false)
-{
- if(mBins<=1)
-   throw RangeCheckError("TsFunRan::TsFunRan less than 2 bins requested");
- rg_ = new DR48RandGen();
- create_DF(pdf);
-}
-
-/********* Methode *********/
-/*! Creator by copy */
-TsFunRan::TsFunRan(const TsFunRan& fh)
-  : Histo(fh), rg_(fh.rg_), internal_rg_(false)
-{
-}
-
-/********* Methode *********/
-/*! Creator by default */
-TsFunRan::TsFunRan(void)
-  : rg_(NULL), internal_rg_(false)
-{
-}
-
-/********* Methode *********/
-TsFunRan::~TsFunRan(void)
-{
-  if(rg_!=NULL && internal_rg_) delete rg_;
-}
-
-/********* Methode *********/
-void TsFunRan::create_DF(bool pdf)
-// Creation (si necessaire) et normalisation de la DF
-{
-  // On fabrique la FD si necessaire
-  if(pdf)
-    for(int_4 i=1;i<mBins;i++) (*this)(i) += (*this)(i-1);
-
-  // On normalise la FD
-  if((*this)(mBins-1)<=0.) {
-    cout<<"TsFunRan::TsFunRan(Histo) not a distribution function last bin is <=0"<<endl;
-    throw RangeCheckError("TsFunRan::TsFunRan(Histo) not a distribution function last bin is <=0");
-  }
- for(int_4 i=0;i<mBins;i++) (*this)(i) /= (*this)(mBins-1);
-}
-
-/********* Methode *********/
-void TsFunRan::SetRandomGenerator(RandomGeneratorInterface* rg)
-{
-  if(rg_!=NULL && internal_rg_) delete rg_;
-  rg_ = rg;
-}
-
-/********* Methode *********/
-/*! Tirage avec retour du numero de bin entre 0 et mBins-1.
-It returns the first bin whose content is greater or equal
-to the random uniform number (in [0,1[)
-*/
-int_4 TsFunRan::BinRandom()
-{
- // recherche du premier bin plus grand ou egal a z
- r_8 z=rg_->Flat01();
- for(int_4 i=0;i<mBins;i++) if(z<(*this)(i)) return i;
- return mBins-1;
-}
-
-/********* Methode *********/
-/*! Tirage avec retour abscisse du bin non interpole. */
-r_8 TsFunRan::Random()
-{
- r_8 z=rg_->Flat01();
- int ibin = mBins-1;
- for(int_4 i=0;i<mBins;i++) if(z<(*this)(i)) {ibin=i; break;}
- return BinCenter(ibin);
-}
-
-/********* Methode *********/
-/*! Tirage avec retour abscisse du bin interpole. */
-r_8 TsFunRan::RandomInterp(void)
-{
- r_8 z=rg_->Flat01();
- int ibin = mBins-1;
- r_8 z1=0., z2;
- for(int_4 i=0;i<mBins;i++) {
-   z2 = (*this)(i);
-   if(z<z2) {ibin=i; break;}
-   z1 = z2;
- }
-
- // l'algorithme garanti que "z2-z1 != 0" et "z1<z2"
- return BinLowEdge(ibin) + (z-z1)/(z2-z1)*binWidth;
- 
-}
-
Index: trunk/SophyaLib/NTools/tsfunran.h
===================================================================
--- trunk/SophyaLib/NTools/tsfunran.h	(revision 3601)
+++ 	(revision )
@@ -1,46 +1,0 @@
-// This may look like C code, but it is really -*- C++ -*-
-// Tirages aleatoires sur une fonction (thread safe)
-// C. Magneville   2009
-// DAPNIA/SPP (Saclay) / CEA    LAL - IN2P3/CNRS  (Orsay)
-
-#ifndef TSFUNRAN_SEEN
-#define TSFUNRAN_SEEN
-
-#include "machdefs.h"
-#include <stdlib.h>
-#include <math.h>
-#include "histos.h"
-#include "tvector.h"
-#include "randinterf.h"
-#include "classfunc.h"
-
-namespace SOPHYA {  
-
-class TsFunRan : public Histo {
-public:
-  typedef r_8 (*Func)(r_8);
-  TsFunRan(ClassFunc& f, r_8 xMin=0.0, r_8 xMax=1.0, int_4 nBin=100, bool pdf=true);
-  TsFunRan(Func f, r_8 xMin=0.0, r_8 xMax=1.0, int_4 nBin=100, bool pdf=true);
-  TsFunRan(r_8 *tab, int_4 nBin, bool pdf=true);
-  TsFunRan(r_8 *tab, int_4 nBin, r_8 xMin, r_8 xMax, bool pdf=true);
-  TsFunRan(TVector<r_8>& tab, int_4 nBin, bool pdf=true);
-  TsFunRan(TVector<r_8>& tab, int_4 nBin, r_8 xMin, r_8 xMax, bool pdf=true);
-  TsFunRan(Histo &h, bool pdf=true);
-  TsFunRan(const TsFunRan& fh);
-  TsFunRan(void);
-  virtual ~TsFunRan(void);
-
-  void SetRandomGenerator(RandomGeneratorInterface* rg);
-
-  int_4 BinRandom(void);
-  r_8 Random(void);
-  r_8 RandomInterp(void);
-protected:
-  void create_DF(bool pdf);
-  RandomGeneratorInterface* rg_;
-  bool internal_rg_;
-};
-
-} // namespace SOPHYA
-
-#endif
