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

Function divTuple

src/python/PyImath/PyImathShear.cpp:358–376  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

356
357template <class T>
358static Shear6<T>
359divTuple(Shear6<T> &v, const tuple &t)
360{
361 MATH_EXC_ON;
362 if(t.attr("__len__")() != 6)
363 throw std::domain_error ("Shear6 expects tuple of length 6");
364
365 Shear6<T> w;
366 for(int i = 0; i < 6; ++i)
367 {
368 T a = extract<T>(t[i]);
369 if(a != T (0))
370 w[i] = v[i] / a;
371 else
372 throw std::domain_error ("Division by Zero");
373 }
374
375 return w;
376}
377
378template <class T>
379static Shear6<T>

Callers

nothing calls this directly

Calls 1

TClass · 0.50

Tested by

no test coverage detected