about summary refs log tree commit diff
path: root/src/libstd/rand/distributions
AgeCommit message (Collapse)AuthorLines
2014-03-12std: Move rand to librand.Huon Wilson-1631/+0
This functionality is not super-core and so doesn't need to be included in std. It's possible that std may need rand (it does a little bit now, for io::test) in which case the functionality required could be moved to a secret hidden module and reexposed by librand. Unfortunately, using #[deprecated] here is hard: there's too much to mock to make it feasible, since we have to ensure that programs still typecheck to reach the linting phase.
2014-03-04Rename all variables that have uppercase characters in their names to use ↵Palmer Cox-6/+6
only lowercase characters
2014-02-28std: Change assert_eq!() to use {} instead of {:?}Alex Crichton-1/+1
Formatting via reflection has been a little questionable for some time now, and it's a little unfortunate that one of the standard macros will silently use reflection when you weren't expecting it. This adds small bits of code bloat to libraries, as well as not always being necessary. In light of this information, this commit switches assert_eq!() to using {} in the error message instead of {:?}. In updating existing code, there were a few error cases that I encountered: * It's impossible to define Show for [T, ..N]. I think DST will alleviate this because we can define Show for [T]. * A few types here and there just needed a #[deriving(Show)] * Type parameters needed a Show bound, I often moved this to `assert!(a == b)` * `Path` doesn't implement `Show`, so assert_eq!() cannot be used on two paths. I don't think this is much of a regression though because {:?} on paths looks awful (it's a byte array). Concretely speaking, this shaved 10K off a 656K binary. Not a lot, but sometime significant for smaller binaries.
2014-02-20move extra::test to libtestLiigo Zhuang-3/+6
2014-02-17Remove Real trait and move methods into FloatBrendan Zabarauskas-3/+3
This is part of the effort to simplify `std::num`, as tracked in issue #10387.
2014-02-14Fix all code examplesAlex Crichton-1/+1
2014-01-26Removed all instances of XXX in preparation for relaxing of FIXME ruleSalem Talha-1/+1
2014-01-17Add a generic power functionFlavio Percoco-1/+1
The patch adds a `pow` function for types implementing `One`, `Mul` and `Clone` trait. The patch also renames f32 and f64 pow into powf in order to still have a way to easily have float powers. It uses llvms intrinsics. The pow implementation for all num types uses the exponentiation by square. Fixes bug #11499
2014-01-09Merge some numeric traits with Real and don't re-export RealExtBrendan Zabarauskas-3/+3
The methods contained in `std::num::{Algebraic, Trigonometric, Exponential, Hyperbolic}` have now been moved into `std::num::Real`. This is part of an ongoing effort to simplify `std::num` (see issue #10387). `std::num::RealExt` has also been removed from the prelude because it is not a commonly used trait.
2014-01-07stdtest: Fix all leaked trait importsAlex Crichton-20/+18
2014-01-07std: Fill in all missing importsAlex Crichton-3/+9
Fallout from the previous commits
2014-01-06Remove some unnecessary type castsFlorian Hahn-1/+1
Conflicts: src/librustc/middle/lint.rs
2014-01-04Don't allow newtype structs to be dereferenced. #6246Brian Anderson-11/+14
2013-12-26std::rand: remove the `fn main()` from the examples.Huon Wilson-46/+30
2013-12-23std: Fix all code examplesAlex Crichton-6/+6
2013-12-15std: fix spelling in docs.Huon Wilson-3/+3
2013-12-08std::rand: implement the student t distribution.Huon Wilson-1/+52
2013-12-08std::rand: implement the F distribution.Huon Wilson-1/+60
2013-12-08std::rand: implement the chi-squared distribution.Huon Wilson-2/+99
2013-12-07std::rand: implement the log-normal distribution.Huon Wilson-2/+58
2013-12-07std::rand: move normal and exponential to their own file.Huon Wilson-244/+303
2013-11-26test: Remove non-procedure uses of `do` from compiletest, libstd tests,Patrick Walton-8/+8
compile-fail tests, run-fail tests, and run-pass tests.
2013-11-26librustc: Remove remaining uses of `&fn()` in favor of `||`.Patrick Walton-6/+8
2013-11-22std::rand: move TaskRng off @mut.Huon Wilson-14/+14
Replace with some unsafe code by storing a pointer into TLS-owned heap data.
2013-11-18std::rand: wrappers for floats from [0,1] and (0,1).Huon Wilson-16/+9
Provide `Closed01` and `Open01` that generate directly from the closed/open intervals from 0 to 1, in contrast to the plain impls for f32 and f64 which generate the half-open [0,1). Fixes #7755.
2013-11-01std::rand: share the benchmark counter among the whole module tree.Huon Wilson-13/+10
2013-11-01std::rand: Implement the Gamma distribution.Huon Wilson-0/+219
2013-11-01std::rand: Move distributions to a subfolder.Huon Wilson-0/+1104