]> ruderich.org/simon Gitweb - config/dotfiles.git/commitdiff
maxima: Add norm() which calculates the euclid norm.
authorSimon Ruderich <simon@ruderich.org>
Thu, 23 Jun 2011 14:49:29 +0000 (16:49 +0200)
committerSimon Ruderich <simon@ruderich.org>
Thu, 23 Jun 2011 14:49:29 +0000 (16:49 +0200)
maxima/maxima-init.mac

index df7c66bd91fde1ccfdfaee832b4e949c4fe38594..045a2586be08dff3851728548d820e038fd79304 100644 (file)
@@ -13,6 +13,9 @@ load (descriptive);
 
 /* CUSTOM FUNCTIONS */
 
+/* Didn't find any euclid norm in Maxima, so here it is. */
+norm(x) := sqrt(transpose(x) . x);
+
 /* 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]));