#include "tensorstore/index_space/alignment.h"
absl::Status tensorstore::AlignDimensionsTo(
    
IndexDomainView<> source,
    
IndexDomainView<> target,
    
span<DimensionIndex> source_matches,
    
DomainAlignmentOptions options = DomainAlignmentOptions::all);

Same as AlignDomainTo, but instead of computing the alignment transform, simply sets source_matches[i] = j, if source dimension i matches to target dimension j, and sets source_matches[i] = -1 if source dimension i is unmatched.

Parameters:
IndexDomainView<> source

Source domain.

IndexDomainView<> target

Target domain.

out
span<DimensionIndex> source_matches

Array of length source.rank(), set to the matches on success. In the case of an error, the contents is unspecified.

DomainAlignmentOptions options = DomainAlignmentOptions::all

Specifies the transformations that are permitted. By default, all transformations (permutation, translation, broadcasting) are permitted.

Dchecks:

source.valid()

Dchecks:

target.valid()

Dchecks:

source_matches.size() == source.rank()

Returns:

absl::Status() on success.

Error absl::StatusCode::kInvalidArgument:

if matching fails.