10 #ifndef EIGEN_CXX11_TENSORSYMMETRY_TEMPLATEGROUPTHEORY_H
11 #define EIGEN_CXX11_TENSORSYMMETRY_TEMPLATEGROUPTHEORY_H
13 #include "../InternalHeaderCheck.h"
19 namespace group_theory {
121 template<
template<
typename,
typename>
class Equality,
typename id,
typename L>
struct strip_identities;
124 template<
typename,
typename>
class Equality,
129 struct strip_identities<Equality, id, type_list<t, ts...>>
131 typedef std::conditional_t<
132 Equality<id, t>::value,
133 typename strip_identities<Equality, id, type_list<ts...>>::type,
134 typename concat<type_list<t>,
typename strip_identities<Equality, id, type_list<ts...>>::type>::type
136 constexpr
static int global_flags = Equality<id, t>::global_flags | strip_identities<Equality, id, type_list<ts...>>::global_flags;
140 template<
typename,
typename>
class Equality,
146 typedef type_list<> type;
147 constexpr
static int global_flags = 0;
164 template<
typename,
typename>
class Multiply,
165 template<
typename,
typename>
class Equality,
168 typename current_element,
170 bool dont_add_current_element
172 struct dimino_first_step_elements_helper
173 #ifndef EIGEN_PARSED_BY_DOXYGEN
175 public dimino_first_step_elements_helper<
180 typename Multiply<current_element, g>::type,
181 typename concat<elements, type_list<current_element>>::type,
182 Equality<typename Multiply<current_element, g>::type, id>::value
186 template<
typename,
typename>
class Multiply,
187 template<
typename,
typename>
class Equality,
190 typename current_element,
193 struct dimino_first_step_elements_helper<Multiply, Equality, id, g, current_element, elements, true>
196 typedef elements type;
197 constexpr
static int global_flags = Equality<current_element, id>::global_flags;
214 template<
typename,
typename>
class Multiply,
215 template<
typename,
typename>
class Equality,
219 struct dimino_first_step_elements
221 typedef typename get<0, generators>::type first_generator;
222 typedef typename skip<1, generators>::type next_generators;
223 typedef type_list<first_generator> generators_done;
225 typedef dimino_first_step_elements_helper<
234 typedef typename helper::type type;
235 constexpr
static int global_flags = helper::global_flags;
259 template<
typename,
typename>
class Multiply,
260 typename sub_group_elements,
261 typename new_coset_rep,
264 struct dimino_get_coset_elements
266 typedef typename apply_op_from_right<Multiply, new_coset_rep, sub_group_elements>::type type;
270 template<
typename,
typename>
class Multiply,
271 typename sub_group_elements,
272 typename new_coset_rep
274 struct dimino_get_coset_elements<Multiply, sub_group_elements, new_coset_rep, false>
276 typedef type_list<> type;
294 template<
typename,
typename>
class Multiply,
295 template<
typename,
typename>
class Equality,
297 typename sub_group_elements,
300 typename rep_element,
303 struct dimino_add_cosets_for_rep;
306 template<
typename,
typename>
class Multiply,
307 template<
typename,
typename>
class Equality,
309 typename sub_group_elements,
313 typename rep_element,
316 struct dimino_add_cosets_for_rep<Multiply, Equality, id, sub_group_elements, elements, type_list<g, gs...>, rep_element, sub_group_size>
318 typedef typename Multiply<rep_element, g>::type new_coset_rep;
319 typedef contained_in_list_gf<Equality, new_coset_rep, elements> _cil;
320 constexpr
static bool add_coset = !_cil::value;
322 typedef typename dimino_get_coset_elements<
327 >::type coset_elements;
329 typedef dimino_add_cosets_for_rep<
334 typename concat<elements, coset_elements>::type,
340 typedef typename _helper::type type;
341 constexpr
static int global_flags = _cil::global_flags | _helper::global_flags;
352 template<
typename,
typename>
class Multiply,
353 template<
typename,
typename>
class Equality,
355 typename sub_group_elements,
358 typename rep_element,
361 struct dimino_add_cosets_for_rep<Multiply, Equality, id, sub_group_elements, elements, type_list<
EIGEN_TPL_PP_SPEC_HACK_USE(empty)>, rep_element, sub_group_size>
363 typedef elements type;
364 constexpr
static int global_flags = 0;
382 template<
typename,
typename>
class Multiply,
383 template<
typename,
typename>
class Equality,
385 typename sub_group_elements,
392 struct dimino_add_all_coset_spaces
394 typedef typename get<rep_pos, elements>::type rep_element;
395 typedef dimino_add_cosets_for_rep<
403 sub_group_elements::count
405 typedef typename _ac4r::type new_elements;
407 constexpr
static int new_rep_pos = rep_pos + sub_group_elements::count;
408 constexpr
static bool new_stop_condition = new_rep_pos >= new_elements::count;
410 typedef dimino_add_all_coset_spaces<
422 typedef typename _helper::type type;
423 constexpr
static int global_flags = _helper::global_flags | _ac4r::global_flags;
427 template<
typename,
typename>
class Multiply,
428 template<
typename,
typename>
class Equality,
430 typename sub_group_elements,
436 struct dimino_add_all_coset_spaces<Multiply, Equality, id, sub_group_elements, elements, generators, sub_group_size, rep_pos, true>
438 typedef elements type;
439 constexpr
static int global_flags = 0;
455 template<
typename,
typename>
class Multiply,
456 template<
typename,
typename>
class Equality,
459 typename generators_done,
460 typename current_generator,
463 struct dimino_add_generator
469 typedef typename apply_op_from_right<Multiply, current_generator, elements>::type multiplied_elements;
470 typedef typename concat<elements, multiplied_elements>::type new_elements;
472 constexpr
static int rep_pos = elements::count;
474 typedef dimino_add_all_coset_spaces<
480 typename concat<generators_done, type_list<current_generator>>::type,
485 typedef typename _helper::type type;
486 constexpr
static int global_flags = _helper::global_flags;
490 template<
typename,
typename>
class Multiply,
491 template<
typename,
typename>
class Equality,
494 typename generators_done,
495 typename current_generator
497 struct dimino_add_generator<Multiply, Equality, id, elements, generators_done, current_generator, true>
500 typedef elements type;
501 constexpr
static int global_flags = 0;
517 template<
typename,
typename>
class Multiply,
518 template<
typename,
typename>
class Equality,
520 typename generators_done,
521 typename remaining_generators,
524 struct dimino_add_remaining_generators
526 typedef typename get<0, remaining_generators>::type first_generator;
527 typedef typename skip<1, remaining_generators>::type next_generators;
529 typedef contained_in_list_gf<Equality, first_generator, elements> _cil;
531 typedef dimino_add_generator<
541 typedef typename _helper::type new_elements;
543 typedef dimino_add_remaining_generators<
547 typename concat<generators_done, type_list<first_generator>>::type,
552 typedef typename _next_iter::type type;
553 constexpr
static int global_flags =
555 _helper::global_flags |
556 _next_iter::global_flags;
560 template<
typename,
typename>
class Multiply,
561 template<
typename,
typename>
class Equality,
563 typename generators_done,
566 struct dimino_add_remaining_generators<Multiply, Equality, id, generators_done, type_list<>, elements>
568 typedef elements type;
569 constexpr
static int global_flags = 0;
587 template<
typename,
typename>
class Multiply,
588 template<
typename,
typename>
class Equality,
591 int initial_global_flags = 0
593 struct enumerate_group_elements_noid
595 typedef dimino_first_step_elements<Multiply, Equality, id, generators> first_step;
596 typedef typename first_step::type first_step_elements;
598 typedef dimino_add_remaining_generators<
602 typename first_step::generators_done,
603 typename first_step::next_generators,
604 typename first_step::type
607 typedef typename _helper::type type;
608 constexpr
static int global_flags =
609 initial_global_flags |
610 first_step::global_flags |
611 _helper::global_flags;
616 template<
typename,
typename>
class Multiply,
617 template<
typename,
typename>
class Equality,
619 int initial_global_flags
621 struct enumerate_group_elements_noid<Multiply, Equality, id, type_list<>, initial_global_flags>
623 typedef type_list<id> type;
624 constexpr
static int global_flags = initial_global_flags;
645 template<
typename,
typename>
class Multiply,
646 template<
typename,
typename>
class Equality,
650 struct enumerate_group_elements
651 :
public enumerate_group_elements_noid<
655 typename strip_identities<Equality, id, Generators_>::type,
656 strip_identities<Equality, id, Generators_>::global_flags
#define EIGEN_TPL_PP_SPEC_HACK_USE(n)
#define EIGEN_TPL_PP_SPEC_HACK_DEFC(mt, n)
: TensorContractionSycl.h, provides various tensor contraction kernel for SYCL backend