You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@mahout.apache.org by Ceyhun Can ÜLKER <ce...@gmail.com> on 2013/02/03 20:22:32 UTC

About a possible bug in 'cross' method of AbstractVector class.

Hello,

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

Re: About a possible bug in 'cross' method of AbstractVector class.

Posted by Ted Dunning <te...@gmail.com>.
Looks great.

If you aren't careful, you will turn into a regular contributor!

On Sun, Feb 3, 2013 at 12:46 PM, Ceyhun Can ÜLKER <ce...@gmail.com>wrote:

> Hello again,
>
> This is my first bug report experience. :) I hope I did it right and it
> helps.
>
> Here is the link to issue I have created:
> https://issues.apache.org/jira/browse/MAHOUT-1146
>
> Ceyhun Can Ülker
>
> On Sun, Feb 3, 2013 at 9:50 PM, Ted Dunning <te...@gmail.com> wrote:
>
> > Ouch.  This is a fine place to start the conversation.
> >
> > Can you put exactly your message below into a bug report on JIRA at
> > https://issues.apache.org/jira/browse/MAHOUT ?
> >
> > That will help us track this apparent bug.
> >
> > On Sun, Feb 3, 2013 at 11:22 AM, Ceyhun Can ÜLKER <ceyhuncanu@gmail.com
> > >wrote:
> >
> > > Hello,
> > >
> > > 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
> > >
> >
>

Re: About a possible bug in 'cross' method of AbstractVector class.

Posted by Ceyhun Can ÜLKER <ce...@gmail.com>.
Hello again,

This is my first bug report experience. :) I hope I did it right and it
helps.

Here is the link to issue I have created:
https://issues.apache.org/jira/browse/MAHOUT-1146

Ceyhun Can Ülker

On Sun, Feb 3, 2013 at 9:50 PM, Ted Dunning <te...@gmail.com> wrote:

> Ouch.  This is a fine place to start the conversation.
>
> Can you put exactly your message below into a bug report on JIRA at
> https://issues.apache.org/jira/browse/MAHOUT ?
>
> That will help us track this apparent bug.
>
> On Sun, Feb 3, 2013 at 11:22 AM, Ceyhun Can ÜLKER <ceyhuncanu@gmail.com
> >wrote:
>
> > Hello,
> >
> > 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
> >
>

Re: About a possible bug in 'cross' method of AbstractVector class.

Posted by Ted Dunning <te...@gmail.com>.
Ouch.  This is a fine place to start the conversation.

Can you put exactly your message below into a bug report on JIRA at
https://issues.apache.org/jira/browse/MAHOUT ?

That will help us track this apparent bug.

On Sun, Feb 3, 2013 at 11:22 AM, Ceyhun Can ÜLKER <ce...@gmail.com>wrote:

> Hello,
>
> 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
>