MCPcopy Create free account
hub / github.com/BIMCoderLiang/LNLib / GetKnotMultiplicity

Method GetKnotMultiplicity

src/LNLib/Algorithm/Polynomials.cpp:107–125  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

105}
106
107int LNLib::Polynomials::GetKnotMultiplicity(const std::vector<double>& knotVector, double knot)
108{
109 VALIDATE_ARGUMENT(knotVector.size() > 0, "knotVector", "KnotVector size must be greater than zero.");
110 VALIDATE_ARGUMENT(ValidationUtils::IsValidKnotVector(knotVector), "knotVector", "KnotVector must be a nondecreasing sequence of real numbers.");
111 VALIDATE_ARGUMENT_RANGE(knot, knotVector[0], knotVector[knotVector.size() - 1]);
112
113 int size = knotVector.size();
114 int multi = 0;
115
116 for (int index = 0; index < size; index++)
117 {
118 if (MathUtils::IsAlmostEqualTo(knot, knotVector[index]))
119 {
120 multi++;
121 }
122 }
123
124 return multi;
125}
126
127int LNLib::Polynomials::GetKnotSpanIndex(int degree, const std::vector<double>& knotVector, double paramT)
128{

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected