Matrix Add - Maple Help
For the best experience, we recommend viewing online help using Google Chrome or Microsoft Edge.

Online Help

All Products    Maple    MapleSim


LinearAlgebra[Generic]

  

MatrixAdd

  

add two matrices

  

VectorAdd

  

add two vectors

 

Calling Sequence

Parameters

Description

Examples

Compatibility

Calling Sequence

MatrixAdd[R](A,B,c,d)

VectorAdd[R](v,w,c,d)

MatrixAdd[R](lA,lc)

VectorAdd[R](lv,lc)

Parameters

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

Description

• 

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.

Examples

withLinearAlgebraGeneric:

F8GF2,3,a3+a+1

F8𝔽8

(1)

AmapF8,Matrixa,a+1,0,a2,0,a2+a

Aamod2a+1mod20mod2a2mod20mod2a2+amod2

(2)

BmapF8,Matrix1,a2+a,a,a2+1,a,a

B1mod2a2+amod2amod2a2+1mod2amod2amod2

(3)

MatrixAddF8A,B=MatrixAddF8A,B

a+1mod2a2+1mod2amod21mod2amod2a2mod2=a+1mod2a2+1mod2amod21mod2amod2a2mod2

(4)

cF8a

camod2

(5)

dF8a+1

da+1mod2

(6)

MatrixAddF8A,B,c,d=MatrixAddF8A,B,c,d

a2+a+1mod2a2+a+1mod2a2+amod2a2+a+1mod2a2+amod21mod2=a2+a+1mod2a2+a+1mod2a2+amod2a2+a+1mod2a2+amod21mod2

(7)

vmapF8,Vectora2+a+1,a,a+1

va2+a+1mod2amod2a+1mod2

(8)

wmapF8,Vectora+1,a2,a2+a

wa+1mod2a2mod2a2+amod2

(9)

VectorAddF8v,w=VectorAddF8v,w

a2mod2a2+amod2a2+1mod2=a2mod2a2+amod2a2+1mod2

(10)

VectorAddF8v,w,c,d=VectorAddF8v,w,c,d

0mod2a+1mod2a2+a+1mod2=0mod2a+1mod2a2+a+1mod2

(11)

Compatibility

• 

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[Generic]

LinearAlgebra[MatrixAdd]

LinearAlgebra[VectorAdd]