value_cache.resize(ncols);
colnum_cache.resize(ncols);
- // then copy everything
- for (int i = 0; i < ncols; ++i)
- this->set(row, colnum_cache[i],
- value_cache[i]);
+ // then copy everything in one swoop
+ this->set(row,
+ colnum_cache,
+ value_cache);
}
return *this;
SparsityPattern sparsity (5,5,5);
sparsity.add (1,2);
sparsity.add (2,3);
+ sparsity.add (3,2);
+ sparsity.add (3,3);
sparsity.add (3,4);
sparsity.add (4,3);
sparsity.compress();
1.000e+00
2.000e+00 3.000e+00
4.000e+00 5.000e+00
- 6.000e+00 7.000e+00
- 9.000e+00 8.000e+00
+ 7.000e+00 6.000e+00 8.000e+00
+ 1.000e+01 9.000e+00
DEAL::Copy with all values:
(0,0) 1.00000
(1,1) 2.00000
(2,2) 4.00000
(2,3) 5.00000
(3,3) 6.00000
-(3,4) 7.00000
-(4,4) 8.00000
-(4,3) 9.00000
+(3,2) 7.00000
+(3,4) 8.00000
+(4,4) 9.00000
+(4,3) 10.0000
In the beginning the Universe was created. This has made a lot of
people very angry and has been widely regarded as a bad move.
Douglas Adams