ArrayTools[AllNonZero] - true when the Array has no zero entries
ArrayTools[HasZero] - true when the Array has a zero entry
ArrayTools[HasNonZero] - true when the Array has a non-zero entry
ArrayTools[IsZero] - true when the Array has only zero entries
ArrayTools[AnyNonZeros] - collapse non-zero lines to 1, zero lines to 0
|
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 non-zero entries in an Array.
|
•
|
The HasNonZero command returns true when a single element of the Array is non-zero.
|
•
|
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 non-zero 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
|
|
>
|
|
>
|
|
| (1) |
>
|
|
| (2) |
>
|
|
| (3) |
|
|
Download Help Document
Was this information helpful?