From 3353e506b494de466170eba1eb0df2a540390f69 Mon Sep 17 00:00:00 2001 From: aardappel Date: Sat, 3 Nov 2018 13:27:37 -0700 Subject: [PATCH] geom.h improvements --- dev/src/lobster/geom.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/dev/src/lobster/geom.h b/dev/src/lobster/geom.h index 5aca07048..84277016b 100644 --- a/dev/src/lobster/geom.h +++ b/dev/src/lobster/geom.h @@ -111,6 +111,7 @@ template struct vec : basevec { vec operator-(const vec &v) const { DOVECR(c[i] - v[i]); } vec operator*(const vec &v) const { DOVECR(c[i] * v[i]); } vec operator/(const vec &v) const { DOVECR(c[i] / v[i]); } + vec operator%(const vec &v) const { DOVECR(c[i] % v[i]); } vec operator+(T e) const { DOVECR(c[i] + e); } vec operator-(T e) const { DOVECR(c[i] - e); } @@ -281,6 +282,10 @@ template inline vec rndunitvec(RandomNu template inline vec rndsignedvec(RandomNumberGenerator &r) { DOVECR(r.rndfloatsigned()); } +template inline vec rndivec(RandomNumberGenerator &r, + const vec &max) { + DOVECR(r(max[i])); +} #undef DOVEC #undef DOVECR