FUNCTION extremal_position_check

(* SCHEMA step_merged_ap_schema; *)
-- IN AP238 STEP-NC/AP242
FUNCTION extremal_position_check
      (fun : linearized_table_function ) : BOOLEAN;
   LOCAL
      source_domain : maths_space;
      source_interval : finite_integer_interval;
      index : INTEGER := 1;
      base : INTEGER;
      shape : LIST OF positive_integer;
      ndim : positive_integer;
      slo : INTEGER;
      shi : INTEGER;
      sublo : LIST OF INTEGER := [];
      subhi : LIST OF INTEGER := [];
   END_LOCAL;
      IF NOT EXISTS(fun) THEN
         RETURN (FALSE);
      END_IF;
      source_domain := factor1(fun.source.domain);
      IF schema_prefix + 'TUPLE_SPACE' IN TYPEOF(source_domain) THEN
         source_domain := factor1(source_domain);
      END_IF;
      IF NOT (schema_prefix + 'FINITE_INTEGER_INTERVAL' IN TYPEOF(source_domain)) THEN
         RETURN (FALSE);
      END_IF;
      source_interval := source_domain;
      base := fun\explicit_table_function.index_base;
      shape := fun\explicit_table_function.shape;
      IF schema_prefix + 'STANDARD_TABLE_FUNCTION' IN TYPEOF(fun) THEN
         REPEAT j := 1 TO SIZEOF(shape);
            index := index * shape[j];
         END_REPEAT;
         index := fun.first + index - 1;
         RETURN (bool((source_interval.min <= index) AND (index <= source_interval.max)));
      END_IF;
      IF schema_prefix + 'REGULAR_TABLE_FUNCTION' IN TYPEOF(fun) THEN
         ndim := SIZEOF(fun\explicit_table_function.shape);
         REPEAT j := 1 TO ndim;
            slo := base;
            shi := base + shape[j] - 1;
            IF fun\regular_table_function.increments[j] >= 0 THEN
               INSERT( sublo, slo, j - 1 );
               INSERT( subhi, shi, j - 1 );
            ELSE
               INSERT( sublo, shi, j - 1 );
               INSERT( subhi, slo, j - 1 );
            END_IF;
         END_REPEAT;
         index := regular_indexing(sublo, base, shape, fun\regular_table_function.increments, fun.first);
         IF NOT ((source_interval.min <= index) AND (index <= source_interval.max)) THEN
            RETURN (FALSE);
         END_IF;
         index := regular_indexing(subhi, base, shape, fun\regular_table_function.increments, fun.first);
         IF NOT ((source_interval.min <= index) AND (index <= source_interval.max)) THEN
            RETURN (FALSE);
         END_IF;
         RETURN (TRUE);
      END_IF;
      RETURN (FALSE);
END_FUNCTION;

Referenced By

Defintion extremal_position_check is references by the following definitions:
DefinitionType
 regular_table_function ENTITY
 standard_table_function ENTITY


[Top Level Definitions] [Exit]

Generated by STEP Tools® EXPRESS to HTML Converter
2024-09-06T14:00:33-04:00