Commit Graph

73 Commits (14b1418f6a0c76397d0030c548408c56b4031163)

Author SHA1 Message Date
John Benediktsson de3b74d1c6 basis/extra: move fewer things. 2020-04-01 21:37:28 -07:00
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 1c5d417100 math.vectors: rename "v." to "vdot" 2020-02-26 12:40:16 -08:00
John Benediktsson 2cbcacad88 core/basis/extra: update some tags.txt. 2020-02-26 10:57:08 -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
Doug Coleman 9f213f96f6 core: Add the shuffler words but without primitives.
The nipd branch slowed bootstrap by a minute, this patch does not.

sorry about changing the fjsc line endings...
2018-06-19 22:52:58 -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
John Benediktsson b40ba26bac basis/extra: removing '[ @ ] in favor of _ for fried quotations. 2018-01-19 23:40:23 -08:00
Doug Coleman e189954ecc core: Rename iota to <iota> so we can have TUPLE: iota ... ; instead of TUPLE: iota-tuple ... ; 2017-06-02 11:57:05 -05:00
John Benediktsson 55cf5472a5 using [ ] [ ... ] ?if instead of [ nip ] [ ... ] if*. 2016-07-11 19:50:37 -07:00
John Benediktsson e477f6996f Fix comments to be ! not #!. 2015-09-08 16:15:10 -07:00
John Benediktsson ceb75057da change ERROR: words from throw-foo back to foo. 2015-08-13 16:13:05 -07:00
Doug Coleman b6be8685c3 basis: ERROR: changes. 2015-08-13 03:20:39 -07:00
John Benediktsson 5eec781b40 use ``if*`` instead of ``dup [ ] [ drop ] if``. 2015-07-20 22:24:30 -07:00
John Benediktsson c89cdc4c67 math.matrices.elimination: avoid double length call. 2015-07-14 15:59:24 -07: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 b366a06c41 use reject instead of [ ... not ] filter. 2015-05-12 18:50:34 -07:00
John Benediktsson 818f337b02 cleanup "over push" is "suffix!". 2014-11-30 08:38:59 -08:00
Björn Lindqvist b72fa3ba0a Docs: fixed doc example errors triggered by help-lint and added with-disposal where applicable 2014-04-14 08:42:10 -07:00
Björn Lindqvist a48567b8af Docs: more matrix-related documentation 2014-04-14 08:42:09 -07:00
Björn Lindqvist 8b4af6bc86 Docs: doc and examples for math.matrices 2014-04-14 08:42:09 -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 5ee7f10f19 math.matrices: simpler square-rows. 2013-05-14 13:52:24 -07:00
John Benediktsson bcbf3198f7 math.matrices: faster square-rows and square-cols. 2013-05-14 13:46:44 -07:00
John Benediktsson 57b7a5fd6f math.matrices: add tests for square-matrix?. 2013-04-25 14:48:16 -07:00
Doug Coleman 401dd47335 math.matrices: Add m+n, m-n, n+m, n-m, words. 2012-11-07 22:53:52 -08: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
Doug Coleman b23e52f532 math.matrics: Add some combinators and indexing words to math.matrices. 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
John Benediktsson 1a73e79ef7 cleanup some use of with-scope. 2012-07-19 13:55:34 -07:00
John Benediktsson f090967d77 math.matrices: adding docs for a few words. 2012-05-25 12:19:23 -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
John Benediktsson 4f046a2339 math.vectors: separate "dot product" from "Hermitian inner product". Fixes #484. 2012-03-29 10:56:39 -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
Joe Groff e7968ceffc mop up compiler errors from macosx load-all 2010-03-09 00:56:07 -08: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