summaryrefslogtreecommitdiff
path: root/src/common.h
diff options
context:
space:
mode:
authorPaweł Redman <pawel.redman@gmail.com>2016-04-02 21:10:03 +0200
committerPaweł Redman <pawel.redman@gmail.com>2016-04-02 21:10:03 +0200
commitf1e955e7e9719aa82d1b32dac2bce62f26f75df7 (patch)
treeeee5d1cd4a68c9cb065384bbd3f5584bd4445bd5 /src/common.h
parente40ab41ae226e257d57a73c69d9bdd8d19f64cb5 (diff)
Auxiliary fields (WIP).
Diffstat (limited to 'src/common.h')
-rw-r--r--src/common.h28
1 files changed, 28 insertions, 0 deletions
diff --git a/src/common.h b/src/common.h
index 8933749..743dea4 100644
--- a/src/common.h
+++ b/src/common.h
@@ -85,6 +85,34 @@ static inline void v2_mul(vec_t *R, vec_t *A, vec_t b)
R[1] = A[1] * b;
}
+static inline void v3_add(vec_t *R, vec_t *A, vec_t *B)
+{
+ R[0] = A[0] + B[0];
+ R[1] = A[1] + B[1];
+ R[2] = A[2] + B[2];
+}
+
+static inline void v3_acc(vec_t *R, vec_t *A)
+{
+ R[0] += A[0];
+ R[1] += A[1];
+ R[2] += A[2];
+}
+
+static inline void v3_sub(vec_t *R, vec_t *A, vec_t *B)
+{
+ R[0] = A[0] - B[0];
+ R[1] = A[1] - B[1];
+ R[2] = A[2] - B[2];
+}
+
+static inline void v3_mul(vec_t *R, vec_t *A, vec_t b)
+{
+ R[0] = A[0] * b;
+ R[1] = A[1] * b;
+ R[2] = A[2] * b;
+}
+
static inline void mst2_set_identity(mst2_t R)
{
R[0] = 0;