MCPcopy Create free account
hub / github.com/apache/madlib / __project

Function __project

src/modules/linalg/svd.cpp:62–72  ·  view source on GitHub ↗

Project the vector v into the vector u (in-place) */

Source from the content-addressed store, hash-verified

60
61/* Project the vector v into the vector u (in-place) */
62static void __project(MappedColumnVector& u, MutableNativeColumnVector& v){
63 double uu = u.dot(u);
64 double uv = u.dot(v);
65
66 double coef;
67 if (uu <= ZERO_THRESHOLD) { // if u is the zero vector, we have a division by zero problem
68 coef = 0;
69 } else
70 coef = uv / uu;
71 v = coef * u;
72}
73
74
75/**

Callers 1

runMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected