Commit Graph

28 Commits (f2a40f88dc4bb13a2974fb6ee8a5a2fbd706aefd)

Author SHA1 Message Date
Cat Stevens 573e4ed198 math.matrices: fix/rename mnorm, update all norms
closes #2244

- `mnorm` has been renamed to `normalize-matrix`
	to reflect what it actually does, which
	is normalize a matrix, not find a norm
	of a matrix.

- `mnorm` is no longer a word defined here.

- bugfix: previously, `normalize-matrix` found
	the supremum of a matrix (`mmax`),
	before taking the supremum's absolute
	value (`abs`) and dividing the matrix
	by it (`m/n`).
	for matrices containing only negative
	values and 0, the supremum is 0, and
	a `div-by-zero` error was thrown.

	`normalize-matrix` has been fixed to
	first `abs` all the matrix elements,
	and then find the supremum and divide,

	it also receieved a zero-matrix? guard
	for optimization and preventing
	`div-by-zero`.

- new alias: `hilbert-schmidt-norm` for
	`frobenius-norm`,  to go along with
	`math.matrices.extras.<hilbert-matrix>`
	and improve searchability by physicists.

- new word: `matrix-p-norm`, written as an
	analogue of `math.vectors.p-norm`.

- new word: `matrix-p-q-norm`, which generalizes
	entrywise matrix norm over the L^p,q
	vector space.

- new word: `matrix-p-norm-entrywise`:
	`matrix-p-norm`'s fallback
	for p =/= 1, 2, inf; analogue of
	`math.vectors.p-norm-default`.

- all norm words have gotten new docs,
	`zero-matrix?` guards as an optimisation,
	and most have gotten new tests.
2020-03-01 03:31:28 +00:00
John Benediktsson 07a5912afa math.matrices: rename m./m.v/v.m to mdot/mdotv/vdotm. 2020-02-26 12:51:04 -08:00
John Benediktsson dfdbde9f33 math.matrices: use any? and all? directly in tests. 2020-01-28 20:44:19 -08:00
John Benediktsson 464f0a11ef math.matrices: update using on tests. 2020-01-28 20:38:43 -08:00
John Benediktsson 548109bf4b math: use sorted-histogram values in a few places. 2020-01-28 16:21:33 -08:00
Cat Stevens 4350bcbfcd math.matrices: rewrite, modernize and overhaul
math.matrices.elimination: move to extra
math.matrices.extras: expand with esoteric, less-used and unfinished code from basis

- math.matrices and .extras receive more words, tests, and docs
- matrix has become a predicate class
- 94% of matrices words have complete docs
- 77% of matrices.extras words have complete docs
- much more consistent naming for constructors etc
- added missing words / features such as main-diagonal and anti-transpose
- optimizations
- lots of documentation
2019-12-08 08:08:54 -08:00
Doug Coleman 0e51880199 math.matrices: Add some more matrix norms. 2018-07-04 16:14:44 -05:00
Björn Lindqvist 97d9cee732 math.matrices: rename for consistency
Getting the sample cov matrix is actually much more common than getting
the population one.
2018-02-24 23:11:22 +01:00
Doug Coleman 892c62e1dc factor: second stab at [ ] [ ] unit-test -> { } [ ] unit-test 2015-07-03 09:39:59 -07:00
Doug Coleman 59f3b1ea57 Revert "factor: rename [ ] [ ] unit-test -> { } [ ] unit-test using a refactoring tool!"
Needs a bit more work.

This reverts commit 7e54cc2824.
2015-07-02 13:47:06 -07:00
Doug Coleman 7e54cc2824 factor: rename [ ] [ ] unit-test -> { } [ ] unit-test using a refactoring tool! 2015-07-02 11:36:08 -07:00
Doug Coleman 999aa7c897 factor: clean up spaces in -tests files 2015-07-02 10:34:01 -07:00
John Benediktsson abd069c1ad math.matrices: add error for negative m^n (and test). 2014-01-05 20:08:55 -08:00
John Benediktsson 57b7a5fd6f math.matrices: add tests for square-matrix?. 2013-04-25 14:48:16 -07:00
Doug Coleman 4c4d186ae4 math.matrices: Trying to flesh out the matrices vocabulary a bit. 2012-10-22 09:47:36 -07:00
Doug Coleman 7906632952 math.matrices: Add some combinators for iterating over matrices. Add covariance matrix. 2012-10-22 09:47:35 -07:00
John Benediktsson 2e9c20a12e math.matrices: adding the outer product. 2012-08-08 17:02:39 -07:00
Doug Coleman ffe1c510ae math.matrices: rename van-der-monde to vandermonde 2012-07-30 16:44:08 -07:00
John Benediktsson 088dfa4861 math.matrices: adding van-der-monde matrix. 2012-07-30 16:15:21 -07:00
Doug Coleman aad94d711b math.matrices: Add another test to make sure we calculate kron correctly. 2012-05-24 09:02:47 -07:00
Doug Coleman 78f1ca9f14 math.matrices: Add stitch. Add Kronecker product. 2012-05-24 08:53:47 -07:00
John Benediktsson 495637a087 math.matrices: adding hilbert-matrix, toeplitz-matrix, hankel-matrix, and box-matrix. 2012-05-04 18:01:21 -07:00
Doug Coleman 6f3fe950a7 math.matrices: Add a diagonal-matrix word that makes an nxn matrix from a sequence.
Optimize identity-matrix word -- 2-3x faster using diagonal-matrix.
Add an eye word that makes an mxn diagonal matrix with a diagonal offset by k.
2012-05-04 11:31:05 -07:00
Slava Pestov 3dbb8e6153 math.matrices: move normal word from gpu.demos.bunny and reverse sign 2010-07-23 20:41:08 -07:00
Erik Charlebois cebabdc323 Add perp and angle-between words for vectors. Fix bug in cross product and add unit tests. 2010-02-25 16:46:02 -08:00
Slava Pestov 7826543d2e sequences: add cartesian-each, cartesian-map, cartesian-product words to eliminate some duplication throughout the codebase 2010-02-25 20:54:57 +13:00
prunedtree 9ffbf32c6f unit test for m^n 2009-06-12 01:35:25 -07:00
Slava Pestov 9add08c200 Move math.matrices to basis 2009-04-18 04:09:16 -05:00