diff options
author | Erik Schnetter <schnetter@gmail.com> | 2013-07-07 15:55:45 -0400 |
---|---|---|
committer | Erik Schnetter <schnetter@gmail.com> | 2013-07-07 15:55:45 -0400 |
commit | 308259ef14ea04b6888d372b2dbe65d48760b7a9 (patch) | |
tree | 07e45b0aee39af37ba8e90404ceb1c387ead1196 /vec_sse_float1.h | |
parent | a505a64345a0d43e212bba31694f48790a5eac2f (diff) | |
download | vecmathlib-308259ef14ea04b6888d372b2dbe65d48760b7a9.zip vecmathlib-308259ef14ea04b6888d372b2dbe65d48760b7a9.tar.gz |
Implement ifthen with boolvec arguments
Diffstat (limited to 'vec_sse_float1.h')
-rw-r--r-- | vec_sse_float1.h | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/vec_sse_float1.h b/vec_sse_float1.h index 6c82e02..675f18a 100644 --- a/vec_sse_float1.h +++ b/vec_sse_float1.h @@ -100,6 +100,7 @@ namespace vecmathlib { // ifthen(condition, then-value, else-value) + boolvec_t ifthen(boolvec_t x, boolvec_t y) const; intvec_t ifthen(intvec_t x, intvec_t y) const; // defined after intvec realvec_t ifthen(realvec_t x, realvec_t y) const; // defined after realvec }; @@ -518,15 +519,18 @@ namespace vecmathlib { } inline - boolvec<float,1>::intvec_t boolvec<float,1>::ifthen(intvec_t x, intvec_t y) - const + boolvec<float,1> boolvec<float,1>::ifthen(boolvec_t x, boolvec_t y) const + { + return v ? x : y; + } + + inline intvec<float,1> boolvec<float,1>::ifthen(intvec_t x, intvec_t y) const { return v ? x : y; } inline - boolvec<float,1>::realvec_t boolvec<float,1>::ifthen(realvec_t x, realvec_t y) - const + realvec<float,1> boolvec<float,1>::ifthen(realvec_t x, realvec_t y) const { return v ? x : y; } |