@@ -5418,6 +5418,8 @@ earlier dimensions before those that involve later dimensions.
#include <isl/space.h>
__isl_give isl_space *isl_space_reverse(
__isl_take isl_space *space);
+ __isl_give isl_space *isl_space_wrapped_reverse(
+ __isl_take isl_space *space);
__isl_give isl_space *isl_space_domain_reverse(
__isl_take isl_space *space);
__isl_give isl_space *isl_space_range_reverse(
@@ -5442,6 +5444,8 @@ that is embedded in the range of the input map space.
The identifier of the range, if any, is only preserved
if this embedded relation has identical input and output tuples.
Similarly for C<isl_space_domain_reverse>.
+Along the same lines, C<isl_space_wrapped_reverse> reverses
+the relation that is embedded in a set space.
=item * Tuple binding
@@ -134,6 +134,8 @@ __isl_give isl_space *isl_space_map_from_domain_and_range(
__isl_export
__isl_give isl_space *isl_space_reverse(__isl_take isl_space *space);
__isl_export
+__isl_give isl_space *isl_space_wrapped_reverse(__isl_take isl_space *space);
+__isl_export
__isl_give isl_space *isl_space_domain_reverse(__isl_take isl_space *space);
__isl_export
__isl_give isl_space *isl_space_range_reverse(__isl_take isl_space *space);
@@ -614,6 +614,8 @@ static std::vector<Signature> fn_domain = { domain, set_params };
/* Signatures for interchanging (wrapped) domain and range.
*/
+static Signature set_reverse =
+ { { { Range, Domain } }, { { { Domain, Range } } } };
static Signature map_reverse = { { Range, Domain }, { { Domain, Range } } };
static Signature map_domain_reverse =
{ { { Domain2, Domain }, Range }, { { { Domain, Domain2 }, Range } } };
@@ -915,6 +917,7 @@ member_methods {
{ "unwrap", { unwrap } },
{ "upper_bound", fn_bin_op },
{ "wrap", { wrap } },
+ { "wrapped_reverse", { set_reverse } },
{ "zero", fn_un_op },
{ "zero_on_domain", { anonymous_map_from_domain } },
};
@@ -2070,6 +2070,23 @@ __isl_give isl_space *isl_space_reverse_wrapped(__isl_take isl_space *space,
return space;
}
+/* Given a space (A -> B), return the corresponding space
+ * (B -> A).
+ *
+ * If the domain tuple is named, then the name is only preserved
+ * if A and B are equal tuples, in which case the output
+ * of this function is identical to the input, except possibly
+ * for the dimension identifiers.
+ */
+__isl_give isl_space *isl_space_wrapped_reverse(__isl_take isl_space *space)
+{
+ if (isl_space_check_is_wrapping(space) < 0)
+ return isl_space_free(space);
+ space = isl_space_reverse_wrapped(space, isl_dim_set);
+
+ return space;
+}
+
/* Given a space (A -> B) -> C, return the corresponding space
* (B -> A) -> C.
*