| 90 | |
| 91 | |
| 92 | DevBlockJacobiMatrix :: DevBlockJacobiMatrix (const BlockJacobiPrecond<double> & mat) |
| 93 | : h(mat.Height()), w(mat.Width()), |
| 94 | matrices(mat.MatrixData()), indices(mat.GetBlockTable()->AsArray()) |
| 95 | { |
| 96 | const Array<FlatMatrix<double>> & inverses = mat.GetInverses(); |
| 97 | |
| 98 | Array<BlockJacobiCtr> hostctrs(inverses.Size()); |
| 99 | Dev<double> * matptr = matrices.Data(); |
| 100 | Dev<int> * indexptr = indices.Data(); |
| 101 | for (size_t i = 0; i < inverses.Size(); i++) |
| 102 | { |
| 103 | size_t s = inverses[i].Height(); |
| 104 | new (&hostctrs[i].mat) SliceMatrix<Dev<double>> (s, s, s, matptr); |
| 105 | hostctrs[i].indices = indexptr; |
| 106 | matptr += s*s; |
| 107 | indexptr += s; |
| 108 | } |
| 109 | |
| 110 | ctrstructs = Array<Dev<BlockJacobiCtr>> (hostctrs); |
| 111 | } |
| 112 | |
| 113 | |
| 114 | void DevBlockJacobiMatrix :: MultAdd (double s, const BaseVector & x, BaseVector & y) const |