Following up, here is a test case for deal.II's BlockVector which fails. I have tried g++ 4.2 and 4.3 without optimization and -llac as well as -llac.g.
Questions: * Where is the definition of BlockVector's operator= ? * If it exists, shouldn't it do something like collect_sizes() ? Regards, -- Christian Cornelssen
// BlockVector Test for deal.II v6.2.pre
#include <lac/block_vector.h>
#include <vector>
#include <cassert>
int main () {
std::vector<double> v(9);
for (unsigned int i = 0; i < v.size(); ++i)
v[i] = double(i+1);
std::vector<unsigned int> partition(3);
for (unsigned int i = 0; i < partition.size(); ++i)
partition[i] = 3;
dealii::BlockVector<double> b(partition);
assert (b.n_blocks() == partition.size()); // passes
unsigned int size = 0;
for (unsigned int i = 0; i < b.n_blocks(); ++i)
{
assert (b.block(i).size() == partition[i]); // passes
size += b.block(i).size();
}
assert (b.size() == size); // passes
for (unsigned int i = 0; i < b.size(); ++i)
{
b(i) = v[i];
assert (b(i) == v[i]); // passes
}
dealii::BlockVector<double> c;
c = b;
assert (c == b); // passes
assert (c.n_blocks() == b.n_blocks()); // fails!
for (unsigned int i = 0; i < b.n_blocks(); ++i)
{
assert (c.block(i) == b.block(i)); // bus error here
}
assert (c.size() == b.size()); // fails!
for (unsigned int i = 0; i < b.size(); ++i)
{
assert (c(i) == b(i)); // segfault here
}
return 0;
}
signature.asc
Description: PGP signature
_______________________________________________
