comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » BVLS (NNLS) without loops?
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
BVLS (NNLS) without loops? [message #86953] Mon, 16 December 2013 22:32 Go to next message
JP is currently offline  JP
Messages: 55
Registered: April 2008
Member
Hi IDLers,

I am currently using BVLS (http://www-astro.physics.ox.ac.uk/~mxc/idl/bvls.pro) for spectral unmixing. It works great, but, on one pixel at a time. I want to implement for many pixels without having to loop. Example below:

IDL> help, a
A FLOAT = Array[85, 3]
IDL> help, b
B FLOAT = Array[85]
IDL> help, bnd
BND FLOAT = Array[2, 3]
IDL> print, bnd
0.000000 1.00000
0.000000 1.00000
0.000000 1.00000


bvls, A, B, BND, X_BVLS

IDL> help, x_bvls
X_BVLS FLOAT = Array[3]

in my example A is a vector of "endmembers" (85 spectral bands and 3 fractions), B is a pixel (vector of 85 bands), BND are bounds (don't go negative nor >1) and the X_BVLS are the estimated fractions returned for that pixel.
Now as you could imagine I have many many pixels (n) (my B is really a 2D array of [85, n]) and i've written a function which loops through n, but it gets very slow for large n.

Any ideas?

Thanks
Re: BVLS (NNLS) without loops? [message #86962 is a reply to message #86953] Tue, 17 December 2013 09:35 Go to previous messageGo to next message
Mike[5] is currently offline  Mike[5]
Messages: 5
Registered: October 2013
Junior Member
Hi Juan Pablo,

From what I understand, your BVLS (Bounded-Variables Least-Squares) problems in every pixel are completely independent. They don't share the coefficients of the A array nor the B vector. The only similarity between the different problems is the size of the arrays.

If this is the case I don't see how one could speed-up the problem by some form of vectorization.

The only real solution would be for IDL to include a compiled BVLS routine in the core language. I had hoped for this to happen for some time, given that so much spectral analysis work has to solve this kind of problem.

So I take the opportunity of your message to suggest to Exelis to consider the inclusion of a compiled version of BVLS (http://www.netlib.org/lawson-hanson/all) in the core language.

Cheers,
Michele

On Tuesday, December 17, 2013 6:32:00 AM UTC, JP wrote:
> Hi IDLers,
>
> I am currently using BVLS (http://www-astro.physics.ox.ac.uk/~mxc/idl/bvls.pro) for spectral unmixing. It works great, but, on one pixel at a time. I want to implement for many pixels without having to loop. Example below:
>
>
>
> IDL> help, a
>
> A FLOAT = Array[85, 3]
>
> IDL> help, b
>
> B FLOAT = Array[85]
>
> IDL> help, bnd
>
> BND FLOAT = Array[2, 3]
>
> IDL> print, bnd
>
> 0.000000 1.00000
>
> 0.000000 1.00000
>
> 0.000000 1.00000
>
>
>
>
>
> bvls, A, B, BND, X_BVLS
>
>
>
> IDL> help, x_bvls
>
> X_BVLS FLOAT = Array[3]
>
>
>
> in my example A is a vector of "endmembers" (85 spectral bands and 3 fractions), B is a pixel (vector of 85 bands), BND are bounds (don't go negative nor >1) and the X_BVLS are the estimated fractions returned for that pixel.
>
> Now as you could imagine I have many many pixels (n) (my B is really a 2D array of [85, n]) and i've written a function which loops through n, but it gets very slow for large n.
>
>
>
> Any ideas?
>
>
>
> Thanks
Re: BVLS (NNLS) without loops? [message #87178 is a reply to message #86953] Tue, 14 January 2014 07:42 Go to previous messageGo to next message
Mike[5] is currently offline  Mike[5]
Messages: 5
Registered: October 2013
Junior Member
Hi Juan Pablo,

I don't see any obvious way to speed up your problem.

However I take the opportunity to suggest the inclusion of a compiled version of BVLS (or NNLS) into a future version of IDL. I have been using that routine for years in a numbers of problems. I keep missing a faster built-in IDL version.

Cheers,

Michele
Re: BVLS (NNLS) without loops? [message #87189 is a reply to message #87178] Tue, 14 January 2014 17:19 Go to previous message
JP is currently offline  JP
Messages: 55
Registered: April 2008
Member
Thanks Michele

JP


On Wednesday, 15 January 2014 02:42:43 UTC+11, Mike wrote:
> Hi Juan Pablo,
>
>
>
> I don't see any obvious way to speed up your problem.
>
>
>
> However I take the opportunity to suggest the inclusion of a compiled version of BVLS (or NNLS) into a future version of IDL. I have been using that routine for years in a numbers of problems. I keep missing a faster built-in IDL version.
>
>
>
> Cheers,
>
>
>
> Michele
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Why are you still here?
Next Topic: Is the sky falling?

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 11:44:07 PDT 2025

Total time taken to generate the page: 0.00432 seconds