Package org.nlpub.watset.util
Class Matrices.RowNormalizeVisitor
java.lang.Object
org.apache.commons.math3.linear.DefaultRealMatrixChangingVisitor
org.nlpub.watset.util.Matrices.RowNormalizeVisitor
- All Implemented Interfaces:
org.apache.commons.math3.linear.RealMatrixChangingVisitor
- Enclosing class:
- Matrices
public static class Matrices.RowNormalizeVisitor
extends org.apache.commons.math3.linear.DefaultRealMatrixChangingVisitor
Visitor that normalizes rows.
-
Constructor Summary
ConstructorsConstructorDescriptionRowNormalizeVisitor(org.apache.commons.math3.linear.RealVector norms) Create an instance of the normalizer. -
Method Summary
Modifier and TypeMethodDescriptiondoublevisit(int row, int column, double value) Divide the value of a single element by the corresponding column ofsums.Methods inherited from class org.apache.commons.math3.linear.DefaultRealMatrixChangingVisitor
end, start
-
Constructor Details
-
RowNormalizeVisitor
public RowNormalizeVisitor(org.apache.commons.math3.linear.RealVector norms) Create an instance of the normalizer.- Parameters:
norms- the row norms
-
-
Method Details
-
visit
public double visit(int row, int column, double value) Divide the value of a single element by the corresponding column ofsums.- Specified by:
visitin interfaceorg.apache.commons.math3.linear.RealMatrixChangingVisitor- Overrides:
visitin classorg.apache.commons.math3.linear.DefaultRealMatrixChangingVisitor- Parameters:
row- rowcolumn- columnvalue- the value- Returns:
- the normalized value
-