Structural Bioinformatics Library
Template C++ / Python API for developping structural bioinformatics applications.
problem< graph, dp_mat, lambda_mat, parameter > Class Template Reference

#include <problem.h>

Public Member Functions

int get_size ()
 
vector< int > & get_up ()
 
vector< int > & get_lo ()
 
vector< int > & get_solution ()
 
float get_ub ()
 
float get_lb ()
 
float get_lb_father ()
 
float get_ub_father ()
 
int get_status ()
 
bool is_splitted ()
 
double get_solve_time ()
 
int get_iter ()
 
void set_up (int col, int val)
 
void set_lo (int col, int val)
 
void lr_sgd_solve (parameter &params)
 
float get_correct_value (vector< int > &sol)
 
int get_nz_sub_gr (vector< int > &sol)
 
void update_lambda (float step)
 
int is_brk_cst_col_node (int col1, int col2, int row2, vector< int > &sol)
 
int is_brk_cst_row_node (int row1, int col2, int row2, vector< int > &sol)
 
int check_cst_col_node (int col1, int col2, int row2, vector< int > &sol)
 
int check_cst_row_node (int row1, int col2, int row2, vector< int > &sol)
 
 problem (graph &g1, dp_mat &dp1, lambda_mat &lb1)
 
 problem (problem &p, vector< int > &lo1, vector< int > &up1)
 
lambda_mat & get_lambda_mat ()
 
graph & get_graph ()
 
dp_mat & get_dp_mat_apurva ()
 
problemcreate_subproblem (vector< int > &lo1, vector< int > &up1)
 
void split (vector< int > &lo1, vector< int > &up1, vector< int > &lo2, vector< int > &up2)
 

Detailed Description

template<class graph, class dp_mat, class lambda_mat, class parameter>
class problem< graph, dp_mat, lambda_mat, parameter >

Problem Class This is used to solve a Contact Map Overlap Maximisation problem, using the A_purva integer programming model and lagrangian relaxation approach.

Constructor & Destructor Documentation

◆ problem() [1/2]

problem ( graph &  g1,
dp_mat &  dp1,
lambda_mat &  lb1 
)
inline

Constructors : create a root problem.

◆ problem() [2/2]

problem ( problem< graph, dp_mat, lambda_mat, parameter > &  p,
vector< int > &  lo1,
vector< int > &  up1 
)
inline

Constructors: Build a sub-problem of problem p, using lo1 for lowerlimits and up1for upperlimits.

Member Function Documentation

◆ check_cst_col_node()

int check_cst_col_node ( int  col1,
int  col2,
int  row2,
vector< int > &  sol 
)
inline

return the value of the X_{col2,row2} - SUM Y_{col1,row1,col2,row2} col / node constraint.

◆ check_cst_row_node()

int check_cst_row_node ( int  row1,
int  col2,
int  row2,
vector< int > &  sol 
)
inline

return the value of the X_{col2,row2} - SUM Y_{col1,row1,col2,row2} row / node constraint.

◆ create_subproblem()

problem* create_subproblem ( vector< int > &  lo1,
vector< int > &  up1 
)
inline

Methods Being given a lower and an upper limits, create the corresponding sub-problem.

◆ get_correct_value()

float get_correct_value ( vector< int > &  sol)
inline

Return the value of the solution for the Primal problem.

◆ get_dp_mat_apurva()

dp_mat& get_dp_mat_apurva ( )
inline

Return the Dynamic programming object.

◆ get_graph()

graph& get_graph ( )
inline

Return the Contact Map alignment graph.

◆ get_iter()

int get_iter ( )
inline

Return the number of iteration needed to solve the problem.

◆ get_lambda_mat()

lambda_mat& get_lambda_mat ( )
inline

Accessors Return the Lambda coeficients.

◆ get_lb()

float get_lb ( )
inline

Return the current lowerbound of the problem.

◆ get_lb_father()

float get_lb_father ( )
inline

Return the lowerbound of the father problem.

◆ get_lo()

vector<int>& get_lo ( )
inline

Return the lower limits of the problem.

◆ get_nz_sub_gr()

int get_nz_sub_gr ( vector< int > &  sol)
inline

Return the nb of non-zero component of the subgradient vector, and the list of non-zero components is stored in nz_sgv

◆ get_size()

int get_size ( )
inline

Accessors Return the size of the problem.

◆ get_solution()

vector<int>& get_solution ( )
inline

Return the best feasible solution of the problem.

◆ get_solve_time()

double get_solve_time ( )
inline

Return the time needed to solve the problem.

◆ get_status()

int get_status ( )
inline

Return the status of the problem (see symbols.h).

◆ get_ub()

float get_ub ( )
inline

Return the current upperbound of the problem.

◆ get_ub_father()

float get_ub_father ( )
inline

Return the upperbound of the father problem.

◆ get_up()

vector<int>& get_up ( )
inline

Return the upper limits of the problem.

◆ is_brk_cst_col_node()

int is_brk_cst_col_node ( int  col1,
int  col2,
int  row2,
vector< int > &  sol 
)
inline

return the value of the X_{col2,row2} - SUM Y_{col1,row1,col2,row2} col / node constraint.

◆ is_brk_cst_row_node()

int is_brk_cst_row_node ( int  row1,
int  col2,
int  row2,
vector< int > &  sol 
)
inline

return the value of the X_{col2,row2} - SUM Y_{col1,row1,col2,row2} row / node constraint.

◆ is_splitted()

bool is_splitted ( )
inline

Boolean function, return 1 if the problem was successfully splitted, 0 else.

◆ lr_sgd_solve()

void lr_sgd_solve ( parameter &  params)
inline

Problem Solver, using Lagrangian Relaxation, with Dual problem solved using SubGradient Descent.

◆ set_lo()

void set_lo ( int  col,
int  val 
)
inline

Set the lowerlimits of the problem.

◆ set_up()

void set_up ( int  col,
int  val 
)
inline

Methods Set the upperlimits of the problem.

◆ split()

void split ( vector< int > &  lo1,
vector< int > &  up1,
vector< int > &  lo2,
vector< int > &  up2 
)
inline

This function split a problem into two subproblem. In fact it generate the two corresponding sets of upper and lower limits.

◆ update_lambda()

void update_lambda ( float  step)
inline

Update Lambda coeficients.