blob: 7e0ce580c92f182a5e62b52b10da57c095b8367e [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>
<!-- Generated by javadoc (1.8.0_121) on Fri Apr 14 22:10:57 PDT 2017 -->
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Vector (Mahout Math 0.13.0 API)</title>
<meta name="date" content="2017-04-14">
<link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style">
<script type="text/javascript" src="../../../../script.js"></script>
</head>
<body>
<script type="text/javascript"><!--
try {
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="Vector (Mahout Math 0.13.0 API)";
}
}
catch(err) {
}
//-->
var methods = {"i0":6,"i1":6,"i2":6,"i3":6,"i4":6,"i5":6,"i6":6,"i7":6,"i8":6,"i9":6,"i10":6,"i11":6,"i12":6,"i13":6,"i14":6,"i15":6,"i16":6,"i17":6,"i18":6,"i19":6,"i20":6,"i21":6,"i22":6,"i23":6,"i24":6,"i25":6,"i26":6,"i27":6,"i28":6,"i29":6,"i30":6,"i31":6,"i32":6,"i33":6,"i34":6,"i35":6,"i36":6,"i37":6,"i38":6,"i39":6,"i40":6,"i41":6,"i42":6,"i43":6,"i44":6,"i45":6,"i46":6,"i47":6,"i48":6,"i49":6};
var tabs = {65535:["t0","All Methods"],2:["t2","Instance Methods"],4:["t3","Abstract Methods"]};
var altColor = "altColor";
var rowColor = "rowColor";
var tableTab = "tableTab";
var activeTableTab = "activeTableTab";
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a name="navbar.top">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div>
<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/Vector.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>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../org/apache/mahout/math/UpperTriangular.html" title="class in org.apache.mahout.math"><span class="typeNameLink">Prev&nbsp;Class</span></a></li>
<li><a href="../../../../org/apache/mahout/math/Vector.Element.html" title="interface in org.apache.mahout.math"><span class="typeNameLink">Next&nbsp;Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../index.html?org/apache/mahout/math/Vector.html" target="_top">Frames</a></li>
<li><a href="Vector.html" target="_top">No&nbsp;Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../../../allclasses-noframe.html">All&nbsp;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><a href="#nested.class.summary">Nested</a>&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.mahout.math</div>
<h2 title="Interface Vector" class="title">Interface Vector</h2>
</div>
<div class="contentContainer">
<div class="description">
<ul class="blockList">
<li class="blockList">
<dl>
<dt>All Superinterfaces:</dt>
<dd><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Cloneable.html?is-external=true" title="class or interface in java.lang">Cloneable</a></dd>
</dl>
<dl>
<dt>All Known Implementing Classes:</dt>
<dd><a href="../../../../org/apache/mahout/math/AbstractMatrix.TransposeViewVector.html" title="class in org.apache.mahout.math">AbstractMatrix.TransposeViewVector</a>, <a href="../../../../org/apache/mahout/math/AbstractVector.html" title="class in org.apache.mahout.math">AbstractVector</a>, <a href="../../../../org/apache/mahout/math/Centroid.html" title="class in org.apache.mahout.math">Centroid</a>, <a href="../../../../org/apache/mahout/math/ConstantVector.html" title="class in org.apache.mahout.math">ConstantVector</a>, <a href="../../../../org/apache/mahout/math/DelegatingVector.html" title="class in org.apache.mahout.math">DelegatingVector</a>, <a href="../../../../org/apache/mahout/math/DenseVector.html" title="class in org.apache.mahout.math">DenseVector</a>, <a href="../../../../org/apache/mahout/math/DiagonalMatrix.SingleElementVector.html" title="class in org.apache.mahout.math">DiagonalMatrix.SingleElementVector</a>, <a href="../../../../org/apache/mahout/math/MatrixSlice.html" title="class in org.apache.mahout.math">MatrixSlice</a>, <a href="../../../../org/apache/mahout/math/MatrixVectorView.html" title="class in org.apache.mahout.math">MatrixVectorView</a>, <a href="../../../../org/apache/mahout/math/NamedVector.html" title="class in org.apache.mahout.math">NamedVector</a>, <a href="../../../../org/apache/mahout/math/PermutedVectorView.html" title="class in org.apache.mahout.math">PermutedVectorView</a>, <a href="../../../../org/apache/mahout/math/RandomAccessSparseVector.html" title="class in org.apache.mahout.math">RandomAccessSparseVector</a>, <a href="../../../../org/apache/mahout/math/SequentialAccessSparseVector.html" title="class in org.apache.mahout.math">SequentialAccessSparseVector</a>, <a href="../../../../org/apache/mahout/math/VectorView.html" title="class in org.apache.mahout.math">VectorView</a>, <a href="../../../../org/apache/mahout/math/WeightedVector.html" title="class in org.apache.mahout.math">WeightedVector</a></dd>
</dl>
<hr>
<br>
<pre>public interface <span class="typeNameLabel">Vector</span>
extends <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Cloneable.html?is-external=true" title="class or interface in java.lang">Cloneable</a></pre>
<div class="block">The basic interface including numerous convenience functions <p> NOTE: All implementing classes must have a
constructor that takes an int for cardinality and a no-arg constructor that can be used for marshalling the Writable
instance <p> NOTE: Implementations may choose to reuse the Vector.Element in the Iterable methods</div>
</li>
</ul>
</div>
<div class="summary">
<ul class="blockList">
<li class="blockList">
<!-- ======== NESTED CLASS SUMMARY ======== -->
<ul class="blockList">
<li class="blockList"><a name="nested.class.summary">
<!-- -->
</a>
<h3>Nested Class Summary</h3>
<table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Nested Class Summary table, listing nested classes, and an explanation">
<caption><span>Nested Classes</span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Interface and Description</th>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static interface&nbsp;</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/mahout/math/Vector.Element.html" title="interface in org.apache.mahout.math">Vector.Element</a></span></code>
<div class="block">A holder for information about a specific item in the Vector.</div>
</td>
</tr>
</table>
</li>
</ul>
<!-- ========== METHOD SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="method.summary">
<!-- -->
</a>
<h3>Method Summary</h3>
<table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation">
<caption><span id="t0" class="activeTableTab"><span>All Methods</span><span class="tabEnd">&nbsp;</span></span><span id="t2" class="tableTab"><span><a href="javascript:show(2);">Instance Methods</a></span><span class="tabEnd">&nbsp;</span></span><span id="t3" class="tableTab"><span><a href="javascript:show(4);">Abstract Methods</a></span><span class="tabEnd">&nbsp;</span></span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Method and Description</th>
</tr>
<tr id="i0" class="altColor">
<td class="colFirst"><code>double</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/mahout/math/Vector.html#aggregate-org.apache.mahout.math.function.DoubleDoubleFunction-org.apache.mahout.math.function.DoubleFunction-">aggregate</a></span>(<a href="../../../../org/apache/mahout/math/function/DoubleDoubleFunction.html" title="class in org.apache.mahout.math.function">DoubleDoubleFunction</a>&nbsp;aggregator,
<a href="../../../../org/apache/mahout/math/function/DoubleFunction.html" title="class in org.apache.mahout.math.function">DoubleFunction</a>&nbsp;map)</code>
<div class="block">Examples speak louder than words: aggregate(plus, pow(2)) is another way to say
getLengthSquared(), aggregate(max, abs) is norm(Double.POSITIVE_INFINITY).</div>
</td>
</tr>
<tr id="i1" class="rowColor">
<td class="colFirst"><code>double</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/mahout/math/Vector.html#aggregate-org.apache.mahout.math.Vector-org.apache.mahout.math.function.DoubleDoubleFunction-org.apache.mahout.math.function.DoubleDoubleFunction-">aggregate</a></span>(<a href="../../../../org/apache/mahout/math/Vector.html" title="interface in org.apache.mahout.math">Vector</a>&nbsp;other,
<a href="../../../../org/apache/mahout/math/function/DoubleDoubleFunction.html" title="class in org.apache.mahout.math.function">DoubleDoubleFunction</a>&nbsp;aggregator,
<a href="../../../../org/apache/mahout/math/function/DoubleDoubleFunction.html" title="class in org.apache.mahout.math.function">DoubleDoubleFunction</a>&nbsp;combiner)</code>
<div class="block">Generalized inner product - take two vectors, iterate over them both, using the combiner to combine together
(and possibly map in some way) each pair of values, which are then aggregated with the previous accumulated
value in the combiner.</div>
</td>
</tr>
<tr id="i2" class="altColor">
<td class="colFirst"><code><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Iterable.html?is-external=true" title="class or interface in java.lang">Iterable</a>&lt;<a href="../../../../org/apache/mahout/math/Vector.Element.html" title="interface in org.apache.mahout.math">Vector.Element</a>&gt;</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/mahout/math/Vector.html#all--">all</a></span>()</code>&nbsp;</td>
</tr>
<tr id="i3" class="rowColor">
<td class="colFirst"><code><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/mahout/math/Vector.html#asFormatString--">asFormatString</a></span>()</code>&nbsp;</td>
</tr>
<tr id="i4" class="altColor">
<td class="colFirst"><code><a href="../../../../org/apache/mahout/math/Vector.html" title="interface in org.apache.mahout.math">Vector</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/mahout/math/Vector.html#assign-double-">assign</a></span>(double&nbsp;value)</code>
<div class="block">Assign the value to all elements of the receiver</div>
</td>
</tr>
<tr id="i5" class="rowColor">
<td class="colFirst"><code><a href="../../../../org/apache/mahout/math/Vector.html" title="interface in org.apache.mahout.math">Vector</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/mahout/math/Vector.html#assign-double:A-">assign</a></span>(double[]&nbsp;values)</code>
<div class="block">Assign the values to the receiver</div>
</td>
</tr>
<tr id="i6" class="altColor">
<td class="colFirst"><code><a href="../../../../org/apache/mahout/math/Vector.html" title="interface in org.apache.mahout.math">Vector</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/mahout/math/Vector.html#assign-org.apache.mahout.math.function.DoubleDoubleFunction-double-">assign</a></span>(<a href="../../../../org/apache/mahout/math/function/DoubleDoubleFunction.html" title="class in org.apache.mahout.math.function">DoubleDoubleFunction</a>&nbsp;f,
double&nbsp;y)</code>
<div class="block">Apply the function to each element of the receiver, using the y value as the second argument of the
DoubleDoubleFunction</div>
</td>
</tr>
<tr id="i7" class="rowColor">
<td class="colFirst"><code><a href="../../../../org/apache/mahout/math/Vector.html" title="interface in org.apache.mahout.math">Vector</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/mahout/math/Vector.html#assign-org.apache.mahout.math.function.DoubleFunction-">assign</a></span>(<a href="../../../../org/apache/mahout/math/function/DoubleFunction.html" title="class in org.apache.mahout.math.function">DoubleFunction</a>&nbsp;function)</code>
<div class="block">Apply the function to each element of the receiver</div>
</td>
</tr>
<tr id="i8" class="altColor">
<td class="colFirst"><code><a href="../../../../org/apache/mahout/math/Vector.html" title="interface in org.apache.mahout.math">Vector</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/mahout/math/Vector.html#assign-org.apache.mahout.math.Vector-">assign</a></span>(<a href="../../../../org/apache/mahout/math/Vector.html" title="interface in org.apache.mahout.math">Vector</a>&nbsp;other)</code>
<div class="block">Assign the other vector values to the receiver</div>
</td>
</tr>
<tr id="i9" class="rowColor">
<td class="colFirst"><code><a href="../../../../org/apache/mahout/math/Vector.html" title="interface in org.apache.mahout.math">Vector</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/mahout/math/Vector.html#assign-org.apache.mahout.math.Vector-org.apache.mahout.math.function.DoubleDoubleFunction-">assign</a></span>(<a href="../../../../org/apache/mahout/math/Vector.html" title="interface in org.apache.mahout.math">Vector</a>&nbsp;other,
<a href="../../../../org/apache/mahout/math/function/DoubleDoubleFunction.html" title="class in org.apache.mahout.math.function">DoubleDoubleFunction</a>&nbsp;function)</code>
<div class="block">Apply the function to each element of the receiver and the corresponding element of the other argument</div>
</td>
</tr>
<tr id="i10" class="altColor">
<td class="colFirst"><code><a href="../../../../org/apache/mahout/math/Vector.html" title="interface in org.apache.mahout.math">Vector</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/mahout/math/Vector.html#clone--">clone</a></span>()</code>
<div class="block">Return a copy of the recipient</div>
</td>
</tr>
<tr id="i11" class="rowColor">
<td class="colFirst"><code><a href="../../../../org/apache/mahout/math/Matrix.html" title="interface in org.apache.mahout.math">Matrix</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/mahout/math/Vector.html#cross-org.apache.mahout.math.Vector-">cross</a></span>(<a href="../../../../org/apache/mahout/math/Vector.html" title="interface in org.apache.mahout.math">Vector</a>&nbsp;other)</code>
<div class="block">Return the cross product of the receiver and the other vector</div>
</td>
</tr>
<tr id="i12" class="altColor">
<td class="colFirst"><code><a href="../../../../org/apache/mahout/math/Vector.html" title="interface in org.apache.mahout.math">Vector</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/mahout/math/Vector.html#divide-double-">divide</a></span>(double&nbsp;x)</code>
<div class="block">Return a new vector containing the values of the recipient divided by the argument</div>
</td>
</tr>
<tr id="i13" class="rowColor">
<td class="colFirst"><code>double</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/mahout/math/Vector.html#dot-org.apache.mahout.math.Vector-">dot</a></span>(<a href="../../../../org/apache/mahout/math/Vector.html" title="interface in org.apache.mahout.math">Vector</a>&nbsp;x)</code>
<div class="block">Return the dot product of the recipient and the argument</div>
</td>
</tr>
<tr id="i14" class="altColor">
<td class="colFirst"><code>double</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/mahout/math/Vector.html#get-int-">get</a></span>(int&nbsp;index)</code>
<div class="block">Return the value at the given index</div>
</td>
</tr>
<tr id="i15" class="rowColor">
<td class="colFirst"><code>double</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/mahout/math/Vector.html#getDistanceSquared-org.apache.mahout.math.Vector-">getDistanceSquared</a></span>(<a href="../../../../org/apache/mahout/math/Vector.html" title="interface in org.apache.mahout.math">Vector</a>&nbsp;v)</code>
<div class="block">Get the square of the distance between this vector and the other vector.</div>
</td>
</tr>
<tr id="i16" class="altColor">
<td class="colFirst"><code><a href="../../../../org/apache/mahout/math/Vector.Element.html" title="interface in org.apache.mahout.math">Vector.Element</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/mahout/math/Vector.html#getElement-int-">getElement</a></span>(int&nbsp;index)</code>
<div class="block">Return an object of Vector.Element representing an element of this Vector.</div>
</td>
</tr>
<tr id="i17" class="rowColor">
<td class="colFirst"><code>double</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/mahout/math/Vector.html#getIteratorAdvanceCost--">getIteratorAdvanceCost</a></span>()</code>
<div class="block">Gets an estimate of the cost (in number of operations) it takes to advance an iterator through the nonzero
elements of this vector.</div>
</td>
</tr>
<tr id="i18" class="altColor">
<td class="colFirst"><code>double</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/mahout/math/Vector.html#getLengthSquared--">getLengthSquared</a></span>()</code>
<div class="block">Return the sum of squares of all elements in the vector.</div>
</td>
</tr>
<tr id="i19" class="rowColor">
<td class="colFirst"><code>double</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/mahout/math/Vector.html#getLookupCost--">getLookupCost</a></span>()</code>
<div class="block">Gets an estimate of the cost (in number of operations) it takes to lookup a random element in this vector.</div>
</td>
</tr>
<tr id="i20" class="altColor">
<td class="colFirst"><code>int</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/mahout/math/Vector.html#getNumNondefaultElements--">getNumNondefaultElements</a></span>()</code>
<div class="block">Return the number of values in the recipient which are not the default value.</div>
</td>
</tr>
<tr id="i21" class="rowColor">
<td class="colFirst"><code>int</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/mahout/math/Vector.html#getNumNonZeroElements--">getNumNonZeroElements</a></span>()</code>
<div class="block">Return the number of non zero elements in the vector.</div>
</td>
</tr>
<tr id="i22" class="altColor">
<td class="colFirst"><code>double</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/mahout/math/Vector.html#getQuick-int-">getQuick</a></span>(int&nbsp;index)</code>
<div class="block">Return the value at the given index, without checking bounds</div>
</td>
</tr>
<tr id="i23" class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/mahout/math/Vector.html#incrementQuick-int-double-">incrementQuick</a></span>(int&nbsp;index,
double&nbsp;increment)</code>
<div class="block">Increment the value at the given index by the given value.</div>
</td>
</tr>
<tr id="i24" class="altColor">
<td class="colFirst"><code>boolean</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/mahout/math/Vector.html#isAddConstantTime--">isAddConstantTime</a></span>()</code>
<div class="block">Return true iff adding a new (nonzero) element takes constant time for this vector.</div>
</td>
</tr>
<tr id="i25" class="rowColor">
<td class="colFirst"><code>boolean</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/mahout/math/Vector.html#isDense--">isDense</a></span>()</code>
<div class="block">true if this implementation should be considered dense -- that it explicitly
represents every value</div>
</td>
</tr>
<tr id="i26" class="altColor">
<td class="colFirst"><code>boolean</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/mahout/math/Vector.html#isSequentialAccess--">isSequentialAccess</a></span>()</code>
<div class="block">true if this implementation should be considered to be iterable in index order in an efficient way.</div>
</td>
</tr>
<tr id="i27" class="rowColor">
<td class="colFirst"><code><a href="../../../../org/apache/mahout/math/Vector.html" title="interface in org.apache.mahout.math">Vector</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/mahout/math/Vector.html#like--">like</a></span>()</code>
<div class="block">Return an empty vector of the same underlying class as the receiver</div>
</td>
</tr>
<tr id="i28" class="altColor">
<td class="colFirst"><code><a href="../../../../org/apache/mahout/math/Vector.html" title="interface in org.apache.mahout.math">Vector</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/mahout/math/Vector.html#like-int-">like</a></span>(int&nbsp;cardinality)</code>
<div class="block">Return a new empty vector of the same underlying class as the receiver with given cardinality</div>
</td>
</tr>
<tr id="i29" class="rowColor">
<td class="colFirst"><code><a href="../../../../org/apache/mahout/math/Vector.html" title="interface in org.apache.mahout.math">Vector</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/mahout/math/Vector.html#logNormalize--">logNormalize</a></span>()</code>
<div class="block">Return a new vector containing the log(1 + entry)/ L_2 norm values of the recipient</div>
</td>
</tr>
<tr id="i30" class="altColor">
<td class="colFirst"><code><a href="../../../../org/apache/mahout/math/Vector.html" title="interface in org.apache.mahout.math">Vector</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/mahout/math/Vector.html#logNormalize-double-">logNormalize</a></span>(double&nbsp;power)</code>
<div class="block">Return a new Vector with a normalized value calculated as log_power(1 + entry)/ L_power norm.</div>
</td>
</tr>
<tr id="i31" class="rowColor">
<td class="colFirst"><code>double</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/mahout/math/Vector.html#maxValue--">maxValue</a></span>()</code>&nbsp;</td>
</tr>
<tr id="i32" class="altColor">
<td class="colFirst"><code>int</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/mahout/math/Vector.html#maxValueIndex--">maxValueIndex</a></span>()</code>&nbsp;</td>
</tr>
<tr id="i33" class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/mahout/math/Vector.html#mergeUpdates-org.apache.mahout.math.OrderedIntDoubleMapping-">mergeUpdates</a></span>(<a href="../../../../org/apache/mahout/math/OrderedIntDoubleMapping.html" title="class in org.apache.mahout.math">OrderedIntDoubleMapping</a>&nbsp;updates)</code>
<div class="block">Merge a set of (index, value) pairs into the vector.</div>
</td>
</tr>
<tr id="i34" class="altColor">
<td class="colFirst"><code><a href="../../../../org/apache/mahout/math/Vector.html" title="interface in org.apache.mahout.math">Vector</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/mahout/math/Vector.html#minus-org.apache.mahout.math.Vector-">minus</a></span>(<a href="../../../../org/apache/mahout/math/Vector.html" title="interface in org.apache.mahout.math">Vector</a>&nbsp;x)</code>
<div class="block">Return a new vector containing the element by element difference of the recipient and the argument</div>
</td>
</tr>
<tr id="i35" class="rowColor">
<td class="colFirst"><code>double</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/mahout/math/Vector.html#minValue--">minValue</a></span>()</code>&nbsp;</td>
</tr>
<tr id="i36" class="altColor">
<td class="colFirst"><code>int</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/mahout/math/Vector.html#minValueIndex--">minValueIndex</a></span>()</code>&nbsp;</td>
</tr>
<tr id="i37" class="rowColor">
<td class="colFirst"><code><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Iterable.html?is-external=true" title="class or interface in java.lang">Iterable</a>&lt;<a href="../../../../org/apache/mahout/math/Vector.Element.html" title="interface in org.apache.mahout.math">Vector.Element</a>&gt;</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/mahout/math/Vector.html#nonZeroes--">nonZeroes</a></span>()</code>&nbsp;</td>
</tr>
<tr id="i38" class="altColor">
<td class="colFirst"><code>double</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/mahout/math/Vector.html#norm-double-">norm</a></span>(double&nbsp;power)</code>
<div class="block">Return the k-norm of the vector.</div>
</td>
</tr>
<tr id="i39" class="rowColor">
<td class="colFirst"><code><a href="../../../../org/apache/mahout/math/Vector.html" title="interface in org.apache.mahout.math">Vector</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/mahout/math/Vector.html#normalize--">normalize</a></span>()</code>
<div class="block">Return a new vector containing the normalized (L_2 norm) values of the recipient</div>
</td>
</tr>
<tr id="i40" class="altColor">
<td class="colFirst"><code><a href="../../../../org/apache/mahout/math/Vector.html" title="interface in org.apache.mahout.math">Vector</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/mahout/math/Vector.html#normalize-double-">normalize</a></span>(double&nbsp;power)</code>
<div class="block">Return a new Vector containing the normalized (L_power norm) values of the recipient.</div>
</td>
</tr>
<tr id="i41" class="rowColor">
<td class="colFirst"><code><a href="../../../../org/apache/mahout/math/Vector.html" title="interface in org.apache.mahout.math">Vector</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/mahout/math/Vector.html#plus-double-">plus</a></span>(double&nbsp;x)</code>
<div class="block">Return a new vector containing the sum of each value of the recipient and the argument</div>
</td>
</tr>
<tr id="i42" class="altColor">
<td class="colFirst"><code><a href="../../../../org/apache/mahout/math/Vector.html" title="interface in org.apache.mahout.math">Vector</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/mahout/math/Vector.html#plus-org.apache.mahout.math.Vector-">plus</a></span>(<a href="../../../../org/apache/mahout/math/Vector.html" title="interface in org.apache.mahout.math">Vector</a>&nbsp;x)</code>
<div class="block">Return a new vector containing the element by element sum of the recipient and the argument</div>
</td>
</tr>
<tr id="i43" class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/mahout/math/Vector.html#set-int-double-">set</a></span>(int&nbsp;index,
double&nbsp;value)</code>
<div class="block">Set the value at the given index</div>
</td>
</tr>
<tr id="i44" class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/mahout/math/Vector.html#setQuick-int-double-">setQuick</a></span>(int&nbsp;index,
double&nbsp;value)</code>
<div class="block">Set the value at the given index, without checking bounds</div>
</td>
</tr>
<tr id="i45" class="rowColor">
<td class="colFirst"><code>int</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/mahout/math/Vector.html#size--">size</a></span>()</code>
<div class="block">Return the cardinality of the recipient (the maximum number of values)</div>
</td>
</tr>
<tr id="i46" class="altColor">
<td class="colFirst"><code><a href="../../../../org/apache/mahout/math/Vector.html" title="interface in org.apache.mahout.math">Vector</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/mahout/math/Vector.html#times-double-">times</a></span>(double&nbsp;x)</code>
<div class="block">Return a new vector containing the product of each value of the recipient and the argument</div>
</td>
</tr>
<tr id="i47" class="rowColor">
<td class="colFirst"><code><a href="../../../../org/apache/mahout/math/Vector.html" title="interface in org.apache.mahout.math">Vector</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/mahout/math/Vector.html#times-org.apache.mahout.math.Vector-">times</a></span>(<a href="../../../../org/apache/mahout/math/Vector.html" title="interface in org.apache.mahout.math">Vector</a>&nbsp;x)</code>
<div class="block">Return a new vector containing the element-wise product of the recipient and the argument</div>
</td>
</tr>
<tr id="i48" class="altColor">
<td class="colFirst"><code><a href="../../../../org/apache/mahout/math/Vector.html" title="interface in org.apache.mahout.math">Vector</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/mahout/math/Vector.html#viewPart-int-int-">viewPart</a></span>(int&nbsp;offset,
int&nbsp;length)</code>
<div class="block">Return a new vector containing the subset of the recipient</div>
</td>
</tr>
<tr id="i49" class="rowColor">
<td class="colFirst"><code>double</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/mahout/math/Vector.html#zSum--">zSum</a></span>()</code>
<div class="block">Return the sum of all the elements of the receiver</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="asFormatString--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>asFormatString</h4>
<pre><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;asFormatString()</pre>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>a formatted String suitable for output</dd>
</dl>
</li>
</ul>
<a name="assign-double-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>assign</h4>
<pre><a href="../../../../org/apache/mahout/math/Vector.html" title="interface in org.apache.mahout.math">Vector</a>&nbsp;assign(double&nbsp;value)</pre>
<div class="block">Assign the value to all elements of the receiver</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>value</code> - a double value</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the modified receiver</dd>
</dl>
</li>
</ul>
<a name="assign-double:A-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>assign</h4>
<pre><a href="../../../../org/apache/mahout/math/Vector.html" title="interface in org.apache.mahout.math">Vector</a>&nbsp;assign(double[]&nbsp;values)</pre>
<div class="block">Assign the values to the receiver</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>values</code> - a double[] of values</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the modified receiver</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="../../../../org/apache/mahout/math/CardinalityException.html" title="class in org.apache.mahout.math">CardinalityException</a></code> - if the cardinalities differ</dd>
</dl>
</li>
</ul>
<a name="assign-org.apache.mahout.math.Vector-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>assign</h4>
<pre><a href="../../../../org/apache/mahout/math/Vector.html" title="interface in org.apache.mahout.math">Vector</a>&nbsp;assign(<a href="../../../../org/apache/mahout/math/Vector.html" title="interface in org.apache.mahout.math">Vector</a>&nbsp;other)</pre>
<div class="block">Assign the other vector values to the receiver</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>other</code> - a Vector</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the modified receiver</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="../../../../org/apache/mahout/math/CardinalityException.html" title="class in org.apache.mahout.math">CardinalityException</a></code> - if the cardinalities differ</dd>
</dl>
</li>
</ul>
<a name="assign-org.apache.mahout.math.function.DoubleFunction-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>assign</h4>
<pre><a href="../../../../org/apache/mahout/math/Vector.html" title="interface in org.apache.mahout.math">Vector</a>&nbsp;assign(<a href="../../../../org/apache/mahout/math/function/DoubleFunction.html" title="class in org.apache.mahout.math.function">DoubleFunction</a>&nbsp;function)</pre>
<div class="block">Apply the function to each element of the receiver</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>function</code> - a DoubleFunction to apply</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the modified receiver</dd>
</dl>
</li>
</ul>
<a name="assign-org.apache.mahout.math.Vector-org.apache.mahout.math.function.DoubleDoubleFunction-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>assign</h4>
<pre><a href="../../../../org/apache/mahout/math/Vector.html" title="interface in org.apache.mahout.math">Vector</a>&nbsp;assign(<a href="../../../../org/apache/mahout/math/Vector.html" title="interface in org.apache.mahout.math">Vector</a>&nbsp;other,
<a href="../../../../org/apache/mahout/math/function/DoubleDoubleFunction.html" title="class in org.apache.mahout.math.function">DoubleDoubleFunction</a>&nbsp;function)</pre>
<div class="block">Apply the function to each element of the receiver and the corresponding element of the other argument</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>other</code> - a Vector containing the second arguments to the function</dd>
<dd><code>function</code> - a DoubleDoubleFunction to apply</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the modified receiver</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="../../../../org/apache/mahout/math/CardinalityException.html" title="class in org.apache.mahout.math">CardinalityException</a></code> - if the cardinalities differ</dd>
</dl>
</li>
</ul>
<a name="assign-org.apache.mahout.math.function.DoubleDoubleFunction-double-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>assign</h4>
<pre><a href="../../../../org/apache/mahout/math/Vector.html" title="interface in org.apache.mahout.math">Vector</a>&nbsp;assign(<a href="../../../../org/apache/mahout/math/function/DoubleDoubleFunction.html" title="class in org.apache.mahout.math.function">DoubleDoubleFunction</a>&nbsp;f,
double&nbsp;y)</pre>
<div class="block">Apply the function to each element of the receiver, using the y value as the second argument of the
DoubleDoubleFunction</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>f</code> - a DoubleDoubleFunction to be applied</dd>
<dd><code>y</code> - a double value to be argument to the function</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the modified receiver</dd>
</dl>
</li>
</ul>
<a name="size--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>size</h4>
<pre>int&nbsp;size()</pre>
<div class="block">Return the cardinality of the recipient (the maximum number of values)</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>an int</dd>
</dl>
</li>
</ul>
<a name="isDense--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>isDense</h4>
<pre>boolean&nbsp;isDense()</pre>
<div class="block">true if this implementation should be considered dense -- that it explicitly
represents every value</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>true or false</dd>
</dl>
</li>
</ul>
<a name="isSequentialAccess--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>isSequentialAccess</h4>
<pre>boolean&nbsp;isSequentialAccess()</pre>
<div class="block">true if this implementation should be considered to be iterable in index order in an efficient way.
In particular this implies that <a href="../../../../org/apache/mahout/math/Vector.html#all--"><code>all()</code></a> and <a href="../../../../org/apache/mahout/math/Vector.html#nonZeroes--"><code>nonZeroes()</code></a> ()} return elements
in ascending order by index.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>true iff this implementation should be considered to be iterable in index order in an efficient way.</dd>
</dl>
</li>
</ul>
<a name="clone--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>clone</h4>
<pre><a href="../../../../org/apache/mahout/math/Vector.html" title="interface in org.apache.mahout.math">Vector</a>&nbsp;clone()</pre>
<div class="block">Return a copy of the recipient</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>a new Vector</dd>
</dl>
</li>
</ul>
<a name="all--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>all</h4>
<pre><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Iterable.html?is-external=true" title="class or interface in java.lang">Iterable</a>&lt;<a href="../../../../org/apache/mahout/math/Vector.Element.html" title="interface in org.apache.mahout.math">Vector.Element</a>&gt;&nbsp;all()</pre>
</li>
</ul>
<a name="nonZeroes--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>nonZeroes</h4>
<pre><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Iterable.html?is-external=true" title="class or interface in java.lang">Iterable</a>&lt;<a href="../../../../org/apache/mahout/math/Vector.Element.html" title="interface in org.apache.mahout.math">Vector.Element</a>&gt;&nbsp;nonZeroes()</pre>
</li>
</ul>
<a name="getElement-int-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getElement</h4>
<pre><a href="../../../../org/apache/mahout/math/Vector.Element.html" title="interface in org.apache.mahout.math">Vector.Element</a>&nbsp;getElement(int&nbsp;index)</pre>
<div class="block">Return an object of Vector.Element representing an element of this Vector. Useful when designing new iterator
types.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>index</code> - Index of the Vector.Element required</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>The Vector.Element Object</dd>
</dl>
</li>
</ul>
<a name="mergeUpdates-org.apache.mahout.math.OrderedIntDoubleMapping-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>mergeUpdates</h4>
<pre>void&nbsp;mergeUpdates(<a href="../../../../org/apache/mahout/math/OrderedIntDoubleMapping.html" title="class in org.apache.mahout.math">OrderedIntDoubleMapping</a>&nbsp;updates)</pre>
<div class="block">Merge a set of (index, value) pairs into the vector.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>updates</code> - an ordered mapping of indices to values to be merged in.</dd>
</dl>
</li>
</ul>
<a name="divide-double-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>divide</h4>
<pre><a href="../../../../org/apache/mahout/math/Vector.html" title="interface in org.apache.mahout.math">Vector</a>&nbsp;divide(double&nbsp;x)</pre>
<div class="block">Return a new vector containing the values of the recipient divided by the argument</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>x</code> - a double value</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>a new Vector</dd>
</dl>
</li>
</ul>
<a name="dot-org.apache.mahout.math.Vector-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>dot</h4>
<pre>double&nbsp;dot(<a href="../../../../org/apache/mahout/math/Vector.html" title="interface in org.apache.mahout.math">Vector</a>&nbsp;x)</pre>
<div class="block">Return the dot product of the recipient and the argument</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>x</code> - a Vector</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>a new Vector</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="../../../../org/apache/mahout/math/CardinalityException.html" title="class in org.apache.mahout.math">CardinalityException</a></code> - if the cardinalities differ</dd>
</dl>
</li>
</ul>
<a name="get-int-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>get</h4>
<pre>double&nbsp;get(int&nbsp;index)</pre>
<div class="block">Return the value at the given index</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>index</code> - an int index</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the double at the index</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="../../../../org/apache/mahout/math/IndexException.html" title="class in org.apache.mahout.math">IndexException</a></code> - if the index is out of bounds</dd>
</dl>
</li>
</ul>
<a name="getQuick-int-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getQuick</h4>
<pre>double&nbsp;getQuick(int&nbsp;index)</pre>
<div class="block">Return the value at the given index, without checking bounds</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>index</code> - an int index</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the double at the index</dd>
</dl>
</li>
</ul>
<a name="like--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>like</h4>
<pre><a href="../../../../org/apache/mahout/math/Vector.html" title="interface in org.apache.mahout.math">Vector</a>&nbsp;like()</pre>
<div class="block">Return an empty vector of the same underlying class as the receiver</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>a Vector</dd>
</dl>
</li>
</ul>
<a name="like-int-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>like</h4>
<pre><a href="../../../../org/apache/mahout/math/Vector.html" title="interface in org.apache.mahout.math">Vector</a>&nbsp;like(int&nbsp;cardinality)</pre>
<div class="block">Return a new empty vector of the same underlying class as the receiver with given cardinality</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>cardinality</code> - - size of vector</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd><a href="../../../../org/apache/mahout/math/Vector.html" title="interface in org.apache.mahout.math"><code>Vector</code></a></dd>
</dl>
</li>
</ul>
<a name="minus-org.apache.mahout.math.Vector-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>minus</h4>
<pre><a href="../../../../org/apache/mahout/math/Vector.html" title="interface in org.apache.mahout.math">Vector</a>&nbsp;minus(<a href="../../../../org/apache/mahout/math/Vector.html" title="interface in org.apache.mahout.math">Vector</a>&nbsp;x)</pre>
<div class="block">Return a new vector containing the element by element difference of the recipient and the argument</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>x</code> - a Vector</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>a new Vector</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="../../../../org/apache/mahout/math/CardinalityException.html" title="class in org.apache.mahout.math">CardinalityException</a></code> - if the cardinalities differ</dd>
</dl>
</li>
</ul>
<a name="normalize--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>normalize</h4>
<pre><a href="../../../../org/apache/mahout/math/Vector.html" title="interface in org.apache.mahout.math">Vector</a>&nbsp;normalize()</pre>
<div class="block">Return a new vector containing the normalized (L_2 norm) values of the recipient</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>a new Vector</dd>
</dl>
</li>
</ul>
<a name="normalize-double-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>normalize</h4>
<pre><a href="../../../../org/apache/mahout/math/Vector.html" title="interface in org.apache.mahout.math">Vector</a>&nbsp;normalize(double&nbsp;power)</pre>
<div class="block">Return a new Vector containing the normalized (L_power norm) values of the recipient. <p>
See
http://en.wikipedia.org/wiki/Lp_space <p>
Technically, when <code>0 &lt; power &lt; 1</code>, we don't have a norm, just a metric,
but we'll overload this here. <p>
Also supports <code>power == 0</code> (number of non-zero elements) and power = <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Double.html?is-external=true#POSITIVE_INFINITY" title="class or interface in java.lang"><code>Double.POSITIVE_INFINITY</code></a> (max element). Again, see the Wikipedia page for more info</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>power</code> - The power to use. Must be >= 0. May also be <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Double.html?is-external=true#POSITIVE_INFINITY" title="class or interface in java.lang"><code>Double.POSITIVE_INFINITY</code></a>. See the Wikipedia link
for more on this.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>a new Vector x such that norm(x, power) == 1</dd>
</dl>
</li>
</ul>
<a name="logNormalize--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>logNormalize</h4>
<pre><a href="../../../../org/apache/mahout/math/Vector.html" title="interface in org.apache.mahout.math">Vector</a>&nbsp;logNormalize()</pre>
<div class="block">Return a new vector containing the log(1 + entry)/ L_2 norm values of the recipient</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>a new Vector</dd>
</dl>
</li>
</ul>
<a name="logNormalize-double-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>logNormalize</h4>
<pre><a href="../../../../org/apache/mahout/math/Vector.html" title="interface in org.apache.mahout.math">Vector</a>&nbsp;logNormalize(double&nbsp;power)</pre>
<div class="block">Return a new Vector with a normalized value calculated as log_power(1 + entry)/ L_power norm. <p></div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>power</code> - The power to use. Must be > 1. Cannot be <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Double.html?is-external=true#POSITIVE_INFINITY" title="class or interface in java.lang"><code>Double.POSITIVE_INFINITY</code></a>.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>a new Vector</dd>
</dl>
</li>
</ul>
<a name="norm-double-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>norm</h4>
<pre>double&nbsp;norm(double&nbsp;power)</pre>
<div class="block">Return the k-norm of the vector. <p/> See http://en.wikipedia.org/wiki/Lp_space <p>
Technically, when <code>0 &gt; power &lt; 1</code>, we don't have a norm, just a metric, but we'll overload this here. Also supports power == 0 (number of
non-zero elements) and power = <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Double.html?is-external=true#POSITIVE_INFINITY" title="class or interface in java.lang"><code>Double.POSITIVE_INFINITY</code></a> (max element). Again, see the Wikipedia page for
more info.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>power</code> - The power to use.</dd>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="../../../../org/apache/mahout/math/Vector.html#normalize-double-"><code>normalize(double)</code></a></dd>
</dl>
</li>
</ul>
<a name="minValue--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>minValue</h4>
<pre>double&nbsp;minValue()</pre>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>The minimum value in the Vector</dd>
</dl>
</li>
</ul>
<a name="minValueIndex--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>minValueIndex</h4>
<pre>int&nbsp;minValueIndex()</pre>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>The index of the minimum value</dd>
</dl>
</li>
</ul>
<a name="maxValue--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>maxValue</h4>
<pre>double&nbsp;maxValue()</pre>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>The maximum value in the Vector</dd>
</dl>
</li>
</ul>
<a name="maxValueIndex--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>maxValueIndex</h4>
<pre>int&nbsp;maxValueIndex()</pre>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>The index of the maximum value</dd>
</dl>
</li>
</ul>
<a name="plus-double-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>plus</h4>
<pre><a href="../../../../org/apache/mahout/math/Vector.html" title="interface in org.apache.mahout.math">Vector</a>&nbsp;plus(double&nbsp;x)</pre>
<div class="block">Return a new vector containing the sum of each value of the recipient and the argument</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>x</code> - a double</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>a new Vector</dd>
</dl>
</li>
</ul>
<a name="plus-org.apache.mahout.math.Vector-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>plus</h4>
<pre><a href="../../../../org/apache/mahout/math/Vector.html" title="interface in org.apache.mahout.math">Vector</a>&nbsp;plus(<a href="../../../../org/apache/mahout/math/Vector.html" title="interface in org.apache.mahout.math">Vector</a>&nbsp;x)</pre>
<div class="block">Return a new vector containing the element by element sum of the recipient and the argument</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>x</code> - a Vector</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>a new Vector</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="../../../../org/apache/mahout/math/CardinalityException.html" title="class in org.apache.mahout.math">CardinalityException</a></code> - if the cardinalities differ</dd>
</dl>
</li>
</ul>
<a name="set-int-double-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>set</h4>
<pre>void&nbsp;set(int&nbsp;index,
double&nbsp;value)</pre>
<div class="block">Set the value at the given index</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>index</code> - an int index into the receiver</dd>
<dd><code>value</code> - a double value to set</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="../../../../org/apache/mahout/math/IndexException.html" title="class in org.apache.mahout.math">IndexException</a></code> - if the index is out of bounds</dd>
</dl>
</li>
</ul>
<a name="setQuick-int-double-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setQuick</h4>
<pre>void&nbsp;setQuick(int&nbsp;index,
double&nbsp;value)</pre>
<div class="block">Set the value at the given index, without checking bounds</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>index</code> - an int index into the receiver</dd>
<dd><code>value</code> - a double value to set</dd>
</dl>
</li>
</ul>
<a name="incrementQuick-int-double-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>incrementQuick</h4>
<pre>void&nbsp;incrementQuick(int&nbsp;index,
double&nbsp;increment)</pre>
<div class="block">Increment the value at the given index by the given value.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>index</code> - an int index into the receiver</dd>
<dd><code>increment</code> - sets the value at the given index to value + increment;</dd>
</dl>
</li>
</ul>
<a name="getNumNondefaultElements--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getNumNondefaultElements</h4>
<pre>int&nbsp;getNumNondefaultElements()</pre>
<div class="block">Return the number of values in the recipient which are not the default value. For instance, for a
sparse vector, this would be the number of non-zero values.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>an int</dd>
</dl>
</li>
</ul>
<a name="getNumNonZeroElements--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getNumNonZeroElements</h4>
<pre>int&nbsp;getNumNonZeroElements()</pre>
<div class="block">Return the number of non zero elements in the vector.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>an int</dd>
</dl>
</li>
</ul>
<a name="times-double-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>times</h4>
<pre><a href="../../../../org/apache/mahout/math/Vector.html" title="interface in org.apache.mahout.math">Vector</a>&nbsp;times(double&nbsp;x)</pre>
<div class="block">Return a new vector containing the product of each value of the recipient and the argument</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>x</code> - a double argument</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>a new Vector</dd>
</dl>
</li>
</ul>
<a name="times-org.apache.mahout.math.Vector-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>times</h4>
<pre><a href="../../../../org/apache/mahout/math/Vector.html" title="interface in org.apache.mahout.math">Vector</a>&nbsp;times(<a href="../../../../org/apache/mahout/math/Vector.html" title="interface in org.apache.mahout.math">Vector</a>&nbsp;x)</pre>
<div class="block">Return a new vector containing the element-wise product of the recipient and the argument</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>x</code> - a Vector argument</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>a new Vector</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="../../../../org/apache/mahout/math/CardinalityException.html" title="class in org.apache.mahout.math">CardinalityException</a></code> - if the cardinalities differ</dd>
</dl>
</li>
</ul>
<a name="viewPart-int-int-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>viewPart</h4>
<pre><a href="../../../../org/apache/mahout/math/Vector.html" title="interface in org.apache.mahout.math">Vector</a>&nbsp;viewPart(int&nbsp;offset,
int&nbsp;length)</pre>
<div class="block">Return a new vector containing the subset of the recipient</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>offset</code> - an int offset into the receiver</dd>
<dd><code>length</code> - the cardinality of the desired result</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>a new Vector</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="../../../../org/apache/mahout/math/CardinalityException.html" title="class in org.apache.mahout.math">CardinalityException</a></code> - if the length is greater than the cardinality of the receiver</dd>
<dd><code><a href="../../../../org/apache/mahout/math/IndexException.html" title="class in org.apache.mahout.math">IndexException</a></code> - if the offset is negative or the offset+length is outside of the receiver</dd>
</dl>
</li>
</ul>
<a name="zSum--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>zSum</h4>
<pre>double&nbsp;zSum()</pre>
<div class="block">Return the sum of all the elements of the receiver</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>a double</dd>
</dl>
</li>
</ul>
<a name="cross-org.apache.mahout.math.Vector-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>cross</h4>
<pre><a href="../../../../org/apache/mahout/math/Matrix.html" title="interface in org.apache.mahout.math">Matrix</a>&nbsp;cross(<a href="../../../../org/apache/mahout/math/Vector.html" title="interface in org.apache.mahout.math">Vector</a>&nbsp;other)</pre>
<div class="block">Return the cross product of the receiver and the other vector</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>other</code> - another Vector</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>a Matrix</dd>
</dl>
</li>
</ul>
<a name="aggregate-org.apache.mahout.math.function.DoubleDoubleFunction-org.apache.mahout.math.function.DoubleFunction-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>aggregate</h4>
<pre>double&nbsp;aggregate(<a href="../../../../org/apache/mahout/math/function/DoubleDoubleFunction.html" title="class in org.apache.mahout.math.function">DoubleDoubleFunction</a>&nbsp;aggregator,
<a href="../../../../org/apache/mahout/math/function/DoubleFunction.html" title="class in org.apache.mahout.math.function">DoubleFunction</a>&nbsp;map)</pre>
<div class="block">Examples speak louder than words: aggregate(plus, pow(2)) is another way to say
getLengthSquared(), aggregate(max, abs) is norm(Double.POSITIVE_INFINITY). To sum all of the positive values,
aggregate(plus, max(0)).</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>aggregator</code> - used to combine the current value of the aggregation with the result of map.apply(nextValue)</dd>
<dd><code>map</code> - a function to apply to each element of the vector in turn before passing to the aggregator</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the final aggregation</dd>
</dl>
</li>
</ul>
<a name="aggregate-org.apache.mahout.math.Vector-org.apache.mahout.math.function.DoubleDoubleFunction-org.apache.mahout.math.function.DoubleDoubleFunction-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>aggregate</h4>
<pre>double&nbsp;aggregate(<a href="../../../../org/apache/mahout/math/Vector.html" title="interface in org.apache.mahout.math">Vector</a>&nbsp;other,
<a href="../../../../org/apache/mahout/math/function/DoubleDoubleFunction.html" title="class in org.apache.mahout.math.function">DoubleDoubleFunction</a>&nbsp;aggregator,
<a href="../../../../org/apache/mahout/math/function/DoubleDoubleFunction.html" title="class in org.apache.mahout.math.function">DoubleDoubleFunction</a>&nbsp;combiner)</pre>
<div class="block"><p>Generalized inner product - take two vectors, iterate over them both, using the combiner to combine together
(and possibly map in some way) each pair of values, which are then aggregated with the previous accumulated
value in the combiner.</p>
<p>
Example: dot(other) could be expressed as aggregate(other, Plus, Times), and kernelized inner products (which
are symmetric on the indices) work similarly.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>other</code> - a vector to aggregate in combination with</dd>
<dd><code>aggregator</code> - function we're aggregating with; fa</dd>
<dd><code>combiner</code> - function we're combining with; fc</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the final aggregation; <code>if r0 = fc(this[0], other[0]), ri = fa(r_{i-1}, fc(this[i], other[i]))
for all i &gt; 0</code></dd>
</dl>
</li>
</ul>
<a name="getLengthSquared--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getLengthSquared</h4>
<pre>double&nbsp;getLengthSquared()</pre>
<div class="block">Return the sum of squares of all elements in the vector. Square root of
this value is the length of the vector.</div>
</li>
</ul>
<a name="getDistanceSquared-org.apache.mahout.math.Vector-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getDistanceSquared</h4>
<pre>double&nbsp;getDistanceSquared(<a href="../../../../org/apache/mahout/math/Vector.html" title="interface in org.apache.mahout.math">Vector</a>&nbsp;v)</pre>
<div class="block">Get the square of the distance between this vector and the other vector.</div>
</li>
</ul>
<a name="getLookupCost--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getLookupCost</h4>
<pre>double&nbsp;getLookupCost()</pre>
<div class="block">Gets an estimate of the cost (in number of operations) it takes to lookup a random element in this vector.</div>
</li>
</ul>
<a name="getIteratorAdvanceCost--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getIteratorAdvanceCost</h4>
<pre>double&nbsp;getIteratorAdvanceCost()</pre>
<div class="block">Gets an estimate of the cost (in number of operations) it takes to advance an iterator through the nonzero
elements of this vector.</div>
</li>
</ul>
<a name="isAddConstantTime--">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>isAddConstantTime</h4>
<pre>boolean&nbsp;isAddConstantTime()</pre>
<div class="block">Return true iff adding a new (nonzero) element takes constant time for this vector.</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>
<div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div>
<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/Vector.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>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../org/apache/mahout/math/UpperTriangular.html" title="class in org.apache.mahout.math"><span class="typeNameLink">Prev&nbsp;Class</span></a></li>
<li><a href="../../../../org/apache/mahout/math/Vector.Element.html" title="interface in org.apache.mahout.math"><span class="typeNameLink">Next&nbsp;Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../index.html?org/apache/mahout/math/Vector.html" target="_top">Frames</a></li>
<li><a href="Vector.html" target="_top">No&nbsp;Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../../../../allclasses-noframe.html">All&nbsp;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><a href="#nested.class.summary">Nested</a>&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; 2008&#x2013;2017 <a href="http://www.apache.org/">The Apache Software Foundation</a>. All rights reserved.</small></p>
</body>
</html>