MCPcopy Create free account
hub / github.com/bgrimstad/splinter / isKnotVectorRefinement

Function isKnotVectorRefinement

src/knots.cpp:49–68  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

47}
48
49bool isKnotVectorRefinement(const std::vector<double> &knots, const std::vector<double> &refinedKnots)
50{
51 // Check size
52 if (refinedKnots.size() < knots.size())
53 return false;
54
55 // Check that each element in knots occurs at least as many times in refinedKnots
56 for (std::vector<double>::const_iterator it = knots.begin() ; it != knots.end(); ++it)
57 {
58 int m_tau = count(knots.begin(), knots.end(), *it);
59 int m_t = count(refinedKnots.begin(), refinedKnots.end(), *it);
60 if (m_t < m_tau) return false;
61 }
62
63 // Check that range is not changed
64 if (knots.front() != refinedKnots.front()) return false;
65 if (knots.back() != refinedKnots.back()) return false;
66
67 return true;
68}
69
70} // namespace SPLINTER

Callers 5

knots.cppFile · 0.85
refineKnotsMethod · 0.85
refineKnotsLocallyMethod · 0.85
decomposeToBezierFormMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected