]> ruderich.org/simon Gitweb - config/dotfiles.git/blob - maxima/maxima-init.mac
f270c10f3f5bef5153c78a901547447d4fc16c57
[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 /* CUSTOM FUNCTIONS */
9
10 /* Didn't find any euclid norm in Maxima, so here it is. */
11 norm(x) := sqrt(transpose(x) . x);
12
13 /* Maxima's mat_norm() can't calculate the 2-norm. Thanks to Wolfgang Lindner
14  * (http://www.ma.utexas.edu/pipermail/maxima/2007/006300.html) for an
15  * improved version. */
16 mat_norm2(x) := sqrt(lmax(eigenvalues(transpose(conjugate(x)).x)[1]));
17
18 /* Shortcut to perform lu factorization. */
19 lu(x) := block(x : lu_factor(x), get_lu_factors(x));
20
21 /* vim: ft=maxima */