#include "tensorstore/index_space/index_domain.h"
Result<IndexDomain<>>
tensorstore::HullIndexDomains(IndexDomainView<> a,
                              
IndexDomainView<> b);

Computes the hull of two index domains.

If both a and b are null, returns a null index domain.

If exactly one of a and b is non-null, returns the non-null domain.

Otherwise, a and b must be compatible:

  • a.rank() == b.rank()

  • For all dimension i for which !a.labels()[i].empty() && !b.labels()[i].empty(), a.labels[i] == b.labels[i].

In the resulting domain, each bound is the smaller of the lower bounds and the larger of the upper bounds. The implicit flag that corresponds to the chosen bound is propagated. The result includes the labels, with non-empty labels having precedence.

Returns:

The hull of the two domains domain, or a null domain if a and b are both null.

Error absl::StatusCode::kInvalidArgument:

if a and b are not compatible.