Examples of IntIntFunction


Examples of cern.colt.function.IntIntFunction

* @param g a unary function.
* @param h a binary function.
* @return the unary function <tt>g( h(a,b) )</tt>.
*/
public static IntIntFunction chain(final IntFunction g, final IntIntFunction h) {
  return new IntIntFunction() {
    public final int apply(int a, int b) { return g.apply(h.apply(a,b)); }
  };
}
View Full Code Here

Examples of cern.colt.function.IntIntFunction

* @param g a unary function.
* @param h a unary function.
* @return the binary function <tt>f( g(a), h(b) )</tt>.
*/
public static IntIntFunction chain(final IntIntFunction f, final IntFunction g, final IntFunction h) {
  return new IntIntFunction() {
    public final int apply(int a, int b) { return f.apply(g.apply(a), h.apply(b)); }
  };
}
View Full Code Here

Examples of cern.colt.function.IntIntFunction

*
* @param function a function taking operands in the form <tt>function.apply(a,b)</tt>.
* @return the binary function <tt>function(b,a)</tt>.
*/
public static IntIntFunction swapArgs(final IntIntFunction function) {
  return new IntIntFunction() {
    public final int apply(int a, int b) { return function.apply(b,a); }
  };
}
View Full Code Here

Examples of cern.colt.function.IntIntFunction

* @param g a unary function.
* @param h a binary function.
* @return the unary function <tt>g( h(a,b) )</tt>.
*/
public static IntIntFunction chain(final IntFunction g, final IntIntFunction h) {
  return new IntIntFunction() {
    public final int apply(int a, int b) { return g.apply(h.apply(a,b)); }
  };
}
View Full Code Here

Examples of cern.colt.function.IntIntFunction

* @param g a unary function.
* @param h a unary function.
* @return the binary function <tt>f( g(a), h(b) )</tt>.
*/
public static IntIntFunction chain(final IntIntFunction f, final IntFunction g, final IntFunction h) {
  return new IntIntFunction() {
    public final int apply(int a, int b) { return f.apply(g.apply(a), h.apply(b)); }
  };
}
View Full Code Here

Examples of cern.colt.function.IntIntFunction

*
* @param function a function taking operands in the form <tt>function.apply(a,b)</tt>.
* @return the binary function <tt>function(b,a)</tt>.
*/
public static IntIntFunction swapArgs(final IntIntFunction function) {
  return new IntIntFunction() {
    public final int apply(int a, int b) { return function.apply(b,a); }
  };
}
View Full Code Here

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

   * @param g a unary function.
   * @param h a binary function.
   * @return the unary function <tt>g( h(a,b) )</tt>.
   */
  public static IntIntFunction chain(final IntFunction g, final IntIntFunction h) {
    return new IntIntFunction() {

      public int apply(int a, int b) {
        return g.apply(h.apply(a, b));
      }
    };
View Full Code Here

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

   * @param g a unary function.
   * @param h a unary function.
   * @return the binary function <tt>f( g(a), h(b) )</tt>.
   */
  public static IntIntFunction chain(final IntIntFunction f, final IntFunction g, final IntFunction h) {
    return new IntIntFunction() {

      public int apply(int a, int b) {
        return f.apply(g.apply(a), h.apply(b));
      }
    };
View Full Code Here

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

public class MatricesTest extends MahoutTestCase {

  @Test
  public void testFunctionalView() {
    Matrix m = Matrices.functionalMatrixView(5, 6, new IntIntFunction() {
      @Override
      public double apply(int row, int col) {
        assertTrue(row < 5);
        assertTrue(col < 6);
        return row + col;
View Full Code Here

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

   *
   * @param m original matrix
   * @return transposed view of original matrix
   */
  public static final Matrix transposedView(final Matrix m) {
    IntIntFunction tf = new IntIntFunction() {
      @Override
      public double apply(int row, int col) {
        return m.getQuick(col, row);
      }
    };
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.