Package org.nlpub.watset.util
Class Matrices.ColumnSumVisitor
java.lang.Object
org.apache.commons.math3.linear.DefaultRealMatrixPreservingVisitor
org.nlpub.watset.util.Matrices.ColumnSumVisitor
- All Implemented Interfaces:
org.apache.commons.math3.linear.RealMatrixPreservingVisitor
- Enclosing class:
- Matrices
public static class Matrices.ColumnSumVisitor
extends org.apache.commons.math3.linear.DefaultRealMatrixPreservingVisitor
Visitor that computes column sums.
-
Constructor Summary
ConstructorsConstructorDescriptionColumnSumVisitor
(org.apache.commons.math3.linear.RealVector sums) Create an instance of the normalizer. -
Method Summary
Modifier and TypeMethodDescriptionvoid
visit
(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.DefaultRealMatrixPreservingVisitor
end, start
-
Constructor Details
-
ColumnSumVisitor
public ColumnSumVisitor(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 void visit(int row, int column, double value) Divide the value of a single element by the corresponding column ofsums
.- Specified by:
visit
in interfaceorg.apache.commons.math3.linear.RealMatrixPreservingVisitor
- Overrides:
visit
in classorg.apache.commons.math3.linear.DefaultRealMatrixPreservingVisitor
- Parameters:
row
- rowcolumn
- columnvalue
- the value
-