Skip to content

Commit

Permalink
geom.h improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
aardappel committed Nov 3, 2018
1 parent 105018b commit 3353e50
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions dev/src/lobster/geom.h
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ template<typename T, int N> struct vec : basevec<T, N> {
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); }
Expand Down Expand Up @@ -281,6 +282,10 @@ template<typename T, int N, typename R> inline vec<float, N> rndunitvec(RandomNu
template<typename T, int N, typename R> inline vec<float, N> rndsignedvec(RandomNumberGenerator<R> &r) {
DOVECR(r.rndfloatsigned());
}
template<typename T, int N, typename R> inline vec<int, N> rndivec(RandomNumberGenerator<R> &r,
const vec<int, N> &max) {
DOVECR(r(max[i]));
}

#undef DOVEC
#undef DOVECR
Expand Down

0 comments on commit 3353e50

Please sign in to comment.