[Insight-developers] vnl_svd on Borland compiler

Miller, James V (Research) millerjv@crd.ge.com
Wed, 2 Oct 2002 15:35:03 -0400


I have found the problem with the SVD code and the Borland compiler.

vcl_abs is not being defined properly for the Borland compiler.  It is
defaulting to Borlands abs() function which is only defined for int's.

vcl_abs() is used in the SVD code to take the absolute values of the 
eigenvalues. So the eigenvalues are being truncated to integers.

I am trying to figure out how much of vcl needs to be changed to get
the correct definition of vcl_abs().



> -----Original Message-----
> From: Miller, James V (Research) 
> Sent: Wednesday, October 02, 2002 11:14 AM
> To: 'Aljaz Noe'; 'Bill Hoffman'; Insight-Developers
> Subject: RE: [Insight-developers] vnl_svd on Borland compiler
> 
> 
> There are a number of vnl tests that are failing on the Borland 
> compiler
> 
> test_matrix_fixed Failed  CHILDSTATUS 
> test_numeric_limits Failed  CHILDSTATUS 
> test_rnpoly_roots Failed  CHILDSTATUS 
> test_sparse_matrix Failed  CHILDSTATUS 
> test_svd Failed  CHILDSTATUS 
> test_symmetric_eigensystem Failed  CHILDSTATUS 
> 
> I imagine once we get these working, the rest of the FEM code 
> will work.
> I'll spend what I can today trying to get these tests to work 
> on Borland.
> 
> 
> 
> > -----Original Message-----
> > From: Miller, James V (Research) 
> > Sent: Wednesday, October 02, 2002 11:10 AM
> > To: 'Aljaz Noe'; 'Bill Hoffman'; Insight-Developers
> > Subject: RE: [Insight-developers] vnl_svd on Borland compiler
> > 
> > 
> > I'll take a look.
> > 
> > > -----Original Message-----
> > > From: Aljaz Noe [mailto:noe@grasp.cis.upenn.edu]
> > > Sent: Wednesday, October 02, 2002 10:34 AM
> > > To: 'Bill Hoffman'; Insight-Developers; Miller, James V (Research)
> > > Subject: RE: [Insight-developers] vnl_svd on Borland compiler
> > > 
> > > 
> > > Do you have any ideas, what could be going wrong inside the svd on
> > > Borland?
> > > 
> > > Aljaz
> > > 
> > > > -----Original Message-----
> > > > From: Bill Hoffman [mailto:bill.hoffman@kitware.com] 
> > > > Sent: Wednesday, October 02, 2002 10:20 AM
> > > > To: Aljaz Noe; insight-developers-admin@public.kitware.com; 
> > > > 'Miller, James V (Research)'
> > > > Subject: RE: [Insight-developers] vnl_svd on Borland compiler
> > > > 
> > > > 
> > > > I think we need to fix svd or say that the borland compiler 
> > > > is not supported.
> > > > 
> > > > -Bill
> > > > 
> > > > 
> > > > At 10:17 AM 10/2/2002 -0400, Aljaz Noe wrote:
> > > > >> While that indeed seems to be a problem.  Why are using an
> > > > >> SVD to compute a determinant? vnl_determinant<> will switch 
> > > > >> between using a brute force determinant and qr decomposition.
> > > > >
> > > > >I didn't know that vnl_determinant<> exists. It's not in 
> > > the doxygen 
> > > > >documentation.
> > > > >
> > > > >> Does vnl_determinant produce the correct answer?
> > > > >
> > > > >It does. I've changed the code, but this doesn't solve the 
> > > > problem yet, 
> > > > >because we're using svd to do other stuff, like inverting 
> > > matrices, 
> > > > >which again, doesn't work on Borland.
> > > > >
> > > > >Is there any alternative to using vnl_svd_inverse<>(matrix)?
> > > > >
> > > > >Aljaz
> > > > 
> > > > 
> > > 
> > _______________________________________________
> > Insight-developers mailing list
> > Insight-developers@public.kitware.com
> > http://public.kitware.com/mailman/listinfo/insight-developers
> > 
> _______________________________________________
> Insight-developers mailing list
> Insight-developers@public.kitware.com
> http://public.kitware.com/mailman/listinfo/insight-developers
>