LinearAlgebra[Generic]
MatrixAdd
add two matrices
VectorAdd
add two vectors
Calling Sequence
Parameters
Description
Examples
Compatibility
MatrixAdd[R](A,B,c,d)
VectorAdd[R](v,w,c,d)
MatrixAdd[R](lA,lc)
VectorAdd[R](lv,lc)
R
-
the domain of computation
A,B
Matrices of values in R
c,d
(optional) scalar values in R (default values: 1)
v,w
Vectors of values in R
lA
non-empty list of Matrices over R
lc
(optional) non-empty list of scalar values in R
lv
non-empty list of vectors over R
The (indexed) parameter R, which specifies the domain of computation, a commutative ring, must be a Maple table/module which has the following values/exports:
R[`0`] : a constant for the zero of the ring R
R[`1`] : a constant for the (multiplicative) identity of R
R[`+`] : a procedure for adding elements of R (nary)
R[`-`] : a procedure for negating and subtracting elements of R (unary and binary)
R[`*`] : a procedure for multiplying elements of R (binary and commutative)
R[`=`] : a boolean procedure for testing if two elements of R are equal
The parameters A,B, and v,w must have compatible dimensions for the addition. Similarly, all Matrices in lA, and all Vectors in lv, must have compatible dimensions, and the number of elements of lc, if given, must match the number of element of lA or lv, respectively.
If c,d,lc are omitted, then MatrixAdd and VectorAdd just compute the sum of the matrices or vectors, respectively.
with⁡LinearAlgebraGeneric:
F8≔GF⁡2,3,a3+a+1
F8≔𝔽8
A≔map⁡F8,Matrix⁡a,a+1,0,a2,0,a2+a
A≔amod2a+1mod20mod2a2mod20mod2a2+amod2
B≔map⁡F8,Matrix⁡1,a2+a,a,a2+1,a,a
B≔1mod2a2+amod2amod2a2+1mod2amod2amod2
MatrixAddF8⁡A,B=MatrixAddF8⁡A,B
a+1mod2a2+1mod2amod21mod2amod2a2mod2=a+1mod2a2+1mod2amod21mod2amod2a2mod2
c≔F8⁡a
c≔amod2
d≔F8⁡a+1
d≔a+1mod2
MatrixAddF8⁡A,B,c,d=MatrixAddF8⁡A,B,c,d
a2+a+1mod2a2+a+1mod2a2+amod2a2+a+1mod2a2+amod21mod2=a2+a+1mod2a2+a+1mod2a2+amod2a2+a+1mod2a2+amod21mod2
v≔map⁡F8,Vector⁡a2+a+1,a,a+1
v≔a2+a+1mod2amod2a+1mod2
w≔map⁡F8,Vector⁡a+1,a2,a2+a
w≔a+1mod2a2mod2a2+amod2
VectorAddF8⁡v,w=VectorAddF8⁡v,w
a2mod2a2+amod2a2+1mod2=a2mod2a2+amod2a2+1mod2
VectorAddF8⁡v,w,c,d=VectorAddF8⁡v,w,c,d
0mod2a+1mod2a2+a+1mod2=0mod2a+1mod2a2+a+1mod2
The LinearAlgebra[Generic][MatrixAdd] and LinearAlgebra[Generic][VectorAdd] commands were introduced in Maple 2021.
For more information on Maple 2021 changes, see Updates in Maple 2021.
See Also
LinearAlgebra[MatrixAdd]
LinearAlgebra[VectorAdd]
Download Help Document