MCPcopy Create free account
hub / github.com/PyMesh/PyMesh / compute_wire_gradient

Method compute_wire_gradient

tools/Wires/Parameters/ParameterManager.cpp:387–409  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

385}
386
387MatrixFr ParameterManager::compute_wire_gradient(size_t i) const {
388 // This is probably not fast, but the number of parameters are typically
389 // low.
390 const size_t num_thickness_dofs = get_num_thickness_dofs();
391 if (i < num_thickness_dofs) {
392 size_t count = 0;
393 for (const auto& param : m_thickness_params) {
394 if (count == i)
395 return param->compute_derivative();
396 count++;
397 }
398 } else {
399 size_t count = num_thickness_dofs;
400 for (const auto& param : m_offset_params) {
401 if (count == i)
402 return param->compute_derivative();
403 count++;
404 }
405
406 }
407
408 throw RuntimeError("Parameter index out of bound!");
409}
410
411VectorI ParameterManager::get_thickness_dof_map() const {
412 size_t domain_size = 0;

Callers

nothing calls this directly

Calls 2

RuntimeErrorClass · 0.85
compute_derivativeMethod · 0.45

Tested by

no test coverage detected