* Split "matrix-constructors.rkt" into three parts:
* "matrix-constructors.rkt"
* "matrix-conversion.rkt"
* "matrix-syntax.rkt"
* Made `matrix-map' automatically inline (it's dirt simple)
* Renamed a few things, changed some type signatures
* Fixed error in `matrix-dot' caught by testing (it was broadcasting)
* Rewrote matrix comprehensions in terms of array comprehensions
* Removed `in-column' and `in-row' (can use `in-array', `matrix-col' and
`matrix-row')
* Tons of new rackunit tests: only "matrix-2d.rkt" and
"matrix-operations.rkt" are left (though the latter is large)
* Finally added `array-axis-expand' as a dual for `array-axis-reduce'
in order to implement `vandermonde-matrix' elegantly
* Better, shorter matrix multiply; reworked all matrix arithmetic
* Split "matrix-operations.rkt" into at least 5 parts:
* "matrix-operations.rkt"
* "matrix-basic.rkt"
* "matrix-comprehension.rkt"
* "matrix-sequences.rkt"
* "matrix-column.rkt"
Added "matrix-constructors.rkt"
Added `matrix', `row-matrix', and `col-matrix' macros
A lot of other little changes
Currently, `in-row' and `in-column' are broken. I intend to implement
them in a way that makes them work in untyped and Typed Racket.
* `list->array' now accepts an optional shape argument, and always returns
an immutable array
* `vector->array' now accepts an optional shape argument, and always
returns a mutable array
* Removed `make-mutable-array' because `vector->array' does its job now (I
never liked the name anyway)
* Renamed `unsafe-mutable-array' to `unsafe-vector->array'
* Added optional type annotation to `array' macro to match `mutable-array'
* Reworded error messages in array broadcasting functions
* Made minor array doc fixes
renamed `partition-count' to `partitions' to be consistent with
`permutations', and gave better examples in `multinomial' docs
* (flulp-error +inf.0 +nan.0) was returning +nan.0 instead of +inf.0
* Type of `multinomial' didn't match its docs or `flmultinomial'
* Reworded docs for `diagonal-array'
* Reworked/reordered quite a few things in docs for `math/bigfloat'
* Fixed first identity given in `gamma-inc' docs
* Fixed descrption for `+max.0', etc.
* Fixed and added tests for `quantile' and `median', documented them
* Added `sort-samples', documented it
* Removed `real-quantile' and `real-median' (too many design choices
right now; will revisit when implementing Kernel Density Estimators)
* Documented `absdev' and `absdev/median'
* Fixed `update-statistics*': now uses O(1) space as advertised (if the
sequences of values and weights both use O(1) space)
* Changed types of binning functions: allows using #:key in the future
(when TR supports function type cases that differ only by keyword
argument types better), places optional weights at the end like other
statistics functions
* Clarified binning docs about sort stability and half-open intervals
When libmpfr wasn't available, the function created by `make-not-available'
would try to print any _mpfr arguments, which would call the custom _mpfr
printer, which would try to use a libmpfr function, which would call the
function created by `make-not-available', which would try to print...
Cleaned up expected value code a little
Refactored running statistics objects (hid private fields, added
`update-statistics*')
Documented expected value functions and running statistics
Removed `bfpsi0' from bigfloat tests (DrDr's libmpfr doesn't have it)
Commented out custodian shutdown callback that frees MPFR's cache
(something's broken)
of libmpfr (like DrDr's) that don't have it
Reimplemented really simple FFI functions (e.g. mpfr-prec, mpfr-exp) to
avoid calling overhead
Renamed `bigfloat-sign' to `bigfloat-signbit'
Renamed `bigfloat-sig+exp' to `bigfloat->sig+exp' (for symmetry with
`sig+exp->bigfloat')
use longs for the "limbs" of bigints. However, when GMP's configure script
detects that mingw64 is compiling, it defines LONG_LONG_LIMB, which makes the
type of limbs long long, or 64 bits. This is fine; a 64-bit machine should use
64-bit ints for the digits of its bigints. It would have been nice to know
this special case earlier, though I can see why it's not advertised: most
users don't need to know, and it seems like it's obviously the right choice to
make when dealing with Win64's annoying ABI.
Made "mpfr.rkt" search for 'mpfr_set_z_exp if 'mpfr_set_z_2exp isn't found.
Hopefully this allows the bigfloat tests to finish on DrDr. If not, DrDr
will need a libmpfr upgrade.
Made some minor doc fixups
Fixed bigfloat functions that assumed (fixnum? x) means x fits in a _long
(not true on Win64)
Hopefully fixed dangling pointer errors that broke `math/bigfloat' on Win64.
It apparently had no _long/_int mismatches, but GC on Win64 will run between
creating an `_mpz' and using its value after passing it as an output argument
to MPFR functions. That doesn't seem to happen on 64-bit Linux or Mac. No
idea why, but Win64 exposed the problem so... that's good, I guess.
Rewrote `rational->bigfloat' to not use GMP's rationals
More/better bigfloat tests
Added bigfloat stress test w/ weak leak detection
Reenabled custodian shutdown callback that clears MPFR constants, because it
seems to work now
Removed `mpfr-available?' because it would only return non-#f
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.
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.)
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'
* 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)
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)
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)
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
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'