Boost logo

Boost :

From: Kresimir Fresl (fresl_at_[hidden])
Date: 2002-06-28 06:55:44


Joerg Walter wrote:

> From: "Marc Duflot" <m.duflot_at_[hidden]>

>>There is a bug in uBLAS that is illustrated with the following code:
>>
>>#include <iostream>
>>#include <boost/numeric/ublas/vector_sp.h>
>>#include <boost/numeric/ublas/io.h>
>>
>>int main () {
>> numerics::sparse_vector<double> v (3);
>> v(1) = v(0) = 42;
>> std::cout << v << std::endl;
>>}
>>
>>The output of the program is (with g++ 2.95.2 and g++ 3.0.4 on Linux)
>>[3](42,0,0)
>>

> Surprising. I'll have to look, whether it's a library or compiler problem.

Some more data with slightly extended example:
=======================================
int main () {
   numerics::sparse_vector<double> v1 (3), v2 (3), v3 (3), v4 (3);
   v1(1) = v1(0) = 42;
   v2(0) = v2(1) = 42;
   v3(1) = v4(1) = 42;
   std::cout << v1 << std::endl;
   std::cout << v2 << std::endl;
   std::cout << v3 << std::endl;
   std::cout << v4 << std::endl;
}
=======================================

g++ 3.1:
=======================================
[3](42,0,0)
[3](42,42,0)
[3](0,42,0)
[3](0,42,0)
=======================================

Comeau C++ 4.2.45.2 and 4.3.0 beta 4:
=======================================
[3](42,0,0)
[3](42,42,0)
[3](0,42,0)
[3](0,42,0)
=======================================

Intel C++ 6.0:
=======================================
[3](42,42,0)
[3](42,42,0)
[3](0,42,0)
[3](0,42,0)
=======================================

Sincerely,

fres


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk