Commit graph

102 commits

Author SHA1 Message Date
Andrei Alexandrescu
92335506d3 Merge pull request #654 from dawgfoto/fix8314
fix issue 8314
2012-07-22 19:50:22 -07:00
jmdavis
735c2adbda Changes required for issue# 6277. 2012-07-21 01:57:28 -07:00
Martin Nowak
aa896e08cc set random generator in constructor
- Bug 8314 was already fixed by adding a _first flag
2012-07-20 16:34:49 +02:00
jmdavis
28781bfb9f Old deprecations which were not properly taken care of previously. 2012-07-07 02:03:49 -07:00
Andrei Alexandrescu
ae15e0ec14 Merge pull request #553 from WebDrake/master
Rewrite of RandomSample to use Jeffrey Scott Vitter's Algorithm D.
2012-07-01 19:14:52 -07:00
Johannes Pfau
589218003d Fix isSeedable documentation 2012-06-18 14:52:44 +02:00
Johannes Pfau
c0be641cd5 Add seed(InputRange) overload to MersenneTwisterEngine 2012-06-17 13:26:49 +02:00
Joseph Rushton Wakeling
205c3bf4cb Fix problem of first sample point always being identical. 2012-05-09 20:57:52 +02:00
Joseph Rushton Wakeling
5f539a1622 Fix link errors in Ddoc comments. 2012-05-04 20:19:44 +02:00
Joseph Rushton Wakeling
d7f5bb0aa5 Small typo correction in comment/doc. 2012-05-04 20:07:10 +02:00
Joseph Rushton Wakeling
40a79b32e2 RandomSample should check if input is InputRange. 2012-05-04 19:04:52 +02:00
Joseph Rushton Wakeling
56ef13997e Bring code in line with D style. 2012-05-04 14:22:34 +02:00
Joseph Rushton Wakeling
39bc5ae412 skip() and skipA() should not be called as properties.
Ensures code builds with -property and -unittest flags
both enabled.
2012-05-04 12:56:59 +02:00
jmdavis
76def7af85 Fix Issue# 8026.
I added template constraints to all of the templates missing template
constraints in std.random - including randomShuffle, per the bug.
2012-05-03 19:47:15 -07:00
jmdavis
088a228b34 Fixed incorrectly named enum. 2012-05-03 19:40:40 -07:00
jmdavis
1b14818170 Fixed incorrect braces in std.random. 2012-05-03 19:13:23 -07:00
jmdavis
cdd6a858b5 Remove unneeded C stuff and trailing whitespace from std.random. 2012-05-03 19:00:17 -07:00
Joseph Rushton Wakeling
34c7d2f9ec Tweaks to authorship & comments. 2012-04-26 22:27:23 +02:00
Joseph Rushton Wakeling
a47707a197 Rewrite of RandomSample to use Jeffrey Scott Vitter's Algorithm D.
This algorithm calculates a random sample of size n in O(n) time,
generating O(n) random variates, as opposed to the previously
implemented Algorithm S where both scale with the size of the
data being sampled.

Variable names in the implementation follow those in Vitter's
papers introducing the algorithm:

  * Vitter, J. S. (1984) Faster methods for random sampling.
    Commun. ACM 27(7): 703--718.

  * Vitter, J. S. (1987) An efficient algorithm for sequential
    random sampling.  ACM Trans. Math. Softw. 13(1): 58--67.
2012-04-24 17:45:12 +02:00
Andrei Alexandrescu
d2a605d8ec Merge pull request #398 from jpf91/isRNG
Add isRandomNumberGenerator template
2012-04-07 13:37:54 -07:00
James Miller
fba8c66dfa Fixes typo in randomShuffle documentation 2012-03-28 19:04:09 +13:00
Johannes Pfau
d99c33c8c7 Rename isRandomNumberGenerator to isUniformRNG 2012-02-21 19:22:35 +01:00
Johannes Pfau
58ea0229d2 Merge branch 'master' into isRNG 2012-02-21 19:10:46 +01:00
Johannes Pfau
1c07d0a2cd Reimplement isRandomNumberGenerator 2012-02-08 17:16:17 +01:00
Johannes Pfau
324b541d6f Add isRandomNumberGenerator template 2012-01-19 12:59:23 +01:00
Daniel Green
58f4356ca2 Change version( Win32 ) to version( Windows ) when Win64 would be supported as well. 2012-01-16 22:10:18 -05:00
Brad Roberts
532b26e6e0 Merge pull request #348 from CyberShadow/std-random-randomsample
std.random: Fix documentation and one of randomSample's overloads.
2011-12-18 03:39:57 -08:00
Vladimir Panteleev
e18c9d6435 std.random: Fix documentation and one of randomSample's overloads. 2011-12-05 12:04:00 +02:00
David Nadlinger
e312f9898b Strict @property syntax compliance.
This enables the test suite to build with the -property switch enabled.

std.cpuid: vendor()/processor() have not been converted to properties in accordance to core.cpuid.
std.xml: Element.text() cannot be a property due to the optional parameter.
2011-12-04 09:56:14 +01:00
Laurie Clark-Michalek
41c4d79a71 Fixed typo in documentation for dice function in std.random 2011-10-27 01:30:27 +02:00
dsimcha
e7e12c0d57 Make c'tor public again 2011-10-19 09:25:57 -04:00
dsimcha
8d1222b9ae Make c'tor private since people should use free functions. 2011-10-14 20:51:23 -04:00
dsimcha
2b04619816 Bug 6802: RandomSample should take a generator as an argument 2011-10-12 22:37:08 -04:00
Brad Roberts
4aded5d345 break std.random's dependency on std.datetime 2011-10-02 23:37:55 -07:00
Brad Roberts
a8a6337ffa move getpid from phobos std.process to druntime core.thread and use in std.random 2011-10-02 00:27:01 -07:00
k-hara
78a2d8abdc Reduce module dependencies. 2011-09-29 07:09:16 +09:00
jmdavis
7bdcb69b21 Removed deprecated std.random.rand and rand_seed.
They've been deprecated since at least 2.039.
2011-08-14 20:12:52 -07:00
KennyTM~
852aa7d723 Remove the DDoc specialization for std.random.uniform.
Since Bug 6090 has been fixed, there is no need to have a special StdDdoc version
for std.random.uniform which replaces the unmatched ')' with '$(RPAREN)', as shown
in http://d-programming-language.org/phobos/std_random.html#uniform.
2011-07-04 17:39:53 +08:00
dawg
ab43002fa0 add unittests for std.random.uniform 2011-06-20 01:32:46 +02:00
dawg
8e96ae8b77 fix shift overflow 2011-06-19 04:54:22 +02:00
Andrei Alexandrescu
c1ec579fa5 Merge pull request #86 from andralex/website
Fix 672 broken links (complements work in d-programming-language.org)
2011-06-09 09:33:13 -07:00
Andrei Alexandrescu
5a0134dd10 Fixed 672 broken links 2011-06-09 09:48:53 -05:00
andralex
7b9460ec54 removed unused function 2011-06-06 13:40:26 -05:00
andralex
017c1e847d bugzilla 3785 + improvements 2011-06-06 13:31:09 -05:00
Andrei Alexandrescu
1083bd4e7b One pass through std.range and friends
* Made emplace faster and replaced calls to it to also make them faster.

* Replaced phobos.d in posix.mak with index.d.

* Added version=StdDdoc to documentation build in posix.mak, and replaced uses of D_Ddoc with it.

* Improved documentation target in posix.mak (target dir automatically created).

* Added nice documentation table and cheat sheet at the top of std.algorithm.

* Replaced a few helper structs in std.range and std.algorithm with local structs, which simplify matters a fair amount.

* Added more constraints to functions in std.algorithm (still work in progress).

* Improved error message in std.algorithm.sort in case of failure to sort.

* std.random.dice(1, 10) now works (no need for array notation std.random.dice([1, 10])).

* Fixed documentation bugs and insufficiencies in std.range (still more to do).

* Improved speed of walkLength.

* Simplified retro.

* Simplified and optimized stride. Also folded stride(stride(r, a), b) into stride(r, a * b).

* Added roundRobin to std.range, which as a perk simplified radial.

* Added takeOne and takeNone to std.range.

* Added unsigned to std.traits.
2011-02-27 12:38:49 -06:00
Walter Bright
046e1b36db add source links 2011-02-06 15:46:50 -08:00
Andrei Alexandrescu
1e4610663f Replaced ddoc symbol with the D_Ddoc built-in throughout 2011-01-22 21:36:53 +00:00
Jonathan M Davis
d8488a9865 Phobos has now been changed to use std.datetime. Also, bug# 3848 has been fixed.
std.gregorian, std.date, and std.dateparse have all been marked as
scheduled for deprecation. Everywhere (except for std.file) which was
using std.date is now using std.datetime. std.file is now using
std.datetime but has a number of functions still using d_time but which
are marked as scheduled for deprecation. I tried to give as many as I
could pragmas indicating that they were scheduled for deprecation, but
at the moment, that requires that a function be a templated function, and
I couldn't templatize all of them. So, some functions in std.file are
only marked as scheduled for deprecation in their documentation and will
not give any warning on compilation.

I had to rename several functions in std.file in order to avoid making
any breaking changes. And since I was already having to mess with
function names, it seemed like a good time to change the names of a
number of the functions in std.file to use proper capitalization
(such as changing isdir to isDir) as has been discussed and overwhelmingly
supported in the newsgroup with regards to std.string. And since I was
making those changes, it seemed like a good time to fix bug# 3848
(functions in std.file don't take symbolic links into account) as well.
So, std.file should now deal with symlinks properly.

The issue which Andrei brought up with +VERSION causing the std.datetime
unit tests to fail on OSX has been fixed as well.
2011-01-19 11:10:18 +00:00
Masahiro Nakagawa
b5058f6875 Fix std.random.XorshiftEngine for 64bit environment 2011-01-10 18:19:12 +00:00
Masahiro Nakagawa
2f7bcb8dce Add max / min properties to Xorshift 2011-01-10 15:56:40 +00:00