diff -Nru maxima-5.41.0/debian/changelog maxima-5.41.0/debian/changelog --- maxima-5.41.0/debian/changelog 2018-02-07 02:49:20.000000000 +0000 +++ maxima-5.41.0/debian/changelog 2018-02-09 02:48:47.000000000 +0000 @@ -1,8 +1,8 @@ -maxima (5.41.0-23~201802062205~ubuntu16.04.1) xenial; urgency=low +maxima (5.41.0-23~201802080819~ubuntu16.04.1) xenial; urgency=low * Auto build. - -- Launchpad Package Builder Wed, 07 Feb 2018 02:49:20 +0000 + -- Launchpad Package Builder Fri, 09 Feb 2018 02:48:47 +0000 maxima (5.41.0-6) unstable; urgency=medium diff -Nru maxima-5.41.0/debian/git-build-recipe.manifest maxima-5.41.0/debian/git-build-recipe.manifest --- maxima-5.41.0/debian/git-build-recipe.manifest 2018-02-07 02:49:20.000000000 +0000 +++ maxima-5.41.0/debian/git-build-recipe.manifest 2018-02-09 02:48:47.000000000 +0000 @@ -1,3 +1,3 @@ -# git-build-recipe format 0.4 deb-version {debupstream}-23~201802062205 -lp:~peterpall/maxima/+git/maxima.code git-commit:1bb0aa6bc0fdddd3a5e320c81a8c1f3bc2fc82d9 +# git-build-recipe format 0.4 deb-version {debupstream}-23~201802080819 +lp:~peterpall/maxima/+git/maxima.code git-commit:4f7c9b272ac2b70ff61be4a01aedb1b57554d06e merge packaging lp:~peterpall/maxima/+git/maxima.code git-commit:7ed2e6489c3aceec3ead4d650860baeb0102bb08 diff -Nru maxima-5.41.0/doc/info/Matrices.texi maxima-5.41.0/doc/info/Matrices.texi --- maxima-5.41.0/doc/info/Matrices.texi 2018-02-07 02:49:18.000000000 +0000 +++ maxima-5.41.0/doc/info/Matrices.texi 2018-02-09 02:48:45.000000000 +0000 @@ -10,6 +10,7 @@ @menu * Dot:: +* Matrices:: * Vectors:: * eigen:: @end menu @@ -47,7 +48,75 @@ @mrefdot{dotscrules} @c ----------------------------------------------------------------------------- -@node Vectors, eigen, Dot, Introduction to Matrices and Linear Algebra +@node Matrices, Vectors, Dot, Introduction to Matrices and Linear Algebra +@subsection Matrices +@c ----------------------------------------------------------------------------- +Matrices are handled with speed and memory-efficiency in mind. This means that +assigning a matrix to a variable will create a reference to, not a copy of the +matrix. If the matrix is modified all references to the matrix point to the +modified object (See @mref{copymatrix} for a way of avoiding this): +@c ===beg=== +@c M1:matrix([0,0],[0,0]); +@c M2:M1; +@c M1[1][1]:2; +@c M2; +@c ===end=== +@example +@group +(%i1) M1:matrix([0,0],[0,0]); + [ 0 0 ] +(%o1) [ ] + [ 0 0 ] +@end group +@group +(%i2) M2:M1; + [ 0 0 ] +(%o2) [ ] + [ 0 0 ] +@end group +@group +(%i3) M1[1][1]:2; +(%o3) 2 +@end group +@group +(%i4) M2; + [ 2 0 ] +(%o4) [ ] + [ 0 0 ] +@end group +@end example + +Converting a matrix to nested lists and vice versa works the following way: +@c ===beg=== +@c l:[[1,2],[3,4]]; +@c M1:apply('matrix,l); +@c M2:transpose(M1); +@c args(M2); +@c ===end=== +@example +@group +(%i1) l:[[1,2],[3,4]]; +(%o1) [[1, 2], [3, 4]] +@end group +@group +(%i2) M1:apply('matrix,l); + [ 1 2 ] +(%o2) [ ] + [ 3 4 ] +@end group +@group +(%i3) M2:transpose(M1); + [ 1 3 ] +(%o3) [ ] + [ 2 4 ] +@end group +@group +(%i4) args(M2); +(%o4) [[1, 3], [2, 4]] +@end group +@end example +@c ----------------------------------------------------------------------------- +@node Vectors, eigen, Matrices, Introduction to Matrices and Linear Algebra @subsection Vectors @c ----------------------------------------------------------------------------- @@ -733,12 +802,15 @@ @c echelon (M); @c ===end=== @example +@group (%i1) M: matrix ([3, 7, aa, bb], [-1, 8, 5, 2], [9, 2, 11, 4]); [ 3 7 aa bb ] [ ] (%o1) [ - 1 8 5 2 ] [ ] [ 9 2 11 4 ] +@end group +@group (%i2) echelon (M); [ 1 - 8 - 5 - 2 ] [ ] @@ -749,6 +821,7 @@ [ 37 bb - 119 ] [ 0 0 1 ----------- ] [ 37 aa - 313 ] +@end group @end example @opencatbox @@ -867,13 +940,18 @@ @c mult[i] = vals[2][i], vec[i] = vecs[i]); @c ===end=== @example +@group (%i1) M1 : matrix ([11, -1], [1, 7]); [ 11 - 1 ] (%o1) [ ] [ 1 7 ] +@end group +@group (%i2) [vals, vecs] : eigenvectors (M1); (%o2) [[[9 - sqrt(3), sqrt(3) + 9], [1, 1]], [[[1, sqrt(3) + 2]], [[1, 2 - sqrt(3)]]]] +@end group +@group (%i3) for i thru length (vals[1]) do disp (val[i] = vals[1][i], mult[i] = vals[2][i], vec[i] = vecs[i]); val = 9 - sqrt(3) @@ -895,6 +973,7 @@ 2 (%o3) done +@end group @end example A matrix which has two eigenvectors for one eigenvalue (namely 2). @@ -906,8 +985,8 @@ @c mult[i] = vals[2][i], vec[i] = vecs[i]); @c ===end=== @example -(%i1) M1 : matrix ([0, 1, 0, 0], [0, 0, 0, 0], [0, 0, 2, 0], - [0, 0, 0, 2]); +@group +(%i1) M1 : matrix ([0, 1, 0, 0], [0, 0, 0, 0], [0, 0, 2, 0], [0, 0, 0, 2]); [ 0 1 0 0 ] [ ] [ 0 0 0 0 ] @@ -915,9 +994,13 @@ [ 0 0 2 0 ] [ ] [ 0 0 0 2 ] +@end group +@group (%i2) [vals, vecs] : eigenvectors (M1); -(%o2) [[[0, 2], [2, 2]], [[[1, 0, 0, 0]], +(%o2) [[[0, 2], [2, 2]], [[[1, 0, 0, 0]], [[0, 0, 1, 0], [0, 0, 0, 1]]]] +@end group +@group (%i3) for i thru length (vals[1]) do disp (val[i] = vals[1][i], mult[i] = vals[2][i], vec[i] = vecs[i]); val = 0 @@ -939,6 +1022,7 @@ 2 (%o3) done +@end group @end example @opencatbox @@ -1042,10 +1126,13 @@ @c genmatrix (B, 2, 2); @c ===end=== @example +@group (%i1) h [i, j] := 1 / (i + j - 1); 1 (%o1) h := --------- i, j i + j - 1 +@end group +@group (%i2) genmatrix (h, 3, 3); [ 1 1 ] [ 1 - - ] @@ -1058,28 +1145,41 @@ [ 1 1 1 ] [ - - - ] [ 3 4 5 ] +@end group +@group (%i3) array (a, fixnum, 2, 2); (%o3) a +@end group +@group (%i4) a [1, 1] : %e; (%o4) %e +@end group +@group (%i5) a [2, 2] : %pi; (%o5) %pi +@end group +@group (%i6) genmatrix (a, 2, 2); [ %e 0 ] (%o6) [ ] [ 0 %pi ] +@end group +@group (%i7) genmatrix (lambda ([i, j], j - i), 3, 3); [ 0 1 2 ] [ ] (%o7) [ - 1 0 1 ] [ ] [ - 2 - 1 0 ] +@end group +@group (%i8) genmatrix (B, 2, 2); [ B B ] [ 1, 1 1, 2 ] (%o8) [ ] [ B B ] [ 2, 1 2, 2 ] +@end group @end example @opencatbox @@ -1123,19 +1223,25 @@ @c ===end=== @example (%i1) load ("eigen")$ +@group (%i2) x: matrix ([1, 2, 3], [9, 18, 30], [12, 48, 60]); [ 1 2 3 ] [ ] (%o2) [ 9 18 30 ] [ ] [ 12 48 60 ] +@end group +@group (%i3) y: gramschmidt (x); 2 2 4 3 3 3 3 5 2 3 2 3 (%o3) [[1, 2, 3], [- ---, - --, ---], [- ----, ----, 0]] 2 7 7 2 7 5 5 +@end group +@group (%i4) map (innerproduct, [y[1], y[2], y[3]], [y[2], y[3], y[1]]); (%o4) [0, 0, 0] +@end group @end example Gram-Schmidt algorithm using a specified inner product function. @@ -1148,15 +1254,20 @@ @c ===end=== @example (%i1) load ("eigen")$ +@group (%i2) ip (f, g) := integrate (f * g, u, a, b); (%o2) ip(f, g) := integrate(f g, u, a, b) -(%i3) y : gramschmidt([1, sin(u), cos(u)], ip), a= -%pi/2, b=%pi/2; +@end group +@group +(%i3) y : gramschmidt ([1, sin(u), cos(u)], ip), a= -%pi/2, b=%pi/2; %pi cos(u) - 2 (%o3) [1, sin(u), --------------] %pi -(%i4) map (ip, [y[1], y[2], y[3]], [y[2], y[3], y[1]]), - a= -%pi/2, b=%pi/2; +@end group +@group +(%i4) map (ip, [y[1], y[2], y[3]], [y[2], y[3], y[1]]), a= -%pi/2, b=%pi/2; (%o4) [0, 0, 0] +@end group @end example @opencatbox @@ -1253,8 +1364,10 @@ @c list_matrix_entries(matrix([a,b],[c,d])); @c ===end=== @example +@group (%i1) list_matrix_entries(matrix([a,b],[c,d])); (%o1) [a, b, c, d] +@end group @end example @opencatbox @@ -2024,18 +2137,22 @@ @c triangularize (M); @c ===end=== @example +@group (%i1) M: matrix ([3, 7, aa, bb], [-1, 8, 5, 2], [9, 2, 11, 4]); [ 3 7 aa bb ] [ ] (%o1) [ - 1 8 5 2 ] [ ] [ 9 2 11 4 ] +@end group +@group (%i2) triangularize (M); [ - 1 8 5 2 ] [ ] (%o2) [ 0 - 74 - 56 - 22 ] [ ] [ 0 0 626 - 74 aa 238 - 74 bb ] +@end group @end example @opencatbox