| 668 | } |
| 669 | |
| 670 | shared_ptr<BaseMatrix> TransposeOperator (shared_ptr<BaseMatrix> mat) |
| 671 | { |
| 672 | if (auto emb = dynamic_pointer_cast<Embedding> (mat)) |
| 673 | return make_shared<EmbeddingTranspose> (emb->Height(), emb->GetRange(), emb->IsComplex()); |
| 674 | |
| 675 | if (auto emb = dynamic_pointer_cast<EmbeddingTranspose> (mat)) |
| 676 | return make_shared<Embedding> (emb->Width(), emb->GetRange(), emb->IsComplex()); |
| 677 | |
| 678 | if (auto parmat = dynamic_pointer_cast<ParallelMatrix> (mat)) |
| 679 | return make_shared<ParallelMatrix> (TransposeOperator(parmat->GetMatrix()), |
| 680 | parmat->GetColParallelDofs(), |
| 681 | parmat->GetRowParallelDofs(), |
| 682 | ParallelOp(InvertType(ColType(parmat->GetOpType())), |
| 683 | InvertType(RowType(parmat->GetOpType())))); |
| 684 | |
| 685 | |
| 686 | return make_shared<Transpose> (mat); |
| 687 | } |
| 688 | |
| 689 | |
| 690 |
no test coverage detected