Added new RNG and test files for it
This commit is contained in:
parent
18f6c31513
commit
46b6a9e17a
11 changed files with 561 additions and 35 deletions
|
|
@ -13,7 +13,8 @@ LDADDS = $(top_builddir)/src/libeo.a
|
|||
|
||||
###############################################################################
|
||||
|
||||
noinst_PROGRAMS = t-eobreeder t-eoinclusion t-eoinsertion t-eo t-eofitness t-eoproblem t-eobin t-eolottery t-eo2dVector t-eogeneration t-eoEasyEA t-eoNonUniform
|
||||
noinst_PROGRAMS = t-eobreeder t-eoinclusion t-eoinsertion t-eo t-eofitness t-eoproblem t-eobin t-eolottery t-eo2dVector t-eogeneration t-eoEasyEA t-eoNonUniform t-eoUniform t-eoRandom
|
||||
|
||||
###############################################################################
|
||||
|
||||
t_eoNonUniform_SOURCES = t-eoNonUniform.cpp
|
||||
|
|
@ -23,6 +24,20 @@ t_eoNonUniform_LDADD = $(LDADDS)
|
|||
|
||||
###############################################################################
|
||||
|
||||
t_eoUniform_SOURCES = t-eoUniform.cpp
|
||||
t_eoUniform_DEPENDENCIES = $(DEPS)
|
||||
t_eoUniform_LDFLAGS = -lm
|
||||
t_eoUniform_LDADD = $(LDADDS)
|
||||
|
||||
###############################################################################
|
||||
|
||||
t_eoRandom_SOURCES = t-eoRandom.cpp
|
||||
t_eoRandom_DEPENDENCIES = $(DEPS)
|
||||
t_eoRandom_LDFLAGS = -lm
|
||||
t_eoRandom_LDADD = $(LDADDS)
|
||||
|
||||
###############################################################################
|
||||
|
||||
t_eogeneration_SOURCES = t-eogeneration.cpp
|
||||
t_eogeneration_DEPENDENCIES = $(DEPS)
|
||||
t_eogeneration_LDFLAGS = -lm
|
||||
|
|
|
|||
|
|
@ -62,11 +62,17 @@ PRE_UNINSTALL = :
|
|||
POST_UNINSTALL = :
|
||||
host_alias = @host_alias@
|
||||
host_triplet = @host@
|
||||
AS = @AS@
|
||||
CC = @CC@
|
||||
CXX = @CXX@
|
||||
DLLTOOL = @DLLTOOL@
|
||||
LD = @LD@
|
||||
LIBTOOL = @LIBTOOL@
|
||||
LN_S = @LN_S@
|
||||
MAINT = @MAINT@
|
||||
MAKEINFO = @MAKEINFO@
|
||||
NM = @NM@
|
||||
OBJDUMP = @OBJDUMP@
|
||||
PACKAGE = @PACKAGE@
|
||||
RANLIB = @RANLIB@
|
||||
VERSION = @VERSION@
|
||||
|
|
@ -80,7 +86,8 @@ LDADDS = $(top_builddir)/src/libeo.a
|
|||
|
||||
###############################################################################
|
||||
|
||||
noinst_PROGRAMS = t-eobreeder t-eoinclusion t-eoinsertion t-eo t-eofitness t-eoproblem t-eobin t-eolottery t-eo2dVector t-eogeneration t-eoEasyEA t-eoNonUniform
|
||||
noinst_PROGRAMS = t-eobreeder t-eoinclusion t-eoinsertion t-eo t-eofitness t-eoproblem t-eobin t-eolottery t-eo2dVector t-eogeneration t-eoEasyEA t-eoNonUniform t-eoUniform t-eoRandom
|
||||
|
||||
###############################################################################
|
||||
|
||||
t_eoNonUniform_SOURCES = t-eoNonUniform.cpp
|
||||
|
|
@ -90,6 +97,20 @@ t_eoNonUniform_LDADD = $(LDADDS)
|
|||
|
||||
###############################################################################
|
||||
|
||||
t_eoUniform_SOURCES = t-eoUniform.cpp
|
||||
t_eoUniform_DEPENDENCIES = $(DEPS)
|
||||
t_eoUniform_LDFLAGS = -lm
|
||||
t_eoUniform_LDADD = $(LDADDS)
|
||||
|
||||
###############################################################################
|
||||
|
||||
t_eoRandom_SOURCES = t-eoRandom.cpp
|
||||
t_eoRandom_DEPENDENCIES = $(DEPS)
|
||||
t_eoRandom_LDFLAGS = -lm
|
||||
t_eoRandom_LDADD = $(LDADDS)
|
||||
|
||||
###############################################################################
|
||||
|
||||
t_eogeneration_SOURCES = t-eogeneration.cpp
|
||||
t_eogeneration_DEPENDENCIES = $(DEPS)
|
||||
t_eogeneration_LDFLAGS = -lm
|
||||
|
|
@ -185,6 +206,8 @@ t_eo2dVector_OBJECTS = t-eo2dVector.o
|
|||
t_eogeneration_OBJECTS = t-eogeneration.o
|
||||
t_eoEasyEA_OBJECTS = t-eoEasyEA.o
|
||||
t_eoNonUniform_OBJECTS = t-eoNonUniform.o
|
||||
t_eoUniform_OBJECTS = t-eoUniform.o
|
||||
t_eoRandom_OBJECTS = t-eoRandom.o
|
||||
CXXFLAGS = @CXXFLAGS@
|
||||
CXXCOMPILE = $(CXX) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
|
||||
LTCXXCOMPILE = $(LIBTOOL) --mode=compile $(CXX) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
|
||||
|
|
@ -203,11 +226,12 @@ DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
|
|||
TAR = gtar
|
||||
GZIP_ENV = --best
|
||||
DEP_FILES = .deps/t-eo.P .deps/t-eo2dVector.P .deps/t-eoEasyEA.P \
|
||||
.deps/t-eoNonUniform.P .deps/t-eobin.P .deps/t-eobreeder.P \
|
||||
.deps/t-eofitness.P .deps/t-eogeneration.P .deps/t-eoinclusion.P \
|
||||
.deps/t-eoinsertion.P .deps/t-eolottery.P .deps/t-eoproblem.P
|
||||
SOURCES = $(t_eobreeder_SOURCES) $(t_eoinclusion_SOURCES) $(t_eoinsertion_SOURCES) $(t_eo_SOURCES) $(t_eofitness_SOURCES) $(t_eoproblem_SOURCES) $(t_eobin_SOURCES) $(t_eolottery_SOURCES) $(t_eo2dVector_SOURCES) $(t_eogeneration_SOURCES) $(t_eoEasyEA_SOURCES) $(t_eoNonUniform_SOURCES)
|
||||
OBJECTS = $(t_eobreeder_OBJECTS) $(t_eoinclusion_OBJECTS) $(t_eoinsertion_OBJECTS) $(t_eo_OBJECTS) $(t_eofitness_OBJECTS) $(t_eoproblem_OBJECTS) $(t_eobin_OBJECTS) $(t_eolottery_OBJECTS) $(t_eo2dVector_OBJECTS) $(t_eogeneration_OBJECTS) $(t_eoEasyEA_OBJECTS) $(t_eoNonUniform_OBJECTS)
|
||||
.deps/t-eoNonUniform.P .deps/t-eoRandom.P .deps/t-eoUniform.P \
|
||||
.deps/t-eobin.P .deps/t-eobreeder.P .deps/t-eofitness.P \
|
||||
.deps/t-eogeneration.P .deps/t-eoinclusion.P .deps/t-eoinsertion.P \
|
||||
.deps/t-eolottery.P .deps/t-eoproblem.P
|
||||
SOURCES = $(t_eobreeder_SOURCES) $(t_eoinclusion_SOURCES) $(t_eoinsertion_SOURCES) $(t_eo_SOURCES) $(t_eofitness_SOURCES) $(t_eoproblem_SOURCES) $(t_eobin_SOURCES) $(t_eolottery_SOURCES) $(t_eo2dVector_SOURCES) $(t_eogeneration_SOURCES) $(t_eoEasyEA_SOURCES) $(t_eoNonUniform_SOURCES) $(t_eoUniform_SOURCES) $(t_eoRandom_SOURCES)
|
||||
OBJECTS = $(t_eobreeder_OBJECTS) $(t_eoinclusion_OBJECTS) $(t_eoinsertion_OBJECTS) $(t_eo_OBJECTS) $(t_eofitness_OBJECTS) $(t_eoproblem_OBJECTS) $(t_eobin_OBJECTS) $(t_eolottery_OBJECTS) $(t_eo2dVector_OBJECTS) $(t_eogeneration_OBJECTS) $(t_eoEasyEA_OBJECTS) $(t_eoNonUniform_OBJECTS) $(t_eoUniform_OBJECTS) $(t_eoRandom_OBJECTS)
|
||||
|
||||
all: all-redirect
|
||||
.SUFFIXES:
|
||||
|
|
@ -308,6 +332,14 @@ t-eoEasyEA: $(t_eoEasyEA_OBJECTS) $(t_eoEasyEA_DEPENDENCIES)
|
|||
t-eoNonUniform: $(t_eoNonUniform_OBJECTS) $(t_eoNonUniform_DEPENDENCIES)
|
||||
@rm -f t-eoNonUniform
|
||||
$(CXXLINK) $(t_eoNonUniform_LDFLAGS) $(t_eoNonUniform_OBJECTS) $(t_eoNonUniform_LDADD) $(LIBS)
|
||||
|
||||
t-eoUniform: $(t_eoUniform_OBJECTS) $(t_eoUniform_DEPENDENCIES)
|
||||
@rm -f t-eoUniform
|
||||
$(CXXLINK) $(t_eoUniform_LDFLAGS) $(t_eoUniform_OBJECTS) $(t_eoUniform_LDADD) $(LIBS)
|
||||
|
||||
t-eoRandom: $(t_eoRandom_OBJECTS) $(t_eoRandom_DEPENDENCIES)
|
||||
@rm -f t-eoRandom
|
||||
$(CXXLINK) $(t_eoRandom_LDFLAGS) $(t_eoRandom_OBJECTS) $(t_eoRandom_LDADD) $(LIBS)
|
||||
.cc.o:
|
||||
$(CXXCOMPILE) -c $<
|
||||
.cc.lo:
|
||||
|
|
|
|||
28
eo/test/t-eoRandom.cpp
Normal file
28
eo/test/t-eoRandom.cpp
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
// t-eouniform
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
#include <iostream> // cout
|
||||
#include <strstream> // ostrstream, istrstream
|
||||
#include <eoUniform.h> // eoBin
|
||||
#include <eoNormal.h>
|
||||
#include <eoNegExp.h>
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
main() {
|
||||
eoNormal<float> n1(-2.5,3.5);
|
||||
eoNormal<double> n2(0.003, 0.0005 );
|
||||
eoNormal<unsigned long> n3( 10000000U, 10000U);
|
||||
eoNegExp<float> e1(3.5);
|
||||
eoNegExp<double> e2(0.003 );
|
||||
eoNegExp<long> e3( 10000U);
|
||||
cout << "n1\t\tn2\t\tn3\t\te1\t\te2\t\te3" << endl;
|
||||
for ( unsigned i = 0; i < 100; i ++) {
|
||||
cout << n1() << "\t" << n2() << "\t" << n3() << "\t" <<
|
||||
e1() << "\t" << e2() << "\t" << e3() << endl;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
22
eo/test/t-eoUniform.cpp
Normal file
22
eo/test/t-eoUniform.cpp
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
// t-eouniform
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
#include <iostream> // cout
|
||||
#include <strstream> // ostrstream, istrstream
|
||||
#include <eoUniform.h> // eoBin
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
main() {
|
||||
eoUniform<float> u1(-2.5,3.5);
|
||||
eoUniform<double> u2(0.003, 0 );
|
||||
eoUniform<unsigned long> u3( 10000U, 10000000U);
|
||||
cout << "u1\t\tu2\t\tu3" << endl;
|
||||
for ( unsigned i = 0; i < 100; i ++) {
|
||||
cout << u1() << "\t" << u2() << "\t" << u3() << endl;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
Loading…
Add table
Add a link
Reference in a new issue