X-Git-Url: https://ruderich.org/simon/gitweb/?a=blobdiff_plain;f=maxima%2Fmaxima-init.mac;h=f270c10f3f5bef5153c78a901547447d4fc16c57;hb=8165a8ace54a29a17fa975278d83609c179d78de;hp=df7c66bd91fde1ccfdfaee832b4e949c4fe38594;hpb=92fe3d7f15820a18aab6ff7d3cc4d87b6b9ae6cb;p=config%2Fdotfiles.git diff --git a/maxima/maxima-init.mac b/maxima/maxima-init.mac index df7c66b..f270c10 100644 --- a/maxima/maxima-init.mac +++ b/maxima/maxima-init.mac @@ -5,17 +5,15 @@ */ -/* PACKAGES */ - -/* Provides maxi() and mini() (and more). */ -load (descriptive); - - /* CUSTOM FUNCTIONS */ -/* Maxima's norm() can't calculate the 2-norm. Only works for non-complex - * matrices. */ -norm_2(x) := sqrt(maxi(eigenvalues(transpose(x) . x)[1])); +/* Didn't find any euclid norm in Maxima, so here it is. */ +norm(x) := sqrt(transpose(x) . x); + +/* Maxima's mat_norm() can't calculate the 2-norm. Thanks to Wolfgang Lindner + * (http://www.ma.utexas.edu/pipermail/maxima/2007/006300.html) for an + * improved version. */ +mat_norm2(x) := sqrt(lmax(eigenvalues(transpose(conjugate(x)).x)[1])); /* Shortcut to perform lu factorization. */ lu(x) := block(x : lu_factor(x), get_lu_factors(x));