blob: 3786816c74f64b57e8ad0c407c2e7e7a01e10fcd [file] [log] [blame]
<!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>DoubleArray (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="DoubleArray (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/DoubleArray.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/DefaultTransformer.html" title="class in org.apache.commons.math3.util"><span class="strong">Prev Class</span></a></li>
<li><a href="../../../../../org/apache/commons/math3/util/FastMath.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/DoubleArray.html" target="_top">Frames</a></li>
<li><a href="DoubleArray.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_top");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary:&nbsp;</li>
<li>Nested&nbsp;|&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li>Constr&nbsp;|&nbsp;</li>
<li><a href="#method_summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li>Constr&nbsp;|&nbsp;</li>
<li><a href="#method_detail">Method</a></li>
</ul>
</div>
<a name="skip-navbar_top">
<!-- -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
<!-- ======== START OF CLASS DATA ======== -->
<div class="header">
<div class="subTitle">org.apache.commons.math3.util</div>
<h2 title="Interface DoubleArray" class="title">Interface DoubleArray</h2>
</div>
<div class="contentContainer">
<div class="description">
<ul class="blockList">
<li class="blockList">
<dl>
<dt>All Known Implementing Classes:</dt>
<dd><a href="../../../../../org/apache/commons/math3/util/ResizableDoubleArray.html" title="class in org.apache.commons.math3.util">ResizableDoubleArray</a></dd>
</dl>
<hr>
<br>
<pre>public interface <span class="strong">DoubleArray</span></pre>
<div class="block">Provides a standard interface for double arrays. Allows different
array implementations to support various storage mechanisms
such as automatic expansion, contraction, and array "rolling".</div>
<dl><dt><span class="strong">Version:</span></dt>
<dd>$Id: DoubleArray.java 1416643 2012-12-03 19:37:14Z tn $</dd></dl>
</li>
</ul>
</div>
<div class="summary">
<ul class="blockList">
<li class="blockList">
<!-- ========== METHOD SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="method_summary">
<!-- -->
</a>
<h3>Method Summary</h3>
<table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation">
<caption><span>Methods</span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Method and Description</th>
</tr>
<tr class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/commons/math3/util/DoubleArray.html#addElement(double)">addElement</a></strong>(double&nbsp;value)</code>
<div class="block">Adds an element to the end of this expandable array</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>double</code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/commons/math3/util/DoubleArray.html#addElementRolling(double)">addElementRolling</a></strong>(double&nbsp;value)</code>
<div class="block">
Adds an element to the end of the array and removes the first
element in the array.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/commons/math3/util/DoubleArray.html#addElements(double[])">addElements</a></strong>(double[]&nbsp;values)</code>
<div class="block">Adds elements to the end of this expandable array</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/commons/math3/util/DoubleArray.html#clear()">clear</a></strong>()</code>
<div class="block">Clear the double array</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>double</code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/commons/math3/util/DoubleArray.html#getElement(int)">getElement</a></strong>(int&nbsp;index)</code>
<div class="block">Returns the element at the specified index.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>double[]</code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/commons/math3/util/DoubleArray.html#getElements()">getElements</a></strong>()</code>
<div class="block">Returns a double[] array containing the elements of this
<code>DoubleArray</code>.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>int</code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/commons/math3/util/DoubleArray.html#getNumElements()">getNumElements</a></strong>()</code>
<div class="block">Returns the number of elements currently in the array.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/commons/math3/util/DoubleArray.html#setElement(int, double)">setElement</a></strong>(int&nbsp;index,
double&nbsp;value)</code>
<div class="block">Sets the element at the specified index.</div>
</td>
</tr>
</table>
</li>
</ul>
</li>
</ul>
</div>
<div class="details">
<ul class="blockList">
<li class="blockList">
<!-- ============ METHOD DETAIL ========== -->
<ul class="blockList">
<li class="blockList"><a name="method_detail">
<!-- -->
</a>
<h3>Method Detail</h3>
<a name="getNumElements()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getNumElements</h4>
<pre>int&nbsp;getNumElements()</pre>
<div class="block">Returns the number of elements currently in the array. Please note
that this may be different from the length of the internal storage array.</div>
<dl><dt><span class="strong">Returns:</span></dt><dd>number of elements</dd></dl>
</li>
</ul>
<a name="getElement(int)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getElement</h4>
<pre>double&nbsp;getElement(int&nbsp;index)</pre>
<div class="block">Returns the element at the specified index. Note that if an
out of bounds index is supplied a ArrayIndexOutOfBoundsException
will be thrown.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>index</code> - index to fetch a value from</dd>
<dt><span class="strong">Returns:</span></dt><dd>value stored at the specified index</dd>
<dt><span class="strong">Throws:</span></dt>
<dd><code><a href="http://docs.oracle.com/javase/6/docs/api/java/lang/ArrayIndexOutOfBoundsException.html?is-external=true" title="class or interface in java.lang">ArrayIndexOutOfBoundsException</a></code> - if <code>index</code> is less than
zero or is greater than <code>getNumElements() - 1</code>.</dd></dl>
</li>
</ul>
<a name="setElement(int, double)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setElement</h4>
<pre>void&nbsp;setElement(int&nbsp;index,
double&nbsp;value)</pre>
<div class="block">Sets the element at the specified index. If the specified index is greater than
<code>getNumElements() - 1</code>, the <code>numElements</code> property
is increased to <code>index +1</code> and additional storage is allocated
(if necessary) for the new element and all (uninitialized) elements
between the new element and the previous end of the array).</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>index</code> - index to store a value in</dd><dd><code>value</code> - value to store at the specified index</dd>
<dt><span class="strong">Throws:</span></dt>
<dd><code><a href="http://docs.oracle.com/javase/6/docs/api/java/lang/ArrayIndexOutOfBoundsException.html?is-external=true" title="class or interface in java.lang">ArrayIndexOutOfBoundsException</a></code> - if <code>index</code> is less than
zero.</dd></dl>
</li>
</ul>
<a name="addElement(double)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>addElement</h4>
<pre>void&nbsp;addElement(double&nbsp;value)</pre>
<div class="block">Adds an element to the end of this expandable array</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>value</code> - to be added to end of array</dd></dl>
</li>
</ul>
<a name="addElements(double[])">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>addElements</h4>
<pre>void&nbsp;addElements(double[]&nbsp;values)</pre>
<div class="block">Adds elements to the end of this expandable array</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>values</code> - to be added to end of array</dd></dl>
</li>
</ul>
<a name="addElementRolling(double)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>addElementRolling</h4>
<pre>double&nbsp;addElementRolling(double&nbsp;value)</pre>
<div class="block"><p>
Adds an element to the end of the array and removes the first
element in the array. Returns the discarded first element.
The effect is similar to a push operation in a FIFO queue.
</p>
<p>
Example: If the array contains the elements 1, 2, 3, 4 (in that order)
and addElementRolling(5) is invoked, the result is an array containing
the entries 2, 3, 4, 5 and the value returned is 1.
</p></div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>value</code> - the value to be added to the array</dd>
<dt><span class="strong">Returns:</span></dt><dd>the value which has been discarded or "pushed" out of the array
by this rolling insert</dd></dl>
</li>
</ul>
<a name="getElements()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getElements</h4>
<pre>double[]&nbsp;getElements()</pre>
<div class="block">Returns a double[] array containing the elements of this
<code>DoubleArray</code>. If the underlying implementation is
array-based, this method should always return a copy, rather than a
reference to the underlying array so that changes made to the returned
array have no effect on the <code>DoubleArray.</code></div>
<dl><dt><span class="strong">Returns:</span></dt><dd>all elements added to the array</dd></dl>
</li>
</ul>
<a name="clear()">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>clear</h4>
<pre>void&nbsp;clear()</pre>
<div class="block">Clear the double array</div>
</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/DoubleArray.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/DefaultTransformer.html" title="class in org.apache.commons.math3.util"><span class="strong">Prev Class</span></a></li>
<li><a href="../../../../../org/apache/commons/math3/util/FastMath.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/DoubleArray.html" target="_top">Frames</a></li>
<li><a href="DoubleArray.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_bottom");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary:&nbsp;</li>
<li>Nested&nbsp;|&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li>Constr&nbsp;|&nbsp;</li>
<li><a href="#method_summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li>Constr&nbsp;|&nbsp;</li>
<li><a href="#method_detail">Method</a></li>
</ul>
</div>
<a name="skip-navbar_bottom">
<!-- -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
<p class="legalCopy"><small>Copyright &#169; 2003&#x2013;2014 <a href="http://www.apache.org/">The Apache Software Foundation</a>. All rights reserved.</small></p>
</body>
</html>