org.apache.mahout.math
Class VectorBinaryAssign.AssignIterateUnionRandomMergeUpdates

java.lang.Object
  extended by org.apache.mahout.math.VectorBinaryAssign
      extended by org.apache.mahout.math.VectorBinaryAssign.AssignIterateUnionRandomMergeUpdates
Enclosing class:
VectorBinaryAssign

public static class VectorBinaryAssign.AssignIterateUnionRandomMergeUpdates
extends VectorBinaryAssign

If f(0, 0) = 0 we can iterate through the nonzeros in either x or y. In this case, we iterate through the nozeros of x and y alternatively (this works even when one of them doesn't support sequential access). Since we're merging the results into x, when iterating through y, the order of iteration matters and y must support sequential access.


Nested Class Summary
 
Nested classes/interfaces inherited from class org.apache.mahout.math.VectorBinaryAssign
VectorBinaryAssign.AssignAllIterateSequentialInplaceUpdates, VectorBinaryAssign.AssignAllIterateSequentialMergeUpdates, VectorBinaryAssign.AssignAllIterateThatLookupThisInplaceUpdates, VectorBinaryAssign.AssignAllIterateThatLookupThisMergeUpdates, VectorBinaryAssign.AssignAllIterateThisLookupThatInplaceUpdates, VectorBinaryAssign.AssignAllIterateThisLookupThatMergeUpdates, VectorBinaryAssign.AssignAllLoopInplaceUpdates, VectorBinaryAssign.AssignAllLoopMergeUpdates, VectorBinaryAssign.AssignIterateIntersection, VectorBinaryAssign.AssignIterateUnionRandomInplaceUpdates, VectorBinaryAssign.AssignIterateUnionRandomMergeUpdates, VectorBinaryAssign.AssignIterateUnionSequentialInplaceUpdates, VectorBinaryAssign.AssignIterateUnionSequentialMergeUpdates, VectorBinaryAssign.AssignNonzerosIterateThatLookupThisInplaceUpdates, VectorBinaryAssign.AssignNonzerosIterateThatLookupThisMergeUpdates, VectorBinaryAssign.AssignNonzerosIterateThisLookupThat
 
Field Summary
 
Fields inherited from class org.apache.mahout.math.VectorBinaryAssign
OPERATIONS
 
Constructor Summary
VectorBinaryAssign.AssignIterateUnionRandomMergeUpdates()
           
 
Method Summary
 Vector assign(Vector x, Vector y, DoubleDoubleFunction f)
          Main method that applies f to x and y component-wise assigning the results to x.
 double estimateCost(Vector x, Vector y, DoubleDoubleFunction f)
          Estimates the cost of using this algorithm to compute the assignment.
 boolean isValid(Vector x, Vector y, DoubleDoubleFunction f)
          Returns true iff we can use this algorithm to apply f to x and y component-wise and assign the result to x.
 
Methods inherited from class org.apache.mahout.math.VectorBinaryAssign
assignBest, getBestOperation
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

VectorBinaryAssign.AssignIterateUnionRandomMergeUpdates

public VectorBinaryAssign.AssignIterateUnionRandomMergeUpdates()
Method Detail

isValid

public boolean isValid(Vector x,
                       Vector y,
                       DoubleDoubleFunction f)
Description copied from class: VectorBinaryAssign
Returns true iff we can use this algorithm to apply f to x and y component-wise and assign the result to x.

Specified by:
isValid in class VectorBinaryAssign

estimateCost

public double estimateCost(Vector x,
                           Vector y,
                           DoubleDoubleFunction f)
Description copied from class: VectorBinaryAssign
Estimates the cost of using this algorithm to compute the assignment. The algorithm is assumed to be valid.

Specified by:
estimateCost in class VectorBinaryAssign

assign

public Vector assign(Vector x,
                     Vector y,
                     DoubleDoubleFunction f)
Description copied from class: VectorBinaryAssign
Main method that applies f to x and y component-wise assigning the results to x. It returns the modified vector, x.

Specified by:
assign in class VectorBinaryAssign


Copyright © 2008–2014 The Apache Software Foundation. All rights reserved.