about summary refs log tree commit diff
path: root/src/libextra/stats.rs
AgeCommit message (Collapse)AuthorLines
2014-03-14extra: Put the nail in the coffin, delete libextraAlex Crichton-1057/+0
This commit shreds all remnants of libextra from the compiler and standard distribution. Two modules, c_vec/tempfile, were moved into libstd after some cleanup, and the other modules were moved to separate crates as seen fit. Closes #8784 Closes #12413 Closes #12576
2014-03-06fix typos with with repeated words, just like this sentence.Kang Seonghoon-1/+1
2014-03-05stats: fix handling of NaN in `min` and `max`Daniel Micay-3/+11
The `cmp::min` and `cmp::max` functions are not correct with partially ordered values. #12712
2014-02-24Transition to new `Hash`, removing IterBytes and std::to_bytes.Huon Wilson-1/+1
2014-02-23Move std::{trie, hashmap} to libcollectionsAlex Crichton-1/+1
These two containers are indeed collections, so their place is in libcollections, not in libstd. There will always be a hash map as part of the standard distribution of Rust, but by moving it out of the standard library it makes libstd that much more portable to more platforms and environments. This conveniently also removes the stuttering of 'std::hashmap::HashMap', although 'collections::HashMap' is only one character shorter.
2014-02-21std: rewrite Hash to make it more genericErick Tryzelaar-0/+1
This patch merges IterBytes and Hash traits, which clears up the confusion of using `#[deriving(IterBytes)]` to support hashing. Instead, it now is much easier to use the new `#[deriving(Hash)]` for making a type hashable with a stream hash. Furthermore, it supports custom non-stream-based hashers, such as if a value's hash was cached in a database. This does not yet replace the old IterBytes-hash with this new version.
2014-02-20Mass rename if_ok! to try!Alex Crichton-11/+11
This "bubble up an error" macro was originally named if_ok! in order to get it landed, but after the fact it was discovered that this name is not exactly desirable. The name `if_ok!` isn't immediately clear that is has much to do with error handling, and it doesn't look fantastic in all contexts (if if_ok!(...) {}). In general, the agreed opinion about `if_ok!` is that is came in as subpar. The name `try!` is more invocative of error handling, it's shorter by 2 letters, and it looks fitting in almost all circumstances. One concern about the word `try!` is that it's too invocative of exceptions, but the belief is that this will be overcome with documentation and examples. Close #12037
2014-02-20move extra::test to libtestLiigo Zhuang-1/+2
2014-02-14Fix all code examplesAlex Crichton-1/+1
2014-02-11Move replace and swap to std::mem. Get rid of std::utilEdward Wang-2/+2
Also move Void to std::any, move drop to std::mem and reexport in prelude.
2014-02-03extra: Fix tests with io_error usageAlex Crichton-6/+6
2014-02-03extra: Remove io_error usageAlex Crichton-14/+17
2014-01-21[std::str] Rename from_utf8_owned_opt() to from_utf8_owned(), drop the old ↵Simon Sapin-1/+1
from_utf8_owned() behavior
2014-01-17auto merge of #11503 : FlaPer87/rust/master, r=huonwbors-2/+2
The patch adds the missing pow method for all the implementations of the Integer trait. This is a small addition that will most likely be improved by the work happening in #10387. Fixes #11499
2014-01-17Tweak the interface of std::ioAlex Crichton-1/+1
* Reexport io::mem and io::buffered structs directly under io, make mem/buffered private modules * Remove with_mem_writer * Remove DEFAULT_CAPACITY and use DEFAULT_BUF_SIZE (in io::buffered)
2014-01-17Add a generic power functionFlavio Percoco-2/+2
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-09auto merge of #11402 : bjz/rust/remove-approx, r=alexcrichtonbors-0/+8
This trait seems to stray too far from the mandate of a standard library as implementations may vary between use cases. Third party libraries should implement their own if they need something like it. This closes #5316. r? @alexcrichton, @pcwalton
2014-01-08Remove the io::Decorator traitAlex Crichton-2/+1
This is just an unnecessary trait that no one's ever going to parameterize over and it's more useful to just define the methods directly on the types themselves. The implementors of this type almost always don't want inner_mut_ref() but they're forced to define it as well.
2014-01-09Remove ApproxEq and assert_approx_eq!Brendan Zabarauskas-0/+8
This trait seems to stray too far from the mandate of a standard library as implementations may vary between use cases.
2014-01-07extratest: Fix all leaked trait importsAlex Crichton-1/+1
2013-12-22std::vec: make the sorting closure use `Ordering` rather than just beingHuon Wilson-3/+22
(implicitly) less_eq.
2013-12-21std::vec: add a sugary .sort() method for plain Ord sorting.Huon Wilson-3/+3
This moves the custom sorting to `.sort_by`.
2013-12-20extra: remove sort in favour of the std method.Huon Wilson-4/+3
Fixes #9676.
2013-12-18auto merge of #10927 : g3xzh/rust/sum_bugfix, r=huonwbors-1/+66
`[1e20, 1.0, -1e20].sum()` returns `0.0`. This happens because during the summation, `1.0` is too small relative to `1e20`, making it negligible. I have tried Kahan summation but it hasn't fixed the problem. Therefore, I've used Python's `fsum()` implementation. For more details, read: www.cs.cmu.edu/~quake-papers/robust-arithmetic.ps https://github.com/mozilla/rust/issues/10851 Python's fsum (msum) http://code.activestate.com/recipes/393090/ @huonw, your feedback is more than welcome. It looks unpolished; Do you have suggestions how to make it more beautiful and elegant? Thanks in advance,
2013-12-19Fix `sum()` accuracyg3xzh-1/+66
`[1e20, 1.0, -1e20].sum()` returns `0.0`. This happens because during the summation, `1.0` is too small relative to `1e20`, making it negligible. I have tried Kahan summation but it hasn't fixed the problem. Therefore, I've used Python's `fsum()` implementation with some help from Jason Fager and Huon Wilson. For more details, read: www.cs.cmu.edu/~quake-papers/robust-arithmetic.ps Moreover, benchmark and unit tests were added. Note: `Status.sum` is still not fully fixed. It doesn't handle NaNs, infinities and overflow correctly. See issue 11059: https://github.com/mozilla/rust/issues/11059
2013-12-13auto merge of #10923 : boredomist/rust/export-summary-members, r=alexcrichtonbors-12/+7
Several of the members of `extra::stats::Summary` were calculated and tested, but not exposed externally. This change exposes all of the members.
2013-12-11Make priv members of extra::stats::Summary public.Erik Price-12/+7
2013-12-11Make 'self lifetime illegal.Erik Price-1/+1
Also remove all instances of 'self within the codebase. This fixes #10889.
2013-11-11Move std::rt::io to std::ioAlex Crichton-4/+4
2013-10-24Remove even more of std::ioAlex Crichton-29/+28
Big fish fried here: extra::json most of the compiler extra::io_util removed extra::fileinput removed Fish left to fry extra::ebml
2013-10-23Removed Unnecessary comments and white spaces #4386reedlepee-1/+0
2013-10-23Making fields in std and extra : private #4386reedlepee-7/+13
2013-10-15Require module documentation with missing_docAlex Crichton-0/+2
Closes #9824
2013-10-07Fix existing privacy/visibility violationsAlex Crichton-1/+2
This commit fixes all of the fallout of the previous commit which is an attempt to refine privacy. There were a few unfortunate leaks which now must be plugged, and the most horrible one is the current `shouldnt_be_public` module now inside `std::rt`. I think that this either needs a slight reorganization of the runtime, or otherwise it needs to just wait for the external users of these modules to get replaced with their `rt` implementations. Other fixes involve making things pub which should be pub, and otherwise updating error messages that now reference privacy instead of referencing an "unresolved name" (yay!).
2013-09-30extra: Remove usage of fmt!Alex Crichton-6/+6
2013-08-27librustc: Fix problem with cross-crate reexported static methods.Patrick Walton-1/+1
2013-08-16doc: correct spelling in documentation.Huon Wilson-1/+1
2013-08-12Fixed #8451 - extra::stats::write_boxplot() applied to negative or zero ↵David Manescu-4/+33
sample values
2013-08-07Forbid `priv` where it has no effectAlex Crichton-1/+1
This is everywhere except struct fields and enum variants.
2013-08-07Add frequency count to extra::stat. #8281Mihnea Dobrescu-Balaur-0/+11
2013-08-03remove obsolete `foreach` keywordDaniel Micay-2/+2
this has been replaced by `for`
2013-08-01migrate many `for` loops to `foreach`Daniel Micay-2/+2
2013-07-17librustc: Remove all uses of "copy".Patrick Walton-1/+1
2013-07-12Remove the global 'vec::to_owned' functionAlex Crichton-4/+3
2013-07-11extra: simplify the bench stat loop, improve stability somewhat (?)Graydon Hoare-1/+4
2013-07-08 Replaces the free-standing functions in f32, &c.Jens Nockert-2/+1
The free-standing functions in f32, f64, i8, i16, i32, i64, u8, u16, u32, u64, float, int, and uint are replaced with generic functions in num instead. If you were previously using any of those functions, just replace them with the corresponding function with the same name in num. Note: If you were using a function that corresponds to an operator, use the operator instead.
2013-06-30extra: docs, tests and new functionality for the extra::stats moduleGraydon Hoare-18/+830
2013-06-29Great renaming: propagate throughout the rest of the codebaseCorey Richardson-5/+4
2013-06-23vec: remove BaseIter implementationDaniel Micay-1/+1
I removed the `static-method-test.rs` test because it was heavily based on `BaseIter` and there are plenty of other more complex uses of static methods anyway.
2013-06-16remove unused importsHuon Wilson-1/+0