MCPcopy Create free account
hub / github.com/EdwardRaff/JSAT / normalize

Method normalize

JSAT/src/jsat/linear/DenseVector.java:406–417  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

404 }
405
406 @Override
407 public void normalize()
408 {
409 double sum = 0;
410
411 for(int i = startIndex; i < endIndex; i++)
412 sum += array[i]*array[i];
413
414 sum = Math.sqrt(sum);
415
416 mutableDivide(Math.max(sum, 1e-10));
417 }
418
419 @Override
420 public void mutablePairwiseMultiply(Vec b)

Callers 2

testSearch_Vec_doubleMethod · 0.95
testSearch_Vec_intMethod · 0.95

Calls 2

mutableDivideMethod · 0.95
maxMethod · 0.45

Tested by 2

testSearch_Vec_doubleMethod · 0.76
testSearch_Vec_intMethod · 0.76