Commit graph

6 commits

Author SHA1 Message Date
Pavel Krajcevski
7ed5c13405 Allow additional indexable types
Instead of using operator() to index into the second operand of the
VectorAddition function, use operator[]. This way we can add to pointers
and std::vector types as well.
2014-02-20 15:36:59 -05:00
Pavel Krajcevski
62cce58c2f Fix some of the vector multiplication and divide routines.
In general, we want the scalar division of vectors and matrices to
have the matrix come first and the scalar come second. It doesn't make
sense to divide a scalar by a vector or to divide a matrix by a vector,
so these should now produce errors at compile time.

Also, make sure to add additional types that can be multiplied together
using the * operator. If we multiply two vectors together, that's a dot
product. The size restrictions should be enforced at compile time by the
template parameters for VectorBase<T, N>::Dot

In this way, we can support vector/matrix multiplication by retaining the
* operator as well.
2014-02-20 14:49:35 -05:00
Pavel Krajcevski
2d7ee21fb7 Let the compiler choose what precision we want to do the vector-scalar multiplication/division in. 2014-02-19 19:36:28 -05:00
Pavel Krajcevski
2213e1b7d6 Add tests for special vector cases 2014-02-16 18:28:37 -05:00
Pavel Krajcevski
45b739a44a Add some tests for VectorBase 2014-02-16 17:17:25 -05:00
Pavel Krajcevski
92f5893650 Add first vector tests 2014-02-16 13:20:43 -05:00