Posted by
Luigi Ballabio-2 on
Feb 23, 2004; 2:10am
URL: http://quantlib.414.s1.nabble.com/SVD-routine-error-tp2794p2809.html
Hi Neil,
At 23:39 22/02/2004, Neil P Firth wrote:
>Sorry about the trouble this class is causing ;)
No problem.
>I've checked in a test to testsuite\matrices.cpp which looks at a couple
>of cases. The accuracy is good to about 1e-6, which isn't that great.
>Anyone having difficulty please contribute your Matrices as test cases.
>
>The algorithm is ported from the TNT / JAMA project, and should have m>=n
>(rows >= columns). I don't know why this is however. I was considering
>throwing an exception if n>m and forcing the user to transpose the matrix
>first.
I'm having a quick look at the thing. Question: line 122:
if (wantu & (k < nct)) {
Are you sure it shouldn't be && ?
>Are there any design thoughts on extending the linear algebra. For
>instance, I'd like to be able to swap the TNT SVD class for a NAG or
>CLAPACK routine to utilise the BLAS and the shared memory processors on
>the Oxford computational finance cluster.
Ehm, I'm not exactly sure what you mean. "Extending", as in ...?
>As for the macro problem:
> >
> > , There are some more problems with SVD
> > In the line
> >
> > T scale = QL_MAX(QL_MAX(QL_MAX(QL_MAX(
> > QL_FABS(s[p-1]),QL_FABS(s[p-2])),QL_FABS(e[p-2])),
> > QL_FABS(s[k])),QL_FABS(e[k]));
> >
> > The Microsoft compiler VC6 doesn't like the macro expansion. Won't work
> > in release mode. I think its the recursion.
This is weird. I've been using VC6 for a long time and it didn't object to
compiling the above... Bill, what is your configuration?
Later,
Luigi