Boost logo

Ublas :

Subject: [ublas] numeric bindings - computing workspace requirements
From: Peter Man (plwm2_at_[hidden])
Date: 2011-01-12 07:30:15


Hi all,

I'm currently using the numeric bindings library, however, I'm trying to
find an easy way of determining the workspace requirements that I need.
As far as I can see, the numeric bindings wrappings around the original
lapack routines automatically do all the work i.e.

- if not using your own workspace, it ascertains either minimal or
optimal workspace requirements by passing lwork=-1 to the original
lapack function.
- creates a temporary workspace according to the computed size
- then the original lapack routine is called using that temporary workspace
- and then the temporary workspace goes out of scope meaning it gets
destroyed.

However, the user of the wrapped lapack functions doesn't have access to
the size of this temporary workspace. Since i'm making repeated calls to
these lapack routines, it seems wasteful that I'm repeatedly creating
and destroying this temporary workspace. My question is this: have I
missed something and that the user actually does have some easy way of
determining the optimal workspace sizes, or should I just create an
overly large workspace object myself? The problem is that I'm not sure
how large I should make this workspace object if I choose the latter option.

Thanks,

Peter