MCPcopy Create free account
hub / github.com/cortex-js/compute-engine / pushPartBound

Function pushPartBound

scripts/fungrim/compile-rules.ts:304–325  ·  view source on GitHub ↗
(
    part: 're' | 'im' | 'abs' | 'arg',
    v: string,
    raw: MathJSON,
    openOp: 'gt' | 'lt',
    closedOp: 'ge' | 'le'
  )

Source from the content-addressed store, hash-verified

302 part: 're' | 'im' | 'abs' | 'arg',
303 v: string,
304 raw: MathJSON,
305 openOp: 'gt' | 'lt',
306 closedOp: 'ge' | 'le'
307 ): void => {
308 let bound = raw;
309 let open = false;
310 if (Array.isArray(bound) && bound[0] === 'Open') {
311 open = true;
312 bound = bound[1];
313 }
314 if (isInfiniteBound(bound)) return; // skip infinite bounds
315 guards.push({
316 k: 'part-cmp',
317 wc: wc(v),
318 part,
319 op: open ? openOp : closedOp,
320 bound: W(bound),
321 });
322 };
323
324 // Element(v, domain) for a bare entry variable v
325 const element = (v: string, dom: MathJSON): string | null => {
326 if (typeof dom === 'string') {
327 switch (dom) {
328 case 'Integers':

Callers 1

compileGuardsFunction · 0.85

Calls 3

isInfiniteBoundFunction · 0.85
wcFunction · 0.85
WFunction · 0.85

Tested by

no test coverage detected