]> ruderich.org/simon Gitweb - config/dotfiles.git/blobdiff - maxima/maxima-init.mac
maxima/maxima-init.mac: Minor documentation fix.
[config/dotfiles.git] / maxima / maxima-init.mac
index 045a2586be08dff3851728548d820e038fd79304..1be72181b9c6c49b807b86343ef9192389c32cfe 100644 (file)
@@ -1,14 +1,25 @@
 /*
- * Maxima (computer algebra system) configuration file, maxima part.
+ * Maxima (computer algebra system) configuration file, Maxima part.
  *
- * Also have a look at maxima/maxima-init.mac.
+ * Also have a look at maxima/maxima-init.lisp.
  */
 
-
-/* PACKAGES */
-
-/* Provides maxi() and mini() (and more). */
-load (descriptive);
+/*
+ * Copyright (C) 2011-2012  Simon Ruderich
+ *
+ * This file is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This file is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this file.  If not, see <http://www.gnu.org/licenses/>.
+ */
 
 
 /* CUSTOM FUNCTIONS */
@@ -16,9 +27,10 @@ load (descriptive);
 /* 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]));
+/* 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));