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

Function sanitize_signature

fem/tensorcoefficient.cpp:283–304  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

281 }
282
283 string sanitize_signature(string signature)
284 {
285 if (signature.find("->") == string::npos)
286 {
287 map<char, size_t> symbol_count{};
288 for (auto c: signature)
289 {
290 if (c == ',' || c == '-' || c == '>' || c == '\0')
291 continue;
292 if (symbol_count.count(c) == 0)
293 symbol_count[c] = 0;
294 symbol_count[c]++;
295 }
296 for (auto item : symbol_count)
297 if (item.second != 2)
298 throw NG_EXCEPTION("Signature does not contain '->'. ATM, this "
299 "is only allowed if each index appears "
300 "exactly twice.");
301 signature += "->";
302 }
303 return signature;
304 }
305
306 vector<string> split_signature(string signature)
307 {

Callers 1

split_signatureFunction · 0.85

Calls 1

findMethod · 0.80

Tested by

no test coverage detected