Vladimír Vondruš
7328fa9ab4
Math: remove obsolete comments in a test -- this is a static assert now.
4 years ago
Vladimír Vondruš
ed9deff432
Test: adapt to a less shitty CORRADE_COMPARE().
5 years ago
Vladimír Vondruš
3d136503d8
Updated copyright year.
5 years ago
Vladimír Vondruš
e6322dcfd1
Math: use angle literals in all test code.
...
It was originally done using the Deg() / Rad() constructors in order to
be compatible with GCC 4.6, but fortunately those days are long gone.
Co-authored-by: Squareys <squareys@googlemail.com>
6 years ago
Vladimír Vondruš
9de4717f0e
Math: add popcount().
6 years ago
Vladimír Vondruš
89e3067009
Math: hmm, why this isn't in the FunctionsBenchmark, then?
...
Probably because it predates it.
6 years ago
Vladimír Vondruš
f225497475
Math: assert valid binomialCoefficient() input instead of returning 0.
6 years ago
Vladimír Vondruš
53a26ad024
Math: use 64-bit literals in a test to be really really sure.
6 years ago
Vladimír Vondruš
f1c713f4c8
Minor cleanup, doc++, updated changelog & credits.
6 years ago
janos
8013afc28c
Math: add binomial coefficient function.
6 years ago
Pablo Escobar
daa6d9125e
Math: add fmod function
6 years ago
Vladimír Vondruš
19e0e96d74
Updated copyright year.
6 years ago
Vladimír Vondruš
65a2ced2a7
Make this compile and test cleanly with CORRADE_NO_ASSERT defined.
6 years ago
Vladimír Vondruš
881003d90b
Test: adapt tests to change in TestSuite float epsilon precisions.
6 years ago
Nghia Truong
1ef813fdad
Math: add reflect() and refract() functions.
...
Co-authored-by: Vladimír Vondruš <mosra@centrum.cz>
6 years ago
Vladimír Vondruš
13b4bf8461
Math: use __builtin_sincos for sincos() on GCC.
...
Makes this thing faster on Debug. But I'm not sure whether it's due to
less function calls or this intrinsic being actually faster, heh.
Probably a combination of both.
7 years ago
Vladimír Vondruš
28f12f9a5e
Math: improve the NaN propagation tests even more.
7 years ago
Vladimír Vondruš
75ffd39fe0
Math: make it possible to use Deg/Rad in all functions.
...
This should have been here ages ago, haha.
7 years ago
Vladimír Vondruš
3a1713d549
Math: no need to include <tuple> just for std::tie() in tests.
...
Unpack the pairs manually instead.
7 years ago
Vladimír Vondruš
c12680ec38
Math: move batch functionality to FunctionsBatch.h.
...
Avoids including a (relatively) large ArrayView in Functions.h. Yes,
we are now at a point where 500 lines matter.
7 years ago
Vladimír Vondruš
2149f7b869
Wrap all tests in unnamed namespaces.
...
This makes the compiler warn about test cases that aren't ever used,
which is a good thing.
7 years ago
Vladimír Vondruš
e6b7aa12fa
Updated copyright year.
7 years ago
Vladimír Vondruš
ebedbce2f2
Math: vector overloads for isInf() and isNan().
8 years ago
Vladimír Vondruš
7a0bf3018f
Math: new min(), max() and minmax() overloads taking plain C arrays.
8 years ago
Vladimír Vondruš
da7d443b67
Math: added lerp(T, T, bool).
...
Last missing piece for fully orthogonal functionality. There was a
lerp(T, T, BoolVector) before, but not a scalar version. This also makes
scalar interpolation phase in select() working with arbitrary types.
8 years ago
Vladimír Vondruš
002d2260fd
Math: added select().
...
For animations I need a constant interpolator with the same API as
lerp() and friends.
8 years ago
Vladimír Vondruš
92071a342c
Math: added isInf() and isNan()
8 years ago
Vladimír Vondruš
623fa97970
Updated copyright year.
8 years ago
Vladimír Vondruš
2145ae9b96
Dropped NaCl support.
9 years ago
Vladimír Vondruš
7a16273e5d
Updated copyright year.
9 years ago
Vladimír Vondruš
eeac7e2868
Math: minmax() for a pointer range.
...
Thanks @Squareys for unblocking my brain!
9 years ago
Vladimír Vondruš
4cf9459110
Math: return default-constructed value for min()/max() on empty range.
9 years ago
Vladimír Vondruš
9e796b76c8
Math: added clamp(Vector, Vector, Vector), {min,max}(Vector, T)
...
In order to provide consistent API with GLSL. Pretty annoying omission.
9 years ago
Vladimír Vondruš
dd2058cee3
Math: renamed {de,}normalize() to {,un}pack() in a new Packing.h header.
...
To be more consistent with GLSL naming. Also, the original naming was
quite misleading, as normalize() is used in GLSL for something
completely different.
If building with deprecated APIs, the Functions.h header includes the
new Packing.h header and the {de,}normalize() functions are defined as
deprecated aliases to the new functions. This will be removed at some
point in the future.
9 years ago
Vladimír Vondruš
dba0ea320d
Math: vector/scalar overload for pow().
10 years ago
Vladimír Vondruš
eaeda24399
Don't restrict Double usage on OpenGL ES.
...
Restrict only what's not defined by GL on the ES flavor (double
attributes and uniforms). I love the smell of burning code.
10 years ago
Vladimír Vondruš
9fa0d8c796
Math: fix lerp() with BoolVector.
...
For some reason I swapped the order and took from the second parameter
when the value was 0. Probably because of the ?: operator.
10 years ago
Vladimír Vondruš
23646e6690
Hell, this project is big.
10 years ago
Vladimír Vondruš
9ebd6ad46d
Math: added pow(), log() and exp().
...
Just wrappers around std::pow(), std::log() and std::exp() to have the
complete toolbox consistent.
11 years ago
Vladimír Vondruš
ab35741221
Math: minor cleanup, reordering and test renaming.
11 years ago
Vladimír Vondruš
247d8dba6f
Math: added lerp(T, T, BoolVector).
...
In GLSL this is called mix() and I thought this is there for a long
time, but apparently it got included only in GL 4.5 / ES 3.1.
11 years ago
Vladimír Vondruš
e6567af364
Math: don't depend on char signedness in test.
...
Hopefully that was only in the test.
11 years ago
Vladimír Vondruš
58f16ccdb5
Math: proper fuzzy-compare for std::pair<float, float>.
...
I should update TestSuite to handle this automagically.
11 years ago
Vladimír Vondruš
e7cae67e9f
Math: added sincos().
...
Mainly a convenience function in case you want to compute sin and cos of
the same, potentially longer expression, and you don't want to have
repeated code or temporary variables. On some architectures might use
faster instruction that computes both values in one shot.
11 years ago
Vladimír Vondruš
127f34b657
Math: fix typedef shadowing.
11 years ago
Vladimír Vondruš
eac01167f5
MSVC 2015 compatibility: except long double (de)normalization to fail.
...
I'm giving up on this one also for 2015. Cherry-picked from
compatibility branch (6ee931b7b492c12cd6674c93564617c7139cea84).
11 years ago
Vladimír Vondruš
a58121e893
Math: added div() function.
11 years ago
Vladimír Vondruš
c71dc12503
Making test declarations more compact.
...
Yet again I experienced how insanely large this thing got over the
years.
11 years ago
Vladimír Vondruš
6488fe6e75
Oh, it's 2015 already.
11 years ago
Vladimír Vondruš
c56940993b
Use the new math constants throughout the code.
12 years ago