001/*
002 * To change this template, choose Tools | Templates
003 * and open the template in the editor.
004 */
005
006package com.nativelibs4java.opencl.util;
007
008
009public enum Fun1 {
010    not("!"),
011    complement("~"),
012    abs,
013    log,
014    exp,
015    sqrt,
016    sin,
017    cos,
018    tan,
019    atan,
020    asin,
021    acos,
022    sinh,
023    cosh,
024    tanh,
025    asinh,
026    acosh,
027    atanh;
028
029    final String prefixOp;
030    Fun1(String op) {
031        this.prefixOp = op;
032    }
033    Fun1() {
034        this(null);
035    }
036    void expr(String a, StringBuilder out) {
037        if (prefixOp != null)
038            out.append('(').append(prefixOp).append(a).append(')');
039        out.append(name()).append('(').append(a).append(')');
040    }
041}