mahout-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ceyhun Can √úLKER <>
Subject About a possible bug in 'cross' method of AbstractVector class.
Date Sun, 03 Feb 2013 19:22:32 GMT

I don't know if this is the right place to post, but here I go. Actually
this bug is probably about the viewColumn method, or matrixLike method or
MatrixVectorView constructor, I didn't really looked into it. But it is
easy to reproduce.

I have a dense matrix U of size 10x670. When I try to do this I get a
cardinality exception, which doesn't make sense:

Vector uI = U.viewColumn(i);
 Matrix outerProduct = uI.cross(uI);

Exception is thrown from AbstractMatrix class' cross method, when a row is
tried to be assigned in the result matrix.
  public Matrix cross(Vector other) {
    Matrix result = matrixLike(size, other.size());
    for (int row = 0; row < size; row++) {
      result.assignRow(row, other.times(getQuick(row)));
    return result;

The problem here is matrixLike method does not return a 10x10 matrix as it
should, instead it returns 1x1 matrix.

Hope this helps.

Ceyhun Can √úlker

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message