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]

template<class graph, class dp_mat, class lambda_mat, class parameter>
problem ( graph & g1,
dp_mat & dp1,
lambda_mat & lb1 )
inline

Constructors : create a root problem.

◆ problem() [2/2]

template<class graph, class dp_mat, class lambda_mat, class parameter>
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()

template<class graph, class dp_mat, class lambda_mat, class parameter>
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()

template<class graph, class dp_mat, class lambda_mat, class parameter>
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()

template<class graph, class dp_mat, class lambda_mat, class parameter>
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()

template<class graph, class dp_mat, class lambda_mat, class parameter>
float get_correct_value ( vector< int > & sol)
inline

Return the value of the solution for the Primal problem.

◆ get_dp_mat_apurva()

template<class graph, class dp_mat, class lambda_mat, class parameter>
dp_mat & get_dp_mat_apurva ( )
inline

Return the Dynamic programming object.

◆ get_graph()

template<class graph, class dp_mat, class lambda_mat, class parameter>
graph & get_graph ( )
inline

Return the Contact Map alignment graph.

◆ get_iter()

template<class graph, class dp_mat, class lambda_mat, class parameter>
int get_iter ( )
inline

Return the number of iteration needed to solve the problem.

◆ get_lambda_mat()

template<class graph, class dp_mat, class lambda_mat, class parameter>
lambda_mat & get_lambda_mat ( )
inline

Accessors Return the Lambda coeficients.

◆ get_lb()

template<class graph, class dp_mat, class lambda_mat, class parameter>
float get_lb ( )
inline

Return the current lowerbound of the problem.

◆ get_lb_father()

template<class graph, class dp_mat, class lambda_mat, class parameter>
float get_lb_father ( )
inline

Return the lowerbound of the father problem.

◆ get_lo()

template<class graph, class dp_mat, class lambda_mat, class parameter>
vector< int > & get_lo ( )
inline

Return the lower limits of the problem.

◆ get_nz_sub_gr()

template<class graph, class dp_mat, class lambda_mat, class parameter>
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()

template<class graph, class dp_mat, class lambda_mat, class parameter>
int get_size ( )
inline

Accessors Return the size of the problem.

◆ get_solution()

template<class graph, class dp_mat, class lambda_mat, class parameter>
vector< int > & get_solution ( )
inline

Return the best feasible solution of the problem.

◆ get_solve_time()

template<class graph, class dp_mat, class lambda_mat, class parameter>
double get_solve_time ( )
inline

Return the time needed to solve the problem.

◆ get_status()

template<class graph, class dp_mat, class lambda_mat, class parameter>
int get_status ( )
inline

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

◆ get_ub()

template<class graph, class dp_mat, class lambda_mat, class parameter>
float get_ub ( )
inline

Return the current upperbound of the problem.

◆ get_ub_father()

template<class graph, class dp_mat, class lambda_mat, class parameter>
float get_ub_father ( )
inline

Return the upperbound of the father problem.

◆ get_up()

template<class graph, class dp_mat, class lambda_mat, class parameter>
vector< int > & get_up ( )
inline

Return the upper limits of the problem.

◆ is_brk_cst_col_node()

template<class graph, class dp_mat, class lambda_mat, class parameter>
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()

template<class graph, class dp_mat, class lambda_mat, class parameter>
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()

template<class graph, class dp_mat, class lambda_mat, class parameter>
bool is_splitted ( )
inline

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

◆ lr_sgd_solve()

template<class graph, class dp_mat, class lambda_mat, class parameter>
void lr_sgd_solve ( parameter & params)
inline

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

◆ set_lo()

template<class graph, class dp_mat, class lambda_mat, class parameter>
void set_lo ( int col,
int val )
inline

Set the lowerlimits of the problem.

◆ set_up()

template<class graph, class dp_mat, class lambda_mat, class parameter>
void set_up ( int col,
int val )
inline

Methods Set the upperlimits of the problem.

◆ split()

template<class graph, class dp_mat, class lambda_mat, class parameter>
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()

template<class graph, class dp_mat, class lambda_mat, class parameter>
void update_lambda ( float step)
inline

Update Lambda coeficients.