You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

36 lines
558 B

9 years ago
#include <assert.h>
#include <matrix/math.hpp>
9 years ago
9 years ago
using namespace matrix;
template class Vector<float, 3>;
9 years ago
int main()
{
Vector3f v;
v(0) = 1;
v(1) = 2;
v(2) = 3;
9 years ago
v.print();
9 years ago
static const float eps = 1e-7f;
assert(fabs(v(0) - 1) < eps);
assert(fabs(v(1) - 2) < eps);
assert(fabs(v(2) - 3) < eps);
9 years ago
Vector3f v2(4, 5, 6);
9 years ago
v2.print();
9 years ago
assert(fabs(v2(0) - 4) < eps);
assert(fabs(v2(1) - 5) < eps);
assert(fabs(v2(2) - 6) < eps);
9 years ago
return 0;
9 years ago
}
/* vim: set et fenc=utf-8 ff=unix sts=0 sw=4 ts=4 : */