LinearAlgebra - Maple Programming Help

Online Help

All Products    Maple    MapleSim


Home : Support : Online Help : Mathematics : Linear Algebra : LinearAlgebra Package : Queries : LinearAlgebra/Equal

LinearAlgebra

  

Equal

  

compare two Vectors or two Matrices for equality

 

Calling Sequence

Parameters

Description

Examples

Calling Sequence

Equal(A, B, c)

Parameters

A

-

Matrix or Vector

B

-

Matrix or Vector

c

-

(optional) equation of the form compare=method where method is one of 'entries', 'structure', or 'all'; type of comparison to make

Description

• 

In any call to Equal(..), A and B must be the same type (both Matrices or both Vectors). Otherwise, Equal(..) returns false.

• 

The Equal(A, B) function returns true if A and B are the same type, have the same dimension, and have equal component-wise data.  In particular, if A and B are Vectors, they must also have the same orientation.

  

Since compare='entries' is the default comparison method, Equal(A, B) and Equal(A, B, compare='entries') are equivalent.

• 

For Matrices, the Equal(A, B, compare='structure') function returns true if A and B have the same dimension, datatype, shape, storage, attributes, and order.

  

For Vectors, the Equal(A, B, compare='structure') function returns true if A and B have the same dimension, datatype, shape, storage, attributes, and orientation.

  

The compare='structure' method does not consider the value of the entries in the Matrices or Vectors in its comparison.

• 

The Equal(A, B, compare='all') function is equivalent to the logical AND of compare='entries' and compare='structure'.

• 

This function is part of the LinearAlgebra package, and so it can be used in the form Equal(..) only after executing the command with(LinearAlgebra). However, it can always be accessed through the long form of the command by using LinearAlgebra[Equal](..).

Examples

withLinearAlgebra:

RVectorrow12,32,15,35,datatype=rational

R12321535

(1)

FVectorrow0.5,1.5,0.2,0.6,datatype=sfloat

F0.51.5−0.20.6

(2)

EqualR,F

true

(3)

EqualR,F,compare=all

false

(4)

S2,0|0,2

S2002

(5)

EqualS,ScalarMatrix2,2,compare=structure

false

(6)

EqualS,ScalarMatrix2,2,compare=entries

true

(7)

See Also

EqualEntries

Matrix

Vector