@author Edward Raff
| 19 | * @author Edward Raff |
| 20 | */ |
| 21 | public class RiddersMethodTest |
| 22 | { |
| 23 | /** |
| 24 | * Root at 0 |
| 25 | */ |
| 26 | Function sinF = new Function() { |
| 27 | |
| 28 | /** |
| 29 | * |
| 30 | */ |
| 31 | private static final long serialVersionUID = -4942395915907632276L; |
| 32 | |
| 33 | public double f(double... x) |
| 34 | { |
| 35 | return sin(x[0]); |
| 36 | } |
| 37 | |
| 38 | public double f(Vec x) |
| 39 | { |
| 40 | return f(x.arrayCopy()); |
| 41 | } |
| 42 | }; |
| 43 | |
| 44 | /** |
| 45 | * Root at 0 + 2nd param |
| 46 | */ |
| 47 | Function sinFp1 = new Function() { |
| 48 | |
| 49 | /** |
| 50 | * |
| 51 | */ |
| 52 | private static final long serialVersionUID = -6913574202545691152L; |
| 53 | |
| 54 | public double f(double... x) |
| 55 | { |
| 56 | return sin(x[0]+x[1]); |
| 57 | } |
| 58 | |
| 59 | public double f(Vec x) |
| 60 | { |
| 61 | return f(x.arrayCopy()); |
| 62 | } |
| 63 | }; |
| 64 | |
| 65 | /** |
| 66 | * Root at approx -4.87906 |
| 67 | */ |
| 68 | Function polyF = new Function() { |
| 69 | |
| 70 | /** |
| 71 | * |
| 72 | */ |
| 73 | private static final long serialVersionUID = -206733171455524905L; |
| 74 | |
| 75 | public double f(double... x) |
| 76 | { |
| 77 | double xp = x[0]; |
| 78 |
nothing calls this directly
no outgoing calls
no test coverage detected