SSJ API Documentation
Stochastic Simulation in Java
Loading...
Searching...
No Matches
IdentityMathFunction.java
1/*
2 * Class: IdentityMathFunction
3 * Description:
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
32public class IdentityMathFunction implements MathFunction
33
35 public double evaluate(double x) {
36 return x;
37 }
38
39 public double derivative(double x) {
40 return 1;
41 }
42
43 public double derivative(double x, int n) {
44 return n > 1 ? 0 : 1;
45 }
46
47 public double integral(double a, double b) {
48 return (b * b - a * a) / 2;
49 }
50}
double derivative(double x, int n)
Computes (or estimates) the th derivative of the function at point x.
double evaluate(double x)
Returns the value of the function evaluated at .
double integral(double a, double b)
Computes (or estimates) the integral of the function over the interval .
double derivative(double x)
Computes (or estimates) the first derivative of the function at point x.
Represents a mathematical function whose th derivative can be computed using derivative(double,...
Represents a mathematical function whose derivative can be computed using derivative(double).
Represents a mathematical function whose integral can be computed by the integral(double,...
This interface should be implemented by classes which represent univariate mathematical functions.