FloatMathFunctions.java

package org.djunits.value.vfloat.function;

/**
 * FloatMathFunctions provides a static implementation of Math functions.
 * <p>
 * This file was generated by the djunits value classes generator, 26 jun, 2015
 * <p>
 * Copyright (c) 2015-2024 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved. <br>
 * BSD-style license. See <a href="https://djunits.org/docs/license.html">DJUNITS License</a>.
 * </p>
 * @author <a href="https://www.tudelft.nl/averbraeck">Alexander Verbraeck</a>
 * @author <a href="https://www.tudelft.nl/staff/p.knoppers/">Peter Knoppers</a>
 */
public interface FloatMathFunctions
{
    /**
     * Function that returns <code>Math.abs(a)</code>.
     */
    FloatFunction ABS = new FloatFunction()
    {
        @Override
        public float apply(final float a)
        {
            return Math.abs(a);
        }
    };

    /**
     * Function that returns <code>Math.acos(a)</code>.
     */
    FloatFunction ACOS = new FloatFunction()
    {
        @Override
        public float apply(final float a)
        {
            return (float) Math.acos(a);
        }
    };

    /**
     * Function that returns <code>Math.asin(a)</code>.
     */
    FloatFunction ASIN = new FloatFunction()
    {
        @Override
        public float apply(final float a)
        {
            return (float) Math.asin(a);
        }
    };

    /**
     * Function that returns <code>Math.atan(a)</code>.
     */
    FloatFunction ATAN = new FloatFunction()
    {
        @Override
        public float apply(final float a)
        {
            return (float) Math.atan(a);
        }
    };

    /**
     * Function that returns <code>Math.cbrt(a)</code>.
     */
    FloatFunction CBRT = new FloatFunction()
    {
        @Override
        public float apply(final float a)
        {
            return (float) Math.cbrt(a);
        }
    };

    /**
     * Function that returns <code>Math.ceil(a)</code>.
     */
    FloatFunction CEIL = new FloatFunction()
    {
        @Override
        public float apply(final float a)
        {
            return (float) Math.ceil(a);
        }
    };

    /**
     * Function that returns <code>Math.cos(a)</code>.
     */
    FloatFunction COS = new FloatFunction()
    {
        @Override
        public float apply(final float a)
        {
            return (float) Math.cos(a);
        }
    };

    /**
     * Function that returns <code>Math.cosh(a)</code>.
     */
    FloatFunction COSH = new FloatFunction()
    {
        @Override
        public float apply(final float a)
        {
            return (float) Math.cosh(a);
        }
    };

    /**
     * Function that returns <code>Math.exp(a)</code>.
     */
    FloatFunction EXP = new FloatFunction()
    {
        @Override
        public float apply(final float a)
        {
            return (float) Math.exp(a);
        }
    };

    /**
     * Function that returns <code>Math.expm1(a)</code>.
     */
    FloatFunction EXPM1 = new FloatFunction()
    {
        @Override
        public float apply(final float a)
        {
            return (float) Math.expm1(a);
        }
    };

    /**
     * Function that returns <code>Math.floor(a)</code>.
     */
    FloatFunction FLOOR = new FloatFunction()
    {
        @Override
        public float apply(final float a)
        {
            return (float) Math.floor(a);
        }
    };

    /**
     * Function that returns <code>Math.log(a)</code>.
     */
    FloatFunction LOG = new FloatFunction()
    {
        @Override
        public float apply(final float a)
        {
            return (float) Math.log(a);
        }
    };

    /**
     * Function that returns <code>Math.log10(a)</code>.
     */
    FloatFunction LOG10 = new FloatFunction()
    {
        @Override
        public float apply(final float a)
        {
            return (float) Math.log10(a);
        }
    };

    /**
     * Function that returns <code>Math.log1p(a)</code>.
     */
    FloatFunction LOG1P = new FloatFunction()
    {
        @Override
        public float apply(final float a)
        {
            return (float) Math.log1p(a);
        }
    };

    /**
     * Function that returns <code>-a</code>.
     */
    FloatFunction NEG = new FloatFunction()
    {
        @Override
        public float apply(final float a)
        {
            return 0f == a ? 0f : -a;
        }
    };

    /**
     * Function that returns <code>Math.pow(a, b)</code>.
     * @param b float; power parameter
     * @return power function
     */
    @SuppressWarnings("checkstyle:methodname")
    static FloatFunction POW(final float b)
    {
        return new FloatFunction()
        {
            @Override
            public float apply(final float a)
            {
                return (float) Math.pow(a, b);
            }
        };
    }

    /**
     * Function that returns <code>Math.rint(a)</code>.
     */
    FloatFunction RINT = new FloatFunction()
    {
        @Override
        public float apply(final float a)
        {
            return (float) Math.rint(a);
        }
    };

    /**
     * Function that returns <code>Math.signum(a)</code>.
     */
    FloatFunction SIGNUM = new FloatFunction()
    {
        @Override
        public float apply(final float a)
        {
            return Math.signum(a);
        }
    };

    /**
     * Function that returns <code>Math.sin(a)</code>.
     */
    FloatFunction SIN = new FloatFunction()
    {
        @Override
        public float apply(final float a)
        {
            return (float) Math.sin(a);
        }
    };

    /**
     * Function that returns <code>Math.sinh(a)</code>.
     */
    FloatFunction SINH = new FloatFunction()
    {
        @Override
        public float apply(final float a)
        {
            return (float) Math.sinh(a);
        }
    };

    /**
     * Function that returns <code>Math.sqrt(a)</code>.
     */
    FloatFunction SQRT = new FloatFunction()
    {
        @Override
        public float apply(final float a)
        {
            return (float) Math.sqrt(a);
        }
    };

    /**
     * Function that returns <code>Math.tan(a)</code>.
     */
    FloatFunction TAN = new FloatFunction()
    {
        @Override
        public float apply(final float a)
        {
            return (float) Math.tan(a);
        }
    };

    /**
     * Function that returns <code>Math.tanh(a)</code>.
     */
    FloatFunction TANH = new FloatFunction()
    {
        @Override
        public float apply(final float a)
        {
            return (float) Math.tanh(a);
        }
    };

    /**
     * Function that returns <code>1/a</code>.
     */
    FloatFunction INV = new FloatFunction()
    {
        @Override
        public float apply(final float a)
        {
            return 1 / a;
        }
    };

    /**
     * Function that returns <code>a + b</code>.
     * @param b float; increment
     * @return power function
     */
    @SuppressWarnings("checkstyle:methodname")
    static FloatFunction INC(final float b)
    {
        return new FloatFunction()
        {
            @Override
            public float apply(final float a)
            {
                return a + b;
            }
        };
    }

    /**
     * Function that returns <code>a - b</code>.
     * @param b float; decrement
     * @return power function
     */
    @SuppressWarnings("checkstyle:methodname")
    static FloatFunction DEC(final float b)
    {
        return new FloatFunction()
        {
            @Override
            public float apply(final float a)
            {
                return a - b;
            }
        };
    }

    /**
     * Function that returns <code>a * b</code>.
     * @param b float; multiplier
     * @return power function
     */
    @SuppressWarnings("checkstyle:methodname")
    static FloatFunction MULT(final float b)
    {
        return new FloatFunction()
        {
            @Override
            public float apply(final float a)
            {
                return a * b;
            }
        };
    }

    /**
     * Function that returns <code>a / b</code>.
     * @param b float; divisor
     * @return power function
     */
    @SuppressWarnings("checkstyle:methodname")
    static FloatFunction DIV(final float b)
    {
        return new FloatFunction()
        {
            @Override
            public float apply(final float a)
            {
                return a / b;
            }
        };
    }
}