Boost logo

Ublas :

From: Gunter Winkler (guwi17_at_[hidden])
Date: 2007-07-05 15:04:48


Am Donnerstag, 5. Juli 2007 12:42 schrieb choon:

>   //cout << ublas::inner_prod(v1,v2) << endl;   // <-- failed to
> compile

> cout << ublas::inner_prod(v1,v3) << endl;   // <-- this
> works; feature or bug?

The cause of this behavior is that the vector implementation is
essentially a loop: for ( i=0; i < result.size(); ++i ) ...
Thus the size is checked before computation. The sparse implementation
is based on forward iterators. Thus there is no size check. I can
simply add the check if necessary.

mfg
Gunter