pierre-vigier / Perl6-Math-Matrix

fully featured data type for matrix math
Artistic License 2.0
20 stars 6 forks source link

Spurious output on t/021-accessors.t causes failure #54

Closed frithnanth closed 6 years ago

frithnanth commented 6 years ago

I'm trying to install Math::Matrix using Perl 6 2018.09 and zef is reporting a test failure. The failing test is t/021-accessors.t and the output is:

1..5
    1..4
    ok 1 - first cell
    ok 2 - first cell
    ok 3 - Out of range row
    ok 4 - Out of range column
ok 1 - Cell
    1..2
    ok 1 - got second row
    ok 2 - tried none existing row
ok 2 - Row
    1..2
    ok 1 - got second column
    ok 2 - tried none existing column
ok 3 - Column
    1..3
    ok 1 - custom diagonal
    ok 2 - identity diagonal
    ok 3 - tried get diagonal of none square matrix
ok 4 - Diagonal
    1..15
-1
    ok 1 - demanded colums are out of range
    ok 2 - demanded submatrix goes out of scope due second cell
    ok 3 - reject none int indices
    ok 4 - rows and colums are out of range
-1
    ok 5 - submatrix built by removing first cell
-1
    ok 6 - submatrix built by removing last cell
    ok 7 - submatrix with range syntax
    ok 8 - submatrix with range syntax using * aka Inf
    ok 9 - simple submatrix created with list syntax
    ok 10 - rehashed submatrix using list syntax
    ok 11 - submatrix with no arguments is matrix itself
    ok 12 - submatrix with range syntax omiting column parameter
    ok 13 - submatrix with range syntax omiting row parameter
    ok 14 - submatrix with list syntax omiting column parameter
    ok 15 - submatrix with list syntax omiting row parameter
ok 5 - Submatrix

Apparently the test is perfectly OK, but its output can't be parsed correctly because for those "-1". Probably this is a problem in the Test module that comes with Perl 6 2018.09, but since I don't know your module's inner workings I'm asking if there's any reason why a .new method should output a -1 before failing.

lichtkind commented 6 years ago

Jay, I have a user :)

Indeed, embarrassingly enough this was just a leftover debug output from the rewrite of the submatrix function, removed now in 091be42ca95644c84cf701de05915b7854750add

btw you know: I plan move to this and call it than math::matrix::bundle to include vector, eigensystems and others

frithnanth commented 6 years ago

Just to let you know: I'm writing an interface to the libfftw3 C library to do Fast Fourier Transforms and I wanted to see if it could take a Math::Matrix object as an input. It works as long as a user feeds a $matrix.list-rows.flat to it, that is as long as it's not a Math::Matrix object anymore :-) I know, it's not a proper interface to your module, but I guess it's the best I can do without declaring an explicit dependency.

Thank for your work!

lichtkind commented 6 years ago

Thanks, just tell me if you need something.

frithnanth commented 6 years ago

Now Math::FFT::Libfftw3 accepts a Math::Matrix object; no need to add .list-rows.flat anymore.

lichtkind commented 5 years ago

thanks in https://modules.perl6.org/dist/Math::FFT::Libfftw3:cpan:FRITH/lib/Math for the :$data! where .^name eq 'Math::Matrix', hack that resolves a lot of issues I was pondering