Examples of IntFunction


Examples of org.apache.mahout.math.function.IntFunction

  /**
   * Constructs a function that returns <tt>a < b ? -1 : a > b ? 1 : 0</tt>. <tt>a</tt> is a variable, <tt>b</tt> is
   * fixed.
   */
  public static IntFunction compare(final int b) {
    return new IntFunction() {

      public int apply(int a) {
        return a < b ? -1 : a > b ? 1 : 0;
      }
    };
View Full Code Here

Examples of org.apache.mahout.math.function.IntFunction

    };
  }

  /** Constructs a function that returns the constant <tt>c</tt>. */
  public static IntFunction constant(final int c) {
    return new IntFunction() {

      public int apply(int a) {
        return c;
      }
    };
View Full Code Here

Examples of org.apache.mahout.math.function.IntFunction

    };
  }

  /** Constructs a function that returns <tt>a / b</tt>. <tt>a</tt> is a variable, <tt>b</tt> is fixed. */
  public static IntFunction div(final int b) {
    return new IntFunction() {

      public int apply(int a) {
        return a / b;
      }
    };
View Full Code Here

Examples of org.apache.mahout.math.function.IntFunction

    };
  }

  /** Constructs a function that returns <tt>a == b ? 1 : 0</tt>. <tt>a</tt> is a variable, <tt>b</tt> is fixed. */
  public static IntFunction equals(final int b) {
    return new IntFunction() {

      public int apply(int a) {
        return a == b ? 1 : 0;
      }
    };
View Full Code Here

Examples of org.apache.mahout.math.function.IntFunction

    };
  }

  /** Constructs a function that returns <tt>Math.max(a,b)</tt>. <tt>a</tt> is a variable, <tt>b</tt> is fixed. */
  public static IntFunction max(final int b) {
    return new IntFunction() {

      public int apply(int a) {
        return (a >= b) ? a : b;
      }
    };
View Full Code Here

Examples of org.apache.mahout.math.function.IntFunction

    };
  }

  /** Constructs a function that returns <tt>Math.min(a,b)</tt>. <tt>a</tt> is a variable, <tt>b</tt> is fixed. */
  public static IntFunction min(final int b) {
    return new IntFunction() {

      public int apply(int a) {
        return (a <= b) ? a : b;
      }
    };
View Full Code Here

Examples of org.apache.mahout.math.function.IntFunction

    };
  }

  /** Constructs a function that returns <tt>a - b</tt>. <tt>a</tt> is a variable, <tt>b</tt> is fixed. */
  public static IntFunction minus(final int b) {
    return new IntFunction() {

      public int apply(int a) {
        return a - b;
      }
    };
View Full Code Here

Examples of org.apache.mahout.math.function.IntFunction

    };
  }

  /** Constructs a function that returns <tt>a * b</tt>. <tt>a</tt> is a variable, <tt>b</tt> is fixed. */
  public static IntFunction mult(final int b) {
    return new IntFunction() {

      public int apply(int a) {
        return a * b;
      }
    };
View Full Code Here

Examples of org.apache.mahout.math.function.IntFunction

    };
  }

  /** Constructs a function that returns <tt>a | b</tt>. <tt>a</tt> is a variable, <tt>b</tt> is fixed. */
  public static IntFunction or(final int b) {
    return new IntFunction() {

      public int apply(int a) {
        return a | b;
      }
    };
View Full Code Here

Examples of org.apache.mahout.math.function.IntFunction

    };
  }

  /** Constructs a function that returns <tt>a + b</tt>. <tt>a</tt> is a variable, <tt>b</tt> is fixed. */
  public static IntFunction plus(final int b) {
    return new IntFunction() {

      public int apply(int a) {
        return a + b;
      }
    };
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.