2
@c makeinfo linearalgebra.texi to make .info
3
@c texi2html linearalgebra.texi to make .html
4
@c texi2pdf linearalgebra.texi to make .pdf
6
@setfilename linearalgebra.info
7
@settitle linearalgebra
12
* Maxima-linearalgebra: (linearalgebra). A computer algebra system -- contributions.
21
@node Top, Introduction to linearalgebra, (dir), (dir)
24
* Introduction to linearalgebra::
25
* Definitions for linearalgebra::
26
* Function and variable index::
29
@node Introduction to linearalgebra, Definitions for linearalgebra, Top, Top
30
@section Introduction to linearalgebra
32
@code{linearalgebra} is a collection of functions for linear algebra.
37
@c load (linearalgebra)$
38
@c M : matrix ([1, 2], [1, 2]);
41
@c ptriangularize (M - z*ident(2), z);
42
@c M : matrix ([1, 2, 3], [4, 5, 6], [7, 8, 9]) - z*ident(3);
43
@c MM : ptriangularize (M, z);
45
@c tellrat (MM [3, 3]);
48
@c M : matrix ([1, 2, 3, 4], [5, 6, 7, 8], [9, 10, 11, 12], [13, 14, 15, 16]);
50
@c apply ('orthogonal_complement, args (nullspace (transpose (M))));
53
(%i1) load (linearalgebra);
54
Warning - you are redefining the Maxima function require_list
55
Warning - you are redefining the Maxima function matrix_size
56
Warning - you are redefining the Maxima function rank
57
(%o1) /usr/local/share/maxima/5.9.2/share/linearalgebra/linearalgebra.mac
58
(%i2) M : matrix ([1, 2], [1, 2]);
68
(%i4) columnspace (M);
72
(%i5) ptriangularize (M - z*ident(2), z);
77
(%i6) M : matrix ([1, 2, 3], [4, 5, 6], [7, 8, 9]) - z*ident(3);
83
(%i7) MM : ptriangularize (M, z);
88
[ 0 -- - -- + ----- + --- ]
93
[ 0 0 ----- - ------ - ----- ]
95
(%i8) algebraic : true;
97
(%i9) tellrat (MM [3, 3]);
99
(%o9) [z - 15 z - 18 z]
100
(%i10) MM : ratsimp (MM);
104
(%o10) [ 66 7 z - 102 z - 132 ]
105
[ 0 -- - ------------------ ]
109
(%i11) nullspace (MM);
121
(%i12) M : matrix ([1, 2, 3, 4], [5, 6, 7, 8], [9, 10, 11, 12], [13, 14, 15, 16]);
129
(%i13) columnspace (M);
133
(%o13) span([ ], [ ])
137
(%i14) apply ('orthogonal_complement, args (nullspace (transpose (M))));
141
(%o14) span([ ], [ ])
147
@node Definitions for linearalgebra, Function and variable index, Introduction to linearalgebra, Top
148
@section Definitions for linearalgebra
150
@deffn {Function} addmatrices (@var{f}, @var{M_1}, ..., @var{M_n})
152
@c REWORD -- THE RESULT IS NOT GENERALLY THE SUM OF M_1, ..., M_N
153
Using the function @var{f} as the addition function, return the sum of
154
the matrices @var{M_1}, ..., @var{M_n}. The function @var{f} must accept any number of
155
arguments (a Maxima nary function).
160
@c m1 : matrix([1,2],[3,4])$
161
@c m2 : matrix([7,8],[9,10])$
162
@c addmatrices('max,m1,m2);
163
@c addmatrices('max,m1,m2,5*m1);
166
(%i1) m1 : matrix([1,2],[3,4])$
167
(%i2) m2 : matrix([7,8],[9,10])$
168
(%i3) addmatrices('max,m1,m2);
169
(%o3) matrix([7,8],[9,10])
170
(%i4) addmatrices('max,m1,m2,5*m1);
171
(%o4) matrix([7,10],[15,20])
176
@deffn {Function} blockmatrixp (@var{M})
178
Return true if and only if @var{M} is a matrix and every entry of
183
@deffn {Function} columnop (@var{M}, @var{i}, @var{j}, @var{theta})
185
If @var{M} is a matrix, return the matrix that results from doing the
186
column operation @code{C_i <- C_i - @var{theta} * C_j}. If @var{M} doesn't have a row
187
@var{i} or @var{j}, signal an error.
191
@deffn {Function} columnswap (@var{M}, @var{i}, @var{j})
193
If @var{M} is a matrix, swap columns @var{i} and @var{j}. If @var{M} doesn't have a column
194
@var{i} or @var{j}, signal an error.
198
@deffn {Function} columnspace (@var{M})
200
If @var{M} is a matrix, return @code{span (v_1, ..., v_n)}, where the set
201
@code{@{v_1, ..., v_n@}} is a basis for the column space of @var{M}. The span
202
of the empty set is @code{@{0@}}. Thus, when the column space has only
203
one member, return @code{span ()}.
207
@deffn {Function} copy (@var{e})
209
Return a copy of the Maxima expression @var{e}. Although @var{e} can be any
210
Maxima expression, the copy function is the most useful when @var{e} is either
211
a list or a matrix; consider:
213
load (linearalgebra);
221
(%i1) load("linearalgebra")$
230
Let's try the same experiment, but this time let @var{mm} be a copy of @var{m}
247
This time, the assignment to @var{mm} does not change the value of @var{m}.
251
@deffn {Function} cholesky (@var{M})
252
@deffnx {Function} cholesky (@var{M}, @var{field})
254
Return the Cholesky factorization of the matrix selfadjoint (or hermitian) matrix
255
@var{M}. The second argument defaults to 'generalring.' For a description of the
256
possible values for @var{field}, see @code{lu_factor}.
260
@deffn {Function} ctranspose (@var{M})
262
Return the complex conjugate transpose of the matrix @var{M}. The function
263
@code{ctranspose} uses @code{matrix_element_transpose} to transpose each matrix element.
267
@deffn {Function} diag_matrix (@var{d_1}, @var{d_2},...,@var{d_n})
269
Return a diagonal matrix with diagonal entries @var{d_1}, @var{d_2},...,@var{d_n}.
270
When the diagonal entries are matrices, the zero entries of the returned matrix
271
are zero matrices of the appropriate size; for example:
273
@c load(linearalgebra)$
274
@c diag_matrix(diag_matrix(1,2),diag_matrix(3,4));
278
(%i1) load(linearalgebra)$
280
(%i2) diag_matrix(diag_matrix(1,2),diag_matrix(3,4));
289
(%i3) diag_matrix(p,q);
297
@deffn {Function} dotproduct (@var{u}, @var{v})
299
Return the dotproduct of vectors @var{u} and @var{v}. This is the same
300
as @code{conjugate (transpose (@var{u})) . @var{v}}. The arguments @var{u} and @var{v} must be
305
@deffn {Function} get_lu_factors (@var{x})
307
When @code{@var{x} = lu_factor (@var{A})}, then @code{get_lu_factors} returns a list of the
308
form @code{[P, L, U]}, where @var{P} is a permutation matrix, @var{L} is lower triangular with
309
ones on the diagonal, and @var{U} is upper triangular, and @code{@var{A} = @var{P} @var{L} @var{U}}.
313
@deffn {Function} hankel (@var{col})
314
@deffnx {Function} hankel (@var{col}, @var{row})
316
Return a Hankel matrix @var{H}. The first first column of @var{H} is @var{col};
317
except for the first entry, the last row of @var{H} is @var{row}. The
318
default for @var{row} is the zero vector with the same length as @var{col}.
322
@deffn {Function} hessian (@var{f},@var{vars})
324
Return the hessian matrix of @var{f} with respect to the variables in the list
325
@var{vars}. The @var{i},@var{j} entry of the hessian matrix is
326
@var{diff(f vars[i],1,vars[j],1)}.
330
@deffn {Function} hilbert_matrix (@var{n})
332
Return the @var{n} by @var{n} Hilbert matrix. When @var{n} isn't a positive
333
integer, signal an error.
337
@deffn {Function} identfor (@var{M})
338
@deffnx {Function} identfor (@var{M}, @var{fld})
340
Return an identity matrix that has the same shape as the matrix
341
@var{M}. The diagonal entries of the identity matrix are the
342
multiplicative identity of the field @var{fld}; the default for
343
@var{fld} is @var{generalring}.
345
The first argument @var{M} should be a square matrix or a
346
non-matrix. When @var{M} is a matrix, each entry of @var{M} can be a
347
square matrix -- thus @var{M} can be a blocked Maxima matrix. The
348
matrix can be blocked to any (finite) depth.
350
See also @code{zerofor}
354
@deffn {Function} invert_by_lu (@var{M}, @var{(rng generalring)})
356
Invert a matrix @var{M} by using the LU factorization. The LU factorization
357
is done using the ring @var{rng}.
361
@deffn {Function} kronecker_product (@var{A}, @var{B})
363
Return the Kronecker product of the matrices @var{A} and @var{B}.
368
@deffn {Function} locate_matrix_entry (@var{M}, @var{r_1}, @var{c_1}, @var{r_2}, @var{c_2}, @var{f}, @var{rel})
370
The first argument must be a matrix; the arguments
371
@var{r_1} through @var{c_2} determine a sub-matrix of @var{M} that consists of
372
rows @var{r_1} through @var{r_2} and columns @var{c_1} through @var{c_2}.
374
Find a entry in the sub-matrix @var{M} that satisfies some property.
377
(1) @code{@var{rel} = 'bool} and @var{f} a predicate:
379
Scan the sub-matrix from left to right then top to bottom,
380
and return the index of the first entry that satisfies the
381
predicate @var{f}. If no matrix entry satisfies @var{f}, return false.
383
(2) @code{@var{rel} = 'max} and @var{f} real-valued:
385
Scan the sub-matrix looking for an entry that maximizes @var{f}.
386
Return the index of a maximizing entry.
388
(3) @code{@var{rel} = 'min} and @var{f} real-valued:
390
Scan the sub-matrix looking for an entry that minimizes @var{f}.
391
Return the index of a minimizing entry.
395
@deffn {Function} lu_backsub (@var{M}, @var{b})
397
When @code{@var{M} = lu_factor (@var{A}, @var{field})},
398
then @code{lu_backsub (@var{M}, @var{b})} solves the linear
399
system @code{@var{A} @var{x} = @var{b}}.
403
@deffn {Function} lu_factor (@var{M}, @var{field})
405
Return a list of the form @code{[@var{LU}, @var{perm}, @var{fld}]},
406
or @code{[@var{LU}, @var{perm}, @var{fld}, @var{lower-cnd} @var{upper-cnd}]}, where
408
(1) The matrix @var{LU} contains the factorization of @var{M} in a packed form. Packed
409
form means three things: First, the rows of @var{LU} are permuted according to the
410
list @var{perm}. If, for example, @var{perm} is the list @code{[3,2,1]}, the actual first row
411
of the @var{LU} factorization is the third row of the matrix @var{LU}. Second,
412
the lower triangular factor of m is the lower triangular part of @var{LU} with the
413
diagonal entries replaced by all ones. Third, the upper triangular factor of
414
@var{M} is the upper triangular part of @var{LU}.
416
(2) When the field is either @code{floatfield} or @code{complexfield},
417
the numbers @var{lower-cnd} and @var{upper-cnd} are lower and upper bounds for the
418
infinity norm condition number of @var{M}. For all fields, the condition number
419
might not be estimated; for such fields, @code{lu_factor} returns a two item list.
420
Both the lower and upper bounds can differ from their true values by
421
arbitrarily large factors. (See also @code{mat_cond}.)
423
The argument @var{M} must be a square matrix.
425
The optional argument @var{fld} must be a symbol that determines a ring or field. The pre-defined
426
fields and rings are:
428
(a) @code{generalring} -- the ring of Maxima expressions,
429
(b) @code{floatfield} -- the field of floating point numbers of the type double,
430
(c) @code{complexfield} -- the field of complex floating point numbers of the
432
(d) @code{crering} -- the ring of Maxima CRE expressions,
433
(e) @code{rationalfield} -- the field of rational numbers,
434
(f) @code{runningerror} -- track the all floating point rounding errors,
435
(g) @code{noncommutingring} -- the ring of Maxima expressions where multiplication is the
436
non-commutative dot operator.
438
When the field is @code{floatfield}, @code{complexfield}, or
439
@code{runningerror}, the algorithm uses partial pivoting; for all
440
other fields, rows are switched only when needed to avoid a zero
443
Floating point addition arithmetic isn't associative, so the meaning
444
of 'field' differs from the mathematical definition.
446
A member of the field @code{runningerror} is a two member Maxima list
447
of the form @code{[x,n]},where @var{x} is a floating point number and
448
@code{n} is an integer. The relative difference between the 'true'
449
value of @code{x} and @code{x} is approximately bounded by the machine
450
epsilon times @code{n}. The running error bound drops some terms that
451
of the order the square of the machine epsilon.
453
There is no user-interface for defining a new field. A user that is
454
familiar with Common Lisp should be able to define a new field. To do
455
this, a user must define functions for the arithmetic operations and
456
functions for converting from the field representation to Maxima and
457
back. Additionally, for ordered fields (where partial pivoting will be
458
used), a user must define functions for the magnitude and for
459
comparing field members. After that all that remains is to define a
460
Common Lisp structure @code{mring}. The file @code{mring} has many
463
To compute the factorization, the first task is to convert each matrix
464
entry to a member of the indicated field. When conversion isn't
465
possible, the factorization halts with an error message. Members of
466
the field needn't be Maxima expressions. Members of the
467
@code{complexfield}, for example, are Common Lisp complex numbers. Thus
468
after computing the factorization, the matrix entries must be
469
converted to Maxima expressions.
471
See also @code{get_lu_factors}.
477
@c load (linearalgebra);
478
@c w[i,j] := random (1.0) + %i * random (1.0);
480
@c M : genmatrix (w, 100, 100)$
481
@c lu_factor (M, complexfield)$
482
@c lu_factor (M, generalring)$
484
@c M : matrix ([1 - z, 3], [3, 8 - z]);
485
@c lu_factor (M, generalring);
486
@c get_lu_factors (%);
487
@c %[1] . %[2] . %[3];
490
(%i1) load (linearalgebra);
491
Warning - you are redefining the Maxima function require_list
492
Warning - you are redefining the Maxima function matrix_size
493
Warning - you are redefining the Maxima function rank
494
(%o1) /usr/local/share/maxima/5.9.2/share/linearalgebra/linearalgebra.mac
495
(%i2) w[i,j] := random (1.0) + %i * random (1.0);
496
(%o2) w := random(1.) + %i random(1.)
498
(%i3) showtime : true$
499
Evaluation took 0.00 seconds (0.00 elapsed)
500
(%i4) M : genmatrix (w, 100, 100)$
501
Evaluation took 7.40 seconds (8.23 elapsed)
502
(%i5) lu_factor (M, complexfield)$
503
Evaluation took 28.71 seconds (35.00 elapsed)
504
(%i6) lu_factor (M, generalring)$
505
Evaluation took 109.24 seconds (152.10 elapsed)
506
(%i7) showtime : false$
508
(%i8) M : matrix ([1 - z, 3], [3, 8 - z]);
512
(%i9) lu_factor (M, generalring);
515
(%o9) [[ 3 9 ], [1, 2]]
516
[ ----- - z - ----- + 8 ]
518
(%i10) get_lu_factors (%);
521
(%o10) [[ ], [ 3 ], [ 9 ]]
522
[ 0 1 ] [ ----- 1 ] [ 0 - z - ----- + 8 ]
524
(%i11) %[1] . %[2] . %[3];
532
@deffn {Function} mat_cond (@var{M}, 1)
533
@deffnx {Function} mat_cond (@var{M}, inf)
535
Return the @var{p}-norm matrix condition number of the matrix
536
@var{m}. The allowed values for @var{p} are 1 and @var{inf}. This
537
function uses the LU factorization to invert the matrix @var{m}. Thus
538
the running time for @code{mat_cond} is proportional to the cube of
539
the matrix size; @code{lu_factor} determines lower and upper bounds
540
for the infinity norm condition number in time proportional to the
541
square of the matrix size.
545
@deffn {Function} mat_norm (@var{M}, 1)
546
@deffnx {Function} mat_norm (@var{M}, inf)
547
@deffnx {Function} mat_norm (@var{M}, frobenius)
549
Return the matrix @var{p}-norm of the matrix @var{M}. The allowed values for @var{p} are
550
1, @code{inf}, and @code{frobenius} (the Frobenius matrix norm). The matrix @var{M} should be
556
@deffn {Function} matrix_size (@var{M})
558
Return a two member list that gives the number of rows and columns, respectively
559
of the matrix @var{M}.
563
@deffn {Function} mat_fullunblocker (@var{M})
565
If @var{M} is a block matrix, unblock the matrix to all levels. If @var{M} is a matrix,
566
return @var{M}; otherwise, signal an error.
570
@deffn {Function} mat_trace (@var{M})
572
Return the trace of the matrix @var{M} If @var{M} isn't a matrix, return a
573
noun form. When @var{M} is a block matrix, @code{mat_trace(M)} returns
574
the same value as does @code{mat_trace(mat_unblocker(m))}.
578
@deffn {Function} mat_unblocker (@var{M})
580
If @var{M} is a block matrix, unblock @var{M} one level. If @var{M} is a matrix,
581
@code{mat_unblocker (M)} returns @var{M}; otherwise, signal an error.
583
Thus if each entry of @var{M} is matrix, @code{mat_unblocker (M)} returns an
584
unblocked matrix, but if each entry of @var{M} is a block matrix, @code{mat_unblocker (M)}
585
returns a block matrix with on less level of blocking.
587
If you use block matrices, most likely you'll want to set @code{matrix_element_mult} to
588
@code{"."} and @code{matrix_element_transpose} to @code{'transpose}. See also @code{mat_fullunblocker}.
593
@c load (linearalgebra);
594
@c A : matrix ([1, 2], [3, 4]);
595
@c B : matrix ([7, 8], [9, 10]);
597
@c mat_unblocker (%);
600
(%i1) load (linearalgebra);
601
Warning - you are redefining the Maxima function require_list
602
Warning - you are redefining the Maxima function matrix_size
603
Warning - you are redefining the Maxima function rank
604
(%o1) /usr/local/share/maxima/5.9.2/share/linearalgebra/linearalgebra.mac
605
(%i2) A : matrix ([1, 2], [3, 4]);
609
(%i3) B : matrix ([7, 8], [9, 10]);
613
(%i4) matrix ([A, B]);
617
(%i5) mat_unblocker (%);
625
@deffn {Function} nonnegintegerp (@var{n})
627
Return @code{true} if and only if @code{@var{n} >= 0} and @var{n} is an integer.
631
@deffn {Function} nullspace (@var{M})
633
If @var{M} is a matrix, return @code{span (v_1, ..., v_n)}, where the set @code{@{v_1, ..., v_n@}}
634
is a basis for the nullspace of @var{M}. The span of the empty set is @code{@{0@}}.
635
Thus, when the nullspace has only one member, return @code{span ()}.
639
@deffn {Function} nullity (@var{M})
641
If @var{M} is a matrix, return the dimension of the nullspace of @var{M}.
645
@deffn {Function} orthogonal_complement (@var{v_1}, ..., @var{v_n})
647
Return @code{span (u_1, ..., u_m)}, where the set @code{@{u_1, ..., u_m@}} is a
648
basis for the orthogonal complement of the set @code{(v_1, ..., v_n)}.
650
Each vector @var{v_1} through @var{v_n} must be a column vector.
654
@deffn {Function} polynomialp (@var{p}, @var{L}, @var{coeffp}, @var{exponp})
655
@deffnx {Function} polynomialp (@var{p}, @var{L}, @var{coeffp})
656
@deffnx {Function} polynomialp (@var{p}, @var{L})
658
Return true if @var{p} is a polynomial in the variables in the list @var{L},
659
The predicate @var{coeffp} must evaluate to @code{true} for each
660
coefficient, and the predicate @var{exponp} must evaluate to @code{true} for all
661
exponents of the variables in @var{L}. If you want to use a non-default
662
value for @var{exponp}, you must supply @var{coeffp} with a value even if you want
663
to use the default for @var{coeffp}.
665
@c WORK THE FOLLOWING INTO THE PRECEDING
666
@code{polynomialp (@var{p}, @var{L}, @var{coeffp})} is equivalent to
667
@code{polynomialp (@var{p}, @var{L}, @var{coeffp}, 'nonnegintegerp)}.
669
@code{polynomialp (@var{p}, @var{L})} is equivalent to
670
@code{polynomialp (@var{p}, L@var{,} 'constantp, 'nonnegintegerp)}.
672
The polynomial needn't be expanded:
675
@c load (linearalgebra);
676
@c polynomialp ((x + 1)*(x + 2), [x]);
677
@c polynomialp ((x + 1)*(x + 2)^a, [x]);
680
(%i1) load (linearalgebra);
681
Warning - you are redefining the Maxima function require_list
682
Warning - you are redefining the Maxima function matrix_size
683
Warning - you are redefining the Maxima function rank
684
(%o1) /usr/local/share/maxima/5.9.2/share/linearalgebra/linearalgebra.mac
685
(%i2) polynomialp ((x + 1)*(x + 2), [x]);
687
(%i3) polynomialp ((x + 1)*(x + 2)^a, [x]);
691
An example using non-default values for coeffp and exponp:
694
@c load (linearalgebra);
695
@c polynomialp ((x + 1)*(x + 2)^(3/2), [x], numberp, numberp);
696
@c polynomialp ((x^(1/2) + 1)*(x + 2)^(3/2), [x], numberp, numberp);
699
(%i1) load (linearalgebra);
700
Warning - you are redefining the Maxima function require_list
701
Warning - you are redefining the Maxima function matrix_size
702
Warning - you are redefining the Maxima function rank
703
(%o1) /usr/local/share/maxima/5.9.2/share/linearalgebra/linearalgebra.mac
704
(%i2) polynomialp ((x + 1)*(x + 2)^(3/2), [x], numberp, numberp);
706
(%i3) polynomialp ((x^(1/2) + 1)*(x + 2)^(3/2), [x], numberp, numberp);
710
Polynomials with two variables:
713
@c load (linearalgebra);
714
@c polynomialp (x^2 + 5*x*y + y^2, [x]);
715
@c polynomialp (x^2 + 5*x*y + y^2, [x, y]);
718
(%i1) load (linearalgebra);
719
Warning - you are redefining the Maxima function require_list
720
Warning - you are redefining the Maxima function matrix_size
721
Warning - you are redefining the Maxima function rank
722
(%o1) /usr/local/share/maxima/5.9.2/share/linearalgebra/linearalgebra.mac
723
(%i2) polynomialp (x^2 + 5*x*y + y^2, [x]);
725
(%i3) polynomialp (x^2 + 5*x*y + y^2, [x, y]);
731
@deffn {Function} polytocompanion (@var{p}, @var{x})
733
If @var{p} is a polynomial in @var{x}, return the companion matrix of @var{p}. For
734
a monic polynomial @var{p} of degree @var{n},
735
we have @code{@var{p} = (-1)^@var{n} charpoly (polytocompanion (@var{p}, @var{x}))}.
737
When @var{p} isn't a polynomial in @var{x}, signal an error.
741
@deffn {Function} ptriangularize (@var{M}, @var{v})
743
If @var{M} is a matrix with each entry a polynomial in @var{v}, return
744
a matrix @var{M2} such that
746
(1) @var{M2} is upper triangular,
748
(2) @code{@var{M2} = @var{E_n} ... @var{E_1} @var{M}},
749
where @var{E_1} through @var{E_n} are elementary matrices
750
whose entries are polynomials in @var{v},
752
(3) @code{|det (@var{M})| = |det (@var{M2})|},
754
Note: This function doesn't check that every entry is a polynomial in @var{v}.
758
@deffn {Function} rowop (@var{M}, @var{i}, @var{j}, @var{theta})
760
If @var{M} is a matrix, return the matrix that results from doing the
761
row operation @code{R_i <- R_i - theta * R_j}. If @var{M} doesn't have a row
762
@var{i} or @var{j}, signal an error.
766
@deffn {Function} rank (@var{M})
768
Return the rank of that matrix @var{M}. The rank is the dimension of the
769
column space. Example:
771
@c load (linearalgebra);
775
(%i1) load(linearalgebra)$
776
(%i2) rank(matrix([1,2],[2,4]));
778
(%i3) rank(matrix([1,b],[c,d]));
779
Proviso: @{d-b*c # 0@}
786
@deffn {Function} rowswap (@var{M}, @var{i}, @var{j})
788
If @var{M} is a matrix, swap rows @var{i} and @var{j}. If @var{M} doesn't have a row
789
@var{i} or @var{j}, signal an error.
793
@deffn {Function} toeplitz (@var{col})
794
@deffnx {Function} toeplitz (@var{col}, @var{row})
796
Return a Toeplitz matrix @var{T}. The first first column of @var{T} is @var{col};
797
except for the first entry, the first row of @var{T} is @var{row}. The
798
default for @var{row} is complex conjugate of @var{col}. Example:
800
@c load(linearalgebra)$
801
@c toeplitz([1,2,3],[x,y,z]);
802
@c toeplitz([1,1+%i]);
805
(%i1) load(linearalgebra)$
807
(%i2) toeplitz([1,2,3],[x,y,z]);
814
(%i3) toeplitz([1,1+%i]);
823
@deffn {Function} vandermonde_matrix ([@var{x_1}, ..., @var{x_n}])
825
Return a @var{n} by @var{n} matrix whose @var{i}-th row is
826
@code{[1, @var{x_i}, @var{x_i}^2, ... @var{x_i}^(@var{n}-1)]}.
830
@deffn {Function} zerofor (@var{M})
831
@deffnx {Function} zerofor (@var{M}, @var{fld})
833
Return a zero matrix that has the same shape as the matrix
834
@var{M}. Every entry of the zero matrix matrix is the
835
additive identity of the field @var{fld}; the default for
836
@var{fld} is @var{generalring}.
838
The first argument @var{M} should be a square matrix or a
839
non-matrix. When @var{M} is a matrix, each entry of @var{M} can be a
840
square matrix -- thus @var{M} can be a blocked Maxima matrix. The
841
matrix can be blocked to any (finite) depth.
843
See also @code{identfor}
847
@deffn {Function} zeromatrixp (@var{M})
849
If @var{M} is not a block matrix, return @code{true} if @code{is (equal (@var{e}, 0))}
850
is true for each element @var{e} of the matrix @var{M}. If @var{M} is a block matrix, return
851
@code{true} if @code{zeromatrixp} evaluates to true for each element of @var{e}.
855
@node Function and variable index, , Definitions for linearalgebra, Top
856
@appendix Function and variable index