| <!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>MathUtils (Apache Commons Math 3.3 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="MathUtils (Apache Commons Math 3.3 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/MathUtils.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/util/MathArrays.Position.html" title="enum in org.apache.commons.math3.util"><span class="strong">Prev Class</span></a></li> |
| <li><a href="../../../../../org/apache/commons/math3/util/MultidimensionalCounter.html" title="class in org.apache.commons.math3.util"><span class="strong">Next Class</span></a></li> |
| </ul> |
| <ul class="navList"> |
| <li><a href="../../../../../index.html?org/apache/commons/math3/util/MathUtils.html" target="_top">Frames</a></li> |
| <li><a href="MathUtils.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: </li> |
| <li>Nested | </li> |
| <li><a href="#field_summary">Field</a> | </li> |
| <li>Constr | </li> |
| <li><a href="#method_summary">Method</a></li> |
| </ul> |
| <ul class="subNavList"> |
| <li>Detail: </li> |
| <li><a href="#field_detail">Field</a> | </li> |
| <li>Constr | </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.util</div> |
| <h2 title="Class MathUtils" class="title">Class MathUtils</h2> |
| </div> |
| <div class="contentContainer"> |
| <ul class="inheritance"> |
| <li><a href="http://docs.oracle.com/javase/6/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.util.MathUtils</li> |
| </ul> |
| </li> |
| </ul> |
| <div class="description"> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <hr> |
| <br> |
| <pre>public final class <span class="strong">MathUtils</span> |
| extends <a href="http://docs.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a></pre> |
| <div class="block">Miscellaneous utility functions.</div> |
| <dl><dt><span class="strong">Version:</span></dt> |
| <dd>$Id: MathUtils.java 1591835 2014-05-02 09:04:01Z tn $</dd> |
| <dt><span class="strong">See Also:</span></dt><dd><a href="../../../../../org/apache/commons/math3/util/ArithmeticUtils.html" title="class in org.apache.commons.math3.util"><code>ArithmeticUtils</code></a>, |
| <a href="../../../../../org/apache/commons/math3/util/Precision.html" title="class in org.apache.commons.math3.util"><code>Precision</code></a>, |
| <a href="../../../../../org/apache/commons/math3/util/MathArrays.html" title="class in org.apache.commons.math3.util"><code>MathArrays</code></a></dd></dl> |
| </li> |
| </ul> |
| </div> |
| <div class="summary"> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <!-- =========== FIELD SUMMARY =========== --> |
| <ul class="blockList"> |
| <li class="blockList"><a name="field_summary"> |
| <!-- --> |
| </a> |
| <h3>Field Summary</h3> |
| <table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Field Summary table, listing fields, and an explanation"> |
| <caption><span>Fields</span><span class="tabEnd"> </span></caption> |
| <tr> |
| <th class="colFirst" scope="col">Modifier and Type</th> |
| <th class="colLast" scope="col">Field 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/util/MathUtils.html#TWO_PI">TWO_PI</a></strong></code> |
| <div class="block">2 π.</div> |
| </td> |
| </tr> |
| </table> |
| </li> |
| </ul> |
| <!-- ========== 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"> </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 void</code></td> |
| <td class="colLast"><code><strong><a href="../../../../../org/apache/commons/math3/util/MathUtils.html#checkFinite(double)">checkFinite</a></strong>(double x)</code> |
| <div class="block">Check that the argument is a real number.</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/util/MathUtils.html#checkFinite(double[])">checkFinite</a></strong>(double[] val)</code> |
| <div class="block">Check that all the elements are real numbers.</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/util/MathUtils.html#checkNotNull(java.lang.Object)">checkNotNull</a></strong>(<a href="http://docs.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a> o)</code> |
| <div class="block">Checks that an object is not null.</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/util/MathUtils.html#checkNotNull(java.lang.Object, org.apache.commons.math3.exception.util.Localizable, java.lang.Object...)">checkNotNull</a></strong>(<a href="http://docs.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a> o, |
| <a href="../../../../../org/apache/commons/math3/exception/util/Localizable.html" title="interface in org.apache.commons.math3.exception.util">Localizable</a> pattern, |
| <a href="http://docs.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a>... args)</code> |
| <div class="block">Checks that an object is not null.</div> |
| </td> |
| </tr> |
| <tr class="altColor"> |
| <td class="colFirst"><code>static byte</code></td> |
| <td class="colLast"><code><strong><a href="../../../../../org/apache/commons/math3/util/MathUtils.html#copySign(byte, byte)">copySign</a></strong>(byte magnitude, |
| byte sign)</code> |
| <div class="block">Returns the first argument with the sign of the second argument.</div> |
| </td> |
| </tr> |
| <tr class="rowColor"> |
| <td class="colFirst"><code>static int</code></td> |
| <td class="colLast"><code><strong><a href="../../../../../org/apache/commons/math3/util/MathUtils.html#copySign(int, int)">copySign</a></strong>(int magnitude, |
| int sign)</code> |
| <div class="block">Returns the first argument with the sign of the second argument.</div> |
| </td> |
| </tr> |
| <tr class="altColor"> |
| <td class="colFirst"><code>static long</code></td> |
| <td class="colLast"><code><strong><a href="../../../../../org/apache/commons/math3/util/MathUtils.html#copySign(long, long)">copySign</a></strong>(long magnitude, |
| long sign)</code> |
| <div class="block">Returns the first argument with the sign of the second argument.</div> |
| </td> |
| </tr> |
| <tr class="rowColor"> |
| <td class="colFirst"><code>static short</code></td> |
| <td class="colLast"><code><strong><a href="../../../../../org/apache/commons/math3/util/MathUtils.html#copySign(short, short)">copySign</a></strong>(short magnitude, |
| short sign)</code> |
| <div class="block">Returns the first argument with the sign of the second argument.</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/util/MathUtils.html#equals(double, double)">equals</a></strong>(double x, |
| double y)</code> |
| <div class="block">Returns <code>true</code> if the values are equal according to semantics of |
| <a href="http://docs.oracle.com/javase/6/docs/api/java/lang/Double.html?is-external=true#equals(java.lang.Object)" title="class or interface in java.lang"><code>Double.equals(Object)</code></a>.</div> |
| </td> |
| </tr> |
| <tr class="rowColor"> |
| <td class="colFirst"><code>static int</code></td> |
| <td class="colLast"><code><strong><a href="../../../../../org/apache/commons/math3/util/MathUtils.html#hash(double)">hash</a></strong>(double value)</code> |
| <div class="block">Returns an integer hash code representing the given double value.</div> |
| </td> |
| </tr> |
| <tr class="altColor"> |
| <td class="colFirst"><code>static int</code></td> |
| <td class="colLast"><code><strong><a href="../../../../../org/apache/commons/math3/util/MathUtils.html#hash(double[])">hash</a></strong>(double[] value)</code> |
| <div class="block">Returns an integer hash code representing the given double array.</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/util/MathUtils.html#normalizeAngle(double, double)">normalizeAngle</a></strong>(double a, |
| double center)</code> |
| <div class="block">Normalize an angle in a 2π wide interval around a center value.</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/util/MathUtils.html#reduce(double, double, double)">reduce</a></strong>(double a, |
| double period, |
| double offset)</code> |
| <div class="block">Reduce <code>|a - offset|</code> to the primary interval |
| <code>[0, |period|)</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 java.lang.<a href="http://docs.oracle.com/javase/6/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/6/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/6/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/6/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/6/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/6/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/6/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/6/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/6/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/6/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/6/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/6/docs/api/java/lang/Object.html?is-external=true#wait(long, int)" 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"> |
| <!-- ============ FIELD DETAIL =========== --> |
| <ul class="blockList"> |
| <li class="blockList"><a name="field_detail"> |
| <!-- --> |
| </a> |
| <h3>Field Detail</h3> |
| <a name="TWO_PI"> |
| <!-- --> |
| </a> |
| <ul class="blockListLast"> |
| <li class="blockList"> |
| <h4>TWO_PI</h4> |
| <pre>public static final double TWO_PI</pre> |
| <div class="block">2 π.</div> |
| <dl><dt><span class="strong">Since:</span></dt> |
| <dd>2.1</dd> |
| <dt><span class="strong">See Also:</span></dt><dd><a href="../../../../../constant-values.html#org.apache.commons.math3.util.MathUtils.TWO_PI">Constant Field Values</a></dd></dl> |
| </li> |
| </ul> |
| </li> |
| </ul> |
| <!-- ============ METHOD DETAIL ========== --> |
| <ul class="blockList"> |
| <li class="blockList"><a name="method_detail"> |
| <!-- --> |
| </a> |
| <h3>Method Detail</h3> |
| <a name="hash(double)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>hash</h4> |
| <pre>public static int hash(double value)</pre> |
| <div class="block">Returns an integer hash code representing the given double value.</div> |
| <dl><dt><span class="strong">Parameters:</span></dt><dd><code>value</code> - the value to be hashed</dd> |
| <dt><span class="strong">Returns:</span></dt><dd>the hash code</dd></dl> |
| </li> |
| </ul> |
| <a name="equals(double, double)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>equals</h4> |
| <pre>public static boolean equals(double x, |
| double y)</pre> |
| <div class="block">Returns <code>true</code> if the values are equal according to semantics of |
| <a href="http://docs.oracle.com/javase/6/docs/api/java/lang/Double.html?is-external=true#equals(java.lang.Object)" title="class or interface in java.lang"><code>Double.equals(Object)</code></a>.</div> |
| <dl><dt><span class="strong">Parameters:</span></dt><dd><code>x</code> - Value</dd><dd><code>y</code> - Value</dd> |
| <dt><span class="strong">Returns:</span></dt><dd><code>new Double(x).equals(new Double(y))</code></dd></dl> |
| </li> |
| </ul> |
| <a name="hash(double[])"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>hash</h4> |
| <pre>public static int hash(double[] value)</pre> |
| <div class="block">Returns an integer hash code representing the given double array.</div> |
| <dl><dt><span class="strong">Parameters:</span></dt><dd><code>value</code> - the value to be hashed (may be null)</dd> |
| <dt><span class="strong">Returns:</span></dt><dd>the hash code</dd><dt><span class="strong">Since:</span></dt> |
| <dd>1.2</dd></dl> |
| </li> |
| </ul> |
| <a name="normalizeAngle(double, double)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>normalizeAngle</h4> |
| <pre>public static double normalizeAngle(double a, |
| double center)</pre> |
| <div class="block">Normalize an angle in a 2π wide interval around a center value. |
| <p>This method has three main uses:</p> |
| <ul> |
| <li>normalize an angle between 0 and 2π:<br/> |
| <code>a = MathUtils.normalizeAngle(a, FastMath.PI);</code></li> |
| <li>normalize an angle between -π and +π<br/> |
| <code>a = MathUtils.normalizeAngle(a, 0.0);</code></li> |
| <li>compute the angle between two defining angular positions:<br> |
| <code>angle = MathUtils.normalizeAngle(end, start) - start;</code></li> |
| </ul> |
| <p>Note that due to numerical accuracy and since π cannot be represented |
| exactly, the result interval is <em>closed</em>, it cannot be half-closed |
| as would be more satisfactory in a purely mathematical view.</p></div> |
| <dl><dt><span class="strong">Parameters:</span></dt><dd><code>a</code> - angle to normalize</dd><dd><code>center</code> - center of the desired 2π interval for the result</dd> |
| <dt><span class="strong">Returns:</span></dt><dd>a-2kπ with integer k and center-π <= a-2kπ <= center+π</dd><dt><span class="strong">Since:</span></dt> |
| <dd>1.2</dd></dl> |
| </li> |
| </ul> |
| <a name="reduce(double, double, double)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>reduce</h4> |
| <pre>public static double reduce(double a, |
| double period, |
| double offset)</pre> |
| <div class="block"><p>Reduce <code>|a - offset|</code> to the primary interval |
| <code>[0, |period|)</code>.</p> |
| |
| <p>Specifically, the value returned is <br/> |
| <code>a - |period| * floor((a - offset) / |period|) - offset</code>.</p> |
| |
| <p>If any of the parameters are <code>NaN</code> or infinite, the result is |
| <code>NaN</code>.</p></div> |
| <dl><dt><span class="strong">Parameters:</span></dt><dd><code>a</code> - Value to reduce.</dd><dd><code>period</code> - Period.</dd><dd><code>offset</code> - Value that will be mapped to <code>0</code>.</dd> |
| <dt><span class="strong">Returns:</span></dt><dd>the value, within the interval <code>[0 |period|)</code>, |
| that corresponds to <code>a</code>.</dd></dl> |
| </li> |
| </ul> |
| <a name="copySign(byte, byte)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>copySign</h4> |
| <pre>public static byte copySign(byte magnitude, |
| byte sign) |
| throws <a href="../../../../../org/apache/commons/math3/exception/MathArithmeticException.html" title="class in org.apache.commons.math3.exception">MathArithmeticException</a></pre> |
| <div class="block">Returns the first argument with the sign of the second argument.</div> |
| <dl><dt><span class="strong">Parameters:</span></dt><dd><code>magnitude</code> - Magnitude of the returned value.</dd><dd><code>sign</code> - Sign of the returned value.</dd> |
| <dt><span class="strong">Returns:</span></dt><dd>a value with magnitude equal to <code>magnitude</code> and with the |
| same sign as the <code>sign</code> argument.</dd> |
| <dt><span class="strong">Throws:</span></dt> |
| <dd><code><a href="../../../../../org/apache/commons/math3/exception/MathArithmeticException.html" title="class in org.apache.commons.math3.exception">MathArithmeticException</a></code> - if <code>magnitude == Byte.MIN_VALUE</code> |
| and <code>sign >= 0</code>.</dd></dl> |
| </li> |
| </ul> |
| <a name="copySign(short, short)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>copySign</h4> |
| <pre>public static short copySign(short magnitude, |
| short sign) |
| throws <a href="../../../../../org/apache/commons/math3/exception/MathArithmeticException.html" title="class in org.apache.commons.math3.exception">MathArithmeticException</a></pre> |
| <div class="block">Returns the first argument with the sign of the second argument.</div> |
| <dl><dt><span class="strong">Parameters:</span></dt><dd><code>magnitude</code> - Magnitude of the returned value.</dd><dd><code>sign</code> - Sign of the returned value.</dd> |
| <dt><span class="strong">Returns:</span></dt><dd>a value with magnitude equal to <code>magnitude</code> and with the |
| same sign as the <code>sign</code> argument.</dd> |
| <dt><span class="strong">Throws:</span></dt> |
| <dd><code><a href="../../../../../org/apache/commons/math3/exception/MathArithmeticException.html" title="class in org.apache.commons.math3.exception">MathArithmeticException</a></code> - if <code>magnitude == Short.MIN_VALUE</code> |
| and <code>sign >= 0</code>.</dd></dl> |
| </li> |
| </ul> |
| <a name="copySign(int, int)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>copySign</h4> |
| <pre>public static int copySign(int magnitude, |
| int sign) |
| throws <a href="../../../../../org/apache/commons/math3/exception/MathArithmeticException.html" title="class in org.apache.commons.math3.exception">MathArithmeticException</a></pre> |
| <div class="block">Returns the first argument with the sign of the second argument.</div> |
| <dl><dt><span class="strong">Parameters:</span></dt><dd><code>magnitude</code> - Magnitude of the returned value.</dd><dd><code>sign</code> - Sign of the returned value.</dd> |
| <dt><span class="strong">Returns:</span></dt><dd>a value with magnitude equal to <code>magnitude</code> and with the |
| same sign as the <code>sign</code> argument.</dd> |
| <dt><span class="strong">Throws:</span></dt> |
| <dd><code><a href="../../../../../org/apache/commons/math3/exception/MathArithmeticException.html" title="class in org.apache.commons.math3.exception">MathArithmeticException</a></code> - if <code>magnitude == Integer.MIN_VALUE</code> |
| and <code>sign >= 0</code>.</dd></dl> |
| </li> |
| </ul> |
| <a name="copySign(long, long)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>copySign</h4> |
| <pre>public static long copySign(long magnitude, |
| long sign) |
| throws <a href="../../../../../org/apache/commons/math3/exception/MathArithmeticException.html" title="class in org.apache.commons.math3.exception">MathArithmeticException</a></pre> |
| <div class="block">Returns the first argument with the sign of the second argument.</div> |
| <dl><dt><span class="strong">Parameters:</span></dt><dd><code>magnitude</code> - Magnitude of the returned value.</dd><dd><code>sign</code> - Sign of the returned value.</dd> |
| <dt><span class="strong">Returns:</span></dt><dd>a value with magnitude equal to <code>magnitude</code> and with the |
| same sign as the <code>sign</code> argument.</dd> |
| <dt><span class="strong">Throws:</span></dt> |
| <dd><code><a href="../../../../../org/apache/commons/math3/exception/MathArithmeticException.html" title="class in org.apache.commons.math3.exception">MathArithmeticException</a></code> - if <code>magnitude == Long.MIN_VALUE</code> |
| and <code>sign >= 0</code>.</dd></dl> |
| </li> |
| </ul> |
| <a name="checkFinite(double)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>checkFinite</h4> |
| <pre>public static void checkFinite(double x) |
| throws <a href="../../../../../org/apache/commons/math3/exception/NotFiniteNumberException.html" title="class in org.apache.commons.math3.exception">NotFiniteNumberException</a></pre> |
| <div class="block">Check that the argument is a real number.</div> |
| <dl><dt><span class="strong">Parameters:</span></dt><dd><code>x</code> - Argument.</dd> |
| <dt><span class="strong">Throws:</span></dt> |
| <dd><code><a href="../../../../../org/apache/commons/math3/exception/NotFiniteNumberException.html" title="class in org.apache.commons.math3.exception">NotFiniteNumberException</a></code> - if <code>x</code> is not a |
| finite real number.</dd></dl> |
| </li> |
| </ul> |
| <a name="checkFinite(double[])"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>checkFinite</h4> |
| <pre>public static void checkFinite(double[] val) |
| throws <a href="../../../../../org/apache/commons/math3/exception/NotFiniteNumberException.html" title="class in org.apache.commons.math3.exception">NotFiniteNumberException</a></pre> |
| <div class="block">Check that all the elements are real numbers.</div> |
| <dl><dt><span class="strong">Parameters:</span></dt><dd><code>val</code> - Arguments.</dd> |
| <dt><span class="strong">Throws:</span></dt> |
| <dd><code><a href="../../../../../org/apache/commons/math3/exception/NotFiniteNumberException.html" title="class in org.apache.commons.math3.exception">NotFiniteNumberException</a></code> - if any values of the array is not a |
| finite real number.</dd></dl> |
| </li> |
| </ul> |
| <a name="checkNotNull(java.lang.Object, org.apache.commons.math3.exception.util.Localizable, java.lang.Object...)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>checkNotNull</h4> |
| <pre>public static void checkNotNull(<a href="http://docs.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a> o, |
| <a href="../../../../../org/apache/commons/math3/exception/util/Localizable.html" title="interface in org.apache.commons.math3.exception.util">Localizable</a> pattern, |
| <a href="http://docs.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a>... args) |
| throws <a href="../../../../../org/apache/commons/math3/exception/NullArgumentException.html" title="class in org.apache.commons.math3.exception">NullArgumentException</a></pre> |
| <div class="block">Checks that an object is not null.</div> |
| <dl><dt><span class="strong">Parameters:</span></dt><dd><code>o</code> - Object to be checked.</dd><dd><code>pattern</code> - Message pattern.</dd><dd><code>args</code> - Arguments to replace the placeholders in <code>pattern</code>.</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>o</code> is <code>null</code>.</dd></dl> |
| </li> |
| </ul> |
| <a name="checkNotNull(java.lang.Object)"> |
| <!-- --> |
| </a> |
| <ul class="blockListLast"> |
| <li class="blockList"> |
| <h4>checkNotNull</h4> |
| <pre>public static void checkNotNull(<a href="http://docs.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a> o) |
| throws <a href="../../../../../org/apache/commons/math3/exception/NullArgumentException.html" title="class in org.apache.commons.math3.exception">NullArgumentException</a></pre> |
| <div class="block">Checks that an object is not null.</div> |
| <dl><dt><span class="strong">Parameters:</span></dt><dd><code>o</code> - Object to be checked.</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>o</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/MathUtils.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/util/MathArrays.Position.html" title="enum in org.apache.commons.math3.util"><span class="strong">Prev Class</span></a></li> |
| <li><a href="../../../../../org/apache/commons/math3/util/MultidimensionalCounter.html" title="class in org.apache.commons.math3.util"><span class="strong">Next Class</span></a></li> |
| </ul> |
| <ul class="navList"> |
| <li><a href="../../../../../index.html?org/apache/commons/math3/util/MathUtils.html" target="_top">Frames</a></li> |
| <li><a href="MathUtils.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: </li> |
| <li>Nested | </li> |
| <li><a href="#field_summary">Field</a> | </li> |
| <li>Constr | </li> |
| <li><a href="#method_summary">Method</a></li> |
| </ul> |
| <ul class="subNavList"> |
| <li>Detail: </li> |
| <li><a href="#field_detail">Field</a> | </li> |
| <li>Constr | </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 © 2003–2014 <a href="http://www.apache.org/">The Apache Software Foundation</a>. All rights reserved.</small></p> |
| </body> |
| </html> |