| 648 | } |
| 649 | |
| 650 | shared_ptr<BaseMatrix> AddOperators (shared_ptr<BaseMatrix> a, |
| 651 | shared_ptr<BaseMatrix> b, |
| 652 | double faca, double facb) |
| 653 | { |
| 654 | auto para = dynamic_pointer_cast<ParallelMatrix> (a); |
| 655 | auto parb = dynamic_pointer_cast<ParallelMatrix> (b); |
| 656 | if (para && parb) |
| 657 | { |
| 658 | if (para->GetOpType() == parb->GetOpType()) |
| 659 | return make_shared<ParallelMatrix> (AddOperators (para->GetMatrix(), parb->GetMatrix(), faca, facb), |
| 660 | para->GetRowParallelDofs(), |
| 661 | para->GetColParallelDofs(), |
| 662 | para->GetOpType()); |
| 663 | |
| 664 | cerr << "Adding parallel matrices of different types, type a = " |
| 665 | << int(para->GetOpType()) << ", type b = " << int(parb->GetOpType()) << endl; |
| 666 | } |
| 667 | return make_shared<SumMatrix> (a, b, faca, facb); |
| 668 | } |
| 669 | |
| 670 | shared_ptr<BaseMatrix> TransposeOperator (shared_ptr<BaseMatrix> mat) |
| 671 | { |
no test coverage detected