Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2015-05-21 13:59:08 +0300
committerCampbell Barton <ideasman42@gmail.com>2015-05-21 14:06:29 +0300
commit6ee653352bbbc8e358969426186b540f98a9aca0 (patch)
tree0f751467cc2f36ffe3b248b76e027ccf22eda588 /source/blender/blenlib/intern/math_vector.c
parent6b40a4bcb1bcd82bf21e0a3473f8aacc11727b24 (diff)
Math Lib: double versions of vector funcs
- add_vn_vn_d - add_vn_vnvn_d - mul_vn_db
Diffstat (limited to 'source/blender/blenlib/intern/math_vector.c')
-rw-r--r--source/blender/blenlib/intern/math_vector.c35
1 files changed, 35 insertions, 0 deletions
diff --git a/source/blender/blenlib/intern/math_vector.c b/source/blender/blenlib/intern/math_vector.c
index 88eccd60352..6da0e87355d 100644
--- a/source/blender/blenlib/intern/math_vector.c
+++ b/source/blender/blenlib/intern/math_vector.c
@@ -1095,3 +1095,38 @@ void copy_vn_fl(float *array_tar, const int size, const float val)
*(tar--) = val;
}
}
+
+/** \name Double precision versions 'db'.
+ * \{ */
+
+void add_vn_vn_d(double *array_tar, const double *array_src, const int size)
+{
+ double *tar = array_tar + (size - 1);
+ const double *src = array_src + (size - 1);
+ int i = size;
+ while (i--) {
+ *(tar--) += *(src--);
+ }
+}
+
+void add_vn_vnvn_d(double *array_tar, const double *array_src_a, const double *array_src_b, const int size)
+{
+ double *tar = array_tar + (size - 1);
+ const double *src_a = array_src_a + (size - 1);
+ const double *src_b = array_src_b + (size - 1);
+ int i = size;
+ while (i--) {
+ *(tar--) = *(src_a--) + *(src_b--);
+ }
+}
+
+void mul_vn_db(double *array_tar, const int size, const double f)
+{
+ double *array_pt = array_tar + (size - 1);
+ int i = size;
+ while (i--) {
+ *(array_pt--) *= f;
+ }
+}
+
+/** \} */