All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.nativelibs4java.opencl.util.Fun2 Maven / Gradle / Ivy

Go to download

JavaCL is an Object-Oriented API that makes the C OpenCL API available to Java in a very natural way. It hides away the complexity of cross-platform C bindings, has a clean OO design (with generics, Java enums, NIO buffers, fully typed exceptions...), provides high-level features (OpenGL-interop, array reductions) and comes with samples and demos. For more info, please visit http://code.google.com/p/nativelibs4java/wiki/OpenCL.

There is a newer version: 1.0.0-RC4
Show newest version
/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.nativelibs4java.opencl.util;


public enum Fun2 {
    min,
    max,
    atan2,
    dist,
    modulo("%"),
    rshift(">>"),
    lshift("<<"),
    xor("^"),
    bitOr("|"),
    bitAnd("&"),
    add("+"),
    substract("-"),
    multiply("*"),
    divide("/");

    String infixOp;
    Fun2() {}
    Fun2(String infixOp) {
        this.infixOp = infixOp;
    }
    void expr(String a, String b, StringBuilder out) {
        if (infixOp == null)
            out.append(name()).append('(').append(a).append(", ").append(b).append(")");
        else
            out.append(a).append(' ').append(infixOp).append(' ').append(b);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy