Boost logo

Boost Users :

Subject: Re: [Boost-users] [ublas]how to get tsm to compile with simple matrixargs?
From: Larry Evans (cppljevans_at_[hidden])
Date: 2011-11-16 21:11:37


On 11/14/11 15:53, pmamales_at_[hidden] wrote:
> Hi Larry,
>> Ah! I should have read closer. BTW, since, based on our past emails,
>> you're interested in linear equation solvers for tridiagonal systems,
>> maybe you could let me know how you're solving tridiagonal systems with
>> ublas or lapack. I'd appreciate it.
>>
>
> Well, blas does not provide with any, and lapack providees with expensive ones
> (w/pivoting and all that, and only saves on the memory footprint, and multiplies with
> 0's until kingdom comes ;-)).
> You are much better off googling Thomas Algorithm and implementing it on your own (does not
> take much at all).

Done:

http://svn.boost.org/svn/boost/sandbox/variadic_templates/sandbox/stepper/boost/array_stepper/numeric/solve_tridiag.hpp

> I would advise you have the lapack ones avail too, for the "nasty" problems.
> Look in LAPACk for
> *gtsv, *gtsvx, *ptsv, *ptsvx
> where * stands for s,d,c or z for float, double, complex<float> and complex<double> respectively.
> You will have to do a little wrapping, but who doesn't ;))

Did the *gtsv in the attached. To get it to link, had to add:
  -llapack -lblas -lgfortran
options to link command.

The in source comments indicate that lapack knows the matrix is banded;
hence, I'm a bit surprised at your observation that it:

  multiplies with 0's until kingdom comes ;-)).

Any idea why?
[snip]

Thanks for the help Petros.

-regards,
Larry




Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net