Added measurements

This commit is contained in:
Nguyen Quy Anh
2026-04-24 16:31:42 +02:00
parent aa1daf9149
commit 3d217e7840
7 changed files with 113 additions and 55 deletions
+2
View File
@@ -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;