Commit 01b04a2e authored by thomas.forbriger's avatar thomas.forbriger Committed by thomas.forbriger
Browse files

new function

This is a legacy commit from before 2015-03-01.
It may be incomplete as well as inconsistent.
See COPYING.legacy and README.history for details.


SVN Path:     http://gpitrsvn.gpi.uni-karlsruhe.de/repos/TFSoftware/trunk
SVN Revision: 2141
SVN UUID:     67feda4a-a26e-11df-9d6e-31afc202ad0c
parent e0ec6500
# this is <Makefile>
# ----------------------------------------------------------------------------
# $Id: Makefile,v 1.18 2006-03-29 09:20:37 tforb Exp $
# $Id: Makefile,v 1.19 2006-06-29 12:32:46 tforb Exp $
#
# Copyright (c) 2003 by Thomas Forbriger (BFO Schiltach)
#
......@@ -33,7 +33,7 @@
HEADERS=$(shell find . -name \*.h)
LIBSRC=tsxx.cc filter.cc seifexx.cc seifeclass.cc \
anyfilter.cc filterbase.cc ipo.cc ipolin.cc sffheaders.cc
anyfilter.cc filterbase.cc ipo.cc ipolin.cc sffheaders.cc random.cc
INCINSTALLPATH=$(LOCINCLUDEDIR)/tsxx
LIBINSTALLPATH=$(LOCLIBDIR)
......
......@@ -3,7 +3,7 @@
*
* ----------------------------------------------------------------------------
*
* $Id: random.cc,v 1.1 2006-06-29 07:11:42 tforb Exp $
* $Id: random.cc,v 1.2 2006-06-29 12:32:46 tforb Exp $
* \author Thomas Forbriger
* \date 27/06/2006
*
......@@ -16,15 +16,36 @@
*
* ============================================================================
*/
#define TF_RANDOM_CC_VERSION \
"TF_RANDOM_CC V1.0 "
#define TF_RANDOM_CC_CVSID \
"$Id: random.cc,v 1.1 2006-06-29 07:11:42 tforb Exp $"
#define TS_RANDOM_CC_VERSION \
"TS_RANDOM_CC V1.0"
#define TS_RANDOM_CC_CVSID \
"$Id: random.cc,v 1.2 2006-06-29 12:32:46 tforb Exp $"
#include <random.h>
#include <tsxx/random.h>
#include <gsl/gsl_rng.h>
#include <gsl/gsl_randist.h>
#include <time.h>
namespace tf {
namespace ts {
}
namespace rnd {
Tdseries dugauss(const int& n)
{
Tdseries retval(n);
gsl_rng_env_setup();
const gsl_rng_type* T=gsl_rng_default;
gsl_rng* R=gsl_rng_alloc(T);
gsl_rng_set(R, time(0));
for (int i=retval.f(); i<=retval.l(); ++i)
{ retval(i)=gsl_ran_ugaussian(R); }
gsl_rng_free(R);
return (retval);
} // Tdseries dugauss
} // namespace rnd
} // namespace ts
/* ----- END OF random.cc ----- */
......@@ -3,7 +3,7 @@
*
* ----------------------------------------------------------------------------
*
* $Id: random.h,v 1.1 2006-06-29 07:11:42 tforb Exp $
* $Id: random.h,v 1.2 2006-06-29 12:32:46 tforb Exp $
* \author Thomas Forbriger
* \date 27/06/2006
*
......@@ -18,17 +18,30 @@
*/
// include guard
#ifndef TF_RANDOM_H_VERSION
#ifndef TS_RANDOM_H_VERSION
#define TF_RANDOM_H_VERSION \
"TF_RANDOM_H V1.0 "
#define TF_RANDOM_H_CVSID \
"$Id: random.h,v 1.1 2006-06-29 07:11:42 tforb Exp $"
#define TS_RANDOM_H_VERSION \
"TS_RANDOM_H V1.0"
#define TS_RANDOM_H_CVSID \
"$Id: random.h,v 1.2 2006-06-29 12:32:46 tforb Exp $"
namespace tf {
#include<aff/series.h>
}
namespace ts {
#endif // TF_RANDOM_H_VERSION (includeguard)
/*! random noise signal toolbox
*/
namespace rnd {
typedef aff::Series<double> Tdseries;
//! return gaussian uniform noise (standard dev=1, zero mean)
Tdseries dugauss(const int& n);
} // namespace rnd
} // namespace ts
#endif // TS_RANDOM_H_VERSION (includeguard)
/* ----- END OF random.h ----- */
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment