Bootstrap.H

Go to the documentation of this file.
00001 /*
00002     Copyright (C) 2004  Kurt Schwehr
00003 
00004     This program is free software; you can redistribute it and/or modify
00005     it under the terms of the GNU General Public License as published by
00006     the Free Software Foundation; either version 2 of the License, or
00007     (at your option) any later version.
00008 
00009     This program is distributed in the hope that it will be useful,
00010     but WITHOUT ANY WARRANTY; without even the implied warranty of
00011     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012     GNU General Public License for more details.
00013 
00014     You should have received a copy of the GNU General Public License
00015     along with this program; if not, write to the Free Software
00016     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00017 
00018 */
00019 #ifndef _BOOTSTRAP_H_
00020 #define _BOOTSTRAP_H_
00021 
00025 
00026 
00027 #include <gsl/gsl_rng.h>
00028 #include <cstdio>
00029 
00030 #include <vector>
00031 
00032 #include "kdsPmagL.H"
00033 
00036 void Print(const SVec &sv);
00037 
00059 
00060 
00061 size_t BootstrapParametricSample(const std::vector<SVec> &s, const std::vector<float> &sigmas,
00062                                  SVec &newSample,   gsl_rng *r);
00063 
00083 
00084 
00085 size_t BootstrapParametricSite  (const std::vector<SVec> &s, const float sigma, 
00086                                  SVec &newSample,   gsl_rng *r);
00087 
00088 
00095 
00096 template <class T>
00097 T getDevRandom(T &randomSample) {
00098     FILE * devRandom = fopen ("/dev/random", "r");
00099     assert (devRandom);
00100     fread (&randomSample,sizeof(T),1,devRandom);
00101     fclose (devRandom);
00102     return (randomSample);
00103 }
00104 
00105 #endif // _BOOTSTRAP_H_

Generated on Thu Mar 2 17:55:25 2006 for density by  doxygen 1.4.6