Vladimír Vondruš
d474f9d176
Math: return an array reference instead of a pointer from data().
...
This makes it possible to conveniently do things like
Containers::StridedArrayView1D<Float> array = …;
Vector4 vector{NoInit};
Utility::copy(array, vector); // or the other way around
which is especially useful together with the new JSON classes. In some
cases this means the function is no longer constexpr, but those weren't
constexpr because it was useful for anything, they were only because it
was possible. So this breakage shouldn't do any harm I think.
4 years ago
Vladimír Vondruš
9874c44262
Don't rely on __GNUC__ being always 4 on Clang.
...
Certain Clang-based IDEs (CLion) "emulate" a compiler by inheriting all
its defines, which means one gets __clang__ defined but also __GNUC__
set to 11 or whatever, breaking all these assumptions.
4 years ago
Vladimír Vondruš
5513eba398
Math: packed debug output for angles, matrices and vectors.
...
Not documenting this publicly as it has a certain smell (needs better
naming, mainly), but I need this for a less verbose output in certain
tools.
4 years ago
Vladimír Vondruš
822fa0d644
Updated copyright year.
4 years ago
Vladimír Vondruš
08a6e7d957
Math: explicit test that all types are trivially copyable.
...
I saw some copy constructors here and there and wasn't sure.
5 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š
1026aee80e
Moved the NoInit tag from Math to the root namespace.
...
The old one is deprecated, and will be removed in a future release.
Unfortunately, to avoid deprecation warnings, all use of NoInit in the
Math library temporarily have to be Magnum::NoInit This will be cleaned
up when the deprecated alias is removed.
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š
498f4c59e1
Math: fix angle() returning NaN for close arguments.
6 years ago
Vladimír Vondruš
94cba139ff
Math: improve and clean up angle() tests.
6 years ago
Vladimír Vondruš
c8afe0f732
Math: make Vector::pad() default argument work with Half.
...
Got lucky enough that the default zero-initialization constructor does
exactly what I need. Otherwise ugh I don't know what I would do.
6 years ago
Vladimír Vondruš
3cf9dbf409
Math: added component-wise equal()/notEqual() for vectors.
7 years ago
Vladimír Vondruš
8e5ecfacac
Math: ignore NaNs also in Vector::min(), max() and minmax().
...
To have the API consistent.
7 years ago
Vladimír Vondruš
36ba5f4333
Math: ensure ZeroInit and IdentityInit constructors are explicit.
...
Like NoInit ones. Not sure what I was doing there.
7 years ago
Vladimír Vondruš
3626562e1d
Adapted to Corrade changes.
...
Mostly missing includes now.
7 years ago
Vladimír Vondruš
64bc7f9c8e
Math: moved configuration value parsers to a dedicated header.
...
There's a lot of string operations and that's nothing good to have
included everywhere. Should speed up the compilation quite a bit.
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
Borislav Stanimirov
f7f2ab8cb5
Math: added StrictWeakOrdering for math types
8 years ago
Vladimír Vondruš
0cf65741ae
Math: helpfully print the offending values in all assertions.
8 years ago
Vladimír Vondruš
08d51ec116
Math: oh, MSVC 2015 constexpr fun is here again.
8 years ago
Vladimír Vondruš
0c49c56768
Math: forgot to execute test for Vector::minmax().
...
:(
8 years ago
Vladimír Vondruš
623fa97970
Updated copyright year.
8 years ago
Vladimír Vondruš
06a7677fbe
Math: test underflow/overflow when parsing vector/matrix from Configuration.
...
Fails as overflow is not handled.
9 years ago
Vladimír Vondruš
7a16273e5d
Updated copyright year.
9 years ago
Vladimír Vondruš
ae9095de16
Remove most of the "MSVC 2015 can't handle {} here" workarounds.
9 years ago
Vladimír Vondruš
353d7ff59d
Math: implemented minmax() for arbitrary vectors.
9 years ago
Vladimír Vondruš
3cedefe14b
Math: remove GCC constexpr workaround from the tests.
10 years ago
Vladimír Vondruš
70ef473710
Math: verify that the NoInit constructors are explicit.
10 years ago
Vladimír Vondruš
e9a2623e02
Math: expect NoInit test failures on GCC 6.1+ with optimizations enabled.
...
It's nothing harmful, just inefficient.
10 years ago
Vladimír Vondruš
40d60f6a3f
Math: make all constructor noexcept and test their behavior.
10 years ago
Vladimír Vondruš
bf393fad59
Math: fix/workaround constexpr test compilation on MSVC 2015.
10 years ago
Vladimír Vondruš
633d792e3d
Math: added Vector::flipped().
10 years ago
Vladimír Vondruš
0d284736e2
Math: expect test failure with Emscripten and -O1.
...
Works flawlessly with -O2.
10 years ago
Vladimír Vondruš
a4fbea42d0
Math: proper implementation of Vector::isZero() for integers.
...
The thing is:
* Doing std::abs() and comparing to some epsilon value is crazy thing
to do with integers.
* When using unsigned integers, Clang rightfully complained that
calling std::abs() on these is a sign of insanity. This fixes it too.
10 years ago
Vladimír Vondruš
f3d774fa48
Math: revert ability to convert Vector<1, T> to T.
...
Doesn't solve problem I hoped it would solve (adding pointer and
Vector<1, size_t> still doesn't compile), breaks GCC 4.7 build in some
crazy way and makes certain previously-working operations (like
operator== on Vector<1, int> and int) ambiguous. Not worth pursuing
further, I think.
This reverts commit ca0892f026 .
This reverts commit d6d0fd1890 .
10 years ago
Vladimír Vondruš
d6d0fd1890
Math: test that it's possible to convert Vector<1, T> to T.
...
It's not (but should be).
10 years ago
Vladimír Vondruš
23646e6690
Hell, this project is big.
10 years ago
Vladimír Vondruš
30fc1411bb
Adapted to Corrade changes.
10 years ago
Vladimír Vondruš
6e8c16c960
MSVC 2015 Update 1: fixed nearly all constexpr bugs.
11 years ago
Vladimír Vondruš
d5359a2c36
Math: update and document subclass implementation macro tests.
11 years ago
Vladimír Vondruš
9136007371
MSVC 2015 compatibility: apparently dereferencing pointer is verboten.
11 years ago
Vladimír Vondruš
d7e507a2a7
MSVC 2015 compatibility: Math copy/conversion constexpr issues.
...
I don't know why, but marking the output of copy constructor of any
subclass or output of conversion operator of any class as constexpr
causes MSVC to complain about non-constant expression.
Probably just another bug.
11 years ago
Vladimír Vondruš
000d8f8129
MSVC 2015 compatibility: Math external conversion constexpr issues.
...
Caused by inability to delegate constexpr constructors. Subclasses are
okay, fortunately.
11 years ago
Vladimír Vondruš
d805e87f21
MSVC 2015 compatibility: Math conversion constructor constexpr issues.
...
Some could be worked around, but the rest is prevented by inability to
delegate constexpr constructors.
11 years ago
Vladimír Vondruš
8984904693
MSVC 2015 compatibility: single value Math constructor constexpr issues.
...
Some could be worked around, but the rest is prevented by inability to
delegate constexpr constructors.
11 years ago
Vladimír Vondruš
a89a692ddd
MSVC 2013 compatibility: {}-related issues.
11 years ago
Vladimír Vondruš
911ed52413
Math: test constexpr-ness of subclass types.
...
Fails with libc++ because std::forward() is not constexpr in C++11 (yes,
I'm adding the test solely because of that).
11 years ago