## org.apache.mahout.math.function
Class PlusMult

    java.lang.Object
      org.apache.mahout.math.function.PlusMult

All Implemented Interfaces:
  BinaryFunction, DoubleDoubleFunction

    public final class PlusMult

extends java.lang.Object
implements BinaryFunction

Only for performance tuning of compute intensive linear algebraic computations. Constructs functions that return one of

- `a + b*constant`
- `a - b*constant`
- `a + b/constant`
- `a - b/constant`

`a` and `b` are variables, `constant` is fixed, but for performance reasons publicly accessible. Intended to be passed to `matrix.assign(otherMatrix,function)` methods.

Constructor Summary
`PlusMult(double multiplicator)`

Method Summary
`double` `apply(double a, double b)` Returns the result of the function evaluation.
`double` `getMultiplicator()`
`static PlusMult` `minusDiv(double constant)` `a - b/constant`.
`static PlusMult` `minusMult(double constant)` `a - b*constant`.
`static PlusMult` `plusDiv(double constant)` `a + b/constant`.
`static PlusMult` `plusMult(double constant)` `a + b*constant`.
`void` `setMultiplicator(double multiplicator)`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### PlusMult

    public PlusMult(double multiplicator)

Method Detail

### apply

    public double apply(double a,
                        double b)

  Returns the result of the function evaluation.

  Specified by:
    `apply` in interface `DoubleDoubleFunction`
  Parameters:
    `a` - a double for the first argument
    `b` - a double for the second argument
  Returns:
    the result of applying the function

### minusDiv

    public static PlusMult minusDiv(double constant)

  `a - b/constant`.

### minusMult

    public static PlusMult minusMult(double constant)

  `a - b*constant`.

### plusDiv

    public static PlusMult plusDiv(double constant)

  `a + b/constant`.

### plusMult

    public static PlusMult plusMult(double constant)

  `a + b*constant`.

### getMultiplicator

    public double getMultiplicator()

### setMultiplicator

    public void setMultiplicator(double multiplicator)

Copyright © 2008-2010 The Apache Software Foundation. All Rights Reserved.