Create a requirement object, and specify the monotonicity for a 2-dimensional variable.
The object requires the elements in the first dimension of the variable to be monotonically increasing and the elements in the second dimension to be monotonically decreasing.
Specify 2-dimensional test data for the variable.
Evaluate if the test data satisfies the requirement.
Evaluation
is column vector with size corresponding to the dimensions of the test data.
To understand the magnitude of Evaluation
, consider the elements of the test data along each dimension. For the first dimension of the test data, going down the rows, the software checks the '<' requirement. Since 10<20<30 and 5<24<33 both satisfy the requirement, Evaluation(1)
is a negative number. Because 24<33 comes closest to violating the requirement, the magnitude of Evaluation
for this dimension is 9, the difference between these two elements.
For the second dimension of the test data, going across the columns, the software checks, the '>' requirement. While 10>5 satisfies the requirement, 20<24 and 30<33 do not satisfy the requirement. This results in Evaluation(2)
being a positive number, indicating that the requirement is not satisfied. Because the elements 20 and 24 violate the requirement the most, the magnitude of Evaluation(2)
is 4, the difference between these elements.