Boost logo

Ublas :

From: Norman Casagrande (nova77_at_[hidden])
Date: 2007-03-08 05:16:56


What about the good old memset?
(As far as the memory for the values is contiguous. Please correct me
if I it is not so)

inline static void SetToZero(compressed_matrix<TDataType>& rA){
memset(rA.value_data().begin(), 0, rA.value_data().size()*sizeof(TDataType) }

But remember that this is going to clear only the currently allocated
memory (capacity) of the matrix!

Cheers,
Norman

On 3/8/07, Riccardo Rossi <rrossi_at_[hidden]> wrote:
> Dear List,
> i guess this has already being addressed a few time but i can not
> find the link ...
>
> i'd like to ask what is the "good" (read FAST) way of setting to zero
> all the entries of a compressed matrix without touching its structure?
>
> the function i am using now is :
>
>
>
> inline static void SetToZero(compressed_matrix<TDataType>&
> rA){std::fill(rA.value_data().begin(), rA.value_data().end(),
> TDataType());}
>
>
>
> unfortunatelly valgrind is telling me of something wrong happening when
> i do this... indeed the error could come from somewhere else but it
> always appear here in my application.
>
>
>
> right now i am using 1.33.1 which i guess is getting more and more
> outdated...i think this is a good occasion to ask about the ublas
> future:
> did any "major" change happen in the interface for the forthcoming 1.34
> release? what will be the areas of open development in ublas in the next
> years? is anyone working in parallelism ?
>
> greetings from spain
>
> Riccardo