From f8dd6b3f3179175c847b53c81d8d8702d4abc590 Mon Sep 17 00:00:00 2001 From: Alejandro Gallo Date: Thu, 27 Jan 2022 20:46:23 +0100 Subject: [PATCH] Templatize Input --- atrip.org | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/atrip.org b/atrip.org index 2c14694..a3aa110 100644 --- a/atrip.org +++ b/atrip.org @@ -1964,8 +1964,9 @@ namespace atrip { static int np; static void init(); + template struct Input { - CTF::Tensor *ei = nullptr + CTF::Tensor *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 * 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; } - Input& with_Tabij(CTF::Tensor * t) { Tpphh = t; return *this; } - 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_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; } + Input& with_Tabij(CTF::Tensor * t) { Tpphh = t; return *this; } + 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_percentageMod(int i) { percentageMod = i; return *this; } @@ -1993,7 +1994,8 @@ namespace atrip { struct Output { double energy; }; - static Output run(Input const& in); + template + static Output run(Input const& in); }; }