1 #ifndef MANGO_LEVENBERG_MARQUARDT_H
2 #define MANGO_LEVENBERG_MARQUARDT_H
8 #ifdef MANGO_EIGEN_AVAILABLE
15 #ifdef MANGO_EIGEN_AVAILABLE
24 MPI_Comm comm_group_leaders;
27 Eigen::Map<Eigen::VectorXd> state_vector;
28 Eigen::Map<Eigen::VectorXd> targets;
29 Eigen::Map<Eigen::VectorXd> sigmas;
31 Eigen::VectorXd state_vector_tentative;
32 Eigen::VectorXd residuals;
33 Eigen::VectorXd shifted_residuals;
34 Eigen::MatrixXd Jacobian;
35 Eigen::VectorXd residuals_extended;
36 Eigen::MatrixXd Jacobian_extended;
37 Eigen::VectorXd delta_x;
38 Eigen::MatrixXd lambda_scan_residuals;
39 Eigen::MatrixXd lambda_scan_state_vectors;
40 Eigen::VectorXd lambdas;
41 Eigen::VectorXd lambda_scan_objective_functions;
42 Eigen::VectorXd delta_x_direct;
43 Eigen::MatrixXd alpha;
44 Eigen::MatrixXd alpha_prime;
47 double central_lambda;
48 double lambda_reduction_on_success;
49 int max_line_search_iterations;
50 int max_outer_iterations;
51 int data, j, j_line_search, failed_int, j_lambda_grid;
52 double lambda, objective_function, tentative_objective_function, min_objective_function;
53 int min_objective_function_index;
56 bool keep_going_outer;
57 bool line_search_succeeded;
58 double lambda_increase_factor;
59 double* normalized_lambda_grid;
60 std::ofstream lambda_file;
62 bool check_least_squares_solution;
63 bool save_lambda_history;
65 void evaluate_on_lambda_grid();
66 void process_lambda_grid_results();
69 static double compute_lambda_increase_factor(
const int);
70 static void compute_lambda_grid(
const int,
const double,
double*);