From 383c5e41a33b17d49e7524089eea3b940008bade Mon Sep 17 00:00:00 2001 From: Jaron Kent-Dobias Date: Tue, 4 Apr 2023 12:25:36 +0200 Subject: Changed constructor specialization to use concepts. Formally, the constructor for pSpinModel specialized using a partially evaluated template, a syntax that did not compile in g++. Changed to use a new method from concepts. --- p-spin.hpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'p-spin.hpp') diff --git a/p-spin.hpp b/p-spin.hpp index dee6273..267ab91 100644 --- a/p-spin.hpp +++ b/p-spin.hpp @@ -2,6 +2,7 @@ #include #include +#include #include "types.hpp" #include "tensor.hpp" @@ -36,7 +37,7 @@ private: template std::tuple, Matrix, Tensor> hamGradHessHelper(const Vector& z, const Tensor& J, const Tensor& ...Js) const { auto [Jz, J3] = hamGradTensorHelper(z, J); - + Vector Jzz = Jz * z; Scalar Jzzz = Jzz.transpose() * z; @@ -66,7 +67,7 @@ public: pSpinModel(const std::tuple...>& Js) : Js(Js) {} template - pSpinModel(unsigned N, Generator& r, T... μs) { + pSpinModel(unsigned N, Generator& r, T... μs) requires(std::is_same_v) { Js = std::make_tuple(μs * generateRealPSpinCouplings(N, r)...); } -- cgit v1.2.3-54-g00ecf