Bug#856705: [dko...@debian.org: Bug#856705: graywolf: License violation]

2017-03-05 Thread Tim Edwards

Hello Dima,


Hi. Yeah, there're plenty of other (and better) SVD implementations.
They won't be a drop-in replacement, however because numerical recipes
uses a ridiculous matrix storage scheme:

 typedef struct {
 INTrows ;
 INTcolumns ;
 DOUBLE **m ;
 } YMBOX, *YMPTR ;

I.e. each row (or column) of a matrix is stored in a separate chunk of
(usually dynamically-allocated) memory. This is stupid, and no other
library would do it this way. So to use other implementations you might
need to write a shim to convert formats. If you find a better way,
please let me know.


I don't think it's that bad.  In graywolf, the matrix computations
appear to be restricted to exactly one routine (adapt_wire_estimator),
which is about 200 lines of code that create some matrices, fill them,
call a few standard matrix routines (multiply, add, etc.), then call
svd_solve.  It all appears to be self-contained, so as long as I can
do the same matrix functions with another library, it should be simple
to replace the Numerical Recipes code.  In other words, matrices aren't
used anywhere else in graywolf.  The matrices are created for the sole
purpose of running svd_solve, and then freed.

---Tim

++-+
| R. Timothy Edwards (Tim)   | email: t...@opencircuitdesign.com|
| Open Circuit Design| web:   http://opencircuitdesign.com |
| 19412 Cissel Manor Drive   | phone: (301) 528-5030   |
| Poolesville, MD 20837  | cell:  (408) 828-8212   |
++-+

--
debian-science-maintainers mailing list
debian-science-maintainers@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/debian-science-maintainers


Bug#856705: [dko...@debian.org: Bug#856705: graywolf: License violation]

2017-03-05 Thread Dima Kogan
Tim Edwards  writes:

> Well, it's pretty clear that the TimberWolf authors at Yale unabashedly
> plaigerized out of Numerical Recipes for their thesis work.  What you
> found is not particularly difficult to work around, as the single-value
> decomposition routines can be found in the GNU Scientific Library and
> should be reasonably easy to substitute.

Hi. Yeah, there're plenty of other (and better) SVD implementations.
They won't be a drop-in replacement, however because numerical recipes
uses a ridiculous matrix storage scheme:

typedef struct {
INTrows ;
INTcolumns ;
DOUBLE **m ;
} YMBOX, *YMPTR ;

I.e. each row (or column) of a matrix is stored in a separate chunk of
(usually dynamically-allocated) memory. This is stupid, and no other
library would do it this way. So to use other implementations you might
need to write a shim to convert formats. If you find a better way,
please let me know.


>  However, it feeds back into other matrix manipulation routines, so I
> cannot be sure how much of that was pulled from Numerical Recipies.
> This looks like finding a needle in a haystack to me. How did you find
> that bit of plaigerized code, and how would I go about flushing out
> any additional plaigerized sections of code?

I came across some other libraries that were doing a similar thing, and
then searched the Debian codebase (http://codesearch.debian.net) for
some unique-looking comments. Here I searched for

You must augment A with extra zero rows

I also searched for some other things that caught some other libraries,
but the above chunk of text is the only one I found in graywolf. What
you can do is to look at functions that use that YMPTR matrix
representation: anything that uses it is a candidate for being plucked
from the book.

Note that for some reason the utility code to support this matrix
representation IS in the public domain, as indicated in numerical
recipes copyright page linked in the bug report.


> I definitely want these out of the code base, especially as GNU
> alternatives are readily available.

Thank you very much.

-- 
debian-science-maintainers mailing list
debian-science-maintainers@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/debian-science-maintainers