SimGrid  3.14.159
Versatile Simulation of Distributed Systems
lagrange.cpp File Reference
#include "xbt/log.h"
#include "xbt/sysdep.h"
#include "maxmin_private.hpp"
#include <stdlib.h>
#include <math.h>

Macros

#define SHOW_EXPR(expr)   XBT_CDEBUG(surf_lagrange,#expr " = %g",expr);
 
#define VEGAS_SCALING   1000.0
 
#define RENO_SCALING   1.0
 
#define RENO2_SCALING   1.0
 

Functions

 XBT_LOG_NEW_DEFAULT_SUBCATEGORY (surf_lagrange, surf, "Logging specific to SURF (lagrange)")
 
 XBT_LOG_NEW_SUBCATEGORY (surf_lagrange_dichotomy, surf_lagrange, "Logging specific to SURF (lagrange dichotomy)")
 
void lagrange_solve (lmm_system_t sys)
 
static double dichotomy (double init, double diff(double, void *), void *var_cnst, double min_error)
 
static double partial_diff_lambda (double lambda, void *param_cnst)
 
static int __check_feasible (xbt_swag_t cnst_list, xbt_swag_t var_list, int warn)
 
static double new_value (lmm_variable_t var)
 
static double new_mu (lmm_variable_t var)
 
static double dual_objective (xbt_swag_t var_list, xbt_swag_t cnst_list)
 
void lmm_set_default_protocol_function (double(*func_f)(lmm_variable_t var, double x), double(*func_fp)(lmm_variable_t var, double x), double(*func_fpi)(lmm_variable_t var, double x))
 Attribute the value bound to var->bound. More...
 
double func_vegas_f (lmm_variable_t var, double x)
 
double func_vegas_fp (lmm_variable_t var, double x)
 
double func_vegas_fpi (lmm_variable_t var, double x)
 
double func_reno_f (lmm_variable_t var, double x)
 
double func_reno_fp (lmm_variable_t var, double x)
 
double func_reno_fpi (lmm_variable_t var, double x)
 
double func_reno2_f (lmm_variable_t var, double x)
 
double func_reno2_fp (lmm_variable_t var, double x)
 
double func_reno2_fpi (lmm_variable_t var, double x)
 

Variables

double(* func_f_def )(lmm_variable_t, double)
 Print information about a lmm system. More...
 
double(* func_fp_def )(lmm_variable_t, double)
 
double(* func_fpi_def )(lmm_variable_t, double)
 

Macro Definition Documentation

◆ SHOW_EXPR

#define SHOW_EXPR (   expr)    XBT_CDEBUG(surf_lagrange,#expr " = %g",expr);

◆ VEGAS_SCALING

#define VEGAS_SCALING   1000.0

◆ RENO_SCALING

#define RENO_SCALING   1.0

◆ RENO2_SCALING

#define RENO2_SCALING   1.0

Function Documentation

◆ XBT_LOG_NEW_DEFAULT_SUBCATEGORY()

XBT_LOG_NEW_DEFAULT_SUBCATEGORY ( surf_lagrange  ,
surf  ,
"Logging specific to SURF (lagrange)"   
)

◆ XBT_LOG_NEW_SUBCATEGORY()

XBT_LOG_NEW_SUBCATEGORY ( surf_lagrange_dichotomy  ,
surf_lagrange  ,
"Logging specific to SURF (lagrange dichotomy)"   
)

◆ lagrange_solve()

void lagrange_solve ( lmm_system_t  sys)

◆ dichotomy()

static double dichotomy ( double  init,
double   diffdouble, void *,
void var_cnst,
double  min_error 
)
static

◆ partial_diff_lambda()

static double partial_diff_lambda ( double  lambda,
void param_cnst 
)
static

◆ __check_feasible()

static int __check_feasible ( xbt_swag_t  cnst_list,
xbt_swag_t  var_list,
int  warn 
)
static

◆ new_value()

static double new_value ( lmm_variable_t  var)
static

◆ new_mu()

static double new_mu ( lmm_variable_t  var)
static

◆ dual_objective()

static double dual_objective ( xbt_swag_t  var_list,
xbt_swag_t  cnst_list 
)
static

◆ lmm_set_default_protocol_function()

void lmm_set_default_protocol_function ( double(*)(lmm_variable_t var, double x)  func_f,
double(*)(lmm_variable_t var, double x)  func_fp,
double(*)(lmm_variable_t var, double x)  func_fpi 
)

Attribute the value bound to var->bound.

Default functions associated to the chosen protocol.

Parameters
func_fpiinverse of the partial differential of f (f prime inverse, (f')^{-1})

Set default functions to the ones passed as parameters. This is a polymorphism in C pure, enjoy the roots of programming.

◆ func_vegas_f()

double func_vegas_f ( lmm_variable_t  var,
double  x 
)

◆ func_vegas_fp()

double func_vegas_fp ( lmm_variable_t  var,
double  x 
)

◆ func_vegas_fpi()

double func_vegas_fpi ( lmm_variable_t  var,
double  x 
)

◆ func_reno_f()

double func_reno_f ( lmm_variable_t  var,
double  x 
)

◆ func_reno_fp()

double func_reno_fp ( lmm_variable_t  var,
double  x 
)

◆ func_reno_fpi()

double func_reno_fpi ( lmm_variable_t  var,
double  x 
)

◆ func_reno2_f()

double func_reno2_f ( lmm_variable_t  var,
double  x 
)

◆ func_reno2_fp()

double func_reno2_fp ( lmm_variable_t  var,
double  x 
)

◆ func_reno2_fpi()

double func_reno2_fpi ( lmm_variable_t  var,
double  x 
)

Variable Documentation

◆ func_fp_def

double(* func_fp_def) (lmm_variable_t, double)

◆ func_fpi_def

double(* func_fpi_def) (lmm_variable_t, double)