📄 bin_sol.c
字号:
/* * Revision Control Information * * $Source: /projects/mvsis/Repository/mvsis-1.3/src/sis/mincov/bin_sol.c,v $ * $Author: wjiang $ * $Revision: 1.1.1.1 $ * $Date: 2003/02/24 22:24:09 $ * */#include "sis.h"#include "mincov_int.h"bin_solution_t *bin_solution_alloc(size)int size;{ bin_solution_t *sol; sol = ALLOC(bin_solution_t, 1); sol->cost = 0; sol->set = set_new (size); return sol;}voidbin_solution_free(sol)bin_solution_t *sol;{ set_free(sol->set); FREE(sol);}bin_solution_t *bin_solution_dup(sol, size)bin_solution_t *sol;int size;{ bin_solution_t *new_sol; new_sol = ALLOC(bin_solution_t, 1); new_sol->cost = sol->cost; new_sol->set = set_new (size); INLINEset_copy (new_sol->set, sol->set); return new_sol;}void bin_solution_del(sol, weight, col)bin_solution_t *sol;int *weight;int col;{ set_remove(sol->set, col); sol->cost -= WEIGHT(weight, col);}void bin_solution_add(sol, weight, col)bin_solution_t *sol;int *weight;int col;{ set_insert(sol->set, col); sol->cost += WEIGHT(weight, col);}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -