>> Basically matrix decompositions (SVD),
>
> OK.  I think I may raid commons math to improve our implementation there.
>
> Are you dependent on assumptions of ordering of eigenvalues?

Staszek wrote our math-related code in Carrot2, so he will be able to
explain better what our needs are. From our short conversation a
minute ago the API requirements were to be able to do various
operations in place (multiplications in particular), so colt was
useful here.

>> some sorting routines from Sorting class
>> (removed now, but this can be replaced)

I see we do have a couple references to:

Sorting.quickSort.sort(VT, aggregates); =>
public DoubleMatrix2D sort(DoubleMatrix2D matrix, final double[] aggregates) {

I have no idea what it was, to be honest.

>> and a lot of multiplying/ basic operations of vectors and matrices.
> Got that, probably.

We implement a few matrix factorizations in Lingo, so (Staszek's) code
looks like this in places:

            U.zMult(V, UV, 1, 0, false, true); // UV <- U*V'
            UV.assign(plusEps); // UV <- UV + eps
            UV.assign(Aeps, invDiv); // UV <- Aeps ./ UV
            UV.zMult(U, VT, 1, 0, true, false); // VT <- UV' * U
            V.assign(VT, sqrtMult); // V <- sqrt(V .* VT)

This was Staszek's thesis, so again -- it's probably better that he
speaks about API requirements.

> So, key step here would be to expose a native array from DenseMatrix, right?
> What format do you require?  Would row major order be OK?

But when I looked at DenseMatrix its internals are:

  private double[][] values;

and this doesn't map to a contiguous memory chunk, does it? The whole
point of using Colt in C2 was so that we didn't have to do any copying
because Colt's internal representation was already a double[]. The
native blas we used could adapt its routines to row-major or
column-major by doing transformations of arguments, but not all
implementations do. If I remember right, AMD's ACML requires
column-major (right, sure it is Fortran :).

> Sorry about that.  I feel your pain, quite
> literally.  But I also really appreciate your feedback.

Staszek will be the right person to talk to. We would be very
interested in getting mahout-math to work so that it could perform
certain computations using, for example, AMD's ACML... Java is fast,
but these optimized native libraries are still way ahead for numerical
computations.

Dawid

Reply via email to