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 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 61e3c490daf394f07a4b9de2640d9e1b42fc2dd1 - new functions
Author: Your Name
Author date (UTC): 2019-05-05 11:28
Committer name: Your Name
Committer date (UTC): 2019-05-05 11:28
Parent(s): ad7cf72e9b0c944d9e3b0ec12a615dfc29c6b6b7
Signing key:
Tree: 5d6fd6b6001830f112ac8c59a31958bc00f66e23
File Lines added Lines deleted
vector/base.h 5 1
vector/base.hpp 25 2
File vector/base.h changed (mode: 100755) (index 2582e96..10d5eef)
... ... namespace math
83 83
84 84 //constexpr inline matrix<size, size, type> operator * (const matrix<size, size, type>&) const; //constexpr inline matrix<size, size, type> operator * (const matrix<size, size, type>&) const;
85 85
86 constexpr inline bool all_less_equal(const vector &other) const;
86 constexpr inline bool all_less_equal (const vector &other) const;
87 constexpr inline bool all_greater_equal(const vector &other) const;
88 constexpr inline bool all_equal (const vector &other) const;
89 constexpr inline bool all_greater (const vector &other) const;
90 constexpr inline bool all_less (const vector &other) const;
87 91
88 92 constexpr inline bool all_equal (const type &value) const; constexpr inline bool all_equal (const type &value) const;
89 93 constexpr inline bool all_greater (const type &value) const; constexpr inline bool all_greater (const type &value) const;
File vector/base.hpp changed (mode: 100755) (index cc2ea2d..786dac1)
... ... namespace math
165 165 } }
166 166 */ */
167 167
168 T_IMPL bool VECTOR::all_less_equal(const vector &other) const
168 template<typename FOO_2values_cmp, unsigned int size, typename type>
169 inline bool compare_vectors (FOO_2values_cmp cmp, const VECTOR &l, const VECTOR &r)
169 170 { {
170 171 for (unsigned int i = 0; i < size; ++i) for (unsigned int i = 0; i < size; ++i)
171 if ((*this)[i] > other[i])
172 if (not cmp(l[i], r[i]))
172 173 return false; return false;
173 174 return true; return true;
174 175 } }
175 176
177 T_IMPL bool VECTOR::all_less_equal(const vector &other) const
178 {
179 return compare_vectors([](const type &l, const type &r) { return l <= r; }, *this, other);
180 }
181
182 T_IMPL bool VECTOR::all_greater_equal(const vector &other) const
183 {
184 return compare_vectors([](const type &l, const type &r) { return l >= r; }, *this, other);
185 }
186 T_IMPL bool VECTOR::all_equal(const vector &other) const
187 {
188 return compare_vectors([](const type &l, const type &r) { return l == r; }, *this, other);
189 }
190 T_IMPL bool VECTOR::all_greater(const vector &other) const
191 {
192 return compare_vectors([](const type &l, const type &r) { return l > r; }, *this, other);
193 }
194 T_IMPL bool VECTOR::all_less(const vector &other) const
195 {
196 return compare_vectors([](const type &l, const type &r) { return l < r; }, *this, other);
197 }
198
176 199 T_IMPL bool VECTOR::all_equal(const type &value) const T_IMPL bool VECTOR::all_equal(const type &value) const
177 200 { {
178 201 for (unsigned int i = 0; i < size; ++i) for (unsigned int i = 0; i < size; ++i)
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