Skip to content
ForCADDocumentation

compute_multiplicity Interface

public interface compute_multiplicity

Count exact knot multiplicities for one knot or an array of knots.

Callers that compare independently generated floating-point knots should first apply a tolerance policy; multiplicity itself follows knot-vector representation and therefore uses exact stored values.


Module Procedures

private pure function compute_multiplicity1(knot) result(multiplicity)

Return exact consecutive run lengths in stored knot order. For a nondecreasing knot vector, each value occupies one run and these are its mathematical knot multiplicities. For arbitrary input, equal values in separated runs produce separate entries. Equality is exact.

Arguments

Type IntentOptional Attributes Name
real(kind=rk), intent(in), contiguous :: knot(:)

Return Value integer, allocatable, (:)

private pure function compute_multiplicity2(knot, Xth) result(multiplicity)

Return the longest exact consecutive run of one stored knot value. For a nondecreasing knot vector this is its knot multiplicity. For arbitrary input with separated equal runs, the result is the maximum run length rather than the total occurrence count. Zero means absent.

Arguments

Type IntentOptional Attributes Name
real(kind=rk), intent(in), contiguous :: knot(:)
real(kind=rk), intent(in) :: Xth

Return Value integer