diff --git a/atrip.org b/atrip.org index 227dfaf..a529b48 100644 --- a/atrip.org +++ b/atrip.org @@ -2686,6 +2686,13 @@ namespace atrip { #include +#define ADD_ATTRIBUTE(_type, _name, _default) \ + _type _name = _default; \ + Input& with_ ## _name(_type i) { \ + _name = i; \ + return *this; \ + } + namespace atrip { struct Atrip { @@ -2703,9 +2710,6 @@ namespace atrip { , *Vhhhp = nullptr , *Vppph = nullptr ; - int maxIterations = 0, iterationMod = -1; - bool barrier = false; - bool chrono = false; Input& with_epsilon_i(CTF::Tensor * t) { ei = t; return *this; } Input& with_epsilon_a(CTF::Tensor * t) { ea = t; return *this; } Input& with_Tai(CTF::Tensor * t) { Tph = t; return *this; } @@ -2713,10 +2717,19 @@ namespace atrip { Input& with_Vabij(CTF::Tensor * t) { Vpphh = t; return *this; } Input& with_Vijka(CTF::Tensor * t) { Vhhhp = t; return *this; } Input& with_Vabci(CTF::Tensor * t) { Vppph = t; return *this; } - Input& with_maxIterations(int i) { maxIterations = i; return *this; } - Input& with_iterationMod(int i) { iterationMod = i; return *this; } - Input& with_barrier(bool i) { barrier = i; return *this; } - Input& with_chrono(bool i) { chrono = i; return *this; } + + enum TuplesDistribution { + NAIVE, + GROUP_AND_SORT, + }; + + ADD_ATTRIBUTE(bool, chrono, false) + ADD_ATTRIBUTE(bool, barrier, false) + ADD_ATTRIBUTE(int, maxIterations, 0) + ADD_ATTRIBUTE(int, iterationMod, -1) + ADD_ATTRIBUTE(TuplesDistribution, tuplesDistribution, NAIVE) + + }; struct Output { @@ -2726,6 +2739,8 @@ namespace atrip { }; } + +#undef ADD_ATTRIBUTE #+end_src *** Main