aboutsummaryrefslogtreecommitdiff
path: root/commons-math3-3.6.1/docs/apidocs/org/apache/commons/math3/analysis/solvers/UnivariateSolverUtils.html
blob: 66c5ec5823f8296709453b60de2a15e6fc96a328 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>UnivariateSolverUtils (Apache Commons Math 3.6.1 API)</title>
<link rel="stylesheet" type="text/css" href="../../../../../../stylesheet.css" title="Style">
</head>
<body>
<script type="text/javascript"><!--
    if (location.href.indexOf('is-external=true') == -1) {
        parent.document.title="UnivariateSolverUtils (Apache Commons Math 3.6.1 API)";
    }
//-->
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a name="navbar_top">
<!--   -->
</a><a href="#skip-navbar_top" title="Skip navigation links"></a><a name="navbar_top_firstrow">
<!--   -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="class-use/UnivariateSolverUtils.html">Use</a></li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../../index-all.html">Index</a></li>
<li><a href="../../../../../../help-doc.html">Help</a></li>
</ul>
<div class="aboutLanguage"><em><script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script></em></div>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../../../org/apache/commons/math3/analysis/solvers/UnivariateSolver.html" title="interface in org.apache.commons.math3.analysis.solvers"><span class="strong">Prev Class</span></a></li>
<li>Next Class</li>
</ul>
<ul class="navList">
<li><a href="../../../../../../index.html?org/apache/commons/math3/analysis/solvers/UnivariateSolverUtils.html" target="_top">Frames</a></li>
<li><a href="UnivariateSolverUtils.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
  allClassesLink = document.getElementById("allclasses_navbar_top");
  if(window==top) {
    allClassesLink.style.display = "block";
  }
  else {
    allClassesLink.style.display = "none";
  }
  //-->
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary:&nbsp;</li>
<li>Nested&nbsp;|&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li>Constr&nbsp;|&nbsp;</li>
<li><a href="#method_summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li>Constr&nbsp;|&nbsp;</li>
<li><a href="#method_detail">Method</a></li>
</ul>
</div>
<a name="skip-navbar_top">
<!--   -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
<!-- ======== START OF CLASS DATA ======== -->
<div class="header">
<div class="subTitle">org.apache.commons.math3.analysis.solvers</div>
<h2 title="Class UnivariateSolverUtils" class="title">Class UnivariateSolverUtils</h2>
</div>
<div class="contentContainer">
<ul class="inheritance">
<li><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">java.lang.Object</a></li>
<li>
<ul class="inheritance">
<li>org.apache.commons.math3.analysis.solvers.UnivariateSolverUtils</li>
</ul>
</li>
</ul>
<div class="description">
<ul class="blockList">
<li class="blockList">
<hr>
<br>
<pre>public class <span class="strong">UnivariateSolverUtils</span>
extends <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a></pre>
<div class="block">Utility routines for <a href="../../../../../../org/apache/commons/math3/analysis/solvers/UnivariateSolver.html" title="interface in org.apache.commons.math3.analysis.solvers"><code>UnivariateSolver</code></a> objects.</div>
</li>
</ul>
</div>
<div class="summary">
<ul class="blockList">
<li class="blockList">
<!-- ========== METHOD SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="method_summary">
<!--   -->
</a>
<h3>Method Summary</h3>
<table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation">
<caption><span>Methods</span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Method and Description</th>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static double[]</code></td>
<td class="colLast"><code><strong><a href="../../../../../../org/apache/commons/math3/analysis/solvers/UnivariateSolverUtils.html#bracket(org.apache.commons.math3.analysis.UnivariateFunction,%20double,%20double,%20double)">bracket</a></strong>(<a href="../../../../../../org/apache/commons/math3/analysis/UnivariateFunction.html" title="interface in org.apache.commons.math3.analysis">UnivariateFunction</a>&nbsp;function,
       double&nbsp;initial,
       double&nbsp;lowerBound,
       double&nbsp;upperBound)</code>
<div class="block">This method simply calls <a href="../../../../../../org/apache/commons/math3/analysis/solvers/UnivariateSolverUtils.html#bracket(org.apache.commons.math3.analysis.UnivariateFunction,%20double,%20double,%20double,%20double,%20double,%20int)"><code>bracket(function, initial, lowerBound, upperBound, q, r, maximumIterations)</code></a>
 with <code>q</code> and <code>r</code> set to 1.0 and <code>maximumIterations</code> set to <code>Integer.MAX_VALUE</code>.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>static double[]</code></td>
<td class="colLast"><code><strong><a href="../../../../../../org/apache/commons/math3/analysis/solvers/UnivariateSolverUtils.html#bracket(org.apache.commons.math3.analysis.UnivariateFunction,%20double,%20double,%20double,%20double,%20double,%20int)">bracket</a></strong>(<a href="../../../../../../org/apache/commons/math3/analysis/UnivariateFunction.html" title="interface in org.apache.commons.math3.analysis">UnivariateFunction</a>&nbsp;function,
       double&nbsp;initial,
       double&nbsp;lowerBound,
       double&nbsp;upperBound,
       double&nbsp;q,
       double&nbsp;r,
       int&nbsp;maximumIterations)</code>
<div class="block">This method attempts to find two values a and b satisfying 
  <code>lowerBound &lt;= a &lt; initial &lt; b &lt;= upperBound</code> 
  <code>f(a) * f(b) &lt;= 0</code> 
 
 If <code>f</code> is continuous on <code>[a,b]</code>, this means that <code>a</code>
 and <code>b</code> bracket a root of <code>f</code>.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static double[]</code></td>
<td class="colLast"><code><strong><a href="../../../../../../org/apache/commons/math3/analysis/solvers/UnivariateSolverUtils.html#bracket(org.apache.commons.math3.analysis.UnivariateFunction,%20double,%20double,%20double,%20int)">bracket</a></strong>(<a href="../../../../../../org/apache/commons/math3/analysis/UnivariateFunction.html" title="interface in org.apache.commons.math3.analysis">UnivariateFunction</a>&nbsp;function,
       double&nbsp;initial,
       double&nbsp;lowerBound,
       double&nbsp;upperBound,
       int&nbsp;maximumIterations)</code>
<div class="block">This method simply calls <a href="../../../../../../org/apache/commons/math3/analysis/solvers/UnivariateSolverUtils.html#bracket(org.apache.commons.math3.analysis.UnivariateFunction,%20double,%20double,%20double,%20double,%20double,%20int)"><code>bracket(function, initial, lowerBound, upperBound, q, r, maximumIterations)</code></a>
 with <code>q</code> and <code>r</code> set to 1.0.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>static double</code></td>
<td class="colLast"><code><strong><a href="../../../../../../org/apache/commons/math3/analysis/solvers/UnivariateSolverUtils.html#forceSide(int,%20org.apache.commons.math3.analysis.UnivariateFunction,%20org.apache.commons.math3.analysis.solvers.BracketedUnivariateSolver,%20double,%20double,%20double,%20org.apache.commons.math3.analysis.solvers.AllowedSolution)">forceSide</a></strong>(int&nbsp;maxEval,
         <a href="../../../../../../org/apache/commons/math3/analysis/UnivariateFunction.html" title="interface in org.apache.commons.math3.analysis">UnivariateFunction</a>&nbsp;f,
         <a href="../../../../../../org/apache/commons/math3/analysis/solvers/BracketedUnivariateSolver.html" title="interface in org.apache.commons.math3.analysis.solvers">BracketedUnivariateSolver</a>&lt;<a href="../../../../../../org/apache/commons/math3/analysis/UnivariateFunction.html" title="interface in org.apache.commons.math3.analysis">UnivariateFunction</a>&gt;&nbsp;bracketing,
         double&nbsp;baseRoot,
         double&nbsp;min,
         double&nbsp;max,
         <a href="../../../../../../org/apache/commons/math3/analysis/solvers/AllowedSolution.html" title="enum in org.apache.commons.math3.analysis.solvers">AllowedSolution</a>&nbsp;allowedSolution)</code>
<div class="block">Force a root found by a non-bracketing solver to lie on a specified side,
 as if the solver were a bracketing one.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static boolean</code></td>
<td class="colLast"><code><strong><a href="../../../../../../org/apache/commons/math3/analysis/solvers/UnivariateSolverUtils.html#isBracketing(org.apache.commons.math3.analysis.UnivariateFunction,%20double,%20double)">isBracketing</a></strong>(<a href="../../../../../../org/apache/commons/math3/analysis/UnivariateFunction.html" title="interface in org.apache.commons.math3.analysis">UnivariateFunction</a>&nbsp;function,
            double&nbsp;lower,
            double&nbsp;upper)</code>
<div class="block">Check whether the interval bounds bracket a root.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>static boolean</code></td>
<td class="colLast"><code><strong><a href="../../../../../../org/apache/commons/math3/analysis/solvers/UnivariateSolverUtils.html#isSequence(double,%20double,%20double)">isSequence</a></strong>(double&nbsp;start,
          double&nbsp;mid,
          double&nbsp;end)</code>
<div class="block">Check whether the arguments form a (strictly) increasing sequence.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static double</code></td>
<td class="colLast"><code><strong><a href="../../../../../../org/apache/commons/math3/analysis/solvers/UnivariateSolverUtils.html#midpoint(double,%20double)">midpoint</a></strong>(double&nbsp;a,
        double&nbsp;b)</code>
<div class="block">Compute the midpoint of two values.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>static double</code></td>
<td class="colLast"><code><strong><a href="../../../../../../org/apache/commons/math3/analysis/solvers/UnivariateSolverUtils.html#solve(org.apache.commons.math3.analysis.UnivariateFunction,%20double,%20double)">solve</a></strong>(<a href="../../../../../../org/apache/commons/math3/analysis/UnivariateFunction.html" title="interface in org.apache.commons.math3.analysis">UnivariateFunction</a>&nbsp;function,
     double&nbsp;x0,
     double&nbsp;x1)</code>
<div class="block">Convenience method to find a zero of a univariate real function.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static double</code></td>
<td class="colLast"><code><strong><a href="../../../../../../org/apache/commons/math3/analysis/solvers/UnivariateSolverUtils.html#solve(org.apache.commons.math3.analysis.UnivariateFunction,%20double,%20double,%20double)">solve</a></strong>(<a href="../../../../../../org/apache/commons/math3/analysis/UnivariateFunction.html" title="interface in org.apache.commons.math3.analysis">UnivariateFunction</a>&nbsp;function,
     double&nbsp;x0,
     double&nbsp;x1,
     double&nbsp;absoluteAccuracy)</code>
<div class="block">Convenience method to find a zero of a univariate real function.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>static void</code></td>
<td class="colLast"><code><strong><a href="../../../../../../org/apache/commons/math3/analysis/solvers/UnivariateSolverUtils.html#verifyBracketing(org.apache.commons.math3.analysis.UnivariateFunction,%20double,%20double)">verifyBracketing</a></strong>(<a href="../../../../../../org/apache/commons/math3/analysis/UnivariateFunction.html" title="interface in org.apache.commons.math3.analysis">UnivariateFunction</a>&nbsp;function,
                double&nbsp;lower,
                double&nbsp;upper)</code>
<div class="block">Check that the endpoints specify an interval and the end points
 bracket a root.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static void</code></td>
<td class="colLast"><code><strong><a href="../../../../../../org/apache/commons/math3/analysis/solvers/UnivariateSolverUtils.html#verifyInterval(double,%20double)">verifyInterval</a></strong>(double&nbsp;lower,
              double&nbsp;upper)</code>
<div class="block">Check that the endpoints specify an interval.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>static void</code></td>
<td class="colLast"><code><strong><a href="../../../../../../org/apache/commons/math3/analysis/solvers/UnivariateSolverUtils.html#verifySequence(double,%20double,%20double)">verifySequence</a></strong>(double&nbsp;lower,
              double&nbsp;initial,
              double&nbsp;upper)</code>
<div class="block">Check that <code>lower &lt; initial &lt; upper</code>.</div>
</td>
</tr>
</table>
<ul class="blockList">
<li class="blockList"><a name="methods_inherited_from_class_java.lang.Object">
<!--   -->
</a>
<h3>Methods inherited from class&nbsp;java.lang.<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a></h3>
<code><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#clone()" title="class or interface in java.lang">clone</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#equals(java.lang.Object)" title="class or interface in java.lang">equals</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#finalize()" title="class or interface in java.lang">finalize</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#getClass()" title="class or interface in java.lang">getClass</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#hashCode()" title="class or interface in java.lang">hashCode</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#notify()" title="class or interface in java.lang">notify</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#notifyAll()" title="class or interface in java.lang">notifyAll</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#toString()" title="class or interface in java.lang">toString</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#wait()" title="class or interface in java.lang">wait</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#wait(long)" title="class or interface in java.lang">wait</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#wait(long,%20int)" title="class or interface in java.lang">wait</a></code></li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
<div class="details">
<ul class="blockList">
<li class="blockList">
<!-- ============ METHOD DETAIL ========== -->
<ul class="blockList">
<li class="blockList"><a name="method_detail">
<!--   -->
</a>
<h3>Method Detail</h3>
<a name="solve(org.apache.commons.math3.analysis.UnivariateFunction, double, double)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>solve</h4>
<pre>public static&nbsp;double&nbsp;solve(<a href="../../../../../../org/apache/commons/math3/analysis/UnivariateFunction.html" title="interface in org.apache.commons.math3.analysis">UnivariateFunction</a>&nbsp;function,
           double&nbsp;x0,
           double&nbsp;x1)
                    throws <a href="../../../../../../org/apache/commons/math3/exception/NullArgumentException.html" title="class in org.apache.commons.math3.exception">NullArgumentException</a>,
                           <a href="../../../../../../org/apache/commons/math3/exception/NoBracketingException.html" title="class in org.apache.commons.math3.exception">NoBracketingException</a></pre>
<div class="block">Convenience method to find a zero of a univariate real function.  A default
 solver is used.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>function</code> - Function.</dd><dd><code>x0</code> - Lower bound for the interval.</dd><dd><code>x1</code> - Upper bound for the interval.</dd>
<dt><span class="strong">Returns:</span></dt><dd>a value where the function is zero.</dd>
<dt><span class="strong">Throws:</span></dt>
<dd><code><a href="../../../../../../org/apache/commons/math3/exception/NoBracketingException.html" title="class in org.apache.commons.math3.exception">NoBracketingException</a></code> - if the function has the same sign at the
 endpoints.</dd>
<dd><code><a href="../../../../../../org/apache/commons/math3/exception/NullArgumentException.html" title="class in org.apache.commons.math3.exception">NullArgumentException</a></code> - if <code>function</code> is <code>null</code>.</dd></dl>
</li>
</ul>
<a name="solve(org.apache.commons.math3.analysis.UnivariateFunction, double, double, double)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>solve</h4>
<pre>public static&nbsp;double&nbsp;solve(<a href="../../../../../../org/apache/commons/math3/analysis/UnivariateFunction.html" title="interface in org.apache.commons.math3.analysis">UnivariateFunction</a>&nbsp;function,
           double&nbsp;x0,
           double&nbsp;x1,
           double&nbsp;absoluteAccuracy)
                    throws <a href="../../../../../../org/apache/commons/math3/exception/NullArgumentException.html" title="class in org.apache.commons.math3.exception">NullArgumentException</a>,
                           <a href="../../../../../../org/apache/commons/math3/exception/NoBracketingException.html" title="class in org.apache.commons.math3.exception">NoBracketingException</a></pre>
<div class="block">Convenience method to find a zero of a univariate real function.  A default
 solver is used.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>function</code> - Function.</dd><dd><code>x0</code> - Lower bound for the interval.</dd><dd><code>x1</code> - Upper bound for the interval.</dd><dd><code>absoluteAccuracy</code> - Accuracy to be used by the solver.</dd>
<dt><span class="strong">Returns:</span></dt><dd>a value where the function is zero.</dd>
<dt><span class="strong">Throws:</span></dt>
<dd><code><a href="../../../../../../org/apache/commons/math3/exception/NoBracketingException.html" title="class in org.apache.commons.math3.exception">NoBracketingException</a></code> - if the function has the same sign at the
 endpoints.</dd>
<dd><code><a href="../../../../../../org/apache/commons/math3/exception/NullArgumentException.html" title="class in org.apache.commons.math3.exception">NullArgumentException</a></code> - if <code>function</code> is <code>null</code>.</dd></dl>
</li>
</ul>
<a name="forceSide(int, org.apache.commons.math3.analysis.UnivariateFunction, org.apache.commons.math3.analysis.solvers.BracketedUnivariateSolver, double, double, double, org.apache.commons.math3.analysis.solvers.AllowedSolution)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>forceSide</h4>
<pre>public static&nbsp;double&nbsp;forceSide(int&nbsp;maxEval,
               <a href="../../../../../../org/apache/commons/math3/analysis/UnivariateFunction.html" title="interface in org.apache.commons.math3.analysis">UnivariateFunction</a>&nbsp;f,
               <a href="../../../../../../org/apache/commons/math3/analysis/solvers/BracketedUnivariateSolver.html" title="interface in org.apache.commons.math3.analysis.solvers">BracketedUnivariateSolver</a>&lt;<a href="../../../../../../org/apache/commons/math3/analysis/UnivariateFunction.html" title="interface in org.apache.commons.math3.analysis">UnivariateFunction</a>&gt;&nbsp;bracketing,
               double&nbsp;baseRoot,
               double&nbsp;min,
               double&nbsp;max,
               <a href="../../../../../../org/apache/commons/math3/analysis/solvers/AllowedSolution.html" title="enum in org.apache.commons.math3.analysis.solvers">AllowedSolution</a>&nbsp;allowedSolution)
                        throws <a href="../../../../../../org/apache/commons/math3/exception/NoBracketingException.html" title="class in org.apache.commons.math3.exception">NoBracketingException</a></pre>
<div class="block">Force a root found by a non-bracketing solver to lie on a specified side,
 as if the solver were a bracketing one.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>maxEval</code> - maximal number of new evaluations of the function
 (evaluations already done for finding the root should have already been subtracted
 from this number)</dd><dd><code>f</code> - function to solve</dd><dd><code>bracketing</code> - bracketing solver to use for shifting the root</dd><dd><code>baseRoot</code> - original root found by a previous non-bracketing solver</dd><dd><code>min</code> - minimal bound of the search interval</dd><dd><code>max</code> - maximal bound of the search interval</dd><dd><code>allowedSolution</code> - the kind of solutions that the root-finding algorithm may
 accept as solutions.</dd>
<dt><span class="strong">Returns:</span></dt><dd>a root approximation, on the specified side of the exact root</dd>
<dt><span class="strong">Throws:</span></dt>
<dd><code><a href="../../../../../../org/apache/commons/math3/exception/NoBracketingException.html" title="class in org.apache.commons.math3.exception">NoBracketingException</a></code> - if the function has the same sign at the
 endpoints.</dd></dl>
</li>
</ul>
<a name="bracket(org.apache.commons.math3.analysis.UnivariateFunction, double, double, double)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>bracket</h4>
<pre>public static&nbsp;double[]&nbsp;bracket(<a href="../../../../../../org/apache/commons/math3/analysis/UnivariateFunction.html" title="interface in org.apache.commons.math3.analysis">UnivariateFunction</a>&nbsp;function,
               double&nbsp;initial,
               double&nbsp;lowerBound,
               double&nbsp;upperBound)
                        throws <a href="../../../../../../org/apache/commons/math3/exception/NullArgumentException.html" title="class in org.apache.commons.math3.exception">NullArgumentException</a>,
                               <a href="../../../../../../org/apache/commons/math3/exception/NotStrictlyPositiveException.html" title="class in org.apache.commons.math3.exception">NotStrictlyPositiveException</a>,
                               <a href="../../../../../../org/apache/commons/math3/exception/NoBracketingException.html" title="class in org.apache.commons.math3.exception">NoBracketingException</a></pre>
<div class="block">This method simply calls <a href="../../../../../../org/apache/commons/math3/analysis/solvers/UnivariateSolverUtils.html#bracket(org.apache.commons.math3.analysis.UnivariateFunction,%20double,%20double,%20double,%20double,%20double,%20int)"><code>bracket(function, initial, lowerBound, upperBound, q, r, maximumIterations)</code></a>
 with <code>q</code> and <code>r</code> set to 1.0 and <code>maximumIterations</code> set to <code>Integer.MAX_VALUE</code>.
 <p>
 <strong>Note: </strong> this method can take <code>Integer.MAX_VALUE</code>
 iterations to throw a <code>ConvergenceException.</code>  Unless you are
 confident that there is a root between <code>lowerBound</code> and
 <code>upperBound</code> near <code>initial</code>, it is better to use
 <a href="../../../../../../org/apache/commons/math3/analysis/solvers/UnivariateSolverUtils.html#bracket(org.apache.commons.math3.analysis.UnivariateFunction,%20double,%20double,%20double,%20double,%20double,%20int)"><code>bracket(function, initial, lowerBound, upperBound, q, r, maximumIterations)</code></a>,
 explicitly specifying the maximum number of iterations.</p></div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>function</code> - Function.</dd><dd><code>initial</code> - Initial midpoint of interval being expanded to
 bracket a root.</dd><dd><code>lowerBound</code> - Lower bound (a is never lower than this value)</dd><dd><code>upperBound</code> - Upper bound (b never is greater than this
 value).</dd>
<dt><span class="strong">Returns:</span></dt><dd>a two-element array holding a and b.</dd>
<dt><span class="strong">Throws:</span></dt>
<dd><code><a href="../../../../../../org/apache/commons/math3/exception/NoBracketingException.html" title="class in org.apache.commons.math3.exception">NoBracketingException</a></code> - if a root cannot be bracketted.</dd>
<dd><code><a href="../../../../../../org/apache/commons/math3/exception/NotStrictlyPositiveException.html" title="class in org.apache.commons.math3.exception">NotStrictlyPositiveException</a></code> - if <code>maximumIterations &lt;= 0</code>.</dd>
<dd><code><a href="../../../../../../org/apache/commons/math3/exception/NullArgumentException.html" title="class in org.apache.commons.math3.exception">NullArgumentException</a></code> - if <code>function</code> is <code>null</code>.</dd></dl>
</li>
</ul>
<a name="bracket(org.apache.commons.math3.analysis.UnivariateFunction, double, double, double, int)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>bracket</h4>
<pre>public static&nbsp;double[]&nbsp;bracket(<a href="../../../../../../org/apache/commons/math3/analysis/UnivariateFunction.html" title="interface in org.apache.commons.math3.analysis">UnivariateFunction</a>&nbsp;function,
               double&nbsp;initial,
               double&nbsp;lowerBound,
               double&nbsp;upperBound,
               int&nbsp;maximumIterations)
                        throws <a href="../../../../../../org/apache/commons/math3/exception/NullArgumentException.html" title="class in org.apache.commons.math3.exception">NullArgumentException</a>,
                               <a href="../../../../../../org/apache/commons/math3/exception/NotStrictlyPositiveException.html" title="class in org.apache.commons.math3.exception">NotStrictlyPositiveException</a>,
                               <a href="../../../../../../org/apache/commons/math3/exception/NoBracketingException.html" title="class in org.apache.commons.math3.exception">NoBracketingException</a></pre>
<div class="block">This method simply calls <a href="../../../../../../org/apache/commons/math3/analysis/solvers/UnivariateSolverUtils.html#bracket(org.apache.commons.math3.analysis.UnivariateFunction,%20double,%20double,%20double,%20double,%20double,%20int)"><code>bracket(function, initial, lowerBound, upperBound, q, r, maximumIterations)</code></a>
 with <code>q</code> and <code>r</code> set to 1.0.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>function</code> - Function.</dd><dd><code>initial</code> - Initial midpoint of interval being expanded to
 bracket a root.</dd><dd><code>lowerBound</code> - Lower bound (a is never lower than this value).</dd><dd><code>upperBound</code> - Upper bound (b never is greater than this
 value).</dd><dd><code>maximumIterations</code> - Maximum number of iterations to perform</dd>
<dt><span class="strong">Returns:</span></dt><dd>a two element array holding a and b.</dd>
<dt><span class="strong">Throws:</span></dt>
<dd><code><a href="../../../../../../org/apache/commons/math3/exception/NoBracketingException.html" title="class in org.apache.commons.math3.exception">NoBracketingException</a></code> - if the algorithm fails to find a and b
 satisfying the desired conditions.</dd>
<dd><code><a href="../../../../../../org/apache/commons/math3/exception/NotStrictlyPositiveException.html" title="class in org.apache.commons.math3.exception">NotStrictlyPositiveException</a></code> - if <code>maximumIterations &lt;= 0</code>.</dd>
<dd><code><a href="../../../../../../org/apache/commons/math3/exception/NullArgumentException.html" title="class in org.apache.commons.math3.exception">NullArgumentException</a></code> - if <code>function</code> is <code>null</code>.</dd></dl>
</li>
</ul>
<a name="bracket(org.apache.commons.math3.analysis.UnivariateFunction, double, double, double, double, double, int)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>bracket</h4>
<pre>public static&nbsp;double[]&nbsp;bracket(<a href="../../../../../../org/apache/commons/math3/analysis/UnivariateFunction.html" title="interface in org.apache.commons.math3.analysis">UnivariateFunction</a>&nbsp;function,
               double&nbsp;initial,
               double&nbsp;lowerBound,
               double&nbsp;upperBound,
               double&nbsp;q,
               double&nbsp;r,
               int&nbsp;maximumIterations)
                        throws <a href="../../../../../../org/apache/commons/math3/exception/NoBracketingException.html" title="class in org.apache.commons.math3.exception">NoBracketingException</a></pre>
<div class="block">This method attempts to find two values a and b satisfying <ul>
 <li> <code>lowerBound &lt;= a &lt; initial &lt; b &lt;= upperBound</code> </li>
 <li> <code>f(a) * f(b) &lt;= 0</code> </li>
 </ul>
 If <code>f</code> is continuous on <code>[a,b]</code>, this means that <code>a</code>
 and <code>b</code> bracket a root of <code>f</code>.
 <p>
 The algorithm checks the sign of \( f(l_k) \) and \( f(u_k) \) for increasing
 values of k, where \( l_k = max(lower, initial - \delta_k) \),
 \( u_k = min(upper, initial + \delta_k) \), using recurrence
 \( \delta_{k+1} = r \delta_k + q, \delta_0 = 0\) and starting search with \( k=1 \).
 The algorithm stops when one of the following happens: <ul>
 <li> at least one positive and one negative value have been found --  success!</li>
 <li> both endpoints have reached their respective limits -- NoBracketingException </li>
 <li> <code>maximumIterations</code> iterations elapse -- NoBracketingException </li></ul>
 <p>
 If different signs are found at first iteration (<code>k=1</code>), then the returned
 interval will be \( [a, b] = [l_1, u_1] \). If different signs are found at a later
 iteration <code>k&gt;1</code>, then the returned interval will be either
 \( [a, b] = [l_{k+1}, l_{k}] \) or \( [a, b] = [u_{k}, u_{k+1}] \). A root solver called
 with these parameters will therefore start with the smallest bracketing interval known
 at this step.
 </p>
 <p>
 Interval expansion rate is tuned by changing the recurrence parameters <code>r</code> and
 <code>q</code>. When the multiplicative factor <code>r</code> is set to 1, the sequence is a
 simple arithmetic sequence with linear increase. When the multiplicative factor <code>r</code>
 is larger than 1, the sequence has an asymptotically exponential rate. Note than the
 additive parameter <code>q</code> should never be set to zero, otherwise the interval would
 degenerate to the single initial point for all values of <code>k</code>.
 </p>
 <p>
 As a rule of thumb, when the location of the root is expected to be approximately known
 within some error margin, <code>r</code> should be set to 1 and <code>q</code> should be set to the
 order of magnitude of the error margin. When the location of the root is really a wild guess,
 then <code>r</code> should be set to a value larger than 1 (typically 2 to double the interval
 length at each iteration) and <code>q</code> should be set according to half the initial
 search interval length.
 </p>
 <p>
 As an example, if we consider the trivial function <code>f(x) = 1 - x</code> and use
 <code>initial = 4</code>, <code>r = 1</code>, <code>q = 2</code>, the algorithm will compute
 <code>f(4-2) = f(2) = -1</code> and <code>f(4+2) = f(6) = -5</code> for <code>k = 1</code>, then
 <code>f(4-4) = f(0) = +1</code> and <code>f(4+4) = f(8) = -7</code> for <code>k = 2</code>. Then it will
 return the interval <code>[0, 2]</code> as the smallest one known to be bracketing the root.
 As shown by this example, the initial value (here <code>4</code>) may lie outside of the returned
 bracketing interval.
 </p></div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>function</code> - function to check</dd><dd><code>initial</code> - Initial midpoint of interval being expanded to
 bracket a root.</dd><dd><code>lowerBound</code> - Lower bound (a is never lower than this value).</dd><dd><code>upperBound</code> - Upper bound (b never is greater than this
 value).</dd><dd><code>q</code> - additive offset used to compute bounds sequence (must be strictly positive)</dd><dd><code>r</code> - multiplicative factor used to compute bounds sequence</dd><dd><code>maximumIterations</code> - Maximum number of iterations to perform</dd>
<dt><span class="strong">Returns:</span></dt><dd>a two element array holding the bracketing values.</dd>
<dt><span class="strong">Throws:</span></dt>
<dd><code><a href="../../../../../../org/apache/commons/math3/exception/NoBracketingException.html" title="class in org.apache.commons.math3.exception">NoBracketingException</a></code> - if function cannot be bracketed in the search interval</dd></dl>
</li>
</ul>
<a name="midpoint(double, double)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>midpoint</h4>
<pre>public static&nbsp;double&nbsp;midpoint(double&nbsp;a,
              double&nbsp;b)</pre>
<div class="block">Compute the midpoint of two values.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>a</code> - first value.</dd><dd><code>b</code> - second value.</dd>
<dt><span class="strong">Returns:</span></dt><dd>the midpoint.</dd></dl>
</li>
</ul>
<a name="isBracketing(org.apache.commons.math3.analysis.UnivariateFunction, double, double)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>isBracketing</h4>
<pre>public static&nbsp;boolean&nbsp;isBracketing(<a href="../../../../../../org/apache/commons/math3/analysis/UnivariateFunction.html" title="interface in org.apache.commons.math3.analysis">UnivariateFunction</a>&nbsp;function,
                   double&nbsp;lower,
                   double&nbsp;upper)
                            throws <a href="../../../../../../org/apache/commons/math3/exception/NullArgumentException.html" title="class in org.apache.commons.math3.exception">NullArgumentException</a></pre>
<div class="block">Check whether the interval bounds bracket a root. That is, if the
 values at the endpoints are not equal to zero, then the function takes
 opposite signs at the endpoints.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>function</code> - Function.</dd><dd><code>lower</code> - Lower endpoint.</dd><dd><code>upper</code> - Upper endpoint.</dd>
<dt><span class="strong">Returns:</span></dt><dd><code>true</code> if the function values have opposite signs at the
 given points.</dd>
<dt><span class="strong">Throws:</span></dt>
<dd><code><a href="../../../../../../org/apache/commons/math3/exception/NullArgumentException.html" title="class in org.apache.commons.math3.exception">NullArgumentException</a></code> - if <code>function</code> is <code>null</code>.</dd></dl>
</li>
</ul>
<a name="isSequence(double, double, double)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>isSequence</h4>
<pre>public static&nbsp;boolean&nbsp;isSequence(double&nbsp;start,
                 double&nbsp;mid,
                 double&nbsp;end)</pre>
<div class="block">Check whether the arguments form a (strictly) increasing sequence.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>start</code> - First number.</dd><dd><code>mid</code> - Second number.</dd><dd><code>end</code> - Third number.</dd>
<dt><span class="strong">Returns:</span></dt><dd><code>true</code> if the arguments form an increasing sequence.</dd></dl>
</li>
</ul>
<a name="verifyInterval(double, double)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>verifyInterval</h4>
<pre>public static&nbsp;void&nbsp;verifyInterval(double&nbsp;lower,
                  double&nbsp;upper)
                           throws <a href="../../../../../../org/apache/commons/math3/exception/NumberIsTooLargeException.html" title="class in org.apache.commons.math3.exception">NumberIsTooLargeException</a></pre>
<div class="block">Check that the endpoints specify an interval.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>lower</code> - Lower endpoint.</dd><dd><code>upper</code> - Upper endpoint.</dd>
<dt><span class="strong">Throws:</span></dt>
<dd><code><a href="../../../../../../org/apache/commons/math3/exception/NumberIsTooLargeException.html" title="class in org.apache.commons.math3.exception">NumberIsTooLargeException</a></code> - if <code>lower &gt;= upper</code>.</dd></dl>
</li>
</ul>
<a name="verifySequence(double, double, double)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>verifySequence</h4>
<pre>public static&nbsp;void&nbsp;verifySequence(double&nbsp;lower,
                  double&nbsp;initial,
                  double&nbsp;upper)
                           throws <a href="../../../../../../org/apache/commons/math3/exception/NumberIsTooLargeException.html" title="class in org.apache.commons.math3.exception">NumberIsTooLargeException</a></pre>
<div class="block">Check that <code>lower &lt; initial &lt; upper</code>.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>lower</code> - Lower endpoint.</dd><dd><code>initial</code> - Initial value.</dd><dd><code>upper</code> - Upper endpoint.</dd>
<dt><span class="strong">Throws:</span></dt>
<dd><code><a href="../../../../../../org/apache/commons/math3/exception/NumberIsTooLargeException.html" title="class in org.apache.commons.math3.exception">NumberIsTooLargeException</a></code> - if <code>lower &gt;= initial</code> or
 <code>initial &gt;= upper</code>.</dd></dl>
</li>
</ul>
<a name="verifyBracketing(org.apache.commons.math3.analysis.UnivariateFunction, double, double)">
<!--   -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>verifyBracketing</h4>
<pre>public static&nbsp;void&nbsp;verifyBracketing(<a href="../../../../../../org/apache/commons/math3/analysis/UnivariateFunction.html" title="interface in org.apache.commons.math3.analysis">UnivariateFunction</a>&nbsp;function,
                    double&nbsp;lower,
                    double&nbsp;upper)
                             throws <a href="../../../../../../org/apache/commons/math3/exception/NullArgumentException.html" title="class in org.apache.commons.math3.exception">NullArgumentException</a>,
                                    <a href="../../../../../../org/apache/commons/math3/exception/NoBracketingException.html" title="class in org.apache.commons.math3.exception">NoBracketingException</a></pre>
<div class="block">Check that the endpoints specify an interval and the end points
 bracket a root.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>function</code> - Function.</dd><dd><code>lower</code> - Lower endpoint.</dd><dd><code>upper</code> - Upper endpoint.</dd>
<dt><span class="strong">Throws:</span></dt>
<dd><code><a href="../../../../../../org/apache/commons/math3/exception/NoBracketingException.html" title="class in org.apache.commons.math3.exception">NoBracketingException</a></code> - if the function has the same sign at the
 endpoints.</dd>
<dd><code><a href="../../../../../../org/apache/commons/math3/exception/NullArgumentException.html" title="class in org.apache.commons.math3.exception">NullArgumentException</a></code> - if <code>function</code> is <code>null</code>.</dd></dl>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
</div>
<!-- ========= END OF CLASS DATA ========= -->
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a name="navbar_bottom">
<!--   -->
</a><a href="#skip-navbar_bottom" title="Skip navigation links"></a><a name="navbar_bottom_firstrow">
<!--   -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="class-use/UnivariateSolverUtils.html">Use</a></li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../../index-all.html">Index</a></li>
<li><a href="../../../../../../help-doc.html">Help</a></li>
</ul>
<div class="aboutLanguage"><em><script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script></em></div>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../../../org/apache/commons/math3/analysis/solvers/UnivariateSolver.html" title="interface in org.apache.commons.math3.analysis.solvers"><span class="strong">Prev Class</span></a></li>
<li>Next Class</li>
</ul>
<ul class="navList">
<li><a href="../../../../../../index.html?org/apache/commons/math3/analysis/solvers/UnivariateSolverUtils.html" target="_top">Frames</a></li>
<li><a href="UnivariateSolverUtils.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../../../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
  allClassesLink = document.getElementById("allclasses_navbar_bottom");
  if(window==top) {
    allClassesLink.style.display = "block";
  }
  else {
    allClassesLink.style.display = "none";
  }
  //-->
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary:&nbsp;</li>
<li>Nested&nbsp;|&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li>Constr&nbsp;|&nbsp;</li>
<li><a href="#method_summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li>Constr&nbsp;|&nbsp;</li>
<li><a href="#method_detail">Method</a></li>
</ul>
</div>
<a name="skip-navbar_bottom">
<!--   -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
<p class="legalCopy"><small>Copyright &#169; 2003&#x2013;2016 <a href="http://www.apache.org/">The Apache Software Foundation</a>. All rights reserved.</small></p>
</body>
</html>