adding more functions and tests for eoNonUniform
This commit is contained in:
parent
557a06ff22
commit
387059901b
6 changed files with 132 additions and 23 deletions
|
|
@ -10,3 +10,4 @@ t-eoinsertion
|
|||
t-eolottery
|
||||
t-eoproblem
|
||||
t-eogeneration
|
||||
t-eoNonUniform
|
||||
|
|
|
|||
|
|
@ -13,7 +13,13 @@ 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
|
||||
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_eoNonUniform_SOURCES = t-eoNonUniform.cpp
|
||||
t_eoNonUniform_DEPENDENCIES = $(DEPS)
|
||||
t_eoNonUniform_LDFLAGS = -lm
|
||||
t_eoNonUniform_LDADD = $(LDADDS)
|
||||
|
||||
###############################################################################
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
# Makefile.in generated automatically by automake 1.4a from Makefile.am
|
||||
# Makefile.in generated automatically by automake 1.4 from Makefile.am
|
||||
|
||||
# Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
|
||||
# This Makefile.in is free software; the Free Software Foundation
|
||||
|
|
@ -49,10 +49,9 @@ AUTOMAKE = @AUTOMAKE@
|
|||
AUTOHEADER = @AUTOHEADER@
|
||||
|
||||
INSTALL = @INSTALL@
|
||||
INSTALL_PROGRAM = @INSTALL_PROGRAM@
|
||||
INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS)
|
||||
INSTALL_DATA = @INSTALL_DATA@
|
||||
INSTALL_SCRIPT = @INSTALL_SCRIPT@
|
||||
INSTALL_STRIP_FLAG =
|
||||
transform = @program_transform_name@
|
||||
|
||||
NORMAL_INSTALL = :
|
||||
|
|
@ -87,7 +86,13 @@ 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
|
||||
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_eoNonUniform_SOURCES = t-eoNonUniform.cpp
|
||||
t_eoNonUniform_DEPENDENCIES = $(DEPS)
|
||||
t_eoNonUniform_LDFLAGS = -lm
|
||||
t_eoNonUniform_LDADD = $(LDADDS)
|
||||
|
||||
###############################################################################
|
||||
|
||||
|
|
@ -185,6 +190,7 @@ t_eolottery_OBJECTS = t-eolottery.o
|
|||
t_eo2dVector_OBJECTS = t-eo2dVector.o
|
||||
t_eogeneration_OBJECTS = t-eogeneration.o
|
||||
t_eoEasyEA_OBJECTS = t-eoEasyEA.o
|
||||
t_eoNonUniform_OBJECTS = t-eoNonUniform.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)
|
||||
|
|
@ -198,11 +204,11 @@ 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-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)
|
||||
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)
|
||||
.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)
|
||||
|
||||
all: all-redirect
|
||||
.SUFFIXES:
|
||||
|
|
@ -299,6 +305,10 @@ t-eogeneration: $(t_eogeneration_OBJECTS) $(t_eogeneration_DEPENDENCIES)
|
|||
t-eoEasyEA: $(t_eoEasyEA_OBJECTS) $(t_eoEasyEA_DEPENDENCIES)
|
||||
@rm -f t-eoEasyEA
|
||||
$(CXXLINK) $(t_eoEasyEA_LDFLAGS) $(t_eoEasyEA_OBJECTS) $(t_eoEasyEA_LDADD) $(LIBS)
|
||||
|
||||
t-eoNonUniform: $(t_eoNonUniform_OBJECTS) $(t_eoNonUniform_DEPENDENCIES)
|
||||
@rm -f t-eoNonUniform
|
||||
$(CXXLINK) $(t_eoNonUniform_LDFLAGS) $(t_eoNonUniform_OBJECTS) $(t_eoNonUniform_LDADD) $(LIBS)
|
||||
.cc.o:
|
||||
$(CXXCOMPILE) -c $<
|
||||
.cc.lo:
|
||||
|
|
@ -350,7 +360,7 @@ distdir: $(DISTFILES)
|
|||
@for file in $(DISTFILES); do \
|
||||
d=$(srcdir); \
|
||||
if test -d $$d/$$file; then \
|
||||
cp -pr $$d/$$file $(distdir)/$$file; \
|
||||
cp -pr $$/$$file $(distdir)/$$file; \
|
||||
else \
|
||||
test -f $(distdir)/$$file \
|
||||
|| ln $$d/$$file $(distdir)/$$file 2> /dev/null \
|
||||
|
|
@ -449,7 +459,7 @@ uninstall: uninstall-am
|
|||
all-am: Makefile $(PROGRAMS)
|
||||
all-redirect: all-am
|
||||
install-strip:
|
||||
$(MAKE) $(AM_MAKEFLAGS) INSTALL_STRIP_FLAG=-s install
|
||||
$(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install
|
||||
installdirs:
|
||||
|
||||
|
||||
|
|
|
|||
31
eo/test/t-eoNonUniform.cpp
Normal file
31
eo/test/t-eoNonUniform.cpp
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
// t-eoNonUniform.cc
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
#include <iostream>
|
||||
#include <eo>
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
main()
|
||||
{
|
||||
eoNonUniform nu(1000);
|
||||
|
||||
cout << "----------------------------------------------------------" << endl
|
||||
<< "nu.step() = " << nu.step()
|
||||
<< "\t nu.num_step() = " << nu.num_step() << endl
|
||||
<< "----------------------------------------------------------" << endl;
|
||||
|
||||
eoLinear l1(0, 1, nu), l2(1, 0, nu);
|
||||
eoNegExp2 n1(0.1, 8, nu), n2(0.75, 3, nu);
|
||||
|
||||
for (; nu; ++nu)
|
||||
{
|
||||
cout << nu.step()
|
||||
<< "\t" << l1() << "\t" << l2()
|
||||
<< "\t" << n1() << "\t" << n2()
|
||||
<< endl;
|
||||
}
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
Reference in a new issue