Comparator API for Recursive Data Structure Equivalence Testing

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Comparing disparate data in complex data structures is challenging due to the need for different comparison methods for various data types, which complicates determining equivalence between simulation and executable results in technical computing environments.

Innovation Solution

A comparator API is provided that recursively compares all elements of a data structure using appropriate comparison logic for each element type, supporting data structures like cell arrays, structure arrays, numeric, logical, string, and object data, enabling equivalence testing between simulation and executable results.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Measurement precision

If different comparison methods are used for various data types, then measurement precision is improved, but device complexity increases

Engineering Contradiction:
Improvecomparison accuracyVSAvoidcomparator complexity
Core Design Contradiction:
Measurement precisionVSDevice complexity

Solution Approach 1:

The patent implements a universal comparator API that can handle multiple data types (numeric, logical, string, cell arrays, structure arrays) through a single unified interface. The comparator uses recursive comparison logic that automatically adapts to different data types, eliminating the need for separate comparison methods for each type while maintaining high precision for all data formats.

Inventive Principle:
Principle #6Universality (Multi-functionality)

Solution Approach 2:

The patent changes the parameter of comparison logic from type-specific fixed methods to a dynamic recursive approach that automatically selects appropriate comparison strategies based on the actual data type encountered. This allows the same comparator structure to handle diverse data types with appropriate precision without increasing complexity.

Inventive Principle:
Principle #35Parameter changes

2Measurement precision

If recursive comparison of all elements is performed, then measurement precision is improved, but loss of time increases

Engineering Contradiction:
Improveequivalence determination accuracyVSAvoidcomparison time
Core Design Contradiction:
Measurement precisionVSLoss of time

Solution Approach 1:

The patent segments the comparison process into hierarchical levels, comparing data structures element-by-element through recursion. By dividing complex data structures into smaller comparable units and processing them systematically, the patent achieves thorough equivalence determination while maintaining efficient execution through the segmented approach.

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

The patent implements early termination logic that stops the recursive comparison process as soon as a difference is detected, rather than examining all elements. This partial action approach maintains measurement precision by ensuring complete comparison when needed while significantly reducing time loss when data structures differ at early levels.

Inventive Principle:
Principle #16Partial or excessive action

3Device complexity

If a single comparator API is used for all data types, then device complexity is reduced, but adaptability decreases

Engineering Contradiction:
Improvecomparator structure simplicityVSAvoiddata type support
Core Design Contradiction:
Device complexityVSAdaptability or versatility

Solution Approach 1:

The patent designs the comparator API with universal functionality to handle numeric, logical, string, cell arrays, and structure arrays through a unified interface. The recursive comparison logic automatically adapts to different data types, providing high versatility while maintaining simple device structure from the user perspective.

Inventive Principle:
Principle #6Universality (Multi-functionality)

Solution Approach 2:

The patent implements dynamic adaptation within the single comparator API, where the comparison logic automatically adjusts its behavior based on the data type being compared. This dynamic capability allows the same simple interface to handle diverse data types effectively, maintaining both low complexity and high adaptability.

Inventive Principle:
Principle #15Dynamics

Data Source

PatentUS9223595B2Mechanism for comparison of disparate data in data structures
Publication Date: 2015.12.29 MATHWORKS INC
  • US9223595B2 patent drawing
  • US9223595B2 patent drawing
  • US9223595B2 patent drawing

AI summary

A device receives a first result that includes first data, and a second result that includes second data, and determines whether a comparator supports the first data and the second data. When the comparator supports the first data and the second data, the device utilizes the comparator to select comparison logic for the first data of the first result and for the second data of the second result, compares the first result and the second result, using the selected comparison logic, to determine whether the first result is equivalent to the second result, and outputs or stores the determination of whether the first result is equivalent to the second result.