Skip to content

feat(bindings): tnumber position predicates (<<, >>, &<, &>)#38

Closed
estebanzimanyi wants to merge 1 commit into
feat/tnumber-numspan-tbox-topopsfrom
feat/tnumber-numspan-tbox-posops
Closed

feat(bindings): tnumber position predicates (<<, >>, &<, &>)#38
estebanzimanyi wants to merge 1 commit into
feat/tnumber-numspan-tbox-topopsfrom
feat/tnumber-numspan-tbox-posops

Conversation

@estebanzimanyi

Copy link
Copy Markdown
Member

Summary

Adds 40 ScalarFunction registrations for tnumber value-position predicates, backed by 20 wrapper functions:

Op tnumber × numspan tnumber × tbox tnumber × tnumber
<<, >>, &<, &> (intspan↔tint, floatspan↔tfloat) × both directions (tint, tfloat) × both directions tint-tint, tfloat-tfloat

MEOS bindings (20)

left/right/overleft/overright_tnumber_numspan + _numspan_tnumber + _tnumber_tbox + _tbox_tnumber + _tnumber_tnumber — all in MEOS public API.

Implementation reuses the TempBoxBoolPred / BoxTempBoolPred / TempTempBoolPred helpers from PR #37 plus three new macros (DEFINE_NUMSPAN_POS, DEFINE_TBOX_POS, DEFINE_TNUM_POS) that generate the wrappers.

Smoke test

SELECT tint '[1@01-01, 5@01-05]' << intspan '[10, 20]';                  -- true
SELECT intspan '[10, 20]' >> tint '[1@01-01, 5@01-05]';                  -- true
SELECT tfloat '[1@01-01, 5@01-05]' &< floatspan '[6, 10]';               -- true
SELECT tint '[1@01-01, 5@01-05]' << tbox 'TBOXINT XT([10,20],...)';      -- true
SELECT tint '[1@01-01, 5@01-05]' << tint '[10@01-01, 20@01-05]';         -- true

Test plan

Dependencies

Stacked on PR #37 (tnumber topological). Merge order: ... #36#37 → this.

Adds 40 ScalarFunction registrations for tnumber-vs-{numspan, tbox,
tnumber} value-position predicates, backed by 20 wrapper functions:

  4 ops (<<, >>, &<, &>) × 5 type-pair shapes:
    tnumber × numspan,  numspan × tnumber  (intspan↔tint, floatspan↔tfloat)
    tnumber × tbox,     tbox × tnumber     (both base types)
    tnumber × tnumber                       (same base type only)

MEOS bindings (20):
  left/right/overleft/overright_tnumber_numspan
  left/right/overleft/overright_numspan_tnumber
  left/right/overleft/overright_tnumber_tbox
  left/right/overleft/overright_tbox_tnumber
  left/right/overleft/overright_tnumber_tnumber

Implementation uses the TempBoxBoolPred / BoxTempBoolPred /
TempTempBoolPred helpers from PR #37 plus three new macros
(DEFINE_NUMSPAN_POS, DEFINE_TBOX_POS, DEFINE_TNUM_POS) that
generate the wrappers.

Smoke test:
  SELECT tint '[1@01-01, 5@01-05]' << intspan '[10, 20]';                 -- true
  SELECT intspan '[10, 20]' >> tint '[1@01-01, 5@01-05]';                 -- true
  SELECT tfloat '[1@01-01, 5@01-05]' &< floatspan '[6, 10]';              -- true
  SELECT tint '[1@01-01, 5@01-05]' << tbox 'TBOXINT XT([10,20],...)';     -- true
  SELECT tint '[1@01-01, 5@01-05]' << tint '[10@01-01, 20@01-05]';        -- true

Stacked on PR #37 (tnumber × {numspan, tbox} topological).

Full suite passes (747 assertions, 13 test cases).
@estebanzimanyi

Copy link
Copy Markdown
Member Author

Consolidated into #40 (tnumber × {numspan, tbox} bounding-box predicates — topo + position combined).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant