-
#include "tensorstore/index_space/dim_expression.h"
-
template <typename Labels>
auto tensorstore::DimExpression<Op...>::Label(
const Labels& labels) const; -
template <typename... L>
auto tensorstore::DimExpression<Op...>::Label(
const L&... labels) const; Sets (or changes) the labels of the selected dimensions.
The new dimension selection is the same as the prior dimension selection, with a static rank equal to the merged static rank of the prior dimension selection and the static rank of the
labels
vector.For example:
Dims(0, 2).Label({"a", "b"})
has the following effects:Before
After
Dimension selection
{0, 2}
{0, 2}
Input domain
[1, 3], [2, 5], [3, 4]
[1, 3], [2, 5], [3, 4]
Labels
{"x", "y", "z"}
{"a", "y", "b"}
- Requires:¶
Labels
isspan
-compatible with aspan::value_type
ofstd::string
,std::string_view
, orconst char*
, and a static extent compatible with the static rank of the dimension selection.- Parameters:¶
- Error absl::StatusCode::kInvalidArgument:¶
if the extent of the
labels
vector is equal to the number of selected dimensions.