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

Function TransposeCF

fem/coefficient.cpp:4350–4367  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4348 }
4349
4350 shared_ptr<CoefficientFunction> TransposeCF (shared_ptr<CoefficientFunction> coef)
4351 {
4352 if (coef->IsZeroCF())
4353 {
4354 auto dims = coef->Dimensions();
4355 if (dims.Size() == 2)
4356 coef->SetDimensions( Array( {dims[1], dims[0]}) );
4357 else
4358 throw Exception("Transpose of non-matrix called");
4359 return coef;
4360 }
4361
4362 // if (coef.use_count() == 1)
4363 if (dynamic_pointer_cast<IdentityCoefficientFunction> (coef) && !coef->IsVariable())
4364 return coef;
4365
4366 return make_shared<TransposeCoefficientFunction> (coef);
4367 }
4368
4369
4370

Callers 15

DiffShapeMethod · 0.85
DiffShapeMethod · 0.85
DiffMethod · 0.85
DiffMethod · 0.85
DiffShapeMethod · 0.85
DiffShapeMethod · 0.85
TransposeMethod · 0.85
optimize_legacyFunction · 0.85
optimize_transposeFunction · 0.85
DiffShapeMethod · 0.85
DiffMethod · 0.85

Calls 3

DimensionsMethod · 0.80
IsZeroCFMethod · 0.45
SizeMethod · 0.45

Tested by

no test coverage detected