tests parts of expr at level level.
represents an operator form of AllTrue that can be applied to an expression.
- AllTrue[list,test] and AllTrue[list,test,level] only evaluate as many test[ei] as are necessary to determine the result.
- AllTrue[list,test] is equivalent to AllTrue[list,test,1].
- AllTrue[test][list] is equivalent to AllTrue[list,test].
Examplesopen allclose all
Basic Examples (4)
Test if all elements of a list satisfy a condition:
Check if all elements of a matrix satisfy a condition:
Test if all values of an association satisfy a condition:
If the condition applied to no element produces False, a symbolic result may be returned:
Even when the condition applied to some elements is symbolic, a definitive result may be deduced:
TrueQ may be used to avoid getting a symbolic result:
AllTrue may be applied to expressions with any head:
AllTrue can operate on ragged expressions:
By default, AllTrue always operates at level 1:
Properties & Relations (5)
Possible Issues (1)
A symbolic result may be returned:
Introduced in 2014
Updated in 2015