ArrayTools - Maple Help

Online Help

All Products    Maple    MapleSim


Home : Support : Online Help : Programming : Low-level Manipulation : Matrices, Vectors, and Arrays : ArrayTools : ArrayTools/AllNonZero

ArrayTools

  

AllNonZero

  

true when the Array has no zero entries

  

HasZero

  

true when the Array has a zero entry

  

HasNonZero

  

true when the Array has a nonzero entry

  

IsZero

  

true when the Array has only zero entries

  

AnyNonZeros

  

collapse nonzero lines to 1, zero lines to 0

 

Calling Sequence

Parameters

Description

Examples

Calling Sequence

AllNonZero(A)

HasNonZero(A)

HasZero(A)

IsZero(A)

AnyNonZeros(A,dim)

Parameters

A

-

Matrix, Vector, or Array

dim

-

optional; integer dimension

Description

• 

These commands check for the presence of zero or nonzero entries in an Array.

• 

The HasNonZero command returns true when a single element of the Array is nonzero.

• 

The HasZero command returns true when a single element of the Array is zero.

• 

The IsZero command returns true when every element of the array is zero.

• 

The AnyNonZeros command returns 0, 1, or an Array. The first non-singleton dimension, or the dimension specified is replaced with constant zeros or ones depending on the presence of nonzero values.

• 

These commands are part of the ArrayTools package, so they can be used in the short form AllNonZero(..), HasZero(..), HasNonZero(..), IsZero(..), or AnyNonZeros(..) only after executing the command with(ArrayTools). However, they can always be accessed through the long form of the command by using ArrayTools[AllNonZero](..), ArrayTools[HasZero](..), ArrayTools[HasNonZero](..), ArrayTools[IsZero](..), or ArrayTools[AnyNonZeros](..), respectively.

Examples

withArrayTools:

AllNonZeroArraya,b,c,0,e,f

false

(1)

IsZeroArray0,0,0,0

true

(2)

AnyNonZerosArray0,b,0,0,e,f

011

(3)

See Also

ArrayTools

 


Download Help Document

Was this information helpful?



Please add your Comment (Optional)
E-mail Address (Optional)
What is ? This question helps us to combat spam