$include_dir="/home/hyper-archives/ublas/include"; include("$include_dir/msg-header.inc") ?>
Subject: [ublas] prod function usage
From: Umut Tabak (u.tabak_at_[hidden])
Date: 2011-05-20 07:21:32
Dear all,
I try to use the prod function to multiply a compressed_matrix<double> 
with a ublas::vector<double>, however I am getting a segmentation fault 
from an assignment like this
Mq = prod( B,q );
where I could not understand the reason of this strange error. I 
allocate the space for Mq vector with resize.
If I use prod( B,q ) on a line to evaluate this expression that works 
fine however, if I try to assign I am getting a segmentation fault and 
the segfault is
Program received signal SIGSEGV, Segmentation fault.
0x000000000040a2a8 in allocate (__n=<value optimized out>, this=<value 
optimized out>) at /usr/include/c++/4.4/ext/new_allocator.h:89
89        return static_cast<_Tp*>(::operator new(__n * sizeof(_Tp)));
This product is used in a template function but the above error reminds 
me that I have a memory leak and checked my program however with 
valgrind that seemed ok.
Any ideas on where I am mistaken?
Best wishes,
Umut