Skip to content

Commit

Permalink
export isl_map_from_multi_pw_aff as isl_multi_pw_aff_as_map
Browse files Browse the repository at this point in the history
In the bindings, it is more convenient to use a method
on the object being converted than to call a named constructor
with the object as argument.
The function has an infix "as" because only functions living
in a map space can be converted to an isl_map.
This naming is consistent with the "as" method
in the C++ interface of type based subclasses.

Signed-off-by: Sven Verdoolaege <[email protected]>
  • Loading branch information
restrin-cb authored and skimo-openhub committed Jan 13, 2021
1 parent 84cc1f1 commit 4e81432
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 0 deletions.
3 changes: 3 additions & 0 deletions doc/user.pod
Original file line number Diff line number Diff line change
Expand Up @@ -2279,6 +2279,8 @@ involve any NaN.
__isl_take isl_multi_pw_aff *mpa);
__isl_give isl_set *isl_set_from_multi_pw_aff(
__isl_take isl_multi_pw_aff *mpa);
__isl_give isl_map *isl_multi_pw_aff_as_map(
__isl_take isl_multi_pw_aff *mpa);
__isl_give isl_map *isl_map_from_multi_pw_aff(
__isl_take isl_multi_pw_aff *mpa);
__isl_give isl_union_map *isl_union_map_from_union_pw_aff(
Expand Down Expand Up @@ -2306,6 +2308,7 @@ for the pair C<isl_pw_aff_as_map> and C<isl_map_from_pw_aff>,
for the pair C<isl_pw_multi_aff_as_set> and C<isl_set_from_pw_multi_aff>,
for the pair C<isl_pw_multi_aff_as_map> and C<isl_map_from_pw_multi_aff>,
the pair C<isl_multi_pw_aff_as_set> and C<isl_set_from_multi_pw_aff>,
the pair C<isl_multi_pw_aff_as_map> and C<isl_map_from_multi_pw_aff>,
and
C<isl_union_pw_multi_aff_as_union_map> and
C<isl_union_map_from_union_pw_multi_aff>.
Expand Down
2 changes: 2 additions & 0 deletions include/isl/aff.h
Original file line number Diff line number Diff line change
Expand Up @@ -1109,6 +1109,8 @@ __isl_give isl_multi_pw_aff *isl_multi_pw_aff_move_dims(
__isl_export
__isl_give isl_set *isl_multi_pw_aff_as_set(__isl_take isl_multi_pw_aff *mpa);
__isl_give isl_set *isl_set_from_multi_pw_aff(__isl_take isl_multi_pw_aff *mpa);
__isl_export
__isl_give isl_map *isl_multi_pw_aff_as_map(__isl_take isl_multi_pw_aff *mpa);
__isl_give isl_map *isl_map_from_multi_pw_aff(__isl_take isl_multi_pw_aff *mpa);
__isl_give isl_pw_multi_aff *isl_pw_multi_aff_from_multi_pw_aff(
__isl_take isl_multi_pw_aff *mpa);
Expand Down
8 changes: 8 additions & 0 deletions isl_aff_map.c
Original file line number Diff line number Diff line change
Expand Up @@ -478,6 +478,14 @@ __isl_give isl_map *isl_map_from_multi_pw_aff(__isl_take isl_multi_pw_aff *mpa)
return map_from_multi_pw_aff(mpa);
}

/* This function performs the same operation as isl_map_from_multi_pw_aff,
* but is considered as a function on an isl_multi_pw_aff when exported.
*/
__isl_give isl_map *isl_multi_pw_aff_as_map(__isl_take isl_multi_pw_aff *mpa)
{
return isl_map_from_multi_pw_aff(mpa);
}

/* Construct a set mapping the shared parameter domain
* of the piecewise affine expressions to the space of "mpa"
* with each dimension in the range equated to the
Expand Down

0 comments on commit 4e81432

Please sign in to comment.