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

Function InverseCF

fem/coefficient_matrix.cpp:1223–1236  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1221
1222
1223 shared_ptr<CoefficientFunction> InverseCF (shared_ptr<CoefficientFunction> coef)
1224 {
1225 auto dims = coef->Dimensions();
1226 if (dims.Size() != 2) throw Exception("Inverse of non-matrix");
1227 if (dims[0] != dims[1]) throw Exception("Inverse of non-quadratic matrix");
1228 switch (dims[0])
1229 {
1230 case 1: return make_shared<InverseCoefficientFunction<1>> (coef);
1231 case 2: return make_shared<InverseCoefficientFunction<2>> (coef);
1232 case 3: return make_shared<InverseCoefficientFunction<3>> (coef);
1233 default:
1234 return make_shared<InverseCoefficientFunctionAnyDim>(coef);
1235 }
1236 }
1237
1238
1239

Callers 2

DiffJacobiMethod · 0.85

Calls 2

DimensionsMethod · 0.80
SizeMethod · 0.45

Tested by

no test coverage detected