|
Ublas : |
Subject: Re: [ublas] Subrange or slice on sparse matrices
From: Umut Tabak (u.tabak_at_[hidden])
Date: 2008-11-30 08:22:57
Gunter Winkler wrote:
> Am Freitag, 28. November 2008 01:07 schrieb Umut Tabak:
>
>> Dear all,
>>
>> While planning for some possible fe code generation, I tried to check
>> the Ublas lib. I was wondering if subrange/slice capabilities also
>> apply to sparse matrices? Or are there some tricks or workarounds to
>> make this happen?
>>
>
> The range and slice operation work with all matrix types - including
> sparse ones.
>
> simply use project():
>
> compressed_matrix<double> A(50000, 50000);
> vector<double> x(5);
> y = prod(project(A, range(0,50000), range(1000,1005)), x);
>
> or
>
> apxy_prod(project(A, range(0,50000), range(1000,1005)), x, y, false);
> (which is more efficient ...)
>
> mfg
> Gunter
>
> PS: However uBLAS default algorithms can still be beaten by handcoded,
> optimized routines, see http://guwi17.de/ublas/matrix_sparse_usage.html
>
> mfg
> Gunter
>
>
As a newcomer, this was what I was looking... Thx
> ------------------------------------------------------------------------
>
> _______________________________________________
> ublas mailing list
> ublas_at_[hidden]
> http://lists.boost.org/mailman/listinfo.cgi/ublas
>
-- -- U.T. -- There are some things which cannot be learned quickly, and time, which is all we have, must be paid heavily for their acquiring. They are the very simplest things, and because it takes a man's life to know them the little new that each man gets from life is very costly and the only heritage he has to leave. - Ernest Hemingway