-
#include "tensorstore/array.h" -
template <typename Func, typename... Array>
bool tensorstore::IterateOverArrays(Func&& func,
IterationConstraints constraints,
const Array&... array); Iterates over one array or jointly iterates over multiple arrays.
For each index vector
indiceswithin the domain of the arrays, calls the element-wise functionfunc(&array(indices)...).- Requires:¶
The
Arraytypes must satisfyIsArray<Array>and have compatible static ranks.- Parameters:¶
- Func &&func¶
The element-wise function. Must return
voidorboolwhen invoked with(Array::Element*...). Iteration stops if the return value offuncisfalse.- IterationConstraints constraints¶
Specifies constraints on the iteration order, and whether repeated elements may be skipped. If
constraints.can_skip_repeated_elements(), the element-wise function may be invoked only once for multipleindicesvectors that yield the same tuple of element pointers. Ifconstraints.has_order_constraint(),funcis invoked in the order given byconstraints.order_constraint_value(). Otherwise, iteration is not guaranteed to occur in any particular order; an efficient iteration order is determined automatically.- const Array&... array¶
The arrays over which to iterate, which must all have the same shape.
- Returns:¶
trueon success,falseon failure.- Checks:¶