linalg(deprecated)/equal - Maple Help

linalg(deprecated)

 equal
 determine whether two matrices are equal

 Calling Sequence equal(A, B)

Parameters

 A, B - matrices

Description

 • Important: The linalg package has been deprecated. Use the superseding command LinearAlgebra[Equal], instead.
 - For information on migrating linalg code to the new packages, see examples/LinearAlgebraMigration.
 • The procedure equal returns true if matrices A and B are of the same shape and corresponding entries are equal, false or an error otherwise.
 • The command with(linalg,equal) allows the use of the abbreviated form of this command.

Examples

Important: The linalg package has been deprecated. Use the superseding command LinearAlgebra[Equal], instead.

 > $\mathrm{with}\left(\mathrm{linalg}\right):$
 > $A≔\mathrm{array}\left(\left[\left[2,1\right],\left[1,2\right]\right]\right)$
 ${A}{≔}\left[\begin{array}{cc}{2}& {1}\\ {1}& {2}\end{array}\right]$ (1)
 > $B≔\mathrm{array}\left(\left[2,1,1,2\right]\right)$
 ${B}{≔}\left[\begin{array}{cccc}{2}& {1}& {1}& {2}\end{array}\right]$ (2)

equal returns an error if A and B are not of the same type

 > $\mathrm{equal}\left(A,B\right)$
 > $C≔\mathrm{matrix}\left(2,2,\left[2,1,1,2\right]\right)$
 ${C}{≔}\left[\begin{array}{cc}{2}& {1}\\ {1}& {2}\end{array}\right]$ (3)
 > $\mathrm{equal}\left(A,C\right)$
 ${\mathrm{true}}$ (4)
 > $F≔\mathrm{array}\left(\left[\left[2,1\right],\left[2,1\right]\right]\right)$
 ${F}{≔}\left[\begin{array}{cc}{2}& {1}\\ {2}& {1}\end{array}\right]$ (5)
 > $\mathrm{equal}\left(A,F\right)$
 ${\mathrm{false}}$ (6)