Commit Graph

89 Commits

Author SHA1 Message Date
Neil Toronto
8f17913d55 Fixed memory leak in making arrays strict: doing so wouldn't clear
the reference to the original procedure, which itself could hold on
to a lot of memory
2012-12-02 22:21:28 -07:00
Neil Toronto
e4f5a0598f Changed how array strictness works: `array-strict' now makes the
original array strict instead of returning a new strict array.
(Finally!) The hard part is keeping the Array type covariant. The
solution is to keep the store in the closure of the array's
procedure instead of in the Array struct itself.
2012-11-29 22:17:06 -09:00
Neil Toronto
0182a6c491 Worked around new typed/rackunit limitations in "array-tests.rkt" and
"mandelbrot-test.rkt"

Fixed error in `array-count' revealed by correctly failing test

Simplified Mandelbrot test
2012-11-29 15:45:17 -07:00
Neil Toronto
5a43f2c6bc Finished array documentation!
Cleaned up other docs in preparation for alpha-testing announcement

Created `math/utils' module for stuff that doesn't go anywhere else (e.g.
FFT scaling convention, max-math-threads parameters)

Reduced the number of macros that expand to applications of `array-map'

Added `flvector-sum', defined `flsum' in terms of it

Reduced the number of pointwise `flvector', `flarray' and `fcarray' operations

Reworked `inline-build-flvector' and `inline-flvector-map' to be faster and
expand to less code in both typed and untyped Racket

Redefined conversions like `list->flvector' in terms of for loops (can do
it now that TR has working `for/flvector:', etc.)
2012-11-29 15:45:17 -07:00
Neil Toronto
6009eed8d2 Moved flvector functions into math/flonum
Sped up normal distribution sampling procedure (2x for large samples)
2012-11-29 15:45:17 -07:00
Neil Toronto
cd002d5830 Documented `math/array' folds
Refactored many of the fold functions (e.g. `array-axis-andmap' is gone,
replaced by short-cutting `array-axis-and', which is sufficient because the
result of `array-map' is non-strict; added `array-count', `array-all-fold';
removed `array-all=' and friends)

Turned common folds into macros (preserves return types better, speeds up
compilation time)

Exposed a safe variant of `unsafe-array-axis-reduce'
2012-11-29 15:45:17 -07:00
Neil Toronto
9249929c45 Documented array printing, broadcasting, and transformations 2012-11-29 15:45:17 -07:00
Neil Toronto
7aadf33ead Implemented `flmultinomial' (not accurately, but it's there); changed
argument types to match `multinomial'
2012-11-29 15:45:16 -07:00
Neil Toronto
96d1400654 Renamed functions
* bernoulli -> bernoulli-number
 * farey -> farey-sequence
 * fibonacci/mod -> modular-fibonacci
 * order -> unit-group-order
 * orders -> unit-group-orders

Documented `make-fibonacci' and `make-modular-fibonacci'

Reworked text about loading external libraries in docs for `math/bigfloat'

Removed type aliases like Z, Q, Prime (I like them, but TR was printing them
in unexpected places like array return types)
2012-11-27 22:23:42 -07:00
Neil Toronto
6f1ffecc23 Stubbed out missing math/array' and math/statistics' doc entries to
clean up build

Moved `float-complex?' and `number->float-complex' to `math/base',
documented them

Documented `flexpt1p'

Removed `samples->immutable-hash' (not covariant anyway; not going to
use hashes)
2012-11-27 18:05:38 -07:00
Neil Toronto
2d34811ab6 Finished `math/distributions' documentation!
Fixed a few limit cases in some distributions (e.g. (uniform-dist 0 0) didn't
act like a delta distribution, (beta-dist 0 0) and (beta-dist +inf.0 +inf.0)
pretended to be defined by unique limits even though they can't be)

Made integer distributions' pdfs return +nan.0 when given non-integers

Added "private/statistics/counting.rkt", for hashing and binning samples

Added `flvector-sums' (cumulative sums with single rounding error)

Added `flinteger?', `flnan?' and `flrational?', which are faster than their
non-flonum counterparts (at least in Typed Racket; haven't tested untyped)
2012-11-27 13:44:15 -07:00
Neil Toronto
8aa623c2e8 Made plots in plot' and math' render nicely in PDFs (plots in docs are picts now)
Fixed errors in `linear-seq' when end <= start
2012-11-25 22:32:07 -08:00
Neil Toronto
3670916a11 Initial commit for `math/array' documentation; about 65% finished
Replaced pointwise operators with macros that expand to applications of `array-map'; allows more precise return types and reduces compilation time

Changed literal array syntax to use #() to delimit rows instead of [] (still suggest using square parens, though)

Minor refactoring

Fixed a macro so that the only problem with "array-tests.rkt" now is that typed/rackunit is b0rked
2012-11-24 22:13:24 -07:00
Jens Axel Søgaard
7ef4bec534 Added more margin notes 2012-11-24 14:00:34 +01:00
Jens Axel Søgaard
50c03c3622 Renamed polygonal functions to include -number the name. 2012-11-23 16:09:28 +01:00
Jens Axel Søgaard
fdfaf6bee0 Added von Mangoldt function 2012-11-23 16:04:37 +01:00
Neil Toronto
0936d8c20b Reworked distribution API, finally happy with it (as happy as I can be without being able to partially instantiate polymorphic parent struct types)
Added docs for math/distributions (about 75% finished)
Started docs for math/array (very incomplete)
2012-11-21 21:16:35 -07:00
Neil Toronto
68af24780d Manually applied Jens Axel's patch to add `random-prime' 2012-11-17 21:19:46 -09:00
Jens Axel Søgaard
e655e97a83 Better example for prime-omega 2012-11-17 21:03:47 -09:00
Jens Axel Søgaard
69f6d8ce52 Added prime-omega 2012-11-17 21:02:59 -09:00
Neil Toronto
1e52736089 Documentation style changes
Fixes after merge weirdness from pull request (specifically, removed `bfrandom' from "mpfr.rkt" again)
Removed dependence of math/flonum on math/bigfloat (better build parallelization)
Changed `divides?' to return #f when its first argument is 0
Made return type of `quadratic-character' more precise
Made argument types more permissive:
 * second argument to `solve-chinese'
 * second argument to `next-primes'
 * second argument to `prev-primes'
2012-11-17 21:02:37 -09:00
Jens Axel Søgaard
db500e8b58 Fixed next-prime and prev-prime problem 2012-11-17 21:02:37 -09:00
Jens Axel Søgaard
7e89adece4 Moved links to margin. Added more links 2012-11-17 21:02:37 -09:00
Jens Axel Søgaard
f208d0dae8 Add note about untyped- in docs for next-prime and prev-prime 2012-11-17 21:02:37 -09:00
Jens Axel Søgaard
bbef490fb0 Fixed missing import for curry 2012-11-17 21:02:36 -09:00
Jens Axel Søgaard
9307cbb120 Changed size of prime arrary to 10000 2012-11-17 21:02:36 -09:00
Jens Axel Søgaard
2178282fd6 Documentation for order, orders, primitive-root, exists-primitive-root?, primitive-roots 2012-11-17 21:02:36 -09:00
Jens Axel Søgaard
0af1cb034e Documentation of tangent-number, quadratic-solutions, quadratic-residue and quadratic-character 2012-11-17 21:02:36 -09:00
Jens Axel Søgaard
63b5f47989 Documentation on mediant 2012-11-17 21:02:36 -09:00
Jens Axel Søgaard
00a886ea0c Documentation on polygonal numbers 2012-11-17 21:02:36 -09:00
Jens Axel Søgaard
f68cc0ada6 More documentation on number theoretic functions 2012-11-17 21:02:36 -09:00
Jens Axel Søgaard
8b99eb5b6a Headline in docs 2012-11-17 21:02:36 -09:00
Jens Axel Søgaard
e81f9eb146 Added bindings to number theoretic functions 2012-11-17 21:02:36 -09:00
Neil Toronto
aa83f80d64 Removed extraneous files that DrDr was running 2012-11-17 11:57:13 -07:00
Matthew Flatt
eaf68e6e85 GMP and MPFR as pre-build libraries for Mac OS X and Windows
Also, add versions for Unix references, and adjust the way that
missing bindings are handled.
2012-11-16 22:21:54 -07:00
Neil Toronto
e88fe44ff5 Made bigfloats serializable 2012-11-16 17:10:37 -07:00
Neil Toronto
97fa28552d Removed runtime dependence on libmpfr; DrDr should be able to test all but tests/bigfloat-test.rkt now 2012-11-16 15:39:15 -07:00
Matthew Flatt
9a48e5d1e5 math: avoid import at unnecessary phase
This repair avoids using at compile time external libraries that
are needed at run time.
2012-11-16 14:10:32 -07:00
Neil Toronto
f2dc2027f6 Initial math library commit. The history for these changes is preserved
in the original GitHub fork:

  https://github.com/ntoronto/racket

Some things about this are known to be broken (most egregious is that the
array tests DO NOT RUN because of a problem in typed/rackunit), about half
has no coverage in the tests, and half has no documentation. Fixes and
docs are coming. This is committed now to allow others to find errors and
inconsistency in the things that appear to be working, and to give the
author a (rather incomplete) sense of closure.
2012-11-16 11:39:51 -07:00