madlib/madlib — pull request #238 by fschopp (2012-09-27 21:24:35+00:00)
Title: Retrieving column of a matrix & silhouette coefficient

Contains 2 commits:

Function for retrieving column of a matrix

Jira: MADLIB-682

The following query returns NULL in PostgreSQL:
SELECT matrix[1] FROM (SELECT ARRAY[ARRAY[1,2], ARRAY[3,4]] matrix) q;

Reason: Since PostgreSQL does not attach dimensionality to the array type
information, it is unknown during parsing whether matrix[1] is an expression of
type INTEGER or INTEGER[]. We still want to be able to retrieve columns (or rows)
from matrices. I therefore added a function that handles this special case.

New k-means: Simplified silhouette function

Jira: MADLIB-681

Implemented a function to compute the simplified silhouette coefficient.
Additions for this functions in other parts of the code:

Matrix operations:
- Function that returns the two closest columns in a matrix (relative to a given
vector).

C++ AL:
- Support for INTEGER arrays