pygccxml-commit Mailing List for C++ Python language bindings (Page 70)
Brought to you by:
mbaas,
roman_yakovenko
You can subscribe to this list here.
2006 |
Jan
|
Feb
|
Mar
(190) |
Apr
(166) |
May
(170) |
Jun
(75) |
Jul
(105) |
Aug
(131) |
Sep
(99) |
Oct
(84) |
Nov
(67) |
Dec
(54) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2007 |
Jan
(66) |
Feb
(49) |
Mar
(25) |
Apr
(62) |
May
(21) |
Jun
(34) |
Jul
(9) |
Aug
(21) |
Sep
(5) |
Oct
|
Nov
(63) |
Dec
(34) |
2008 |
Jan
(10) |
Feb
(42) |
Mar
(26) |
Apr
(25) |
May
(6) |
Jun
(40) |
Jul
(18) |
Aug
(29) |
Sep
(6) |
Oct
(32) |
Nov
(14) |
Dec
(56) |
2009 |
Jan
(127) |
Feb
(52) |
Mar
(2) |
Apr
(10) |
May
(29) |
Jun
(3) |
Jul
|
Aug
(16) |
Sep
(4) |
Oct
(11) |
Nov
(8) |
Dec
(14) |
2010 |
Jan
(31) |
Feb
(1) |
Mar
(7) |
Apr
(9) |
May
(1) |
Jun
|
Jul
(2) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2011 |
Jan
|
Feb
(8) |
Mar
(4) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2014 |
Jan
|
Feb
|
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: <rom...@us...> - 2006-05-17 06:38:10
|
Revision: 116 Author: roman_yakovenko Date: 2006-05-16 23:38:02 -0700 (Tue, 16 May 2006) ViewCVS: http://svn.sourceforge.net/pygccxml/?rev=116&view=rev Log Message: ----------- rename random to boost_random Added Paths: ----------- pyplusplus_dev/examples/pyboost_dev/pyboost/boost_random/ Removed Paths: ------------- pyplusplus_dev/examples/pyboost_dev/pyboost/boost_random/generated/ Copied: pyplusplus_dev/examples/pyboost_dev/pyboost/boost_random (from rev 113, pyplusplus_dev/examples/pyboost_dev/pyboost/brandom) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rom...@us...> - 2006-05-17 06:26:17
|
Revision: 115 Author: roman_yakovenko Date: 2006-05-16 23:26:12 -0700 (Tue, 16 May 2006) ViewCVS: http://svn.sourceforge.net/pygccxml/?rev=115&view=rev Log Message: ----------- remove generated dir Removed Paths: ------------- pyplusplus_dev/examples/pyboost_dev/pyboost/brandom/generated/ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rom...@us...> - 2006-05-17 06:25:43
|
Revision: 114 Author: roman_yakovenko Date: 2006-05-16 23:25:39 -0700 (Tue, 16 May 2006) ViewCVS: http://svn.sourceforge.net/pygccxml/?rev=114&view=rev Log Message: ----------- rename random to brandom Removed Paths: ------------- pyplusplus_dev/examples/pyboost_dev/pyboost/random/ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rom...@us...> - 2006-05-17 06:20:04
|
Revision: 113 Author: roman_yakovenko Date: 2006-05-16 23:19:51 -0700 (Tue, 16 May 2006) ViewCVS: http://svn.sourceforge.net/pygccxml/?rev=113&view=rev Log Message: ----------- rename random to brandom Added Paths: ----------- pyplusplus_dev/examples/pyboost_dev/unittests/brandom/ pyplusplus_dev/examples/pyboost_dev/unittests/brandom/__init__.py pyplusplus_dev/examples/pyboost_dev/unittests/brandom/unittests/test_all.py Copied: pyplusplus_dev/examples/pyboost_dev/unittests/brandom (from rev 89, pyplusplus_dev/examples/pyboost_dev/unittests/random) Copied: pyplusplus_dev/examples/pyboost_dev/unittests/brandom/__init__.py (from rev 112, pyplusplus_dev/examples/pyboost_dev/unittests/random/__init__.py) =================================================================== --- pyplusplus_dev/examples/pyboost_dev/unittests/brandom/__init__.py (rev 0) +++ pyplusplus_dev/examples/pyboost_dev/unittests/brandom/__init__.py 2006-05-17 06:19:51 UTC (rev 113) @@ -0,0 +1,492 @@ +#! /usr/bin/python +# Copyright 2004 Roman Yakovenko. +# Distributed under the Boost Software License, Version 1.0. (See +# accompanying file LICENSE_1_0.txt or copy at +# http://www.boost.org/LICENSE_1_0.txt) + +import _random_ + +#generators: +from _random_ import ecuyer1988 +from _random_ import hellekalek1995 +from _random_ import kreutzer1986 +from _random_ import lagged_fibonacci1279 +from _random_ import lagged_fibonacci19937 +from _random_ import lagged_fibonacci2281 +from _random_ import lagged_fibonacci23209 +from _random_ import lagged_fibonacci3217 +from _random_ import lagged_fibonacci4423 +from _random_ import lagged_fibonacci44497 +from _random_ import lagged_fibonacci607 +from _random_ import lagged_fibonacci9689 +from _random_ import minstd_rand +from _random_ import minstd_rand0 +from _random_ import mt11213b +from _random_ import mt19937 +from _random_ import ranlux3 +from _random_ import ranlux3_01 +from _random_ import ranlux4 +from _random_ import ranlux4_01 +from _random_ import ranlux64_3_01 +from _random_ import ranlux64_4_01 +from _random_ import taus88 + +generators = [ + ecuyer1988 + , hellekalek1995 + , kreutzer1986 + , lagged_fibonacci1279 + , lagged_fibonacci19937 + , lagged_fibonacci2281 + , lagged_fibonacci23209 + , lagged_fibonacci3217 + , lagged_fibonacci4423 + , lagged_fibonacci44497 + , lagged_fibonacci607 + , lagged_fibonacci9689 + , minstd_rand + , minstd_rand0 + , mt11213b + , mt19937 + , ranlux3 + , ranlux3_01 + , ranlux4 + , ranlux4_01 + , ranlux64_3_01 + , ranlux64_4_01 + , taus88 +] + +#distribution +from _random_ import bernoulli_distribution +bernoulli_distribution.__call__ = _random_.py_bernoulli_distribution.call + +from _random_ import binomial_distribution +binomial_distribution.__call__ = _random_.py_binomial_distribution.call + +from _random_ import cauchy_distribution +cauchy_distribution.__call__ = _random_.py_cauchy_distribution.call + +from _random_ import exponential_distribution +exponential_distribution.__call__ = _random_.py_exponential_distribution.call + +from _random_ import gamma_distribution +gamma_distribution.__call__ = _random_.py_gamma_distribution.call + +from _random_ import geometric_distribution +geometric_distribution.__call__ = _random_.py_geometric_distribution.call + +from _random_ import lognormal_distribution +lognormal_distribution.__call__ = _random_.py_lognormal_distribution.call + +from _random_ import normal_distribution +normal_distribution.__call__ = _random_.py_normal_distribution.call + +from _random_ import poisson_distribution +poisson_distribution.__call__ = _random_.py_poisson_distribution.call + +from _random_ import triangle_distribution +triangle_distribution.__call__ = _random_.py_triangle_distribution.call + +from _random_ import uniform_int +uniform_int.__call__ = _random_.py_uniform_int.call + +from _random_ import uniform_on_sphere +uniform_on_sphere.__call__ = _random_.py_uniform_on_sphere.call + +from _random_ import uniform_real +uniform_real.__call__ = _random_.py_uniform_real.call + +from _random_ import uniform_smallint +uniform_smallint.__call__ = _random_.py_uniform_smallint.call + +distributions = [ + bernoulli_distribution + , binomial_distribution + , cauchy_distribution + , exponential_distribution + , gamma_distribution + , geometric_distribution + , lognormal_distribution + , normal_distribution + , poisson_distribution + , triangle_distribution + , uniform_int + , uniform_on_sphere + , uniform_real + , uniform_smallint +] + + + +__vg = {} +for g in generators: + __vg[g] = {} + +__vg[ ecuyer1988 ][ bernoulli_distribution ] = _random_.variate_generator_ecuyer1988__bernoulli_distribution +__vg[ ecuyer1988 ][ binomial_distribution ] = _random_.variate_generator_ecuyer1988__binomial_distribution +__vg[ ecuyer1988 ][ cauchy_distribution ] = _random_.variate_generator_ecuyer1988__cauchy_distribution +__vg[ ecuyer1988 ][ exponential_distribution ] = _random_.variate_generator_ecuyer1988__exponential_distribution +__vg[ ecuyer1988 ][ gamma_distribution ] = _random_.variate_generator_ecuyer1988__gamma_distribution +__vg[ ecuyer1988 ][ geometric_distribution ] = _random_.variate_generator_ecuyer1988__geometric_distribution +__vg[ ecuyer1988 ][ lognormal_distribution ] = _random_.variate_generator_ecuyer1988__lognormal_distribution +__vg[ ecuyer1988 ][ normal_distribution ] = _random_.variate_generator_ecuyer1988__normal_distribution +__vg[ ecuyer1988 ][ poisson_distribution ] = _random_.variate_generator_ecuyer1988__poisson_distribution +__vg[ ecuyer1988 ][ triangle_distribution ] = _random_.variate_generator_ecuyer1988__triangle_distribution +__vg[ ecuyer1988 ][ uniform_int ] = _random_.variate_generator_ecuyer1988__uniform_int +__vg[ ecuyer1988 ][ uniform_on_sphere ] = _random_.variate_generator_ecuyer1988__uniform_on_sphere +__vg[ ecuyer1988 ][ uniform_real ] = _random_.variate_generator_ecuyer1988__uniform_real +__vg[ ecuyer1988 ][ uniform_smallint ] = _random_.variate_generator_ecuyer1988__uniform_smallint + +__vg[ hellekalek1995 ][ bernoulli_distribution ] = _random_.variate_generator_hellekalek1995__bernoulli_distribution +__vg[ hellekalek1995 ][ binomial_distribution ] = _random_.variate_generator_hellekalek1995__binomial_distribution +__vg[ hellekalek1995 ][ cauchy_distribution ] = _random_.variate_generator_hellekalek1995__cauchy_distribution +__vg[ hellekalek1995 ][ exponential_distribution ] = _random_.variate_generator_hellekalek1995__exponential_distribution +__vg[ hellekalek1995 ][ gamma_distribution ] = _random_.variate_generator_hellekalek1995__gamma_distribution +__vg[ hellekalek1995 ][ geometric_distribution ] = _random_.variate_generator_hellekalek1995__geometric_distribution +__vg[ hellekalek1995 ][ lognormal_distribution ] = _random_.variate_generator_hellekalek1995__lognormal_distribution +__vg[ hellekalek1995 ][ normal_distribution ] = _random_.variate_generator_hellekalek1995__normal_distribution +__vg[ hellekalek1995 ][ poisson_distribution ] = _random_.variate_generator_hellekalek1995__poisson_distribution +__vg[ hellekalek1995 ][ triangle_distribution ] = _random_.variate_generator_hellekalek1995__triangle_distribution +__vg[ hellekalek1995 ][ uniform_int ] = _random_.variate_generator_hellekalek1995__uniform_int +__vg[ hellekalek1995 ][ uniform_on_sphere ] = _random_.variate_generator_hellekalek1995__uniform_on_sphere +__vg[ hellekalek1995 ][ uniform_real ] = _random_.variate_generator_hellekalek1995__uniform_real +__vg[ hellekalek1995 ][ uniform_smallint ] = _random_.variate_generator_hellekalek1995__uniform_smallint + +__vg[ kreutzer1986 ][ bernoulli_distribution ] = _random_.variate_generator_kreutzer1986__bernoulli_distribution +__vg[ kreutzer1986 ][ binomial_distribution ] = _random_.variate_generator_kreutzer1986__binomial_distribution +__vg[ kreutzer1986 ][ cauchy_distribution ] = _random_.variate_generator_kreutzer1986__cauchy_distribution +__vg[ kreutzer1986 ][ exponential_distribution ] = _random_.variate_generator_kreutzer1986__exponential_distribution +__vg[ kreutzer1986 ][ gamma_distribution ] = _random_.variate_generator_kreutzer1986__gamma_distribution +__vg[ kreutzer1986 ][ geometric_distribution ] = _random_.variate_generator_kreutzer1986__geometric_distribution +__vg[ kreutzer1986 ][ lognormal_distribution ] = _random_.variate_generator_kreutzer1986__lognormal_distribution +__vg[ kreutzer1986 ][ normal_distribution ] = _random_.variate_generator_kreutzer1986__normal_distribution +__vg[ kreutzer1986 ][ poisson_distribution ] = _random_.variate_generator_kreutzer1986__poisson_distribution +__vg[ kreutzer1986 ][ triangle_distribution ] = _random_.variate_generator_kreutzer1986__triangle_distribution +__vg[ kreutzer1986 ][ uniform_int ] = _random_.variate_generator_kreutzer1986__uniform_int +__vg[ kreutzer1986 ][ uniform_on_sphere ] = _random_.variate_generator_kreutzer1986__uniform_on_sphere +__vg[ kreutzer1986 ][ uniform_real ] = _random_.variate_generator_kreutzer1986__uniform_real +__vg[ kreutzer1986 ][ uniform_smallint ] = _random_.variate_generator_kreutzer1986__uniform_smallint + +__vg[ lagged_fibonacci1279 ][ bernoulli_distribution ] = _random_.variate_generator_lagged_fibonacci1279__bernoulli_distribution +__vg[ lagged_fibonacci1279 ][ binomial_distribution ] = _random_.variate_generator_lagged_fibonacci1279__binomial_distribution +__vg[ lagged_fibonacci1279 ][ cauchy_distribution ] = _random_.variate_generator_lagged_fibonacci1279__cauchy_distribution +__vg[ lagged_fibonacci1279 ][ exponential_distribution ] = _random_.variate_generator_lagged_fibonacci1279__exponential_distribution +__vg[ lagged_fibonacci1279 ][ gamma_distribution ] = _random_.variate_generator_lagged_fibonacci1279__gamma_distribution +__vg[ lagged_fibonacci1279 ][ geometric_distribution ] = _random_.variate_generator_lagged_fibonacci1279__geometric_distribution +__vg[ lagged_fibonacci1279 ][ lognormal_distribution ] = _random_.variate_generator_lagged_fibonacci1279__lognormal_distribution +__vg[ lagged_fibonacci1279 ][ normal_distribution ] = _random_.variate_generator_lagged_fibonacci1279__normal_distribution +__vg[ lagged_fibonacci1279 ][ poisson_distribution ] = _random_.variate_generator_lagged_fibonacci1279__poisson_distribution +__vg[ lagged_fibonacci1279 ][ triangle_distribution ] = _random_.variate_generator_lagged_fibonacci1279__triangle_distribution +__vg[ lagged_fibonacci1279 ][ uniform_on_sphere ] = _random_.variate_generator_lagged_fibonacci1279__uniform_on_sphere +__vg[ lagged_fibonacci1279 ][ uniform_real ] = _random_.variate_generator_lagged_fibonacci1279__uniform_real +#__vg[ ][ uniform_int ] = _random_.does not exist +#__vg[ ][ uniform_smallint ] = _random_.does not exist + +__vg[ lagged_fibonacci19937 ][ bernoulli_distribution ] = _random_.variate_generator_lagged_fibonacci19937__bernoulli_distribution +__vg[ lagged_fibonacci19937 ][ binomial_distribution ] = _random_.variate_generator_lagged_fibonacci19937__binomial_distribution +__vg[ lagged_fibonacci19937 ][ cauchy_distribution ] = _random_.variate_generator_lagged_fibonacci19937__cauchy_distribution +__vg[ lagged_fibonacci19937 ][ exponential_distribution ] = _random_.variate_generator_lagged_fibonacci19937__exponential_distribution +__vg[ lagged_fibonacci19937 ][ gamma_distribution ] = _random_.variate_generator_lagged_fibonacci19937__gamma_distribution +__vg[ lagged_fibonacci19937 ][ geometric_distribution ] = _random_.variate_generator_lagged_fibonacci19937__geometric_distribution +__vg[ lagged_fibonacci19937 ][ lognormal_distribution ] = _random_.variate_generator_lagged_fibonacci19937__lognormal_distribution +__vg[ lagged_fibonacci19937 ][ normal_distribution ] = _random_.variate_generator_lagged_fibonacci19937__normal_distribution +__vg[ lagged_fibonacci19937 ][ poisson_distribution ] = _random_.variate_generator_lagged_fibonacci19937__poisson_distribution +__vg[ lagged_fibonacci19937 ][ triangle_distribution ] = _random_.variate_generator_lagged_fibonacci19937__triangle_distribution +__vg[ lagged_fibonacci19937 ][ uniform_on_sphere ] = _random_.variate_generator_lagged_fibonacci19937__uniform_on_sphere +__vg[ lagged_fibonacci19937 ][ uniform_real ] = _random_.variate_generator_lagged_fibonacci19937__uniform_real +#__vg[ ][ uniform_int ] = _random_.does not exist +#__vg[ ][ uniform_smallint ] = _random_.does not exist + +__vg[ lagged_fibonacci2281 ][ bernoulli_distribution ] = _random_.variate_generator_lagged_fibonacci2281__bernoulli_distribution +__vg[ lagged_fibonacci2281 ][ binomial_distribution ] = _random_.variate_generator_lagged_fibonacci2281__binomial_distribution +__vg[ lagged_fibonacci2281 ][ cauchy_distribution ] = _random_.variate_generator_lagged_fibonacci2281__cauchy_distribution +__vg[ lagged_fibonacci2281 ][ exponential_distribution ] = _random_.variate_generator_lagged_fibonacci2281__exponential_distribution +__vg[ lagged_fibonacci2281 ][ gamma_distribution ] = _random_.variate_generator_lagged_fibonacci2281__gamma_distribution +__vg[ lagged_fibonacci2281 ][ geometric_distribution ] = _random_.variate_generator_lagged_fibonacci2281__geometric_distribution +__vg[ lagged_fibonacci2281 ][ lognormal_distribution ] = _random_.variate_generator_lagged_fibonacci2281__lognormal_distribution +__vg[ lagged_fibonacci2281 ][ normal_distribution ] = _random_.variate_generator_lagged_fibonacci2281__normal_distribution +__vg[ lagged_fibonacci2281 ][ poisson_distribution ] = _random_.variate_generator_lagged_fibonacci2281__poisson_distribution +__vg[ lagged_fibonacci2281 ][ triangle_distribution ] = _random_.variate_generator_lagged_fibonacci2281__triangle_distribution +__vg[ lagged_fibonacci2281 ][ uniform_on_sphere ] = _random_.variate_generator_lagged_fibonacci2281__uniform_on_sphere +__vg[ lagged_fibonacci2281 ][ uniform_real ] = _random_.variate_generator_lagged_fibonacci2281__uniform_real +#__vg[ ][ uniform_int ] = _random_.does not exist +#__vg[ ][ uniform_smallint ] = _random_.does not exist + +__vg[ lagged_fibonacci23209 ][ bernoulli_distribution ] = _random_.variate_generator_lagged_fibonacci23209__bernoulli_distribution +__vg[ lagged_fibonacci23209 ][ binomial_distribution ] = _random_.variate_generator_lagged_fibonacci23209__binomial_distribution +__vg[ lagged_fibonacci23209 ][ cauchy_distribution ] = _random_.variate_generator_lagged_fibonacci23209__cauchy_distribution +__vg[ lagged_fibonacci23209 ][ exponential_distribution ] = _random_.variate_generator_lagged_fibonacci23209__exponential_distribution +__vg[ lagged_fibonacci23209 ][ gamma_distribution ] = _random_.variate_generator_lagged_fibonacci23209__gamma_distribution +__vg[ lagged_fibonacci23209 ][ geometric_distribution ] = _random_.variate_generator_lagged_fibonacci23209__geometric_distribution +__vg[ lagged_fibonacci23209 ][ lognormal_distribution ] = _random_.variate_generator_lagged_fibonacci23209__lognormal_distribution +__vg[ lagged_fibonacci23209 ][ normal_distribution ] = _random_.variate_generator_lagged_fibonacci23209__normal_distribution +__vg[ lagged_fibonacci23209 ][ poisson_distribution ] = _random_.variate_generator_lagged_fibonacci23209__poisson_distribution +__vg[ lagged_fibonacci23209 ][ triangle_distribution ] = _random_.variate_generator_lagged_fibonacci23209__triangle_distribution +__vg[ lagged_fibonacci23209 ][ uniform_on_sphere ] = _random_.variate_generator_lagged_fibonacci23209__uniform_on_sphere +__vg[ lagged_fibonacci23209 ][ uniform_real ] = _random_.variate_generator_lagged_fibonacci23209__uniform_real +#__vg[ ][ uniform_int ] = _random_.does not exist +#__vg[ ][ uniform_smallint ] = _random_.does not exist + + +__vg[ lagged_fibonacci3217 ][ bernoulli_distribution ] = _random_.variate_generator_lagged_fibonacci3217__bernoulli_distribution +__vg[ lagged_fibonacci3217 ][ binomial_distribution ] = _random_.variate_generator_lagged_fibonacci3217__binomial_distribution +__vg[ lagged_fibonacci3217 ][ cauchy_distribution ] = _random_.variate_generator_lagged_fibonacci3217__cauchy_distribution +__vg[ lagged_fibonacci3217 ][ exponential_distribution ] = _random_.variate_generator_lagged_fibonacci3217__exponential_distribution +__vg[ lagged_fibonacci3217 ][ gamma_distribution ] = _random_.variate_generator_lagged_fibonacci3217__gamma_distribution +__vg[ lagged_fibonacci3217 ][ geometric_distribution ] = _random_.variate_generator_lagged_fibonacci3217__geometric_distribution +__vg[ lagged_fibonacci3217 ][ lognormal_distribution ] = _random_.variate_generator_lagged_fibonacci3217__lognormal_distribution +__vg[ lagged_fibonacci3217 ][ normal_distribution ] = _random_.variate_generator_lagged_fibonacci3217__normal_distribution +__vg[ lagged_fibonacci3217 ][ poisson_distribution ] = _random_.variate_generator_lagged_fibonacci3217__poisson_distribution +__vg[ lagged_fibonacci3217 ][ triangle_distribution ] = _random_.variate_generator_lagged_fibonacci3217__triangle_distribution +__vg[ lagged_fibonacci3217 ][ uniform_int ] = _random_.variate_generator_lagged_fibonacci3217__uniform_on_sphere +__vg[ lagged_fibonacci3217 ][ uniform_on_sphere ] = _random_.variate_generator_lagged_fibonacci3217__uniform_real +#__vg[ ][ uniform_real ] = _random_.does not exist +#__vg[ ][ uniform_smallint ] = _random_.does not exist + + +__vg[ lagged_fibonacci4423 ][ bernoulli_distribution ] = _random_.variate_generator_lagged_fibonacci4423__bernoulli_distribution +__vg[ lagged_fibonacci4423 ][ binomial_distribution ] = _random_.variate_generator_lagged_fibonacci4423__binomial_distribution +__vg[ lagged_fibonacci4423 ][ cauchy_distribution ] = _random_.variate_generator_lagged_fibonacci4423__cauchy_distribution +__vg[ lagged_fibonacci4423 ][ exponential_distribution ] = _random_.variate_generator_lagged_fibonacci4423__exponential_distribution +__vg[ lagged_fibonacci4423 ][ gamma_distribution ] = _random_.variate_generator_lagged_fibonacci4423__gamma_distribution +__vg[ lagged_fibonacci4423 ][ geometric_distribution ] = _random_.variate_generator_lagged_fibonacci4423__geometric_distribution +__vg[ lagged_fibonacci4423 ][ lognormal_distribution ] = _random_.variate_generator_lagged_fibonacci4423__lognormal_distribution +__vg[ lagged_fibonacci4423 ][ normal_distribution ] = _random_.variate_generator_lagged_fibonacci4423__normal_distribution +__vg[ lagged_fibonacci4423 ][ poisson_distribution ] = _random_.variate_generator_lagged_fibonacci4423__poisson_distribution +__vg[ lagged_fibonacci4423 ][ triangle_distribution ] = _random_.variate_generator_lagged_fibonacci4423__triangle_distribution +__vg[ lagged_fibonacci4423 ][ uniform_on_sphere ] = _random_.variate_generator_lagged_fibonacci4423__uniform_on_sphere +__vg[ lagged_fibonacci4423 ][ uniform_real ] = _random_.variate_generator_lagged_fibonacci4423__uniform_real +#__vg[ ][ uniform_int ] = _random_.does not exist +#__vg[ ][ uniform_smallint ] = _random_.does not exist + + +__vg[ lagged_fibonacci44497 ][ bernoulli_distribution ] = _random_.variate_generator_lagged_fibonacci44497__bernoulli_distribution +__vg[ lagged_fibonacci44497 ][ binomial_distribution ] = _random_.variate_generator_lagged_fibonacci44497__binomial_distribution +__vg[ lagged_fibonacci44497 ][ cauchy_distribution ] = _random_.variate_generator_lagged_fibonacci44497__cauchy_distribution +__vg[ lagged_fibonacci44497 ][ exponential_distribution ] = _random_.variate_generator_lagged_fibonacci44497__exponential_distribution +__vg[ lagged_fibonacci44497 ][ gamma_distribution ] = _random_.variate_generator_lagged_fibonacci44497__gamma_distribution +__vg[ lagged_fibonacci44497 ][ geometric_distribution ] = _random_.variate_generator_lagged_fibonacci44497__geometric_distribution +__vg[ lagged_fibonacci44497 ][ lognormal_distribution ] = _random_.variate_generator_lagged_fibonacci44497__lognormal_distribution +__vg[ lagged_fibonacci44497 ][ normal_distribution ] = _random_.variate_generator_lagged_fibonacci44497__normal_distribution +__vg[ lagged_fibonacci44497 ][ poisson_distribution ] = _random_.variate_generator_lagged_fibonacci44497__poisson_distribution +__vg[ lagged_fibonacci44497 ][ triangle_distribution ] = _random_.variate_generator_lagged_fibonacci44497__triangle_distribution +__vg[ lagged_fibonacci44497 ][ uniform_on_sphere ] = _random_.variate_generator_lagged_fibonacci44497__uniform_on_sphere +__vg[ lagged_fibonacci44497 ][ uniform_real ] = _random_.variate_generator_lagged_fibonacci44497__uniform_real +#__vg[ ][ uniform_int ] = _random_.does not exist +#__vg[ ][ uniform_smallint ] = _random_.does not exist + +__vg[ lagged_fibonacci607 ][ bernoulli_distribution ] = _random_.variate_generator_lagged_fibonacci607__bernoulli_distribution +__vg[ lagged_fibonacci607 ][ binomial_distribution ] = _random_.variate_generator_lagged_fibonacci607__binomial_distribution +__vg[ lagged_fibonacci607 ][ cauchy_distribution ] = _random_.variate_generator_lagged_fibonacci607__cauchy_distribution +__vg[ lagged_fibonacci607 ][ exponential_distribution ] = _random_.variate_generator_lagged_fibonacci607__exponential_distribution +__vg[ lagged_fibonacci607 ][ gamma_distribution ] = _random_.variate_generator_lagged_fibonacci607__gamma_distribution +__vg[ lagged_fibonacci607 ][ geometric_distribution ] = _random_.variate_generator_lagged_fibonacci607__geometric_distribution +__vg[ lagged_fibonacci607 ][ lognormal_distribution ] = _random_.variate_generator_lagged_fibonacci607__lognormal_distribution +__vg[ lagged_fibonacci607 ][ normal_distribution ] = _random_.variate_generator_lagged_fibonacci607__normal_distribution +__vg[ lagged_fibonacci607 ][ poisson_distribution ] = _random_.variate_generator_lagged_fibonacci607__poisson_distribution +__vg[ lagged_fibonacci607 ][ triangle_distribution ] = _random_.variate_generator_lagged_fibonacci607__triangle_distribution +__vg[ lagged_fibonacci607 ][ uniform_on_sphere ] = _random_.variate_generator_lagged_fibonacci607__uniform_on_sphere +__vg[ lagged_fibonacci607 ][ uniform_real ] = _random_.variate_generator_lagged_fibonacci607__uniform_real +#__vg[ ][ uniform_int ] = _random_.does not exist +#__vg[ ][ uniform_smallint ] = _random_.does not exist + + +__vg[ lagged_fibonacci9689 ][ bernoulli_distribution ] = _random_.variate_generator_lagged_fibonacci9689__bernoulli_distribution +__vg[ lagged_fibonacci9689 ][ binomial_distribution ] = _random_.variate_generator_lagged_fibonacci9689__binomial_distribution +__vg[ lagged_fibonacci9689 ][ cauchy_distribution ] = _random_.variate_generator_lagged_fibonacci9689__cauchy_distribution +__vg[ lagged_fibonacci9689 ][ exponential_distribution ] = _random_.variate_generator_lagged_fibonacci9689__exponential_distribution +__vg[ lagged_fibonacci9689 ][ gamma_distribution ] = _random_.variate_generator_lagged_fibonacci9689__gamma_distribution +__vg[ lagged_fibonacci9689 ][ geometric_distribution ] = _random_.variate_generator_lagged_fibonacci9689__geometric_distribution +__vg[ lagged_fibonacci9689 ][ lognormal_distribution ] = _random_.variate_generator_lagged_fibonacci9689__lognormal_distribution +__vg[ lagged_fibonacci9689 ][ normal_distribution ] = _random_.variate_generator_lagged_fibonacci9689__normal_distribution +__vg[ lagged_fibonacci9689 ][ poisson_distribution ] = _random_.variate_generator_lagged_fibonacci9689__poisson_distribution +__vg[ lagged_fibonacci9689 ][ triangle_distribution ] = _random_.variate_generator_lagged_fibonacci9689__triangle_distribution +__vg[ lagged_fibonacci9689 ][ uniform_on_sphere ] = _random_.variate_generator_lagged_fibonacci9689__uniform_on_sphere +__vg[ lagged_fibonacci9689 ][ uniform_real ] = _random_.variate_generator_lagged_fibonacci9689__uniform_real +#__vg[ ][ uniform_int ] = _random_.does not exist +#__vg[ ][ uniform_smallint ] = _random_.does not exist + +__vg[ minstd_rand0 ][ bernoulli_distribution ] = _random_.variate_generator_minstd_rand0__bernoulli_distribution +__vg[ minstd_rand0 ][ binomial_distribution ] = _random_.variate_generator_minstd_rand0__binomial_distribution +__vg[ minstd_rand0 ][ cauchy_distribution ] = _random_.variate_generator_minstd_rand0__cauchy_distribution +__vg[ minstd_rand0 ][ exponential_distribution ] = _random_.variate_generator_minstd_rand0__exponential_distribution +__vg[ minstd_rand0 ][ gamma_distribution ] = _random_.variate_generator_minstd_rand0__gamma_distribution +__vg[ minstd_rand0 ][ geometric_distribution ] = _random_.variate_generator_minstd_rand0__geometric_distribution +__vg[ minstd_rand0 ][ lognormal_distribution ] = _random_.variate_generator_minstd_rand0__lognormal_distribution +__vg[ minstd_rand0 ][ normal_distribution ] = _random_.variate_generator_minstd_rand0__normal_distribution +__vg[ minstd_rand0 ][ poisson_distribution ] = _random_.variate_generator_minstd_rand0__poisson_distribution +__vg[ minstd_rand0 ][ triangle_distribution ] = _random_.variate_generator_minstd_rand0__triangle_distribution +__vg[ minstd_rand0 ][ uniform_int ] = _random_.variate_generator_minstd_rand0__uniform_int +__vg[ minstd_rand0 ][ uniform_on_sphere ] = _random_.variate_generator_minstd_rand0__uniform_on_sphere +__vg[ minstd_rand0 ][ uniform_real ] = _random_.variate_generator_minstd_rand0__uniform_real +__vg[ minstd_rand0 ][ uniform_smallint ] = _random_.variate_generator_minstd_rand0__uniform_smallint + +__vg[ minstd_rand ][ bernoulli_distribution ] = _random_.variate_generator_minstd_rand__bernoulli_distribution +__vg[ minstd_rand ][ binomial_distribution ] = _random_.variate_generator_minstd_rand__binomial_distribution +__vg[ minstd_rand ][ cauchy_distribution ] = _random_.variate_generator_minstd_rand__cauchy_distribution +__vg[ minstd_rand ][ exponential_distribution ] = _random_.variate_generator_minstd_rand__exponential_distribution +__vg[ minstd_rand ][ gamma_distribution ] = _random_.variate_generator_minstd_rand__gamma_distribution +__vg[ minstd_rand ][ geometric_distribution ] = _random_.variate_generator_minstd_rand__geometric_distribution +__vg[ minstd_rand ][ lognormal_distribution ] = _random_.variate_generator_minstd_rand__lognormal_distribution +__vg[ minstd_rand ][ normal_distribution ] = _random_.variate_generator_minstd_rand__normal_distribution +__vg[ minstd_rand ][ poisson_distribution ] = _random_.variate_generator_minstd_rand__poisson_distribution +__vg[ minstd_rand ][ triangle_distribution ] = _random_.variate_generator_minstd_rand__triangle_distribution +__vg[ minstd_rand ][ uniform_int ] = _random_.variate_generator_minstd_rand__uniform_int +__vg[ minstd_rand ][ uniform_on_sphere ] = _random_.variate_generator_minstd_rand__uniform_on_sphere +__vg[ minstd_rand ][ uniform_real ] = _random_.variate_generator_minstd_rand__uniform_real +__vg[ minstd_rand ][ uniform_smallint ] = _random_.variate_generator_minstd_rand__uniform_smallint + +__vg[ mt11213b ][ bernoulli_distribution ] = _random_.variate_generator_mt11213b__bernoulli_distribution +__vg[ mt11213b ][ binomial_distribution ] = _random_.variate_generator_mt11213b__binomial_distribution +__vg[ mt11213b ][ cauchy_distribution ] = _random_.variate_generator_mt11213b__cauchy_distribution +__vg[ mt11213b ][ exponential_distribution ] = _random_.variate_generator_mt11213b__exponential_distribution +__vg[ mt11213b ][ gamma_distribution ] = _random_.variate_generator_mt11213b__gamma_distribution +__vg[ mt11213b ][ geometric_distribution ] = _random_.variate_generator_mt11213b__geometric_distribution +__vg[ mt11213b ][ lognormal_distribution ] = _random_.variate_generator_mt11213b__lognormal_distribution +__vg[ mt11213b ][ normal_distribution ] = _random_.variate_generator_mt11213b__normal_distribution +__vg[ mt11213b ][ poisson_distribution ] = _random_.variate_generator_mt11213b__poisson_distribution +__vg[ mt11213b ][ triangle_distribution ] = _random_.variate_generator_mt11213b__triangle_distribution +__vg[ mt11213b ][ uniform_int ] = _random_.variate_generator_mt11213b__uniform_int +__vg[ mt11213b ][ uniform_on_sphere ] = _random_.variate_generator_mt11213b__uniform_on_sphere +__vg[ mt11213b ][ uniform_real ] = _random_.variate_generator_mt11213b__uniform_real +__vg[ mt11213b ][ uniform_smallint ] = _random_.variate_generator_mt11213b__uniform_smallint + +__vg[ mt19937 ][ bernoulli_distribution ] = _random_.variate_generator_mt19937__bernoulli_distribution +__vg[ mt19937 ][ binomial_distribution ] = _random_.variate_generator_mt19937__binomial_distribution +__vg[ mt19937 ][ cauchy_distribution ] = _random_.variate_generator_mt19937__cauchy_distribution +__vg[ mt19937 ][ exponential_distribution ] = _random_.variate_generator_mt19937__exponential_distribution +__vg[ mt19937 ][ gamma_distribution ] = _random_.variate_generator_mt19937__gamma_distribution +__vg[ mt19937 ][ geometric_distribution ] = _random_.variate_generator_mt19937__geometric_distribution +__vg[ mt19937 ][ lognormal_distribution ] = _random_.variate_generator_mt19937__lognormal_distribution +__vg[ mt19937 ][ normal_distribution ] = _random_.variate_generator_mt19937__normal_distribution +__vg[ mt19937 ][ poisson_distribution ] = _random_.variate_generator_mt19937__poisson_distribution +__vg[ mt19937 ][ triangle_distribution ] = _random_.variate_generator_mt19937__triangle_distribution +__vg[ mt19937 ][ uniform_int ] = _random_.variate_generator_mt19937__uniform_int +__vg[ mt19937 ][ uniform_on_sphere ] = _random_.variate_generator_mt19937__uniform_on_sphere +__vg[ mt19937 ][ uniform_real ] = _random_.variate_generator_mt19937__uniform_real +__vg[ mt19937 ][ uniform_smallint ] = _random_.variate_generator_mt19937__uniform_smallint + +__vg[ ranlux3_01 ][ bernoulli_distribution ] = _random_.variate_generator_ranlux3_01__bernoulli_distribution +__vg[ ranlux3_01 ][ binomial_distribution ] = _random_.variate_generator_ranlux3_01__binomial_distribution +__vg[ ranlux3_01 ][ cauchy_distribution ] = _random_.variate_generator_ranlux3_01__cauchy_distribution +__vg[ ranlux3_01 ][ exponential_distribution ] = _random_.variate_generator_ranlux3_01__exponential_distribution +__vg[ ranlux3_01 ][ gamma_distribution ] = _random_.variate_generator_ranlux3_01__gamma_distribution +__vg[ ranlux3_01 ][ geometric_distribution ] = _random_.variate_generator_ranlux3_01__geometric_distribution +__vg[ ranlux3_01 ][ lognormal_distribution ] = _random_.variate_generator_ranlux3_01__lognormal_distribution +__vg[ ranlux3_01 ][ normal_distribution ] = _random_.variate_generator_ranlux3_01__normal_distribution +__vg[ ranlux3_01 ][ poisson_distribution ] = _random_.variate_generator_ranlux3_01__poisson_distribution +__vg[ ranlux3_01 ][ triangle_distribution ] = _random_.variate_generator_ranlux3_01__triangle_distribution +__vg[ ranlux3_01 ][ uniform_on_sphere ] = _random_.variate_generator_ranlux3_01__uniform_on_sphere +__vg[ ranlux3_01 ][ uniform_real ] = _random_.variate_generator_ranlux3_01__uniform_real +#__vg[ ][ uniform_int ] = _random_.does not exist +#__vg[ ][ uniform_smallint ] = _random_.does not exist + +__vg[ ranlux3 ][ bernoulli_distribution ] = _random_.variate_generator_ranlux3__bernoulli_distribution +__vg[ ranlux3 ][ binomial_distribution ] = _random_.variate_generator_ranlux3__binomial_distribution +__vg[ ranlux3 ][ cauchy_distribution ] = _random_.variate_generator_ranlux3__cauchy_distribution +__vg[ ranlux3 ][ exponential_distribution ] = _random_.variate_generator_ranlux3__exponential_distribution +__vg[ ranlux3 ][ gamma_distribution ] = _random_.variate_generator_ranlux3__gamma_distribution +__vg[ ranlux3 ][ geometric_distribution ] = _random_.variate_generator_ranlux3__geometric_distribution +__vg[ ranlux3 ][ lognormal_distribution ] = _random_.variate_generator_ranlux3__lognormal_distribution +__vg[ ranlux3 ][ normal_distribution ] = _random_.variate_generator_ranlux3__normal_distribution +__vg[ ranlux3 ][ poisson_distribution ] = _random_.variate_generator_ranlux3__poisson_distribution +__vg[ ranlux3 ][ triangle_distribution ] = _random_.variate_generator_ranlux3__triangle_distribution +__vg[ ranlux3 ][ uniform_int ] = _random_.variate_generator_ranlux3__uniform_int +__vg[ ranlux3 ][ uniform_on_sphere ] = _random_.variate_generator_ranlux3__uniform_on_sphere +__vg[ ranlux3 ][ uniform_real ] = _random_.variate_generator_ranlux3__uniform_real +__vg[ ranlux3 ][ uniform_smallint ] = _random_.variate_generator_ranlux3__uniform_smallint + +__vg[ ranlux4_01 ][ bernoulli_distribution ] = _random_.variate_generator_ranlux4_01__bernoulli_distribution +__vg[ ranlux4_01 ][ binomial_distribution ] = _random_.variate_generator_ranlux4_01__binomial_distribution +__vg[ ranlux4_01 ][ cauchy_distribution ] = _random_.variate_generator_ranlux4_01__cauchy_distribution +__vg[ ranlux4_01 ][ exponential_distribution ] = _random_.variate_generator_ranlux4_01__exponential_distribution +__vg[ ranlux4_01 ][ gamma_distribution ] = _random_.variate_generator_ranlux4_01__gamma_distribution +__vg[ ranlux4_01 ][ geometric_distribution ] = _random_.variate_generator_ranlux4_01__geometric_distribution +__vg[ ranlux4_01 ][ lognormal_distribution ] = _random_.variate_generator_ranlux4_01__lognormal_distribution +__vg[ ranlux4_01 ][ normal_distribution ] = _random_.variate_generator_ranlux4_01__normal_distribution +__vg[ ranlux4_01 ][ poisson_distribution ] = _random_.variate_generator_ranlux4_01__poisson_distribution +__vg[ ranlux4_01 ][ triangle_distribution ] = _random_.variate_generator_ranlux4_01__triangle_distribution +__vg[ ranlux4_01 ][ uniform_on_sphere ] = _random_.variate_generator_ranlux4_01__uniform_on_sphere +__vg[ ranlux4_01 ][ uniform_real ] = _random_.variate_generator_ranlux4_01__uniform_real +#__vg[ ][ uniform_int ] = _random_.does not exist +#__vg[ ][ uniform_smallint ] = _random_.does not exist + +__vg[ ranlux4 ][ bernoulli_distribution ] = _random_.variate_generator_ranlux4__bernoulli_distribution +__vg[ ranlux4 ][ binomial_distribution ] = _random_.variate_generator_ranlux4__binomial_distribution +__vg[ ranlux4 ][ cauchy_distribution ] = _random_.variate_generator_ranlux4__cauchy_distribution +__vg[ ranlux4 ][ exponential_distribution ] = _random_.variate_generator_ranlux4__exponential_distribution +__vg[ ranlux4 ][ gamma_distribution ] = _random_.variate_generator_ranlux4__gamma_distribution +__vg[ ranlux4 ][ geometric_distribution ] = _random_.variate_generator_ranlux4__geometric_distribution +__vg[ ranlux4 ][ lognormal_distribution ] = _random_.variate_generator_ranlux4__lognormal_distribution +__vg[ ranlux4 ][ normal_distribution ] = _random_.variate_generator_ranlux4__normal_distribution +__vg[ ranlux4 ][ poisson_distribution ] = _random_.variate_generator_ranlux4__poisson_distribution +__vg[ ranlux4 ][ triangle_distribution ] = _random_.variate_generator_ranlux4__triangle_distribution +__vg[ ranlux4 ][ uniform_int ] = _random_.variate_generator_ranlux4__uniform_int +__vg[ ranlux4 ][ uniform_on_sphere ] = _random_.variate_generator_ranlux4__uniform_on_sphere +__vg[ ranlux4 ][ uniform_real ] = _random_.variate_generator_ranlux4__uniform_real +__vg[ ranlux4 ][ uniform_smallint ] = _random_.variate_generator_ranlux4__uniform_smallint + +__vg[ ranlux64_3_01 ][ bernoulli_distribution ] = _random_.variate_generator_ranlux64_3_01__bernoulli_distribution +__vg[ ranlux64_3_01 ][ binomial_distribution ] = _random_.variate_generator_ranlux64_3_01__binomial_distribution +__vg[ ranlux64_3_01 ][ cauchy_distribution ] = _random_.variate_generator_ranlux64_3_01__cauchy_distribution +__vg[ ranlux64_3_01 ][ exponential_distribution ] = _random_.variate_generator_ranlux64_3_01__exponential_distribution +__vg[ ranlux64_3_01 ][ gamma_distribution ] = _random_.variate_generator_ranlux64_3_01__gamma_distribution +__vg[ ranlux64_3_01 ][ geometric_distribution ] = _random_.variate_generator_ranlux64_3_01__geometric_distribution +__vg[ ranlux64_3_01 ][ lognormal_distribution ] = _random_.variate_generator_ranlux64_3_01__lognormal_distribution +__vg[ ranlux64_3_01 ][ normal_distribution ] = _random_.variate_generator_ranlux64_3_01__normal_distribution +__vg[ ranlux64_3_01 ][ poisson_distribution ] = _random_.variate_generator_ranlux64_3_01__poisson_distribution +__vg[ ranlux64_3_01 ][ triangle_distribution ] = _random_.variate_generator_ranlux64_3_01__triangle_distribution +__vg[ ranlux64_3_01 ][ uniform_on_sphere ] = _random_.variate_generator_ranlux64_3_01__uniform_on_sphere +__vg[ ranlux64_3_01 ][ uniform_real ] = _random_.variate_generator_ranlux64_3_01__uniform_real +#__vg[ ][ uniform_int ] = _random_.does not exist +#__vg[ ][ uniform_smallint ] = _random_.does not exist + +__vg[ ranlux64_4_01 ][ bernoulli_distribution ] = _random_.variate_generator_ranlux64_4_01__bernoulli_distribution +__vg[ ranlux64_4_01 ][ binomial_distribution ] = _random_.variate_generator_ranlux64_4_01__binomial_distribution +__vg[ ranlux64_4_01 ][ cauchy_distribution ] = _random_.variate_generator_ranlux64_4_01__cauchy_distribution +__vg[ ranlux64_4_01 ][ exponential_distribution ] = _random_.variate_generator_ranlux64_4_01__exponential_distribution +__vg[ ranlux64_4_01 ][ gamma_distribution ] = _random_.variate_generator_ranlux64_4_01__gamma_distribution +__vg[ ranlux64_4_01 ][ geometric_distribution ] = _random_.variate_generator_ranlux64_4_01__geometric_distribution +__vg[ ranlux64_4_01 ][ lognormal_distribution ] = _random_.variate_generator_ranlux64_4_01__lognormal_distribution +__vg[ ranlux64_4_01 ][ normal_distribution ] = _random_.variate_generator_ranlux64_4_01__normal_distribution +__vg[ ranlux64_4_01 ][ poisson_distribution ] = _random_.variate_generator_ranlux64_4_01__poisson_distribution +__vg[ ranlux64_4_01 ][ triangle_distribution ] = _random_.variate_generator_ranlux64_4_01__triangle_distribution +__vg[ ranlux64_4_01 ][ uniform_on_sphere ] = _random_.variate_generator_ranlux64_4_01__uniform_on_sphere +__vg[ ranlux64_4_01 ][ uniform_real ] = _random_.variate_generator_ranlux64_4_01__uniform_real +#__vg[ ][ uniform_int ] = _random_.does not exist +#__vg[ ][ uniform_smallint ] = _random_.does not exist + + +__vg[ taus88 ][ bernoulli_distribution ] = _random_.variate_generator_taus88__bernoulli_distribution +__vg[ taus88 ][ binomial_distribution ] = _random_.variate_generator_taus88__binomial_distribution +__vg[ taus88 ][ cauchy_distribution ] = _random_.variate_generator_taus88__cauchy_distribution +__vg[ taus88 ][ exponential_distribution ] = _random_.variate_generator_taus88__exponential_distribution +__vg[ taus88 ][ gamma_distribution ] = _random_.variate_generator_taus88__gamma_distribution +__vg[ taus88 ][ geometric_distribution ] = _random_.variate_generator_taus88__geometric_distribution +__vg[ taus88 ][ lognormal_distribution ] = _random_.variate_generator_taus88__lognormal_distribution +__vg[ taus88 ][ normal_distribution ] = _random_.variate_generator_taus88__normal_distribution +__vg[ taus88 ][ poisson_distribution ] = _random_.variate_generator_taus88__poisson_distribution +__vg[ taus88 ][ triangle_distribution ] = _random_.variate_generator_taus88__triangle_distribution +__vg[ taus88 ][ uniform_int ] = _random_.variate_generator_taus88__uniform_int +__vg[ taus88 ][ uniform_on_sphere ] = _random_.variate_generator_taus88__uniform_on_sphere +__vg[ taus88 ][ uniform_real ] = _random_.variate_generator_taus88__uniform_real +__vg[ taus88 ][ uniform_smallint ] = _random_.variate_generator_taus88__uniform_smallint + + +def variate_generator( generator, distribution ): + global __vg + global distributions + gcls = generator.__class__ + if not __vg.has_key( gcls ): + raise RuntimeError( 'Unable to create variate_generator - unknown generator type!' ) + dcls = distribution.__class__ + if dcls not in distributions: + raise RuntimeError( 'Unable to create variate_generator - unknown distribution type!' ) + + valid_distrs = __vg[ gcls ] + if not valid_distrs.has_key( dcls ): + raise RuntimeError( 'Unable to create variate_generator(%s, %s) - takoe sochetanie does not exist!' + % ( gcls.__name__, dcls.__name__ ) ) + return valid_distrs[dcls] + Copied: pyplusplus_dev/examples/pyboost_dev/unittests/brandom/unittests/test_all.py (from rev 112, pyplusplus_dev/examples/pyboost_dev/unittests/random/unittests/test_all.py) =================================================================== --- pyplusplus_dev/examples/pyboost_dev/unittests/brandom/unittests/test_all.py (rev 0) +++ pyplusplus_dev/examples/pyboost_dev/unittests/brandom/unittests/test_all.py 2006-05-17 06:19:51 UTC (rev 113) @@ -0,0 +1,28 @@ +#! /usr/bin/python +# Copyright 2004 Roman Yakovenko. +# Distributed under the Boost Software License, Version 1.0. (See +# accompanying file LICENSE_1_0.txt or copy at +# http://www.boost.org/LICENSE_1_0.txt) + +import sys +sys.path.append( '../..' ) + +import random +print random.__path__ +import unittest + +class tester_t( unittest.TestCase ): + def __init__( self, *args ): + unittest.TestCase.__init__( self, *args ) + + +def create_suite(): + suite = unittest.TestSuite() + suite.addTest( unittest.makeSuite(tester_t) ) + return suite + +def run_suite(): + unittest.TextTestRunner(verbosity=2).run( create_suite() ) + +if __name__ == "__main__": + run_suite() This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rom...@us...> - 2006-05-17 06:18:45
|
Revision: 112 Author: roman_yakovenko Date: 2006-05-16 23:18:34 -0700 (Tue, 16 May 2006) ViewCVS: http://svn.sourceforge.net/pygccxml/?rev=112&view=rev Log Message: ----------- rename random to brandom Added Paths: ----------- pyplusplus_dev/examples/pyboost_dev/unittests/random/__init__.py pyplusplus_dev/examples/pyboost_dev/unittests/random/unittests/test_all.py Added: pyplusplus_dev/examples/pyboost_dev/unittests/random/__init__.py =================================================================== --- pyplusplus_dev/examples/pyboost_dev/unittests/random/__init__.py (rev 0) +++ pyplusplus_dev/examples/pyboost_dev/unittests/random/__init__.py 2006-05-17 06:18:34 UTC (rev 112) @@ -0,0 +1,492 @@ +#! /usr/bin/python +# Copyright 2004 Roman Yakovenko. +# Distributed under the Boost Software License, Version 1.0. (See +# accompanying file LICENSE_1_0.txt or copy at +# http://www.boost.org/LICENSE_1_0.txt) + +import _random_ + +#generators: +from _random_ import ecuyer1988 +from _random_ import hellekalek1995 +from _random_ import kreutzer1986 +from _random_ import lagged_fibonacci1279 +from _random_ import lagged_fibonacci19937 +from _random_ import lagged_fibonacci2281 +from _random_ import lagged_fibonacci23209 +from _random_ import lagged_fibonacci3217 +from _random_ import lagged_fibonacci4423 +from _random_ import lagged_fibonacci44497 +from _random_ import lagged_fibonacci607 +from _random_ import lagged_fibonacci9689 +from _random_ import minstd_rand +from _random_ import minstd_rand0 +from _random_ import mt11213b +from _random_ import mt19937 +from _random_ import ranlux3 +from _random_ import ranlux3_01 +from _random_ import ranlux4 +from _random_ import ranlux4_01 +from _random_ import ranlux64_3_01 +from _random_ import ranlux64_4_01 +from _random_ import taus88 + +generators = [ + ecuyer1988 + , hellekalek1995 + , kreutzer1986 + , lagged_fibonacci1279 + , lagged_fibonacci19937 + , lagged_fibonacci2281 + , lagged_fibonacci23209 + , lagged_fibonacci3217 + , lagged_fibonacci4423 + , lagged_fibonacci44497 + , lagged_fibonacci607 + , lagged_fibonacci9689 + , minstd_rand + , minstd_rand0 + , mt11213b + , mt19937 + , ranlux3 + , ranlux3_01 + , ranlux4 + , ranlux4_01 + , ranlux64_3_01 + , ranlux64_4_01 + , taus88 +] + +#distribution +from _random_ import bernoulli_distribution +bernoulli_distribution.__call__ = _random_.py_bernoulli_distribution.call + +from _random_ import binomial_distribution +binomial_distribution.__call__ = _random_.py_binomial_distribution.call + +from _random_ import cauchy_distribution +cauchy_distribution.__call__ = _random_.py_cauchy_distribution.call + +from _random_ import exponential_distribution +exponential_distribution.__call__ = _random_.py_exponential_distribution.call + +from _random_ import gamma_distribution +gamma_distribution.__call__ = _random_.py_gamma_distribution.call + +from _random_ import geometric_distribution +geometric_distribution.__call__ = _random_.py_geometric_distribution.call + +from _random_ import lognormal_distribution +lognormal_distribution.__call__ = _random_.py_lognormal_distribution.call + +from _random_ import normal_distribution +normal_distribution.__call__ = _random_.py_normal_distribution.call + +from _random_ import poisson_distribution +poisson_distribution.__call__ = _random_.py_poisson_distribution.call + +from _random_ import triangle_distribution +triangle_distribution.__call__ = _random_.py_triangle_distribution.call + +from _random_ import uniform_int +uniform_int.__call__ = _random_.py_uniform_int.call + +from _random_ import uniform_on_sphere +uniform_on_sphere.__call__ = _random_.py_uniform_on_sphere.call + +from _random_ import uniform_real +uniform_real.__call__ = _random_.py_uniform_real.call + +from _random_ import uniform_smallint +uniform_smallint.__call__ = _random_.py_uniform_smallint.call + +distributions = [ + bernoulli_distribution + , binomial_distribution + , cauchy_distribution + , exponential_distribution + , gamma_distribution + , geometric_distribution + , lognormal_distribution + , normal_distribution + , poisson_distribution + , triangle_distribution + , uniform_int + , uniform_on_sphere + , uniform_real + , uniform_smallint +] + + + +__vg = {} +for g in generators: + __vg[g] = {} + +__vg[ ecuyer1988 ][ bernoulli_distribution ] = _random_.variate_generator_ecuyer1988__bernoulli_distribution +__vg[ ecuyer1988 ][ binomial_distribution ] = _random_.variate_generator_ecuyer1988__binomial_distribution +__vg[ ecuyer1988 ][ cauchy_distribution ] = _random_.variate_generator_ecuyer1988__cauchy_distribution +__vg[ ecuyer1988 ][ exponential_distribution ] = _random_.variate_generator_ecuyer1988__exponential_distribution +__vg[ ecuyer1988 ][ gamma_distribution ] = _random_.variate_generator_ecuyer1988__gamma_distribution +__vg[ ecuyer1988 ][ geometric_distribution ] = _random_.variate_generator_ecuyer1988__geometric_distribution +__vg[ ecuyer1988 ][ lognormal_distribution ] = _random_.variate_generator_ecuyer1988__lognormal_distribution +__vg[ ecuyer1988 ][ normal_distribution ] = _random_.variate_generator_ecuyer1988__normal_distribution +__vg[ ecuyer1988 ][ poisson_distribution ] = _random_.variate_generator_ecuyer1988__poisson_distribution +__vg[ ecuyer1988 ][ triangle_distribution ] = _random_.variate_generator_ecuyer1988__triangle_distribution +__vg[ ecuyer1988 ][ uniform_int ] = _random_.variate_generator_ecuyer1988__uniform_int +__vg[ ecuyer1988 ][ uniform_on_sphere ] = _random_.variate_generator_ecuyer1988__uniform_on_sphere +__vg[ ecuyer1988 ][ uniform_real ] = _random_.variate_generator_ecuyer1988__uniform_real +__vg[ ecuyer1988 ][ uniform_smallint ] = _random_.variate_generator_ecuyer1988__uniform_smallint + +__vg[ hellekalek1995 ][ bernoulli_distribution ] = _random_.variate_generator_hellekalek1995__bernoulli_distribution +__vg[ hellekalek1995 ][ binomial_distribution ] = _random_.variate_generator_hellekalek1995__binomial_distribution +__vg[ hellekalek1995 ][ cauchy_distribution ] = _random_.variate_generator_hellekalek1995__cauchy_distribution +__vg[ hellekalek1995 ][ exponential_distribution ] = _random_.variate_generator_hellekalek1995__exponential_distribution +__vg[ hellekalek1995 ][ gamma_distribution ] = _random_.variate_generator_hellekalek1995__gamma_distribution +__vg[ hellekalek1995 ][ geometric_distribution ] = _random_.variate_generator_hellekalek1995__geometric_distribution +__vg[ hellekalek1995 ][ lognormal_distribution ] = _random_.variate_generator_hellekalek1995__lognormal_distribution +__vg[ hellekalek1995 ][ normal_distribution ] = _random_.variate_generator_hellekalek1995__normal_distribution +__vg[ hellekalek1995 ][ poisson_distribution ] = _random_.variate_generator_hellekalek1995__poisson_distribution +__vg[ hellekalek1995 ][ triangle_distribution ] = _random_.variate_generator_hellekalek1995__triangle_distribution +__vg[ hellekalek1995 ][ uniform_int ] = _random_.variate_generator_hellekalek1995__uniform_int +__vg[ hellekalek1995 ][ uniform_on_sphere ] = _random_.variate_generator_hellekalek1995__uniform_on_sphere +__vg[ hellekalek1995 ][ uniform_real ] = _random_.variate_generator_hellekalek1995__uniform_real +__vg[ hellekalek1995 ][ uniform_smallint ] = _random_.variate_generator_hellekalek1995__uniform_smallint + +__vg[ kreutzer1986 ][ bernoulli_distribution ] = _random_.variate_generator_kreutzer1986__bernoulli_distribution +__vg[ kreutzer1986 ][ binomial_distribution ] = _random_.variate_generator_kreutzer1986__binomial_distribution +__vg[ kreutzer1986 ][ cauchy_distribution ] = _random_.variate_generator_kreutzer1986__cauchy_distribution +__vg[ kreutzer1986 ][ exponential_distribution ] = _random_.variate_generator_kreutzer1986__exponential_distribution +__vg[ kreutzer1986 ][ gamma_distribution ] = _random_.variate_generator_kreutzer1986__gamma_distribution +__vg[ kreutzer1986 ][ geometric_distribution ] = _random_.variate_generator_kreutzer1986__geometric_distribution +__vg[ kreutzer1986 ][ lognormal_distribution ] = _random_.variate_generator_kreutzer1986__lognormal_distribution +__vg[ kreutzer1986 ][ normal_distribution ] = _random_.variate_generator_kreutzer1986__normal_distribution +__vg[ kreutzer1986 ][ poisson_distribution ] = _random_.variate_generator_kreutzer1986__poisson_distribution +__vg[ kreutzer1986 ][ triangle_distribution ] = _random_.variate_generator_kreutzer1986__triangle_distribution +__vg[ kreutzer1986 ][ uniform_int ] = _random_.variate_generator_kreutzer1986__uniform_int +__vg[ kreutzer1986 ][ uniform_on_sphere ] = _random_.variate_generator_kreutzer1986__uniform_on_sphere +__vg[ kreutzer1986 ][ uniform_real ] = _random_.variate_generator_kreutzer1986__uniform_real +__vg[ kreutzer1986 ][ uniform_smallint ] = _random_.variate_generator_kreutzer1986__uniform_smallint + +__vg[ lagged_fibonacci1279 ][ bernoulli_distribution ] = _random_.variate_generator_lagged_fibonacci1279__bernoulli_distribution +__vg[ lagged_fibonacci1279 ][ binomial_distribution ] = _random_.variate_generator_lagged_fibonacci1279__binomial_distribution +__vg[ lagged_fibonacci1279 ][ cauchy_distribution ] = _random_.variate_generator_lagged_fibonacci1279__cauchy_distribution +__vg[ lagged_fibonacci1279 ][ exponential_distribution ] = _random_.variate_generator_lagged_fibonacci1279__exponential_distribution +__vg[ lagged_fibonacci1279 ][ gamma_distribution ] = _random_.variate_generator_lagged_fibonacci1279__gamma_distribution +__vg[ lagged_fibonacci1279 ][ geometric_distribution ] = _random_.variate_generator_lagged_fibonacci1279__geometric_distribution +__vg[ lagged_fibonacci1279 ][ lognormal_distribution ] = _random_.variate_generator_lagged_fibonacci1279__lognormal_distribution +__vg[ lagged_fibonacci1279 ][ normal_distribution ] = _random_.variate_generator_lagged_fibonacci1279__normal_distribution +__vg[ lagged_fibonacci1279 ][ poisson_distribution ] = _random_.variate_generator_lagged_fibonacci1279__poisson_distribution +__vg[ lagged_fibonacci1279 ][ triangle_distribution ] = _random_.variate_generator_lagged_fibonacci1279__triangle_distribution +__vg[ lagged_fibonacci1279 ][ uniform_on_sphere ] = _random_.variate_generator_lagged_fibonacci1279__uniform_on_sphere +__vg[ lagged_fibonacci1279 ][ uniform_real ] = _random_.variate_generator_lagged_fibonacci1279__uniform_real +#__vg[ ][ uniform_int ] = _random_.does not exist +#__vg[ ][ uniform_smallint ] = _random_.does not exist + +__vg[ lagged_fibonacci19937 ][ bernoulli_distribution ] = _random_.variate_generator_lagged_fibonacci19937__bernoulli_distribution +__vg[ lagged_fibonacci19937 ][ binomial_distribution ] = _random_.variate_generator_lagged_fibonacci19937__binomial_distribution +__vg[ lagged_fibonacci19937 ][ cauchy_distribution ] = _random_.variate_generator_lagged_fibonacci19937__cauchy_distribution +__vg[ lagged_fibonacci19937 ][ exponential_distribution ] = _random_.variate_generator_lagged_fibonacci19937__exponential_distribution +__vg[ lagged_fibonacci19937 ][ gamma_distribution ] = _random_.variate_generator_lagged_fibonacci19937__gamma_distribution +__vg[ lagged_fibonacci19937 ][ geometric_distribution ] = _random_.variate_generator_lagged_fibonacci19937__geometric_distribution +__vg[ lagged_fibonacci19937 ][ lognormal_distribution ] = _random_.variate_generator_lagged_fibonacci19937__lognormal_distribution +__vg[ lagged_fibonacci19937 ][ normal_distribution ] = _random_.variate_generator_lagged_fibonacci19937__normal_distribution +__vg[ lagged_fibonacci19937 ][ poisson_distribution ] = _random_.variate_generator_lagged_fibonacci19937__poisson_distribution +__vg[ lagged_fibonacci19937 ][ triangle_distribution ] = _random_.variate_generator_lagged_fibonacci19937__triangle_distribution +__vg[ lagged_fibonacci19937 ][ uniform_on_sphere ] = _random_.variate_generator_lagged_fibonacci19937__uniform_on_sphere +__vg[ lagged_fibonacci19937 ][ uniform_real ] = _random_.variate_generator_lagged_fibonacci19937__uniform_real +#__vg[ ][ uniform_int ] = _random_.does not exist +#__vg[ ][ uniform_smallint ] = _random_.does not exist + +__vg[ lagged_fibonacci2281 ][ bernoulli_distribution ] = _random_.variate_generator_lagged_fibonacci2281__bernoulli_distribution +__vg[ lagged_fibonacci2281 ][ binomial_distribution ] = _random_.variate_generator_lagged_fibonacci2281__binomial_distribution +__vg[ lagged_fibonacci2281 ][ cauchy_distribution ] = _random_.variate_generator_lagged_fibonacci2281__cauchy_distribution +__vg[ lagged_fibonacci2281 ][ exponential_distribution ] = _random_.variate_generator_lagged_fibonacci2281__exponential_distribution +__vg[ lagged_fibonacci2281 ][ gamma_distribution ] = _random_.variate_generator_lagged_fibonacci2281__gamma_distribution +__vg[ lagged_fibonacci2281 ][ geometric_distribution ] = _random_.variate_generator_lagged_fibonacci2281__geometric_distribution +__vg[ lagged_fibonacci2281 ][ lognormal_distribution ] = _random_.variate_generator_lagged_fibonacci2281__lognormal_distribution +__vg[ lagged_fibonacci2281 ][ normal_distribution ] = _random_.variate_generator_lagged_fibonacci2281__normal_distribution +__vg[ lagged_fibonacci2281 ][ poisson_distribution ] = _random_.variate_generator_lagged_fibonacci2281__poisson_distribution +__vg[ lagged_fibonacci2281 ][ triangle_distribution ] = _random_.variate_generator_lagged_fibonacci2281__triangle_distribution +__vg[ lagged_fibonacci2281 ][ uniform_on_sphere ] = _random_.variate_generator_lagged_fibonacci2281__uniform_on_sphere +__vg[ lagged_fibonacci2281 ][ uniform_real ] = _random_.variate_generator_lagged_fibonacci2281__uniform_real +#__vg[ ][ uniform_int ] = _random_.does not exist +#__vg[ ][ uniform_smallint ] = _random_.does not exist + +__vg[ lagged_fibonacci23209 ][ bernoulli_distribution ] = _random_.variate_generator_lagged_fibonacci23209__bernoulli_distribution +__vg[ lagged_fibonacci23209 ][ binomial_distribution ] = _random_.variate_generator_lagged_fibonacci23209__binomial_distribution +__vg[ lagged_fibonacci23209 ][ cauchy_distribution ] = _random_.variate_generator_lagged_fibonacci23209__cauchy_distribution +__vg[ lagged_fibonacci23209 ][ exponential_distribution ] = _random_.variate_generator_lagged_fibonacci23209__exponential_distribution +__vg[ lagged_fibonacci23209 ][ gamma_distribution ] = _random_.variate_generator_lagged_fibonacci23209__gamma_distribution +__vg[ lagged_fibonacci23209 ][ geometric_distribution ] = _random_.variate_generator_lagged_fibonacci23209__geometric_distribution +__vg[ lagged_fibonacci23209 ][ lognormal_distribution ] = _random_.variate_generator_lagged_fibonacci23209__lognormal_distribution +__vg[ lagged_fibonacci23209 ][ normal_distribution ] = _random_.variate_generator_lagged_fibonacci23209__normal_distribution +__vg[ lagged_fibonacci23209 ][ poisson_distribution ] = _random_.variate_generator_lagged_fibonacci23209__poisson_distribution +__vg[ lagged_fibonacci23209 ][ triangle_distribution ] = _random_.variate_generator_lagged_fibonacci23209__triangle_distribution +__vg[ lagged_fibonacci23209 ][ uniform_on_sphere ] = _random_.variate_generator_lagged_fibonacci23209__uniform_on_sphere +__vg[ lagged_fibonacci23209 ][ uniform_real ] = _random_.variate_generator_lagged_fibonacci23209__uniform_real +#__vg[ ][ uniform_int ] = _random_.does not exist +#__vg[ ][ uniform_smallint ] = _random_.does not exist + + +__vg[ lagged_fibonacci3217 ][ bernoulli_distribution ] = _random_.variate_generator_lagged_fibonacci3217__bernoulli_distribution +__vg[ lagged_fibonacci3217 ][ binomial_distribution ] = _random_.variate_generator_lagged_fibonacci3217__binomial_distribution +__vg[ lagged_fibonacci3217 ][ cauchy_distribution ] = _random_.variate_generator_lagged_fibonacci3217__cauchy_distribution +__vg[ lagged_fibonacci3217 ][ exponential_distribution ] = _random_.variate_generator_lagged_fibonacci3217__exponential_distribution +__vg[ lagged_fibonacci3217 ][ gamma_distribution ] = _random_.variate_generator_lagged_fibonacci3217__gamma_distribution +__vg[ lagged_fibonacci3217 ][ geometric_distribution ] = _random_.variate_generator_lagged_fibonacci3217__geometric_distribution +__vg[ lagged_fibonacci3217 ][ lognormal_distribution ] = _random_.variate_generator_lagged_fibonacci3217__lognormal_distribution +__vg[ lagged_fibonacci3217 ][ normal_distribution ] = _random_.variate_generator_lagged_fibonacci3217__normal_distribution +__vg[ lagged_fibonacci3217 ][ poisson_distribution ] = _random_.variate_generator_lagged_fibonacci3217__poisson_distribution +__vg[ lagged_fibonacci3217 ][ triangle_distribution ] = _random_.variate_generator_lagged_fibonacci3217__triangle_distribution +__vg[ lagged_fibonacci3217 ][ uniform_int ] = _random_.variate_generator_lagged_fibonacci3217__uniform_on_sphere +__vg[ lagged_fibonacci3217 ][ uniform_on_sphere ] = _random_.variate_generator_lagged_fibonacci3217__uniform_real +#__vg[ ][ uniform_real ] = _random_.does not exist +#__vg[ ][ uniform_smallint ] = _random_.does not exist + + +__vg[ lagged_fibonacci4423 ][ bernoulli_distribution ] = _random_.variate_generator_lagged_fibonacci4423__bernoulli_distribution +__vg[ lagged_fibonacci4423 ][ binomial_distribution ] = _random_.variate_generator_lagged_fibonacci4423__binomial_distribution +__vg[ lagged_fibonacci4423 ][ cauchy_distribution ] = _random_.variate_generator_lagged_fibonacci4423__cauchy_distribution +__vg[ lagged_fibonacci4423 ][ exponential_distribution ] = _random_.variate_generator_lagged_fibonacci4423__exponential_distribution +__vg[ lagged_fibonacci4423 ][ gamma_distribution ] = _random_.variate_generator_lagged_fibonacci4423__gamma_distribution +__vg[ lagged_fibonacci4423 ][ geometric_distribution ] = _random_.variate_generator_lagged_fibonacci4423__geometric_distribution +__vg[ lagged_fibonacci4423 ][ lognormal_distribution ] = _random_.variate_generator_lagged_fibonacci4423__lognormal_distribution +__vg[ lagged_fibonacci4423 ][ normal_distribution ] = _random_.variate_generator_lagged_fibonacci4423__normal_distribution +__vg[ lagged_fibonacci4423 ][ poisson_distribution ] = _random_.variate_generator_lagged_fibonacci4423__poisson_distribution +__vg[ lagged_fibonacci4423 ][ triangle_distribution ] = _random_.variate_generator_lagged_fibonacci4423__triangle_distribution +__vg[ lagged_fibonacci4423 ][ uniform_on_sphere ] = _random_.variate_generator_lagged_fibonacci4423__uniform_on_sphere +__vg[ lagged_fibonacci4423 ][ uniform_real ] = _random_.variate_generator_lagged_fibonacci4423__uniform_real +#__vg[ ][ uniform_int ] = _random_.does not exist +#__vg[ ][ uniform_smallint ] = _random_.does not exist + + +__vg[ lagged_fibonacci44497 ][ bernoulli_distribution ] = _random_.variate_generator_lagged_fibonacci44497__bernoulli_distribution +__vg[ lagged_fibonacci44497 ][ binomial_distribution ] = _random_.variate_generator_lagged_fibonacci44497__binomial_distribution +__vg[ lagged_fibonacci44497 ][ cauchy_distribution ] = _random_.variate_generator_lagged_fibonacci44497__cauchy_distribution +__vg[ lagged_fibonacci44497 ][ exponential_distribution ] = _random_.variate_generator_lagged_fibonacci44497__exponential_distribution +__vg[ lagged_fibonacci44497 ][ gamma_distribution ] = _random_.variate_generator_lagged_fibonacci44497__gamma_distribution +__vg[ lagged_fibonacci44497 ][ geometric_distribution ] = _random_.variate_generator_lagged_fibonacci44497__geometric_distribution +__vg[ lagged_fibonacci44497 ][ lognormal_distribution ] = _random_.variate_generator_lagged_fibonacci44497__lognormal_distribution +__vg[ lagged_fibonacci44497 ][ normal_distribution ] = _random_.variate_generator_lagged_fibonacci44497__normal_distribution +__vg[ lagged_fibonacci44497 ][ poisson_distribution ] = _random_.variate_generator_lagged_fibonacci44497__poisson_distribution +__vg[ lagged_fibonacci44497 ][ triangle_distribution ] = _random_.variate_generator_lagged_fibonacci44497__triangle_distribution +__vg[ lagged_fibonacci44497 ][ uniform_on_sphere ] = _random_.variate_generator_lagged_fibonacci44497__uniform_on_sphere +__vg[ lagged_fibonacci44497 ][ uniform_real ] = _random_.variate_generator_lagged_fibonacci44497__uniform_real +#__vg[ ][ uniform_int ] = _random_.does not exist +#__vg[ ][ uniform_smallint ] = _random_.does not exist + +__vg[ lagged_fibonacci607 ][ bernoulli_distribution ] = _random_.variate_generator_lagged_fibonacci607__bernoulli_distribution +__vg[ lagged_fibonacci607 ][ binomial_distribution ] = _random_.variate_generator_lagged_fibonacci607__binomial_distribution +__vg[ lagged_fibonacci607 ][ cauchy_distribution ] = _random_.variate_generator_lagged_fibonacci607__cauchy_distribution +__vg[ lagged_fibonacci607 ][ exponential_distribution ] = _random_.variate_generator_lagged_fibonacci607__exponential_distribution +__vg[ lagged_fibonacci607 ][ gamma_distribution ] = _random_.variate_generator_lagged_fibonacci607__gamma_distribution +__vg[ lagged_fibonacci607 ][ geometric_distribution ] = _random_.variate_generator_lagged_fibonacci607__geometric_distribution +__vg[ lagged_fibonacci607 ][ lognormal_distribution ] = _random_.variate_generator_lagged_fibonacci607__lognormal_distribution +__vg[ lagged_fibonacci607 ][ normal_distribution ] = _random_.variate_generator_lagged_fibonacci607__normal_distribution +__vg[ lagged_fibonacci607 ][ poisson_distribution ] = _random_.variate_generator_lagged_fibonacci607__poisson_distribution +__vg[ lagged_fibonacci607 ][ triangle_distribution ] = _random_.variate_generator_lagged_fibonacci607__triangle_distribution +__vg[ lagged_fibonacci607 ][ uniform_on_sphere ] = _random_.variate_generator_lagged_fibonacci607__uniform_on_sphere +__vg[ lagged_fibonacci607 ][ uniform_real ] = _random_.variate_generator_lagged_fibonacci607__uniform_real +#__vg[ ][ uniform_int ] = _random_.does not exist +#__vg[ ][ uniform_smallint ] = _random_.does not exist + + +__vg[ lagged_fibonacci9689 ][ bernoulli_distribution ] = _random_.variate_generator_lagged_fibonacci9689__bernoulli_distribution +__vg[ lagged_fibonacci9689 ][ binomial_distribution ] = _random_.variate_generator_lagged_fibonacci9689__binomial_distribution +__vg[ lagged_fibonacci9689 ][ cauchy_distribution ] = _random_.variate_generator_lagged_fibonacci9689__cauchy_distribution +__vg[ lagged_fibonacci9689 ][ exponential_distribution ] = _random_.variate_generator_lagged_fibonacci9689__exponential_distribution +__vg[ lagged_fibonacci9689 ][ gamma_distribution ] = _random_.variate_generator_lagged_fibonacci9689__gamma_distribution +__vg[ lagged_fibonacci9689 ][ geometric_distribution ] = _random_.variate_generator_lagged_fibonacci9689__geometric_distribution +__vg[ lagged_fibonacci9689 ][ lognormal_distribution ] = _random_.variate_generator_lagged_fibonacci9689__lognormal_distribution +__vg[ lagged_fibonacci9689 ][ normal_distribution ] = _random_.variate_generator_lagged_fibonacci9689__normal_distribution +__vg[ lagged_fibonacci9689 ][ poisson_distribution ] = _random_.variate_generator_lagged_fibonacci9689__poisson_distribution +__vg[ lagged_fibonacci9689 ][ triangle_distribution ] = _random_.variate_generator_lagged_fibonacci9689__triangle_distribution +__vg[ lagged_fibonacci9689 ][ uniform_on_sphere ] = _random_.variate_generator_lagged_fibonacci9689__uniform_on_sphere +__vg[ lagged_fibonacci9689 ][ uniform_real ] = _random_.variate_generator_lagged_fibonacci9689__uniform_real +#__vg[ ][ uniform_int ] = _random_.does not exist +#__vg[ ][ uniform_smallint ] = _random_.does not exist + +__vg[ minstd_rand0 ][ bernoulli_distribution ] = _random_.variate_generator_minstd_rand0__bernoulli_distribution +__vg[ minstd_rand0 ][ binomial_distribution ] = _random_.variate_generator_minstd_rand0__binomial_distribution +__vg[ minstd_rand0 ][ cauchy_distribution ] = _random_.variate_generator_minstd_rand0__cauchy_distribution +__vg[ minstd_rand0 ][ exponential_distribution ] = _random_.variate_generator_minstd_rand0__exponential_distribution +__vg[ minstd_rand0 ][ gamma_distribution ] = _random_.variate_generator_minstd_rand0__gamma_distribution +__vg[ minstd_rand0 ][ geometric_distribution ] = _random_.variate_generator_minstd_rand0__geometric_distribution +__vg[ minstd_rand0 ][ lognormal_distribution ] = _random_.variate_generator_minstd_rand0__lognormal_distribution +__vg[ minstd_rand0 ][ normal_distribution ] = _random_.variate_generator_minstd_rand0__normal_distribution +__vg[ minstd_rand0 ][ poisson_distribution ] = _random_.variate_generator_minstd_rand0__poisson_distribution +__vg[ minstd_rand0 ][ triangle_distribution ] = _random_.variate_generator_minstd_rand0__triangle_distribution +__vg[ minstd_rand0 ][ uniform_int ] = _random_.variate_generator_minstd_rand0__uniform_int +__vg[ minstd_rand0 ][ uniform_on_sphere ] = _random_.variate_generator_minstd_rand0__uniform_on_sphere +__vg[ minstd_rand0 ][ uniform_real ] = _random_.variate_generator_minstd_rand0__uniform_real +__vg[ minstd_rand0 ][ uniform_smallint ] = _random_.variate_generator_minstd_rand0__uniform_smallint + +__vg[ minstd_rand ][ bernoulli_distribution ] = _random_.variate_generator_minstd_rand__bernoulli_distribution +__vg[ minstd_rand ][ binomial_distribution ] = _random_.variate_generator_minstd_rand__binomial_distribution +__vg[ minstd_rand ][ cauchy_distribution ] = _random_.variate_generator_minstd_rand__cauchy_distribution +__vg[ minstd_rand ][ exponential_distribution ] = _random_.variate_generator_minstd_rand__exponential_distribution +__vg[ minstd_rand ][ gamma_distribution ] = _random_.variate_generator_minstd_rand__gamma_distribution +__vg[ minstd_rand ][ geometric_distribution ] = _random_.variate_generator_minstd_rand__geometric_distribution +__vg[ minstd_rand ][ lognormal_distribution ] = _random_.variate_generator_minstd_rand__lognormal_distribution +__vg[ minstd_rand ][ normal_distribution ] = _random_.variate_generator_minstd_rand__normal_distribution +__vg[ minstd_rand ][ poisson_distribution ] = _random_.variate_generator_minstd_rand__poisson_distribution +__vg[ minstd_rand ][ triangle_distribution ] = _random_.variate_generator_minstd_rand__triangle_distribution +__vg[ minstd_rand ][ uniform_int ] = _random_.variate_generator_minstd_rand__uniform_int +__vg[ minstd_rand ][ uniform_on_sphere ] = _random_.variate_generator_minstd_rand__uniform_on_sphere +__vg[ minstd_rand ][ uniform_real ] = _random_.variate_generator_minstd_rand__uniform_real +__vg[ minstd_rand ][ uniform_smallint ] = _random_.variate_generator_minstd_rand__uniform_smallint + +__vg[ mt11213b ][ bernoulli_distribution ] = _random_.variate_generator_mt11213b__bernoulli_distribution +__vg[ mt11213b ][ binomial_distribution ] = _random_.variate_generator_mt11213b__binomial_distribution +__vg[ mt11213b ][ cauchy_distribution ] = _random_.variate_generator_mt11213b__cauchy_distribution +__vg[ mt11213b ][ exponential_distribution ] = _random_.variate_generator_mt11213b__exponential_distribution +__vg[ mt11213b ][ gamma_distribution ] = _random_.variate_generator_mt11213b__gamma_distribution +__vg[ mt11213b ][ geometric_distribution ] = _random_.variate_generator_mt11213b__geometric_distribution +__vg[ mt11213b ][ lognormal_distribution ] = _random_.variate_generator_mt11213b__lognormal_distribution +__vg[ mt11213b ][ normal_distribution ] = _random_.variate_generator_mt11213b__normal_distribution +__vg[ mt11213b ][ poisson_distribution ] = _random_.variate_generator_mt11213b__poisson_distribution +__vg[ mt11213b ][ triangle_distribution ] = _random_.variate_generator_mt11213b__triangle_distribution +__vg[ mt11213b ][ uniform_int ] = _random_.variate_generator_mt11213b__uniform_int +__vg[ mt11213b ][ uniform_on_sphere ] = _random_.variate_generator_mt11213b__uniform_on_sphere +__vg[ mt11213b ][ uniform_real ] = _random_.variate_generator_mt11213b__uniform_real +__vg[ mt11213b ][ uniform_smallint ] = _random_.variate_generator_mt11213b__uniform_smallint + +__vg[ mt19937 ][ bernoulli_distribution ] = _random_.variate_generator_mt19937__bernoulli_distribution +__vg[ mt19937 ][ binomial_distribution ] = _random_.variate_generator_mt19937__binomial_distribution +__vg[ mt19937 ][ cauchy_distribution ] = _random_.variate_generator_mt19937__cauchy_distribution +__vg[ mt19937 ][ exponential_distribution ] = _random_.variate_generator_mt19937__exponential_distribution +__vg[ mt19937 ][ gamma_distribution ] = _random_.variate_generator_mt19937__gamma_distribution +__vg[ mt19937 ][ geometric_distribution ] = _random_.variate_generator_mt19937__geometric_distribution +__vg[ mt19937 ][ lognormal_distribution ] = _random_.variate_generator_mt19937__lognormal_distribution +__vg[ mt19937 ][ normal_distribution ] = _random_.variate_generator_mt19937__normal_distribution +__vg[ mt19937 ][ poisson_distribution ] = _random_.variate_generator_mt19937__poisson_distribution +__vg[ mt19937 ][ triangle_distribution ] = _random_.variate_generator_mt19937__triangle_distribution +__vg[ mt19937 ][ uniform_int ] = _random_.variate_generator_mt19937__uniform_int +__vg[ mt19937 ][ uniform_on_sphere ] = _random_.variate_generator_mt19937__uniform_on_sphere +__vg[ mt19937 ][ uniform_real ] = _random_.variate_generator_mt19937__uniform_real +__vg[ mt19937 ][ uniform_smallint ] = _random_.variate_generator_mt19937__uniform_smallint + +__vg[ ranlux3_01 ][ bernoulli_distribution ] = _random_.variate_generator_ranlux3_01__bernoulli_distribution +__vg[ ranlux3_01 ][ binomial_distribution ] = _random_.variate_generator_ranlux3_01__binomial_distribution +__vg[ ranlux3_01 ][ cauchy_distribution ] = _random_.variate_generator_ranlux3_01__cauchy_distribution +__vg[ ranlux3_01 ][ exponential_distribution ] = _random_.variate_generator_ranlux3_01__exponential_distribution +__vg[ ranlux3_01 ][ gamma_distribution ] = _random_.variate_generator_ranlux3_01__gamma_distribution +__vg[ ranlux3_01 ][ geometric_distribution ] = _random_.variate_generator_ranlux3_01__geometric_distribution +__vg[ ranlux3_01 ][ lognormal_distribution ] = _random_.variate_generator_ranlux3_01__lognormal_distribution +__vg[ ranlux3_01 ][ normal_distribution ] = _random_.variate_generator_ranlux3_01__normal_distribution +__vg[ ranlux3_01 ][ poisson_distribution ] = _random_.variate_generator_ranlux3_01__poisson_distribution +__vg[ ranlux3_01 ][ triangle_distribution ] = _random_.variate_generator_ranlux3_01__triangle_distribution +__vg[ ranlux3_01 ][ uniform_on_sphere ] = _random_.variate_generator_ranlux3_01__uniform_on_sphere +__vg[ ranlux3_01 ][ uniform_real ] = _random_.variate_generator_ranlux3_01__uniform_real +#__vg[ ][ uniform_int ] = _random_.does not exist +#__vg[ ][ uniform_smallint ] = _random_.does not exist + +__vg[ ranlux3 ][ bernoulli_distribution ] = _random_.variate_generator_ranlux3__bernoulli_distribution +__vg[ ranlux3 ][ binomial_distribution ] = _random_.variate_generator_ranlux3__binomial_distribution +__vg[ ranlux3 ][ cauchy_distribution ] = _random_.variate_generator_ranlux3__cauchy_distribution +__vg[ ranlux3 ][ exponential_distribution ] = _random_.variate_generator_ranlux3__exponential_distribution +__vg[ ranlux3 ][ gamma_distribution ] = _random_.variate_generator_ranlux3__gamma_distribution +__vg[ ranlux3 ][ geometric_distribution ] = _random_.variate_generator_ranlux3__geometric_distribution +__vg[ ranlux3 ][ lognormal_distribution ] = _random_.variate_generator_ranlux3__lognormal_distribution +__vg[ ranlux3 ][ normal_distribution ] = _random_.variate_generator_ranlux3__normal_distribution +__vg[ ranlux3 ][ poisson_distribution ] = _random_.variate_generator_ranlux3__poisson_distribution +__vg[ ranlux3 ][ triangle_distribution ] = _random_.variate_generator_ranlux3__triangle_distribution +__vg[ ranlux3 ][ uniform_int ] = _random_.variate_generator_ranlux3__uniform_int +__vg[ ranlux3 ][ uniform_on_sphere ] = _random_.variate_generator_ranlux3__uniform_on_sphere +__vg[ ranlux3 ][ uniform_real ] = _random_.variate_generator_ranlux3__uniform_real +__vg[ ranlux3 ][ uniform_smallint ] = _random_.variate_generator_ranlux3__uniform_smallint + +__vg[ ranlux4_01 ][ bernoulli_distribution ] = _random_.variate_generator_ranlux4_01__bernoulli_distribution +__vg[ ranlux4_01 ][ binomial_distribution ] = _random_.variate_generator_ranlux4_01__binomial_distribution +__vg[ ranlux4_01 ][ cauchy_distribution ] = _random_.variate_generator_ranlux4_01__cauchy_distribution +__vg[ ranlux4_01 ][ exponential_distribution ] = _random_.variate_generator_ranlux4_01__exponential_distribution +__vg[ ranlux4_01 ][ gamma_distribution ] = _random_.variate_generator_ranlux4_01__gamma_distribution +__vg[ ranlux4_01 ][ geometric_distribution ] = _random_.variate_generator_ranlux4_01__geometric_distribution +__vg[ ranlux4_01 ][ lognormal_distribution ] = _random_.variate_generator_ranlux4_01__lognormal_distribution +__vg[ ranlux4_01 ][ normal_distribution ] = _random_.variate_generator_ranlux4_01__normal_distribution +__vg[ ranlux4_01 ][ poisson_distribution ] = _random_.variate_generator_ranlux4_01__poisson_distribution +__vg[ ranlux4_01 ][ triangle_distribution ] = _random_.variate_generator_ranlux4_01__triangle_distribution +__vg[ ranlux4_01 ][ uniform_on_sphere ] = _random_.variate_generator_ranlux4_01__uniform_on_sphere +__vg[ ranlux4_01 ][ uniform_real ] = _random_.variate_generator_ranlux4_01__uniform_real +#__vg[ ][ uniform_int ] = _random_.does not exist +#__vg[ ][ uniform_smallint ] = _random_.does not exist + +__vg[ ranlux4 ][ bernoulli_distribution ] = _random_.variate_generator_ranlux4__bernoulli_distribution +__vg[ ranlux4 ][ binomial_distribution ] = _random_.variate_generator_ranlux4__binomial_distribution +__vg[ ranlux4 ][ cauchy_distribution ] = _random_.variate_generator_ranlux4__cauchy_distribution +__vg[ ranlux4 ][ exponential_distribution ] = _random_.variate_generator_ranlux4__exponential_distribution +__vg[ ranlux4 ][ gamma_distribution ] = _random_.variate_generator_ranlux4__gamma_distribution +__vg[ ranlux4 ][ geometric_distribution ] = _random_.variate_generator_ranlux4__geometric_distribution +__vg[ ranlux4 ][ lognormal_distribution ] = _random_.variate_generator_ranlux4__lognormal_distribution +__vg[ ranlux4 ][ normal_distribution ] = _random_.variate_generator_ranlux4__normal_distribution +__vg[ ranlux4 ][ poisson_distribution ] = _random_.variate_generator_ranlux4__poisson_distribution +__vg[ ranlux4 ][ triangle_distribution ] = _random_.variate_generator_ranlux4__triangle_distribution +__vg[ ranlux4 ][ uniform_int ] = _random_.variate_generator_ranlux4__uniform_int +__vg[ ranlux4 ][ uniform_on_sphere ] = _random_.variate_generator_ranlux4__uniform_on_sphere +__vg[ ranlux4 ][ uniform_real ] = _random_.variate_generator_ranlux4__uniform_real +__vg[ ranlux4 ][ uniform_smallint ] = _random_.variate_generator_ranlux4__uniform_smallint + +__vg[ ranlux64_3_01 ][ bernoulli_distribution ] = _random_.variate_generator_ranlux64_3_01__bernoulli_distribution +__vg[ ranlux64_3_01 ][ binomial_distribution ] = _random_.variate_generator_ranlux64_3_01__binomial_distribution +__vg[ ranlux64_3_01 ][ cauchy_distribution ] = _random_.variate_generator_ranlux64_3_01__cauchy_distribution +__vg[ ranlux64_3_01 ][ exponential_distribution ] = _random_.variate_generator_ranlux64_3_01__exponential_distribution +__vg[ ranlux64_3_01 ][ gamma_distribution ] = _random_.variate_generator_ranlux64_3_01__gamma_distribution +__vg[ ranlux64_3_01 ][ geometric_distribution ] = _random_.variate_generator_ranlux64_3_01__geometric_distribution +__vg[ ranlux64_3_01 ][ lognormal_distribution ] = _random_.variate_generator_ranlux64_3_01__lognormal_distribution +__vg[ ranlux64_3_01 ][ normal_distribution ] = _random_.variate_generator_ranlux64_3_01__normal_distribution +__vg[ ranlux64_3_01 ][ poisson_distribution ] = _random_.variate_generator_ranlux64_3_01__poisson_distribution +__vg[ ranlux64_3_01 ][ triangle_distribution ] = _random_.variate_generator_ranlux64_3_01__triangle_distribution +__vg[ ranlux64_3_01 ][ uniform_on_sphere ] = _random_.variate_generator_ranlux64_3_01__uniform_on_sphere +__vg[ ranlux64_3_01 ][ uniform_real ] = _random_.variate_generator_ranlux64_3_01__uniform_real +#__vg[ ][ uniform_int ] = _random_.does not exist +#__vg[ ][ uniform_smallint ] = _random_.does not exist + +__vg[ ranlux64_4_01 ][ bernoulli_distribution ] = _random_.variate_generator_ranlux64_4_01__bernoulli_distribution +__vg[ ranlux64_4_01 ][ binomial_distribution ] = _random_.variate_generator_ranlux64_4_01__binomial_distribution +__vg[ ranlux64_4_01 ][ cauchy_distribution ] = _random_.variate_generator_ranlux64_4_01__cauchy_distribution +__vg[ ranlux64_4_01 ][ exponential_distribution ] = _random_.variate_generator_ranlux64_4_01__exponential_distribution +__vg[ ranlux64_4_01 ][ gamma_distribution ] = _random_.variate_generator_ranlux64_4_01__gamma_distribution +__vg[ ranlux64_4_01 ][ geometric_distribution ] = _random_.variate_generator_ranlux64_4_01__geometric_distribution +__vg[ ranlux64_4_01 ][ lognormal_distribution ] = _random_.variate_generator_ranlux64_4_01__lognormal_distribution +__vg[ ranlux64_4_01 ][ normal_distribution ] = _random_.variate_generator_ranlux64_4_01__normal_distribution +__vg[ ranlux64_4_01 ][ poisson_distribution ] = _random_.variate_generator_ranlux64_4_01__poisson_distribution +__vg[ ranlux64_4_01 ][ triangle_distribution ] = _random_.variate_generator_ranlux64_4_01__triangle_distribution +__vg[ ranlux64_4_01 ][ uniform_on_sphere ] = _random_.variate_generator_ranlux64_4_01__uniform_on_sphere +__vg[ ranlux64_4_01 ][ uniform_real ] = _random_.variate_generator_ranlux64_4_01__uniform_real +#__vg[ ][ uniform_int ] = _random_.does not exist +#__vg[ ][ uniform_smallint ] = _random_.does not exist + + +__vg[ taus88 ][ bernoulli_distribution ] = _random_.variate_generator_taus88__bernoulli_distribution +__vg[ taus88 ][ binomial_distribution ] = _random_.variate_generator_taus88__binomial_distribution +__vg[ taus88 ][ cauchy_distribution ] = _random_.variate_generator_taus88__cauchy_distribution +__vg[ taus88 ][ exponential_distribution ] = _random_.variate_generator_taus88__exponential_distribution +__vg[ taus88 ][ gamma_distribution ] = _random_.variate_generator_taus88__gamma_distribution +__vg[ taus88 ][ geometric_distribution ] = _random_.variate_generator_taus88__geometric_distribution +__vg[ taus88 ][ lognormal_distribution ] = _random_.variate_generator_taus88__lognormal_distribution +__vg[ taus88 ][ normal_distribution ] = _random_.variate_generator_taus88__normal_distribution +__vg[ taus88 ][ poisson_distribution ] = _random_.variate_generator_taus88__poisson_distribution +__vg[ taus88 ][ triangle_distribution ] = _random_.variate_generator_taus88__triangle_distribution +__vg[ taus88 ][ uniform_int ] = _random_.variate_generator_taus88__uniform_int +__vg[ taus88 ][ uniform_on_sphere ] = _random_.variate_generator_taus88__uniform_on_sphere +__vg[ taus88 ][ uniform_real ] = _random_.variate_generator_taus88__uniform_real +__vg[ taus88 ][ uniform_smallint ] = _random_.variate_generator_taus88__uniform_smallint + + +def variate_generator( generator, distribution ): + global __vg + global distributions + gcls = generator.__class__ + if not __vg.has_key( gcls ): + raise RuntimeError( 'Unable to create variate_generator - unknown generator type!' ) + dcls = distribution.__class__ + if dcls not in distributions: + raise RuntimeError( 'Unable to create variate_generator - unknown distribution type!' ) + + valid_distrs = __vg[ gcls ] + if not valid_distrs.has_key( dcls ): + raise RuntimeError( 'Unable to create variate_generator(%s, %s) - takoe sochetanie does not exist!' + % ( gcls.__name__, dcls.__name__ ) ) + return valid_distrs[dcls] + Added: pyplusplus_dev/examples/pyboost_dev/unittests/random/unittests/test_all.py =================================================================== --- pyplusplus_dev/examples/pyboost_dev/unittests/random/unittests/test_all.py (rev 0) +++ pyplusplus_dev/examples/pyboost_dev/unittests/random/unittests/test_all.py 2006-05-17 06:18:34 UTC (rev 112) @@ -0,0 +1,28 @@ +#! /usr/bin/python +# Copyright 2004 Roman Yakovenko. +# Distributed under the Boost Software License, Version 1.0. (See +# accompanying file LICENSE_1_0.txt or copy at +# http://www.boost.org/LICENSE_1_0.txt) + +import sys +sys.path.append( '../..' ) + +import random +print random.__path__ +import unittest + +class tester_t( unittest.TestCase ): + def __init__( self, *args ): + unittest.TestCase.__init__( self, *args ) + + +def create_suite(): + suite = unittest.TestSuite() + suite.addTest( unittest.makeSuite(tester_t) ) + return suite + +def run_suite(): + unittest.TextTestRunner(verbosity=2).run( create_suite() ) + +if __name__ == "__main__": + run_suite() This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rom...@us...> - 2006-05-17 06:16:49
|
Revision: 111 Author: roman_yakovenko Date: 2006-05-16 23:16:44 -0700 (Tue, 16 May 2006) ViewCVS: http://svn.sourceforge.net/pygccxml/?rev=111&view=rev Log Message: ----------- rename random to brandom Removed Paths: ------------- pyplusplus_dev/examples/pyboost_dev/pyboost/random/sconscript Deleted: pyplusplus_dev/examples/pyboost_dev/pyboost/random/sconscript =================================================================== --- pyplusplus_dev/examples/pyboost_dev/pyboost/random/sconscript 2006-05-17 06:16:24 UTC (rev 110) +++ pyplusplus_dev/examples/pyboost_dev/pyboost/random/sconscript 2006-05-17 06:16:44 UTC (rev 111) @@ -1,35 +0,0 @@ -#! /usr/bin/python -# Copyright 2004 Roman Yakovenko. -# Distributed under the Boost Software License, Version 1.0. (See -# accompanying file LICENSE_1_0.txt or copy at -# http://www.boost.org/LICENSE_1_0.txt) - -import os -import sys -import random_settings - -Import( 'env' ) - -def get_ccflags(): - if sys.platform == 'win32': - return random_settings.scons.ccflags \ - + map( lambda ds: '/D%s' % ds, random_settings.defined_symbols ) - else: - return map( lambda ds: '-D' + ds, random_settings.defined_symbols ) - -def get_source_files(): - source_files = filter( lambda s: s.endswith( '.cpp' ), os.listdir(random_settings.generated_files_dir) ) - return map( lambda fname: os.path.join( random_settings.generated_files_dir, fname ), source_files ) - -def get_target(): - return os.path.join( random_settings.generated_files_dir - , random_settings.module_name + random_settings.scons.suffix ) - -local_env = env.Copy() -local_env.Append( CPPPATH=[ random_settings.working_dir, random_settings.generated_files_dir ] ) -local_env.Append( CCFLAGS=get_ccflags() ) - -_random_ = local_env.SharedLibrary( target=random_settings.module_name - , source=get_source_files() ) - -local_env.Install( '#unittests/random', _random_ ) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rom...@us...> - 2006-05-17 06:16:32
|
Revision: 110 Author: roman_yakovenko Date: 2006-05-16 23:16:24 -0700 (Tue, 16 May 2006) ViewCVS: http://svn.sourceforge.net/pygccxml/?rev=110&view=rev Log Message: ----------- rename random to brandom Removed Paths: ------------- pyplusplus_dev/examples/pyboost_dev/pyboost/random/random_settings.py Deleted: pyplusplus_dev/examples/pyboost_dev/pyboost/random/random_settings.py =================================================================== --- pyplusplus_dev/examples/pyboost_dev/pyboost/random/random_settings.py 2006-05-17 06:16:08 UTC (rev 109) +++ pyplusplus_dev/examples/pyboost_dev/pyboost/random/random_settings.py 2006-05-17 06:16:24 UTC (rev 110) @@ -1,27 +0,0 @@ -#! /usr/bin/python -# Copyright 2004 Roman Yakovenko. -# Distributed under the Boost Software License, Version 1.0. (See -# accompanying file LICENSE_1_0.txt or copy at -# http://www.boost.org/LICENSE_1_0.txt) - -import os -import sys - -_script_dir = os.path.abspath( os.getcwd() ) -environment_path = os.path.realpath( os.path.join( _script_dir, '..', '..', '..', '..' ) ) -sys.path.append( environment_path ) - -from environment import boost, scons, gccxml, python - -module_name = '_random_' -working_dir = _script_dir -generated_files_dir = os.path.join( _script_dir, 'generated' ) -unittests_dir = os.path.join( _script_dir, '..', '..', 'unittests', 'random' ) - -defined_symbols = [ 'BOOST_NO_INCLASS_MEMBER_INITIALIZATION', 'BOOST_NO_INT64_T' ] -undefined_symbols = [ '__MINGW32__' ] -#defined_symbols = ['BOOST_DATE_TIME_NO_MEMBER_INIT'] -#if sys.platform == 'win32': - #defined_symbols.extend( [ 'BOOST_DATE_TIME_DYN_LINK' ] ) - - \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rom...@us...> - 2006-05-17 06:16:16
|
Revision: 109 Author: roman_yakovenko Date: 2006-05-16 23:16:08 -0700 (Tue, 16 May 2006) ViewCVS: http://svn.sourceforge.net/pygccxml/?rev=109&view=rev Log Message: ----------- Removed Paths: ------------- pyplusplus_dev/examples/pyboost_dev/pyboost/random/generate_code.py Deleted: pyplusplus_dev/examples/pyboost_dev/pyboost/random/generate_code.py =================================================================== --- pyplusplus_dev/examples/pyboost_dev/pyboost/random/generate_code.py 2006-05-17 06:13:37 UTC (rev 108) +++ pyplusplus_dev/examples/pyboost_dev/pyboost/random/generate_code.py 2006-05-17 06:16:08 UTC (rev 109) @@ -1,169 +0,0 @@ -#! /usr/bin/python -# Copyright 2004 Roman Yakovenko. -# Distributed under the Boost Software License, Version 1.0. (See -# accompanying file LICENSE_1_0.txt or copy at -# http://www.boost.org/LICENSE_1_0.txt) - - -import os -import sys -import time -import shutil -import logging -import random_settings -from pygccxml import parser -from pygccxml import declarations -from pyplusplus import module_builder -from pyplusplus.module_builder import call_policies - - -LICENSE = """// Copyright 2004 Roman Yakovenko. -// Distributed under the Boost Software License, Version 1.0. (See -// accompanying file LICENSE_1_0.txt or copy at -// http://www.boost.org/LICENSE_1_0.txt) -""" - -class code_generator_t(object): - def __init__(self): - module_builder.set_logger_level( logging.INFO ) - self.__file = os.path.join( random_settings.working_dir, 'random_export.hpp' ) - self.__mb = module_builder.module_builder_t( - [ parser.create_cached_source_fc( - self.__file - , os.path.join( random_settings.generated_files_dir, 'random.xml' ) ) ] - , gccxml_path=random_settings.gccxml.executable - , include_paths=[random_settings.boost.include] - , define_symbols=random_settings.defined_symbols - , undefine_symbols=random_settings.undefined_symbols) - self.generators = [ "ecuyer1988" - , "hellekalek1995" - , "kreutzer1986" - , "lagged_fibonacci1279" - , "lagged_fibonacci19937" - , "lagged_fibonacci2281" - , "lagged_fibonacci23209" - , "lagged_fibonacci3217" - , "lagged_fibonacci4423" - , "lagged_fibonacci44497" - , "lagged_fibonacci607" - , "lagged_fibonacci9689" - , "minstd_rand" - , "minstd_rand0" - , "mt11213b" - , "mt19937" - , "ranlux3" - , "ranlux3_01" - , "ranlux4" - , "ranlux4_01" - , "ranlux64_3_01" - , "ranlux64_4_01" - , "taus88" ] - - self.no_min_max = [ 'py_cauchy_distribution' - , 'py_bernoulli_distribution' - , 'py_binomial_distribution' - , 'py_poisson_distribution' - , 'py_normal_distribution' - , 'py_gamma_distribution' - , 'py_triangle_distribution' - , 'py_uniform_on_sphere' - , 'py_exponential_distribution' - , 'py_geometric_distribution' - , 'py_lognormal_distribution' - ] - - def typedef2class( self, scope, name ): - typedef = scope.typedef( name ) - return typedef.type.declaration - - def filter_declarations(self ): - self.__mb.global_ns.exclude() - boost_ns = self.__mb.global_ns.namespace( 'boost', recursive=False ) - for name in self.generators: - gen_cls = self.typedef2class( boost_ns, name ) - gen_cls.include() - #TODO: find out why compiler complains - gen_cls.member_functions( 'seed' ).create_with_signature = True - - pyimpl_ns = boost_ns.namespace( 'pyimpl' ) - helpers = pyimpl_ns.classes( lambda decl: decl.name.startswith( 'py_') ) - helpers.include() - for helper in helpers: - distrib_cls = self.typedef2class( helper, "distribution" ) - distrib_cls.include() - var_gen_typedefs = helper.typedefs( lambda decl: decl.name.startswith( 'variate_generator_' ) ) - for var_gen_typedef in var_gen_typedefs: - var_gen_cls = var_gen_typedef.type.declaration - var_gen_cls.include() - var_gen_cls.member_operators( symbol='()' ).create_with_signature = True - if helper.name in self.no_min_max: - var_gen_cls.member_function( 'max' ).exclude() - var_gen_cls.member_function( 'min' ).exclude() - - ecuyer1988 = self.typedef2class( boost_ns, 'ecuyer1988' ) - ecuyer1988.member_function( 'seed', arg_types=[None, None] ).exclude() - - def prepare_declarations( self ): - boost_ns = self.__mb.namespace( 'boost' ) - for name in self.generators: - gen_cls = self.typedef2class( boost_ns, name ) - gen_cls.alias = name - - pyimpl_ns = boost_ns.namespace( 'pyimpl' ) - helpers = pyimpl_ns.classes( lambda decl: decl.name.startswith( 'py_') ) - for helper in helpers: - distrib_cls = self.typedef2class( helper, "distribution" ) - distrib_cls.alias = helper.name[3:] #py_ - var_gen_typedefs = helper.typedefs( lambda decl: decl.name.startswith( 'variate_generator_' ) ) - for var_gen_typedef in var_gen_typedefs: - var_gen_cls = var_gen_typedef.type.declaration - var_gen_cls.alias = var_gen_typedef.name + '__' + distrib_cls.alias - - self.set_call_policies() - - def set_call_policies( self ): - boost_ns = self.__mb.namespace( 'boost' ) - engine_funcs = boost_ns.member_functions( name="engine" - , function=lambda decl: not decl.has_const ) - engine_funcs.call_policies = call_policies.return_internal_reference() - - distribution_funcs = boost_ns.member_functions( name="distribution" - , function=lambda decl: not decl.has_const ) - distribution_funcs.call_policies = call_policies.return_internal_reference() - - - - def customize_extmodule( self ): - global LICENSE - extmodule = self.__mb.code_creator - #beautifying include code generation - extmodule.license = LICENSE - extmodule.user_defined_directories.append( random_settings.boost.include ) - extmodule.user_defined_directories.append( random_settings.working_dir ) - extmodule.user_defined_directories.append( random_settings.generated_files_dir ) - extmodule.precompiled_header = 'boost/python.hpp' - extmodule.replace_included_headers( ['boost/random.hpp', 'boost/nondet_random.hpp', 'random_export.hpp' ] ) - - def write_files( self ): - #self.__mb.write_module( os.path.join( random_settings.generated_files_dir, 'random.pypp.cpp' ) ) - self.__mb.split_module( random_settings.generated_files_dir ) - - def create(self): - start_time = time.clock() - self.filter_declarations() - self.prepare_declarations() - self.__mb.build_code_creator( random_settings.module_name ) - - self.customize_extmodule() - self.write_files( ) - print 'time taken : ', time.clock() - start_time, ' seconds' - -def export(): - cg = code_generator_t() - cg.create() - -if __name__ == '__main__': - export() - print 'done' - - This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rom...@us...> - 2006-05-17 06:13:42
|
Revision: 108 Author: roman_yakovenko Date: 2006-05-16 23:13:37 -0700 (Tue, 16 May 2006) ViewCVS: http://svn.sourceforge.net/pygccxml/?rev=108&view=rev Log Message: ----------- Removed Paths: ------------- pyplusplus_dev/examples/pyboost_dev/pyboost/random/generated/ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rom...@us...> - 2006-05-17 06:12:33
|
Revision: 107 Author: roman_yakovenko Date: 2006-05-16 23:12:19 -0700 (Tue, 16 May 2006) ViewCVS: http://svn.sourceforge.net/pygccxml/?rev=107&view=rev Log Message: ----------- rename random to brandom Added Paths: ----------- pyplusplus_dev/examples/pyboost_dev/pyboost/brandom/ pyplusplus_dev/examples/pyboost_dev/pyboost/brandom/generate_code.py pyplusplus_dev/examples/pyboost_dev/pyboost/brandom/generated/ pyplusplus_dev/examples/pyboost_dev/pyboost/brandom/random_export.hpp pyplusplus_dev/examples/pyboost_dev/pyboost/brandom/random_settings.py pyplusplus_dev/examples/pyboost_dev/pyboost/brandom/sconscript Removed Paths: ------------- pyplusplus_dev/examples/pyboost_dev/pyboost/brandom/generate_code.py pyplusplus_dev/examples/pyboost_dev/pyboost/brandom/generated/ pyplusplus_dev/examples/pyboost_dev/pyboost/brandom/sconstruct pyplusplus_dev/examples/pyboost_dev/pyboost/brandom/settings.py Copied: pyplusplus_dev/examples/pyboost_dev/pyboost/brandom (from rev 63, pyplusplus_dev/examples/pyboost_dev/pyboost/random) Deleted: pyplusplus_dev/examples/pyboost_dev/pyboost/brandom/generate_code.py =================================================================== --- pyplusplus_dev/examples/pyboost_dev/pyboost/random/generate_code.py 2006-05-04 05:21:37 UTC (rev 63) +++ pyplusplus_dev/examples/pyboost_dev/pyboost/brandom/generate_code.py 2006-05-17 06:12:19 UTC (rev 107) @@ -1,97 +0,0 @@ -#! /usr/bin/python -# Copyright 2004 Roman Yakovenko. -# Distributed under the Boost Software License, Version 1.0. (See -# accompanying file LICENSE_1_0.txt or copy at -# http://www.boost.org/LICENSE_1_0.txt) - - -import os -import sys -import time -import shutil -import settings -from pygccxml import parser -from pygccxml import declarations -from pyplusplus import code_creators -from pyplusplus import module_builder - -LICENSE = """// Copyright 2004 Roman Yakovenko. -// Distributed under the Boost Software License, Version 1.0. (See -// accompanying file LICENSE_1_0.txt or copy at -// http://www.boost.org/LICENSE_1_0.txt) -""" - -class code_generator_t(object): - def __init__(self): - self.__file = os.path.join( settings.boost.include - , 'libs', 'random', 'random_test.cpp' ) - self.__mb = module_builder.module_builder_t( - [ parser.create_cached_source_fc( - self.__file - , os.path.join( settings.generated_files_dir, 'random_test.xml' ) ) ] - , gccxml_path=settings.gccxml.executable - , include_paths=[settings.boost.include] - , undefine_symbols=settings.undefined_symbols) - - def filter_declarations(self ): - self.__mb.global_ns.exclude() - boost_ns = self.__mb.global_ns.namespace( 'boost', recursive=False ) - boost_ns.namespace( 'random' ).include() - boost_ns.namespaces( 'detail' ).exclude() - for cls in boost_ns.namespace( 'random' ).classes(): - if cls.ignore: - continue - else: - aliases = set([ t.name for t in cls.typedefs ]) - for alias in [ 'engine_value_type', 'value_type', 'base_type', 'engine_type' ]: - if alias in aliases: - aliases.remove( alias ) - if len( aliases ) == 1: - cls.alias = list( aliases )[0] - else: - print cls.name - for t in aliases: - print ' ', t - - boost_ns.free_functions( "lessthan_signed_unsigned" ).exclude() - boost_ns.free_functions( "equal_signed_unsigned" ).exclude() - - def beautify_code( self ): - extmodule = self.__mb.code_creator - position = extmodule.last_include_index() + 1 - extmodule.adopt_creator( code_creators.namespace_using_t( 'boost' ) - , position ) - - def customize_extmodule( self ): - global LICENSE - extmodule = self.__mb.code_creator - #beautifying include code generation - extmodule.license = LICENSE - extmodule.user_defined_directories.append( settings.boost.include ) - extmodule.user_defined_directories.append( settings.working_dir ) - extmodule.user_defined_directories.append( settings.generated_files_dir ) - extmodule.precompiled_header = 'boost/python.hpp' - self.beautify_code( ) - - def write_files( self ): - self.__mb.write_module( os.path.join( settings.generated_files_dir, 'random.pypp.cpp' ) ) - - def create(self): - start_time = time.clock() - self.filter_declarations() - - self.__mb.build_code_creator( settings.module_name ) - - self.customize_extmodule() - self.write_files( ) - print 'time taken : ', time.clock() - start_time, ' seconds' - -def export(): - cg = code_generator_t() - cg.create() - -if __name__ == '__main__': - export() - print 'done' - - Copied: pyplusplus_dev/examples/pyboost_dev/pyboost/brandom/generate_code.py (from rev 106, pyplusplus_dev/examples/pyboost_dev/pyboost/random/generate_code.py) =================================================================== --- pyplusplus_dev/examples/pyboost_dev/pyboost/brandom/generate_code.py (rev 0) +++ pyplusplus_dev/examples/pyboost_dev/pyboost/brandom/generate_code.py 2006-05-17 06:12:19 UTC (rev 107) @@ -0,0 +1,169 @@ +#! /usr/bin/python +# Copyright 2004 Roman Yakovenko. +# Distributed under the Boost Software License, Version 1.0. (See +# accompanying file LICENSE_1_0.txt or copy at +# http://www.boost.org/LICENSE_1_0.txt) + + +import os +import sys +import time +import shutil +import logging +import random_settings +from pygccxml import parser +from pygccxml import declarations +from pyplusplus import module_builder +from pyplusplus.module_builder import call_policies + + +LICENSE = """// Copyright 2004 Roman Yakovenko. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +""" + +class code_generator_t(object): + def __init__(self): + module_builder.set_logger_level( logging.INFO ) + self.__file = os.path.join( random_settings.working_dir, 'random_export.hpp' ) + self.__mb = module_builder.module_builder_t( + [ parser.create_cached_source_fc( + self.__file + , os.path.join( random_settings.generated_files_dir, 'random.xml' ) ) ] + , gccxml_path=random_settings.gccxml.executable + , include_paths=[random_settings.boost.include] + , define_symbols=random_settings.defined_symbols + , undefine_symbols=random_settings.undefined_symbols) + self.generators = [ "ecuyer1988" + , "hellekalek1995" + , "kreutzer1986" + , "lagged_fibonacci1279" + , "lagged_fibonacci19937" + , "lagged_fibonacci2281" + , "lagged_fibonacci23209" + , "lagged_fibonacci3217" + , "lagged_fibonacci4423" + , "lagged_fibonacci44497" + , "lagged_fibonacci607" + , "lagged_fibonacci9689" + , "minstd_rand" + , "minstd_rand0" + , "mt11213b" + , "mt19937" + , "ranlux3" + , "ranlux3_01" + , "ranlux4" + , "ranlux4_01" + , "ranlux64_3_01" + , "ranlux64_4_01" + , "taus88" ] + + self.no_min_max = [ 'py_cauchy_distribution' + , 'py_bernoulli_distribution' + , 'py_binomial_distribution' + , 'py_poisson_distribution' + , 'py_normal_distribution' + , 'py_gamma_distribution' + , 'py_triangle_distribution' + , 'py_uniform_on_sphere' + , 'py_exponential_distribution' + , 'py_geometric_distribution' + , 'py_lognormal_distribution' + ] + + def typedef2class( self, scope, name ): + typedef = scope.typedef( name ) + return typedef.type.declaration + + def filter_declarations(self ): + self.__mb.global_ns.exclude() + boost_ns = self.__mb.global_ns.namespace( 'boost', recursive=False ) + for name in self.generators: + gen_cls = self.typedef2class( boost_ns, name ) + gen_cls.include() + #TODO: find out why compiler complains + gen_cls.member_functions( 'seed' ).create_with_signature = True + + pyimpl_ns = boost_ns.namespace( 'pyimpl' ) + helpers = pyimpl_ns.classes( lambda decl: decl.name.startswith( 'py_') ) + helpers.include() + for helper in helpers: + distrib_cls = self.typedef2class( helper, "distribution" ) + distrib_cls.include() + var_gen_typedefs = helper.typedefs( lambda decl: decl.name.startswith( 'variate_generator_' ) ) + for var_gen_typedef in var_gen_typedefs: + var_gen_cls = var_gen_typedef.type.declaration + var_gen_cls.include() + var_gen_cls.member_operators( symbol='()' ).create_with_signature = True + if helper.name in self.no_min_max: + var_gen_cls.member_function( 'max' ).exclude() + var_gen_cls.member_function( 'min' ).exclude() + + ecuyer1988 = self.typedef2class( boost_ns, 'ecuyer1988' ) + ecuyer1988.member_function( 'seed', arg_types=[None, None] ).exclude() + + def prepare_declarations( self ): + boost_ns = self.__mb.namespace( 'boost' ) + for name in self.generators: + gen_cls = self.typedef2class( boost_ns, name ) + gen_cls.alias = name + + pyimpl_ns = boost_ns.namespace( 'pyimpl' ) + helpers = pyimpl_ns.classes( lambda decl: decl.name.startswith( 'py_') ) + for helper in helpers: + distrib_cls = self.typedef2class( helper, "distribution" ) + distrib_cls.alias = helper.name[3:] #py_ + var_gen_typedefs = helper.typedefs( lambda decl: decl.name.startswith( 'variate_generator_' ) ) + for var_gen_typedef in var_gen_typedefs: + var_gen_cls = var_gen_typedef.type.declaration + var_gen_cls.alias = var_gen_typedef.name + '__' + distrib_cls.alias + + self.set_call_policies() + + def set_call_policies( self ): + boost_ns = self.__mb.namespace( 'boost' ) + engine_funcs = boost_ns.member_functions( name="engine" + , function=lambda decl: not decl.has_const ) + engine_funcs.call_policies = call_policies.return_internal_reference() + + distribution_funcs = boost_ns.member_functions( name="distribution" + , function=lambda decl: not decl.has_const ) + distribution_funcs.call_policies = call_policies.return_internal_reference() + + + + def customize_extmodule( self ): + global LICENSE + extmodule = self.__mb.code_creator + #beautifying include code generation + extmodule.license = LICENSE + extmodule.user_defined_directories.append( random_settings.boost.include ) + extmodule.user_defined_directories.append( random_settings.working_dir ) + extmodule.user_defined_directories.append( random_settings.generated_files_dir ) + extmodule.precompiled_header = 'boost/python.hpp' + extmodule.replace_included_headers( ['boost/random.hpp', 'boost/nondet_random.hpp', 'random_export.hpp' ] ) + + def write_files( self ): + #self.__mb.write_module( os.path.join( random_settings.generated_files_dir, 'random.pypp.cpp' ) ) + self.__mb.split_module( random_settings.generated_files_dir ) + + def create(self): + start_time = time.clock() + self.filter_declarations() + self.prepare_declarations() + self.__mb.build_code_creator( random_settings.module_name ) + + self.customize_extmodule() + self.write_files( ) + print 'time taken : ', time.clock() - start_time, ' seconds' + +def export(): + cg = code_generator_t() + cg.create() + +if __name__ == '__main__': + export() + print 'done' + + Copied: pyplusplus_dev/examples/pyboost_dev/pyboost/brandom/generated (from rev 106, pyplusplus_dev/examples/pyboost_dev/pyboost/random/generated) Added: pyplusplus_dev/examples/pyboost_dev/pyboost/brandom/random_export.hpp =================================================================== --- pyplusplus_dev/examples/pyboost_dev/pyboost/brandom/random_export.hpp (rev 0) +++ pyplusplus_dev/examples/pyboost_dev/pyboost/brandom/random_export.hpp 2006-05-17 06:12:19 UTC (rev 107) @@ -0,0 +1,472 @@ +#include <boost/random.hpp> + +namespace boost{ namespace random{ namespace pyimpl{ + +struct generators{ + static void instantiate(){ + sizeof( ecuyer1988 ); + sizeof( hellekalek1995 ); + sizeof( kreutzer1986 ); + sizeof( lagged_fibonacci1279 ); + sizeof( lagged_fibonacci19937 ); + sizeof( lagged_fibonacci2281 ); + sizeof( lagged_fibonacci23209 ); + sizeof( lagged_fibonacci3217 ); + sizeof( lagged_fibonacci4423 ); + sizeof( lagged_fibonacci44497 ); + sizeof( lagged_fibonacci607 ); + sizeof( lagged_fibonacci9689 ); + sizeof( minstd_rand ); + sizeof( minstd_rand0 ); + sizeof( mt11213b ); + sizeof( mt19937 ); + sizeof( ranlux3 ); + sizeof( ranlux3_01 ); + sizeof( ranlux4 ); + sizeof( ranlux4_01 ); + sizeof( ranlux64_3_01 ); + sizeof( ranlux64_4_01 ); + sizeof( taus88 ); + } +}; + +#define CREATE_INSTANTIATION( GENERATOR_TYPE ) \ + static result_type \ + inline call( distribution& dist, GENERATOR_TYPE& gen ){ \ + return dist( gen ); \ + } \ + \ + typedef variate_generator< GENERATOR_TYPE, distribution > variate_generator_##GENERATOR_TYPE; \ + \ + variate_generator< GENERATOR_TYPE, distribution > \ + create_vg(distribution dist, GENERATOR_TYPE gen ){ \ + return variate_generator< GENERATOR_TYPE, distribution >(gen, dist); \ + } + +struct py_uniform_smallint{ + + typedef uniform_smallint<> distribution; + typedef distribution::result_type result_type; + + CREATE_INSTANTIATION( ecuyer1988 ); + CREATE_INSTANTIATION( hellekalek1995 ); + CREATE_INSTANTIATION( kreutzer1986 ); + //CREATE_INSTANTIATION( lagged_fibonacci1279 ); + //CREATE_INSTANTIATION( lagged_fibonacci19937 ); + //CREATE_INSTANTIATION( lagged_fibonacci2281 ); + //CREATE_INSTANTIATION( lagged_fibonacci23209 ); + //CREATE_INSTANTIATION( lagged_fibonacci3217 ); + //CREATE_INSTANTIATION( lagged_fibonacci4423 ); + //CREATE_INSTANTIATION( lagged_fibonacci44497 ); + //CREATE_INSTANTIATION( lagged_fibonacci607 ); + //CREATE_INSTANTIATION( lagged_fibonacci9689 ); + CREATE_INSTANTIATION( minstd_rand ); + CREATE_INSTANTIATION( minstd_rand0 ); + CREATE_INSTANTIATION( mt11213b ); + CREATE_INSTANTIATION( mt19937 ); + CREATE_INSTANTIATION( ranlux3 ); + //CREATE_INSTANTIATION( ranlux3_01 ); + CREATE_INSTANTIATION( ranlux4 ); + //CREATE_INSTANTIATION( ranlux4_01 ); + //CREATE_INSTANTIATION( ranlux64_3_01 ); + //CREATE_INSTANTIATION( ranlux64_4_01 ); + CREATE_INSTANTIATION( taus88 ); +}; + +struct py_uniform_int{ + + typedef uniform_int<> distribution; + typedef distribution::result_type result_type; + + CREATE_INSTANTIATION( ecuyer1988 ); + CREATE_INSTANTIATION( hellekalek1995 ); + CREATE_INSTANTIATION( kreutzer1986 ); + //CREATE_INSTANTIATION( lagged_fibonacci1279 ); + //CREATE_INSTANTIATION( lagged_fibonacci19937 ); + //CREATE_INSTANTIATION( lagged_fibonacci2281 ); + //CREATE_INSTANTIATION( lagged_fibonacci23209 ); + //CREATE_INSTANTIATION( lagged_fibonacci3217 ); + //CREATE_INSTANTIATION( lagged_fibonacci4423 ); + //CREATE_INSTANTIATION( lagged_fibonacci44497 ); + //CREATE_INSTANTIATION( lagged_fibonacci607 ); + //CREATE_INSTANTIATION( lagged_fibonacci9689 ); + CREATE_INSTANTIATION( minstd_rand ); + CREATE_INSTANTIATION( minstd_rand0 ); + CREATE_INSTANTIATION( mt11213b ); + CREATE_INSTANTIATION( mt19937 ); + CREATE_INSTANTIATION( ranlux3 ); + //CREATE_INSTANTIATION( ranlux3_01 ); + CREATE_INSTANTIATION( ranlux4 ); + //CREATE_INSTANTIATION( ranlux4_01 ); + //CREATE_INSTANTIATION( ranlux64_3_01 ); + //CREATE_INSTANTIATION( ranlux64_4_01 ); + CREATE_INSTANTIATION( taus88 ); +}; + + +struct py_uniform_real{ + + typedef uniform_real<> distribution; + typedef distribution::result_type result_type; + + CREATE_INSTANTIATION( ecuyer1988 ); + CREATE_INSTANTIATION( hellekalek1995 ); + CREATE_INSTANTIATION( kreutzer1986 ); + CREATE_INSTANTIATION( lagged_fibonacci1279 ); + CREATE_INSTANTIATION( lagged_fibonacci19937 ); + CREATE_INSTANTIATION( lagged_fibonacci2281 ); + CREATE_INSTANTIATION( lagged_fibonacci23209 ); + CREATE_INSTANTIATION( lagged_fibonacci3217 ); + CREATE_INSTANTIATION( lagged_fibonacci4423 ); + CREATE_INSTANTIATION( lagged_fibonacci44497 ); + CREATE_INSTANTIATION( lagged_fibonacci607 ); + CREATE_INSTANTIATION( lagged_fibonacci9689 ); + CREATE_INSTANTIATION( minstd_rand ); + CREATE_INSTANTIATION( minstd_rand0 ); + CREATE_INSTANTIATION( mt11213b ); + CREATE_INSTANTIATION( mt19937 ); + CREATE_INSTANTIATION( ranlux3 ); + CREATE_INSTANTIATION( ranlux3_01 ); + CREATE_INSTANTIATION( ranlux4 ); + CREATE_INSTANTIATION( ranlux4_01 ); + CREATE_INSTANTIATION( ranlux64_3_01 ); + CREATE_INSTANTIATION( ranlux64_4_01 ); + CREATE_INSTANTIATION( taus88 ); +}; + +struct py_bernoulli_distribution{ + + typedef bernoulli_distribution<> distribution; + typedef distribution::result_type result_type; + + CREATE_INSTANTIATION( ecuyer1988 ); + CREATE_INSTANTIATION( hellekalek1995 ); + CREATE_INSTANTIATION( kreutzer1986 ); + CREATE_INSTANTIATION( lagged_fibonacci1279 ); + CREATE_INSTANTIATION( lagged_fibonacci19937 ); + CREATE_INSTANTIATION( lagged_fibonacci2281 ); + CREATE_INSTANTIATION( lagged_fibonacci23209 ); + CREATE_INSTANTIATION( lagged_fibonacci3217 ); + CREATE_INSTANTIATION( lagged_fibonacci4423 ); + CREATE_INSTANTIATION( lagged_fibonacci44497 ); + CREATE_INSTANTIATION( lagged_fibonacci607 ); + CREATE_INSTANTIATION( lagged_fibonacci9689 ); + CREATE_INSTANTIATION( minstd_rand ); + CREATE_INSTANTIATION( minstd_rand0 ); + CREATE_INSTANTIATION( mt11213b ); + CREATE_INSTANTIATION( mt19937 ); + CREATE_INSTANTIATION( ranlux3 ); + CREATE_INSTANTIATION( ranlux3_01 ); + CREATE_INSTANTIATION( ranlux4 ); + CREATE_INSTANTIATION( ranlux4_01 ); + CREATE_INSTANTIATION( ranlux64_3_01 ); + CREATE_INSTANTIATION( ranlux64_4_01 ); + CREATE_INSTANTIATION( taus88 ); +}; + + +struct py_geometric_distribution{ + + typedef geometric_distribution<> distribution; + typedef distribution::result_type result_type; + + CREATE_INSTANTIATION( ecuyer1988 ); + CREATE_INSTANTIATION( hellekalek1995 ); + CREATE_INSTANTIATION( kreutzer1986 ); + CREATE_INSTANTIATION( lagged_fibonacci1279 ); + CREATE_INSTANTIATION( lagged_fibonacci19937 ); + CREATE_INSTANTIATION( lagged_fibonacci2281 ); + CREATE_INSTANTIATION( lagged_fibonacci23209 ); + CREATE_INSTANTIATION( lagged_fibonacci3217 ); + CREATE_INSTANTIATION( lagged_fibonacci4423 ); + CREATE_INSTANTIATION( lagged_fibonacci44497 ); + CREATE_INSTANTIATION( lagged_fibonacci607 ); + CREATE_INSTANTIATION( lagged_fibonacci9689 ); + CREATE_INSTANTIATION( minstd_rand ); + CREATE_INSTANTIATION( minstd_rand0 ); + CREATE_INSTANTIATION( mt11213b ); + CREATE_INSTANTIATION( mt19937 ); + CREATE_INSTANTIATION( ranlux3 ); + CREATE_INSTANTIATION( ranlux3_01 ); + CREATE_INSTANTIATION( ranlux4 ); + CREATE_INSTANTIATION( ranlux4_01 ); + CREATE_INSTANTIATION( ranlux64_3_01 ); + CREATE_INSTANTIATION( ranlux64_4_01 ); + CREATE_INSTANTIATION( taus88 ); +}; + +struct py_triangle_distribution{ + + typedef triangle_distribution<> distribution; + typedef distribution::result_type result_type; + + CREATE_INSTANTIATION( ecuyer1988 ); + CREATE_INSTANTIATION( hellekalek1995 ); + CREATE_INSTANTIATION( kreutzer1986 ); + CREATE_INSTANTIATION( lagged_fibonacci1279 ); + CREATE_INSTANTIATION( lagged_fibonacci19937 ); + CREATE_INSTANTIATION( lagged_fibonacci2281 ); + CREATE_INSTANTIATION( lagged_fibonacci23209 ); + CREATE_INSTANTIATION( lagged_fibonacci3217 ); + CREATE_INSTANTIATION( lagged_fibonacci4423 ); + CREATE_INSTANTIATION( lagged_fibonacci44497 ); + CREATE_INSTANTIATION( lagged_fibonacci607 ); + CREATE_INSTANTIATION( lagged_fibonacci9689 ); + CREATE_INSTANTIATION( minstd_rand ); + CREATE_INSTANTIATION( minstd_rand0 ); + CREATE_INSTANTIATION( mt11213b ); + CREATE_INSTANTIATION( mt19937 ); + CREATE_INSTANTIATION( ranlux3 ); + CREATE_INSTANTIATION( ranlux3_01 ); + CREATE_INSTANTIATION( ranlux4 ); + CREATE_INSTANTIATION( ranlux4_01 ); + CREATE_INSTANTIATION( ranlux64_3_01 ); + CREATE_INSTANTIATION( ranlux64_4_01 ); + CREATE_INSTANTIATION( taus88 ); +}; + + +struct py_exponential_distribution{ + + typedef exponential_distribution<> distribution; + typedef distribution::result_type result_type; + + CREATE_INSTANTIATION( ecuyer1988 ); + CREATE_INSTANTIATION( hellekalek1995 ); + CREATE_INSTANTIATION( kreutzer1986 ); + CREATE_INSTANTIATION( lagged_fibonacci1279 ); + CREATE_INSTANTIATION( lagged_fibonacci19937 ); + CREATE_INSTANTIATION( lagged_fibonacci2281 ); + CREATE_INSTANTIATION( lagged_fibonacci23209 ); + CREATE_INSTANTIATION( lagged_fibonacci3217 ); + CREATE_INSTANTIATION( lagged_fibonacci4423 ); + CREATE_INSTANTIATION( lagged_fibonacci44497 ); + CREATE_INSTANTIATION( lagged_fibonacci607 ); + CREATE_INSTANTIATION( lagged_fibonacci9689 ); + CREATE_INSTANTIATION( minstd_rand ); + CREATE_INSTANTIATION( minstd_rand0 ); + CREATE_INSTANTIATION( mt11213b ); + CREATE_INSTANTIATION( mt19937 ); + CREATE_INSTANTIATION( ranlux3 ); + CREATE_INSTANTIATION( ranlux3_01 ); + CREATE_INSTANTIATION( ranlux4 ); + CREATE_INSTANTIATION( ranlux4_01 ); + CREATE_INSTANTIATION( ranlux64_3_01 ); + CREATE_INSTANTIATION( ranlux64_4_01 ); + CREATE_INSTANTIATION( taus88 ); +}; + + +struct py_normal_distribution{ + + typedef normal_distribution<> distribution; + typedef distribution::result_type result_type; + + CREATE_INSTANTIATION( ecuyer1988 ); + CREATE_INSTANTIATION( hellekalek1995 ); + CREATE_INSTANTIATION( kreutzer1986 ); + CREATE_INSTANTIATION( lagged_fibonacci1279 ); + CREATE_INSTANTIATION( lagged_fibonacci19937 ); + CREATE_INSTANTIATION( lagged_fibonacci2281 ); + CREATE_INSTANTIATION( lagged_fibonacci23209 ); + CREATE_INSTANTIATION( lagged_fibonacci3217 ); + CREATE_INSTANTIATION( lagged_fibonacci4423 ); + CREATE_INSTANTIATION( lagged_fibonacci44497 ); + CREATE_INSTANTIATION( lagged_fibonacci607 ); + CREATE_INSTANTIATION( lagged_fibonacci9689 ); + CREATE_INSTANTIATION( minstd_rand ); + CREATE_INSTANTIATION( minstd_rand0 ); + CREATE_INSTANTIATION( mt11213b ); + CREATE_INSTANTIATION( mt19937 ); + CREATE_INSTANTIATION( ranlux3 ); + CREATE_INSTANTIATION( ranlux3_01 ); + CREATE_INSTANTIATION( ranlux4 ); + CREATE_INSTANTIATION( ranlux4_01 ); + CREATE_INSTANTIATION( ranlux64_3_01 ); + CREATE_INSTANTIATION( ranlux64_4_01 ); + CREATE_INSTANTIATION( taus88 ); +}; + +struct py_uniform_on_sphere{ + + typedef uniform_on_sphere<> distribution; + typedef distribution::result_type result_type; + + CREATE_INSTANTIATION( ecuyer1988 ); + CREATE_INSTANTIATION( hellekalek1995 ); + CREATE_INSTANTIATION( kreutzer1986 ); + CREATE_INSTANTIATION( lagged_fibonacci1279 ); + CREATE_INSTANTIATION( lagged_fibonacci19937 ); + CREATE_INSTANTIATION( lagged_fibonacci2281 ); + CREATE_INSTANTIATION( lagged_fibonacci23209 ); + CREATE_INSTANTIATION( lagged_fibonacci3217 ); + CREATE_INSTANTIATION( lagged_fibonacci4423 ); + CREATE_INSTANTIATION( lagged_fibonacci44497 ); + CREATE_INSTANTIATION( lagged_fibonacci607 ); + CREATE_INSTANTIATION( lagged_fibonacci9689 ); + CREATE_INSTANTIATION( minstd_rand ); + CREATE_INSTANTIATION( minstd_rand0 ); + CREATE_INSTANTIATION( mt11213b ); + CREATE_INSTANTIATION( mt19937 ); + CREATE_INSTANTIATION( ranlux3 ); + CREATE_INSTANTIATION( ranlux3_01 ); + CREATE_INSTANTIATION( ranlux4 ); + CREATE_INSTANTIATION( ranlux4_01 ); + CREATE_INSTANTIATION( ranlux64_3_01 ); + CREATE_INSTANTIATION( ranlux64_4_01 ); + CREATE_INSTANTIATION( taus88 ); +}; + +struct py_lognormal_distribution{ + + typedef lognormal_distribution<> distribution; + typedef distribution::result_type result_type; + + CREATE_INSTANTIATION( ecuyer1988 ); + CREATE_INSTANTIATION( hellekalek1995 ); + CREATE_INSTANTIATION( kreutzer1986 ); + CREATE_INSTANTIATION( lagged_fibonacci1279 ); + CREATE_INSTANTIATION( lagged_fibonacci19937 ); + CREATE_INSTANTIATION( lagged_fibonacci2281 ); + CREATE_INSTANTIATION( lagged_fibonacci23209 ); + CREATE_INSTANTIATION( lagged_fibonacci3217 ); + CREATE_INSTANTIATION( lagged_fibonacci4423 ); + CREATE_INSTANTIATION( lagged_fibonacci44497 ); + CREATE_INSTANTIATION( lagged_fibonacci607 ); + CREATE_INSTANTIATION( lagged_fibonacci9689 ); + CREATE_INSTANTIATION( minstd_rand ); + CREATE_INSTANTIATION( minstd_rand0 ); + CREATE_INSTANTIATION( mt11213b ); + CREATE_INSTANTIATION( mt19937 ); + CREATE_INSTANTIATION( ranlux3 ); + CREATE_INSTANTIATION( ranlux3_01 ); + CREATE_INSTANTIATION( ranlux4 ); + CREATE_INSTANTIATION( ranlux4_01 ); + CREATE_INSTANTIATION( ranlux64_3_01 ); + CREATE_INSTANTIATION( ranlux64_4_01 ); + CREATE_INSTANTIATION( taus88 ); +}; + +struct py_gamma_distribution{ + + typedef gamma_distribution<> distribution; + typedef distribution::result_type result_type; + + CREATE_INSTANTIATION( ecuyer1988 ); + CREATE_INSTANTIATION( hellekalek1995 ); + CREATE_INSTANTIATION( kreutzer1986 ); + CREATE_INSTANTIATION( lagged_fibonacci1279 ); + CREATE_INSTANTIATION( lagged_fibonacci19937 ); + CREATE_INSTANTIATION( lagged_fibonacci2281 ); + CREATE_INSTANTIATION( lagged_fibonacci23209 ); + CREATE_INSTANTIATION( lagged_fibonacci3217 ); + CREATE_INSTANTIATION( lagged_fibonacci4423 ); + CREATE_INSTANTIATION( lagged_fibonacci44497 ); + CREATE_INSTANTIATION( lagged_fibonacci607 ); + CREATE_INSTANTIATION( lagged_fibonacci9689 ); + CREATE_INSTANTIATION( minstd_rand ); + CREATE_INSTANTIATION( minstd_rand0 ); + CREATE_INSTANTIATION( mt11213b ); + CREATE_INSTANTIATION( mt19937 ); + CREATE_INSTANTIATION( ranlux3 ); + CREATE_INSTANTIATION( ranlux3_01 ); + CREATE_INSTANTIATION( ranlux4 ); + CREATE_INSTANTIATION( ranlux4_01 ); + CREATE_INSTANTIATION( ranlux64_3_01 ); + CREATE_INSTANTIATION( ranlux64_4_01 ); + CREATE_INSTANTIATION( taus88 ); +}; + +struct py_binomial_distribution{ + + typedef binomial_distribution<> distribution; + typedef distribution::result_type result_type; + + CREATE_INSTANTIATION( ecuyer1988 ); + CREATE_INSTANTIATION( hellekalek1995 ); + CREATE_INSTANTIATION( kreutzer1986 ); + CREATE_INSTANTIATION( lagged_fibonacci1279 ); + CREATE_INSTANTIATION( lagged_fibonacci19937 ); + CREATE_INSTANTIATION( lagged_fibonacci2281 ); + CREATE_INSTANTIATION( lagged_fibonacci23209 ); + CREATE_INSTANTIATION( lagged_fibonacci3217 ); + CREATE_INSTANTIATION( lagged_fibonacci4423 ); + CREATE_INSTANTIATION( lagged_fibonacci44497 ); + CREATE_INSTANTIATION( lagged_fibonacci607 ); + CREATE_INSTANTIATION( lagged_fibonacci9689 ); + CREATE_INSTANTIATION( minstd_rand ); + CREATE_INSTANTIATION( minstd_rand0 ); + CREATE_INSTANTIATION( mt11213b ); + CREATE_INSTANTIATION( mt19937 ); + CREATE_INSTANTIATION( ranlux3 ); + CREATE_INSTANTIATION( ranlux3_01 ); + CREATE_INSTANTIATION( ranlux4 ); + CREATE_INSTANTIATION( ranlux4_01 ); + CREATE_INSTANTIATION( ranlux64_3_01 ); + CREATE_INSTANTIATION( ranlux64_4_01 ); + CREATE_INSTANTIATION( taus88 ); +}; + +struct py_poisson_distribution{ + + typedef poisson_distribution<> distribution; + typedef distribution::result_type result_type; + + CREATE_INSTANTIATION( ecuyer1988 ); + CREATE_INSTANTIATION( hellekalek1995 ); + CREATE_INSTANTIATION( kreutzer1986 ); + CREATE_INSTANTIATION( lagged_fibonacci1279 ); + CREATE_INSTANTIATION( lagged_fibonacci19937 ); + CREATE_INSTANTIATION( lagged_fibonacci2281 ); + CREATE_INSTANTIATION( lagged_fibonacci23209 ); + CREATE_INSTANTIATION( lagged_fibonacci3217 ); + CREATE_INSTANTIATION( lagged_fibonacci4423 ); + CREATE_INSTANTIATION( lagged_fibonacci44497 ); + CREATE_INSTANTIATION( lagged_fibonacci607 ); + CREATE_INSTANTIATION( lagged_fibonacci9689 ); + CREATE_INSTANTIATION( minstd_rand ); + CREATE_INSTANTIATION( minstd_rand0 ); + CREATE_INSTANTIATION( mt11213b ); + CREATE_INSTANTIATION( mt19937 ); + CREATE_INSTANTIATION( ranlux3 ); + CREATE_INSTANTIATION( ranlux3_01 ); + CREATE_INSTANTIATION( ranlux4 ); + CREATE_INSTANTIATION( ranlux4_01 ); + CREATE_INSTANTIATION( ranlux64_3_01 ); + CREATE_INSTANTIATION( ranlux64_4_01 ); + CREATE_INSTANTIATION( taus88 ); +}; + +struct py_cauchy_distribution{ + + typedef cauchy_distribution<> distribution; + typedef distribution::result_type result_type; + + CREATE_INSTANTIATION( ecuyer1988 ); + CREATE_INSTANTIATION( hellekalek1995 ); + CREATE_INSTANTIATION( kreutzer1986 ); + CREATE_INSTANTIATION( lagged_fibonacci1279 ); + CREATE_INSTANTIATION( lagged_fibonacci19937 ); + CREATE_INSTANTIATION( lagged_fibonacci2281 ); + CREATE_INSTANTIATION( lagged_fibonacci23209 ); + CREATE_INSTANTIATION( lagged_fibonacci3217 ); + CREATE_INSTANTIATION( lagged_fibonacci4423 ); + CREATE_INSTANTIATION( lagged_fibonacci44497 ); + CREATE_INSTANTIATION( lagged_fibonacci607 ); + CREATE_INSTANTIATION( lagged_fibonacci9689 ); + CREATE_INSTANTIATION( minstd_rand ); + CREATE_INSTANTIATION( minstd_rand0 ); + CREATE_INSTANTIATION( mt11213b ); + CREATE_INSTANTIATION( mt19937 ); + CREATE_INSTANTIATION( ranlux3 ); + CREATE_INSTANTIATION( ranlux3_01 ); + CREATE_INSTANTIATION( ranlux4 ); + CREATE_INSTANTIATION( ranlux4_01 ); + CREATE_INSTANTIATION( ranlux64_3_01 ); + CREATE_INSTANTIATION( ranlux64_4_01 ); + CREATE_INSTANTIATION( taus88 ); +}; + +} } } + + Copied: pyplusplus_dev/examples/pyboost_dev/pyboost/brandom/random_settings.py (from rev 85, pyplusplus_dev/examples/pyboost_dev/pyboost/random/random_settings.py) =================================================================== --- pyplusplus_dev/examples/pyboost_dev/pyboost/brandom/random_settings.py (rev 0) +++ pyplusplus_dev/examples/pyboost_dev/pyboost/brandom/random_settings.py 2006-05-17 06:12:19 UTC (rev 107) @@ -0,0 +1,27 @@ +#! /usr/bin/python +# Copyright 2004 Roman Yakovenko. +# Distributed under the Boost Software License, Version 1.0. (See +# accompanying file LICENSE_1_0.txt or copy at +# http://www.boost.org/LICENSE_1_0.txt) + +import os +import sys + +_script_dir = os.path.abspath( os.getcwd() ) +environment_path = os.path.realpath( os.path.join( _script_dir, '..', '..', '..', '..' ) ) +sys.path.append( environment_path ) + +from environment import boost, scons, gccxml, python + +module_name = '_random_' +working_dir = _script_dir +generated_files_dir = os.path.join( _script_dir, 'generated' ) +unittests_dir = os.path.join( _script_dir, '..', '..', 'unittests', 'random' ) + +defined_symbols = [ 'BOOST_NO_INCLASS_MEMBER_INITIALIZATION', 'BOOST_NO_INT64_T' ] +undefined_symbols = [ '__MINGW32__' ] +#defined_symbols = ['BOOST_DATE_TIME_NO_MEMBER_INIT'] +#if sys.platform == 'win32': + #defined_symbols.extend( [ 'BOOST_DATE_TIME_DYN_LINK' ] ) + + \ No newline at end of file Copied: pyplusplus_dev/examples/pyboost_dev/pyboost/brandom/sconscript (from rev 106, pyplusplus_dev/examples/pyboost_dev/pyboost/random/sconscript) =================================================================== --- pyplusplus_dev/examples/pyboost_dev/pyboost/brandom/sconscript (rev 0) +++ pyplusplus_dev/examples/pyboost_dev/pyboost/brandom/sconscript 2006-05-17 06:12:19 UTC (rev 107) @@ -0,0 +1,35 @@ +#! /usr/bin/python +# Copyright 2004 Roman Yakovenko. +# Distributed under the Boost Software License, Version 1.0. (See +# accompanying file LICENSE_1_0.txt or copy at +# http://www.boost.org/LICENSE_1_0.txt) + +import os +import sys +import random_settings + +Import( 'env' ) + +def get_ccflags(): + if sys.platform == 'win32': + return random_settings.scons.ccflags \ + + map( lambda ds: '/D%s' % ds, random_settings.defined_symbols ) + else: + return map( lambda ds: '-D' + ds, random_settings.defined_symbols ) + +def get_source_files(): + source_files = filter( lambda s: s.endswith( '.cpp' ), os.listdir(random_settings.generated_files_dir) ) + return map( lambda fname: os.path.join( random_settings.generated_files_dir, fname ), source_files ) + +def get_target(): + return os.path.join( random_settings.generated_files_dir + , random_settings.module_name + random_settings.scons.suffix ) + +local_env = env.Copy() +local_env.Append( CPPPATH=[ random_settings.working_dir, random_settings.generated_files_dir ] ) +local_env.Append( CCFLAGS=get_ccflags() ) + +_random_ = local_env.SharedLibrary( target=random_settings.module_name + , source=get_source_files() ) + +local_env.Install( '#unittests/random', _random_ ) Deleted: pyplusplus_dev/examples/pyboost_dev/pyboost/brandom/sconstruct =================================================================== --- pyplusplus_dev/examples/pyboost_dev/pyboost/random/sconstruct 2006-05-04 05:21:37 UTC (rev 63) +++ pyplusplus_dev/examples/pyboost_dev/pyboost/brandom/sconstruct 2006-05-17 06:12:19 UTC (rev 107) @@ -1,54 +0,0 @@ -#! /usr/bin/python -# Copyright 2004 Roman Yakovenko. -# Distributed under the Boost Software License, Version 1.0. (See -# accompanying file LICENSE_1_0.txt or copy at -# http://www.boost.org/LICENSE_1_0.txt) - -import os -import sys -from environment import settings - -def get_shlibsuffix(): - if sys.platform == 'win32': - return '.pyd' - else: - return '.so' - -def get_ccflags(): - if sys.platform == 'win32': - return [ '/MD' - , '/EHsc' - , '/GR' - , '/Zc:wchar_t' - , '/Zc:forScope' - , '/GR' ] \ - + map( lambda ds: '/D%s' % ds, settings.defined_symbols ) - else: - return map( lambda ds: '-D' + ds, settings.defined_symbols ) - -def get_py_date_time_files(): - source_files = filter( lambda s: s.endswith( '.cpp' ), os.listdir(settings.generated_files_dir) ) - return map( lambda fname: os.path.join( settings.generated_files_dir, fname ), source_files ) - -def get_libs(): - if sys.platform == 'win32': - return ['boost_python' ] #python24.lib - else: - return ['boost_python', 'libboost_date_time-gcc-1_34'] - -def get_target(): - return os.path.join( settings.unittests_dir - , settings.module_name + get_shlibsuffix() ) - -SharedLibrary( target=get_target() - , source=get_py_date_time_files() - , LIBS=get_libs() - , LIBPATH=[ settings.boost_libs_path, settings.python_libs_path ] - , CPPPATH=[ settings.boost_path - , settings.working_dir - , settings.python_include_path - , settings.generated_files_dir ] - , CCFLAGS=get_ccflags() - , SHLIBPREFIX='' - , SHLIBSUFFIX=get_shlibsuffix() -) Deleted: pyplusplus_dev/examples/pyboost_dev/pyboost/brandom/settings.py =================================================================== --- pyplusplus_dev/examples/pyboost_dev/pyboost/random/settings.py 2006-05-04 05:21:37 UTC (rev 63) +++ pyplusplus_dev/examples/pyboost_dev/pyboost/brandom/settings.py 2006-05-17 06:12:19 UTC (rev 107) @@ -1,25 +0,0 @@ -#! /usr/bin/python -# Copyright 2004 Roman Yakovenko. -# Distributed under the Boost Software License, Version 1.0. (See -# accompanying file LICENSE_1_0.txt or copy at -# http://www.boost.org/LICENSE_1_0.txt) - -import os -import sys - -_script_dir = os.path.split( os.path.abspath( sys.argv[0] ) )[0] -environment_path = os.path.normpath( os.path.join( _script_dir, '..', '..', '..', '..' ) ) - -sys.path.append( environment_path ) - -from environment import boost, scons, gccxml - -module_name = '_random_' -working_dir = _script_dir -generated_files_dir = os.path.join( _script_dir, 'generated' ) -unittests_dir = os.path.join( _script_dir, '..', '..', 'unittests', 'random' ) - -undefined_symbols = [ '__MINGW32__' ] -#defined_symbols = ['BOOST_DATE_TIME_NO_MEMBER_INIT'] -#if sys.platform == 'win32': - #defined_symbols.extend( [ 'BOOST_DATE_TIME_DYN_LINK' ] ) \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rom...@us...> - 2006-05-17 05:54:41
|
Revision: 106 Author: roman_yakovenko Date: 2006-05-16 22:54:23 -0700 (Tue, 16 May 2006) ViewCVS: http://svn.sourceforge.net/pygccxml/?rev=106&view=rev Log Message: ----------- updating to use new functions Modified Paths: -------------- pyplusplus_dev/examples/pyboost_dev/pyboost/crc/generate_code.py pyplusplus_dev/examples/pyboost_dev/pyboost/random/generate_code.py pyplusplus_dev/examples/pyboost_dev/pyboost/random/sconscript pyplusplus_dev/examples/pyboost_dev/pyboost/rational/generate_code.py pyplusplus_dev/examples/pyboost_dev/pyboost/rational/rational_export.hpp pyplusplus_dev/examples/pyboost_dev/unittests/rational/__init__.py pyplusplus_dev/examples/pyboost_dev/unittests/rational/unittests/test_all.py pyplusplus_dev/examples/pyeasybmp_dev/pyeasybmp/generate_code.py Modified: pyplusplus_dev/examples/pyboost_dev/pyboost/crc/generate_code.py =================================================================== --- pyplusplus_dev/examples/pyboost_dev/pyboost/crc/generate_code.py 2006-05-17 05:45:42 UTC (rev 105) +++ pyplusplus_dev/examples/pyboost_dev/pyboost/crc/generate_code.py 2006-05-17 05:54:23 UTC (rev 106) @@ -58,7 +58,7 @@ for arg in f.arguments: if arg.default_value == 'InitRem': arg.default_value = InitRem - aliases = set( map( lambda decl: decl.name, cls.typedefs ) ) + aliases = set( map( lambda decl: decl.name, cls.aliases ) ) if 'optimal_crc_type' in aliases: aliases.remove( 'optimal_crc_type' ) if len( aliases ) == 1: Modified: pyplusplus_dev/examples/pyboost_dev/pyboost/random/generate_code.py =================================================================== --- pyplusplus_dev/examples/pyboost_dev/pyboost/random/generate_code.py 2006-05-17 05:45:42 UTC (rev 105) +++ pyplusplus_dev/examples/pyboost_dev/pyboost/random/generate_code.py 2006-05-17 05:54:23 UTC (rev 106) @@ -9,12 +9,14 @@ import sys import time import shutil +import logging import random_settings from pygccxml import parser from pygccxml import declarations -from pyplusplus import code_creators from pyplusplus import module_builder +from pyplusplus.module_builder import call_policies + LICENSE = """// Copyright 2004 Roman Yakovenko. // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at @@ -23,61 +25,114 @@ class code_generator_t(object): def __init__(self): - self.__file = os.path.join( random_settings.boost.include - , 'libs', 'random', 'random_test.cpp' ) + module_builder.set_logger_level( logging.INFO ) + self.__file = os.path.join( random_settings.working_dir, 'random_export.hpp' ) self.__mb = module_builder.module_builder_t( [ parser.create_cached_source_fc( self.__file - , os.path.join( random_settings.generated_files_dir, 'random_test.xml' ) ) ] + , os.path.join( random_settings.generated_files_dir, 'random.xml' ) ) ] , gccxml_path=random_settings.gccxml.executable , include_paths=[random_settings.boost.include] , define_symbols=random_settings.defined_symbols , undefine_symbols=random_settings.undefined_symbols) + self.generators = [ "ecuyer1988" + , "hellekalek1995" + , "kreutzer1986" + , "lagged_fibonacci1279" + , "lagged_fibonacci19937" + , "lagged_fibonacci2281" + , "lagged_fibonacci23209" + , "lagged_fibonacci3217" + , "lagged_fibonacci4423" + , "lagged_fibonacci44497" + , "lagged_fibonacci607" + , "lagged_fibonacci9689" + , "minstd_rand" + , "minstd_rand0" + , "mt11213b" + , "mt19937" + , "ranlux3" + , "ranlux3_01" + , "ranlux4" + , "ranlux4_01" + , "ranlux64_3_01" + , "ranlux64_4_01" + , "taus88" ] + + self.no_min_max = [ 'py_cauchy_distribution' + , 'py_bernoulli_distribution' + , 'py_binomial_distribution' + , 'py_poisson_distribution' + , 'py_normal_distribution' + , 'py_gamma_distribution' + , 'py_triangle_distribution' + , 'py_uniform_on_sphere' + , 'py_exponential_distribution' + , 'py_geometric_distribution' + , 'py_lognormal_distribution' + ] + def typedef2class( self, scope, name ): + typedef = scope.typedef( name ) + return typedef.type.declaration + def filter_declarations(self ): self.__mb.global_ns.exclude() - boost_ns = self.__mb.global_ns.namespace( 'boost', recursive=False ) - boost_ns.namespace( 'random' ).include() - boost_ns.namespaces( 'detail' ).exclude() - for cls in boost_ns.namespace( 'random' ).classes(): - if cls.ignore: - continue - if cls.name.startswith( 'const_mod' ): - cls.exclude() - continue - aliases = set([ t.name for t in cls.typedefs ]) - for alias in [ 'engine_value_type', 'value_type', 'base_type', 'engine_type' ]: - if alias in aliases: - aliases.remove( alias ) - if len( aliases ) == 1: - cls.alias = list( aliases )[0] - else: - print cls.name - for t in aliases: - print ' ', t - if cls.alias == 'ecuyer1988': - seed = cls.member_function( 'seed', arg_types=[None, None] ) - seed.exclude() + boost_ns = self.__mb.global_ns.namespace( 'boost', recursive=False ) + for name in self.generators: + gen_cls = self.typedef2class( boost_ns, name ) + gen_cls.include() + #TODO: find out why compiler complains + gen_cls.member_functions( 'seed' ).create_with_signature = True + + pyimpl_ns = boost_ns.namespace( 'pyimpl' ) + helpers = pyimpl_ns.classes( lambda decl: decl.name.startswith( 'py_') ) + helpers.include() + for helper in helpers: + distrib_cls = self.typedef2class( helper, "distribution" ) + distrib_cls.include() + var_gen_typedefs = helper.typedefs( lambda decl: decl.name.startswith( 'variate_generator_' ) ) + for var_gen_typedef in var_gen_typedefs: + var_gen_cls = var_gen_typedef.type.declaration + var_gen_cls.include() + var_gen_cls.member_operators( symbol='()' ).create_with_signature = True + if helper.name in self.no_min_max: + var_gen_cls.member_function( 'max' ).exclude() + var_gen_cls.member_function( 'min' ).exclude() - boost_ns.free_functions( "lessthan_signed_unsigned" ).exclude() - boost_ns.free_functions( "equal_signed_unsigned" ).exclude() + ecuyer1988 = self.typedef2class( boost_ns, 'ecuyer1988' ) + ecuyer1988.member_function( 'seed', arg_types=[None, None] ).exclude() - def beautify_code( self ): - extmodule = self.__mb.code_creator - position = extmodule.last_include_index() + 1 - extmodule.adopt_creator( code_creators.namespace_using_t( 'boost' ) - , position ) - self.__mb.calldefs().create_with_signature = True + def prepare_declarations( self ): + boost_ns = self.__mb.namespace( 'boost' ) + for name in self.generators: + gen_cls = self.typedef2class( boost_ns, name ) + gen_cls.alias = name + + pyimpl_ns = boost_ns.namespace( 'pyimpl' ) + helpers = pyimpl_ns.classes( lambda decl: decl.name.startswith( 'py_') ) + for helper in helpers: + distrib_cls = self.typedef2class( helper, "distribution" ) + distrib_cls.alias = helper.name[3:] #py_ + var_gen_typedefs = helper.typedefs( lambda decl: decl.name.startswith( 'variate_generator_' ) ) + for var_gen_typedef in var_gen_typedefs: + var_gen_cls = var_gen_typedef.type.declaration + var_gen_cls.alias = var_gen_typedef.name + '__' + distrib_cls.alias + + self.set_call_policies() + + def set_call_policies( self ): + boost_ns = self.__mb.namespace( 'boost' ) + engine_funcs = boost_ns.member_functions( name="engine" + , function=lambda decl: not decl.has_const ) + engine_funcs.call_policies = call_policies.return_internal_reference() + + distribution_funcs = boost_ns.member_functions( name="distribution" + , function=lambda decl: not decl.has_const ) + distribution_funcs.call_policies = call_policies.return_internal_reference() + + - def replace_include_directives( self ): - extmodule = self.__mb.code_creator - includes = filter( lambda creator: isinstance( creator, code_creators.include_t ) - , extmodule.creators ) - includes = includes[1:] #all includes except boost\python.hpp - map( lambda creator: extmodule.remove_creator( creator ), includes ) - for include_header in ['boost/random.hpp', 'boost/nondet_random.hpp' ]: - extmodule.adopt_include( code_creators.include_t( header=include_header ) ) - def customize_extmodule( self ): global LICENSE extmodule = self.__mb.code_creator @@ -87,21 +142,16 @@ extmodule.user_defined_directories.append( random_settings.working_dir ) extmodule.user_defined_directories.append( random_settings.generated_files_dir ) extmodule.precompiled_header = 'boost/python.hpp' - self.replace_include_directives() - self.beautify_code( ) - -#include "boost/random.hpp" -#include "boost/nondet_random.hpp" - + extmodule.replace_included_headers( ['boost/random.hpp', 'boost/nondet_random.hpp', 'random_export.hpp' ] ) - def write_files( self ): - self.__mb.write_module( os.path.join( random_settings.generated_files_dir, 'random.pypp.cpp' ) ) + #self.__mb.write_module( os.path.join( random_settings.generated_files_dir, 'random.pypp.cpp' ) ) + self.__mb.split_module( random_settings.generated_files_dir ) def create(self): start_time = time.clock() self.filter_declarations() - + self.prepare_declarations() self.__mb.build_code_creator( random_settings.module_name ) self.customize_extmodule() Modified: pyplusplus_dev/examples/pyboost_dev/pyboost/random/sconscript =================================================================== --- pyplusplus_dev/examples/pyboost_dev/pyboost/random/sconscript 2006-05-17 05:45:42 UTC (rev 105) +++ pyplusplus_dev/examples/pyboost_dev/pyboost/random/sconscript 2006-05-17 05:54:23 UTC (rev 106) @@ -26,7 +26,7 @@ , random_settings.module_name + random_settings.scons.suffix ) local_env = env.Copy() -local_env.Append( CPPPATH=[ random_settings.generated_files_dir ] ) +local_env.Append( CPPPATH=[ random_settings.working_dir, random_settings.generated_files_dir ] ) local_env.Append( CCFLAGS=get_ccflags() ) _random_ = local_env.SharedLibrary( target=random_settings.module_name Modified: pyplusplus_dev/examples/pyboost_dev/pyboost/rational/generate_code.py =================================================================== --- pyplusplus_dev/examples/pyboost_dev/pyboost/rational/generate_code.py 2006-05-17 05:45:42 UTC (rev 105) +++ pyplusplus_dev/examples/pyboost_dev/pyboost/rational/generate_code.py 2006-05-17 05:54:23 UTC (rev 106) @@ -59,6 +59,11 @@ self.__mb.free_function( 'lcm<long>' ).include() self.__mb.free_function( 'gcd<long>' ).include() + self.__mb.free_function( 'rational_cast<double, long>' ).include() + self.__mb.free_function( 'rational_cast<double, long>' ).alias = 'to_double' + self.__mb.free_function( 'rational_cast<long, long>' ).include() + self.__mb.free_function( 'rational_cast<long, long>' ).alias = 'to_long' + self.__mb.free_function( 'abs<long>' ).include() def prepare_decls( self ): self.__mb.class_('rational<long>').alias = 'rational' Modified: pyplusplus_dev/examples/pyboost_dev/pyboost/rational/rational_export.hpp =================================================================== --- pyplusplus_dev/examples/pyboost_dev/pyboost/rational/rational_export.hpp 2006-05-17 05:45:42 UTC (rev 105) +++ pyplusplus_dev/examples/pyboost_dev/pyboost/rational/rational_export.hpp 2006-05-17 05:54:23 UTC (rev 106) @@ -16,6 +16,9 @@ sizeof( pyrational ); boost::gcd<long int>( 1, 1); boost::lcm<long int>( 1, 1); + boost::abs( pyrational(1) ); + boost::rational_cast<double>( pyrational(1) ); + boost::rational_cast<long int>( pyrational(1) ); } } } Modified: pyplusplus_dev/examples/pyboost_dev/unittests/rational/__init__.py =================================================================== --- pyplusplus_dev/examples/pyboost_dev/unittests/rational/__init__.py 2006-05-17 05:45:42 UTC (rev 105) +++ pyplusplus_dev/examples/pyboost_dev/unittests/rational/__init__.py 2006-05-17 05:54:23 UTC (rev 106) @@ -10,3 +10,7 @@ from _rational_ import lcm from _rational_ import gcd +rational.__abs__ = _rational_.abs +rational.__float__ = _rational_.to_double +rational.__long__ = _rational_.to_long +rational.__int__ = _rational_.to_long \ No newline at end of file Modified: pyplusplus_dev/examples/pyboost_dev/unittests/rational/unittests/test_all.py =================================================================== --- pyplusplus_dev/examples/pyboost_dev/unittests/rational/unittests/test_all.py 2006-05-17 05:45:42 UTC (rev 105) +++ pyplusplus_dev/examples/pyboost_dev/unittests/rational/unittests/test_all.py 2006-05-17 05:54:23 UTC (rev 106) @@ -9,7 +9,6 @@ import rational import unittest - class tester_t( unittest.TestCase ): def __init__( self, *args ): unittest.TestCase.__init__( self, *args ) @@ -72,6 +71,20 @@ self.failUnless( lcm(-10, -10) ==10 ) self.failUnless( lcm( 25, -10) ==50 ) + def test_abs( self ): + pyrational = rational.rational + + self.failUnless( abs( pyrational( 28, 7) ) == pyrational( 28, 7) ) + self.failUnless( abs( pyrational( -28, 7) ) == pyrational( 28, 7) ) + self.failUnless( abs( pyrational( 28, -7) ) == pyrational( 28, 7) ) + + def test_conversion( self ): + pyrational = rational.rational + + half = pyrational( 1, 2 ) + self.failUnless( float(half) == 0.5 ) + self.failUnless( int(half) == 0 ) + def create_suite(): suite = unittest.TestSuite() suite.addTest( unittest.makeSuite(tester_t) ) Modified: pyplusplus_dev/examples/pyeasybmp_dev/pyeasybmp/generate_code.py =================================================================== --- pyplusplus_dev/examples/pyeasybmp_dev/pyeasybmp/generate_code.py 2006-05-17 05:45:42 UTC (rev 105) +++ pyplusplus_dev/examples/pyeasybmp_dev/pyeasybmp/generate_code.py 2006-05-17 05:54:23 UTC (rev 106) @@ -6,7 +6,6 @@ import os from environment import settings -from pyplusplus import code_creators from pyplusplus import module_builder @@ -36,7 +35,7 @@ mb.code_creator.license = license mb.code_creator.user_defined_directories.append( settings.easybmp_path ) mb.code_creator.precompiled_header = 'boost/python.hpp' - mb.code_creator.adopt_creator( code_creators.include_t( header=header_file ), 2 ) + mb.code_creator.replace_included_headers( [header_file] ) mb.write_module( os.path.join( settings.generated_files_dir, settings.module_name + '.cpp') ) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rom...@us...> - 2006-05-17 05:45:51
|
Revision: 105 Author: roman_yakovenko Date: 2006-05-16 22:45:42 -0700 (Tue, 16 May 2006) ViewCVS: http://svn.sourceforge.net/pygccxml/?rev=105&view=rev Log Message: ----------- rename of class_t.typedefs property to "aliases" adding new functions to module_t code creator Modified Paths: -------------- pyplusplus_dev/pyplusplus/code_creators/module.py pyplusplus_dev/pyplusplus/decl_wrappers/decl_wrapper.py Modified: pyplusplus_dev/pyplusplus/code_creators/module.py =================================================================== --- pyplusplus_dev/pyplusplus/code_creators/module.py 2006-05-17 05:39:04 UTC (rev 104) +++ pyplusplus_dev/pyplusplus/code_creators/module.py 2006-05-17 05:45:42 UTC (rev 105) @@ -191,7 +191,10 @@ code = compound.compound_t.create_internal_code( self.creators[index:] ) code = self.unindent(code) return os.linesep.join( includes ) + 2 * os.linesep + code + os.linesep - + + def add_include( self, header ): + self.adopt_include( include.include_t( header=header ) ) + def add_namespace_usage( self, namespace_name ): self.adopt_creator( namespace.namespace_using_t( 'boost' ) , self.last_include_index() + 1 ) Modified: pyplusplus_dev/pyplusplus/decl_wrappers/decl_wrapper.py =================================================================== --- pyplusplus_dev/pyplusplus/decl_wrappers/decl_wrapper.py 2006-05-17 05:39:04 UTC (rev 104) +++ pyplusplus_dev/pyplusplus/decl_wrappers/decl_wrapper.py 2006-05-17 05:45:42 UTC (rev 105) @@ -47,8 +47,8 @@ if not self._alias: if declarations.templates.is_instantiation( self.name ): if isinstance( self, declarations.class_t ) \ - and 1 == len( set( map( lambda typedef: typedef.name, self.typedefs ) ) ): - self._alias = self.typedefs[0].name + and 1 == len( set( map( lambda typedef: typedef.name, self.aliases ) ) ): + self._alias = self.aliases[0].name else: self._alias = self._generate_valid_name() else: This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rom...@us...> - 2006-05-17 05:39:19
|
Revision: 104 Author: roman_yakovenko Date: 2006-05-16 22:39:04 -0700 (Tue, 16 May 2006) ViewCVS: http://svn.sourceforge.net/pygccxml/?rev=104&view=rev Log Message: ----------- rename of class_t.typedefs property to "aliases" adding 2 new select functions: typedef and typedefs Modified Paths: -------------- pygccxml_dev/pygccxml/declarations/__init__.py pygccxml_dev/pygccxml/declarations/class_declaration.py pygccxml_dev/pygccxml/declarations/decl_printer.py pygccxml_dev/pygccxml/declarations/scopedef.py pygccxml_dev/pygccxml/parser/patcher.py pygccxml_dev/pygccxml/parser/project_reader.py pygccxml_dev/pygccxml/parser/source_reader.py pygccxml_dev/unittests/typedefs_tester.py Modified: pygccxml_dev/pygccxml/declarations/__init__.py =================================================================== --- pygccxml_dev/pygccxml/declarations/__init__.py 2006-05-16 19:33:24 UTC (rev 103) +++ pygccxml_dev/pygccxml/declarations/__init__.py 2006-05-17 05:39:04 UTC (rev 104) @@ -196,6 +196,7 @@ impl_decl_types[ scopedef.scopedef_t.calldef ] = calldef_t impl_matchers[ scopedef.scopedef_t.operator ] = operator_matcher_t +impl_decl_types[ scopedef.scopedef_t.operator ] = operator_t impl_matchers[ scopedef.scopedef_t.member_function ] = calldef_matcher_t impl_decl_types[ scopedef.scopedef_t.member_function ] = member_function_t @@ -215,6 +216,10 @@ impl_matchers[ scopedef.scopedef_t.enumeration ] = declaration_matcher_t impl_decl_types[ scopedef.scopedef_t.enumeration ] = enumeration_t +impl_matchers[ scopedef.scopedef_t.typedef ] = declaration_matcher_t +impl_decl_types[ scopedef.scopedef_t.typedef ] = typedef_t + + impl_matchers[ namespace_t.namespace ] = namespace_matcher_t impl_matchers[ namespace_t.free_function ] = calldef_matcher_t Modified: pygccxml_dev/pygccxml/declarations/class_declaration.py =================================================================== --- pygccxml_dev/pygccxml/declarations/class_declaration.py 2006-05-16 19:33:24 UTC (rev 103) +++ pygccxml_dev/pygccxml/declarations/class_declaration.py 2006-05-17 05:39:04 UTC (rev 104) @@ -98,7 +98,7 @@ self._public_members = [] self._private_members = [] self._protected_members = [] - self._typedefs = [] + self._aliases = [] def _get_name_impl( self ): if class_t.USE_DEMANGLED_AS_NAME and self.demangled: @@ -221,12 +221,12 @@ protected_members = property( _get_protected_members, _set_protected_members , doc="list of all protected L{members<declaration_t>}" ) - def _get_typedefs(self): - return self._typedefs - def _set_typedefs( self, new_typedefs ): - self._typedefs = new_typedefs - typedefs = property( _get_typedefs, _set_typedefs - , doc="List of aliases/typedefs to this instance") + def _get_aliases(self): + return self._aliases + def _set_aliases( self, new_aliases ): + self._aliases = new_aliases + aliases = property( _get_aliases, _set_aliases + , doc="List of L{aliases<typedef_t>} to this instance") def _get_declarations_impl(self): return self.get_members() Modified: pygccxml_dev/pygccxml/declarations/decl_printer.py =================================================================== --- pygccxml_dev/pygccxml/declarations/decl_printer.py 2006-05-16 19:33:24 UTC (rev 103) +++ pygccxml_dev/pygccxml/declarations/decl_printer.py 2006-05-17 05:39:04 UTC (rev 104) @@ -129,8 +129,8 @@ class_type = 'class type: ' + "'%s'" % str(self.__inst.class_type) self.writer( ' ' * curr_level * self.INDENT_SIZE + class_type.ljust( self.JUSTIFY ) + os.linesep ) - if self.__inst.typedefs: - aliases = map( lambda typedef: typedef.name, self.__inst.typedefs ) + if self.__inst.aliases: + aliases = map( lambda typedef: typedef.name, self.__inst.aliases ) msg = 'aliases: ' + `aliases` self.writer( ' ' * curr_level * self.INDENT_SIZE + msg.ljust( self.JUSTIFY ) + os.linesep ) Modified: pygccxml_dev/pygccxml/declarations/scopedef.py =================================================================== --- pygccxml_dev/pygccxml/declarations/scopedef.py 2006-05-16 19:33:24 UTC (rev 103) +++ pygccxml_dev/pygccxml/declarations/scopedef.py 2006-05-17 05:39:04 UTC (rev 104) @@ -524,3 +524,23 @@ , allow_empty=allow_empty) #adding small aliase enums = enumerations + + def typedef( self, name=None, function=None, header_dir=None, header_file=None, recursive=None ): + """Finds any declaration by criteria. Please see L{scopedef_t} for full explanation.""" + return self._find_single( self._impl_matchers[ scopedef_t.typedef ] + , name=name + , function=function + , decl_type=self._impl_decl_types[ scopedef_t.typedef ] + , header_dir=header_dir + , header_file=header_file + , recursive=recursive) + + def typedefs( self, name=None, function=None, header_dir=None, header_file=None, recursive=None, allow_empty=None ): + return self._find_multiple( self._impl_matchers[ scopedef_t.typedef ] + , name=name + , function=function + , decl_type=self._impl_decl_types[ scopedef_t.typedef ] + , header_dir=header_dir + , header_file=header_file + , recursive=recursive + , allow_empty=allow_empty) \ No newline at end of file Modified: pygccxml_dev/pygccxml/parser/patcher.py =================================================================== --- pygccxml_dev/pygccxml/parser/patcher.py 2006-05-16 19:33:24 UTC (rev 103) +++ pygccxml_dev/pygccxml/parser/patcher.py 2006-05-17 05:39:04 UTC (rev 104) @@ -147,7 +147,7 @@ decl = base_type.declaration return decl.name == name \ or ( isinstance( decl, declarations.class_t ) \ - and name in map( lambda typedef: typedef.name, decl.typedefs ) ) + and name in map( lambda typedef: typedef.name, decl.aliases ) ) def __fix_constructor_call( self, func, arg ): call_invocation = declarations.call_invocation @@ -160,7 +160,7 @@ if decl.name != name: #we have some alias to the class relevant_typedefs = filter( lambda typedef: typedef.name == name - , decl.typedefs ) + , decl.aliases ) if 1 == len( relevant_typedefs ): f_q_name = self.__join_names( declarations.full_name( relevant_typedefs[0].parent ) , name ) Modified: pygccxml_dev/pygccxml/parser/project_reader.py =================================================================== --- pygccxml_dev/pygccxml/parser/project_reader.py 2006-05-16 19:33:24 UTC (rev 103) +++ pygccxml_dev/pygccxml/parser/project_reader.py 2006-05-17 05:39:04 UTC (rev 104) @@ -252,7 +252,7 @@ if config.verbose: logger.info( "Relinking declared types ..." ) self._relink_declarated_types( leaved_classes, types ) - source_reader.bind_typedefs( pygccxml.declarations.make_flatten( answer ) ) + source_reader.bind_aliases( pygccxml.declarations.make_flatten( answer ) ) return answer def __parse_all_at_once(self, files): Modified: pygccxml_dev/pygccxml/parser/source_reader.py =================================================================== --- pygccxml_dev/pygccxml/parser/source_reader.py 2006-05-16 19:33:24 UTC (rev 103) +++ pygccxml_dev/pygccxml/parser/source_reader.py 2006-05-17 05:39:04 UTC (rev 104) @@ -19,7 +19,7 @@ RuntimeError.__init__( self, msg ) -def bind_typedefs( decls ): +def bind_aliases( decls ): """ This function binds between class and it's typedefs. @@ -40,8 +40,8 @@ continue if id( cls_inst ) not in visited: visited.add( id( cls_inst ) ) - del cls_inst.typedefs[:] - cls_inst.typedefs.append( decl ) + del cls_inst.aliases[:] + cls_inst.aliases.append( decl ) class source_reader_t: def __init__( self, config, cache=None, decl_factory=None ): @@ -253,7 +253,7 @@ for decl in decls.itervalues(): linker_.instance = decl apply_visitor( linker_, decl ) - bind_typedefs( decls.itervalues() ) + bind_aliases( decls.itervalues() ) decls = filter( lambda inst: isinstance(inst, declaration_t) and not inst.parent, decls.itervalues() ) #some times gccxml report typedefs defined in no namespace #it happens for example in next situation Modified: pygccxml_dev/unittests/typedefs_tester.py =================================================================== --- pygccxml_dev/unittests/typedefs_tester.py 2006-05-16 19:33:24 UTC (rev 103) +++ pygccxml_dev/unittests/typedefs_tester.py 2006-05-17 05:39:04 UTC (rev 104) @@ -30,8 +30,8 @@ def test( self ): item_cls = self.global_ns.class_( name='item_t' ) self.failUnless( item_cls, "unable to find class 'item_t'" ) - self.failUnless( len( item_cls.typedefs ) == 1 ) - self.failUnless( item_cls.typedefs[0].name == 'Item' ) + self.failUnless( len( item_cls.aliases ) == 1 ) + self.failUnless( item_cls.aliases[0].name == 'Item' ) class tester_prj_t( parser_test_case.parser_test_case_t ): @@ -52,9 +52,9 @@ , type=declarations.class_t , name='item_t' ) self.failUnless( item_cls, "unable to find class 'item_t'" ) - self.failUnless( len( item_cls.typedefs ) == 3 ) + self.failUnless( len( item_cls.aliases ) == 3 ) expected_aliases = set( ['Item', 'Item1', 'Item2' ] ) - real_aliases = set( map( lambda typedef: typedef.name, item_cls.typedefs ) ) + real_aliases = set( map( lambda typedef: typedef.name, item_cls.aliases ) ) self.failUnless( real_aliases == expected_aliases ) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rom...@us...> - 2006-05-16 19:33:32
|
Revision: 103 Author: roman_yakovenko Date: 2006-05-16 12:33:24 -0700 (Tue, 16 May 2006) ViewCVS: http://svn.sourceforge.net/pygccxml/?rev=103&view=rev Log Message: ----------- improving log functionality of base file writer. Modified Paths: -------------- pyplusplus_dev/pyplusplus/file_writers/writer.py Modified: pyplusplus_dev/pyplusplus/file_writers/writer.py =================================================================== --- pyplusplus_dev/pyplusplus/file_writers/writer.py 2006-05-16 19:31:47 UTC (rev 102) +++ pyplusplus_dev/pyplusplus/file_writers/writer.py 2006-05-16 19:33:24 UTC (rev 103) @@ -55,6 +55,7 @@ @param content: The content of the file @type content: str """ + fname = os.path.split( fpath )[1] _logging_.logger.debug( 'write code to file "%s" - started' % fpath ) start_time = time.clock() fcontent_new = [] @@ -80,6 +81,6 @@ f = file( fpath, 'w+b' ) f.write( fcontent_new ) f.close() - _logging_.logger.debug( 'write code - done( %f seconds )' % ( time.clock() - start_time ) ) + _logging_.logger.info( 'file "%s" - updated( %f seconds )' % ( fname, time.clock() - start_time ) ) write_file = staticmethod( write_file ) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rom...@us...> - 2006-05-16 19:31:53
|
Revision: 102 Author: roman_yakovenko Date: 2006-05-16 12:31:47 -0700 (Tue, 16 May 2006) ViewCVS: http://svn.sourceforge.net/pygccxml/?rev=102&view=rev Log Message: ----------- adding new convinience function - set_logger_level This function will adjust pygccxml and pyplusplus loggers to desired level. Modified Paths: -------------- pyplusplus_dev/pyplusplus/module_builder/__init__.py Modified: pyplusplus_dev/pyplusplus/module_builder/__init__.py =================================================================== --- pyplusplus_dev/pyplusplus/module_builder/__init__.py 2006-05-16 19:30:08 UTC (rev 101) +++ pyplusplus_dev/pyplusplus/module_builder/__init__.py 2006-05-16 19:31:47 UTC (rev 102) @@ -45,4 +45,11 @@ from pyplusplus.decl_wrappers import print_declarations -import call_policies \ No newline at end of file +import call_policies + +from pygccxml import utils as __pygccxml_utils +from pyplusplus import _logging_ as __pyplusplus_logging + +def set_logger_level( level ): + __pygccxml_utils.logger.setLevel( level ) + __pyplusplus_logging.logger.setLevel( level ) \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rom...@us...> - 2006-05-16 19:30:13
|
Revision: 101 Author: roman_yakovenko Date: 2006-05-16 12:30:08 -0700 (Tue, 16 May 2006) ViewCVS: http://svn.sourceforge.net/pygccxml/?rev=101&view=rev Log Message: ----------- Commiting Allen patch. Now module_builder_t.print_declarations has a full set of argument decl_printer supports Modified Paths: -------------- pyplusplus_dev/pyplusplus/module_builder/builder.py Modified: pyplusplus_dev/pyplusplus/module_builder/builder.py =================================================================== --- pyplusplus_dev/pyplusplus/module_builder/builder.py 2006-05-15 07:14:23 UTC (rev 100) +++ pyplusplus_dev/pyplusplus/module_builder/builder.py 2006-05-16 19:30:08 UTC (rev 101) @@ -135,7 +135,7 @@ map( lambda calldef: calldef.set_call_policies( call_policies_resolver( calldef ) ) , calldefs ) - def print_declarations(self, decl=None): + def print_declarations(self, decl=None, detailed=True, recursive=True, writer=sys.stdout.write): """ This function will print detailed description of all declarations or some specific one. @@ -145,7 +145,7 @@ """ if None is decl: decl = self.global_ns - decl_wrappers.print_declarations( decl ) + decl_wrappers.print_declarations( decl, detailed, recursive, writer ) def build_code_creator( self , module_name This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rom...@us...> - 2006-05-15 07:14:28
|
Revision: 100 Author: roman_yakovenko Date: 2006-05-15 00:14:23 -0700 (Mon, 15 May 2006) ViewCVS: http://svn.sourceforge.net/pygccxml/?rev=100&view=rev Log Message: ----------- adding rational library Modified Paths: -------------- pyplusplus_dev/examples/pyboost_dev/sconstruct Modified: pyplusplus_dev/examples/pyboost_dev/sconstruct =================================================================== --- pyplusplus_dev/examples/pyboost_dev/sconstruct 2006-05-15 07:14:06 UTC (rev 99) +++ pyplusplus_dev/examples/pyboost_dev/sconstruct 2006-05-15 07:14:23 UTC (rev 100) @@ -19,4 +19,5 @@ Export( 'env' ) env.SConscript( ['pyboost/date_time/sconscript'] ) env.SConscript( ['pyboost/crc/sconscript'] ) -env.SConscript( ['pyboost/random/sconscript'] ) \ No newline at end of file +env.SConscript( ['pyboost/random/sconscript'] ) +env.SConscript( ['pyboost/rational/sconscript'] ) \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rom...@us...> - 2006-05-15 07:14:14
|
Revision: 99 Author: roman_yakovenko Date: 2006-05-15 00:14:06 -0700 (Mon, 15 May 2006) ViewCVS: http://svn.sourceforge.net/pygccxml/?rev=99&view=rev Log Message: ----------- adding rational library Added Paths: ----------- pyplusplus_dev/examples/pyboost_dev/unittests/rational/ pyplusplus_dev/examples/pyboost_dev/unittests/rational/__init__.py pyplusplus_dev/examples/pyboost_dev/unittests/rational/unittests/ pyplusplus_dev/examples/pyboost_dev/unittests/rational/unittests/test_all.py Added: pyplusplus_dev/examples/pyboost_dev/unittests/rational/__init__.py =================================================================== --- pyplusplus_dev/examples/pyboost_dev/unittests/rational/__init__.py (rev 0) +++ pyplusplus_dev/examples/pyboost_dev/unittests/rational/__init__.py 2006-05-15 07:14:06 UTC (rev 99) @@ -0,0 +1,12 @@ +#! /usr/bin/python +# Copyright 2004 Roman Yakovenko. +# Distributed under the Boost Software License, Version 1.0. (See +# accompanying file LICENSE_1_0.txt or copy at +# http://www.boost.org/LICENSE_1_0.txt) + +import _rational_ + +from _rational_ import rational +from _rational_ import lcm +from _rational_ import gcd + Added: pyplusplus_dev/examples/pyboost_dev/unittests/rational/unittests/test_all.py =================================================================== --- pyplusplus_dev/examples/pyboost_dev/unittests/rational/unittests/test_all.py (rev 0) +++ pyplusplus_dev/examples/pyboost_dev/unittests/rational/unittests/test_all.py 2006-05-15 07:14:06 UTC (rev 99) @@ -0,0 +1,84 @@ +# Copyright 2004 Roman Yakovenko. +# Distributed under the Boost Software License, Version 1.0. (See +# accompanying file LICENSE_1_0.txt or copy at +# http://www.boost.org/LICENSE_1_0.txt) + +import sys +sys.path.append( '../..' ) + +import rational +import unittest + + +class tester_t( unittest.TestCase ): + def __init__( self, *args ): + unittest.TestCase.__init__( self, *args ) + + def test_rational(self): + pyrational = rational.rational + + self.failUnless( pyrational( 28, 7) == 4 ) + self.failUnless( pyrational( 28, 7) == pyrational( 4 ) ) + + r1 = pyrational( 5, 7 ) + + r1 += pyrational( 4, 11 ) + r2 = pyrational( 5*11 + 7*4, 7*11 ) + self.failUnless( r1 == r2 ) + + r1 -= pyrational( 5, 7) + self.failUnless( r1 == pyrational( 4, 11) ) + + r1 *= 2 + self.failUnless( r1 == pyrational( 8, 11) ) + + r1 /= 3 + self.failUnless( r1 == pyrational( 8, 33) ) + + r2 = not r1 + self.failUnless( r2 == False ) + + self.failUnless( 0 < r1 ) + + def test_gcd( self ): + gcd = rational.gcd + self.failUnless( gcd( 1, -1) == 1 ) + self.failUnless( gcd( -1, 1) == 1 ) + self.failUnless( gcd( 1, 1) == 1 ) + self.failUnless( gcd( -1, -1) == 1 ) + self.failUnless( gcd( 0, 0) == 0 ) + self.failUnless( gcd( 7, 0) == 7 ) + self.failUnless( gcd( 0, 9) == 9 ) + self.failUnless( gcd( -7, 0) == 7 ) + self.failUnless( gcd( 0, -9) == 9 ) + self.failUnless( gcd( 42, 30) == 6 ) + self.failUnless( gcd( 6, -9) == 3 ) + self.failUnless( gcd(-10, -10) ==10 ) + self.failUnless( gcd(-25, -10) == 5 ) + + def test_lcm( self ): + lcm = rational.lcm + self.failUnless( lcm( 1, -1) == 1 ) + self.failUnless( lcm( -1, 1) == 1 ) + self.failUnless( lcm( 1, 1) == 1 ) + self.failUnless( lcm( -1, -1) == 1 ) + self.failUnless( lcm( 0, 0) == 0 ) + self.failUnless( lcm( 6, 0) == 0 ) + self.failUnless( lcm( 0, 7) == 0 ) + self.failUnless( lcm( -5, 0) == 0 ) + self.failUnless( lcm( 0, -4) == 0 ) + self.failUnless( lcm( 18, 30) ==90 ) + self.failUnless( lcm( -6, 9) ==18 ) + self.failUnless( lcm(-10, -10) ==10 ) + self.failUnless( lcm( 25, -10) ==50 ) + +def create_suite(): + suite = unittest.TestSuite() + suite.addTest( unittest.makeSuite(tester_t) ) + return suite + +def run_suite(): + unittest.TextTestRunner(verbosity=2).run( create_suite() ) + +if __name__ == "__main__": + run_suite() This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rom...@us...> - 2006-05-15 07:13:10
|
Revision: 98 Author: roman_yakovenko Date: 2006-05-15 00:13:04 -0700 (Mon, 15 May 2006) ViewCVS: http://svn.sourceforge.net/pygccxml/?rev=98&view=rev Log Message: ----------- switching to new convinience functions Modified Paths: -------------- pyplusplus_dev/examples/pyboost_dev/pyboost/crc/generate_code.py Modified: pyplusplus_dev/examples/pyboost_dev/pyboost/crc/generate_code.py =================================================================== --- pyplusplus_dev/examples/pyboost_dev/pyboost/crc/generate_code.py 2006-05-15 07:11:24 UTC (rev 97) +++ pyplusplus_dev/examples/pyboost_dev/pyboost/crc/generate_code.py 2006-05-15 07:13:04 UTC (rev 98) @@ -12,7 +12,6 @@ import crc_settings from pygccxml import parser from pygccxml import declarations -from pyplusplus import code_creators from pyplusplus import module_builder LICENSE = """// Copyright 2004 Roman Yakovenko. @@ -23,8 +22,6 @@ class code_generator_t(object): def __init__(self): - #self.__file = os.path.join( crc_settings.boost.include - #,'libs', 'crc', 'crc_test.cpp' ) self.__file = os.path.join( crc_settings.working_dir, 'crc_export.hpp' ) self.__mb = module_builder.module_builder_t( @@ -44,7 +41,7 @@ boost_ns.member_functions( 'process_bytes' ).exclude() boost_ns.member_functions( 'process_block' ).exclude() - def prepare_decls( self ): + def prepare_declarations( self ): boost_ns = self.__mb.namespace( 'boost' ) classes = boost_ns.classes( lambda decl: decl.name.startswith( 'crc_basic' ) ) classes.always_expose_using_scope = True @@ -72,21 +69,7 @@ cls.alias = 'slow_crc_type' else: print 'no alias for class ', cls.name - def beautify_code( self ): - extmodule = self.__mb.code_creator - position = extmodule.last_include_index() + 1 - extmodule.adopt_creator( code_creators.namespace_using_t( 'boost' ) - , position ) - self.__mb.calldefs().create_with_signature = True - - def replace_include_directives( self ): - extmodule = self.__mb.code_creator - includes = filter( lambda creator: isinstance( creator, code_creators.include_t ) - , extmodule.creators ) - includes = includes[1:] #all includes except boost\python.hpp - map( lambda creator: extmodule.remove_creator( creator ), includes ) - extmodule.adopt_include( code_creators.include_t( header='boost/crc.hpp' ) ) - + def customize_extmodule( self ): global LICENSE extmodule = self.__mb.code_creator @@ -96,8 +79,8 @@ extmodule.user_defined_directories.append( crc_settings.working_dir ) extmodule.user_defined_directories.append( crc_settings.generated_files_dir ) extmodule.precompiled_header = 'boost/python.hpp' - self.replace_include_directives() - self.beautify_code( ) + self.__mb.code_creator.replace_included_headers( ['boost/crc.hpp'] ) + #self.__mb.code_creator.add_namespace_usage( 'boost' ) def write_files( self ): self.__mb.write_module( os.path.join( crc_settings.generated_files_dir, 'crc.pypp.cpp' ) ) @@ -106,7 +89,7 @@ start_time = time.clock() self.filter_declarations() - self.prepare_decls() + self.prepare_declarations() self.__mb.build_code_creator( crc_settings.module_name ) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rom...@us...> - 2006-05-15 07:11:36
|
Revision: 97 Author: roman_yakovenko Date: 2006-05-15 00:11:24 -0700 (Mon, 15 May 2006) ViewCVS: http://svn.sourceforge.net/pygccxml/?rev=97&view=rev Log Message: ----------- switching to new convinience functions Modified Paths: -------------- pyplusplus_dev/examples/pyboost_dev/pyboost/date_time/generate_code.py pyplusplus_dev/examples/pyboost_dev/pyboost/date_time/include/date_time.pypp.xml Modified: pyplusplus_dev/examples/pyboost_dev/pyboost/date_time/generate_code.py =================================================================== --- pyplusplus_dev/examples/pyboost_dev/pyboost/date_time/generate_code.py 2006-05-15 07:10:41 UTC (rev 96) +++ pyplusplus_dev/examples/pyboost_dev/pyboost/date_time/generate_code.py 2006-05-15 07:11:24 UTC (rev 97) @@ -10,10 +10,9 @@ import time import shutil import date_time_settings +import customization_data from pygccxml import parser from pygccxml import declarations -from pyplusplus import code_creators -import customization_data from pyplusplus import module_builder class code_generator_t(object): @@ -115,15 +114,6 @@ tdi_init = tdi.constructor( arg_types=[None, None, None, None], recursive=False) tdi_init.ignore=True - def replace_include_directives( self, mb ): - extmodule = mb.code_creator - includes = filter( lambda creator: isinstance( creator, code_creators.include_t ) - , extmodule.creators ) - includes = includes[1:] #all includes except boost\python.hpp - map( lambda creator: extmodule.remove_creator( creator ), includes ) - for include_header in customization_data.includes: - extmodule.adopt_include( code_creators.include_t( header=include_header ) ) - def add_code( self, mb ): as_number_template = 'def( "as_number", &%(class_def)s::operator %(class_def)s::value_type, bp::default_call_policies() )' @@ -147,36 +137,27 @@ def beautify_code( self, mb ): extmodule = mb.code_creator - position = extmodule.last_include_index() + 1 - extmodule.adopt_creator( code_creators.namespace_using_t( 'boost' ) - , position ) - position += 1 - extmodule.adopt_creator( code_creators.namespace_using_t( 'boost::date_time' ) - , position ) - position += 1 - + extmodule.add_namespace_usage( 'boost' ) + extmodule.add_namespace_usage( 'boost::date_time' ) for full_ns_name, alias in customization_data.ns_aliases.items(): - creator = code_creators.namespace_alias_t( alias=alias - , full_namespace_name=full_ns_name ) - extmodule.adopt_creator( creator, position ) - position += 1 + extmodule.add_namespace_alias( alias, full_ns_name ) def customize_extmodule( self, mb ): extmodule = mb.code_creator #beautifying include code generation extmodule.license = customization_data.license - extmodule.user_defined_directories.append( settings.boost.include ) - extmodule.user_defined_directories.append( settings.working_dir ) - extmodule.user_defined_directories.append( settings.generated_files_dir ) + extmodule.user_defined_directories.append( date_time_settings.boost.include ) + extmodule.user_defined_directories.append( date_time_settings.working_dir ) + extmodule.user_defined_directories.append( date_time_settings.generated_files_dir ) extmodule.license = customization_data.license extmodule.precompiled_header = 'boost/python.hpp' - self.replace_include_directives( mb ) + mb.code_creator.replace_included_headers( customization_data.includes ) self.beautify_code( mb ) def write_files( self, mb ): - mb.split_module( settings.generated_files_dir ) - shutil.copyfile( os.path.join( settings.date_time_pypp_include, 'date_time_wrapper.hpp' ) - , os.path.join( settings.generated_files_dir, 'date_time_wrapper.hpp' ) ) + mb.split_module( date_time_settings.generated_files_dir ) + shutil.copyfile( os.path.join( date_time_settings.date_time_pypp_include, 'date_time_wrapper.hpp' ) + , os.path.join( date_time_settings.generated_files_dir, 'date_time_wrapper.hpp' ) ) def create(self): start_time = time.clock() @@ -184,7 +165,7 @@ self.filter_declarations(mb) self.add_code( mb ) - mb.build_code_creator( settings.module_name ) + mb.build_code_creator( date_time_settings.module_name ) self.customize_extmodule( mb ) self.write_files( mb ) Modified: pyplusplus_dev/examples/pyboost_dev/pyboost/date_time/include/date_time.pypp.xml =================================================================== --- pyplusplus_dev/examples/pyboost_dev/pyboost/date_time/include/date_time.pypp.xml 2006-05-15 07:10:41 UTC (rev 96) +++ pyplusplus_dev/examples/pyboost_dev/pyboost/date_time/include/date_time.pypp.xml 2006-05-15 07:11:24 UTC (rev 97) @@ -2,8 +2,8 @@ <GCC_XML cvs_revision="1.112"> <Namespace id="_1" name="::" members="_3 _4 _5 _6 _7 _8 _9 _10 _11 _12 _13 _14 _15 _16 _17 _18 _19 _20 _21 _22 _23 _24 _25 _26 _27 _28 _29 _30 _31 _32 _33 _34 _35 _36 _37 _38 _39 _40 _41 _42 _43 _44 _45 _46 _47 _48 _49 _50 _51 _52 _53 _54 _55 _56 _57 _58 _59 _60 _61 _62 _63 _64 _65 _66 _67 _68 _69 _70 _71 _72 _73 _74 _75 _76 _77 _78 _79 _80 _81 _82 _83 _84 _85 _86 _87 _88 _89 _90 _91 _92 _93 _94 _95 _96 _97 _98 _99 _100 _101 _102 _103 _104 _105 _106 _107 _108 _109 _110 _111 _112 _113 _114 _115 _116 _117 _118 _119 _120 _121 _122 _123 _124 _125 _126 _127 _128 _129 _130 _131 _132 _133 _134 _135 _136 _137 _138 _139 _140 _141 _142 _143 _144 _145 _146 _147 _148 _149 _150 _151 _152 _153 _154 _155 _156 _157 _158 _159 _160 _161 _162 _163 _164 _165 _166 _167 _168 _169 _170 _171 _172 _173 _174 _175 _176 _177 _178 _179 _180 _181 _182 _183 _184 _185 _186 _187 _188 _189 _190 _191 _192 _193 _194 _195 _196 _197 _198 _199 _200 _201 _202 _203 _204 _205 _206 _207 _208 _209 _210 _211 _212 _213 _214 _215 _216 _217 _218 _219 _220 _221 _222 _223 _224 _225 _226 _227 _228 _229 _230 _231 _232 _233 _234 _235 _236 _237 _238 _239 _240 _241 _242 _243 _244 _245 _246 _247 _248 _249 _250 _251 _252 _253 _254 _255 _256 _257 _258 _259 _260 _261 _262 _263 _264 _265 _266 _267 _268 _269 _270 _271 _272 _273 _274 _275 _276 _277 _278 _279 _280 _281 _282 _283 _284 _285 _286 _287 _288 _289 _290 _291 _292 _293 _294 _295 _296 _297 _298 _299 _300 _301 _302 _303 _304 _305 _306 _307 _308 _309 _310 _311 _312 _313 _314 _315 _316 _317 _318 _319 _320 _321 _322 _323 _324 _325 _326 _327 _328 _329 _330 _331 _332 _333 _334 _335 _336 _337 _338 _339 _340 _341 _342 _343 _344 _345 _346 _347 _348 _349 _350 _351 _352 _353 _354 _355 _356 _357 _358 _359 _360 _361 _362 _363 _364 _365 _366 _367 _368 _369 _370 _371 _372 _373 _374 _375 _376 _377 _378 _379 _380 _381 _382 _383 _384 _385 _386 _387 _388 _389 _390 _391 _392 _393 _394 _395 _396 _397 _398 _399 _400 _401 _402 _403 _404 _405 _406 _407 _408 _409 _410 _411 _412 _413 _414 _415 _416 _417 _418 _419 _420 _421 _422 _423 _424 _425 _426 _427 _428 _429 _430 _431 _432 _433 _434 _435 _436 _437 _438 _439 _440 _441 _442 _443 _444 _445 _446 _447 _448 _449 _450 _451 _452 _453 _454 _455 _456 _457 _458 _459 _460 _461 _462 _463 _464 _465 _466 _467 _468 _469 _470 _471 _472 _473 _474 _475 _476 _477 _478 _479 _480 _482 _483 _484 _485 _486 _487 _488 _489 _490 _491 _492 _493 _494 _495 _496 _497 _498 _499 _501 _502 _503 _504 _505 _506 _508 _509 _510 _511 _512 _513 _514 _515 _516 _517 _518 _519 _520 _521 _522 _523 _524 _525 _526 _527 _528 _529 _530 _531 _532 _533 _534 _535 _536 _537 _538 _539 _540 _541 _542 _543 _544 _545 _546 _547 _548 _549 _550 _551 _552 _553 _554 _555 _556 _557 _558 _559 _560 _561 _562 _563 _564 _565 _566 _567 _568 _569 _570 _571 _572 _573 _574 _575 _576 _577 _578 _579 _580 _581 _582 _583 _584 _585 _586 _587 _588 _589 _590 _591 _592 _593 _594 _595 _596 _597 _598 _599 _600 _601 _602 _603 _604 _605 _606 _607 _608 _609 _610 _611 _612 _613 _614 _615 _616 _617 _618 _619 _621 _622 _623 _624 _625 _626 _627 _628 _629 _630 _631 _632 _633 _634 _635 _636 _638 _639 _640 _641 _642 _643 _644 _645 _646 _647 _648 _649 _650 _651 _652 _653 _654 _655 _656 _657 _658 _659 _660 _661 _662 _663 _664 _665 _666 _667 _668 _669 _670 _671 _672 _673 _674 _675 _676 _677 _678 _679 _680 _681 _682 _683 _684 _685 _686 _687 _688 _689 _690 _691 _692 _693 _694 _695 _696 _697 _698 _699 _700 _701 _702 _703 _704 _705 _706 _707 _708 _709 _710 _711 _712 _713 _714 _715 _716 _717 _718 _719 _720 _721 _722 _723 _724 _725 _726 _727 _728 _729 _730 _731 _732 _733 _734 _735 _736 _737 _738 _739 _740 _741 _742 _743 _744 _745 _746 _747 _748 _749 _750 _751 _752 _753 _754 _755 _756 _757 _758 _759 _760 _761 _762 _763 _764 _766 _767 _768 _769 _770 _771 _772 _773 _774 _775 _776 _777 _778 _779 _780 _781 _782 _783 _784 _785 _786 _787 _788 _789 _790 _791 _792 _793 _794 _795 _796 _797 _798 _799 _800 _801 _802 _803 _804 _805 _806 _807 _808 _809 _810 _811 _812 _813 _814 _815 _816 _817 _819 _820 _821 _823 _824 _825 _826 _827 _828 _829 _830 _831 _832 _833 _834 _835 _836 _837 _838 _839 _840 _841 _842 _843 _844 _845 _846 _847 _848 _849 _850 _851 _852 _853 _854 _855 _856 _857 _858 _859 _860 _861 _862 _863 _864 _865 _866 _867 _868 _869 _870 _871 _872 _873 _874 _875 _876 _877 _878 _879 _880 _881 _882 _883 _884 _885 _886 _887 _888 _889 _890 _891 _892 _893 _894 _895 _896 _897 _898 _899 _900 _901 _902 _903 _904 _905 _906 _907 _908 _909 _910 _911 _912 _913 _914 _915 _916 _917 _918 _919 _920 _921 _922 _923 _924 _925 _926 _927 _928 _929 _930 _931 _932 _933 _934 _935 _936 _937 _938 _939 _940 _941 _942 _943 _944 _945 _946 _947 _948 _949 _950 _951 _952 _953 _954 _955 _956 _957 _958 _959 _960 _961 _962 _963 _964 _965 _966 _967 _968 _969 _970 _971 _972 _973 _974 _975 _976 _977 _978 _979 _980 _981 _982 _983 _984 _985 _986 _987 _988 _989 _990 _991 _992 _993 _994 _995 _996 _997 _998 _999 _1000 _1001 _1002 _1003 _1005 _1006 _1007 _1008 _1009 _1010 _1011 _1012 _1013 _1014 _1015 _1016 _1017 _1018 _1019 _1020 _1021 _1022 _1023 _1024 _1025 _1026 _1027 _1028 _1029 _1030 _1031 _1032 _1033 _1034 _1035 _1036 _1037 _1038 _1039 _1040 _1041 _1042 _1043 _1044 _1045 _1046 _1047 _1048 _1049 _1050 _1051 _1052 _1053 _1054 _1055 _1056 _1057 _1058 _1059 _1060 _1061 _1062 _1063 _1064 _1065 _1066 _1067 _1068 _1069 _1070 _1071 _1072 _1073 _1074 _1075 _1076 _1077 _1078 _1079 _1080 _1081 _1082 _1083 _1084 _1085 _1086 _1087 _1088 _1089 _1090 _1091 _1092 _1093 _1094 _1095 _1096 _1097 _1098 _1099 _1100 _1101 _1102 _1103 _1104 _1106 _1108 _1110 _1111 _1112 _1113 _1114 _1115 _1116 _1117 _1118 _1119 _1120 _1121 _1122 _1123 _1124 _1125 _1126 _1127 _1128 _1129 _1130 _1131 _1132 _1133 _1135 _1134 _1137 _1139 _1141 _1143 _1144 _1145 _1146 _1147 _1148 _1149 _1150 _1151 _1152 _1153 _1155 _1156 _1157 _1158 _1160 _1161 _1163 _1164 _1166 _1167 _1169 _1171 _1173 _1175 _1177 _1179 _1181 _1183 _1185 _1186 _1187 _1188 _1189 _1190 _1191 _1105 _1107 _765 _1192 _1194 _1195 _1193 _1196 _1197 _1198 _1199 _1200 _1201 _1202 _1203 _1204 _1205 _1206 _1207 _1208 _1209 _1210 _1211 _1212 _1213 _1214 _1215 _1216 _1217 _1218 _1219 _1220 _1221 _1222 _1223 _1224 _1225 _1226 _1227 _1228 _1229 _1230 _1231 _1232 _1233 _1234 _1235 _1236 _1237 _1238 _1239 _1241 _1242 _1243 _1244 _1245 _1247 _1249 _1250 _1251 _1252 _1253 _1255 _1256 _1257 _1258 _1260 _1261 _1262 _1263 _1264 _1265 _1266 _1267 _1268 _1269 _1270 _1271 _1272 _1273 _1274 _1275 _1276 _1277 _1278 _1279 _1280 _1281 _1282 _1283 _1284 _1285 _1286 _1287 _1288 _1289 _1290 _1291 _1292 _1293 _1294 _1295 _1296 _1297 _1298 _1299 _1300 _1301 _1302 _1303 _1304 _1305 _1306 _1307 _1308 _1309 _1310 _1311 _1312 _1313 _1314 _1315 _1316 _1317 _1318 _1319 _1320 _1321 _1322 _1323 _1324 _1325 _1326 _1327 _1328 _1329 _1330 _1331 _1332 _1333 _1334 _1335 _1336 _1337 _1338 _1339 _1340 _1341 _1342 _1343 _1344 _1345 _1346 _1347 _1348 _1349 _1350 _1351 _1352 _1353 _1354 _1355 _1356 _1357 _1358 _1359 _1360 _1361 _1362 _1363 _1364 _1365 _1366 _1367 _1368 _1369 _1370 _1371 _1372 _1373 _1374 _1375 _1376 _1377 _1378 _1379 _1380 _1381 _1382 _1383 _1384 _1385 _1386 _1387 _1388 _1389 _1390 _1391 _1392 _1393 _1394 _1395 _1396 _1397 _1398 _1399 _1400 _1401 _1402 _1403 _1404 _1405 _1406 _1407 _1408 _1409 _1410 _1411 _1412 _1413 _1414 _1415 _1416 _1417 _1418 _1419 _1420 _1421 _1422 _1423 _1424 _1425 _1426 _1427 _1428 _1430 _1431 _1432 _1433 _1434 _1435 _1436 _1437 _1438 _1439 _1440 _1441 _1442 _1443 _1444 _1445 _1446 _1447 _1448 _1449 _1450 _1451 _1452 _1453 _1454 _1455 _1456 _1457 _1458 _1459 _1460 _1461 _1462 _1463 _1464 _1465 _1466 _1467 _1468 _1469 _1470 _1471 _1472 _1473 _1474 _1475 _1476 _1477 _1478 _1479 _1480 _1481 _1482 _1483 _1484 _1485 _1486 _1487 _1488 _1489 _1491 _1490 _1492 _1493 _818 _1494 _1495 _1496 _1497 _1499 _1498 _1501 _1502 _1503 _1504 _1505 _1506 _1507 _1508 _1509 _1510 _1512 _1513 _1514 _1515 _1516 _1517 _1518 _1519 _1520 _1521 _1522 _1523 _1525 _1524 _1526 _1527 _1528 _1529 _1530 _1531 _1532 _1533 _1534 _1535 _1536 _1537 _1538 _1539 _1540 _1541 _1542 _1543 _1544 _1545 _1546 _1547 _1548 _1549 _1550 _1551 _1552 _1553 _1554 _1555 _1556 _1557 _1558 _1559 _1560 _1562 _1563 _1564 _1565 _1566 _1567 _1568 _1569 _1570 _1571 _1573 _1574 _1575 _1576 _1577 _1578 _1579 _1580 _1581 _1582 _1583 _1584 _1585 _1586 _1587 _1588 _1589 _1590 _1591 _1592 _1593 _1594 _1561 _1595 _1596 _1597 _1598 _1599 _1600 _1601 _1602 _1603 _1604 _1605 _1606 _1607 _1608 _1609 _1610 _1611 _1612 _1613 _1614 _1615 _1616 _1617 _1618 _1619 _1620 _1621 _1622 _1623 _1624 _1625 _1626 _1627 _1628 _1629 _1630 _1631 _1632 _1633 _1634 _1635 _1636 _1637 _1638 _1639 _1640 _1641 _1642 _1643 _1644 _1645 _1646 _1647 _1648 _1649 _1650 _1651 _1652 _1653 _1654 _1655 _1656 _1657 _1658 _1659 _1660 _1661 _1662 _1663 _1664 _1665 _1666 _1667 _1668 _1669 _1670 _1671 _1672 _1673 _1674 _1675 _1676 _1677 _1678 _1679 _1680 _1681 _1682 _1683 _1684 _1685 _1686 _1687 _1688 _1689 _1690 _1691 _1692 _1693 _1694 _1695 _1696 _1697 _1698 _1699 _1700 _1701 _1702 _1703 _1704 _1705 _1706 _1707 _1708 _1709 _1710 _1711 _1712 _1713 _1714 _1715 _1716 _1717 _1718 _1719 _1720 _1721 _1722 _1723 _1724 _1725 _1726 _1727 _1728 _1729 _1730 _1731 _1732 _1733 _1734 _1735 _1736 _1737 _1738 _1739 _1740 _1741 _1742 _1743 _1744 _1745 _1746 _1747 _1748 _1749 _1750 _1751 _1752 _1753 _1754 _1755 _1756 _1757 _1758 _1759 _1760 _1761 _1762 _1763 _1764 _1765 _1766 _1767 _1768 _1769 _1770 _1771 _1772 _1773 _1774 _1775 _1776 _1777 _1778 _1779 _1780 _1781 _1782 _1783 _1784 _1785 _1786 _1787 _1788 _1789 _1790 _1791 _1792 _1793 _1794 _1795 _1796 _1797 _1798 _1799 _1800 _1801 _1802 _1803 _1804 _1805 _1806 _1807 _1808 _1809 _1810 _1811 _1812 _1813 _1814 _1815 _1816 _1817 _1818 _1819 _1820 _1821 _1822 _1823 _1824 _1825 _1826 _1827 _1828 _1829 _1830 _1831 _1832 _1833 _1834 _1835 _1836 _1837 _1838 _1839 _1840 _1841 _1842 _1843 _1844 " mangled="_Z2::" demangled="::"/> <Namespace id="_2" name="std" context="_1" members="_1846 _1847 _1848 _1849 _1850 _1851 _1852 _1853 _1854 _1855 _1856 _1857 _1858 _1859 _1860 _1861 _1862 _1863 _1864 _1865 _1866 _1867 _1868 _1869 _1870 _1871 _1872 _1873 _1874 _1875 _1876 _1877 _1878 _1879 _1880 _1881 _1882 _1883 _1884 _1885 _1886 _1887 _1888 _1889 _1890 _1891 _1892 _1893 _1894 _1895 _1900 _1901 _1906 _1907 _1920 _1921 _1926 _1927 _1932 _1933 _1934 _1935 _1936 _1937 _1938 _1939 _1940 _1941 _1942 _1956 _1957 _1958 _1959 _1960 _1961 _1962 _1963 _1964 _1965 _1968 _1973 _1974 _1975 _1976 _1981 _1982 _1983 _1984 _1987 _1988 _1989 _1990 _1991 _1992 _1993 _1994 _1995 _1996 _1997 _2006 _2007 _2008 _2039 _2048 _2049 _2050 _2051 _2052 _2053 _2054 _2055 _2056 _2057 _2058 _2059 _2060 _2061 _2062 _2063 _2064 _2065 _2066 _2067 _2068 _2069 _2070 _2071 _2072 _2073 _2074 _2075 _2076 _2077 _2078 _2079 _2080 _2081 _2082 _2083 _2084 _2085 _2086 _2087 _2088 _2089 _2090 _2091 _2092 _2093 _2094 _2100 _2101 _2142 _2143 _2144 _2162 _2163 _2203 _2205 _2206 _2207 _2268 _2281 _2290 _2307 _2308 _2313 _2315 _2316 _2317 _2324 _2325 _2326 _2449 _2450 _2451 _2452 _2453 _2454 _2455 _2456 _2457 _2459 _2461 _2463 _2465 _2467 _2469 _2471 _2473 _2475 _2477 _2479 _2481 _2483 _2485 _2487 _2489 _2491 _2493 _2495 _2497 _2499 _2501 _2503 _2505 _2507 _2509 _2510 _2515 _2516 _2517 _2518 _2519 _2520 _2521 _2522 _2523 _2524 _2525 _2526 _2527 _2528 _2530 _2531 _2532 _2533 _2534 _2535 _2536 _2537 _2538 _2540 _2542 _2561 _2562 _2563 _2564 _2565 _2566 _2567 _2568 _2569 _2632 _2633 _2634 _2635 _2636 _2637 _2638 _2647 _2648 _2649 " mangled="_Z3std" demangled="std"/> - <Function id="_3" name="_GLOBAL__D__home_roman_pygccxml_sources_sources_pyplusplus_dev_examples_pyboost_dev_pyboost_date_time_include_date_time.pypp.hppT8ZErb" returns="_1154" context="_1" location="f0:131" file="f0" line="131" endline="131"/> - <Function id="_4" name="_GLOBAL__I__home_roman_pygccxml_sources_sources_pyplusplus_dev_examples_pyboost_dev_pyboost_date_time_include_date_time.pypp.hppT8ZErb" returns="_1154" context="_1" location="f0:131" file="f0" line="131" endline="131"/> + <Function id="_3" name="_GLOBAL__D__home_roman_pygccxml_sources_sources_pyplusplus_dev_examples_pyboost_dev_pyboost_date_time_include_date_time.pypp.hpp6rBGba" returns="_1154" context="_1" location="f0:131" file="f0" line="131" endline="131"/> + <Function id="_4" name="_GLOBAL__I__home_roman_pygccxml_sources_sources_pyplusplus_dev_examples_pyboost_dev_pyboost_date_time_include_date_time.pypp.hpp6rBGba" returns="_1154" context="_1" location="f0:131" file="f0" line="131" endline="131"/> <Variable id="_5" name="_ZGVN5boost9date_time10date_facetINS_9gregorian4dateEcSt19ostreambuf_iteratorIcSt11char_traitsIcEEE2idE" type="_1248" context="_1" location="f1:372" file="f1" line="372" artificial="1"/> <Function id="_6" name="__static_initialization_and_destruction_0" returns="_1154" context="_1" mangled="_Z41__static_initialization_and_destruction_0ii" demangled="__static_initialization_and_destruction_0(int, int)" location="f0:131" file="f0" line="131" endline="76"> <Argument name="__initialize_p" type="_500" location="f0:131" file="f0" line="131"/> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rom...@us...> - 2006-05-15 07:10:46
|
Revision: 96 Author: roman_yakovenko Date: 2006-05-15 00:10:41 -0700 (Mon, 15 May 2006) ViewCVS: http://svn.sourceforge.net/pygccxml/?rev=96&view=rev Log Message: ----------- small improvments Modified Paths: -------------- pyplusplus_dev/examples/pyboost_dev/unittests/crc/__init__.py Modified: pyplusplus_dev/examples/pyboost_dev/unittests/crc/__init__.py =================================================================== --- pyplusplus_dev/examples/pyboost_dev/unittests/crc/__init__.py 2006-05-15 07:09:55 UTC (rev 95) +++ pyplusplus_dev/examples/pyboost_dev/unittests/crc/__init__.py 2006-05-15 07:10:41 UTC (rev 96) @@ -6,8 +6,6 @@ import _crc_ -#print dir( _crc_ ) - from _crc_ import crc_16_type from _crc_ import crc_32_type from _crc_ import crc_ccitt_type @@ -35,8 +33,12 @@ __all__ = __optimal__ + __basic__ def process_bytes( self, data ): - for byte in data: - self.process_byte( byte ) + if isinstance( data, str ): + for byte in data: + self.process_byte( ord( byte ) ) + else: + for byte in data: + self.process_byte( byte ) for cls in __all__: cls.process_bytes = process_bytes This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rom...@us...> - 2006-05-15 07:10:05
|
Revision: 95 Author: roman_yakovenko Date: 2006-05-15 00:09:55 -0700 (Mon, 15 May 2006) ViewCVS: http://svn.sourceforge.net/pygccxml/?rev=95&view=rev Log Message: ----------- adding rational library Added Paths: ----------- pyplusplus_dev/examples/pyboost_dev/pyboost/rational/ pyplusplus_dev/examples/pyboost_dev/pyboost/rational/generate_code.py pyplusplus_dev/examples/pyboost_dev/pyboost/rational/rational_export.hpp pyplusplus_dev/examples/pyboost_dev/pyboost/rational/rational_settings.py pyplusplus_dev/examples/pyboost_dev/pyboost/rational/sconscript Added: pyplusplus_dev/examples/pyboost_dev/pyboost/rational/generate_code.py =================================================================== --- pyplusplus_dev/examples/pyboost_dev/pyboost/rational/generate_code.py (rev 0) +++ pyplusplus_dev/examples/pyboost_dev/pyboost/rational/generate_code.py 2006-05-15 07:09:55 UTC (rev 95) @@ -0,0 +1,100 @@ +#! /usr/bin/python +# Copyright 2004 Roman Yakovenko. +# Distributed under the Boost Software License, Version 1.0. (See +# accompanying file LICENSE_1_0.txt or copy at +# http://www.boost.org/LICENSE_1_0.txt) + + +import os +import sys +import time +import shutil +import rational_settings +from pygccxml import parser +from pygccxml import declarations +from pyplusplus import code_creators +from pyplusplus import module_builder +from pyplusplus.module_builder import call_policies + +LICENSE = """// Copyright 2004 Roman Yakovenko. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +""" + +class code_generator_t(object): + def __init__(self): + self.__file = os.path.join( rational_settings.working_dir, 'rational_export.hpp' ) + + self.__mb = module_builder.module_builder_t( + [ parser.create_cached_source_fc( + self.__file + , os.path.join( rational_settings.generated_files_dir, 'rational.xml' ) ) ] + , gccxml_path=rational_settings.gccxml.executable + , include_paths=[rational_settings.boost.include] + , define_symbols=rational_settings.defined_symbols + , undefine_symbols=rational_settings.undefined_symbols + , optimize_queries=False ) + + for f_decl in self.__mb.free_functions(): + f_decl.alias = f_decl.name + f_decl.name = f_decl.demangled_name + + self.__mb.run_query_optimizer() + + + def filter_declarations(self ): + self.__mb.global_ns.exclude() + rational = self.__mb.class_('rational<long>') + rational.include() + + r_assign = rational.calldef( 'assign', recursive=False ) + r_assign.call_policies = call_policies.return_self() + + foperators = self.__mb.free_operators( lambda decl: 'rational<long>' in decl.decl_string ) + foperators.include() + + bad_rational = self.__mb.class_('bad_rational' ) + bad_rational.include() + + self.__mb.free_function( 'lcm<long>' ).include() + self.__mb.free_function( 'gcd<long>' ).include() + + def prepare_decls( self ): + self.__mb.class_('rational<long>').alias = 'rational' + + def customize_extmodule( self ): + global LICENSE + extmodule = self.__mb.code_creator + #beautifying include code generation + extmodule.license = LICENSE + extmodule.user_defined_directories.append( rational_settings.boost.include ) + extmodule.user_defined_directories.append( rational_settings.working_dir ) + extmodule.user_defined_directories.append( rational_settings.generated_files_dir ) + extmodule.precompiled_header = 'boost/python.hpp' + extmodule.replace_included_headers( ['boost/rational.hpp'] ) + + def write_files( self ): + self.__mb.write_module( os.path.join( rational_settings.generated_files_dir, 'rational.pypp.cpp' ) ) + + def create(self): + start_time = time.clock() + self.filter_declarations() + + self.prepare_decls() + + self.__mb.build_code_creator( rational_settings.module_name ) + + self.customize_extmodule() + self.write_files( ) + print 'time taken : ', time.clock() - start_time, ' seconds' + +def export(): + cg = code_generator_t() + cg.create() + +if __name__ == '__main__': + export() + print 'done' + + Added: pyplusplus_dev/examples/pyboost_dev/pyboost/rational/rational_export.hpp =================================================================== --- pyplusplus_dev/examples/pyboost_dev/pyboost/rational/rational_export.hpp (rev 0) +++ pyplusplus_dev/examples/pyboost_dev/pyboost/rational/rational_export.hpp 2006-05-15 07:09:55 UTC (rev 95) @@ -0,0 +1,24 @@ +// Copyright 2004 Roman Yakovenko. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef __rational_export_hpp__ +#define __rational_export_hpp__ + +#include "boost/rational.hpp" + +namespace boost{ namespace detail{ + +typedef boost::rational< long int > pyrational; + +inline void instantiate(){ + sizeof( pyrational ); + boost::gcd<long int>( 1, 1); + boost::lcm<long int>( 1, 1); +} + +} } + + +#endif//__rational_export_hpp__ \ No newline at end of file Added: pyplusplus_dev/examples/pyboost_dev/pyboost/rational/rational_settings.py =================================================================== --- pyplusplus_dev/examples/pyboost_dev/pyboost/rational/rational_settings.py (rev 0) +++ pyplusplus_dev/examples/pyboost_dev/pyboost/rational/rational_settings.py 2006-05-15 07:09:55 UTC (rev 95) @@ -0,0 +1,24 @@ +#! /usr/bin/python +# Copyright 2004 Roman Yakovenko. +# Distributed under the Boost Software License, Version 1.0. (See +# accompanying file LICENSE_1_0.txt or copy at +# http://www.boost.org/LICENSE_1_0.txt) + +import os +import sys + +_script_dir = os.path.abspath( os.getcwd() ) +environment_path = os.path.realpath( os.path.join( _script_dir, '..', '..', '..', '..' ) ) +sys.path.append( environment_path ) + +from environment import boost, scons, gccxml, python + +module_name = '_rational_' +working_dir = _script_dir +generated_files_dir = os.path.join( _script_dir, 'generated' ) +unittests_dir = os.path.join( _script_dir, '..', '..', 'unittests', 'rational' ) + +defined_symbols = ['BOOST_NO_INCLASS_MEMBER_INITIALIZATION'] +undefined_symbols = [ '__MINGW32__' ] + + \ No newline at end of file Added: pyplusplus_dev/examples/pyboost_dev/pyboost/rational/sconscript =================================================================== --- pyplusplus_dev/examples/pyboost_dev/pyboost/rational/sconscript (rev 0) +++ pyplusplus_dev/examples/pyboost_dev/pyboost/rational/sconscript 2006-05-15 07:09:55 UTC (rev 95) @@ -0,0 +1,35 @@ +#! /usr/bin/python +# Copyright 2004 Roman Yakovenko. +# Distributed under the Boost Software License, Version 1.0. (See +# accompanying file LICENSE_1_0.txt or copy at +# http://www.boost.org/LICENSE_1_0.txt) + +import os +import sys +import rational_settings + +Import( 'env' ) + +def get_ccflags(): + if sys.platform == 'win32': + return rational_settings.scons.ccflags \ + + map( lambda ds: '/D%s' % ds, rational_settings.defined_symbols ) + else: + return map( lambda ds: '-D' + ds, rational_settings.defined_symbols ) + +def get_source_files(): + source_files = filter( lambda s: s.endswith( '.cpp' ), os.listdir(rational_settings.generated_files_dir) ) + return map( lambda fname: os.path.join( rational_settings.generated_files_dir, fname ), source_files ) + +def get_target(): + return os.path.join( rational_settings.generated_files_dir + , rational_settings.module_name + rational_settings.scons.suffix ) + +local_env = env.Copy() +local_env.Append( CPPPATH=[ rational_settings.generated_files_dir ] ) +local_env.Append( CCFLAGS=get_ccflags() ) + +_rational_ = local_env.SharedLibrary( target=rational_settings.module_name + , source=get_source_files() ) + +local_env.Install( '#unittests/rational', _rational_ ) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rom...@us...> - 2006-05-15 07:06:21
|
Revision: 94 Author: roman_yakovenko Date: 2006-05-15 00:06:15 -0700 (Mon, 15 May 2006) ViewCVS: http://svn.sourceforge.net/pygccxml/?rev=94&view=rev Log Message: ----------- adding few convinience function: replace_included_headers add_namespace_usage add_namespace_alias Modified Paths: -------------- pyplusplus_dev/pyplusplus/code_creators/module.py Modified: pyplusplus_dev/pyplusplus/code_creators/module.py =================================================================== --- pyplusplus_dev/pyplusplus/code_creators/module.py 2006-05-14 18:37:22 UTC (rev 93) +++ pyplusplus_dev/pyplusplus/code_creators/module.py 2006-05-15 07:06:15 UTC (rev 94) @@ -7,6 +7,7 @@ import types import license import include +import namespace import compound import algorithm import module_body @@ -109,7 +110,29 @@ return i else: raise RuntimeError( "include_t creator has not been found." ) + + def replace_included_headers( self, headers, leave_boost_python_header=True ): + to_be_removed = [] + for creator in self.creators: + if isinstance( creator, include.include_t ): + to_be_removed.append( creator ) + elif isinstance( creator, module_body.module_body_t ): + break + boost_python_treated = False + for creator in to_be_removed: + if not boost_python_treated: + boost_python_treated = True + if 'boost/python.hpp' in creator.header: + if not leave_boost_python_header: + self.remove_creator( creator ) + else: + self.remove_creator( creator ) + else: + self.remove_creator( creator ) + map( lambda header: self.adopt_include( include.include_t( header=header ) ) + , headers ) + def adopt_include(self, include_creator): """Insert an L{include_t} object. @@ -168,4 +191,25 @@ code = compound.compound_t.create_internal_code( self.creators[index:] ) code = self.unindent(code) return os.linesep.join( includes ) + 2 * os.linesep + code + os.linesep - + + def add_namespace_usage( self, namespace_name ): + self.adopt_creator( namespace.namespace_using_t( 'boost' ) + , self.last_include_index() + 1 ) + + def add_namespace_alias( self, alias, full_namespace_name ): + self.adopt_creator( namespace.namespace_alias_t( + alias=alias + , full_namespace_name=full_namespace_name ) + , self.last_include_index() + 1 ) + + + + + + + + + + + + \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rom...@us...> - 2006-05-14 18:37:35
|
Revision: 93 Author: roman_yakovenko Date: 2006-05-14 11:37:22 -0700 (Sun, 14 May 2006) ViewCVS: http://svn.sourceforge.net/pygccxml/?rev=93&view=rev Log Message: ----------- crc library almost fully exported to Python Modified Paths: -------------- pyplusplus_dev/examples/pyboost_dev/pyboost/crc/generate_code.py pyplusplus_dev/examples/pyboost_dev/unittests/crc/__init__.py pyplusplus_dev/examples/pyboost_dev/unittests/crc/unittests/test_all.py Added Paths: ----------- pyplusplus_dev/examples/pyboost_dev/pyboost/crc/crc_export.hpp Added: pyplusplus_dev/examples/pyboost_dev/pyboost/crc/crc_export.hpp =================================================================== --- pyplusplus_dev/examples/pyboost_dev/pyboost/crc/crc_export.hpp (rev 0) +++ pyplusplus_dev/examples/pyboost_dev/pyboost/crc/crc_export.hpp 2006-05-14 18:37:22 UTC (rev 93) @@ -0,0 +1,23 @@ +// Copyright 2004 Roman Yakovenko. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#include "boost/crc.hpp" + +namespace boost{ namespace details{ + +inline void export_crc(){ + sizeof( crc_16_type ); + sizeof( crc_ccitt_type ); + sizeof( crc_xmodem_type ); + sizeof( crc_32_type ); + sizeof( crc_basic<1> ); + sizeof( crc_basic<3> ); + sizeof( crc_basic<7> ); + sizeof( crc_basic<16> ); + sizeof( crc_basic<32> ); +} + +} } + Modified: pyplusplus_dev/examples/pyboost_dev/pyboost/crc/generate_code.py =================================================================== --- pyplusplus_dev/examples/pyboost_dev/pyboost/crc/generate_code.py 2006-05-14 08:19:04 UTC (rev 92) +++ pyplusplus_dev/examples/pyboost_dev/pyboost/crc/generate_code.py 2006-05-14 18:37:22 UTC (rev 93) @@ -23,8 +23,9 @@ class code_generator_t(object): def __init__(self): - self.__file = os.path.join( crc_settings.boost.include - ,'libs', 'crc', 'crc_test.cpp' ) + #self.__file = os.path.join( crc_settings.boost.include + #,'libs', 'crc', 'crc_test.cpp' ) + self.__file = os.path.join( crc_settings.working_dir, 'crc_export.hpp' ) self.__mb = module_builder.module_builder_t( [ parser.create_cached_source_fc( @@ -40,7 +41,9 @@ boost_ns = self.__mb.global_ns.namespace( 'boost', recursive=False ) boost_ns.classes( lambda decl: decl.name.startswith( 'crc_basic' ) ).include() boost_ns.classes( lambda decl: decl.name.startswith( 'crc_optimal' ) ).include() - + boost_ns.member_functions( 'process_bytes' ).exclude() + boost_ns.member_functions( 'process_block' ).exclude() + def prepare_decls( self ): boost_ns = self.__mb.namespace( 'boost' ) classes = boost_ns.classes( lambda decl: decl.name.startswith( 'crc_basic' ) ) Modified: pyplusplus_dev/examples/pyboost_dev/unittests/crc/__init__.py =================================================================== --- pyplusplus_dev/examples/pyboost_dev/unittests/crc/__init__.py 2006-05-14 08:19:04 UTC (rev 92) +++ pyplusplus_dev/examples/pyboost_dev/unittests/crc/__init__.py 2006-05-14 18:37:22 UTC (rev 93) @@ -6,15 +6,16 @@ import _crc_ -print dir( _crc_ ) +#print dir( _crc_ ) -from _crc_ import crc_16_type as crc16 -from _crc_ import crc_32_type as crc32 -from _crc_ import crc_ccitt_type as crc_ccitt -from _crc_ import fast_crc_type as fast_crc +from _crc_ import crc_16_type +from _crc_ import crc_32_type +from _crc_ import crc_ccitt_type +from _crc_ import crc_xmodem_type -__optimal__ = [ crc16, crc32, crc_ccitt, fast_crc ] +__optimal__ = [ crc_16_type, crc_32_type, crc_ccitt_type, crc_xmodem_type ] + from _crc_ import crc_basic_1 from _crc_ import crc_basic_16 from _crc_ import crc_basic_3 @@ -38,4 +39,5 @@ self.process_byte( byte ) for cls in __all__: - cls.process_bytes = process_bytes \ No newline at end of file + cls.process_bytes = process_bytes + cls.process_block = process_bytes \ No newline at end of file Modified: pyplusplus_dev/examples/pyboost_dev/unittests/crc/unittests/test_all.py =================================================================== --- pyplusplus_dev/examples/pyboost_dev/unittests/crc/unittests/test_all.py 2006-05-14 08:19:04 UTC (rev 92) +++ pyplusplus_dev/examples/pyboost_dev/unittests/crc/unittests/test_all.py 2006-05-14 18:37:22 UTC (rev 93) @@ -7,8 +7,9 @@ import sys sys.path.append( '../..' ) +import crc +import random import unittest -import crc class consts: data = [ 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39 ] @@ -23,7 +24,6 @@ def fundamental_test( self, cls, data, expected ): inst = cls() inst.process_bytes( data ) - print inst.checksum() #self.failUnless( inst.checksum() == expected ) def compute_test( self, fast_crc, slow_crc, expected ): @@ -31,9 +31,16 @@ slow_crc.process_bytes( consts.data, len(consts.data) ) def test( self ): - self.fundamental_test( crc.crc_ccitt, consts.data, consts.crc_ccitt_result ) + self.fundamental_test( crc.crc_ccitt_type, consts.data, consts.crc_ccitt_result ) + self.fundamental_test( crc.crc_16_type, consts.data, consts.crc_16_result ) + self.fundamental_test( crc.crc_32_type, consts.data, consts.crc_32_result ) - def test_small_crc_3( self ): + def test_crc_basic_1( self ): + crc1 = crc.crc_basic_1( 1 ) + crc1.process_bytes( consts.data ) + self.failUnless( crc1.checksum() == 1 ) + + def test_crc_basic_3( self ): #The CRC standard is a SDH/SONET Low Order LCAS control word with CRC-3 #taken from ITU-T G.707 (12/03) XIII.2. @@ -77,7 +84,143 @@ #undef PRIVATE_ACRC_FUNC #undef PRIVATE_CRC_FUNC + + def test_crc_basic_7( self ): + #"Doing short-CRC (7-bit augmented) message tests." + # The CRC standard is a SDH/SONET J0/J1/J2/N1/N2/TR TTI (trace message) + # with CRC-7, o.a. ITU-T G.707 Annex B, G.832 Annex A. + + # Two samples, each sixteen bytes + # Sample 1 is '\x80' + ASCII("123456789ABCDEF") + # Sample 2 is '\x80' + ASCII("TTI UNAVAILABLE") + samples = [ [ 0x80, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, + 0x38, 0x39, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46 ] + , [ 0x80, 0x54, 0x54, 0x49, 0x20, 0x55, 0x4E, 0x41, + 0x56, 0x41, 0x49, 0x4C, 0x41, 0x42, 0x4C, 0x45 ] ] + results = [ 0x62, 0x23 ] + + # Basic computer + tester1 = crc.crc_basic_7( 0x09 ) + + tester1.process_bytes( samples[0] ) + self.failUnless( tester1.checksum() == results[0] ) + + tester1.reset() + tester1.process_bytes( samples[1] ) + self.failUnless( tester1.checksum() == results[1] ) + + # Optimal computer + #define PRIVATE_CRC_FUNC boost::crc<7, 0x09, 0, 0, false, false> + #define PRIVATE_ACRC_FUNC boost::augmented_crc<7, 0x09> + + #self.failUnless( results[0] == PRIVATE_CRC_FUNC(samples[0], 16) ) + #self.failUnless( results[1] == PRIVATE_CRC_FUNC(samples[1], 16) ) + + # maybe the fix to CRC functions needs to be applied to augmented CRCs? + + #undef PRIVATE_ACRC_FUNC + #undef PRIVATE_CRC_FUNC + + def compute_test( self, optimal_cls, basic_cls, data, expected ): + fast_crc = optimal_cls() + slow_crc = basic_cls( fast_crc.truncated_polynominal + , fast_crc.initial_remainder + , fast_crc.final_xor_value + , fast_crc.reflect_input + , fast_crc.reflect_remainder ) + + fast_crc.process_bytes( data ) + slow_crc.process_bytes( data ) + self.failUnless( fast_crc.checksum() == expected ) + self.failUnless( slow_crc.checksum() == expected ) + #self.failUnless( func_result == expected ); + + def interrupt_test( self, optimal_cls, basic_cls, data, expected ): + fast_crc1 = optimal_cls() + slow_crc1 = basic_cls( fast_crc1.truncated_polynominal + , fast_crc1.initial_remainder + , fast_crc1.final_xor_value + , fast_crc1.reflect_input + , fast_crc1.reflect_remainder ) + self.failUnless( fast_crc1.get_interim_remainder() == slow_crc1.get_initial_remainder() ) + first_half = data[:len( data )/2] + second_half = data[len( data )/2:] + + fast_crc1.process_bytes( first_half ); + slow_crc1.process_bytes( first_half ); + self.failUnless( fast_crc1.checksum() == slow_crc1.checksum() ) + + #Process the second half of the data (also test accessors) + fast_crc2 = optimal_cls( fast_crc1.get_interim_remainder() ) + slow_crc2 = basic_cls( slow_crc1.get_truncated_polynominal() + , slow_crc1.get_interim_remainder() + , slow_crc1.get_final_xor_value() + , slow_crc1.get_reflect_input() + , slow_crc1.get_reflect_remainder() ) + + fast_crc2.process_block( second_half ) + slow_crc2.process_block( second_half ) + + self.failUnless( fast_crc2.checksum() == slow_crc2.checksum() ) + self.failUnless( fast_crc2.checksum() == expected ) + self.failUnless( slow_crc2.checksum() == expected ) + + def error_test( self, optimal_cls, basic_cls ): + # Create a random block of data + ran_data = map( lambda unused: random.randint(0, 255), [0] * 256 ) + + # Create computers and compute the checksum of the data + fast_tester = optimal_cls() + slow_tester = basic_cls( fast_tester.truncated_polynominal + , fast_tester.initial_remainder + , fast_tester.final_xor_value + , fast_tester.reflect_input + , fast_tester.reflect_remainder ) + + fast_tester.process_bytes( ran_data ) + slow_tester.process_bytes( ran_data ) + + fast_checksum = fast_tester.checksum() + slow_checksum = slow_tester.checksum() + + self.failUnless( fast_checksum == slow_checksum ) + + # Do the checksum again (and test resetting ability) + fast_tester.reset(); + slow_tester.reset( fast_tester.initial_remainder ); + fast_tester.process_bytes( ran_data ) + slow_tester.process_bytes( ran_data ) + self.failUnless( fast_tester.checksum() == slow_tester.checksum() ) + self.failUnless( fast_tester.checksum() == fast_checksum ) + self.failUnless( slow_tester.checksum() == slow_checksum ) + + # Produce a single-bit error + ran_data[ ran_data[0] % 255 ] = ( ran_data[ ran_data[0] % 255 ] ^ ( 1 << (ran_data[1] % 32) ) ) % 255 + + # Compute the checksum of the errorenous data + # (and continue testing resetting ability) + fast_tester.reset( fast_tester.initial_remainder ) + slow_tester.reset() + fast_tester.process_bytes( ran_data ) + slow_tester.process_bytes( ran_data ) + self.failUnless( fast_tester.checksum() == slow_tester.checksum() ) + self.failUnless( fast_tester.checksum() != fast_checksum ) + self.failUnless( slow_tester.checksum() != slow_checksum ) + + def test_crc_ccitt( self ): + self.compute_test( crc.crc_ccitt_type, crc.crc_basic_16, consts.data, consts.crc_ccitt_result ) + self.interrupt_test( crc.crc_ccitt_type, crc.crc_basic_16, consts.data, consts.crc_ccitt_result ) + self.error_test( crc.crc_ccitt_type, crc.crc_basic_16 ) + + def test_crc_16( self ): + self.compute_test( crc.crc_16_type, crc.crc_basic_16, consts.data, consts.crc_16_result) + self.interrupt_test( crc.crc_16_type, crc.crc_basic_16, consts.data, consts.crc_16_result) + + def test_crc_32( self ): + self.compute_test( crc.crc_32_type, crc.crc_basic_32, consts.data, consts.crc_32_result) + self.interrupt_test( crc.crc_32_type, crc.crc_basic_32, consts.data, consts.crc_32_result) + def create_suite(): suite = unittest.TestSuite() suite.addTest( unittest.makeSuite(tester_t) ) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rom...@us...> - 2006-05-14 08:19:11
|
Revision: 92 Author: roman_yakovenko Date: 2006-05-14 01:19:04 -0700 (Sun, 14 May 2006) ViewCVS: http://svn.sourceforge.net/pygccxml/?rev=92&view=rev Log Message: ----------- adding *.py~ extention to remove list Modified Paths: -------------- developer_scripts/clean_source_dir.py Modified: developer_scripts/clean_source_dir.py =================================================================== --- developer_scripts/clean_source_dir.py 2006-05-14 08:15:06 UTC (rev 91) +++ developer_scripts/clean_source_dir.py 2006-05-14 08:19:04 UTC (rev 92) @@ -8,6 +8,7 @@ to_be_deleted_file_exts = [ '*.pyc' + , '*.py~' , '*.so' , '*.os' , '*.cpp~' This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |