[ 
https://issues.apache.org/jira/browse/MAHOUT-6?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12571295#action_12571295
 ] 

Ted Dunning commented on MAHOUT-6:
----------------------------------


Here is my set of methods for Matrix1D.  These are nearly identical to the 
functions used by Colt with the addition of some convenience methods.

    double get(int index);
    void set(int index, double value);
    Matrix1D plus(double x);
    Matrix1D plus(Matrix1D x);
    Matrix1D minus(Matrix1D x);
    Matrix1D times(double x);
    // should this be element-wise or dot ... I think element-wise
    Matrix1D times(Matrix1D x);
    double dot(Matrix1D x);
    double zSum();

    Matrix1D viewPart(int offset, int length);
    Matrix1D copy();

    double getQuick(int index);
    void setQuick(int index, double value);

    void getNonZeros(IntArrayList jx, DoubleArrayList values);
    void foreachNonZero(IntDoubleFunction f);

    int size();
    int cardinality();

    double aggregate(DoubleDoubleFunction aggregator, DoubleFunction map);
    double aggregate(Matrix1D other, DoubleDoubleFunction aggregator, 
DoubleDoubleFunction map);

    Matrix1D assign(double[] values);
    Matrix1D assign(double value);
    Matrix1D assign(DoubleFunction function);
    Matrix1D assign(Matrix1D other);
    Matrix1D assign(Matrix1D y, DoubleDoubleFunction function);
    NewMatrix1D assign(Matrix1D y,  DoubleDoubleFunction function, IntArrayList 
nonZeroIndexes);

    boolean haveSharedCells(Matrix1D other);

    Matrix1D like();
    Matrix1D like(int n);

    double[] toArray();


> Need a matrix implementation
> ----------------------------
>
>                 Key: MAHOUT-6
>                 URL: https://issues.apache.org/jira/browse/MAHOUT-6
>             Project: Mahout
>          Issue Type: New Feature
>            Reporter: Ted Dunning
>         Attachments: MAHOUT-6a.diff
>
>
> We need matrices for Mahout.
> An initial set of basic requirements includes:
> a) sparse and dense support are required
> b) row and column labels are important
> c) serialization for hadoop use is required
> d) reasonable floating point performance is required, but awesome FP is not
> e) the API should be simple enough to understand
> f) it should be easy to carve out sub-matrices for sending to different 
> reducers
> g) a reasonable set of matrix operations should be supported, these should 
> eventually include:
>     simple matrix-matrix and matrix-vector and matrix-scalar linear algebra 
> operations, A B, A + B, A v, A + x, v + x, u + v, dot(u, v)
>     row and column sums  
>     generalized level 2 and 3 BLAS primitives, alpha A B + beta C and A u + 
> beta v
> h) easy and efficient iteration constructs, especially for sparse matrices
> i) easy to extend with new implementations

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to