Boost logo

Ublas :

From: Gunter Winkler (guwi17_at_[hidden])
Date: 2006-12-07 05:11:42


On Thursday 07 December 2006 04:10, Seabook wrote:
> Hello Gunter,
>
> I done it!

Thanks. Can you post or mail the source code, please?

> (1)compressed_matrix<float, column_major> * compressed_matrix<float,
> column_major>
> (2)compressed_matrix<float, column_major> * matrix<float, column_major>
> (3)compressed_matrix<float, column_major> * matrix<float, row_major>
> (4)compressed_matrix<float, column_major> * symmetric_matrix<float, upper>
> (5)compressed_matrix<float, column_major> * symmetric_matrix<float, lower>
> (6) normal matrix * normal matrix
> I do A[100,100]*B[100,100]=C[100,100] 20times.( using prod() )
> Without assigning data to these matrixes.
> The time seems reasonable.
> Debug Release (m sec)
> (1) 219 79
> (2) 422 93
> (3) 250 110
> (4) 188 109
> (5) 172 109
> (6) 351 157
The debug times are slower because the product is computed twice (once with
the release algorithm and once again with a slow but reliable algorithm).
The release time for sparse types is surprisingly high (should be zero, but is
O(n) because the outer iterators are actually dense).

> If I assgin some data to these matrixed. (like this way)
> for(i=0;i<99;i++)
> for(j=0;j<99;j++)
> ...
> sy1(i,j)=0;
> sy1(i,j)=0;
                ^^^ this should be sy2?
> Release (m sec)
> (1) 6437
> (2) 7110
> (3) 7187
> (4) 6656
> (5) 6641
> (6) 157
> It's really slow! (I assign data incorrectly ?)
> I have no idea about this.

This is quite interesting. What is the type of the result?
maybe you should try prod<matrix<double> >(A,B) (this forces the result type
to be dense, if the automatic result type is sparse then the times are very
high because insertion of elements into a (general) sparse type is usually
very slow).

> When I use axpy_prod(sp1,sp2,sp3,true) ,
> This message will show on the operation.hpp
> " error C2039: 'functor_type' : is not a member of
> 'boost::numeric::ublas::basic_full<>' "
> I forget to use some .hpp files or operate incorrectly???

I need the source (or at least the line number) to check this.

> My question list:
> 1. Why will assigned matrixed run slowly?
empty sparse matrices ( == zero matrices ) do not store any element. Thus they
should multiply in zero time. (Try axpy_prod( compressed_matrix,
dense_vector, ... ) ). Sparse algorithms are
> 2. Why could not I use axpy_prob function?
see above.
> 3. How to see the special matrix data by "watch"function ?

compressed_matrix has index1_data(), index2_data() and value_data()
dense matrices have data() member functions ( usable like double[], and int[])

mfg
Gunter