Templatize Input
This commit is contained in:
parent
75ecd53e18
commit
f8dd6b3f31
20
atrip.org
20
atrip.org
@ -1964,8 +1964,9 @@ namespace atrip {
|
||||
static int np;
|
||||
static void init();
|
||||
|
||||
template <typename F=double>
|
||||
struct Input {
|
||||
CTF::Tensor<double> *ei = nullptr
|
||||
CTF::Tensor<F> *ei = nullptr
|
||||
, *ea = nullptr
|
||||
, *Tph = nullptr
|
||||
, *Tpphh = nullptr
|
||||
@ -1976,13 +1977,13 @@ namespace atrip {
|
||||
int maxIterations = 0, iterationMod = -1, percentageMod = -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; }
|
||||
Input& with_Tabij(CTF::Tensor<double> * t) { Tpphh = t; return *this; }
|
||||
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_epsilon_i(CTF::Tensor<F> * t) { ei = t; return *this; }
|
||||
Input& with_epsilon_a(CTF::Tensor<F> * t) { ea = t; return *this; }
|
||||
Input& with_Tai(CTF::Tensor<F> * t) { Tph = t; return *this; }
|
||||
Input& with_Tabij(CTF::Tensor<F> * t) { Tpphh = t; return *this; }
|
||||
Input& with_Vabij(CTF::Tensor<F> * t) { Vpphh = t; return *this; }
|
||||
Input& with_Vijka(CTF::Tensor<F> * t) { Vhhhp = t; return *this; }
|
||||
Input& with_Vabci(CTF::Tensor<F> * 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_percentageMod(int i) { percentageMod = i; return *this; }
|
||||
@ -1993,7 +1994,8 @@ namespace atrip {
|
||||
struct Output {
|
||||
double energy;
|
||||
};
|
||||
static Output run(Input const& in);
|
||||
template <typename F=double>
|
||||
static Output run(Input<F> const& in);
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user