SSJ API Documentation
Stochastic Simulation in Java
Loading...
Searching...
No Matches
SqrtMathFunction.java
1/*
2 * Class: SqrtMathFunction
3 * Description: function computing the square root of another function
4 * Environment: Java
5 * Software: SSJ
6 * Copyright (C) 2001 Pierre L'Ecuyer and Universite de Montreal
7 * Organization: DIRO, Universite de Montreal
8 * @author Éric Buist
9 * @since
10 *
11 *
12 * Licensed under the Apache License, Version 2.0 (the "License");
13 * you may not use this file except in compliance with the License.
14 * You may obtain a copy of the License at
15 *
16 * http://www.apache.org/licenses/LICENSE-2.0
17 *
18 * Unless required by applicable law or agreed to in writing, software
19 * distributed under the License is distributed on an "AS IS" BASIS,
20 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
21 * See the License for the specific language governing permissions and
22 * limitations under the License.
23 *
24 */
25package umontreal.ssj.functions;
26
34public class SqrtMathFunction implements MathFunction {
35 private MathFunction func;
36
43 super();
44 if (func == null)
45 throw new NullPointerException();
46 this.func = func;
47 }
48
55 return func;
56 }
57
58 public double evaluate(double x) {
59 return Math.sqrt(func.evaluate(x));
60 }
61}
SqrtMathFunction(MathFunction func)
Computes and returns the square root of the function func.
double evaluate(double x)
Returns the value of the function evaluated at .
MathFunction getFunction()
Returns the function associated with this object.
This interface should be implemented by classes which represent univariate mathematical functions.