blob: 7a01c5b5b7303ae9c9f1a00625a574e81054e5fe (
plain) (
tree)
|
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (version 1.7.0_51) on Wed Sep 16 10:26:34 PDT 2015 -->
<title>DenseVector</title>
<meta name="date" content="2015-09-16">
<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="DenseVector";
}
//-->
</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="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>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../../org/apache/spark/mllib/linalg/DenseMatrix.html" title="class in org.apache.spark.mllib.linalg"><span class="strong">Prev Class</span></a></li>
<li><a href="../../../../../org/apache/spark/mllib/linalg/Matrices.html" title="class in org.apache.spark.mllib.linalg"><span class="strong">Next Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../../index.html?org/apache/spark/mllib/linalg/DenseVector.html" target="_top">Frames</a></li>
<li><a href="DenseVector.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>Field | </li>
<li><a href="#constructor_summary">Constr</a> | </li>
<li><a href="#method_summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail: </li>
<li>Field | </li>
<li><a href="#constructor_detail">Constr</a> | </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.spark.mllib.linalg</div>
<h2 title="Class DenseVector" class="title">Class DenseVector</h2>
</div>
<div class="contentContainer">
<ul class="inheritance">
<li>java.lang.Object</li>
<li>
<ul class="inheritance">
<li>org.apache.spark.mllib.linalg.DenseVector</li>
</ul>
</li>
</ul>
<div class="description">
<ul class="blockList">
<li class="blockList">
<dl>
<dt>All Implemented Interfaces:</dt>
<dd>java.io.Serializable, <a href="../../../../../org/apache/spark/mllib/linalg/Vector.html" title="interface in org.apache.spark.mllib.linalg">Vector</a></dd>
</dl>
<hr>
<br>
<pre>public class <span class="strong">DenseVector</span>
extends java.lang.Object
implements <a href="../../../../../org/apache/spark/mllib/linalg/Vector.html" title="interface in org.apache.spark.mllib.linalg">Vector</a></pre>
<div class="block">A dense vector represented by a value array.</div>
<dl><dt><span class="strong">See Also:</span></dt><dd><a href="../../../../../serialized-form.html#org.apache.spark.mllib.linalg.DenseVector">Serialized Form</a></dd></dl>
</li>
</ul>
</div>
<div class="summary">
<ul class="blockList">
<li class="blockList">
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
<ul class="blockList">
<li class="blockList"><a name="constructor_summary">
<!-- -->
</a>
<h3>Constructor Summary</h3>
<table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Constructor Summary table, listing constructors, and an explanation">
<caption><span>Constructors</span><span class="tabEnd"> </span></caption>
<tr>
<th class="colOne" scope="col">Constructor and Description</th>
</tr>
<tr class="altColor">
<td class="colOne"><code><strong><a href="../../../../../org/apache/spark/mllib/linalg/DenseVector.html#DenseVector(double[])">DenseVector</a></strong>(double[] values)</code> </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>double</code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/spark/mllib/linalg/DenseVector.html#apply(int)">apply</a></strong>(int i)</code>
<div class="block">Gets the value of the ith element.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>int</code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/spark/mllib/linalg/DenseVector.html#argmax()">argmax</a></strong>()</code>
<div class="block">Find the index of a maximal element.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code><a href="../../../../../org/apache/spark/mllib/linalg/DenseVector.html" title="class in org.apache.spark.mllib.linalg">DenseVector</a></code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/spark/mllib/linalg/DenseVector.html#copy()">copy</a></strong>()</code>
<div class="block">Makes a deep copy of this vector.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>int</code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/spark/mllib/linalg/DenseVector.html#hashCode()">hashCode</a></strong>()</code>
<div class="block">Returns a hash code value for the vector.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>int</code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/spark/mllib/linalg/DenseVector.html#numActives()">numActives</a></strong>()</code>
<div class="block">Number of active entries.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>int</code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/spark/mllib/linalg/DenseVector.html#numNonzeros()">numNonzeros</a></strong>()</code>
<div class="block">Number of nonzero elements.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>int</code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/spark/mllib/linalg/DenseVector.html#size()">size</a></strong>()</code>
<div class="block">Size of the vector.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>double[]</code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/spark/mllib/linalg/DenseVector.html#toArray()">toArray</a></strong>()</code>
<div class="block">Converts the instance to a double array.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code><a href="../../../../../org/apache/spark/mllib/linalg/SparseVector.html" title="class in org.apache.spark.mllib.linalg">SparseVector</a></code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/spark/mllib/linalg/DenseVector.html#toSparse()">toSparse</a></strong>()</code>
<div class="block">Converts this vector to a sparse vector with all explicit zeros removed.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>java.lang.String</code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/spark/mllib/linalg/DenseVector.html#toString()">toString</a></strong>()</code> </td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static scala.Option<double[]></code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/spark/mllib/linalg/DenseVector.html#unapply(org.apache.spark.mllib.linalg.DenseVector)">unapply</a></strong>(<a href="../../../../../org/apache/spark/mllib/linalg/DenseVector.html" title="class in org.apache.spark.mllib.linalg">DenseVector</a> dv)</code>
<div class="block">Extracts the value array from a dense vector.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>double[]</code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/spark/mllib/linalg/DenseVector.html#values()">values</a></strong>()</code> </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.Object</h3>
<code>clone, equals, finalize, getClass, notify, notifyAll, wait, wait, wait</code></li>
</ul>
<ul class="blockList">
<li class="blockList"><a name="methods_inherited_from_class_org.apache.spark.mllib.linalg.Vector">
<!-- -->
</a>
<h3>Methods inherited from interface org.apache.spark.mllib.linalg.<a href="../../../../../org/apache/spark/mllib/linalg/Vector.html" title="interface in org.apache.spark.mllib.linalg">Vector</a></h3>
<code><a href="../../../../../org/apache/spark/mllib/linalg/Vector.html#compressed()">compressed</a>, <a href="../../../../../org/apache/spark/mllib/linalg/Vector.html#equals(java.lang.Object)">equals</a>, <a href="../../../../../org/apache/spark/mllib/linalg/Vector.html#toDense()">toDense</a></code></li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
<div class="details">
<ul class="blockList">
<li class="blockList">
<!-- ========= CONSTRUCTOR DETAIL ======== -->
<ul class="blockList">
<li class="blockList"><a name="constructor_detail">
<!-- -->
</a>
<h3>Constructor Detail</h3>
<a name="DenseVector(double[])">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>DenseVector</h4>
<pre>public DenseVector(double[] values)</pre>
</li>
</ul>
</li>
</ul>
<!-- ============ METHOD DETAIL ========== -->
<ul class="blockList">
<li class="blockList"><a name="method_detail">
<!-- -->
</a>
<h3>Method Detail</h3>
<a name="unapply(org.apache.spark.mllib.linalg.DenseVector)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>unapply</h4>
<pre>public static scala.Option<double[]> unapply(<a href="../../../../../org/apache/spark/mllib/linalg/DenseVector.html" title="class in org.apache.spark.mllib.linalg">DenseVector</a> dv)</pre>
<div class="block">Extracts the value array from a dense vector.</div>
</li>
</ul>
<a name="values()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>values</h4>
<pre>public double[] values()</pre>
</li>
</ul>
<a name="size()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>size</h4>
<pre>public int size()</pre>
<div class="block"><strong>Description copied from interface: <code><a href="../../../../../org/apache/spark/mllib/linalg/Vector.html#size()">Vector</a></code></strong></div>
<div class="block">Size of the vector.</div>
<dl>
<dt><strong>Specified by:</strong></dt>
<dd><code><a href="../../../../../org/apache/spark/mllib/linalg/Vector.html#size()">size</a></code> in interface <code><a href="../../../../../org/apache/spark/mllib/linalg/Vector.html" title="interface in org.apache.spark.mllib.linalg">Vector</a></code></dd>
<dt><span class="strong">Returns:</span></dt><dd>(undocumented)</dd></dl>
</li>
</ul>
<a name="toString()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>toString</h4>
<pre>public java.lang.String toString()</pre>
<dl>
<dt><strong>Overrides:</strong></dt>
<dd><code>toString</code> in class <code>java.lang.Object</code></dd>
</dl>
</li>
</ul>
<a name="toArray()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>toArray</h4>
<pre>public double[] toArray()</pre>
<div class="block"><strong>Description copied from interface: <code><a href="../../../../../org/apache/spark/mllib/linalg/Vector.html#toArray()">Vector</a></code></strong></div>
<div class="block">Converts the instance to a double array.</div>
<dl>
<dt><strong>Specified by:</strong></dt>
<dd><code><a href="../../../../../org/apache/spark/mllib/linalg/Vector.html#toArray()">toArray</a></code> in interface <code><a href="../../../../../org/apache/spark/mllib/linalg/Vector.html" title="interface in org.apache.spark.mllib.linalg">Vector</a></code></dd>
<dt><span class="strong">Returns:</span></dt><dd>(undocumented)</dd></dl>
</li>
</ul>
<a name="apply(int)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>apply</h4>
<pre>public double apply(int i)</pre>
<div class="block"><strong>Description copied from interface: <code><a href="../../../../../org/apache/spark/mllib/linalg/Vector.html#apply(int)">Vector</a></code></strong></div>
<div class="block">Gets the value of the ith element.</div>
<dl>
<dt><strong>Specified by:</strong></dt>
<dd><code><a href="../../../../../org/apache/spark/mllib/linalg/Vector.html#apply(int)">apply</a></code> in interface <code><a href="../../../../../org/apache/spark/mllib/linalg/Vector.html" title="interface in org.apache.spark.mllib.linalg">Vector</a></code></dd>
<dt><span class="strong">Parameters:</span></dt><dd><code>i</code> - index</dd>
<dt><span class="strong">Returns:</span></dt><dd>(undocumented)</dd></dl>
</li>
</ul>
<a name="copy()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>copy</h4>
<pre>public <a href="../../../../../org/apache/spark/mllib/linalg/DenseVector.html" title="class in org.apache.spark.mllib.linalg">DenseVector</a> copy()</pre>
<div class="block"><strong>Description copied from interface: <code><a href="../../../../../org/apache/spark/mllib/linalg/Vector.html#copy()">Vector</a></code></strong></div>
<div class="block">Makes a deep copy of this vector.</div>
<dl>
<dt><strong>Specified by:</strong></dt>
<dd><code><a href="../../../../../org/apache/spark/mllib/linalg/Vector.html#copy()">copy</a></code> in interface <code><a href="../../../../../org/apache/spark/mllib/linalg/Vector.html" title="interface in org.apache.spark.mllib.linalg">Vector</a></code></dd>
<dt><span class="strong">Returns:</span></dt><dd>(undocumented)</dd></dl>
</li>
</ul>
<a name="hashCode()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>hashCode</h4>
<pre>public int hashCode()</pre>
<div class="block"><strong>Description copied from interface: <code><a href="../../../../../org/apache/spark/mllib/linalg/Vector.html#hashCode()">Vector</a></code></strong></div>
<div class="block">Returns a hash code value for the vector. The hash code is based on its size and its nonzeros
in the first 16 entries, using a hash algorithm similar to <code>java.util.Arrays.hashCode</code>.</div>
<dl>
<dt><strong>Specified by:</strong></dt>
<dd><code><a href="../../../../../org/apache/spark/mllib/linalg/Vector.html#hashCode()">hashCode</a></code> in interface <code><a href="../../../../../org/apache/spark/mllib/linalg/Vector.html" title="interface in org.apache.spark.mllib.linalg">Vector</a></code></dd>
<dt><strong>Overrides:</strong></dt>
<dd><code>hashCode</code> in class <code>java.lang.Object</code></dd>
<dt><span class="strong">Returns:</span></dt><dd>(undocumented)</dd></dl>
</li>
</ul>
<a name="numActives()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>numActives</h4>
<pre>public int numActives()</pre>
<div class="block"><strong>Description copied from interface: <code><a href="../../../../../org/apache/spark/mllib/linalg/Vector.html#numActives()">Vector</a></code></strong></div>
<div class="block">Number of active entries. An "active entry" is an element which is explicitly stored,
regardless of its value. Note that inactive entries have value 0.</div>
<dl>
<dt><strong>Specified by:</strong></dt>
<dd><code><a href="../../../../../org/apache/spark/mllib/linalg/Vector.html#numActives()">numActives</a></code> in interface <code><a href="../../../../../org/apache/spark/mllib/linalg/Vector.html" title="interface in org.apache.spark.mllib.linalg">Vector</a></code></dd>
<dt><span class="strong">Returns:</span></dt><dd>(undocumented)</dd></dl>
</li>
</ul>
<a name="numNonzeros()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>numNonzeros</h4>
<pre>public int numNonzeros()</pre>
<div class="block"><strong>Description copied from interface: <code><a href="../../../../../org/apache/spark/mllib/linalg/Vector.html#numNonzeros()">Vector</a></code></strong></div>
<div class="block">Number of nonzero elements. This scans all active values and count nonzeros.</div>
<dl>
<dt><strong>Specified by:</strong></dt>
<dd><code><a href="../../../../../org/apache/spark/mllib/linalg/Vector.html#numNonzeros()">numNonzeros</a></code> in interface <code><a href="../../../../../org/apache/spark/mllib/linalg/Vector.html" title="interface in org.apache.spark.mllib.linalg">Vector</a></code></dd>
<dt><span class="strong">Returns:</span></dt><dd>(undocumented)</dd></dl>
</li>
</ul>
<a name="toSparse()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>toSparse</h4>
<pre>public <a href="../../../../../org/apache/spark/mllib/linalg/SparseVector.html" title="class in org.apache.spark.mllib.linalg">SparseVector</a> toSparse()</pre>
<div class="block"><strong>Description copied from interface: <code><a href="../../../../../org/apache/spark/mllib/linalg/Vector.html#toSparse()">Vector</a></code></strong></div>
<div class="block">Converts this vector to a sparse vector with all explicit zeros removed.</div>
<dl>
<dt><strong>Specified by:</strong></dt>
<dd><code><a href="../../../../../org/apache/spark/mllib/linalg/Vector.html#toSparse()">toSparse</a></code> in interface <code><a href="../../../../../org/apache/spark/mllib/linalg/Vector.html" title="interface in org.apache.spark.mllib.linalg">Vector</a></code></dd>
<dt><span class="strong">Returns:</span></dt><dd>(undocumented)</dd></dl>
</li>
</ul>
<a name="argmax()">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>argmax</h4>
<pre>public int argmax()</pre>
<div class="block"><strong>Description copied from interface: <code><a href="../../../../../org/apache/spark/mllib/linalg/Vector.html#argmax()">Vector</a></code></strong></div>
<div class="block">Find the index of a maximal element. Returns the first maximal element in case of a tie.
Returns -1 if vector has length 0.</div>
<dl>
<dt><strong>Specified by:</strong></dt>
<dd><code><a href="../../../../../org/apache/spark/mllib/linalg/Vector.html#argmax()">argmax</a></code> in interface <code><a href="../../../../../org/apache/spark/mllib/linalg/Vector.html" title="interface in org.apache.spark.mllib.linalg">Vector</a></code></dd>
<dt><span class="strong">Returns:</span></dt><dd>(undocumented)</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="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>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../../org/apache/spark/mllib/linalg/DenseMatrix.html" title="class in org.apache.spark.mllib.linalg"><span class="strong">Prev Class</span></a></li>
<li><a href="../../../../../org/apache/spark/mllib/linalg/Matrices.html" title="class in org.apache.spark.mllib.linalg"><span class="strong">Next Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../../index.html?org/apache/spark/mllib/linalg/DenseVector.html" target="_top">Frames</a></li>
<li><a href="DenseVector.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>Field | </li>
<li><a href="#constructor_summary">Constr</a> | </li>
<li><a href="#method_summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail: </li>
<li>Field | </li>
<li><a href="#constructor_detail">Constr</a> | </li>
<li><a href="#method_detail">Method</a></li>
</ul>
</div>
<a name="skip-navbar_bottom">
<!-- -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
<script defer="defer" type="text/javascript" src="../../../../../lib/jquery.js"></script><script defer="defer" type="text/javascript" src="../../../../../lib/api-javadocs.js"></script></body>
</html>
|