Package org.nlpub.watset.util
Class Matrices.ColumnNormalizeVisitor
java.lang.Object
org.apache.commons.math3.linear.DefaultRealMatrixChangingVisitor
org.nlpub.watset.util.Matrices.ColumnNormalizeVisitor
- All Implemented Interfaces:
org.apache.commons.math3.linear.RealMatrixChangingVisitor
- Enclosing class:
- Matrices
public static class Matrices.ColumnNormalizeVisitor
extends org.apache.commons.math3.linear.DefaultRealMatrixChangingVisitor
Visitor that normalizes columns.
-
Constructor Summary
ConstructorsConstructorDescriptionColumnNormalizeVisitor(org.apache.commons.math3.linear.RealVector sums) 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
-
ColumnNormalizeVisitor
public ColumnNormalizeVisitor(org.apache.commons.math3.linear.RealVector sums) Create an instance of the normalizer.- Parameters:
sums- the column vector containing row sums
-
-
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
-