Polly 23.0.0git
isl_test2.cc File Reference
#include <assert.h>
#include <stdlib.h>
#include <functional>
#include <ios>
#include <iostream>
#include <sstream>
#include <string>
#include <type_traits>
#include <utility>
#include <vector>
#include <isl/cpp.h>

Go to the source code of this file.

Classes

struct  unary_prop
struct  unary
struct  binary
struct  ternary

Macros

#define THROW_INVALID(msg)
#define C(FN, ...)
#define TWO(x)

Typedefs

template<typename A1, typename R, typename T>
using binary_fn = R (T::*)(A1) const
template<typename A1, typename A2, typename R, typename T>
using ternary_fn = R (T::*)(A1, A2) const

Functions

template<typename A1, typename R, typename T>
static binary_fn< A1, R, T > const arg (const binary_fn< A1, R, T > &fn)
template<typename A1, typename A2, typename R, typename T>
static ternary_fn< A1, A2, R, T > const arg (const ternary_fn< A1, A2, R, T > &fn)
template<typename T, typename std::decay< decltype(std::declval< T >().is_equal(std::declval< T >()))>::type = true>
static bool is_equal (const T &a, const T &b)
template<typename T>
static void test (isl::ctx ctx, bool fn(const T &), const std::string &name, const std::vector< unary_prop > &tests)
template<typename R, typename T>
static void test (isl::ctx ctx, R(T::*fn)() const, const std::string &name, const std::vector< unary > &tests)
template<typename R, typename T, typename A1>
static void test (isl::ctx ctx, R(T::*fn)(A1) const, const std::string &name, const std::vector< binary > &tests)
template<typename R, typename T, typename A1, typename A2, typename F>
static void test_ternary (isl::ctx ctx, const F &fn, const std::string &name, const std::vector< ternary > &tests)
template<typename R, typename T, typename A1, typename A2>
static void test (isl::ctx ctx, R fn(const T &, const A1 &, const A2 &), const std::string &name, const std::vector< ternary > &tests)
template<typename R, typename T, typename A1, typename A2>
static void test (isl::ctx ctx, R(T::*fn)(A1, A2) const, const std::string &name, const std::vector< ternary > &tests)
static void test_space (isl::ctx ctx)
static bool has_single_cell (const isl::pw_multi_aff &fn)
template<typename T>
static bool has_single_cell_pma (const T &obj)
static void test_conversion (isl::ctx ctx)
static void test_preimage (isl::ctx ctx)
static void test_fixed_power (isl::ctx ctx)
static void test_intersect (isl::ctx ctx)
template<typename T>
static bool lexmin_has_single_cell (const T &obj)
static void test_lexmin (isl::ctx ctx)
template<typename T>
gist (const T &obj, const T &copy, const T &context)
static void test_gist (isl::ctx ctx)
static void test_project (isl::ctx ctx)
static void test_reverse (isl::ctx ctx)
static void test_scale (isl::ctx ctx)
static void test_id_to_id (isl::ctx ctx)
int main (int argc, char **argv)

Variables

static std::vector< std::pair< const char *, void(*)(isl::ctx)> > tests

Macro Definition Documentation

◆ C

◆ THROW_INVALID

#define THROW_INVALID ( msg)
Value:
isl::exception::throw_error(isl_error_invalid, msg, __FILE__, __LINE__)
@ isl_error_invalid
Definition ctx.h:80

Definition at line 120 of file isl_test2.cc.

Referenced by gist(), test(), test(), test(), and test_ternary().

◆ TWO

#define TWO ( x)
Value:
(x), (x)

Definition at line 560 of file isl_test2.cc.

Referenced by test_gist().

Typedef Documentation

◆ binary_fn

template<typename A1, typename R, typename T>
using binary_fn = R (T::*)(A1) const

Definition at line 39 of file isl_test2.cc.

◆ ternary_fn

template<typename A1, typename A2, typename R, typename T>
using ternary_fn = R (T::*)(A1, A2) const

Definition at line 56 of file isl_test2.cc.

Function Documentation

◆ arg() [1/2]

template<typename A1, typename R, typename T>
binary_fn< A1, R, T > const arg ( const binary_fn< A1, R, T > & fn)
static

Definition at line 46 of file isl_test2.cc.

References fn.

◆ arg() [2/2]

template<typename A1, typename A2, typename R, typename T>
ternary_fn< A1, A2, R, T > const arg ( const ternary_fn< A1, A2, R, T > & fn)
static

Definition at line 63 of file isl_test2.cc.

References fn.

◆ gist()

template<typename T>
T gist ( const T & obj,
const T & copy,
const T & context )

Definition at line 541 of file isl_test2.cc.

References context, is_equal(), obj, res, and THROW_INVALID.

◆ has_single_cell()

bool has_single_cell ( const isl::pw_multi_aff & fn)
static

Definition at line 283 of file isl_test2.cc.

References domain, and fn.

Referenced by has_single_cell_pma(), and lexmin_has_single_cell().

◆ has_single_cell_pma()

template<typename T>
bool has_single_cell_pma ( const T & obj)
static

Definition at line 293 of file isl_test2.cc.

References has_single_cell(), and obj.

Referenced by test_conversion().

◆ is_equal()

template<typename T, typename std::decay< decltype(std::declval< T >().is_equal(std::declval< T >()))>::type = true>
bool is_equal ( const T & a,
const T & b )
static

◆ lexmin_has_single_cell()

template<typename T>
bool lexmin_has_single_cell ( const T & obj)
static

Definition at line 472 of file isl_test2.cc.

References has_single_cell(), and obj.

Referenced by test_lexmin().

◆ main()

int main ( int argc,
char ** argv )

Definition at line 927 of file isl_test2.cc.

References assert, f, ISL_ARG_ALL, isl_ctx_alloc_with_options(), isl_ctx_free(), and tests.

◆ test() [1/5]

template<typename T>
void test ( isl::ctx ctx,
bool fnconst T &,
const std::string & name,
const std::vector< unary_prop > & tests )
static

Definition at line 128 of file isl_test2.cc.

References fn, name, obj, res, test, tests, and THROW_INVALID.

◆ test() [2/5]

template<typename R, typename T, typename A1, typename A2>
void test ( isl::ctx ctx,
R fnconst T &, const A1 &, const A2 &,
const std::string & name,
const std::vector< ternary > & tests )
static

Definition at line 233 of file isl_test2.cc.

References fn, name, test_ternary(), and tests.

◆ test() [3/5]

template<typename R, typename T>
void test ( isl::ctx ctx,
R(T::* fn )() const,
const std::string & name,
const std::vector< unary > & tests )
static

Definition at line 152 of file isl_test2.cc.

References expected, fn, is_equal(), name, obj, res, test, tests, and THROW_INVALID.

◆ test() [4/5]

template<typename R, typename T, typename A1>
void test ( isl::ctx ctx,
R(T::* fn )(A1) const,
const std::string & name,
const std::vector< binary > & tests )
static

Definition at line 177 of file isl_test2.cc.

References arg1, expected, fn, is_equal(), name, obj, res, test, tests, and THROW_INVALID.

◆ test() [5/5]

template<typename R, typename T, typename A1, typename A2>
void test ( isl::ctx ctx,
R(T::* fn )(A1, A2) const,
const std::string & name,
const std::vector< ternary > & tests )
static

Definition at line 247 of file isl_test2.cc.

References arg1, arg2, fn, name, test_ternary(), tests, and wrap.

◆ test_conversion()

void test_conversion ( isl::ctx ctx)
static

◆ test_fixed_power()

void test_fixed_power ( isl::ctx ctx)
static

Definition at line 419 of file isl_test2.cc.

References arg, C, and isl::map::fixed_power().

◆ test_gist()

◆ test_id_to_id()

void test_id_to_id ( isl::ctx ctx)
static

Definition at line 892 of file isl_test2.cc.

References arg, C, and isl::id_to_id::set().

◆ test_intersect()

◆ test_lexmin()

void test_lexmin ( isl::ctx ctx)
static

◆ test_preimage()

void test_preimage ( isl::ctx ctx)
static

◆ test_project()

void test_project ( isl::ctx ctx)
static

Definition at line 772 of file isl_test2.cc.

References arg, C, and isl::union_map::project_out_param().

◆ test_reverse()

◆ test_scale()

void test_scale ( isl::ctx ctx)
static

Definition at line 869 of file isl_test2.cc.

References arg, C, isl::pw_multi_aff::scale(), and isl::pw_multi_aff::scale_down().

◆ test_space()

void test_space ( isl::ctx ctx)
static

Definition at line 263 of file isl_test2.cc.

References C, isl::space::domain(), isl::space::params(), and isl::space::range().

Referenced by main().

◆ test_ternary()

template<typename R, typename T, typename A1, typename A2, typename F>
void test_ternary ( isl::ctx ctx,
const F & fn,
const std::string & name,
const std::vector< ternary > & tests )
static

Definition at line 203 of file isl_test2.cc.

References arg1, arg2, expected, fn, is_equal(), name, obj, res, test, tests, and THROW_INVALID.

Referenced by test(), and test().

Variable Documentation

◆ tests

std::vector<std::pair<const char *, void (*)(isl::ctx)> > tests
static
Initial value:
=
{
{ "space", &test_space },
{ "conversion", &test_conversion },
{ "preimage", &test_preimage },
{ "fixed power", &test_fixed_power },
{ "intersect", &test_intersect },
{ "lexmin", &test_lexmin },
{ "gist", &test_gist },
{ "project out parameters", &test_project },
{ "reverse", &test_reverse },
{ "scale", &test_scale },
{ "id-to-id", &test_id_to_id },
}
static void test_preimage(isl::ctx ctx)
Definition isl_test2.cc:347
static void test_id_to_id(isl::ctx ctx)
Definition isl_test2.cc:892
static void test_project(isl::ctx ctx)
Definition isl_test2.cc:772
static void test_scale(isl::ctx ctx)
Definition isl_test2.cc:869
static void test_space(isl::ctx ctx)
Definition isl_test2.cc:263
static void test_fixed_power(isl::ctx ctx)
Definition isl_test2.cc:419
static void test_reverse(isl::ctx ctx)
Definition isl_test2.cc:789
static int test_lexmin(struct isl_ctx *ctx)
Definition isl_test.c:2932
static int test_gist(struct isl_ctx *ctx)
Definition isl_test.c:1839
static int test_conversion(isl_ctx *ctx)
Definition isl_test.c:9224
static int test_intersect(isl_ctx *ctx)
Definition isl_test.c:4241

Definition at line 910 of file isl_test2.cc.