fschopp/madlib — pull request #4 by fschopp (2012-06-05 23:59:40+00:00)
Title: Linear-Algebra Operations

Added a module for linear-algebra operations, initially with functions [squared_]dist_{1|2}norm() and closest_column().

Jira: MADLIB-532

Linear-Algebra Operations:
- Function closest_column() for determining the column of a matrix that is closest to a vector, according to the given metric
- Functions [squared_]dist_{1|2}norm() for determining the (square) of the Euclidean/Manhattan distance between two vectors. These functions will be needed for k-means.
- Unit tests

C++ AL:
- Increased support for Eigen types: (Non-mapped) vectors and matrices can now directly be converted to AnyType (and thus returned or passed to FunctionHandles)
- Added types [Mutable]Mapped{ColumnVector|Matrix} that can now be used as template parameters for AnyType::getAs
- ArrayHandles now understand multi-dimensional PostgreSQL arrays. We store matrices as an array of columns, i.e., in PostgreSQL one would write matrix[col][row] whereas in C++ code the row index comes first (as one would expect)

Linear/logistic regression:
- Minor changes to make use of the [Mutable]MappedColumnVector types.