Add ADD_ATTRIBUTE macro to atrip
This commit is contained in:
parent
f514b70b4e
commit
2bcffb96f2
29
atrip.org
29
atrip.org
@ -2686,6 +2686,13 @@ namespace atrip {
|
||||
|
||||
#include <ctf.hpp>
|
||||
|
||||
#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<double> * t) { ei = t; return *this; }
|
||||
Input& with_epsilon_a(CTF::Tensor<double> * t) { ea = t; return *this; }
|
||||
Input& with_Tai(CTF::Tensor<double> * t) { Tph = t; return *this; }
|
||||
@ -2713,10 +2717,19 @@ namespace atrip {
|
||||
Input& with_Vabij(CTF::Tensor<double> * t) { Vpphh = t; return *this; }
|
||||
Input& with_Vijka(CTF::Tensor<double> * t) { Vhhhp = t; return *this; }
|
||||
Input& with_Vabci(CTF::Tensor<double> * 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
|
||||
|
||||
Loading…
Reference in New Issue
Block a user