You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
*`(mx-any? pred mat)` returns **boolean** answering if any entry of **matrix**`mat` fulfills predicate **procedure**`pred`.
214
224
215
-
*`(mx-all? pred mat)` returns **boolean** answering if all entries of **matrix**`mat`fulfills predicate **procedure**`pred`.
225
+
*`(mx-all? pred mat)` returns **boolean** answering if all entries of **matrix**`mat`fulfill predicate **procedure**`pred`.
216
226
217
227
*`(mx=? x y tol)` returns **boolean** answering if all entry-wise distances between **matrix**es `x` and `y` are below tolerance **flonum**`tol`.
218
228
@@ -490,20 +500,76 @@ csi demos/flame.scm
490
500
491
501
*`(mx-trapz mat)` returns column-**matrix** trapezoid approximate integral of **matrix**`mat` being columns data-points of rows-dimensional function.
492
502
493
-
*`(mx-ode2-hyp num fun x0 dt tf)`returns states-times-steps **matrix** trajectory solving an ordinary differential equation, by a 2nd order hyperbolic Runge-Kutta method of **fixnum**`num` stages, with vector field **procedure**`fun`, initial state column-**matrix**`x0`, time step **flonum**`dt`, and time horizon **flonum**`tf`.
503
+
*`(mx-ode2-hyp num sys tim x0)` states-times-steps **matrix** trajectory solving an ordinary differential equation, by a 2nd order hyperbolic Runge-Kutta method of **fixnum**`num` stages, with vector field **procedure**or **pair** of vector field and output **procedure**s `sys`, time step **flonum** and time horizon **flonum**in **pair**`tim`, initial state column-**matrix**`x0`.
494
504
495
-
*`(mx-ode2-ssp num fun x0 dt tf)`returns states-times-steps **matrix** trajectory solving an ordinary differential equation, by a 2nd order strong stability preserving Runge-Kutta method of **fixnum**`num` stages, with vector field **procedure**`fun`, initial state column-**matrix**`x0`, time step **flonum**`dt`, and time horizon **flonum**`tf`.
505
+
*`(mx-ode2-ssp num sys tim x0)` states-times-steps **matrix** trajectory solving an ordinary differential equation, by a 2nd order strong stability preserving Runge-Kutta method of **fixnum**`num` stages, with vector field **procedure**or **pair** of vector field and output **procedure**s `sys`, time step **flonum** and time horizon **flonum**in **pair**`tim`, initial state column-**matrix**`x0`.
496
506
497
507
#### Matrix Utilities
498
508
509
+
*`(mx->list mat)` returns **list** of entries of one-dimensional **matrix**`mat`.
510
+
499
511
*`(mx-print mat)` returns **void**, prints **matrix**`mat` to terminal.
500
512
501
-
*`(mx-export str mat)`returns **void**, writes **matrix**`mat` to new comma-separated-value (CSV) file in relative path **string**`str`.
513
+
*`(mx-export str mat . sep)`**void**, writes **matrix**`mat` to new **character**`sep`-separated-value file in relative path **string**`str`, by default `sep` is `,` resulting in CSV.
502
514
503
515
*`(mx-save str mat)` returns **void**, writes **matrix**`mat` to new Scheme (SCM) file in relative path **string**`str`.
504
516
505
517
*`(mx-load str)` returns **matrix** loaded from SCM file in relative path **string**`str`.
506
518
519
+
#### Extra Flonum Functions
520
+
521
+
The **matrico** module implicitly exports the [(chicken flonum)](http://wiki.call-cc.org/man/5/Module%20(chicken%20flonum)) module, as well as the following additional `flonum` operations:
522
+
523
+
*`fp` is **alias** for `exact->inexact`.
524
+
525
+
*`(fp% n d)` returns **flonum** fraction with numerator **fixnum**`n` and denominator **fixnum**`d`.
526
+
527
+
*`(fpzero?? x)` returns **boolean** answering if **flonum**`x` is exactly zero.
528
+
529
+
*`(fpzero? x tol)` returns **boolean** answering if absolute value of **flonum**`x` is less than **flonum**`tol`.
530
+
531
+
*`(fp*2 x)` returns **flonum** double of **flonum**`x`.
532
+
533
+
*`(fp^2 x)` returns **flonum** square of **flonum**`x`.
534
+
535
+
*`(fprec x)` returns **flonum** reciprocal of **flonum**`x`.
536
+
537
+
*`(fptau)` returns **flonum** circle constant Tau via fraction.
538
+
539
+
*`(fpeul)` returns **flonum** Euler's number via fraction.
540
+
541
+
*`(fpphi)` returns **flonum** golden ratio via fraction of consecutive Fibonacci numbers.
542
+
543
+
*`(fpdelta x)` returns **flonum** Kronecker delta of **flonum**`x`.
544
+
545
+
*`(fpheaviside x)` returns **flonum** Heaviside step function of **flonum**`x`.
546
+
547
+
*`(fpsign x)` returns **flonum** sign of **flonum**`x`.
548
+
549
+
*`(fpln x)` returns **flonum** natural logarithm of **flonum**`x`.
550
+
551
+
*`(fplb x)` returns **flonum** base-2 logarithm of **flonum**`x`.
552
+
553
+
*`(fplg x)` returns **flonum** base-10 logarithm of **flonum**`x`.
554
+
555
+
*`(fphsin x)` returns **flonum** haversed sine of **flonum**`x`.
556
+
557
+
*`(fphcos x)` returns **flonum** haversed cosine of **flonum**`x`.
558
+
559
+
*`(fplnsinh x)` returns **flonum** log-sinh of **flonum**`x`.
560
+
561
+
*`(fplncosh x)` returns **flonum** log-cosh of **flonum**`x`.
562
+
563
+
*`(fpsignsqrt x)` returns **flonum** sign times square root of absolute value of **flonum**`x`.
564
+
565
+
*`(fpsinc x)` returns **flonum** cardinal sine function with removed singularity of **flonum**`x`.
566
+
567
+
*`(fpsigm x)` returns **flonum** standard logistic function of **flonum**`x`, aka sigmoid.
568
+
569
+
*`(fpgauss x)` returns **flonum** Gauss bell curve function evaluation of **flonum**`x`.
570
+
571
+
*`(fpstirling x)` returns **flonum** Stirling approximation of factorial of **flonum**`x`.
572
+
507
573
</details>
508
574
509
575
### Internal Libraries and Modules
@@ -528,7 +594,7 @@ csi demos/flame.scm
528
594
529
595
*`(translate-rows idx)` returns **fixnum** for **matrix**`mat` translated row index **fixnum**`idx` (from 1-based to 0-based and from end).
530
596
531
-
*`(time-stepper typ fun x0 dt tf)` states-times-steps **matrix** trajectory solving an ordinary differential equation, by method **procedure**`typ`, with vector field **procedure**`fun`, initial state column-**matrix**`x0`, time step **flonum**`dt`, and time horizon **flonum**`tf`.
597
+
*`(time-stepper typ sys tim x0)` states-times-steps **matrix** trajectory solving an ordinary differential equation, by method **procedure**`typ`, with vector field **procedure**or vector field and output function **pair**-of-**procedure**s `sys`, time step and time horizon **pair**-of-**flonum**s `tim`, initial state column-**matrix**`x0`.
532
598
533
599
#### Matrix Backend Library
534
600
Defines the matrix type (record) as column-major list-of-columns and provides generic basic and functional methods wrapped in a functor
@@ -595,11 +661,11 @@ Defines the matrix type (record) as column-major list-of-columns and provides ge
595
661
596
662
*`(matrix-all? pred mat)` returns **boolean** answering if all entries of **matrix**`mat` fulfill predicate **procedure**`pred`.
597
663
598
-
*`(matrix-colfold fun ini mat)` returns row **matrix** resulting from folding by two-argument **procedure**`fun each column of **matrix** `mat`.
664
+
*`(matrix-colfold fun ini mat)` returns row **matrix** resulting from folding by two-argument **procedure**`fun` each column of **matrix**`mat`.
599
665
600
-
*`(matrix-rowfold fun ini mat)` returns column **matrix** resulting from folding by two-argument **procedure**`fun each row of **matrix** `mat`.
666
+
*`(matrix-rowfold fun ini mat)` returns column **matrix** resulting from folding by two-argument **procedure**`fun` each row of **matrix**`mat`.
601
667
602
-
*`(matrix-allfold fun ini mat)` returns **any** resulting from folding by two-argument **procedure**`fun all **matrix** `mat` entries.
668
+
*`(matrix-allfold fun ini mat)` returns **any** resulting from folding by two-argument **procedure**`fun` all **matrix**`mat` entries.
603
669
604
670
*`(matrix-map fun mat)` returns **matrix** resulting from applying **procedure**`fun` to each entry of **matrix**`mat`.
605
671
@@ -619,9 +685,11 @@ Defines the matrix type (record) as column-major list-of-columns and provides ge
619
685
620
686
*`(matrix-implode lst)` returns **matrix** of horizontally concatenated **list**-of-column-**matrix**es `lst`.
621
687
688
+
*`(matrix->list mat)` returns: **list** of entries of one-dimensional **matrix**`mat`.
689
+
622
690
*`(matrix-print mat)` returns **void**, prints **matrix**`mat` to terminal.
623
691
624
-
*`(matrix-export str mat)` returns **void**, writes **matrix**`mat` to new comma-seperated-value (CSV) file in relative path (**string**) `str`.
692
+
*`(matrix-export str mat sep)` returns **void**, writes **matrix**`mat` to new **character**`sep`-separated-value file in relative path (**string**) `str`.
625
693
626
694
*`(matrix-save str mat)` returns **void**, writes **matrix**`mat` to new Scheme (SCM) file in relative path (**string**) `str`.
*`(f64vector-dot x y)` returns **flonum** resulting from applying fused-multiply-add to zero initialized accumulator and sequentially to all **f64vector**s `x`, `y` elements from left to right.
0 commit comments