Boost logo

Ublas :

Subject: Re: [ublas] [bindings] LAPACK ?GESVD and minimum workspace size
From: sguazt (marco.guazzone_at_[hidden])
Date: 2011-04-07 07:08:05


On Thu, Apr 7, 2011 at 12:52 PM, Rutger ter Borg <rutger_at_[hidden]> wrote:
> On 04/07/2011 11:59 AM, sguazt wrote:
>
>> I've tried to follow each path. I've end up with the following cases:
>>
>> --- [code] ---
>> m = ...; // # rows of A
>> n = ...; // # columns of A
>> sz = 0; // will hold the min work size
>> /* k = ::std::min(m,n); */
>> if (m>= n /*&&  k>  0 */) {
>>   if (jobu == 'N') {
>>     //sz = ::std::max(4*n, 5*n);
>>     sz = 5*n;
>>   } else {
>>     sz = ::std::max(3*n+m,5*n);
>>   }
>> } else /* if (k>  0) */ {
>>   if (jobvt == 'N') {
>>     // sz = ::std::max(4*m, 5*m);
>>     sz = 5*m;
>>   } else {
>>     sz = ::std::max(3*m+n,5*m);
>>   }
>> }
>> return sz;
>> --- [code] ---
>>
>> Do you agree?
>
> Looks promising. Would this be about the same as
>
> minmn = min( m, n );
> if ( jobu=='N' || jobvt == 'N' ) {
>  return 5 * minmn;
> } else {
>  return max( 3 * minmn + max(m,n), 5 * minmn );
> }
>
> ?

Sure, your's definitively better!! :)

Cheers,

-- Marco