haorenhui
2023-10-25 a5530f694660a51af01c7d9fc6e7453c2286309d
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
Quintiq file version 2.0
#parent: #root
Method ConvertNegativeToZeroInMatrix (
  structured[Real] newvalues,
  output structured[Real] convertedvalues_o
) id:Method_ApplicationLibMacroPlanner_ConvertNegativeToZeroInMatrix
{
  #keys: '[112884.0.422676847]'
  Body:
  [*
    // Convert negative number to zero when editing matrix
    convertedvalues_o.Flush();
    
    traverse( newvalues, Elements, e )
    {
      value := e;
    
      if( value < 0 )
      {
        value := 0.0;
      }
      convertedvalues_o.Add( value );
    }
  *]
}