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

Method normalize

JSAT/src/jsat/linear/SparseVector.java:775–786  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

773 }
774
775 @Override
776 public void normalize()
777 {
778 double sum = 0;
779
780 for(int i = 0; i < used; i++)
781 sum += values[i]*values[i];
782
783 sum = Math.sqrt(sum);
784
785 mutableDivide(Math.max(sum, 1e-10));
786 }
787
788 @Override
789 public void mutablePairwiseMultiply(Vec b)

Callers

nothing calls this directly

Calls 2

mutableDivideMethod · 0.95
maxMethod · 0.45

Tested by

no test coverage detected