MCPcopy Create free account
hub / github.com/AcademySoftwareFoundation/Imath / rdivTuple

Function rdivTuple

src/python/PyImath/PyImathShear.cpp:379–397  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

377
378template <class T>
379static Shear6<T>
380rdivTuple(Shear6<T> &v, const tuple &t)
381{
382 MATH_EXC_ON;
383 if(t.attr("__len__")() != 6)
384 throw std::domain_error ("Shear6 expects tuple of length 6");
385
386 Shear6<T> w;
387 for(int i = 0; i < 6; ++i)
388 {
389 T a = extract<T>(t[i]);
390 if(v[i] != T (0))
391 w[i] = a / v[i];
392 else
393 throw std::domain_error ("Division by Zero");
394 }
395
396 return w;
397}
398
399template <class T>
400static bool

Callers

nothing calls this directly

Calls 1

TClass · 0.50

Tested by

no test coverage detected