1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
  | Quintiq file version 2.0 
 |  #parent: #root 
 |  StaticMethod GetDiffIndex ( 
 |    RealVector vector1, 
 |    RealVector vector2, 
 |    RealVector slack 
 |  ) as Number 
 |  { 
 |    Description: 
 |    [* 
 |      Return the index of the cell in which the vector is different. 
 |      This returns -1 if there is no difference. 
 |    *] 
 |    TextBody: 
 |    [* 
 |      value := -1; 
 |       
 |      assert( vector1.Size() = vector2.Size() and slack.Size() = vector1.Size(), 'The size of the vectors is not identical' ); 
 |       
 |      for( i := 0; i < vector1.Size(); i++ ) 
 |      { 
 |        if( abs(  vector1.Get( i )- vector2.Get( i ) ) > slack.Get( i ) ) 
 |        { 
 |          value := i; 
 |          i := vector1.Size(); // terminate loop 
 |        } 
 |      } 
 |       
 |      return value; 
 |    *] 
 |    InterfaceProperties { Accessibility: 'Module' } 
 |  } 
 |  
  |