Portfolio Code | Clement Colmerauer
Repositories
Site
Rabbit simulation
Code
Commits
Branches
Tags
Search
Tree:
a20104a
Branches
Tags
master
Rabbit simulation
build
colt
doc
api
cern
jet
math
Functions.html
initial commit
Clement COLMERAUER
commited
a20104a
at 2024-09-09 10:17:52
Functions.html
Blame
History
Raw
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!--NewPage--> <HTML> <HEAD> <!-- Generated by javadoc (build 1.4.2_05) on Thu Sep 09 20:36:12 PDT 2004 --> <TITLE> Functions (Colt 1.2.0 - API Specification) </TITLE> <META NAME="keywords" CONTENT="cern.jet.math.Functions class"> <LINK REL ="stylesheet" TYPE="text/css" HREF="../../../stylesheet.css" TITLE="Style"> <SCRIPT type="text/javascript"> function windowTitle() { parent.document.title="Functions (Colt 1.2.0 - API Specification)"; } </SCRIPT> </HEAD> <BODY BGCOLOR="white" onload="windowTitle();"> <!-- ========= START OF TOP NAVBAR ======= --> <A NAME="navbar_top"><!-- --></A> <A HREF="#skip-navbar_top" title="Skip navigation links"></A> <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> <TR> <TD COLSPAN=3 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A NAME="navbar_top_firstrow"><!-- --></A> <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/Functions.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../index-files/index-1.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> </TR> </TABLE> </TD> <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> <b>Colt 1.2.0</b></EM> </TD> </TR> <TR> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../cern/jet/math/Constants.html" title="class in cern.jet.math"><B>PREV CLASS</B></A> <A HREF="../../../cern/jet/math/IntFunctions.html" title="class in cern.jet.math"><B>NEXT CLASS</B></A></FONT></TD> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../index.html" target="_top"><B>FRAMES</B></A> <A HREF="Functions.html" target="_top"><B>NO FRAMES</B></A> <SCRIPT type="text/javascript"> <!-- if(window==top) { document.writeln('<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>'); } //--> </SCRIPT> <NOSCRIPT> <A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A> </NOSCRIPT> </FONT></TD> </TR> <TR> <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> SUMMARY: NESTED | <A HREF="#field_summary">FIELD</A> | CONSTR | <A HREF="#method_summary">METHOD</A></FONT></TD> <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> DETAIL: <A HREF="#field_detail">FIELD</A> | CONSTR | <A HREF="#method_detail">METHOD</A></FONT></TD> </TR> </TABLE> <A NAME="skip-navbar_top"></A> <!-- ========= END OF TOP NAVBAR ========= --> <HR> <!-- ======== START OF CLASS DATA ======== --> <H2> <FONT SIZE="-1"> cern.jet.math</FONT> <BR> Class Functions</H2> <PRE> <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/Object.html" title="class or interface in java.lang">java.lang.Object</A> <IMG SRC="../../../resources/inherit.gif" ALT="extended by"><B>cern.jet.math.Functions</B> </PRE> <HR> <DL> <DT>public class <B>Functions</B><DT>extends <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/Object.html" title="class or interface in java.lang">Object</A></DL> <P> Function objects to be passed to generic methods. Contains the functions of <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/Math.html" title="class or interface in java.lang"><CODE>Math</CODE></A> as function objects, as well as a few more basic functions. <p>Function objects conveniently allow to express arbitrary functions in a generic manner. Essentially, a function object is an object that can perform a function on some arguments. It has a minimal interface: a method <tt>apply</tt> that takes the arguments, computes something and returns some result value. Function objects are comparable to function pointers in C used for call-backs. <p>Unary functions are of type <A HREF="../../../cern/colt/function/DoubleFunction.html" title="interface in cern.colt.function"><CODE>DoubleFunction</CODE></A>, binary functions of type <A HREF="../../../cern/colt/function/DoubleDoubleFunction.html" title="interface in cern.colt.function"><CODE>DoubleDoubleFunction</CODE></A>. All can be retrieved via <tt>public static final</tt> variables named after the function. Unary predicates are of type <A HREF="../../../cern/colt/function/DoubleProcedure.html" title="interface in cern.colt.function"><CODE>DoubleProcedure</CODE></A>, binary predicates of type <A HREF="../../../cern/colt/function/DoubleDoubleProcedure.html" title="interface in cern.colt.function"><CODE>DoubleDoubleProcedure</CODE></A>. All can be retrieved via <tt>public static final</tt> variables named <tt>isXXX</tt>. <p> Binary functions and predicates also exist as unary functions with the second argument being fixed to a constant. These are generated and retrieved via factory methods (again with the same name as the function). Example: <ul> <li><tt>Functions.pow</tt> gives the function <tt>a<sup>b</sup></tt>. <li><tt>Functions.pow.apply(2,3)==8</tt>. <li><tt>Functions.pow(3)</tt> gives the function <tt>a<sup>3</sup></tt>. <li><tt>Functions.pow(3).apply(2)==8</tt>. </ul> More general, any binary function can be made an unary functions by fixing either the first or the second argument. See methods <A HREF="../../../cern/jet/math/Functions.html#bindArg1(cern.colt.function.DoubleDoubleFunction, double)"><CODE>bindArg1(DoubleDoubleFunction,double)</CODE></A> and <A HREF="../../../cern/jet/math/Functions.html#bindArg2(cern.colt.function.DoubleDoubleFunction, double)"><CODE>bindArg2(DoubleDoubleFunction,double)</CODE></A>. The order of arguments can be swapped so that the first argument becomes the second and vice-versa. See method <A HREF="../../../cern/jet/math/Functions.html#swapArgs(cern.colt.function.DoubleDoubleFunction)"><CODE>swapArgs(DoubleDoubleFunction)</CODE></A>. Example: <ul> <li><tt>Functions.pow</tt> gives the function <tt>a<sup>b</sup></tt>. <li><tt>Functions.bindArg2(Functions.pow,3)</tt> gives the function <tt>x<sup>3</sup></tt>. <li><tt>Functions.bindArg1(Functions.pow,3)</tt> gives the function <tt>3<sup>x</sup></tt>. <li><tt>Functions.swapArgs(Functions.pow)</tt> gives the function <tt>b<sup>a</sup></tt>. </ul> <p> Even more general, functions can be chained (composed, assembled). Assume we have two unary functions <tt>g</tt> and <tt>h</tt>. The unary function <tt>g(h(a))</tt> applying both in sequence can be generated via <A HREF="../../../cern/jet/math/Functions.html#chain(cern.colt.function.DoubleFunction, cern.colt.function.DoubleFunction)"><CODE>chain(DoubleFunction,DoubleFunction)</CODE></A>: <ul> <li><tt>Functions.chain(g,h);</tt> </ul> Assume further we have a binary function <tt>f</tt>. The binary function <tt>g(f(a,b))</tt> can be generated via <A HREF="../../../cern/jet/math/Functions.html#chain(cern.colt.function.DoubleFunction, cern.colt.function.DoubleDoubleFunction)"><CODE>chain(DoubleFunction,DoubleDoubleFunction)</CODE></A>: <ul> <li><tt>Functions.chain(g,f);</tt> </ul> The binary function <tt>f(g(a),h(b))</tt> can be generated via <A HREF="../../../cern/jet/math/Functions.html#chain(cern.colt.function.DoubleDoubleFunction, cern.colt.function.DoubleFunction, cern.colt.function.DoubleFunction)"><CODE>chain(DoubleDoubleFunction,DoubleFunction,DoubleFunction)</CODE></A>: <ul> <li><tt>Functions.chain(f,g,h);</tt> </ul> Arbitrarily complex functions can be composed from these building blocks. For example <tt>sin(a) + cos<sup>2</sup>(b)</tt> can be specified as follows: <ul> <li><tt>chain(plus,sin,chain(square,cos));</tt> </ul> or, of course, as <pre> new DoubleDoubleFunction() { public final double apply(double a, double b) { return Math.sin(a) + Math.pow(Math.cos(b),2); } } </pre> <p> For aliasing see <A HREF="../../../cern/jet/math/Functions.html#functions"><CODE>functions</CODE></A>. Try this <table> <td class="PRE"> <pre> // should yield 1.4399560356056456 in all cases double a = 0.5; double b = 0.2; double v = Math.sin(a) + Math.pow(Math.cos(b),2); System.out.println(v); Functions F = Functions.functions; DoubleDoubleFunction f = F.chain(F.plus,F.sin,F.chain(F.square,F.cos)); System.out.println(f.apply(a,b)); DoubleDoubleFunction g = new DoubleDoubleFunction() { public double apply(double a, double b) { return Math.sin(a) + Math.pow(Math.cos(b),2); } }; System.out.println(g.apply(a,b)); </pre> </td> </table> <p> <H3>Performance</H3> Surprise. Using modern non-adaptive JITs such as SunJDK 1.2.2 (java -classic) there seems to be no or only moderate performance penalty in using function objects in a loop over traditional code in a loop. For complex nested function objects (e.g. <tt>F.chain(F.abs,F.chain(F.plus,F.sin,F.chain(F.square,F.cos)))</tt>) the penalty is zero, for trivial functions (e.g. <tt>F.plus</tt>) the penalty is often acceptable. <center> <table border cellpadding="3" cellspacing="0" align="center"> <tr valign="middle" bgcolor="#33CC66" nowrap align="center"> <td nowrap colspan="7"> <font size="+2">Iteration Performance [million function evaluations per second]</font><br> <font size="-1">Pentium Pro 200 Mhz, SunJDK 1.2.2, NT, java -classic, </font></td> </tr> <tr valign="middle" bgcolor="#66CCFF" nowrap align="center"> <td nowrap bgcolor="#FF9966" rowspan="2"> </td> <td bgcolor="#FF9966" colspan="2"> <p> 30000000 iterations</p> </td> <td bgcolor="#FF9966" colspan="2"> 3000000 iterations (10 times less)</td> <td bgcolor="#FF9966" colspan="2"> </td> </tr> <tr valign="middle" bgcolor="#66CCFF" nowrap align="center"> <td bgcolor="#FF9966"> <tt>F.plus</tt></td> <td bgcolor="#FF9966"><tt>a+b</tt></td> <td bgcolor="#FF9966"> <tt>F.chain(F.abs,F.chain(F.plus,F.sin,F.chain(F.square,F.cos)))</tt></td> <td bgcolor="#FF9966"> <tt>Math.abs(Math.sin(a) + Math.pow(Math.cos(b),2))</tt></td> <td bgcolor="#FF9966"> </td> <td bgcolor="#FF9966"> </td> </tr> <tr valign="middle" bgcolor="#66CCFF" nowrap align="center"> <td nowrap bgcolor="#FF9966"> </td> <td nowrap>10.8</td> <td nowrap>29.6</td> <td nowrap>0.43</td> <td nowrap>0.35</td> <td nowrap> </td> <td nowrap> </td> </tr> </table></center> <P> <P> <DL> <DT><B>Version:</B></DT> <DD>1.0, 09/24/99</DD> </DL> <HR> <P> <!-- ======== NESTED CLASS SUMMARY ======== --> <!-- =========== FIELD SUMMARY =========== --> <A NAME="field_summary"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TD COLSPAN=2><FONT SIZE="+2"> <B>Field Summary</B></FONT></TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>static <A HREF="../../../cern/colt/function/DoubleFunction.html" title="interface in cern.colt.function">DoubleFunction</A></CODE></FONT></TD> <TD><CODE><B><A HREF="../../../cern/jet/math/Functions.html#abs">abs</A></B></CODE> <BR> Function that returns <tt>Math.abs(a)</tt>.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>static <A HREF="../../../cern/colt/function/DoubleFunction.html" title="interface in cern.colt.function">DoubleFunction</A></CODE></FONT></TD> <TD><CODE><B><A HREF="../../../cern/jet/math/Functions.html#acos">acos</A></B></CODE> <BR> Function that returns <tt>Math.acos(a)</tt>.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>static <A HREF="../../../cern/colt/function/DoubleFunction.html" title="interface in cern.colt.function">DoubleFunction</A></CODE></FONT></TD> <TD><CODE><B><A HREF="../../../cern/jet/math/Functions.html#asin">asin</A></B></CODE> <BR> Function that returns <tt>Math.asin(a)</tt>.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>static <A HREF="../../../cern/colt/function/DoubleFunction.html" title="interface in cern.colt.function">DoubleFunction</A></CODE></FONT></TD> <TD><CODE><B><A HREF="../../../cern/jet/math/Functions.html#atan">atan</A></B></CODE> <BR> Function that returns <tt>Math.atan(a)</tt>.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>static <A HREF="../../../cern/colt/function/DoubleDoubleFunction.html" title="interface in cern.colt.function">DoubleDoubleFunction</A></CODE></FONT></TD> <TD><CODE><B><A HREF="../../../cern/jet/math/Functions.html#atan2">atan2</A></B></CODE> <BR> Function that returns <tt>Math.atan2(a,b)</tt>.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>static <A HREF="../../../cern/colt/function/DoubleFunction.html" title="interface in cern.colt.function">DoubleFunction</A></CODE></FONT></TD> <TD><CODE><B><A HREF="../../../cern/jet/math/Functions.html#ceil">ceil</A></B></CODE> <BR> Function that returns <tt>Math.ceil(a)</tt>.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>static <A HREF="../../../cern/colt/function/DoubleDoubleFunction.html" title="interface in cern.colt.function">DoubleDoubleFunction</A></CODE></FONT></TD> <TD><CODE><B><A HREF="../../../cern/jet/math/Functions.html#compare">compare</A></B></CODE> <BR> Function that returns <tt>a < b ? -1 : a > b ? 1 : 0</tt>.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>static <A HREF="../../../cern/colt/function/DoubleFunction.html" title="interface in cern.colt.function">DoubleFunction</A></CODE></FONT></TD> <TD><CODE><B><A HREF="../../../cern/jet/math/Functions.html#cos">cos</A></B></CODE> <BR> Function that returns <tt>Math.cos(a)</tt>.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>static <A HREF="../../../cern/colt/function/DoubleDoubleFunction.html" title="interface in cern.colt.function">DoubleDoubleFunction</A></CODE></FONT></TD> <TD><CODE><B><A HREF="../../../cern/jet/math/Functions.html#div">div</A></B></CODE> <BR> Function that returns <tt>a / b</tt>.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>static <A HREF="../../../cern/colt/function/DoubleDoubleFunction.html" title="interface in cern.colt.function">DoubleDoubleFunction</A></CODE></FONT></TD> <TD><CODE><B><A HREF="../../../cern/jet/math/Functions.html#equals">equals</A></B></CODE> <BR> Function that returns <tt>a == b ? 1 : 0</tt>.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>static <A HREF="../../../cern/colt/function/DoubleFunction.html" title="interface in cern.colt.function">DoubleFunction</A></CODE></FONT></TD> <TD><CODE><B><A HREF="../../../cern/jet/math/Functions.html#exp">exp</A></B></CODE> <BR> Function that returns <tt>Math.exp(a)</tt>.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>static <A HREF="../../../cern/colt/function/DoubleFunction.html" title="interface in cern.colt.function">DoubleFunction</A></CODE></FONT></TD> <TD><CODE><B><A HREF="../../../cern/jet/math/Functions.html#floor">floor</A></B></CODE> <BR> Function that returns <tt>Math.floor(a)</tt>.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>static <A HREF="../../../cern/jet/math/Functions.html" title="class in cern.jet.math">Functions</A></CODE></FONT></TD> <TD><CODE><B><A HREF="../../../cern/jet/math/Functions.html#functions">functions</A></B></CODE> <BR> Little trick to allow for "aliasing", that is, renaming this class.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>static <A HREF="../../../cern/colt/function/DoubleDoubleFunction.html" title="interface in cern.colt.function">DoubleDoubleFunction</A></CODE></FONT></TD> <TD><CODE><B><A HREF="../../../cern/jet/math/Functions.html#greater">greater</A></B></CODE> <BR> Function that returns <tt>a > b ? 1 : 0</tt>.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>static <A HREF="../../../cern/colt/function/DoubleFunction.html" title="interface in cern.colt.function">DoubleFunction</A></CODE></FONT></TD> <TD><CODE><B><A HREF="../../../cern/jet/math/Functions.html#identity">identity</A></B></CODE> <BR> Function that returns its argument.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>static <A HREF="../../../cern/colt/function/DoubleDoubleFunction.html" title="interface in cern.colt.function">DoubleDoubleFunction</A></CODE></FONT></TD> <TD><CODE><B><A HREF="../../../cern/jet/math/Functions.html#IEEEremainder">IEEEremainder</A></B></CODE> <BR> Function that returns <tt>Math.IEEEremainder(a,b)</tt>.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>static <A HREF="../../../cern/colt/function/DoubleFunction.html" title="interface in cern.colt.function">DoubleFunction</A></CODE></FONT></TD> <TD><CODE><B><A HREF="../../../cern/jet/math/Functions.html#inv">inv</A></B></CODE> <BR> Function that returns <tt>1.0 / a</tt>.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>static <A HREF="../../../cern/colt/function/DoubleDoubleProcedure.html" title="interface in cern.colt.function">DoubleDoubleProcedure</A></CODE></FONT></TD> <TD><CODE><B><A HREF="../../../cern/jet/math/Functions.html#isEqual">isEqual</A></B></CODE> <BR> Function that returns <tt>a == b</tt>.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>static <A HREF="../../../cern/colt/function/DoubleDoubleProcedure.html" title="interface in cern.colt.function">DoubleDoubleProcedure</A></CODE></FONT></TD> <TD><CODE><B><A HREF="../../../cern/jet/math/Functions.html#isGreater">isGreater</A></B></CODE> <BR> Function that returns <tt>a > b</tt>.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>static <A HREF="../../../cern/colt/function/DoubleDoubleProcedure.html" title="interface in cern.colt.function">DoubleDoubleProcedure</A></CODE></FONT></TD> <TD><CODE><B><A HREF="../../../cern/jet/math/Functions.html#isLess">isLess</A></B></CODE> <BR> Function that returns <tt>a < b</tt>.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>static <A HREF="../../../cern/colt/function/DoubleDoubleFunction.html" title="interface in cern.colt.function">DoubleDoubleFunction</A></CODE></FONT></TD> <TD><CODE><B><A HREF="../../../cern/jet/math/Functions.html#less">less</A></B></CODE> <BR> Function that returns <tt>a < b ? 1 : 0</tt>.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>static <A HREF="../../../cern/colt/function/DoubleDoubleFunction.html" title="interface in cern.colt.function">DoubleDoubleFunction</A></CODE></FONT></TD> <TD><CODE><B><A HREF="../../../cern/jet/math/Functions.html#lg">lg</A></B></CODE> <BR> Function that returns <tt>Math.log(a) / Math.log(b)</tt>.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>static <A HREF="../../../cern/colt/function/DoubleFunction.html" title="interface in cern.colt.function">DoubleFunction</A></CODE></FONT></TD> <TD><CODE><B><A HREF="../../../cern/jet/math/Functions.html#log">log</A></B></CODE> <BR> Function that returns <tt>Math.log(a)</tt>.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>static <A HREF="../../../cern/colt/function/DoubleFunction.html" title="interface in cern.colt.function">DoubleFunction</A></CODE></FONT></TD> <TD><CODE><B><A HREF="../../../cern/jet/math/Functions.html#log2">log2</A></B></CODE> <BR> Function that returns <tt>Math.log(a) / Math.log(2)</tt>.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>static <A HREF="../../../cern/colt/function/DoubleDoubleFunction.html" title="interface in cern.colt.function">DoubleDoubleFunction</A></CODE></FONT></TD> <TD><CODE><B><A HREF="../../../cern/jet/math/Functions.html#max">max</A></B></CODE> <BR> Function that returns <tt>Math.max(a,b)</tt>.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>static <A HREF="../../../cern/colt/function/DoubleDoubleFunction.html" title="interface in cern.colt.function">DoubleDoubleFunction</A></CODE></FONT></TD> <TD><CODE><B><A HREF="../../../cern/jet/math/Functions.html#min">min</A></B></CODE> <BR> Function that returns <tt>Math.min(a,b)</tt>.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>static <A HREF="../../../cern/colt/function/DoubleDoubleFunction.html" title="interface in cern.colt.function">DoubleDoubleFunction</A></CODE></FONT></TD> <TD><CODE><B><A HREF="../../../cern/jet/math/Functions.html#minus">minus</A></B></CODE> <BR> Function that returns <tt>a - b</tt>.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>static <A HREF="../../../cern/colt/function/DoubleDoubleFunction.html" title="interface in cern.colt.function">DoubleDoubleFunction</A></CODE></FONT></TD> <TD><CODE><B><A HREF="../../../cern/jet/math/Functions.html#mod">mod</A></B></CODE> <BR> Function that returns <tt>a % b</tt>.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>static <A HREF="../../../cern/colt/function/DoubleDoubleFunction.html" title="interface in cern.colt.function">DoubleDoubleFunction</A></CODE></FONT></TD> <TD><CODE><B><A HREF="../../../cern/jet/math/Functions.html#mult">mult</A></B></CODE> <BR> Function that returns <tt>a * b</tt>.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>static <A HREF="../../../cern/colt/function/DoubleFunction.html" title="interface in cern.colt.function">DoubleFunction</A></CODE></FONT></TD> <TD><CODE><B><A HREF="../../../cern/jet/math/Functions.html#neg">neg</A></B></CODE> <BR> Function that returns <tt>-a</tt>.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>static <A HREF="../../../cern/colt/function/DoubleDoubleFunction.html" title="interface in cern.colt.function">DoubleDoubleFunction</A></CODE></FONT></TD> <TD><CODE><B><A HREF="../../../cern/jet/math/Functions.html#plus">plus</A></B></CODE> <BR> Function that returns <tt>a + b</tt>.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>static <A HREF="../../../cern/colt/function/DoubleDoubleFunction.html" title="interface in cern.colt.function">DoubleDoubleFunction</A></CODE></FONT></TD> <TD><CODE><B><A HREF="../../../cern/jet/math/Functions.html#plusAbs">plusAbs</A></B></CODE> <BR> Function that returns <tt>Math.abs(a) + Math.abs(b)</tt>.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>static <A HREF="../../../cern/colt/function/DoubleDoubleFunction.html" title="interface in cern.colt.function">DoubleDoubleFunction</A></CODE></FONT></TD> <TD><CODE><B><A HREF="../../../cern/jet/math/Functions.html#pow">pow</A></B></CODE> <BR> Function that returns <tt>Math.pow(a,b)</tt>.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>static <A HREF="../../../cern/colt/function/DoubleFunction.html" title="interface in cern.colt.function">DoubleFunction</A></CODE></FONT></TD> <TD><CODE><B><A HREF="../../../cern/jet/math/Functions.html#rint">rint</A></B></CODE> <BR> Function that returns <tt>Math.rint(a)</tt>.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>static <A HREF="../../../cern/colt/function/DoubleFunction.html" title="interface in cern.colt.function">DoubleFunction</A></CODE></FONT></TD> <TD><CODE><B><A HREF="../../../cern/jet/math/Functions.html#sign">sign</A></B></CODE> <BR> Function that returns <tt>a < 0 ? -1 : a > 0 ? 1 : 0</tt>.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>static <A HREF="../../../cern/colt/function/DoubleFunction.html" title="interface in cern.colt.function">DoubleFunction</A></CODE></FONT></TD> <TD><CODE><B><A HREF="../../../cern/jet/math/Functions.html#sin">sin</A></B></CODE> <BR> Function that returns <tt>Math.sin(a)</tt>.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>static <A HREF="../../../cern/colt/function/DoubleFunction.html" title="interface in cern.colt.function">DoubleFunction</A></CODE></FONT></TD> <TD><CODE><B><A HREF="../../../cern/jet/math/Functions.html#sqrt">sqrt</A></B></CODE> <BR> Function that returns <tt>Math.sqrt(a)</tt>.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>static <A HREF="../../../cern/colt/function/DoubleFunction.html" title="interface in cern.colt.function">DoubleFunction</A></CODE></FONT></TD> <TD><CODE><B><A HREF="../../../cern/jet/math/Functions.html#square">square</A></B></CODE> <BR> Function that returns <tt>a * a</tt>.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>static <A HREF="../../../cern/colt/function/DoubleFunction.html" title="interface in cern.colt.function">DoubleFunction</A></CODE></FONT></TD> <TD><CODE><B><A HREF="../../../cern/jet/math/Functions.html#tan">tan</A></B></CODE> <BR> Function that returns <tt>Math.tan(a)</tt>.</TD> </TR> </TABLE> <!-- ======== CONSTRUCTOR SUMMARY ======== --> <!-- ========== METHOD SUMMARY =========== --> <A NAME="method_summary"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TD COLSPAN=2><FONT SIZE="+2"> <B>Method Summary</B></FONT></TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>static <A HREF="../../../cern/colt/function/DoubleFunction.html" title="interface in cern.colt.function">DoubleFunction</A></CODE></FONT></TD> <TD><CODE><B><A HREF="../../../cern/jet/math/Functions.html#between(double, double)">between</A></B>(double from, double to)</CODE> <BR> Constructs a function that returns <tt>(from<=a && a<=to) ? 1 : 0</tt>.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>static <A HREF="../../../cern/colt/function/DoubleFunction.html" title="interface in cern.colt.function">DoubleFunction</A></CODE></FONT></TD> <TD><CODE><B><A HREF="../../../cern/jet/math/Functions.html#bindArg1(cern.colt.function.DoubleDoubleFunction, double)">bindArg1</A></B>(<A HREF="../../../cern/colt/function/DoubleDoubleFunction.html" title="interface in cern.colt.function">DoubleDoubleFunction</A> function, double c)</CODE> <BR> Constructs a unary function from a binary function with the first operand (argument) fixed to the given constant <tt>c</tt>.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>static <A HREF="../../../cern/colt/function/DoubleFunction.html" title="interface in cern.colt.function">DoubleFunction</A></CODE></FONT></TD> <TD><CODE><B><A HREF="../../../cern/jet/math/Functions.html#bindArg2(cern.colt.function.DoubleDoubleFunction, double)">bindArg2</A></B>(<A HREF="../../../cern/colt/function/DoubleDoubleFunction.html" title="interface in cern.colt.function">DoubleDoubleFunction</A> function, double c)</CODE> <BR> Constructs a unary function from a binary function with the second operand (argument) fixed to the given constant <tt>c</tt>.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>static <A HREF="../../../cern/colt/function/DoubleDoubleFunction.html" title="interface in cern.colt.function">DoubleDoubleFunction</A></CODE></FONT></TD> <TD><CODE><B><A HREF="../../../cern/jet/math/Functions.html#chain(cern.colt.function.DoubleDoubleFunction, cern.colt.function.DoubleFunction, cern.colt.function.DoubleFunction)">chain</A></B>(<A HREF="../../../cern/colt/function/DoubleDoubleFunction.html" title="interface in cern.colt.function">DoubleDoubleFunction</A> f, <A HREF="../../../cern/colt/function/DoubleFunction.html" title="interface in cern.colt.function">DoubleFunction</A> g, <A HREF="../../../cern/colt/function/DoubleFunction.html" title="interface in cern.colt.function">DoubleFunction</A> h)</CODE> <BR> Constructs the function <tt>f( g(a), h(b) )</tt>.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>static <A HREF="../../../cern/colt/function/DoubleDoubleFunction.html" title="interface in cern.colt.function">DoubleDoubleFunction</A></CODE></FONT></TD> <TD><CODE><B><A HREF="../../../cern/jet/math/Functions.html#chain(cern.colt.function.DoubleFunction, cern.colt.function.DoubleDoubleFunction)">chain</A></B>(<A HREF="../../../cern/colt/function/DoubleFunction.html" title="interface in cern.colt.function">DoubleFunction</A> g, <A HREF="../../../cern/colt/function/DoubleDoubleFunction.html" title="interface in cern.colt.function">DoubleDoubleFunction</A> h)</CODE> <BR> Constructs the function <tt>g( h(a,b) )</tt>.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>static <A HREF="../../../cern/colt/function/DoubleFunction.html" title="interface in cern.colt.function">DoubleFunction</A></CODE></FONT></TD> <TD><CODE><B><A HREF="../../../cern/jet/math/Functions.html#chain(cern.colt.function.DoubleFunction, cern.colt.function.DoubleFunction)">chain</A></B>(<A HREF="../../../cern/colt/function/DoubleFunction.html" title="interface in cern.colt.function">DoubleFunction</A> g, <A HREF="../../../cern/colt/function/DoubleFunction.html" title="interface in cern.colt.function">DoubleFunction</A> h)</CODE> <BR> Constructs the function <tt>g( h(a) )</tt>.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>static <A HREF="../../../cern/colt/function/DoubleFunction.html" title="interface in cern.colt.function">DoubleFunction</A></CODE></FONT></TD> <TD><CODE><B><A HREF="../../../cern/jet/math/Functions.html#compare(double)">compare</A></B>(double b)</CODE> <BR> Constructs a function that returns <tt>a < b ? -1 : a > b ? 1 : 0</tt>.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>static <A HREF="../../../cern/colt/function/DoubleFunction.html" title="interface in cern.colt.function">DoubleFunction</A></CODE></FONT></TD> <TD><CODE><B><A HREF="../../../cern/jet/math/Functions.html#constant(double)">constant</A></B>(double c)</CODE> <BR> Constructs a function that returns the constant <tt>c</tt>.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>static void</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../cern/jet/math/Functions.html#demo1()">demo1</A></B>()</CODE> <BR> Demonstrates usage of this class.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>static void</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../cern/jet/math/Functions.html#demo2(int)">demo2</A></B>(int size)</CODE> <BR> Benchmarks and demonstrates usage of trivial and complex functions.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>static <A HREF="../../../cern/colt/function/DoubleFunction.html" title="interface in cern.colt.function">DoubleFunction</A></CODE></FONT></TD> <TD><CODE><B><A HREF="../../../cern/jet/math/Functions.html#div(double)">div</A></B>(double b)</CODE> <BR> Constructs a function that returns <tt>a / b</tt>.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>static <A HREF="../../../cern/colt/function/DoubleFunction.html" title="interface in cern.colt.function">DoubleFunction</A></CODE></FONT></TD> <TD><CODE><B><A HREF="../../../cern/jet/math/Functions.html#equals(double)">equals</A></B>(double b)</CODE> <BR> Constructs a function that returns <tt>a == b ? 1 : 0</tt>.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>static <A HREF="../../../cern/colt/function/DoubleFunction.html" title="interface in cern.colt.function">DoubleFunction</A></CODE></FONT></TD> <TD><CODE><B><A HREF="../../../cern/jet/math/Functions.html#greater(double)">greater</A></B>(double b)</CODE> <BR> Constructs a function that returns <tt>a > b ? 1 : 0</tt>.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>static <A HREF="../../../cern/colt/function/DoubleFunction.html" title="interface in cern.colt.function">DoubleFunction</A></CODE></FONT></TD> <TD><CODE><B><A HREF="../../../cern/jet/math/Functions.html#IEEEremainder(double)">IEEEremainder</A></B>(double b)</CODE> <BR> Constructs a function that returns <tt>Math.IEEEremainder(a,b)</tt>.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>static <A HREF="../../../cern/colt/function/DoubleProcedure.html" title="interface in cern.colt.function">DoubleProcedure</A></CODE></FONT></TD> <TD><CODE><B><A HREF="../../../cern/jet/math/Functions.html#isBetween(double, double)">isBetween</A></B>(double from, double to)</CODE> <BR> Constructs a function that returns <tt>from<=a && a<=to</tt>.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>static <A HREF="../../../cern/colt/function/DoubleProcedure.html" title="interface in cern.colt.function">DoubleProcedure</A></CODE></FONT></TD> <TD><CODE><B><A HREF="../../../cern/jet/math/Functions.html#isEqual(double)">isEqual</A></B>(double b)</CODE> <BR> Constructs a function that returns <tt>a == b</tt>.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>static <A HREF="../../../cern/colt/function/DoubleProcedure.html" title="interface in cern.colt.function">DoubleProcedure</A></CODE></FONT></TD> <TD><CODE><B><A HREF="../../../cern/jet/math/Functions.html#isGreater(double)">isGreater</A></B>(double b)</CODE> <BR> Constructs a function that returns <tt>a > b</tt>.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>static <A HREF="../../../cern/colt/function/DoubleProcedure.html" title="interface in cern.colt.function">DoubleProcedure</A></CODE></FONT></TD> <TD><CODE><B><A HREF="../../../cern/jet/math/Functions.html#isLess(double)">isLess</A></B>(double b)</CODE> <BR> Constructs a function that returns <tt>a < b</tt>.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>static <A HREF="../../../cern/colt/function/DoubleFunction.html" title="interface in cern.colt.function">DoubleFunction</A></CODE></FONT></TD> <TD><CODE><B><A HREF="../../../cern/jet/math/Functions.html#less(double)">less</A></B>(double b)</CODE> <BR> Constructs a function that returns <tt>a < b ? 1 : 0</tt>.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>static <A HREF="../../../cern/colt/function/DoubleFunction.html" title="interface in cern.colt.function">DoubleFunction</A></CODE></FONT></TD> <TD><CODE><B><A HREF="../../../cern/jet/math/Functions.html#lg(double)">lg</A></B>(double b)</CODE> <BR> Constructs a function that returns <tt><tt>Math.log(a) / Math.log(b)</tt></tt>.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>static <A HREF="../../../cern/colt/function/DoubleFunction.html" title="interface in cern.colt.function">DoubleFunction</A></CODE></FONT></TD> <TD><CODE><B><A HREF="../../../cern/jet/math/Functions.html#max(double)">max</A></B>(double b)</CODE> <BR> Constructs a function that returns <tt>Math.max(a,b)</tt>.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>static <A HREF="../../../cern/colt/function/DoubleFunction.html" title="interface in cern.colt.function">DoubleFunction</A></CODE></FONT></TD> <TD><CODE><B><A HREF="../../../cern/jet/math/Functions.html#min(double)">min</A></B>(double b)</CODE> <BR> Constructs a function that returns <tt>Math.min(a,b)</tt>.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>static <A HREF="../../../cern/colt/function/DoubleFunction.html" title="interface in cern.colt.function">DoubleFunction</A></CODE></FONT></TD> <TD><CODE><B><A HREF="../../../cern/jet/math/Functions.html#minus(double)">minus</A></B>(double b)</CODE> <BR> Constructs a function that returns <tt>a - b</tt>.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>static <A HREF="../../../cern/colt/function/DoubleDoubleFunction.html" title="interface in cern.colt.function">DoubleDoubleFunction</A></CODE></FONT></TD> <TD><CODE><B><A HREF="../../../cern/jet/math/Functions.html#minusMult(double)">minusMult</A></B>(double constant)</CODE> <BR> Constructs a function that returns <tt>a - b*constant</tt>.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>static <A HREF="../../../cern/colt/function/DoubleFunction.html" title="interface in cern.colt.function">DoubleFunction</A></CODE></FONT></TD> <TD><CODE><B><A HREF="../../../cern/jet/math/Functions.html#mod(double)">mod</A></B>(double b)</CODE> <BR> Constructs a function that returns <tt>a % b</tt>.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>static <A HREF="../../../cern/colt/function/DoubleFunction.html" title="interface in cern.colt.function">DoubleFunction</A></CODE></FONT></TD> <TD><CODE><B><A HREF="../../../cern/jet/math/Functions.html#mult(double)">mult</A></B>(double b)</CODE> <BR> Constructs a function that returns <tt>a * b</tt>.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>static <A HREF="../../../cern/colt/function/DoubleFunction.html" title="interface in cern.colt.function">DoubleFunction</A></CODE></FONT></TD> <TD><CODE><B><A HREF="../../../cern/jet/math/Functions.html#plus(double)">plus</A></B>(double b)</CODE> <BR> Constructs a function that returns <tt>a + b</tt>.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>static <A HREF="../../../cern/colt/function/DoubleDoubleFunction.html" title="interface in cern.colt.function">DoubleDoubleFunction</A></CODE></FONT></TD> <TD><CODE><B><A HREF="../../../cern/jet/math/Functions.html#plusMult(double)">plusMult</A></B>(double constant)</CODE> <BR> Constructs a function that returns <tt>a + b*constant</tt>.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>static <A HREF="../../../cern/colt/function/DoubleFunction.html" title="interface in cern.colt.function">DoubleFunction</A></CODE></FONT></TD> <TD><CODE><B><A HREF="../../../cern/jet/math/Functions.html#pow(double)">pow</A></B>(double b)</CODE> <BR> Constructs a function that returns <tt>Math.pow(a,b)</tt>.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>static <A HREF="../../../cern/colt/function/DoubleFunction.html" title="interface in cern.colt.function">DoubleFunction</A></CODE></FONT></TD> <TD><CODE><B><A HREF="../../../cern/jet/math/Functions.html#random()">random</A></B>()</CODE> <BR> Constructs a function that returns a new uniform random number in the open unit interval <code>(0.0,1.0)</code> (excluding 0.0 and 1.0).</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>static <A HREF="../../../cern/colt/function/DoubleFunction.html" title="interface in cern.colt.function">DoubleFunction</A></CODE></FONT></TD> <TD><CODE><B><A HREF="../../../cern/jet/math/Functions.html#round(double)">round</A></B>(double precision)</CODE> <BR> Constructs a function that returns the number rounded to the given precision; <tt>Math.rint(a/precision)*precision</tt>.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>static <A HREF="../../../cern/colt/function/DoubleDoubleFunction.html" title="interface in cern.colt.function">DoubleDoubleFunction</A></CODE></FONT></TD> <TD><CODE><B><A HREF="../../../cern/jet/math/Functions.html#swapArgs(cern.colt.function.DoubleDoubleFunction)">swapArgs</A></B>(<A HREF="../../../cern/colt/function/DoubleDoubleFunction.html" title="interface in cern.colt.function">DoubleDoubleFunction</A> function)</CODE> <BR> Constructs a function that returns <tt>function.apply(b,a)</tt>, i.e.</TD> </TR> </TABLE> <A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"> <TD><B>Methods inherited from class java.lang.<A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/Object.html" title="class or interface in java.lang">Object</A></B></TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD><CODE><A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/Object.html#equals(java.lang.Object)" title="class or interface in java.lang">equals</A>, <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/Object.html#getClass()" title="class or interface in java.lang">getClass</A>, <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/Object.html#hashCode()" title="class or interface in java.lang">hashCode</A>, <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/Object.html#notify()" title="class or interface in java.lang">notify</A>, <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/Object.html#notifyAll()" title="class or interface in java.lang">notifyAll</A>, <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/Object.html#toString()" title="class or interface in java.lang">toString</A>, <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/Object.html#wait()" title="class or interface in java.lang">wait</A>, <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/Object.html#wait(long)" title="class or interface in java.lang">wait</A>, <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/Object.html#wait(long, int)" title="class or interface in java.lang">wait</A></CODE></TD> </TR> </TABLE> <P> <!-- ============ FIELD DETAIL =========== --> <A NAME="field_detail"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TD COLSPAN=1><FONT SIZE="+2"> <B>Field Detail</B></FONT></TD> </TR> </TABLE> <A NAME="functions"><!-- --></A><H3> functions</H3> <PRE> public static final <A HREF="../../../cern/jet/math/Functions.html" title="class in cern.jet.math">Functions</A> <B>functions</B></PRE> <DL> <DD>Little trick to allow for "aliasing", that is, renaming this class. Writing code like <p> <tt>Functions.chain(Functions.plus,Functions.sin,Functions.chain(Functions.square,Functions.cos));</tt> <p> is a bit awkward, to say the least. Using the aliasing you can instead write <p> <tt>Functions F = Functions.functions; <br> F.chain(F.plus,F.sin,F.chain(F.square,F.cos));</tt> <P> <DL> </DL> </DL> <HR> <A NAME="abs"><!-- --></A><H3> abs</H3> <PRE> public static final <A HREF="../../../cern/colt/function/DoubleFunction.html" title="interface in cern.colt.function">DoubleFunction</A> <B>abs</B></PRE> <DL> <DD>Function that returns <tt>Math.abs(a)</tt>. <P> <DL> </DL> </DL> <HR> <A NAME="acos"><!-- --></A><H3> acos</H3> <PRE> public static final <A HREF="../../../cern/colt/function/DoubleFunction.html" title="interface in cern.colt.function">DoubleFunction</A> <B>acos</B></PRE> <DL> <DD>Function that returns <tt>Math.acos(a)</tt>. <P> <DL> </DL> </DL> <HR> <A NAME="asin"><!-- --></A><H3> asin</H3> <PRE> public static final <A HREF="../../../cern/colt/function/DoubleFunction.html" title="interface in cern.colt.function">DoubleFunction</A> <B>asin</B></PRE> <DL> <DD>Function that returns <tt>Math.asin(a)</tt>. <P> <DL> </DL> </DL> <HR> <A NAME="atan"><!-- --></A><H3> atan</H3> <PRE> public static final <A HREF="../../../cern/colt/function/DoubleFunction.html" title="interface in cern.colt.function">DoubleFunction</A> <B>atan</B></PRE> <DL> <DD>Function that returns <tt>Math.atan(a)</tt>. <P> <DL> </DL> </DL> <HR> <A NAME="ceil"><!-- --></A><H3> ceil</H3> <PRE> public static final <A HREF="../../../cern/colt/function/DoubleFunction.html" title="interface in cern.colt.function">DoubleFunction</A> <B>ceil</B></PRE> <DL> <DD>Function that returns <tt>Math.ceil(a)</tt>. <P> <DL> </DL> </DL> <HR> <A NAME="cos"><!-- --></A><H3> cos</H3> <PRE> public static final <A HREF="../../../cern/colt/function/DoubleFunction.html" title="interface in cern.colt.function">DoubleFunction</A> <B>cos</B></PRE> <DL> <DD>Function that returns <tt>Math.cos(a)</tt>. <P> <DL> </DL> </DL> <HR> <A NAME="exp"><!-- --></A><H3> exp</H3> <PRE> public static final <A HREF="../../../cern/colt/function/DoubleFunction.html" title="interface in cern.colt.function">DoubleFunction</A> <B>exp</B></PRE> <DL> <DD>Function that returns <tt>Math.exp(a)</tt>. <P> <DL> </DL> </DL> <HR> <A NAME="floor"><!-- --></A><H3> floor</H3> <PRE> public static final <A HREF="../../../cern/colt/function/DoubleFunction.html" title="interface in cern.colt.function">DoubleFunction</A> <B>floor</B></PRE> <DL> <DD>Function that returns <tt>Math.floor(a)</tt>. <P> <DL> </DL> </DL> <HR> <A NAME="identity"><!-- --></A><H3> identity</H3> <PRE> public static final <A HREF="../../../cern/colt/function/DoubleFunction.html" title="interface in cern.colt.function">DoubleFunction</A> <B>identity</B></PRE> <DL> <DD>Function that returns its argument. <P> <DL> </DL> </DL> <HR> <A NAME="inv"><!-- --></A><H3> inv</H3> <PRE> public static final <A HREF="../../../cern/colt/function/DoubleFunction.html" title="interface in cern.colt.function">DoubleFunction</A> <B>inv</B></PRE> <DL> <DD>Function that returns <tt>1.0 / a</tt>. <P> <DL> </DL> </DL> <HR> <A NAME="log"><!-- --></A><H3> log</H3> <PRE> public static final <A HREF="../../../cern/colt/function/DoubleFunction.html" title="interface in cern.colt.function">DoubleFunction</A> <B>log</B></PRE> <DL> <DD>Function that returns <tt>Math.log(a)</tt>. <P> <DL> </DL> </DL> <HR> <A NAME="log2"><!-- --></A><H3> log2</H3> <PRE> public static final <A HREF="../../../cern/colt/function/DoubleFunction.html" title="interface in cern.colt.function">DoubleFunction</A> <B>log2</B></PRE> <DL> <DD>Function that returns <tt>Math.log(a) / Math.log(2)</tt>. <P> <DL> </DL> </DL> <HR> <A NAME="neg"><!-- --></A><H3> neg</H3> <PRE> public static final <A HREF="../../../cern/colt/function/DoubleFunction.html" title="interface in cern.colt.function">DoubleFunction</A> <B>neg</B></PRE> <DL> <DD>Function that returns <tt>-a</tt>. <P> <DL> </DL> </DL> <HR> <A NAME="rint"><!-- --></A><H3> rint</H3> <PRE> public static final <A HREF="../../../cern/colt/function/DoubleFunction.html" title="interface in cern.colt.function">DoubleFunction</A> <B>rint</B></PRE> <DL> <DD>Function that returns <tt>Math.rint(a)</tt>. <P> <DL> </DL> </DL> <HR> <A NAME="sign"><!-- --></A><H3> sign</H3> <PRE> public static final <A HREF="../../../cern/colt/function/DoubleFunction.html" title="interface in cern.colt.function">DoubleFunction</A> <B>sign</B></PRE> <DL> <DD>Function that returns <tt>a < 0 ? -1 : a > 0 ? 1 : 0</tt>. <P> <DL> </DL> </DL> <HR> <A NAME="sin"><!-- --></A><H3> sin</H3> <PRE> public static final <A HREF="../../../cern/colt/function/DoubleFunction.html" title="interface in cern.colt.function">DoubleFunction</A> <B>sin</B></PRE> <DL> <DD>Function that returns <tt>Math.sin(a)</tt>. <P> <DL> </DL> </DL> <HR> <A NAME="sqrt"><!-- --></A><H3> sqrt</H3> <PRE> public static final <A HREF="../../../cern/colt/function/DoubleFunction.html" title="interface in cern.colt.function">DoubleFunction</A> <B>sqrt</B></PRE> <DL> <DD>Function that returns <tt>Math.sqrt(a)</tt>. <P> <DL> </DL> </DL> <HR> <A NAME="square"><!-- --></A><H3> square</H3> <PRE> public static final <A HREF="../../../cern/colt/function/DoubleFunction.html" title="interface in cern.colt.function">DoubleFunction</A> <B>square</B></PRE> <DL> <DD>Function that returns <tt>a * a</tt>. <P> <DL> </DL> </DL> <HR> <A NAME="tan"><!-- --></A><H3> tan</H3> <PRE> public static final <A HREF="../../../cern/colt/function/DoubleFunction.html" title="interface in cern.colt.function">DoubleFunction</A> <B>tan</B></PRE> <DL> <DD>Function that returns <tt>Math.tan(a)</tt>. <P> <DL> </DL> </DL> <HR> <A NAME="atan2"><!-- --></A><H3> atan2</H3> <PRE> public static final <A HREF="../../../cern/colt/function/DoubleDoubleFunction.html" title="interface in cern.colt.function">DoubleDoubleFunction</A> <B>atan2</B></PRE> <DL> <DD>Function that returns <tt>Math.atan2(a,b)</tt>. <P> <DL> </DL> </DL> <HR> <A NAME="compare"><!-- --></A><H3> compare</H3> <PRE> public static final <A HREF="../../../cern/colt/function/DoubleDoubleFunction.html" title="interface in cern.colt.function">DoubleDoubleFunction</A> <B>compare</B></PRE> <DL> <DD>Function that returns <tt>a < b ? -1 : a > b ? 1 : 0</tt>. <P> <DL> </DL> </DL> <HR> <A NAME="div"><!-- --></A><H3> div</H3> <PRE> public static final <A HREF="../../../cern/colt/function/DoubleDoubleFunction.html" title="interface in cern.colt.function">DoubleDoubleFunction</A> <B>div</B></PRE> <DL> <DD>Function that returns <tt>a / b</tt>. <P> <DL> </DL> </DL> <HR> <A NAME="equals"><!-- --></A><H3> equals</H3> <PRE> public static final <A HREF="../../../cern/colt/function/DoubleDoubleFunction.html" title="interface in cern.colt.function">DoubleDoubleFunction</A> <B>equals</B></PRE> <DL> <DD>Function that returns <tt>a == b ? 1 : 0</tt>. <P> <DL> </DL> </DL> <HR> <A NAME="greater"><!-- --></A><H3> greater</H3> <PRE> public static final <A HREF="../../../cern/colt/function/DoubleDoubleFunction.html" title="interface in cern.colt.function">DoubleDoubleFunction</A> <B>greater</B></PRE> <DL> <DD>Function that returns <tt>a > b ? 1 : 0</tt>. <P> <DL> </DL> </DL> <HR> <A NAME="IEEEremainder"><!-- --></A><H3> IEEEremainder</H3> <PRE> public static final <A HREF="../../../cern/colt/function/DoubleDoubleFunction.html" title="interface in cern.colt.function">DoubleDoubleFunction</A> <B>IEEEremainder</B></PRE> <DL> <DD>Function that returns <tt>Math.IEEEremainder(a,b)</tt>. <P> <DL> </DL> </DL> <HR> <A NAME="isEqual"><!-- --></A><H3> isEqual</H3> <PRE> public static final <A HREF="../../../cern/colt/function/DoubleDoubleProcedure.html" title="interface in cern.colt.function">DoubleDoubleProcedure</A> <B>isEqual</B></PRE> <DL> <DD>Function that returns <tt>a == b</tt>. <P> <DL> </DL> </DL> <HR> <A NAME="isLess"><!-- --></A><H3> isLess</H3> <PRE> public static final <A HREF="../../../cern/colt/function/DoubleDoubleProcedure.html" title="interface in cern.colt.function">DoubleDoubleProcedure</A> <B>isLess</B></PRE> <DL> <DD>Function that returns <tt>a < b</tt>. <P> <DL> </DL> </DL> <HR> <A NAME="isGreater"><!-- --></A><H3> isGreater</H3> <PRE> public static final <A HREF="../../../cern/colt/function/DoubleDoubleProcedure.html" title="interface in cern.colt.function">DoubleDoubleProcedure</A> <B>isGreater</B></PRE> <DL> <DD>Function that returns <tt>a > b</tt>. <P> <DL> </DL> </DL> <HR> <A NAME="less"><!-- --></A><H3> less</H3> <PRE> public static final <A HREF="../../../cern/colt/function/DoubleDoubleFunction.html" title="interface in cern.colt.function">DoubleDoubleFunction</A> <B>less</B></PRE> <DL> <DD>Function that returns <tt>a < b ? 1 : 0</tt>. <P> <DL> </DL> </DL> <HR> <A NAME="lg"><!-- --></A><H3> lg</H3> <PRE> public static final <A HREF="../../../cern/colt/function/DoubleDoubleFunction.html" title="interface in cern.colt.function">DoubleDoubleFunction</A> <B>lg</B></PRE> <DL> <DD>Function that returns <tt>Math.log(a) / Math.log(b)</tt>. <P> <DL> </DL> </DL> <HR> <A NAME="max"><!-- --></A><H3> max</H3> <PRE> public static final <A HREF="../../../cern/colt/function/DoubleDoubleFunction.html" title="interface in cern.colt.function">DoubleDoubleFunction</A> <B>max</B></PRE> <DL> <DD>Function that returns <tt>Math.max(a,b)</tt>. <P> <DL> </DL> </DL> <HR> <A NAME="min"><!-- --></A><H3> min</H3> <PRE> public static final <A HREF="../../../cern/colt/function/DoubleDoubleFunction.html" title="interface in cern.colt.function">DoubleDoubleFunction</A> <B>min</B></PRE> <DL> <DD>Function that returns <tt>Math.min(a,b)</tt>. <P> <DL> </DL> </DL> <HR> <A NAME="minus"><!-- --></A><H3> minus</H3> <PRE> public static final <A HREF="../../../cern/colt/function/DoubleDoubleFunction.html" title="interface in cern.colt.function">DoubleDoubleFunction</A> <B>minus</B></PRE> <DL> <DD>Function that returns <tt>a - b</tt>. <P> <DL> </DL> </DL> <HR> <A NAME="mod"><!-- --></A><H3> mod</H3> <PRE> public static final <A HREF="../../../cern/colt/function/DoubleDoubleFunction.html" title="interface in cern.colt.function">DoubleDoubleFunction</A> <B>mod</B></PRE> <DL> <DD>Function that returns <tt>a % b</tt>. <P> <DL> </DL> </DL> <HR> <A NAME="mult"><!-- --></A><H3> mult</H3> <PRE> public static final <A HREF="../../../cern/colt/function/DoubleDoubleFunction.html" title="interface in cern.colt.function">DoubleDoubleFunction</A> <B>mult</B></PRE> <DL> <DD>Function that returns <tt>a * b</tt>. <P> <DL> </DL> </DL> <HR> <A NAME="plus"><!-- --></A><H3> plus</H3> <PRE> public static final <A HREF="../../../cern/colt/function/DoubleDoubleFunction.html" title="interface in cern.colt.function">DoubleDoubleFunction</A> <B>plus</B></PRE> <DL> <DD>Function that returns <tt>a + b</tt>. <P> <DL> </DL> </DL> <HR> <A NAME="plusAbs"><!-- --></A><H3> plusAbs</H3> <PRE> public static final <A HREF="../../../cern/colt/function/DoubleDoubleFunction.html" title="interface in cern.colt.function">DoubleDoubleFunction</A> <B>plusAbs</B></PRE> <DL> <DD>Function that returns <tt>Math.abs(a) + Math.abs(b)</tt>. <P> <DL> </DL> </DL> <HR> <A NAME="pow"><!-- --></A><H3> pow</H3> <PRE> public static final <A HREF="../../../cern/colt/function/DoubleDoubleFunction.html" title="interface in cern.colt.function">DoubleDoubleFunction</A> <B>pow</B></PRE> <DL> <DD>Function that returns <tt>Math.pow(a,b)</tt>. <P> <DL> </DL> </DL> <!-- ========= CONSTRUCTOR DETAIL ======== --> <!-- ============ METHOD DETAIL ========== --> <A NAME="method_detail"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TD COLSPAN=1><FONT SIZE="+2"> <B>Method Detail</B></FONT></TD> </TR> </TABLE> <A NAME="between(double, double)"><!-- --></A><H3> between</H3> <PRE> public static <A HREF="../../../cern/colt/function/DoubleFunction.html" title="interface in cern.colt.function">DoubleFunction</A> <B>between</B>(double from, double to)</PRE> <DL> <DD>Constructs a function that returns <tt>(from<=a && a<=to) ? 1 : 0</tt>. <tt>a</tt> is a variable, <tt>from</tt> and <tt>to</tt> are fixed. <P> <DD><DL> </DL> </DD> </DL> <HR> <A NAME="bindArg1(cern.colt.function.DoubleDoubleFunction, double)"><!-- --></A><H3> bindArg1</H3> <PRE> public static <A HREF="../../../cern/colt/function/DoubleFunction.html" title="interface in cern.colt.function">DoubleFunction</A> <B>bindArg1</B>(<A HREF="../../../cern/colt/function/DoubleDoubleFunction.html" title="interface in cern.colt.function">DoubleDoubleFunction</A> function, double c)</PRE> <DL> <DD>Constructs a unary function from a binary function with the first operand (argument) fixed to the given constant <tt>c</tt>. The second operand is variable (free). <P> <DD><DL> <DT><B>Parameters:</B><DD><CODE>function</CODE> - a binary function taking operands in the form <tt>function.apply(c,var)</tt>. <DT><B>Returns:</B><DD>the unary function <tt>function(c,var)</tt>.</DL> </DD> </DL> <HR> <A NAME="bindArg2(cern.colt.function.DoubleDoubleFunction, double)"><!-- --></A><H3> bindArg2</H3> <PRE> public static <A HREF="../../../cern/colt/function/DoubleFunction.html" title="interface in cern.colt.function">DoubleFunction</A> <B>bindArg2</B>(<A HREF="../../../cern/colt/function/DoubleDoubleFunction.html" title="interface in cern.colt.function">DoubleDoubleFunction</A> function, double c)</PRE> <DL> <DD>Constructs a unary function from a binary function with the second operand (argument) fixed to the given constant <tt>c</tt>. The first operand is variable (free). <P> <DD><DL> <DT><B>Parameters:</B><DD><CODE>function</CODE> - a binary function taking operands in the form <tt>function.apply(var,c)</tt>. <DT><B>Returns:</B><DD>the unary function <tt>function(var,c)</tt>.</DL> </DD> </DL> <HR> <A NAME="chain(cern.colt.function.DoubleDoubleFunction, cern.colt.function.DoubleFunction, cern.colt.function.DoubleFunction)"><!-- --></A><H3> chain</H3> <PRE> public static <A HREF="../../../cern/colt/function/DoubleDoubleFunction.html" title="interface in cern.colt.function">DoubleDoubleFunction</A> <B>chain</B>(<A HREF="../../../cern/colt/function/DoubleDoubleFunction.html" title="interface in cern.colt.function">DoubleDoubleFunction</A> f, <A HREF="../../../cern/colt/function/DoubleFunction.html" title="interface in cern.colt.function">DoubleFunction</A> g, <A HREF="../../../cern/colt/function/DoubleFunction.html" title="interface in cern.colt.function">DoubleFunction</A> h)</PRE> <DL> <DD>Constructs the function <tt>f( g(a), h(b) )</tt>. <P> <DD><DL> <DT><B>Parameters:</B><DD><CODE>f</CODE> - a binary function.<DD><CODE>g</CODE> - a unary function.<DD><CODE>h</CODE> - a unary function. <DT><B>Returns:</B><DD>the binary function <tt>f( g(a), h(b) )</tt>.</DL> </DD> </DL> <HR> <A NAME="chain(cern.colt.function.DoubleFunction, cern.colt.function.DoubleDoubleFunction)"><!-- --></A><H3> chain</H3> <PRE> public static <A HREF="../../../cern/colt/function/DoubleDoubleFunction.html" title="interface in cern.colt.function">DoubleDoubleFunction</A> <B>chain</B>(<A HREF="../../../cern/colt/function/DoubleFunction.html" title="interface in cern.colt.function">DoubleFunction</A> g, <A HREF="../../../cern/colt/function/DoubleDoubleFunction.html" title="interface in cern.colt.function">DoubleDoubleFunction</A> h)</PRE> <DL> <DD>Constructs the function <tt>g( h(a,b) )</tt>. <P> <DD><DL> <DT><B>Parameters:</B><DD><CODE>g</CODE> - a unary function.<DD><CODE>h</CODE> - a binary function. <DT><B>Returns:</B><DD>the unary function <tt>g( h(a,b) )</tt>.</DL> </DD> </DL> <HR> <A NAME="chain(cern.colt.function.DoubleFunction, cern.colt.function.DoubleFunction)"><!-- --></A><H3> chain</H3> <PRE> public static <A HREF="../../../cern/colt/function/DoubleFunction.html" title="interface in cern.colt.function">DoubleFunction</A> <B>chain</B>(<A HREF="../../../cern/colt/function/DoubleFunction.html" title="interface in cern.colt.function">DoubleFunction</A> g, <A HREF="../../../cern/colt/function/DoubleFunction.html" title="interface in cern.colt.function">DoubleFunction</A> h)</PRE> <DL> <DD>Constructs the function <tt>g( h(a) )</tt>. <P> <DD><DL> <DT><B>Parameters:</B><DD><CODE>g</CODE> - a unary function.<DD><CODE>h</CODE> - a unary function. <DT><B>Returns:</B><DD>the unary function <tt>g( h(a) )</tt>.</DL> </DD> </DL> <HR> <A NAME="compare(double)"><!-- --></A><H3> compare</H3> <PRE> public static <A HREF="../../../cern/colt/function/DoubleFunction.html" title="interface in cern.colt.function">DoubleFunction</A> <B>compare</B>(double b)</PRE> <DL> <DD>Constructs a function that returns <tt>a < b ? -1 : a > b ? 1 : 0</tt>. <tt>a</tt> is a variable, <tt>b</tt> is fixed. <P> <DD><DL> </DL> </DD> </DL> <HR> <A NAME="constant(double)"><!-- --></A><H3> constant</H3> <PRE> public static <A HREF="../../../cern/colt/function/DoubleFunction.html" title="interface in cern.colt.function">DoubleFunction</A> <B>constant</B>(double c)</PRE> <DL> <DD>Constructs a function that returns the constant <tt>c</tt>. <P> <DD><DL> </DL> </DD> </DL> <HR> <A NAME="demo1()"><!-- --></A><H3> demo1</H3> <PRE> public static void <B>demo1</B>()</PRE> <DL> <DD>Demonstrates usage of this class. <P> <DD><DL> </DL> </DD> </DL> <HR> <A NAME="demo2(int)"><!-- --></A><H3> demo2</H3> <PRE> public static void <B>demo2</B>(int size)</PRE> <DL> <DD>Benchmarks and demonstrates usage of trivial and complex functions. <P> <DD><DL> </DL> </DD> </DL> <HR> <A NAME="div(double)"><!-- --></A><H3> div</H3> <PRE> public static <A HREF="../../../cern/colt/function/DoubleFunction.html" title="interface in cern.colt.function">DoubleFunction</A> <B>div</B>(double b)</PRE> <DL> <DD>Constructs a function that returns <tt>a / b</tt>. <tt>a</tt> is a variable, <tt>b</tt> is fixed. <P> <DD><DL> </DL> </DD> </DL> <HR> <A NAME="equals(double)"><!-- --></A><H3> equals</H3> <PRE> public static <A HREF="../../../cern/colt/function/DoubleFunction.html" title="interface in cern.colt.function">DoubleFunction</A> <B>equals</B>(double b)</PRE> <DL> <DD>Constructs a function that returns <tt>a == b ? 1 : 0</tt>. <tt>a</tt> is a variable, <tt>b</tt> is fixed. <P> <DD><DL> </DL> </DD> </DL> <HR> <A NAME="greater(double)"><!-- --></A><H3> greater</H3> <PRE> public static <A HREF="../../../cern/colt/function/DoubleFunction.html" title="interface in cern.colt.function">DoubleFunction</A> <B>greater</B>(double b)</PRE> <DL> <DD>Constructs a function that returns <tt>a > b ? 1 : 0</tt>. <tt>a</tt> is a variable, <tt>b</tt> is fixed. <P> <DD><DL> </DL> </DD> </DL> <HR> <A NAME="IEEEremainder(double)"><!-- --></A><H3> IEEEremainder</H3> <PRE> public static <A HREF="../../../cern/colt/function/DoubleFunction.html" title="interface in cern.colt.function">DoubleFunction</A> <B>IEEEremainder</B>(double b)</PRE> <DL> <DD>Constructs a function that returns <tt>Math.IEEEremainder(a,b)</tt>. <tt>a</tt> is a variable, <tt>b</tt> is fixed. <P> <DD><DL> </DL> </DD> </DL> <HR> <A NAME="isBetween(double, double)"><!-- --></A><H3> isBetween</H3> <PRE> public static <A HREF="../../../cern/colt/function/DoubleProcedure.html" title="interface in cern.colt.function">DoubleProcedure</A> <B>isBetween</B>(double from, double to)</PRE> <DL> <DD>Constructs a function that returns <tt>from<=a && a<=to</tt>. <tt>a</tt> is a variable, <tt>from</tt> and <tt>to</tt> are fixed. <P> <DD><DL> </DL> </DD> </DL> <HR> <A NAME="isEqual(double)"><!-- --></A><H3> isEqual</H3> <PRE> public static <A HREF="../../../cern/colt/function/DoubleProcedure.html" title="interface in cern.colt.function">DoubleProcedure</A> <B>isEqual</B>(double b)</PRE> <DL> <DD>Constructs a function that returns <tt>a == b</tt>. <tt>a</tt> is a variable, <tt>b</tt> is fixed. <P> <DD><DL> </DL> </DD> </DL> <HR> <A NAME="isGreater(double)"><!-- --></A><H3> isGreater</H3> <PRE> public static <A HREF="../../../cern/colt/function/DoubleProcedure.html" title="interface in cern.colt.function">DoubleProcedure</A> <B>isGreater</B>(double b)</PRE> <DL> <DD>Constructs a function that returns <tt>a > b</tt>. <tt>a</tt> is a variable, <tt>b</tt> is fixed. <P> <DD><DL> </DL> </DD> </DL> <HR> <A NAME="isLess(double)"><!-- --></A><H3> isLess</H3> <PRE> public static <A HREF="../../../cern/colt/function/DoubleProcedure.html" title="interface in cern.colt.function">DoubleProcedure</A> <B>isLess</B>(double b)</PRE> <DL> <DD>Constructs a function that returns <tt>a < b</tt>. <tt>a</tt> is a variable, <tt>b</tt> is fixed. <P> <DD><DL> </DL> </DD> </DL> <HR> <A NAME="less(double)"><!-- --></A><H3> less</H3> <PRE> public static <A HREF="../../../cern/colt/function/DoubleFunction.html" title="interface in cern.colt.function">DoubleFunction</A> <B>less</B>(double b)</PRE> <DL> <DD>Constructs a function that returns <tt>a < b ? 1 : 0</tt>. <tt>a</tt> is a variable, <tt>b</tt> is fixed. <P> <DD><DL> </DL> </DD> </DL> <HR> <A NAME="lg(double)"><!-- --></A><H3> lg</H3> <PRE> public static <A HREF="../../../cern/colt/function/DoubleFunction.html" title="interface in cern.colt.function">DoubleFunction</A> <B>lg</B>(double b)</PRE> <DL> <DD>Constructs a function that returns <tt><tt>Math.log(a) / Math.log(b)</tt></tt>. <tt>a</tt> is a variable, <tt>b</tt> is fixed. <P> <DD><DL> </DL> </DD> </DL> <HR> <A NAME="max(double)"><!-- --></A><H3> max</H3> <PRE> public static <A HREF="../../../cern/colt/function/DoubleFunction.html" title="interface in cern.colt.function">DoubleFunction</A> <B>max</B>(double b)</PRE> <DL> <DD>Constructs a function that returns <tt>Math.max(a,b)</tt>. <tt>a</tt> is a variable, <tt>b</tt> is fixed. <P> <DD><DL> </DL> </DD> </DL> <HR> <A NAME="min(double)"><!-- --></A><H3> min</H3> <PRE> public static <A HREF="../../../cern/colt/function/DoubleFunction.html" title="interface in cern.colt.function">DoubleFunction</A> <B>min</B>(double b)</PRE> <DL> <DD>Constructs a function that returns <tt>Math.min(a,b)</tt>. <tt>a</tt> is a variable, <tt>b</tt> is fixed. <P> <DD><DL> </DL> </DD> </DL> <HR> <A NAME="minus(double)"><!-- --></A><H3> minus</H3> <PRE> public static <A HREF="../../../cern/colt/function/DoubleFunction.html" title="interface in cern.colt.function">DoubleFunction</A> <B>minus</B>(double b)</PRE> <DL> <DD>Constructs a function that returns <tt>a - b</tt>. <tt>a</tt> is a variable, <tt>b</tt> is fixed. <P> <DD><DL> </DL> </DD> </DL> <HR> <A NAME="minusMult(double)"><!-- --></A><H3> minusMult</H3> <PRE> public static <A HREF="../../../cern/colt/function/DoubleDoubleFunction.html" title="interface in cern.colt.function">DoubleDoubleFunction</A> <B>minusMult</B>(double constant)</PRE> <DL> <DD>Constructs a function that returns <tt>a - b*constant</tt>. <tt>a</tt> and <tt>b</tt> are variables, <tt>constant</tt> is fixed. <P> <DD><DL> </DL> </DD> </DL> <HR> <A NAME="mod(double)"><!-- --></A><H3> mod</H3> <PRE> public static <A HREF="../../../cern/colt/function/DoubleFunction.html" title="interface in cern.colt.function">DoubleFunction</A> <B>mod</B>(double b)</PRE> <DL> <DD>Constructs a function that returns <tt>a % b</tt>. <tt>a</tt> is a variable, <tt>b</tt> is fixed. <P> <DD><DL> </DL> </DD> </DL> <HR> <A NAME="mult(double)"><!-- --></A><H3> mult</H3> <PRE> public static <A HREF="../../../cern/colt/function/DoubleFunction.html" title="interface in cern.colt.function">DoubleFunction</A> <B>mult</B>(double b)</PRE> <DL> <DD>Constructs a function that returns <tt>a * b</tt>. <tt>a</tt> is a variable, <tt>b</tt> is fixed. <P> <DD><DL> </DL> </DD> </DL> <HR> <A NAME="plus(double)"><!-- --></A><H3> plus</H3> <PRE> public static <A HREF="../../../cern/colt/function/DoubleFunction.html" title="interface in cern.colt.function">DoubleFunction</A> <B>plus</B>(double b)</PRE> <DL> <DD>Constructs a function that returns <tt>a + b</tt>. <tt>a</tt> is a variable, <tt>b</tt> is fixed. <P> <DD><DL> </DL> </DD> </DL> <HR> <A NAME="plusMult(double)"><!-- --></A><H3> plusMult</H3> <PRE> public static <A HREF="../../../cern/colt/function/DoubleDoubleFunction.html" title="interface in cern.colt.function">DoubleDoubleFunction</A> <B>plusMult</B>(double constant)</PRE> <DL> <DD>Constructs a function that returns <tt>a + b*constant</tt>. <tt>a</tt> and <tt>b</tt> are variables, <tt>constant</tt> is fixed. <P> <DD><DL> </DL> </DD> </DL> <HR> <A NAME="pow(double)"><!-- --></A><H3> pow</H3> <PRE> public static <A HREF="../../../cern/colt/function/DoubleFunction.html" title="interface in cern.colt.function">DoubleFunction</A> <B>pow</B>(double b)</PRE> <DL> <DD>Constructs a function that returns <tt>Math.pow(a,b)</tt>. <tt>a</tt> is a variable, <tt>b</tt> is fixed. <P> <DD><DL> </DL> </DD> </DL> <HR> <A NAME="random()"><!-- --></A><H3> random</H3> <PRE> public static <A HREF="../../../cern/colt/function/DoubleFunction.html" title="interface in cern.colt.function">DoubleFunction</A> <B>random</B>()</PRE> <DL> <DD>Constructs a function that returns a new uniform random number in the open unit interval <code>(0.0,1.0)</code> (excluding 0.0 and 1.0). Currently the engine is <A HREF="../../../cern/jet/random/engine/MersenneTwister.html" title="class in cern.jet.random.engine"><CODE>MersenneTwister</CODE></A> and is seeded with the current time. <p> Note that any random engine derived from <A HREF="../../../cern/jet/random/engine/RandomEngine.html" title="class in cern.jet.random.engine"><CODE>RandomEngine</CODE></A> and any random distribution derived from <A HREF="../../../cern/jet/random/AbstractDistribution.html" title="class in cern.jet.random"><CODE>AbstractDistribution</CODE></A> are function objects, because they implement the proper interfaces. Thus, if you are not happy with the default, just pass your favourite random generator to function evaluating methods. <P> <DD><DL> </DL> </DD> </DL> <HR> <A NAME="round(double)"><!-- --></A><H3> round</H3> <PRE> public static <A HREF="../../../cern/colt/function/DoubleFunction.html" title="interface in cern.colt.function">DoubleFunction</A> <B>round</B>(double precision)</PRE> <DL> <DD>Constructs a function that returns the number rounded to the given precision; <tt>Math.rint(a/precision)*precision</tt>. Examples: <pre> precision = 0.01 rounds 0.012 --> 0.01, 0.018 --> 0.02 precision = 10 rounds 123 --> 120 , 127 --> 130 </pre> <P> <DD><DL> </DL> </DD> </DL> <HR> <A NAME="swapArgs(cern.colt.function.DoubleDoubleFunction)"><!-- --></A><H3> swapArgs</H3> <PRE> public static <A HREF="../../../cern/colt/function/DoubleDoubleFunction.html" title="interface in cern.colt.function">DoubleDoubleFunction</A> <B>swapArgs</B>(<A HREF="../../../cern/colt/function/DoubleDoubleFunction.html" title="interface in cern.colt.function">DoubleDoubleFunction</A> function)</PRE> <DL> <DD>Constructs a function that returns <tt>function.apply(b,a)</tt>, i.e. applies the function with the first operand as second operand and the second operand as first operand. <P> <DD><DL> <DT><B>Parameters:</B><DD><CODE>function</CODE> - a function taking operands in the form <tt>function.apply(a,b)</tt>. <DT><B>Returns:</B><DD>the binary function <tt>function(b,a)</tt>.</DL> </DD> </DL> <!-- ========= END OF CLASS DATA ========= --> <HR> <!-- ======= START OF BOTTOM NAVBAR ====== --> <A NAME="navbar_bottom"><!-- --></A> <A HREF="#skip-navbar_bottom" title="Skip navigation links"></A> <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> <TR> <TD COLSPAN=3 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A NAME="navbar_bottom_firstrow"><!-- --></A> <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/Functions.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../index-files/index-1.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> </TR> </TABLE> </TD> <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> <b>Colt 1.2.0</b></EM> </TD> </TR> <TR> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../cern/jet/math/Constants.html" title="class in cern.jet.math"><B>PREV CLASS</B></A> <A HREF="../../../cern/jet/math/IntFunctions.html" title="class in cern.jet.math"><B>NEXT CLASS</B></A></FONT></TD> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../index.html" target="_top"><B>FRAMES</B></A> <A HREF="Functions.html" target="_top"><B>NO FRAMES</B></A> <SCRIPT type="text/javascript"> <!-- if(window==top) { document.writeln('<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>'); } //--> </SCRIPT> <NOSCRIPT> <A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A> </NOSCRIPT> </FONT></TD> </TR> <TR> <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> SUMMARY: NESTED | <A HREF="#field_summary">FIELD</A> | CONSTR | <A HREF="#method_summary">METHOD</A></FONT></TD> <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> DETAIL: <A HREF="#field_detail">FIELD</A> | CONSTR | <A HREF="#method_detail">METHOD</A></FONT></TD> </TR> </TABLE> <A NAME="skip-navbar_bottom"></A> <!-- ======== END OF BOTTOM NAVBAR ======= --> <HR> <font size=-1 >Jump to the <a target=_top href=http://dsd.lbl.gov/~hoschek/colt >Colt Homepage</a> </BODY> </HTML>