11#include < chrono>
2- #include < string>
32#include < iostream>
3+ #include < string>
44
55#include " core/c3_miqp.h"
66
@@ -130,7 +130,6 @@ int DoMain(int argc, char* argv[]) {
130130 opt.AddLinearConstraint (LinIneq2, lowerbound, upperbound, stateconstraint);
131131 }
132132
133-
134133 // / initialize ADMM variables (delta, w)
135134 std::vector<VectorXd> delta (N, VectorXd::Zero (n + m + k));
136135 std::vector<VectorXd> w (N, VectorXd::Zero (n + m + k));
@@ -163,7 +162,6 @@ int DoMain(int argc, char* argv[]) {
163162 w = w_reset;
164163 }
165164
166-
167165 if (example == 2 ) {
168166 init_pivoting (x[i], &nd, &md, &kd, &Nd, &Ad, &Bd, &Dd, &dd, &Ed, &Fd, &Hd,
169167 &cd, &Qd, &Rd, &Gd, &Ud, &x0, &xdesired, &options);
@@ -172,14 +170,12 @@ int DoMain(int argc, char* argv[]) {
172170 C3MIQP opt (system, cost, xdesired, options);
173171 }
174172
175-
176173 auto start = std::chrono::high_resolution_clock::now ();
177174 // / calculate the input given x[i]
178175 opt.Solve (x[i]);
179176 input[i] = opt.GetInputSolution ()[0 ];
180177
181-
182- auto finish = std::chrono::high_resolution_clock::now ();
178+ auto finish = std::chrono::high_resolution_clock::now ();
183179 std::chrono::duration<double > elapsed = finish - start;
184180 std::cout << " Solve time:" << elapsed.count () << std::endl;
185181 total_time = total_time + elapsed.count ();
@@ -188,17 +184,15 @@ int DoMain(int argc, char* argv[]) {
188184 x[i + 1 ] = system.Simulate (x[i], input[i]);
189185
190186 // / print the state
191- // std::cout << "state: " << x[i + 1] << std::endl;
187+ // std::cout << "state: " << x[i + 1] << std::endl;
192188 }
193189 std::cout << " Average time: " << total_time / (timesteps - 1 ) << std::endl;
194190 return 0 ;
195191}
196192
197193} // namespace c3
198194
199- int main (int argc, char * argv[]) {
200- return c3::DoMain (argc, argv);
201- }
195+ int main (int argc, char * argv[]) { return c3::DoMain (argc, argv); }
202196
203197// / initialize LCS parameters for cartpole
204198void init_cartpole (int * n_, int * m_, int * k_, int * N_, vector<MatrixXd>* A_,
0 commit comments