Jackalope / jmath (public) (License: GPLv3 or later) (since 2018-10-11) (hash sha1)
C++ conxstexpr template Math library with:
- multidimensional vectors and matrices
- geometry primitives with projection, distance and intersection functions
- coordinate systems conversions
- some routines

Depends on GCE-math C++ library as git submodule.

Used with clang (version 9 or 10) and gcc (version 9).
Written with C++17.
List of commits:
Subject Hash Author Date (UTC)
new functions 46561c6e97aa1ba2d0c41a19ba1977b0427b5f4b Your Name 2019-05-07 05:42:45
new functions 61e3c490daf394f07a4b9de2640d9e1b42fc2dd1 Your Name 2019-05-05 11:28:57
pragma removed 5843f3d68f0d3c08d5be7d16ef8c05db5bceda89 jp.larry 2019-05-01 12:31:57
uint replaced with unsigned int bbde30ca5f66601143ed8862aded9da0cd3aadf8 Your Name 2019-04-30 23:30:19
New enums for vector subscription (X, Y, Z, W, U, V indices) 760dc000f5349f72f8c73330801d1986c46dbb49 jp.larry 2019-04-29 10:43:53
new vector function 570b1dab1163d43426d70048a7ed51162127774e jp.larry 2019-04-26 04:45:13
new functions all vector summ, all vector equal to value ... a47df1be3233abb5e6e2f479b24725bb474cc483 jp.larry 2019-04-25 04:04:26
vector abs 85a414da1c952aa9ec9e2c9e4c8a938becb7a24d jp.larry 2019-04-20 14:11:03
gcem added as module 8a7946d3c3de780c6cee1bba325bb9e4b9490e42 Your Name 2019-03-18 22:05:51
new vector types b338913aa1d93eeda0b771e27dd0572353d17139 jp.larry 2019-02-26 03:33:58
inlines and new functions 1a2b86f33d8a0b1ec7db4edc138b8058fd6935b3 jp.larry 2019-02-23 18:24:38
type cast for warning remove a401d65e4ba7f4edbb9f193397017a0ddabd55cd jp.larry 2019-01-18 23:09:44
comparison operator issue solved, added begin & end functions for vector 56bc2502562e613fee6be95a889ee98197f253a2 jp.larry 2019-01-06 08:58:32
reduced pi number precision from 100500 numbers after dots to 100498 278d8e24bcabb0d55f3414915b348db601c30092 jp.larry 2019-01-06 02:34:07
nothing ba652a4c8dfd731fcc7bad57bba65ec3cb77716b jp.larry 2018-11-01 03:54:11
added is_power_of_2 for integers adf0dcb3a3ed02c441e6712f1a031ab05788045b jp.larry 2018-10-29 00:47:48
Initial commit f36f18cb8677587102be1f4f04027a04a94624b3 jp.larry 2018-10-11 19:06:27
Commit 46561c6e97aa1ba2d0c41a19ba1977b0427b5f4b - new functions
Author: Your Name
Author date (UTC): 2019-05-07 05:42
Committer name: Your Name
Committer date (UTC): 2019-05-07 05:42
Parent(s): 61e3c490daf394f07a4b9de2640d9e1b42fc2dd1
Signer:
Signing key:
Signing status: N
Tree: a217647d4995a0964753e2c3dc425d33db6cf779
File Lines added Lines deleted
vector/base.h 5 3
vector/base.hpp 23 16
File vector/base.h changed (mode: 100755) (index 10d5eef..8d05c8e)
... ... namespace math
89 89 constexpr inline bool all_greater (const vector &other) const; constexpr inline bool all_greater (const vector &other) const;
90 90 constexpr inline bool all_less (const vector &other) const; constexpr inline bool all_less (const vector &other) const;
91 91
92 constexpr inline bool all_equal (const type &value) const;
93 constexpr inline bool all_greater (const type &value) const;
94 constexpr inline bool all_less_equal(const type &value) const;
92 constexpr inline bool all_less_equal (const type &value) const;
93 constexpr inline bool all_greater_equal(const type &value) const;
94 constexpr inline bool all_equal (const type &value) const;
95 constexpr inline bool all_greater (const type &value) const;
96 constexpr inline bool all_less (const type &value) const;
95 97
96 98 constexpr inline type all_scale() const; constexpr inline type all_scale() const;
97 99 constexpr inline type all_summ() const; constexpr inline type all_summ() const;
File vector/base.hpp changed (mode: 100755) (index 786dac1..ee156ac)
... ... namespace math
174 174 return true; return true;
175 175 } }
176 176
177 template<typename FOO_2values_cmp, unsigned int size, typename type>
178 inline bool compare_vector (FOO_2values_cmp cmp, const VECTOR &l, const type &r)
179 {
180 for (unsigned int i = 0; i < size; ++i)
181 if (not cmp(l[i], r))
182 return false;
183 return true;
184 }
185
177 186 T_IMPL bool VECTOR::all_less_equal(const vector &other) const T_IMPL bool VECTOR::all_less_equal(const vector &other) const
178 187 { {
179 188 return compare_vectors([](const type &l, const type &r) { return l <= r; }, *this, other); return compare_vectors([](const type &l, const type &r) { return l <= r; }, *this, other);
 
... ... namespace math
196 205 return compare_vectors([](const type &l, const type &r) { return l < r; }, *this, other); return compare_vectors([](const type &l, const type &r) { return l < r; }, *this, other);
197 206 } }
198 207
199 T_IMPL bool VECTOR::all_equal(const type &value) const
208 T_IMPL bool VECTOR::all_less_equal(const type &value) const
200 209 { {
201 for (unsigned int i = 0; i < size; ++i)
202 if ((*this)[i] != value)
203 return false;
204 return true;
210 return compare_vector([](const type &l, const type &r) { return l <= r; }, *this, value);
205 211 } }
206 212
207
213 T_IMPL bool VECTOR::all_greater_equal(const type &value) const
214 {
215 return compare_vector([](const type &l, const type &r) { return l >= r; }, *this, value);
216 }
217 T_IMPL bool VECTOR::all_equal(const type &value) const
218 {
219 return compare_vector([](const type &l, const type &r) { return l == r; }, *this, value);
220 }
208 221 T_IMPL bool VECTOR::all_greater(const type &value) const T_IMPL bool VECTOR::all_greater(const type &value) const
209 222 { {
210 for (unsigned int i = 0; i < size; ++i)
211 if ((*this)[i] <= value)
212 return false;
213 return true;
223 return compare_vector([](const type &l, const type &r) { return l > r; }, *this, value);
214 224 } }
215
216 T_IMPL bool VECTOR::all_less_equal(const type &value) const
225 T_IMPL bool VECTOR::all_less(const type &value) const
217 226 { {
218 for (unsigned int i = 0; i < size; ++i)
219 if ((*this)[i] > value)
220 return false;
221 return true;
227 return compare_vector([](const type &l, const type &r) { return l < r; }, *this, value);
222 228 } }
223 229
224 230
231
225 232 T_IMPL type VECTOR::all_scale() const T_IMPL type VECTOR::all_scale() const
226 233 { {
227 234 type r = (*this)[0]; type r = (*this)[0];
Hints:
Before first commit, do not forget to setup your git environment:
git config --global user.name "your_name_here"
git config --global user.email "your@email_here"

Clone this repository using HTTP(S):
git clone https://rocketgit.com/user/Jackalope/jmath

Clone this repository using ssh (do not forget to upload a key first):
git clone ssh://rocketgit@ssh.rocketgit.com/user/Jackalope/jmath

Clone this repository using git:
git clone git://git.rocketgit.com/user/Jackalope/jmath

You are allowed to anonymously push to this repository.
This means that your pushed commits will automatically be transformed into a merge request:
... clone the repository ...
... make some changes and some commits ...
git push origin main