Skip to content

Commit

Permalink
Format code.
Browse files Browse the repository at this point in the history
  • Loading branch information
zfengyan committed May 23, 2022
1 parent 155bee0 commit c1e4b55
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions Triangulation/triangulation_method.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1029,19 +1029,18 @@ bool Triangulation::triangulation(
* 1st argument is the number of functions, 2nd the number of variables
*/
GEO1016_A2::Data data(M, points_0);

int num_func = 2 * static_cast<int>(points_0.size());
int num_var = 3 * static_cast<int>(points_3d.size());

GEO1016_A2::MyObjective obj(num_func, num_var, &data);
GEO1016_A2::MyObjective obj(num_func, num_var, &data); // pass deifined data

/* create an instance of the Levenberg - Marquardt(LM for short) optimizer */
Optimizer_LM lm;

/* initialized the variables.Later x will be modified after optimization. */
//double* x = new double[num_var];
std::vector<double> x(num_var, 0);
//GEO1016_A2::setOptimizeVariables(x, num_var, points_3d);

GEO1016_A2::setOptimizeVariables(x, num_var, points_3d); // add values to x

/* optimize(i.e., minimizing the objective function).*/
bool status = lm.optimize(&obj, x);
Expand All @@ -1051,7 +1050,7 @@ bool Triangulation::triangulation(
//std::cout << "the solution is: " << x[0] << ", " << x[1] << std::endl;
//std::cout << "the expected result: 0, 0" << std::endl;

//return status;
return status;

//delete[] x;

Expand Down

0 comments on commit c1e4b55

Please sign in to comment.