FUNCTION regular_indexing

(* SCHEMA step_merged_ap_schema; *)
-- IN AP238 STEP-NC/AP242
FUNCTION regular_indexing
      (sub : LIST OF INTEGER;
       base : zero_or_one;
       shape : LIST [1:?] OF positive_integer;
       inc : LIST [1:?] OF INTEGER;
       first : INTEGER ) : INTEGER;
   LOCAL
      k : INTEGER;
      index : INTEGER;
   END_LOCAL;
      IF (((NOT EXISTS(sub) OR NOT EXISTS(base)) OR NOT EXISTS(shape)) OR NOT EXISTS(inc)) OR NOT EXISTS(first) THEN
         RETURN (?);
      END_IF;
      IF (SIZEOF(sub) <> SIZEOF(inc)) OR (SIZEOF(sub) <> SIZEOF(shape)) THEN
         RETURN (?);
      END_IF;
      index := first;
      REPEAT j := 1 TO SIZEOF(sub);
         IF NOT EXISTS(sub[j]) OR NOT EXISTS(inc[j]) THEN
            RETURN (?);
         END_IF;
         k := sub[j] - base;
         IF NOT ((0 <= k) AND (k < shape[j])) THEN
            RETURN (?);
         END_IF;
         index := index + k * inc[j];
      END_REPEAT;
      RETURN (index);
END_FUNCTION;

Referenced By

Defintion regular_indexing is references by the following definitions:
DefinitionType
 extremal_position_check FUNCTION


[Top Level Definitions] [Exit]

Generated by STEP Tools® EXPRESS to HTML Converter
2020-07-28T17:02:20-04:00