9#include <kernel/shape.hpp> 
   25      template<
typename Shape_>
 
   27      class CongruencySampler;
 
   29      class CongruencySampler
 
   47        static int compare(
const Source_& src, 
const Target_& trg);
 
   58        static int orientation(
int orientation_code);
 
   73      class CongruencySampler< Shape::Simplex<1> >
 
   79        static int compare(
const Source_& src, 
const Target_& trg)
 
   81          return compare_with(src, trg, [](
const auto& a, 
const auto& b) { 
return a == b; });
 
   88        static int compare_with(
const Source_& src, 
const Target_& trg, 
const Comparator_& comp)
 
   95          else if(comp(sv0, trg[1]))
 
  103        static int orientation(
int orientation_code)
 
  105          if(orientation_code == 0)
 
  107          if(orientation_code == 1)
 
  133      class CongruencySampler< Shape::Simplex<2> >
 
  139        static int compare(
const Source_& src, 
const Target_& trg)
 
  141          return compare_with(src, trg, [](
const auto& a, 
const auto& b) { 
return a == b; });
 
  147          typename Comparator_>
 
  148        static int compare_with(
const Source_& src, 
const Target_& trg, 
const Comparator_& comp)
 
  152          if(comp(sv0, trg[0]))
 
  154            if(comp(sv1, trg[1]))
 
  158            else if(comp(sv1, trg[2]))
 
  163          else if(comp(sv0, trg[1]))
 
  165            if(comp(sv1, trg[2]))
 
  169            else if(comp(sv1, trg[0]))
 
  174          else if(comp(sv0, trg[2]))
 
  176            if(comp(sv1, trg[0]))
 
  180            else if(comp(sv1, trg[1]))
 
  189        static int orientation(
int orientation_code)
 
  191          if(orientation_code == -1)
 
  193          if(orientation_code < 3)
 
  211      class CongruencySampler< Shape::Hypercube<1> >
 
  217        static int compare(
const Source_& src, 
const Target_& trg)
 
  219          return compare_with(src, trg, [](
const auto& a, 
const auto& b) { 
return a == b; });
 
  225          typename Comparator_>
 
  226        static int compare_with(
const Source_& src, 
const Target_& trg, 
const Comparator_& comp)
 
  229          if(comp(sv0, trg[0]))
 
  233          else if(comp(sv0, trg[1]))
 
  241        static int orientation(
int orientation_code)
 
  243          if(orientation_code == 0)
 
  245          if(orientation_code == 1)
 
  269      class CongruencySampler< Shape::Hypercube<2> >
 
  275        static int compare(
const Source_& src, 
const Target_& trg)
 
  277          return compare_with(src, trg, [](
const auto& a, 
const auto& b) { 
return a == b; });
 
  283          typename Comparator_>
 
  284        static int compare_with(
const Source_& src, 
const Target_& trg, 
const Comparator_& comp)
 
  288          if(comp(sv0, trg[0]))
 
  290            if(comp(sv1, trg[1]))
 
  294            else if(comp(sv1, trg[2]))
 
  299          else if(comp(sv0, trg[1]))
 
  301            if(comp(sv1, trg[3]))
 
  305            else if(comp(sv1, trg[0]))
 
  310          else if(comp(sv0, trg[2]))
 
  312            if(comp(sv1, trg[0]))
 
  316            else if(comp(sv1, trg[3]))
 
  321          else if(comp(sv0, trg[3]))
 
  323            if(comp(sv1, trg[2]))
 
  327            else if(comp(sv1, trg[1]))
 
  336        static int orientation(
int orientation_code)
 
  338          if(orientation_code == -1)
 
  340          if(orientation_code < 4)