toon-members
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Toon-members] SVD


From: E. Rosten
Subject: Re: [Toon-members] SVD
Date: Tue, 18 Aug 2009 17:27:19 +0100 (BST)
User-agent: Alpine 2.00 (LSU 1167 2008-08-23)

On Tue, 18 Aug 2009, Georg Klein wrote:

Hi,

it'd be good to put a C++ version of the SVD into TooN - this turns out to be much faster than LAPACK for small matrices and eliminates dependence on LAPACK, both of which are good things for e.g. iphone stuff.

Currently I'm using a c++-ified port of the numerical recipes algorithm, but numerical recipes is notoriously difficult with copyright. Any guesses if porting the c-code to C++ is enough to get around copyright, or better not?

It depends if it was ported from a direct copy or written with one eye on the book. The code in the optimization subdir is my own implementation of the numerical recipies algorithms. I didn't actually ever copy the code, but the algorithms are very close in structure. Plus also, the NR code isn't very nice to read, since none of the basic linear algebra bits are done automatically (like in TooN), and it's pre C89 at best, so all variables are declared at the start of the functions (net even block local).

If on the other hand you start off by copying the original code and then make successive modifications to it, then you're on slightly shakier ground.

By the way, NR says:

"if you analyze the ideas contained in a program and then express those ideas in your own completely different implementation, then that new program implementation belongs to you."

which sounds about right.

Otherwise I can go back to the FORTRAN code which NumRec used to make their C version.



-Ed

--
(You can't go wrong with psycho-rats.)(http://mi.eng.cam.ac.uk/~er258)

/d{def}def/f{/Times s selectfont}d/s{11}d/r{roll}d f 2/m{moveto}d -1
r 230 350 m 0 1 179{ 1 index show 88 rotate 4 mul 0 rmoveto}for/s 12
    d f pop 235 420 translate 0 0 moveto 1 2 scale show showpage




reply via email to

[Prev in Thread] Current Thread [Next in Thread]