Vladimír Vondruš
316a2d1c37
Math: removed superfluous instantiation sources.
...
Moved all instantiation into instantiation.cpp and removed the rest
(~200 lines of mainly license headers). Saves another ~3 seconds (4:06
before, 4:03 now). I'm done with these micro-optimizations for now.
13 years ago
Vladimír Vondruš
a63fea570a
Math: don't include <algorithm> in header file.
...
31ce072f39 was wrong, this header is
harmful. This beast includes ~46k LOC, much more than <*stream> class of
headers. Rewritten min() and max() manually, which surprisingly leads to
shorter implementation than previously. Compilation time on my machine
reduced from ~4:30 to ~4:21, not bad.
13 years ago
Vladimír Vondruš
fc58631aa5
Math: added convenience function Vector::resized().
13 years ago
Vladimír Vondruš
09ec2006be
Use `\bot` instead of `\perp` in math formulas.
...
`\perp` is for relations, `\bot` is usable as "name". Thanks @JanDupal
for hints :-)
13 years ago
Vladimír Vondruš
1f675cae25
Math::Geometry: cleaned up Distance, removed use of Matrix.
...
The same functionality is now provided in Vector2::cross() which is
also more meaningful.
13 years ago
Vladimír Vondruš
bf09b037da
Math::Geometry: cleaned up Distance test.
...
Everything is working as expected, which is ahem... unexpected.
13 years ago
Vladimír Vondruš
a4a962f686
Math: fixed matrix tests (spotted by Clang).
...
Either GCC 4.8 poorly implements C++11 or it already has support for
some proposed C++14 feature, which allows to elide successive
initializer braces.
13 years ago
Vladimír Vondruš
446b108bde
Added TODOs.
13 years ago
Vladimír Vondruš
a21fd0df07
Math: ability to convert matrices from/to external representation.
13 years ago
Vladimír Vondruš
31ce072f39
Math: added initializer list overloads for min() and max().
...
Hopefully including <algorithm> doesn't do much harm to compilation
time.
13 years ago
Vladimír Vondruš
2447ca9fb5
Added some TODOs.
13 years ago
Vladimír Vondruš
e147cc3992
Doc++, TODO++
13 years ago
Vladimír Vondruš
7ef8432fbe
Doxygen: ignore specific namespaces instead of whole directories.
...
Less maintenance burden with `#ifndef DOXYGEN_GENERATING_OUTPUT`,
removed the ones which are not needed anymore.
13 years ago
Vladimír Vondruš
458e146765
Math: std::fma() is not available in NaCl's newlib.
13 years ago
Vladimír Vondruš
f6ae87376b
Math: added function fma().
13 years ago
Vladimír Vondruš
1402833553
Math: added TODO.
13 years ago
Vladimír Vondruš
3f696533ff
Math: algorithm for computing intersection of two lines in 2D.
13 years ago
Vladimír Vondruš
6385ae1478
Math: more Intersection test cleanup.
13 years ago
Vladimír Vondruš
fd531b5101
Math: cleaned up plane/line intersection.
...
The function now accepts starting point and direction of the line (not
starting and ending point). Also improved the documentation and test a
bit.
13 years ago
Vladimír Vondruš
4ab3ab6534
Math: added Vector::lengthInverted().
...
Also because there are SIMD instructions for that.
13 years ago
Vladimír Vondruš
6124ad3c27
Math: added sqrtInverted() function.
...
There are SIMD instructions for that, so why not have it in place.
13 years ago
Vladimír Vondruš
7c3cb652bd
Math: doc++
13 years ago
Vladimír Vondruš
bf58bb3cb1
Math: rework of component-wise matrix and vector functions.
...
First, removed functions which can be done with Vector's member
functions and functions from Functions.h. More flexibility and less
redundant code which leads to easier SIMD implementation later.
Vector4 a;
Float b = a.maxAbs(); // before
Float b = Math::abs(a).max(); // now
Second, removed all functions from RectangularMatrix which are
implemented in Vector and added conversion from RectangularMatrix to
Vector and back. Also for more flexibility and less redundant code (i.e.
reusing SIMD-optimized Vector::max() instead of writing it again).
Matrix4x3 a;
Float b = a.max(); // before
Float b = a.toVector().max(); // now
13 years ago
Vladimír Vondruš
a80b4b146d
Math: write Vector2::cross() in terms of perpendicular() and dot().
13 years ago
Vladimír Vondruš
49154f30c4
Math: added Vector2::perpendicular().
...
Also updated and crosslinked related documentation.
13 years ago
Vladimír Vondruš
bba3755da1
GCC 4.8 compilation fixes.
13 years ago
Vladimír Vondruš
b7aeccad4c
Clang compilation fixes.
13 years ago
Vladimír Vondruš
0cd98456da
Math: Added Vector2::cross().
13 years ago
Vladimír Vondruš
b0883f8d6b
Doc++
13 years ago
Vladimír Vondruš
5e8606a755
Math: added sign() function.
13 years ago
Vladimír Vondruš
56139ae365
Math: no need to provide implementation just for Doxygen.
13 years ago
Vladimír Vondruš
8d5b2cae71
Math: std::hypot() is not available in NaCl newlib.
...
Probably bug / not-yet-implemented feature.
13 years ago
Vladimír Vondruš
64585ca4fd
GCC 4.6 compatibility: vector conversion is not constexpr.
13 years ago
Vladimír Vondruš
2d71c86942
Math: make trignometric functions working with Unit base class.
...
The test now passes again.
13 years ago
Vladimír Vondruš
d95c44fcc8
Math: test that trigonometric functions work with Unit base class.
...
The test fails.
13 years ago
Vladimír Vondruš
6802b022ea
Added some TODOs.
13 years ago
Vladimír Vondruš
407071dc96
Math: test also possibility of Unit implicit conversions.
13 years ago
Vladimír Vondruš
32d03530e1
Math: test that implicit conversion vector <-> complex/quat can't compile.
13 years ago
Vladimír Vondruš
37c93468fd
Math: test that implicit conversion of Rectangle type can't compile.
13 years ago
Vladimír Vondruš
51da8bd65b
Math: updated Rectangle test to test constexpr functions.
13 years ago
Vladimír Vondruš
213499e7bb
Math: test that implicit conversion from/to foreign types can't compile.
13 years ago
Vladimír Vondruš
1d5e3fee7a
Math: test that implicit conversion of underlying type can't compile.
13 years ago
Vladimír Vondruš
cc938a29dd
Math: test that implicit conversion of T to Vector<T> won't compile.
...
"Won't compile" tests are another awesome feature of C++11.
13 years ago
Vladimír Vondruš
45ba444fb8
Math: properly test conversion constexpr also in Vector subclasses.
13 years ago
Vladimír Vondruš
83bda8bbe6
Math: fixed test for denormalize<UnsignedLong, long double>().
...
Amazing what single forgotten literal can do.
13 years ago
Vladimír Vondruš
35eb876303
Various other compilation fixes for OpenGL ES target.
13 years ago
Vladimír Vondruš
ba0f56fa51
No need to use Double type in tests so extensively.
...
Makes porting to OpenGL ES easier.
13 years ago
Vladimír Vondruš
b28261d269
Math: fix compilation of tests with OpenGL ES.
...
Double precision is not supported there, mention that for skipped test
cases.
13 years ago
Vladimír Vondruš
be5c872c8a
Math: fixed two typos in the test.
...
They resulted in fact that the test case didn't actually test anything.
Spotted by Clang.
13 years ago
Vladimír Vondruš
fcb756e42a
Revert "GCC 4.6 compatibility: can't list-initialize array of classes."
...
It does too much harm on GCC 4.6 (all these constexpr constructors are
not constexpr now). We can disable that `-pedantic` warning for GCC 4.6
only and live with that.
This reverts commit 2d92d497d9 .
13 years ago