MOOCHO (Single Doxygen Collection)  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Macros | Functions | Variables
RTOp_TOp_force_in_bounds.c File Reference
#include "RTOp_TOp_force_in_bounds.h"
#include "RTOp_obj_null_vtbl.h"
#include "RTOp_obj_value_value_vtbl.h"
Include dependency graph for RTOp_TOp_force_in_bounds.c:

Go to the source code of this file.

Macros

#define max(a, b)   ( (a) > (b) ? (a) : (b) )
 
#define min(a, b)   ( (a) < (b) ? (a) : (b) )
 

Functions

static int RTOp_TOp_force_in_bounds_apply_op (const struct RTOp_RTOp_vtbl_t *vtbl, const void *obj_data, const int num_vecs, const struct RTOp_SubVector vecs[], const int num_targ_vecs, const struct RTOp_MutableSubVector targ_vecs[], RTOp_ReductTarget targ_obj)
 
int RTOp_TOp_force_in_bounds_construct (struct RTOp_RTOp *op)
 
int RTOp_TOp_force_in_bounds_destroy (struct RTOp_RTOp *op)
 
static int RTOp_TOp_force_in_bounds_buffer_apply_op (const struct RTOp_RTOp_vtbl_t *vtbl, const void *obj_data, const int num_vecs, const struct RTOp_SubVector vecs[], const int num_targ_vecs, const struct RTOp_MutableSubVector targ_vecs[], RTOp_ReductTarget reduct_obj)
 
int RTOp_TOp_force_in_bounds_buffer_construct (RTOp_value_type rel_push, RTOp_value_type abs_push, struct RTOp_RTOp *op)
 
int RTOp_TOp_force_in_bounds_buffer_destroy (struct RTOp_RTOp *op)
 
int RTOp_TOp_force_in_bounds_buffer_init (RTOp_value_type rel_push, RTOp_value_type abs_push, struct RTOp_RTOp *op)
 

Variables

const struct RTOp_RTOp_vtbl_t RTOp_TOp_force_in_bounds_vtbl
 
const struct RTOp_RTOp_vtbl_t RTOp_TOp_force_in_bounds_buffer_vtbl
 

Macro Definition Documentation

#define max (   a,
 
)    ( (a) > (b) ? (a) : (b) )

Definition at line 48 of file RTOp_TOp_force_in_bounds.c.

#define min (   a,
 
)    ( (a) < (b) ? (a) : (b) )

Definition at line 49 of file RTOp_TOp_force_in_bounds.c.

Function Documentation

static int RTOp_TOp_force_in_bounds_apply_op ( const struct RTOp_RTOp_vtbl_t vtbl,
const void obj_data,
const int  num_vecs,
const struct RTOp_SubVector  vecs[],
const int  num_targ_vecs,
const struct RTOp_MutableSubVector  targ_vecs[],
RTOp_ReductTarget  targ_obj 
)
static

Definition at line 53 of file RTOp_TOp_force_in_bounds.c.

int RTOp_TOp_force_in_bounds_construct ( struct RTOp_RTOp op)

Definition at line 134 of file RTOp_TOp_force_in_bounds.c.

int RTOp_TOp_force_in_bounds_destroy ( struct RTOp_RTOp op)

Definition at line 141 of file RTOp_TOp_force_in_bounds.c.

static int RTOp_TOp_force_in_bounds_buffer_apply_op ( const struct RTOp_RTOp_vtbl_t vtbl,
const void obj_data,
const int  num_vecs,
const struct RTOp_SubVector  vecs[],
const int  num_targ_vecs,
const struct RTOp_MutableSubVector  targ_vecs[],
RTOp_ReductTarget  reduct_obj 
)
static

Definition at line 150 of file RTOp_TOp_force_in_bounds.c.

int RTOp_TOp_force_in_bounds_buffer_construct ( RTOp_value_type  rel_push,
RTOp_value_type  abs_push,
struct RTOp_RTOp op 
)

Definition at line 248 of file RTOp_TOp_force_in_bounds.c.

int RTOp_TOp_force_in_bounds_buffer_destroy ( struct RTOp_RTOp op)

Definition at line 259 of file RTOp_TOp_force_in_bounds.c.

int RTOp_TOp_force_in_bounds_buffer_init ( RTOp_value_type  rel_push,
RTOp_value_type  abs_push,
struct RTOp_RTOp op 
)

Definition at line 267 of file RTOp_TOp_force_in_bounds.c.

Variable Documentation

const struct RTOp_RTOp_vtbl_t RTOp_TOp_force_in_bounds_vtbl
Initial value:
=
{
,"TOp_force_in_bounds"
,NULL
,NULL
,NULL
}
static int RTOp_TOp_force_in_bounds_apply_op(const struct RTOp_RTOp_vtbl_t *vtbl, const void *obj_data, const int num_vecs, const struct RTOp_SubVector vecs[], const int num_targ_vecs, const struct RTOp_MutableSubVector targ_vecs[], RTOp_ReductTarget targ_obj)
const struct RTOp_obj_type_vtbl_t RTOp_obj_null_vtbl

Definition at line 121 of file RTOp_TOp_force_in_bounds.c.

const struct RTOp_RTOp_vtbl_t RTOp_TOp_force_in_bounds_buffer_vtbl
Initial value:
=
{
,"TOp_force_in_bounds_buffer"
,NULL
,NULL
,NULL
}
const struct RTOp_obj_type_vtbl_t RTOp_obj_value_value_vtbl
const struct RTOp_obj_type_vtbl_t RTOp_obj_null_vtbl
static int RTOp_TOp_force_in_bounds_buffer_apply_op(const struct RTOp_RTOp_vtbl_t *vtbl, const void *obj_data, const int num_vecs, const struct RTOp_SubVector vecs[], const int num_targ_vecs, const struct RTOp_MutableSubVector targ_vecs[], RTOp_ReductTarget reduct_obj)

This operator is used by the interior point algorithm to push initial variables sufficiently inside the bounds since the algorithm assumes that they are ALWAYS within bounds.

element-wise transformation:
    xl_sb = min(v0 + rel_push*(v1-v0), v0 + abs_push);
    xu_sb = max(v1 - rel_push*(v1-v0), v1 - abs_push);
    if (xl_sb >= xu_sb)
        { z0 = v0 + (v1-v0)/2.0; }
    else if (z0 < xl_sb)
        { z0 = xl_sb; }
    else if (z0 > xu_sb)
        { z0 = xu_sb; }
    // Otherwise, leave it

This operator class implementation was created automatically by 'new_rtop.pl'.

xl_sb = min(xl+relative_bound_push*(xu-xl), xl + absolute_bound_push) xu_sb = max(xu-relative_bound_push*(xu-xl), xu - absolute_bound_push) if (xl_sb > xu_sb) then x = (xl + (xu-xl)/2 else if (x < xl_sb) then x = xl_sb else if (x > xu_sb) then x = xu_sb

Definition at line 235 of file RTOp_TOp_force_in_bounds.c.