@@ -23,8 +23,8 @@ namespace test {
2323 * \f[
2424 * x_M = [x_i, n - M + 1 <= i <= n]
2525 * g(x) = \Sigma{i = n - M + 1}^n (x_i - 0.5)^2
26- *
27- * f_1(x) = 0.5 * cos(x_1 * pi * 0.5) * cos(x_2 * pi * 0.5) * ... cos(x_2 * pi * 0.5) * (1 + g(x_M))
26+ *
27+ * f_1(x) = 0.5 * cos(x_1 * pi * 0.5) * cos(x_2 * pi * 0.5) * ... cos(x_2 * pi * 0.5) * (1 + g(x_M))
2828 * f_2(x) = 0.5 * cos(x_1 * pi * 0.5) * cos(x_2 * pi * 0.5) * ... sin(x_M-1 * pi * 0.5) * (1 + g(x_M))
2929 * .
3030 * .
@@ -35,9 +35,9 @@ namespace test {
3535 * 0 <= x_i <= 1 for i = 1,...,n.
3636 *
3737 * This should be optimized to x_i = 0.5 (for all x_i in x_M), at:
38- *
38+ *
3939 * For more information, please refer to:
40- *
40+ *
4141 * @code
4242 * @incollection{deb2005scalable,
4343 * title={Scalable test problems for evolutionary multiobjective optimization},
@@ -62,7 +62,7 @@ namespace test {
6262 size_t numParetoPoints;
6363
6464 public:
65-
65+
6666 /* *
6767 * Object Constructor.
6868 * Initializes the individual objective functions.
@@ -82,10 +82,10 @@ namespace test {
8282 // Convenience typedef.
8383 typedef typename MatType::elem_type ElemType;
8484 return arma::Col<ElemType>(numVariables, 1 , arma::fill::zeros);
85- }
86-
85+ }
86+
8787 // Get the private variables.
88-
88+
8989 // Get the number of objectives.
9090 size_t GetNumObjectives ()
9191 { return this -> numObjectives; }
@@ -113,16 +113,16 @@ namespace test {
113113
114114 // Convenience typedef.
115115 typedef typename MatType::elem_type ElemType;
116-
116+
117117 arma::Row<ElemType> innerSum (size (coords)[1 ], arma::fill::zeros);
118-
118+
119119 for (size_t i = numObjectives - 1 ; i < numVariables; i++)
120120 {
121- innerSum += arma::pow ((coords.row (i) - 0.5 ), 2 );
122- }
123-
121+ innerSum += arma::pow ((coords.row (i) - 0.5 ), 2 );
122+ }
123+
124124 return innerSum;
125- }
125+ }
126126
127127 /* *
128128 * Evaluate the objectives with the given coordinate.
@@ -140,21 +140,21 @@ namespace test {
140140 arma::Row<ElemType> value = 0.5 * (1.0 + G);
141141 for (size_t i = 0 ; i < numObjectives - 1 ; i++)
142142 {
143- objectives.row (i) = value %
143+ objectives.row (i) = value %
144144 arma::sin (coords.row (i) * arma::datum::pi * 0.5 );
145- value = value % arma::cos (coords.row (i) * arma::datum::pi * 0.5 );
145+ value = value % arma::cos (coords.row (i) * arma::datum::pi * 0.5 );
146146 }
147147 objectives.row (numObjectives - 1 ) = value;
148- return objectives;
148+ return objectives;
149149 }
150-
150+
151151 // Individual Objective function.
152- // Changes based on stop variable provided.
152+ // Changes based on stop variable provided.
153153 struct DTLZ2Objective
154154 {
155155 DTLZ2Objective (size_t stop, DTLZ2& dtlz): stop(stop), dtlz(dtlz)
156- {/* Nothing to do here. */ }
157-
156+ {/* Nothing to do here. */ }
157+
158158 /* *
159159 * Evaluate one objective with the given coordinate.
160160 *
@@ -181,8 +181,8 @@ namespace test {
181181 }
182182
183183 value = value * (1.0 + dtlz.g (coords)[0 ]);
184- return value;
185- }
184+ return value;
185+ }
186186
187187 DTLZ2& dtlz;
188188 size_t stop;
@@ -192,12 +192,12 @@ namespace test {
192192 std::tuple<DTLZ2Objective, DTLZ2Objective, DTLZ2Objective> GetObjectives ()
193193 {
194194 return std::make_tuple (objectiveF1, objectiveF2, objectiveF3);
195- }
195+ }
196196
197197 // ! Get the Reference Front.
198198 // ! Front. The implementation has been taken from pymoo.
199199 arma::mat GetReferenceFront ()
200- {
200+ {
201201 Uniform refGenerator;
202202 arma::mat refDirs = refGenerator.Generate <arma::mat>(3 , this -> numParetoPoints, 0 );
203203 arma::colvec x = arma::normalise (refDirs, 2 , 1 );
@@ -213,4 +213,4 @@ namespace test {
213213 } // namespace test
214214 } // namespace ens
215215
216- #endif
216+ #endif
0 commit comments