Boost logo

Ublas :

From: Nico Galoppo (nico_at_[hidden])
Date: 2007-11-17 10:42:34


I'm having issues with serialization (malloc problems), and I'm trying
to figure out where the bug is (ublas or own code). I noticed
something bizarre in the output of my serialization of a
compressed_matrix, vs. Gunter's example code output.

I create and fill a compressed_matrix as follows, and then I make a
copy (just to make sure that less storage is required, see issue

  ublas::compressed_matrix<double> K;
  // ... fill K ..
  // Make a copy
  ublas::compressed_matrix<double> Kcopy;

Then, the result xml file is like this:

<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE boost_serialization>
<boost_serialization signature="serialization::archive" version="4">
<K class_id="0" tracking_level="0" version="0">
        <index1_data class_id="1" tracking_level="0" version="0">
        <value_data class_id="2" tracking_level="0" version="0">

Notice that index1_data size is 1618, where it should only be 148
(filled1). These sizes match up in Gunter's example, they don't in my
case. This causes garbage data in index1_data after item 148.

Also, why is capacity so big? Making a copy, I would expect only the
nnz() in matrix K should be required storage upon construction of



Nico Galoppo ::