Re: jama_svd.h (fwd)

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Re: jama_svd.h (fwd)

Neil P Firth
Luigi,

You were right about the &....
Neil

---------------------------------------------------
  Neil Firth
  Brasenose College Oxford OX1 4AJ United Kingdom
  Office: 01865 280616
  [hidden email]
  http://www.maths.ox.ac.uk/~firth
---------------------------------------------------
---------- Forwarded message ----------
Date: Mon, 23 Feb 2004 14:47:54 -0500
From: Roldan Pozo <[hidden email]>
To: [hidden email]
Subject: Re: jama_svd.h

Neil,

The 1-e7 is OK for single precision; it depends on the norm of A. One general
rule of thumb for solving linear systems Ax=b is that |Ax-b|/ (|A|*|b|) should
be about machine epsilon, which is  1e-7 for single precision, and 1e-15
for double.

And, yes, although the operands take boolean values, the "if" expression would
better written with && instead of &.  Thanks for pointing this out.

Regards,
Roldan

[hidden email] wrote:

> Hi,
>
> I am working on an open source project for pricing financial derivatives:
> www.quantlib.org and we need some linear algebra. We have included your
> jama_svd.h (thanks, very useful!) and we have a couple of questions.
>
> What sort of accuracy should we expect from the implementation. Currently
> we do A = USV' and test that UU' = I and VV' = I and that USV' = A. On
> win32 we get that the absolute difference is about 1e-7. Is this what
> you would expect?
>
> We also have a question about line 107
>
> if (wantu & (k < nct)) {
>
> should that be && ?
>
> Thanks in advance,
>
> Neil
>
> ---------------------------------------------------
>   Neil Firth
>   Brasenose College Oxford OX1 4AJ United Kingdom
>   Office: 01865 280616
>   [hidden email]
>   http://www.maths.ox.ac.uk/~firth
> ---------------------------------------------------
>
>