当前位置: 首页>>代码示例>>C++>>正文


C++ OptionsList::GetIntegerValue方法代码示例

本文整理汇总了C++中OptionsList::GetIntegerValue方法的典型用法代码示例。如果您正苦于以下问题:C++ OptionsList::GetIntegerValue方法的具体用法?C++ OptionsList::GetIntegerValue怎么用?C++ OptionsList::GetIntegerValue使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在OptionsList的用法示例。


在下文中一共展示了OptionsList::GetIntegerValue方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: numbering

  bool Ma86SolverInterface::InitializeImpl(const OptionsList& options,
      const std::string& prefix)
  {
    ma86_default_control(&control_);
    control_.f_arrays = 1; // Use Fortran numbering (faster)
    /* Note: we can't set control_.action = false as we need to know the
     * intertia. (Otherwise we just enter the restoration phase and fail) */

    options.GetIntegerValue("ma86_print_level", control_.diagnostics_level,
                            prefix);
    options.GetIntegerValue("ma86_nemin", control_.nemin, prefix);
    options.GetNumericValue("ma86_small", control_.small_, prefix);
    options.GetNumericValue("ma86_static", control_.static_, prefix);
    options.GetNumericValue("ma86_u", control_.u, prefix);
    options.GetNumericValue("ma86_umax", umax_, prefix);
    std::string order_method, scaling_method;
    options.GetStringValue("ma86_order", order_method, prefix);
    if(order_method == "metis") {
      ordering_ = ORDER_METIS;
    } else if(order_method == "amd") {
      ordering_ = ORDER_AMD;
    } else {
      ordering_ = ORDER_AUTO;
    }
    options.GetStringValue("ma86_scaling", scaling_method, prefix);
    if(scaling_method == "mc64") {
      control_.scaling = 1;
    } else if(scaling_method == "mc77") {
      control_.scaling = 2;
    } else {
      control_.scaling = 0;
    }

    return true; // All is well
  }
开发者ID:MengbinZhu,项目名称:pfldp,代码行数:35,代码来源:IpMa86SolverInterface.cpp

示例2: InitializeImpl

bool RestoConvergenceCheck::InitializeImpl(const OptionsList& options,
        const std::string& prefix)
{
    options.GetNumericValue("required_infeasibility_reduction", kappa_resto_, prefix);
    options.GetIntegerValue("max_iter", maximum_iters_, prefix);
    options.GetIntegerValue("max_resto_iter", maximum_resto_iters_, prefix);

    // The original constraint violation tolerance
    options.GetNumericValue("constr_viol_tol", orig_constr_viol_tol_, "");

    first_resto_iter_ = true;
    successive_resto_iter_ = 0;

    return OptimalityErrorConvergenceCheck::InitializeImpl(options, prefix);
}
开发者ID:imzye,项目名称:coin,代码行数:15,代码来源:IpRestoConvCheck.cpp

示例3: InitializeImpl

  bool PDFullSpaceSolver::InitializeImpl(const OptionsList& options,
                                         const std::string& prefix)
  {
    // Check for the algorithm options
    options.GetIntegerValue("min_refinement_steps", min_refinement_steps_, prefix);
    options.GetIntegerValue("max_refinement_steps", max_refinement_steps_, prefix);
    ASSERT_EXCEPTION(max_refinement_steps_ >= min_refinement_steps_, OPTION_INVALID,
                     "Option \"max_refinement_steps\": This value must be larger than or equal to min_refinement_steps (default 1)");

    options.GetNumericValue("residual_ratio_max", residual_ratio_max_, prefix);
    options.GetNumericValue("residual_ratio_singular", residual_ratio_singular_, prefix);
    ASSERT_EXCEPTION(residual_ratio_singular_ >= residual_ratio_max_, OPTION_INVALID,
                     "Option \"residual_ratio_singular\": This value must be not smaller than residual_ratio_max.");
    options.GetNumericValue("residual_improvement_factor", residual_improvement_factor_, prefix);
    options.GetNumericValue("neg_curv_test_tol", neg_curv_test_tol_, prefix);
    options.GetBoolValue("neg_curv_test_reg", neg_curv_test_reg_, prefix);

    // Reset internal flags and data
    augsys_improved_ = false;

    if (!augSysSolver_->Initialize(Jnlst(), IpNLP(), IpData(), IpCq(),
                                   options, prefix)) {
      return false;
    }

    return perturbHandler_->Initialize(Jnlst(), IpNLP(), IpData(), IpCq(),
                                       options, prefix);
  }
开发者ID:RobotLocomotion,项目名称:ipopt-mirror,代码行数:28,代码来源:IpPDFullSpaceSolver.cpp

示例4:

  bool
  OptimalityErrorConvergenceCheck::InitializeImpl(const OptionsList& options,
      const std::string& prefix)
  {
    options.GetIntegerValue("max_iter", max_iterations_, prefix);
    options.GetNumericValue("dual_inf_tol", dual_inf_tol_, prefix);
    options.GetNumericValue("constr_viol_tol", constr_viol_tol_, prefix);
    options.GetNumericValue("compl_inf_tol", compl_inf_tol_, prefix);
    options.GetIntegerValue("acceptable_iter", acceptable_iter_, prefix);
    options.GetNumericValue("acceptable_tol", acceptable_tol_, prefix);
    options.GetNumericValue("acceptable_dual_inf_tol", acceptable_dual_inf_tol_, prefix);
    options.GetNumericValue("acceptable_constr_viol_tol", acceptable_constr_viol_tol_, prefix);
    options.GetNumericValue("acceptable_compl_inf_tol", acceptable_compl_inf_tol_, prefix);
    options.GetNumericValue("diverging_iterates_tol", diverging_iterates_tol_, prefix);
    acceptable_counter_ = 0;

    return true;
  }
开发者ID:Gjacquenot,项目名称:simbody,代码行数:18,代码来源:IpOptErrorConvCheck.cpp

示例5: InitializeImpl

  bool MumpsSolverInterface::InitializeImpl(const OptionsList& options,
      const std::string& prefix)
  {
    options.GetNumericValue("mumps_pivtol", pivtol_, prefix);
    if (options.GetNumericValue("mumps_pivtolmax", pivtolmax_, prefix)) {
      ASSERT_EXCEPTION(pivtolmax_>=pivtol_, OPTION_INVALID,
                       "Option \"mumps_pivtolmax\": This value must be between "
                       "mumps_pivtol and 1.");
    }
    else {
      pivtolmax_ = Max(pivtolmax_, pivtol_);
    }

    options.GetIntegerValue("mumps_mem_percent",
                            mem_percent_, prefix);

    // The following option is registered by OrigIpoptNLP
    options.GetBoolValue("warm_start_same_structure",
                         warm_start_same_structure_, prefix);

    options.GetIntegerValue("mumps_permuting_scaling",
                            mumps_permuting_scaling_, prefix);
    options.GetIntegerValue("mumps_pivot_order", mumps_pivot_order_, prefix);
    options.GetIntegerValue("mumps_scaling", mumps_scaling_, prefix);
    options.GetNumericValue("mumps_dep_tol", mumps_dep_tol_, prefix);

    // Reset all private data
    initialized_ = false;
    pivtol_changed_ = false;
    refactorize_ = false;
    have_symbolic_factorization_ = false;

    DMUMPS_STRUC_C* mumps_ = (DMUMPS_STRUC_C*)mumps_ptr_;
    if (!warm_start_same_structure_) {
      mumps_->n = 0;
      mumps_->nz = 0;
    }
    else {
      ASSERT_EXCEPTION(mumps_->n>0 && mumps_->nz>0, INVALID_WARMSTART,
                       "MumpsSolverInterface called with warm_start_same_structure, but the problem is solved for the first time.");
    }

    return true;
  }
开发者ID:aimanqais,项目名称:gerardus,代码行数:44,代码来源:IpMumpsSolverInterface.cpp

示例6: numbering

  bool Ma77SolverInterface::InitializeImpl(const OptionsList& options,
      const std::string& prefix)
  {
    ma77_default_control(&control_);
    control_.f_arrays = 1; // Use Fortran numbering (faster)
    control_.bits=32;
    // FIXME: HSL_MA77 should be updated to allow a matrix with new
    // values to be refactorized after a -11 (singular) error.
    //control_.action = 0; // false, should exit with error on singularity

    options.GetIntegerValue("ma77_print_level", control_.print_level, prefix);
    options.GetIntegerValue("ma77_buffer_lpage", control_.buffer_lpage[0], prefix);
    options.GetIntegerValue("ma77_buffer_lpage", control_.buffer_lpage[1], prefix);
    options.GetIntegerValue("ma77_buffer_npage", control_.buffer_npage[0], prefix);
    options.GetIntegerValue("ma77_buffer_npage", control_.buffer_npage[1], prefix);
    int temp;
    options.GetIntegerValue("ma77_file_size", temp, prefix);
    control_.file_size = temp;
    options.GetIntegerValue("ma77_maxstore", temp, prefix);
    control_.maxstore = temp;
    options.GetIntegerValue("ma77_nemin", control_.nemin, prefix);
    options.GetNumericValue("ma77_small", control_.small, prefix);
    options.GetNumericValue("ma77_static", control_.static_, prefix);
    options.GetNumericValue("ma77_u", control_.u, prefix);
    options.GetNumericValue("ma77_umax", umax_, prefix);
    std::string order_method;
    options.GetStringValue("ma77_order", order_method, prefix);
    if (order_method == "metis") {
      ordering_ = ORDER_METIS;
    } else {
      ordering_ = ORDER_AMD;
    }
    return true; // All is well
  }
开发者ID:MengbinZhu,项目名称:pfldp,代码行数:34,代码来源:IpMa77SolverInterface.cpp

示例7: InitializeImpl

  bool CGPenaltyLSAcceptor::InitializeImpl(const OptionsList& options,
      const std::string& prefix)
  {
    options.GetBoolValue("never_use_piecewise_penalty_ls",
                         never_use_piecewise_penalty_ls_, prefix);
    options.GetNumericValue("eta_penalty", eta_penalty_, prefix);
    options.GetNumericValue("penalty_update_infeasibility_tol",
                            penalty_update_infeasibility_tol_, prefix);
    options.GetNumericValue("eta_min", eta_min_, prefix);
    options.GetNumericValue("penalty_update_compl_tol",
                            penalty_update_compl_tol_, prefix);
    options.GetNumericValue("chi_hat", chi_hat_, prefix);
    options.GetNumericValue("chi_tilde", chi_tilde_, prefix);
    options.GetNumericValue("chi_cup", chi_cup_, prefix);
    options.GetNumericValue("gamma_hat", gamma_hat_, prefix);
    options.GetNumericValue("gamma_tilde", gamma_tilde_, prefix);
    options.GetNumericValue("epsilon_c", epsilon_c_, prefix);
    options.GetNumericValue("piecewisepenalty_gamma_obj",
                            piecewisepenalty_gamma_obj_, prefix);
    options.GetNumericValue("piecewisepenalty_gamma_infeasi",
                            piecewisepenalty_gamma_infeasi_, prefix);
    options.GetNumericValue("pen_theta_max_fact", pen_theta_max_fact_, prefix);
    options.GetNumericValue("min_alpha_primal", min_alpha_primal_, prefix);
    options.GetNumericValue("theta_min", theta_min_, prefix);
    options.GetNumericValue("mult_diverg_feasibility_tol", mult_diverg_feasibility_tol_, prefix);
    options.GetNumericValue("mult_diverg_y_tol", mult_diverg_y_tol_, prefix);
    // The following option has been registered by FilterLSAcceptor
    options.GetIntegerValue("max_soc", max_soc_, prefix);
    // The following option has been registered by CGSearhDirCalc
    options.GetNumericValue("penalty_max", penalty_max_, prefix);

    if (max_soc_>0) {
      ASSERT_EXCEPTION(IsValid(pd_solver_), OPTION_INVALID,
                       "Option \"max_soc\": This option is non-negative, but no linear solver for computing the SOC given to FilterLSAcceptor object.");
    }
    options.GetNumericValue("kappa_soc", kappa_soc_, prefix);

    pen_theta_max_ = -1.;
    pen_curr_mu_ = IpData().curr_mu();
    counter_first_type_penalty_updates_ = 0;
    counter_second_type_penalty_updates_ = 0;
    curr_eta_ = -1.;
    CGPenData().SetPenaltyUninitialized();
    ls_counter_ = 0;
    best_KKT_error_ = -1.;
    accepted_by_Armijo_ = true;
    //never_do_restor_ = true;
    jump_for_tiny_step_ = 0;

    return true;
  }
开发者ID:BRAINSia,项目名称:calatk,代码行数:51,代码来源:IpCGPenaltyLSAcceptor.cpp

示例8:

  bool
  OptimalityErrorConvergenceCheck::InitializeImpl(const OptionsList& options,
      const std::string& prefix)
  {
    options.GetIntegerValue("max_iter", max_iterations_, prefix);
    options.GetNumericValue("max_cpu_time", max_cpu_time_, prefix);
    options.GetNumericValue("dual_inf_tol", dual_inf_tol_, prefix);
    options.GetNumericValue("constr_viol_tol", constr_viol_tol_, prefix);
    options.GetNumericValue("compl_inf_tol", compl_inf_tol_, prefix);
    options.GetIntegerValue("acceptable_iter", acceptable_iter_, prefix);
    options.GetNumericValue("acceptable_tol", acceptable_tol_, prefix);
    options.GetNumericValue("acceptable_dual_inf_tol", acceptable_dual_inf_tol_, prefix);
    options.GetNumericValue("acceptable_constr_viol_tol", acceptable_constr_viol_tol_, prefix);
    options.GetNumericValue("acceptable_compl_inf_tol", acceptable_compl_inf_tol_, prefix);
    options.GetNumericValue("acceptable_obj_change_tol", acceptable_obj_change_tol_, prefix);
    options.GetNumericValue("diverging_iterates_tol", diverging_iterates_tol_, prefix);
    options.GetNumericValue("mu_target", mu_target_, prefix);
    acceptable_counter_ = 0;
    curr_obj_val_ = -1e50;
    last_obj_val_iter_ = -1;

    return true;
  }
开发者ID:BRAINSia,项目名称:calatk,代码行数:23,代码来源:IpOptErrorConvCheck.cpp

示例9: InitializeImpl

  bool RestoIterationOutput::InitializeImpl(const OptionsList& options,
      const std::string& prefix)
  {
    options.GetBoolValue("print_info_string", print_info_string_, prefix);
    Index enum_int;
    options.GetEnumValue("inf_pr_output", enum_int, prefix);
    inf_pr_output_ = InfPrOutput(enum_int);
    options.GetIntegerValue("print_frequency_iter", print_frequency_iter_, prefix);
    options.GetNumericValue("print_frequency_time", print_frequency_time_, prefix);

    bool retval = true;
    if (IsValid(resto_orig_iteration_output_)) {
      retval = resto_orig_iteration_output_->Initialize(Jnlst(), IpNLP(),
               IpData(), IpCq(),
               options, prefix);
    }
    return retval;
  }
开发者ID:ChinaQuants,项目名称:Ipopt,代码行数:18,代码来源:IpRestoIterationOutput.cpp

示例10: InitializeImpl

  bool AdaptiveMuUpdate::InitializeImpl(const OptionsList& options,
                                        const std::string& prefix)
  {
    options.GetNumericValue("mu_max_fact", mu_max_fact_, prefix);
    if (!options.GetNumericValue("mu_max", mu_max_, prefix)) {
      // Set to a negative value as a hint that this value still has
      // to be computed
      mu_max_ = -1.;
    }
    options.GetNumericValue("tau_min", tau_min_, prefix);
    options.GetNumericValue("adaptive_mu_safeguard_factor", adaptive_mu_safeguard_factor_, prefix);
    options.GetNumericValue("adaptive_mu_kkterror_red_fact", refs_red_fact_, prefix);
    options.GetIntegerValue("adaptive_mu_kkterror_red_iters", num_refs_max_, prefix);
    Index enum_int;
    options.GetEnumValue("adaptive_mu_globalization", enum_int, prefix);
    adaptive_mu_globalization_ = AdaptiveMuGlobalizationEnum(enum_int);
    options.GetNumericValue("filter_max_margin", filter_max_margin_, prefix);
    options.GetNumericValue("filter_margin_fact", filter_margin_fact_, prefix);
    options.GetBoolValue("adaptive_mu_restore_previous_iterate", restore_accepted_iterate_, prefix);

    bool retvalue = free_mu_oracle_->Initialize(Jnlst(), IpNLP(), IpData(),
                    IpCq(), options, prefix);
    if (!retvalue) {
      return retvalue;
    }

    if (IsValid(fix_mu_oracle_)) {
      retvalue = fix_mu_oracle_->Initialize(Jnlst(), IpNLP(), IpData(),
                                            IpCq(), options, prefix);
      if (!retvalue) {
        return retvalue;
      }
    }

    options.GetNumericValue("adaptive_mu_monotone_init_factor", adaptive_mu_monotone_init_factor_, prefix);
    options.GetNumericValue("barrier_tol_factor", barrier_tol_factor_, prefix);
    options.GetNumericValue("mu_linear_decrease_factor", mu_linear_decrease_factor_, prefix);
    options.GetNumericValue("mu_superlinear_decrease_power", mu_superlinear_decrease_power_, prefix);

    options.GetEnumValue("quality_function_norm_type", enum_int, prefix);
    adaptive_mu_kkt_norm_ = QualityFunctionMuOracle::NormEnum(enum_int);
    options.GetEnumValue("quality_function_centrality", enum_int, prefix);
    adaptive_mu_kkt_centrality_ = QualityFunctionMuOracle::CentralityEnum(enum_int);
    options.GetEnumValue("quality_function_balancing_term", enum_int, prefix);
    adaptive_mu_kkt_balancing_term_ = QualityFunctionMuOracle::BalancingTermEnum(enum_int);
    options.GetNumericValue("compl_inf_tol", compl_inf_tol_, prefix);
    if (prefix == "resto.") {
      if (!options.GetNumericValue("mu_min", mu_min_, prefix)) {
        // For restoration phase, we choose a more conservative mu_min
        mu_min_ = 1e2*mu_min_;
        // Compute mu_min based on tolerance (once the NLP scaling is known)
        mu_min_default_ = true;
      }
      else {
        mu_min_default_ = false;
      }
    }
    else {
      if (!options.GetNumericValue("mu_min", mu_min_, prefix)) {
        // Compute mu_min based on tolerance (once the NLP scaling is known)
        mu_min_default_ = true;
      }
      else {
        mu_min_default_ = false;
      }
    }
    options.GetNumericValue("mu_target", mu_target_, prefix);

    init_dual_inf_ = -1.;
    init_primal_inf_ = -1.;

    refs_vals_.clear();
    check_if_no_bounds_ = false;
    no_bounds_ = false;
    filter_.Clear();
    IpData().SetFreeMuMode(true);

    accepted_point_ = NULL;

    // The following lines are only here so that
    // IpoptCalculatedQuantities::CalculateSafeSlack and the first
    // output line have something to work with
    IpData().Set_mu(1.);
    IpData().Set_tau(0.);

    return retvalue;
  }
开发者ID:BRAINSia,项目名称:calatk,代码行数:87,代码来源:IpAdaptiveMuUpdate.cpp

示例11: InitializeImpl

  bool IterativeWsmpSolverInterface::InitializeImpl(const OptionsList& options,
      const std::string& prefix)
  {
    options.GetIntegerValue("wsmp_num_threads", wsmp_num_threads_, prefix);
    Index wsmp_ordering_option;
    if (!options.GetIntegerValue("wsmp_ordering_option", wsmp_ordering_option,
                                 prefix)) {
      wsmp_ordering_option = 1;
    }
    Index wsmp_ordering_option2;
    if (!options.GetIntegerValue("wsmp_ordering_option2", wsmp_ordering_option2,
                                 prefix)) {
      wsmp_ordering_option2 = 0;
    }
    if (!options.GetNumericValue("wsmp_pivtol", wsmp_pivtol_, prefix)) {
      wsmp_pivtol_ = 1e-3;
    }
    if (options.GetNumericValue("wsmp_pivtolmax", wsmp_pivtolmax_, prefix)) {
      ASSERT_EXCEPTION(wsmp_pivtolmax_>=wsmp_pivtol_, OPTION_INVALID,
                       "Option \"wsmp_pivtolmax\": This value must be between "
                       "wsmp_pivtol and 1.");
    }
    else {
      wsmp_pivtolmax_ = Max(wsmp_pivtolmax_, wsmp_pivtol_);
    }
    if (!options.GetIntegerValue("wsmp_scaling", wsmp_scaling_, prefix)) {
      wsmp_scaling_ = 1;
    }
    options.GetIntegerValue("wsmp_write_matrix_iteration",
                            wsmp_write_matrix_iteration_, prefix);
    Index wsmp_max_iter;
    options.GetIntegerValue("wsmp_max_iter", wsmp_max_iter, prefix);
    options.GetNumericValue("wsmp_inexact_droptol", wsmp_inexact_droptol_,
                            prefix);
    options.GetNumericValue("wsmp_inexact_fillin_limit", wsmp_inexact_fillin_limit_,
                            prefix);

    // Reset all private data
    dim_=0;
    initialized_=false;
    pivtol_changed_ = false;
    have_symbolic_factorization_ = false;
    delete[] a_;
    a_ = NULL;

#if 1
    // Set the number of threads
    ipfint NTHREADS = wsmp_num_threads_;
    F77_FUNC(wsetmaxthrds,WSETMAXTHRDS)(&NTHREADS);
    Jnlst().Printf(J_DETAILED, J_LINEAR_ALGEBRA,
                   "WSMP will use %d threads.\n", wsmp_num_threads_);
#else
    Jnlst().Printf(J_WARNING, J_LINEAR_ALGEBRA,
                   "Not setting WISMP threads at the moment.\n");
#endif

    // Get WSMP's default parameters and set the ones we want differently
    IPARM_[0] = 0;
    IPARM_[1] = 0;
    IPARM_[2] = 0;
    ipfint idmy;
    double ddmy;
    F77_FUNC(wismp,WISMP)(&idmy, &idmy, &idmy, &ddmy, &ddmy, &idmy,
                          &ddmy, &idmy, &idmy, &ddmy, &ddmy,
                          IPARM_, DPARM_);
    IPARM_[3] = 3; // Upper trianguar portion of matrix in CSR format
    // (same as for WSSMP)
    IPARM_[6] = 3;
    IPARM_[13] = 0; // do not overwrite avals
    IPARM_[27] = 0; // to make runs repeatable

#if 1
    IPARM_[5] = wsmp_max_iter; // maximal number of iterations
    IPARM_[15] = wsmp_ordering_option; // ordering option
    IPARM_[16] = wsmp_ordering_option2; // for ordering in IP methods?
#endif
    DPARM_[13] = wsmp_inexact_droptol_;
    DPARM_[14] = wsmp_inexact_fillin_limit_;

// DELETE
    IPARM_[33] = 0;

    matrix_file_number_ = 0;

    // Check for SPINLOOPTIME and YIELDLOOPTIME?

    return true;
  }
开发者ID:BRAINSia,项目名称:calatk,代码行数:88,代码来源:IpIterativeWsmpSolverInterface.cpp

示例12: InitializeImpl

  bool WsmpSolverInterface::InitializeImpl(const OptionsList& options,
      const std::string& prefix)
  {
    options.GetIntegerValue("wsmp_num_threads", wsmp_num_threads_, prefix);
    Index wsmp_ordering_option;
    options.GetIntegerValue("wsmp_ordering_option", wsmp_ordering_option,
                            prefix);
    Index wsmp_ordering_option2;
    options.GetIntegerValue("wsmp_ordering_option2", wsmp_ordering_option2,
                            prefix);
    options.GetNumericValue("wsmp_pivtol", wsmp_pivtol_, prefix);
    if (options.GetNumericValue("wsmp_pivtolmax", wsmp_pivtolmax_, prefix)) {
      ASSERT_EXCEPTION(wsmp_pivtolmax_>=wsmp_pivtol_, OPTION_INVALID,
                       "Option \"wsmp_pivtolmax\": This value must be between "
                       "wsmp_pivtol and 1.");
    }
    else {
      wsmp_pivtolmax_ = Max(wsmp_pivtolmax_, wsmp_pivtol_);
    }
    options.GetNumericValue("wsmp_singularity_threshold",
                            wsmp_singularity_threshold_, prefix);
    options.GetIntegerValue("wsmp_scaling", wsmp_scaling_, prefix);
    options.GetIntegerValue("wsmp_write_matrix_iteration",
                            wsmp_write_matrix_iteration_, prefix);
    options.GetBoolValue("wsmp_skip_inertia_check",
                         skip_inertia_check_, prefix);
    options.GetBoolValue("wsmp_no_pivoting",
                         wsmp_no_pivoting_, prefix);

    // Reset all private data
    dim_=0;
    initialized_=false;
    printed_num_threads_ = false;
    pivtol_changed_ = false;
    have_symbolic_factorization_ = false;
    factorizations_since_recomputed_ordering_ = -1;
    delete[] a_;
    a_ = NULL;
    delete[] PERM_;
    PERM_ = NULL;
    delete[] INVP_;
    INVP_ = NULL;
    delete[] MRP_;
    MRP_ = NULL;

#ifdef PARDISO_MATCHING_PREPROCESS
    delete[] ia2;
    ia2 = NULL;

    delete[] ja2;
    ja2 = NULL;

    delete[] a2_;
    a2_ = NULL;

    delete[] perm2;
    perm2 = NULL;

    delete[] scale2;
    scale2 = NULL;
#endif

    // Set the number of threads
    ipfint NTHREADS = wsmp_num_threads_;
    F77_FUNC(wsetmaxthrds,WSETMAXTHRDS)(&NTHREADS);
    Jnlst().Printf(J_DETAILED, J_LINEAR_ALGEBRA,
                   "WSMP will use %d threads.\n", wsmp_num_threads_);

    // Get WSMP's default parameters and set the ones we want differently
    IPARM_[0] = 0;
    IPARM_[1] = 0;
    IPARM_[2] = 0;
    ipfint idmy;
    double ddmy;
    F77_FUNC(wssmp,WSSMP)(&idmy, &idmy, &idmy, &ddmy, &ddmy, &idmy,
                          &idmy, &ddmy, &idmy, &idmy, &ddmy, &idmy,
                          &idmy, IPARM_, DPARM_);
    IPARM_[15] = wsmp_ordering_option; // ordering option
    IPARM_[17] = 0; // use local minimum fill-in ordering
    IPARM_[19] = wsmp_ordering_option2; // for ordering in IP methods?
    if (wsmp_no_pivoting_) {
      IPARM_[30] = 1; // want L D L^T factorization with diagonal no pivoting
      IPARM_[26] = 1;
    }
    else {
      IPARM_[30] = 2; // want L D L^T factorization with diagonal with pivoting
    }
    // pivoting (Bunch/Kaufman)
    //IPARM_[31] = 1; // need D to see where first negative eigenvalue occurs
    //                   if we change this, we need DIAG arguments below!

    IPARM_[10] = 2; // Mark bad pivots

    // Set WSMP's scaling option
    IPARM_[9] = wsmp_scaling_;

    DPARM_[9] = wsmp_singularity_threshold_;

    matrix_file_number_ = 0;

//.........这里部分代码省略.........
开发者ID:ChinaQuants,项目名称:Ipopt,代码行数:101,代码来源:IpWsmpSolverInterface.cpp

示例13: InitializeImpl

  bool PardisoSolverInterface::InitializeImpl(const OptionsList& options,
      const std::string& prefix)
  {
    Index enum_int;
    options.GetEnumValue("pardiso_matching_strategy", enum_int, prefix);
    match_strat_ = PardisoMatchingStrategy(enum_int);
    options.GetBoolValue("pardiso_redo_symbolic_fact_only_if_inertia_wrong",
                         pardiso_redo_symbolic_fact_only_if_inertia_wrong_,
                         prefix);
    options.GetBoolValue("pardiso_repeated_perturbation_means_singular",
                         pardiso_repeated_perturbation_means_singular_,
                         prefix);
    //Index pardiso_out_of_core_power;
    //options.GetIntegerValue("pardiso_out_of_core_power",
    //                        pardiso_out_of_core_power, prefix);
    options.GetBoolValue("pardiso_skip_inertia_check",
                         skip_inertia_check_, prefix);
    int pardiso_msglvl;
    options.GetIntegerValue("pardiso_msglvl", pardiso_msglvl, prefix);
    int max_iterref_steps;
    options.GetIntegerValue("pardiso_max_iterative_refinement_steps", max_iterref_steps, prefix);
    int order;
    options.GetEnumValue("pardiso_order", order, prefix);
#if !defined(HAVE_PARDISO_OLDINTERFACE) && !defined(HAVE_PARDISO_MKL)
    options.GetBoolValue("pardiso_iterative", pardiso_iterative_, prefix);
    int pardiso_max_iter;
    options.GetIntegerValue("pardiso_max_iter", pardiso_max_iter, prefix);
    Number pardiso_iter_relative_tol;
    options.GetNumericValue("pardiso_iter_relative_tol",
                            pardiso_iter_relative_tol, prefix);
    Index pardiso_iter_coarse_size;
    options.GetIntegerValue("pardiso_iter_coarse_size",
                            pardiso_iter_coarse_size, prefix);
    Index pardiso_iter_max_levels;
    options.GetIntegerValue("pardiso_iter_max_levels",
                            pardiso_iter_max_levels, prefix);
    Number pardiso_iter_dropping_factor;
    options.GetNumericValue("pardiso_iter_dropping_factor",
                            pardiso_iter_dropping_factor, prefix);
    Number pardiso_iter_dropping_schur;
    options.GetNumericValue("pardiso_iter_dropping_schur",
                            pardiso_iter_dropping_schur, prefix);
    Index pardiso_iter_max_row_fill;
    options.GetIntegerValue("pardiso_iter_max_row_fill",
                            pardiso_iter_max_row_fill, prefix);
    Number pardiso_iter_inverse_norm_factor;
    options.GetNumericValue("pardiso_iter_inverse_norm_factor",
                            pardiso_iter_inverse_norm_factor, prefix);
    options.GetIntegerValue("pardiso_max_droptol_corrections",
                            pardiso_max_droptol_corrections_, prefix);
#else
    pardiso_iterative_ = false;
#endif

    // Number value = 0.0;

    // Tell Pardiso to release all memory if it had been used before
    if (initialized_) {
      ipfint PHASE = -1;
      ipfint N = dim_;
      ipfint NRHS = 0;
      ipfint ERROR;
      ipfint idmy;
      double ddmy;
      PARDISO_FUNC(PT_, &MAXFCT_, &MNUM_, &MTYPE_, &PHASE, &N,
                   &ddmy, &idmy, &idmy, &idmy, &NRHS, IPARM_,
                   &MSGLVL_, &ddmy, &ddmy, &ERROR, DPARM_);
      DBG_ASSERT(ERROR==0);
    }

    // Reset all private data
    dim_=0;
    nonzeros_=0;
    have_symbolic_factorization_=false;
    initialized_=false;
    delete[] a_;
    a_ = NULL;

#ifdef PARDISO_MATCHING_PREPROCESS
    delete[] ia2;
    ia2 = NULL;

    delete[] ja2;
    ja2 = NULL;

    delete[] a2_;
    a2_ = NULL;

    delete[] perm2;
    perm2 = NULL;

    delete[] scale2;
    scale2 = NULL;
#endif

    // Call Pardiso's initialization routine
    IPARM_[0] = 0;  // Tell it to fill IPARM with default values(?)

#if ! defined(HAVE_PARDISO_OLDINTERFACE) && ! defined(HAVE_PARDISO_MKL)
    ipfint ERROR = 0;
//.........这里部分代码省略.........
开发者ID:OpenModelica,项目名称:OMCompiler-3rdParty,代码行数:101,代码来源:IpPardisoSolverInterface.cpp

示例14: InitializeImpl

  bool IterativePardisoSolverInterface::InitializeImpl(const OptionsList& options,
      const std::string& prefix)
  {
    Index enum_int;
    options.GetEnumValue("pardiso_matching_strategy", enum_int, prefix);
    match_strat_ = PardisoMatchingStrategy(enum_int);
    options.GetBoolValue("pardiso_redo_symbolic_fact_only_if_inertia_wrong",
                         pardiso_redo_symbolic_fact_only_if_inertia_wrong_,
                         prefix);
    options.GetBoolValue("pardiso_repeated_perturbation_means_singular",
                         pardiso_repeated_perturbation_means_singular_,
                         prefix);
    Index pardiso_out_of_core_power;
    options.GetIntegerValue("pardiso_out_of_core_power",
                            pardiso_out_of_core_power, prefix);
    options.GetBoolValue("pardiso_skip_inertia_check",
                         skip_inertia_check_, prefix);

    // PD system
    options.GetIntegerValue("pardiso_max_iter", pardiso_max_iter_, prefix);
    options.GetNumericValue("pardiso_iter_relative_tol",
                            pardiso_iter_relative_tol_, prefix);
    options.GetIntegerValue("pardiso_iter_coarse_size",
                            pardiso_iter_coarse_size_, prefix);
    options.GetIntegerValue("pardiso_iter_max_levels",
                            pardiso_iter_max_levels_, prefix);
    options.GetNumericValue("pardiso_iter_dropping_factor",
                            pardiso_iter_dropping_factor_, prefix);
    options.GetNumericValue("pardiso_iter_dropping_schur",
                            pardiso_iter_dropping_schur_, prefix);
    options.GetIntegerValue("pardiso_iter_max_row_fill",
                            pardiso_iter_max_row_fill_, prefix);
    options.GetNumericValue("pardiso_iter_inverse_norm_factor",
                            pardiso_iter_inverse_norm_factor_, prefix);
    // Normal system
    options.GetIntegerValue("pardiso_max_iter", normal_pardiso_max_iter_,
                            prefix+"normal.");
    options.GetNumericValue("pardiso_iter_relative_tol",
                            normal_pardiso_iter_relative_tol_,
                            prefix+"normal.");
    options.GetIntegerValue("pardiso_iter_coarse_size",
                            normal_pardiso_iter_coarse_size_,
                            prefix+"normal.");
    options.GetIntegerValue("pardiso_iter_max_levels",
                            normal_pardiso_iter_max_levels_,
                            prefix+"normal.");
    options.GetNumericValue("pardiso_iter_dropping_factor",
                            normal_pardiso_iter_dropping_factor_,
                            prefix+"normal.");
    options.GetNumericValue("pardiso_iter_dropping_schur",
                            normal_pardiso_iter_dropping_schur_,
                            prefix+"normal.");
    options.GetIntegerValue("pardiso_iter_max_row_fill",
                            normal_pardiso_iter_max_row_fill_,
                            prefix+"normal.");
    options.GetNumericValue("pardiso_iter_inverse_norm_factor",
                            normal_pardiso_iter_inverse_norm_factor_,
                            prefix+"normal.");

    int pardiso_msglvl;
    options.GetIntegerValue("pardiso_msglvl", pardiso_msglvl, prefix);
    options.GetIntegerValue("pardiso_max_droptol_corrections",
                            pardiso_max_droptol_corrections_, prefix);

    // Number value = 0.0;

    // Tell Pardiso to release all memory if it had been used before
    if (initialized_) {
      ipfint PHASE = -1;
      ipfint N = dim_;
      ipfint NRHS = 0;
      ipfint ERROR;
      ipfint idmy;
      double ddmy;
      F77_FUNC(pardiso,PARDISO)(PT_, &MAXFCT_, &MNUM_, &MTYPE_, &PHASE, &N,
                                &ddmy, &idmy, &idmy, &idmy, &NRHS, IPARM_,
                                &MSGLVL_, &ddmy, &ddmy, &ERROR, DPARM_) ;
      DBG_ASSERT(ERROR==0);
    }

    // Reset all private data
    dim_=0;
    nonzeros_=0;
    have_symbolic_factorization_=false;
    initialized_=false;
    delete[] a_;
    a_ = NULL;

#ifdef HAVE_PARDISO_OLDINTERFACE
    THROW_EXCEPTION(OPTION_INVALID, "The inexact version works only with a new version of Pardiso (at least 4.0)");
#endif

    // Call Pardiso's initialization routine
    IPARM_[0] = 0;  // Tell it to fill IPARM with default values(?)
    ipfint ERROR = 0;
    ipfint SOLVER = 1; // initialze only direct solver
    F77_FUNC(pardisoinit,PARDISOINIT)(PT_, &MTYPE_, &SOLVER,
                                      IPARM_, DPARM_, &ERROR);

    // Set some parameters for Pardiso
//.........这里部分代码省略.........
开发者ID:BRAINSia,项目名称:calatk,代码行数:101,代码来源:IpIterativePardisoSolverInterface.cpp

示例15: Max

bool Ma57TSolverInterface::InitializeImpl(const OptionsList&  options,
        const std::string&    prefix)
{
    // Obtain the options settings
    options.GetNumericValue("ma57_pivtol", pivtol_, prefix);
    if (options.GetNumericValue("ma57_pivtolmax", pivtolmax_, prefix)) {
        ASSERT_EXCEPTION(pivtolmax_>=pivtol_, OPTION_INVALID,
                         "Option \"pivtolmax\": This value must be between "
                         "pivtol and 1.");
    }
    else {
        pivtolmax_ = Max(pivtolmax_, pivtol_);
    }

    options.GetNumericValue("ma57_pre_alloc", ma57_pre_alloc_, prefix);
    Index ma57_pivot_order;
    options.GetIntegerValue("ma57_pivot_order", ma57_pivot_order, prefix);

    // The following option is registered by OrigIpoptNLP
    options.GetBoolValue("warm_start_same_structure",
                         warm_start_same_structure_, prefix);
    DBG_ASSERT(!warm_start_same_structure_ && "warm_start_same_structure not yet implemented");

    bool ma57_automatic_scaling;
    options.GetBoolValue("ma57_automatic_scaling", ma57_automatic_scaling, prefix);

    // CET 04-29-2010
    Index ma57_block_size;
    options.GetIntegerValue("ma57_block_size", ma57_block_size, prefix);

    Index ma57_node_amalgamation;
    options.GetIntegerValue("ma57_node_amalgamation", ma57_node_amalgamation, prefix);

    Index ma57_small_pivot_flag;
    options.GetIntegerValue("ma57_small_pivot_flag", ma57_small_pivot_flag, prefix);
    // CET 04-29-2010


    /* Initialize. */
    F77_FUNC (ma57id, MA57ID) (wd_cntl_, wd_icntl_);

    /* Custom settings for MA57. */
    wd_icntl_[1-1] = 0;      /* Error stream */
    wd_icntl_[2-1] = 0;      /* Warning stream. */

    wd_icntl_[4-1] = 1;      /* Print statistics.  NOT Used. */
    wd_icntl_[5-1] = 0;      /* Print error. */

    wd_icntl_[6-1] = ma57_pivot_order;       /* Pivoting order. */

    wd_cntl_[1-1]  = pivtol_;    /* Pivot threshold. */
    wd_icntl_[7-1] = 1;      /* Pivoting strategy. */

    // CET: Added 04-29-2010 at suggestion of Jonathan Hogg of HSL
    wd_icntl_[11-1] = ma57_block_size;   /* Block size used by Level 3 BLAS in MA57BD - should be a multiple of 8.  Default is 16. */
    wd_icntl_[12-1] = ma57_node_amalgamation; /* Two nodes of the assembly tree are merged only if both involve less than ICNTL(12) eliminations.  Default is 16. */
    // CET: 04-29-2010


    if (ma57_automatic_scaling) {
        wd_icntl_[15-1] = 1;
    }
    else {
        wd_icntl_[15-1] = 0;
    }


    // CET: Added 04-29-2010 at suggestion of Jonathan Hogg of HSL
    wd_icntl_[16-1] = ma57_small_pivot_flag;    /* If set to 1, small entries are removed and corresponding pivots are placed at the end of factorization.  May be useful for highly rank deficient matrices.  Default is 0. */
    // CET: 04-29-2010


    // wd_icntl[8-1] = 0;       /* Retry factorization. */

    if (!warm_start_same_structure_) {
        dim_=0;
        nonzeros_=0;
        delete [] a_;
        a_ = NULL;
        delete [] wd_fact_;
        wd_fact_ = NULL;
        delete [] wd_ifact_;
        wd_ifact_ = NULL;
        delete [] wd_iwork_;
        wd_iwork_ = NULL;
        delete [] wd_keep_;
        wd_keep_ = NULL;
    }
    else {
        ASSERT_EXCEPTION(dim_>0 && nonzeros_>0, INVALID_WARMSTART,
                         "Ma57TSolverInterface called with warm_start_same_structure, "
                         "but the problem is solved for the first time.");
    }

    return true;
}
开发者ID:fbudin69500,项目名称:calatk,代码行数:96,代码来源:IpMa57TSolverInterface.cpp


注:本文中的OptionsList::GetIntegerValue方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。