]> ruderich.org/simon Gitweb - config/dotfiles.git/blob - maxima/maxima-init.mac
maxima: Add norm() which calculates the euclid norm.
[config/dotfiles.git] / maxima / maxima-init.mac
1 /*
2  * Maxima (computer algebra system) configuration file, maxima part.
3  *
4  * Also have a look at maxima/maxima-init.mac.
5  */
6
7
8 /* PACKAGES */
9
10 /* Provides maxi() and mini() (and more). */
11 load (descriptive);
12
13
14 /* CUSTOM FUNCTIONS */
15
16 /* Didn't find any euclid norm in Maxima, so here it is. */
17 norm(x) := sqrt(transpose(x) . x);
18
19 /* Maxima's norm() can't calculate the 2-norm. Only works for non-complex
20  * matrices. */
21 norm_2(x) := sqrt(maxi(eigenvalues(transpose(x) . x)[1]));
22
23 /* Shortcut to perform lu factorization. */
24 lu(x) := block(x : lu_factor(x), get_lu_factors(x));
25
26 /* vim: ft=maxima */