Boost logo

Ublas :

Subject: Re: [ublas] [bindings] New traits system
From: Thomas Klimpel (Thomas.Klimpel_at_[hidden])
Date: 2010-01-09 06:03:44


> * The gelsd header has repeats of the same overloads... Perhaps the generator has
> a bug? For example, overloads 685 and 723 are identical. When I commented out
> the overloads I wasn't using, things compiled fine.

These sort of "bugs" are normally inconsistencies in the documentation of the original lapack functions. In this case sgelsd.f says
* A (input) REAL array, dimension (LDA,N)
* On entry, the M-by-N matrix A.
* On exit, A has been destroyed.
but cgelsd.f says
* A (input/output) COMPLEX array, dimension (LDA,N)
* On entry, the M-by-N matrix A.
* On exit, A has been destroyed.

So the matrix A will be destroyed on output (as such cgelsd.f is probably correct to declare it as "input/output"), but sgelsd.f doesn't declare it as "input/output", so the overloaded templates gelsd have the same name, but generate incompatible overloads.

> * gelss is working fine for linear least squares, but gelsd has some kind of a
> bug in it (I believe the interface used to work in the version of the bindings
> before you sync'd, but there is a chance I am wrong.). Now it is crashing
> inside of my LAPACK (MKL on windows).

I don't think that this has anything to do with MKL, and I think the crash happens earlier before you are in the MKL on an assert. This is again an inconsistency in the documentation, because the optimal workspace determined by lapack for gelsd is smaller than the minimal required workspace mentioned in the documentation. So I cheated when updating the regression tests, and did some hand-editing to gelsd.hpp. The updated bindings have of course reverted the hand editing, so it's no surprise that it no longer works.

Regards,
Thomas