FOR Statements

FOR-statement loops are automatically shown in the diagram when there are annotated actions inside. (The zoom level for the loop will correspond to the greater zoom level of all actions).
We may add a user-defined condition description for the loop before the FOR-statement. We may also quote the calls to functions/methods in the loop-condition so that they appear in the diagram.

annotation

      //$ [loop condition user-description] 
      for(Loop = 0; Loop < Parameter; Loop++) {   //$ 
      //$ action 1
      code
      }
      

OPTIONAL:
//$: forces displaying in the diagram the calls to functions/methods inside the conditionStatement
//$ [condition user-description]: specifies a user-description of the condition; the square brackets [ ] are required syntax

representation in the diagram

figure

calls to functions/methods in the conditionStatements
[not implemented]
When the loop-condition involves calls to a method/function, these calls will be shown as actionable hyperlinks, provided that there exists the relevant diagram(s):
  • conditionStatement read directly from the code: always shown. Example:
    figure
  • user-defined condition: shown only if the //$ option is present. Example:
    figure

examples

void VINCIA::shower(){
//$ do VINCIA parton shower
std::cout << "the parton shower code would go here";

int numberofevents=10000;
for (int i = 1; i < numberofevents; ++i) {    

  //$1 1) prepare system of partons

  //$1 2) do phase 1 of shower

  //$1 3)...

}

return;
};


    
    ( zoom level 1 )
    figure