
Step-by-step numerical example of CSA 103
63 }
64 f l o a t minimum=EvalMemory [ 0 ] ; i n t minimumIndex =0;
65 fo r ( in t i =1; i <N; i ++) {
66 i f ( EvalMemory [ i ]<minimum ) {
67 minimum=EvalMemory [ i ] ;
68 minimumIndex=i ;
69 }
70 }
71 cout<<"FINAL RESULT: [ "<<Memory [ minimumIndex ] [ 0 ] ;
72 fo r ( in t j =1; j<d ; j ++) {
73 cout<<" , "<<Memory [ minimumIndex ] [ j ] ;
74 }
75 cout<<" ] "<<en d l ;
76 cout<<"OF="<<EvalMemory [ minimumIndex]<<en d l ;
77 g e tc h a r ( ) ;
78 return 0 ;
79 }
Listing 8.3
Source-code of CSA in C++.
8.5 Step-by-step numerical example of CSA
First step
The objective of the algorithm is to minimize the value of the function ...