Skip to content

Commit 8d4ea6f

Browse files
committed
0.5rc1
1 parent 136d1a6 commit 8d4ea6f

23 files changed

+182
-164
lines changed

CITATION.cff

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,16 @@ authors:
77
title: matrico
88
type: software
99
abstract: "A flonum matrix module for CHICKEN Scheme."
10-
version: 0.4
11-
date-released: 2023-06-01
10+
version: 0.5
11+
date-released: 2023-06-06
1212
commit:
1313
license: zlib-Acknowledgement
1414
repository: https://github.com/gramian/matrico
1515
url: https://numerical-schemer.xyz
1616
keywords:
17+
- "Lisp"
1718
- "Scheme"
1819
- "Chicken Scheme"
19-
- "Matrix Calculations"
2020
- "Matrix Computations"
2121
- "Linear Algebra"
22-
22+
- "Numerics"

Makefile

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,11 @@ CHICKEN_INSTALL = chicken-install
88
CHICKEN_PROFILE = chicken-profile
99
TEST_NEW_EGG = test-new-egg # homebrew: /opt/homebrew/Cellar/chicken/5.3.0_1/bin/test-new-egg
1010

11+
# DEV-TEMP
12+
TAR = gtar
13+
SED = gsed
14+
TEST_NEW_EGG = /opt/homebrew/Cellar/chicken/5.3.0_1/bin/test-new-egg
15+
1116
CLARG =
1217
LEVEL = -O3
1318
DEBUG = -d0
@@ -47,7 +52,7 @@ test_install:
4752
CHICKEN_REPOSITORY_PATH="/tmp/matrico:`$(CHICKEN_INSTALL) -repository`" $(CSI) -e "(import matrico) (matrico 'citation)"
4853

4954
iprofile:
50-
make matmul LEVEL='-O3' FLAGS='-profile' DIM=100
55+
make linpack LEVEL='-O3' FLAGS='-profile' DIM=1000
5156
ls -1 PROFILE.* | sort -n | head -n1 | $(CHICKEN_PROFILE)
5257

5358
sprofile:
@@ -100,4 +105,4 @@ clean:
100105
rm -f test.csv test.mx linpack.txt matmul.txt \
101106
matrico.so matrico.import.scm matrico.import.so matrico.static.o \
102107
matrico.build.sh matrico.install.sh matrico.link matrico.static.so \
103-
matrico-$(VERSION).tar.gz PROFILE.*
108+
matrico-$(VERSION).tar.gz PROFILE.* heat.csv flame.csv

README.md

Lines changed: 37 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
![matrico 0.4](res/matrico-logo.svg) matrico
1+
![matrico 0.5](res/matrico-logo.svg) matrico
22
========================================
33

44
* **Project**: matrico ([Esperanto for "matrix"](https://translate.google.com/?sl=eo&tl=en&text=matrico&op=translate))
@@ -9,7 +9,7 @@
99

1010
* **License**: [zlib-acknowledgement](https://spdx.org/licenses/zlib-acknowledgement.html)
1111

12-
* **Version**: 0.4 (2023-06-01)
12+
* **Version**: 0.5 (2023-06-06)
1313

1414
* **Depends**: [CHICKEN Scheme](http://call-cc.org) (>= 5.1)
1515

@@ -37,6 +37,12 @@
3737

3838
`matrico` is a _Scheme_ module for numerical matrix computations encapsulated in a _CHICKEN Scheme_ egg.
3939

40+
### Clone and Try `matrico` Code
41+
42+
```shell
43+
./matrico.sh
44+
```
45+
4046
### Install and Test `matrico` Egg
4147

4248
```shell
@@ -49,26 +55,18 @@ CHICKEN_INSTALL_REPOSITORY="/my/egg/directory/" chicken-install -test matrico
4955
CHICKEN_REPOSITORY_PATH="`chicken-install -repository`:/my/egg/directory/" csi
5056
```
5157

52-
### Clone and Try `matrico` Code
53-
54-
```scheme
55-
(load "matrico.scm")
58+
### Run Demo Codes
5659

57-
(import matrico)
58-
```
59-
60-
### Run Demo Code
61-
62-
```scheme
63-
(load "RUNME.scm")
60+
```shell
61+
csi RUNME.scm
6462
```
6563

66-
```scheme
67-
(load "demos/heat.scm")
64+
```shell
65+
csi demos/heat.scm
6866
```
6967

70-
```scheme
71-
(load "demos/flame.scm")
68+
```shell
69+
csi demos/flame.scm
7270
```
7371

7472
### Minimal Explanation
@@ -250,8 +248,6 @@ CHICKEN_REPOSITORY_PATH="`chicken-install -repository`:/my/egg/directory/" csi
250248

251249
* `(mx-where pred x y)` returns **matrix** of entries of **matrix**es `x` or `y` based on predicate **procedure** `pred`.
252250

253-
* `(mx*+ a x y)` returns **matrix** of entry-wise generalized addition of **flonum** `a` times **matrix** `x` plus **matrix** `y`, aka axpy.
254-
255251
#### Matrix Mappers
256252

257253
##### Elementary Functions
@@ -422,6 +418,8 @@ CHICKEN_REPOSITORY_PATH="`chicken-install -repository`:/my/egg/directory/" csi
422418

423419
* `(mx-transpose mat)` returns **matrix** of entries of **matrix** `mat` with swapped row and column indices.
424420

421+
* `(mx-axpy a x y)` returns **matrix** of entry-wise generalized addition of **flonum** `a` times **matrix** `x` plus **matrix** `y`, aka "a times x plus y".
422+
425423
* `(mx-sympart mat)` returns **matrix** being symmetric part of square **matrix** `mat`.
426424

427425
* `(mx-skewpart mat)` returns **matrix** being skey-symmetric part of square **matrix** `mat`, aka anti-symmetric part.
@@ -611,6 +609,8 @@ Defines the matrix type (record) as column-major list-of-columns and provides ge
611609

612610
* `(matrix-transpose mat)` returns **matrix** of entries of **matrix** `mat` with swapped row and column indices.
613611

612+
* `(matrix-axpy a x y)` returns **matrix** resulting from scaling **matrix** `x` by **any** `a` and add **matrix** `y`.
613+
614614
* `(matrix-scalar xt y)` returns **any** resulting from the scalar product of column-**matrix**es `xt` and `y`.
615615

616616
* `(matrix-dot* xt y)` returns **matrix** resulting from matrix multiplication of transposed of **matrix** `xt` and **matrix** `y`.
@@ -655,6 +655,8 @@ Provides homogeneous vector transformations analogous to vectors.
655655

656656
* `(f64vector-foreach-index fun . vecs)` returns **void**, applies **procedure** `fun` to index and all corresponding **f64vector**(s) `vecs` elements.
657657

658+
* `(f64vector-axpy a x y)` returns **f64vector** resulting from applying fused-multiply-add to the **flonum** `a` and to all **f64vector**s `x`, `y` elements.
659+
658660
* `(f64vector-fold fun ini . vecs)` returns **any** resulting from applying **procedure** `fun` to `ini` initialized accumulator and sequentially to all **f64vector**(s) `vecs` elements from left to right.
659661

660662
* `(f64vector-fold* fun ini . vecs)` returns **any** resulting from applying **procedure** `fun` to `ini` initialized accumulator and sequentially to all **f64vector**(s) `vecs` elements from right to left.
@@ -678,7 +680,7 @@ Provides additional mathematical functions, extending CHICKEN's `flonum` module.
678680

679681
* `(fprec x)` returns **flonum** reciprocal of **flonum** `x`.
680682

681-
* `(fp*+ z x y)` returns **flonum** sum with product: `x * y + z` of **flonum**s `x`, `y`, `z`.
683+
* `(fp*+ x y z)` returns **flonum** sum with product: `x * y + z` of **flonum**s `x`, `y`, `z`.
682684

683685
* `(fptau)` returns **flonum** circle constant Tau via fraction.
684686

@@ -844,8 +846,8 @@ make mips
844846
* `SYS:` MacOS Monterey (12.6)
845847
* `SCM:` CHICKEN Scheme (5.3)
846848

847-
* MATMUL: `1230` Megaflops
848-
* LINPACK: `185` Megaflops
849+
* MATMUL: `267` Megaflops
850+
* LINPACK: `319` Megaflops
849851
* BOGOMIPS: `275` Mips
850852

851853
## Development
@@ -858,13 +860,21 @@ make mips
858860

859861
* [`mx`] Add rank-revealing QR and pseudo-inverse via QR
860862

861-
* [`mx`] Add Eigenvalue decomposition and singular value decomposition
863+
* [`mx`] Add Eigenvalue decomposition and singular value decomposition via QR
862864

863-
* [`mx`] Add [`asciichart`](https://github.com/kroitor/asciichart) interface or functionality
865+
* [`mx`] Add [`UnicodePlot`](https://github.com/JuliaPlots/UnicodePlots.jl)-like lineplot functionality
864866

865867
### Changelog
866868

867-
<b>0.4</b> (2023-06-01)
869+
<b>0.5</b> (2023-06-06)
870+
871+
* **ADDED** `f64vector-axpy`
872+
* **ADDED** `matrix-axpy`
873+
* **CHANGED** `mx*+` to `mx-axpy`
874+
* **IMPROVED** `mx-qr`
875+
* **IMPROVED** `mx-solver`
876+
877+
<details><summary markdown="span"><b>0.4</b> (2023-06-01)</summary>
868878

869879
* **ADDED** `mx-angle`
870880
* **ADDED** `mx-var`
@@ -875,6 +885,8 @@ make mips
875885
* **REMOVED** `mx-logb`
876886
* ... and many minor updates and fixes.
877887

888+
</details>
889+
878890
<details><summary markdown="span"><b>0.3</b> (2022-09-16)</summary>
879891

880892
* **ADDED** `matrico` function
@@ -937,12 +949,4 @@ make mips
937949

938950
* `matrico` can be build with `-O5` if `matrico.scm` is included into the source.
939951

940-
### Ideas
941-
942-
* Alias for `.bashrc`:
943-
```
944-
alias matrico='CHICKEN_REPOSITORY_PATH="`chicken-install -repository`:/my/egg/directory/" csi -R matrico'
945-
```
946-
947952
## [`matrico`](https://git.io/matrico) — a (:chicken: λ) :egg: for numerical schemers!
948-

RUNME.scm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
;;;; RUNME.scm
22

33
;;@project: matrico (numerical-schemer.xyz)
4-
;;@version: 0.4 (2023-06-01)
4+
;;@version: 0.5 (2023-06-06)
55
;;@authors: Christian Himpe (0000-0003-2194-6754)
66
;;@license: zlib-acknowledgement (spdx.org/licenses/zlib-acknowledgement.html)
77
;;@summary: demo code

demos/flame.scm

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
;;;; demo-flame.scm
22

33
;;@project: matrico (numerical-schemer.xyz)
4-
;;@version: 0.4 (2023-06-01)
4+
;;@version: 0.5 (2023-06-06)
55
;;@authors: Christian Himpe (0000-0003-2194-6754)
66
;;@license: zlib-acknowledgement (spdx.org/licenses/zlib-acknowledgement.html)
77
;;@summary: flame demo code
@@ -19,6 +19,7 @@
1919
(define 2/h (/ 0.5 h))
2020

2121
(define A^T (mx-tridiag N (* 1.0 2/h) (* -4.0 2/h) (* 3.0 2/h)))
22+
(mx-set! A^T (sub1 N) N (* 4.0 2/h))
2223
(define B (mx-set (mx N 1 0.0) 1 1 (* 1.0 2/h)))
2324
(define C^T (mx-set (mx N 1 0.0) N 1 1.0))
2425

demos/heat.scm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
;;;; demo-heat.scm
22

33
;;@project: matrico (numerical-schemer.xyz)
4-
;;@version: 0.4 (2023-06-01)
4+
;;@version: 0.5 (2023-06-06)
55
;;@authors: Christian Himpe (0000-0003-2194-6754)
66
;;@license: zlib-acknowledgement (spdx.org/licenses/zlib-acknowledgement.html)
77
;;@summary: cooling demo code

doc/matrico.wiki

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -165,9 +165,6 @@ returns ''matrix'' of entry-wise exponentiation of ''matrix''es {{x}} to the {{y
165165
<procedure>(mx-where pred x y)</procedure>
166166
returns ''matrix'' of entries of ''matrix''es {{x}} or {{y}} based on predicate ''procedure'' {{pred}}.
167167

168-
<procedure>(mx*+ a x y)</procedure>
169-
returns ''matrix'' of entry-wise generalized addition of ''flonum'' {{a}} times ''matrix'' {{x}} plus ''matrix'' {{y}}.
170-
171168
== Matrix Mappers
172169

173170
=== Entry-Wise Elementary Functions
@@ -400,6 +397,9 @@ returns ''matrix'' of vertically concatenated columns of ''matrix'' {{mat}}, aka
400397
<procedure>(mx-transpose mat)</procedure>
401398
returns ''matrix'' of entries of ''matrix'' {{mat}} with swapped row and column indices.
402399

400+
<procedure>(mx-axpy a x y)</procedure>
401+
returns ''matrix'' of entry-wise generalized addition of ''flonum'' {{a}} times ''matrix'' {{x}} plus ''matrix'' {{y}}.
402+
403403
<procedure>(mx-sympart mat)</procedure>
404404
returns ''matrix'' being symmetric part of square ''matrix'' {{mat}}.
405405

@@ -536,8 +536,10 @@ Copyright (c) 2022 Christian Himpe. [[https://spdx.org/licenses/zlib-acknowledge
536536

537537
; 0.1 : Initial Release
538538
539-
; 0.2 : Major Update ([[https://github.com/gramian/matrico#changelog|details]])
539+
; 0.2 : Major Update
540+
541+
; 0.3 : Major Update
540542
541-
; 0.3 : Major Update ([[https://github.com/gramian/matrico#changelog|details]])
543+
; 0.4 : Minor Update
542544
543-
; 0.4 : Minor Update ([[https://github.com/gramian/matrico#changelog|details]])
545+
; 0.5 : Minor Update ([[https://github.com/gramian/matrico#changelog|details]])

matrico.egg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
;;;; matrico.egg
22

3-
((version "0.4")
3+
((version "0.5")
44
(synopsis "A flonum matrix module for CHICKEN Scheme.")
55
(author "Christian Himpe")
66
(category math)

matrico.release-info

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,5 @@
1414

1515
(release "0.4rc1")
1616
(release "0.4rel")
17+
18+
(release "0.5rc1")

matrico.scm

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
;;;; matrico.scm
22

33
;;@project: matrico (numerical-schemer.xyz)
4-
;;@version: 0.4 (2023-06-01)
4+
;;@version: 0.5 (2023-06-06)
55
;;@authors: Christian Himpe (0000-0003-2194-6754)
66
;;@license: zlib-acknowledgement (spdx.org/licenses/zlib-acknowledgement.html)
77
;;@summary: A CHICKEN Scheme flonum matrix module.
@@ -21,7 +21,7 @@
2121
mx-samecols? mx-samerows? mx-samedims?
2222
mx-any? mx-all? mx=?
2323
mx-ref11 mx-ref mx-set mx-set! mx-col mx-row mx-diag mx-submatrix
24-
mx+ mx* mx- mx/ mx*2 mx^2 mx^ mx-where mx*+
24+
mx+ mx* mx- mx/ mx*2 mx^2 mx^ mx-where
2525
mx-round mx-floor mx-ceil
2626
mx-abs mx-sign mx-delta mx-heaviside
2727
mx-sin mx-cos mx-tan
@@ -43,6 +43,7 @@
4343
mx-rownorm mx-colnorm mx-norm
4444
mx-horcat mx-vercat
4545
mx-vec mx-transpose
46+
mx-axpy
4647
mx-sympart mx-skewpart
4748
mx-diagonal
4849
mx-qr mx-solver mx-solve mx-orth mx-absdet mx-logdet
@@ -67,7 +68,7 @@
6768
[else])
6869

6970
;;@assigns: matrico version number as pair.
70-
(define-constant version '(0 . 4))
71+
(define-constant version '(0 . 5))
7172

7273
;;@returns
7374
(define (matrico . s)

0 commit comments

Comments
 (0)