diff --git a/libs/geom/include/psemek/geom/gram_schmidt.hpp b/libs/geom/include/psemek/geom/gram_schmidt.hpp index 9d1b496d..5dac446f 100644 --- a/libs/geom/include/psemek/geom/gram_schmidt.hpp +++ b/libs/geom/include/psemek/geom/gram_schmidt.hpp @@ -5,17 +5,22 @@ namespace psemek::geom { - inline void gram_schmidt() - {} + inline bool gram_schmidt() + { + return true; + } template - void gram_schmidt(V1 & v1, Vs & ... vs) + bool gram_schmidt(V1 & v1, Vs & ... vs) { - v1 = normalized(v1); + if (auto l = length(v1); l != 0) + v1 /= l; + else + return false; ((vs -= dot(v1, vs) * v1), ...); - gram_schmidt(vs...); + return gram_schmidt(vs...); } }