Added measurements
This commit is contained in:
@@ -15,7 +15,9 @@ struct Vector2d {
|
||||
*this = *this + v;
|
||||
return *this;
|
||||
}
|
||||
// # 4 flops = 1 SQRT, 2 MULTs, 1 ADD
|
||||
double norm() { return sqrt(x * x + y * y); }
|
||||
// # 3 flops = 2 MULTs, 1 ADD
|
||||
double dot(Vector2d v) { return x * v.x + y * v.y; }
|
||||
void reset() {
|
||||
x = 0;
|
||||
|
||||
Reference in New Issue
Block a user