The fix consists of three parts:
1. Rewriting `inline-matrix*'. The material change here is that the
expansion now contains only direct applications of `+' and `*'.
TR's optimizer replaces them with `unsafe-fx+' and `unsafe-fx*',
which keeps intermediate flonum values from being boxed.
2. Making the types of all functions that operate on (Matrix Number)
values more precise. Now TR can prove that matrix operations preserve
inexactness. For example, matrix-conjugate : (Matrix Flonum) ->
(Matrix Flonum) and three other cases for Real, Float-Complex, and
Number.
3. Changing the return types of some functions that used to return
things like (Matrix (U A 0)). Now that we worry about preserving
inexactness, we can't have `matrix-upper-triangle' always return a
matrix that contains exact zeros. It now accepts an optional `zero'
argument of type A.
* Fixed type of `matrix-expt'
* Made matrix functions respect `array-strictness' parameter (mostly
wrapping functions with `parameterize' and return values with
`array-default-strictness'; reindentation makes changes look larger)
* Added strictness tests
* Gram-Schmidt using vector type
* QR decomposition
* Operator 1-norm and maximum norm; stub for 2-norm and angle between
subspaces (`matrix-basis-angle')
* `matrix-absolute-error' and `matrix-relative-error'; also predicates
based on them, such as `matrix-identity?'
* Lots of shuffling code about
* Types that can have contracts, and an exhaustive test to make sure
every value exported by `math/matrix' has a contract when used in
untyped code
* Some more tests (still needs some)
* 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.
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.