Tensor<T>.Any Method

Definition

Namespace: Numerics.NET.Tensors
Assembly: Numerics.NET.Tensors (in Numerics.NET.Tensors.dll) Version: 9.0.0

Overload List

Any<TPredicate>(TPredicate, Tensor<Boolean>, Boolean) Computes whether any elements of the tensor satisfy the specified predicate.
Any<TPredicate>(TPredicate, Axes, Tensor<Boolean>, Boolean, Tensor<Boolean>, Boolean, TensorElementOrder) Computes whether any elements of the tensor along the specified axis satisfy the specified predicate.

Any<TPredicate>(TPredicate, Tensor<Boolean>, Boolean)

Computes whether any elements of the tensor satisfy the specified predicate.
C#
public virtual bool Any<TPredicate>(
	TPredicate predicate,
	Tensor<bool>? mask = null,
	bool skipMissingValues = false
)
where TPredicate : struct, new(), IFastFunc<T, bool>

Parameters

predicate  TPredicate
A 'fast' function that evaluates the predicate each element is tested for.
mask  Tensor<Boolean>  (Optional)
Optional. A boolean that specifies for which elements the operation should be performed. If null (the default), the operation is applied everywhere.
skipMissingValues  Boolean  (Optional)
Optional. Specifies whether missing values should be excluded from the aggregation. The default is false.

Type Parameters

TPredicate
The type of predicate.

Return Value

Boolean
true if any elements of the tensor that satisfy mask satisfy predicate; otherwise false.

Any<TPredicate>(TPredicate, Axes, Tensor<Boolean>, Boolean, Tensor<Boolean>, Boolean, TensorElementOrder)

Computes whether any elements of the tensor along the specified axis satisfy the specified predicate.
C#
public virtual Tensor<bool> Any<TPredicate>(
	TPredicate predicate,
	Axes axis,
	Tensor<bool>? result = null,
	bool keepDimensions = false,
	Tensor<bool>? mask = null,
	bool skipMissingValues = false,
	TensorElementOrder order = TensorElementOrder.Automatic
)
where TPredicate : struct, new(), IFastFunc<T, bool>

Parameters

predicate  TPredicate
A 'fast' function that evaluates the predicate each element is tested for.
axis  Axes
The axis along which to sum the elements. The default is 0.
result  Tensor<Boolean>  (Optional)
Optional. The tensor that is to hold the result. May be null.
keepDimensions  Boolean  (Optional)
Optional. Specifies whether the reduced axis should be retained in the result. The default is false.
mask  Tensor<Boolean>  (Optional)
Optional. A boolean that specifies for which elements the operation should be performed. If null (the default), the operation is applied everywhere.
skipMissingValues  Boolean  (Optional)
Optional. Specifies whether missing values should be excluded from the aggregation. The default is false.
order  TensorElementOrder  (Optional)
Optional. Specifies the element order of the result. By default, elements are stored in the order of the current tensor.

Type Parameters

TPredicate
The type of predicate.

Return Value

Tensor<Boolean>
A tensor containing a value that indicates whether all elements of the tensor that satisfy mask along axis satisfy predicate.

See Also