APPFS
Advanced practical programming for scientists
|
BIP Enumerator. More...
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <assert.h>
#include <stdbool.h>
#include <time.h>
#include <limits.h>
#include <math.h>
#include <errno.h>
#include <float.h>
#include <fenv.h>
#include "mshell.h"
#include "splitline.h"
#include "bip_enum.h"
Go to the source code of this file.
Data Structures | |
struct | binary_program |
Macros | |
#define | BIP_MAX_COLS 32 |
#define | BIP_MAX_ROWS 32 |
#define | MAX_LINE_LEN 512 |
Maximum input line length. More... | |
#define | GET_SEC(a, b) ((b - a) / (double)CLOCKS_PER_SEC) |
Enumerations | |
enum | LINE_MODE { READ_ERROR, READ_COLS, READ_ROWS, READ_COEF } |
enum | Sense { LE = 0, GE = 1, EQ = 2 } |
Functions | |
static bool | bip_is_valid (const BIP *bip) |
Check whether BIP data structure is consistent. More... | |
void | bip_init () |
void | bip_free (BIP *bip) |
Deallocate BIP data structure. More... | |
static bool | bip_can_overflow (const BIP *bip) |
static LINE_MODE | process_line (LINE_MODE mode, const LFS *lfs, const int lines, BIP *bip) |
BIP * | bip_read (const char *filename) |
Read a bip file. More... | |
void | bip_print (const BIP *bip, FILE *fp) |
Print Binary Program from BIP. More... | |
static void | print_solu (FILE *fp, int vars, const double *x) |
Print solution vector. More... | |
static bool | bip_is_feasible (const BIP *bip, const double *x) |
Check whether a particular vector is a feasible solution to a BIP. More... | |
int | bip_enumerate (const BIP *bip, bool with_output) |
Enumerate all possible solution of a BIP. More... | |
Variables | |
static Numb | max_coef_val |
static Numb | min_coef_val |
static bool | int_coef |
Definition in file bip_enum.c.
#define BIP_MAX_COLS 32 |
Definition at line 37 of file bip_enum.c.
#define BIP_MAX_ROWS 32 |
Definition at line 38 of file bip_enum.c.
#define GET_SEC | ( | a, | |
b | |||
) | ((b - a) / (double)CLOCKS_PER_SEC) |
Definition at line 57 of file bip_enum.c.
#define MAX_LINE_LEN 512 |
Definition at line 55 of file bip_enum.c.
enum LINE_MODE |
Enumerator | |
---|---|
READ_ERROR | |
READ_COLS | |
READ_ROWS | |
READ_COEF |
Definition at line 40 of file bip_enum.c.
enum Sense |
Enumerator | |
---|---|
LE | |
GE | |
EQ |
Definition at line 42 of file bip_enum.c.
|
static |
Definition at line 142 of file bip_enum.c.
int bip_enumerate | ( | const BIP * | bip, |
bool | with_output | ||
) |
Prints all solutions.
Definition at line 439 of file bip_enum.c.
void bip_free | ( | BIP * | bip | ) |
Definition at line 133 of file bip_enum.c.
void bip_init | ( | void | ) |
Definition at line 91 of file bip_enum.c.
|
static |
Definition at line 394 of file bip_enum.c.
|
static |
Definition at line 66 of file bip_enum.c.
void bip_print | ( | const BIP * | bip, |
FILE * | fp | ||
) |
Definition at line 359 of file bip_enum.c.
BIP* bip_read | ( | const char * | filename | ) |
Format example:
4 # cols (variables) 3 # rows (constraints) 2 3 5 4 <= 8 3 6 0 8 <= 10 0 0 1 1 <= 1
comments (#) and empty lines are ignored.
filename | name of file to read |
Definition at line 296 of file bip_enum.c.
|
static |
fp | file pointer to output to |
vars | number of variables |
x | ptr to solution vector |
Definition at line 376 of file bip_enum.c.
|
static |
Definition at line 179 of file bip_enum.c.
|
static |
Definition at line 61 of file bip_enum.c.
|
static |
Definition at line 59 of file bip_enum.c.
|
static |
Definition at line 60 of file bip_enum.c.