MCPcopy Create free account
hub / github.com/NGSolve/ngsolve / AddOperators

Function AddOperators

linalg/basematrix.cpp:650–668  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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 {

Callers 3

GetTraceOperatorMethod · 0.85
operator+Function · 0.85

Calls 4

GetOpTypeMethod · 0.45
GetMatrixMethod · 0.45
GetRowParallelDofsMethod · 0.45
GetColParallelDofsMethod · 0.45

Tested by

no test coverage detected