Boost logo

Ublas :

From: choon (teochoonhui_at_[hidden])
Date: 2007-07-05 06:42:56


Hi,

uBLAS doesn't complain when I do inner_prod with one compressed_vector and
another (compressed_)vector of different sizes. Can anyone tell me if this
is a feature or a bug?

example:

#include <iostream>
#include <boost/numeric/ublas/vector.hpp>
#include <boost/numeric/ublas/vector_sparse.hpp>
#include <boost/numeric/ublas/io.hpp>
#include <boost/numeric/ublas/fwd.hpp>

using namespace boost::numeric;
using namespace std;

int main(int argc, char **argv)
{
  ublas::vector<double> v1(11);
  ublas::vector<double> v2(12);
  ublas::compressed_vector<double> v3(13);
  
  v1[0] = 11;
  v2[0] = 12;
  v3[0] = 13;

  //cout << ublas::inner_prod(v1,v2) << endl; // <-- failed to compile
  cout << ublas::inner_prod(v1,v3) << endl; // <-- this works; feature or
bug?
  
  return EXIT_SUCCESS;
}

Thanks,
Choon

-- 
View this message in context: http://www.nabble.com/bug-in-sparse-vector-inner-product--tf4028960.html#a11444247
Sent from the Boost - uBLAS mailing list archive at Nabble.com.