Interval Clamp and Empty Audit

Audit raw clipped interval bounds and emptiness; disjoint intersections retain start>end as evidence, not a fabricated nonempty interval.

Description

Audit raw clipped interval bounds and emptiness; disjoint intersections retain start>end as evidence, not a fabricated nonempty interval.

Clamping intervals to a domain can remove their entire contents. Keeping an empty flag alongside raw clipped endpoints helps distinguish clipping from an actual surviving span.

When to use this tool

Audit raw clipped interval bounds and emptiness; disjoint intersections retain start>end as evidence, not a fabricated nonempty interval.

  • Prepare the supplied intervals, domainStart, domainEnd fields for this operation.
  • Compare the complete example with the representation used by your own input before carrying the result into another step.

How to use the tool and how it works

  1. Enter intervals, domainStart, domainEnd. Use the exact text syntax, units and index conventions explained below.
  2. Run the tool. If input validation fails, correct the supplied fields before interpreting any result.
  3. Read result.audit. Interpret false, null and empty lists using the distinctions below; they can be valid outputs.

For each interval, set start to the larger source/domain start and end to the smaller source/domain end. Report empty when end is at most start and clipped when either endpoint changed.1

Input fieldMeaning and representationAccepted input
intervalsintervals.Numeric rows; at most 128 rows and 128 values per row
domainStartdomain start.Finite number
domainEnddomain end.Finite number
Output fieldInterpretation
resultObject containing the named outputs below.
result.auditThe audit list in the ordering and representation described above.
json
{
  "input": {
    "intervals": [
      [
        0,
        2
      ],
      [
        4,
        5
      ]
    ],
    "domainStart": 1,
    "domainEnd": 3
  },
  "output": {
    "result": {
      "audit": [
        {
          "sourceIndex": 0,
          "start": 1,
          "end": 2,
          "empty": false,
          "clipped": true
        },
        {
          "sourceIndex": 1,
          "start": 4,
          "end": 3,
          "empty": true,
          "clipped": true
        }
      ]
    }
  }
}

Limitations and assumptions

  • An interval wholly outside the domain can produce start greater than end. These are audit coordinates, not normalized nonempty intervals; inspect empty before consuming them.
  • Interval-array rows contain exactly two finite endpoints in start/end order, with at most 128 intervals per collection. Individual operations state when positive length, integer endpoints or explicit inclusion flags are required.
  • Every declared top-level field is required and unexpected fields are rejected. Numeric inputs must be finite; ordinary text fields are bounded to 8,192 UTF-16 code units, with tighter operation-specific limits where stated.
  • Ordinary string lists have at most 128 entries of at most 128 code units each; numeric lists and matrices have separate bounded size checks. Nonfinite results and excessively large serialized outputs are rejected.
  • Indexes are zero-based and spans have an exclusive end unless explicitly stated otherwise. A valid false, null or empty-list result is distinct from malformed input.

Alternative or Complementary methods

Retain the endpoint convention with every result. Continuous length, integer point counts and open/closed membership differ; merge returned cells separately when a canonical minimal interval collection is required.

References

  1. Tool behavior and example: Interval Clamp and Empty Audit — tool.io

Similar or alternative tools

  • Interval Affine Transform

    Affine-transform interval endpoints, reorder the image bounds and retain negative-scale orientation reversal.

  • Interval Complement Within Domain

    Compute half-open uncovered domain cells after clipping supplied intervals; no extrapolation outside the explicit nonempty domain.

Don't forget to set a bookmark for tool.io!
Privacy | Imprint | Cookies