blob: 7a88f0270034014c691c79b33f0aef970b63a234 [file] [log] [blame]
<!-- HTML header for doxygen 1.8.4-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.4"/>
<meta name="keywords" content="madlib,postgres,greenplum,machine learning,data mining,deep learning,ensemble methods,data science,market basket analysis,affinity analysis,pca,lda,regression,elastic net,huber white,proportional hazards,k-means,latent dirichlet allocation,bayes,support vector machines,svm"/>
<title>MADlib: Array Operations</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
$(document).ready(initResizable);
$(window).load(resizeHeight);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
$(document).ready(function() { searchBox.OnSelectItem(0); });
</script>
<script type="text/x-mathjax-config">
MathJax.Hub.Config({
extensions: ["tex2jax.js", "TeX/AMSmath.js", "TeX/AMSsymbols.js"],
jax: ["input/TeX","output/HTML-CSS"],
});
</script><script src="../mathjax/MathJax.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="madlib_extra.css" rel="stylesheet" type="text/css"/>
<!-- google analytics -->
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-45382226-1', 'auto');
ga('send', 'pageview');
</script>
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td style="padding-left: 0.5em;">
<div id="projectname">MADlib
&#160;<span id="projectnumber">1.4.1</span>
</div>
<div id="projectbrief">User Documentation</div>
</td>
<td> <div id="MSearchBox" class="MSearchBoxInactive">
<span class="left">
<img id="MSearchSelect" src="search/mag_sel.png"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
alt=""/>
<input type="text" id="MSearchField" value="Search" accesskey="S"
onfocus="searchBox.OnSearchFieldFocus(true)"
onblur="searchBox.OnSearchFieldFocus(false)"
onkeyup="searchBox.OnSearchFieldChange(event)"/>
</span><span class="right">
<a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
</span>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.4 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
<div id="nav-tree">
<div id="nav-tree-contents">
<div id="nav-sync" class="sync"></div>
</div>
</div>
<div id="splitbar" style="-moz-user-select:none;"
class="ui-resizable-handle">
</div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('group__grp__array.html','');});
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Groups</a></div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0"
name="MSearchResults" id="MSearchResults">
</iframe>
</div>
<div class="header">
<div class="headertitle">
<div class="title">Array Operations<div class="ingroups"><a class="el" href="group__grp__support.html">Support Modules</a></div></div> </div>
</div><!--header-->
<div class="contents">
<div class="toc"><b>Contents</b> </p>
<ul>
<li>
<a href="#notes">Implementation Notes</a> </li>
<li>
<a href="#list">List of Array Operations</a> </li>
<li>
<a href="#related">Related Topics</a> </li>
</ul>
</div><p>This module provides a set of basic array operations implemented in C. It is a support module for several machine learning algorithms that require fast array operations.</p>
<p><a class="anchor" id="notes"></a></p>
<dl class="section user"><dt>Implementation Notes</dt><dd></dd></dl>
<p>These functions support several numeric types:</p>
<ul>
<li>SHORTINT</li>
<li>INT</li>
<li>BIGINT</li>
<li>REAL</li>
<li>FLOAT</li>
</ul>
<p>As of now they do not support variable size NUMERIC input.</p>
<p>Several of the function require NO NULL VALUES, while others omit NULLs and return results.</p>
<p><a class="anchor" id="list"></a></p>
<dl class="section user"><dt>Array Operations</dt><dd><table class="output">
<tr>
<th><a class="el" href="array__ops_8sql__in.html#a91c8d3715142927b3967f05a4fbf1575" title="Adds two arrays. It requires that all the values are NON-NULL. Return type is the same as the input t...">array_add()</a></th><td><p class="starttd">Adds two arrays. It requires that all the values are NON-NULL. Return type is the same as the input type.</p>
<p class="endtd"></p>
</td></tr>
<tr>
<th><a class="el" href="array__ops_8sql__in.html#a2875a161a01c7dcdea9a4997b074eefc" title="Subtracts two arrays. It requires that all the values are NON-NULL. Return type is the same as the in...">array_sub()</a></th><td><p class="starttd">Subtracts two arrays. It requires that all the values are NON-NULL. Return type is the same as the input type. </p>
<p class="endtd"></p>
</td></tr>
<tr>
<th><a class="el" href="array__ops_8sql__in.html#a652d70c480d484c4a1a92ded384b0dd7" title="Element-wise product of two arrays. It requires that all the values are NON-NULL. Return type is the ...">array_mult()</a></th><td><p class="starttd">Element-wise product of two arrays. It requires that all the values are NON-NULL. Return type is the same as the input type. </p>
<p class="endtd"></p>
</td></tr>
<tr>
<th><a class="el" href="array__ops_8sql__in.html#a6cc05e7052495f8b64692faf40219576" title="Element-wise division of two arrays. It requires that all the values are NON-NULL. Return type is the same as the input type. ">array_div()</a></th><td><p class="starttd">Element-wise division of two arrays. It requires that all the values are NON-NULL. Return type is the same as the input type. </p>
<p class="endtd"></p>
</td></tr>
<tr>
<th><a class="el" href="array__ops_8sql__in.html#acde10964ed23b7c8da515fb84cb8d5e0" title="Dot-product of two arrays. It requires that all the values are NON-NULL. Return type is the same as t...">array_dot()</a></th><td><p class="starttd">Dot-product of two arrays. It requires that all the values are NON-NULL. Return type is the same as the input type. </p>
<p class="endtd"></p>
</td></tr>
<tr>
<th><a class="el" href="array__ops_8sql__in.html#aedf6cb13eb4803bcc12dc4d95ea8ff4e" title="Checks whether one array contains the other. ">array_contains()</a></th><td><p class="starttd">Checks whether one array contains the other. </p>
<p class="endtd"></p>
</td></tr>
<tr>
<th><a class="el" href="array__ops_8sql__in.html#ae891429cc50705c530f3e5ca15541849" title="This function finds the maximum value in the array. NULLs are ignored. Return type is the same as the...">array_max()</a></th><td><p class="starttd">This function finds the maximum value in the array. NULLs are ignored. Return type is the same as the input type. </p>
<p class="endtd"></p>
</td></tr>
<tr>
<th><a class="el" href="array__ops_8sql__in.html#a6659bf9d9363eb179fab34f81f8ac59b" title="This function finds the minimum value in the array. NULLs are ignored. Return type is the same as the...">array_min()</a></th><td><p class="starttd">This function finds the minimum value in the array. NULLs are ignored. Return type is the same as the input type. </p>
<p class="endtd"></p>
</td></tr>
<tr>
<th><a class="el" href="array__ops_8sql__in.html#a4c98f20e6a737358806f63318daea5ec" title="This function finds the sum of the values in the array. NULLs are ignored. Return type is the same as...">array_sum()</a></th><td><p class="starttd">This function finds the sum of the values in the array. NULLs are ignored. Return type is the same as the input type. </p>
<p class="endtd"></p>
</td></tr>
<tr>
<th><a class="el" href="array__ops_8sql__in.html#a418de59800833aa95f9b7cbd6b12901c" title="This function finds the sum of the values in the array. NULLs are ignored. Return type is always FLOA...">array_sum_big()</a></th><td><p class="starttd">This function finds the sum of the values in the array. NULLs are ignored. Return type is always FLOAT8 regardless of input. This function is meant to replace array_sum in the cases when sum may overflow the array type. </p>
<p class="endtd"></p>
</td></tr>
<tr>
<th><a class="el" href="array__ops_8sql__in.html#a407598f9eb70637798b02fd731bfca2c" title="TThis function finds the mean of the values in the array. NULLs are ignored. Return type is the same ...">array_mean()</a></th><td><p class="starttd">TThis function finds the mean of the values in the array. NULLs are ignored. Return type is the same as the input type. </p>
<p class="endtd"></p>
</td></tr>
<tr>
<th><a class="el" href="array__ops_8sql__in.html#a3b6c2d173a611e6d6b184d825c2b336d" title="This function finds the standard deviation of the values in the array. NULLs are ignored. Return type is the same as the input type. ">array_stddev()</a></th><td><p class="starttd">This function finds the standard deviation of the values in the array. NULLs are ignored. Return type is the same as the input type. </p>
<p class="endtd"></p>
</td></tr>
<tr>
<th><a class="el" href="array__ops_8sql__in.html#a2c42a29f01aeab521073bb329fa4d239" title="This function creates an array of set size (the argument value) of FLOAT8, initializing the values to...">array_of_float()</a></th><td><p class="starttd">This function creates an array of set size (the argument value) of FLOAT8, initializing the values to 0.0;. </p>
<p class="endtd"></p>
</td></tr>
<tr>
<th><a class="el" href="array__ops_8sql__in.html#a4b562ee8fb5b3f974fdc56093c0cc9dd" title="This function creates an array of set size (the argument value) of BIGINT, initializing the values to...">array_of_bigint()</a></th><td><p class="starttd">This function creates an array of set size (the argument value) of BIGINT, initializing the values to 0;. </p>
<p class="endtd"></p>
</td></tr>
<tr>
<th><a class="el" href="array__ops_8sql__in.html#a065a5323f3b742be47e39ad8b4c90fc2" title="This functions set every values in the array to some desired value (provided as the argument)...">array_fill()</a></th><td><p class="starttd">This functions set every value in the array to some desired value (provided as the argument). </p>
<p class="endtd"></p>
</td></tr>
<tr>
<th><a class="el" href="array__ops_8sql__in.html#ae6881cc5c86941b6ffca35d7f3cd5c12" title="This function takes an array as the input and executes element with multiplication by the scalar prov...">array_scalar_mult()</a></th><td><p class="starttd">This function takes an array as the input and executes element with multiplication by the scalar provided as the second argument, returning the resulting array. It requires that all the values are NON-NULL. Return type is the same as the input type. </p>
<p class="endtd"></p>
</td></tr>
<tr>
<th><a class="el" href="array__ops_8sql__in.html#a66195b7521ba0491f7fcbb54b10f335d" title="This function takes an array as the input and finds square root of each element in the array...">array_sqrt()</a></th><td><p class="starttd">This function takes an array as the input and finds square root of each element in the array, returning the resulting array. It requires that all the values are NON-NULL. Return type is the same as the input type. This means that if the input if of the size INT, the results would also be rounded. </p>
<p class="endtd"></p>
</td></tr>
<tr>
<th><a class="el" href="array__ops_8sql__in.html#adf90038b728d1904b03767cc79dd9561" title="Array normalization function. ">normalize()</a></th><td>Array normalization function. </td></tr>
</table>
</dd></dl>
<p><a class="anchor" id="related"></a></p>
<dl class="section user"><dt>Related Topics</dt><dd></dd></dl>
<p>File <a class="el" href="array__ops_8sql__in.html" title="implementation of array operations in SQL ">array_ops.sql_in</a> for list of functions and usage. </p>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
<li class="footer">Generated on Thu Jan 9 2014 20:25:07 for MADlib by
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.4 </li>
</ul>
</div>
</body>
</html>