#ifndef __NPE_H_1#define __NPE_H_23#include "flp.h"45/* normalized polish expression */6typedef struct NPE_t_st7{8int *elements;9int size;1011/* positions of the units */12int *unit_pos;13int n_units;1415/*16* flipping positions - where17* a unit is immediately adjacent18* to a cut_type and vice-versa19*/20int *flip_pos;21int n_flips;2223/* positions of the chains */24int *chain_pos;25int n_chains;2627/* no. of units till this position */28int *ballot_count;29}NPE_t;3031/* NPE routines */3233/* the starting solution for simulated annealing */34NPE_t *NPE_get_initial(flp_desc_t *flp_desc);35/* uninitialization */36void free_NPE(NPE_t *expr);37/* debug print */38void print_NPE(NPE_t *expr, flp_desc_t *flp_desc);39/*40* move M1 of the floorplan paper41* swap two units adjacent in the NPE42*/43void NPE_swap_units(NPE_t *expr, int pos);44/* move M2 - invert a chain of cut_types in the NPE */45void NPE_invert_chain(NPE_t *expr, int pos);46/* move M3 - swap adjacent cut_type and unit in the NPE */47int NPE_swap_cut_unit(NPE_t *expr, int pos);48/* make a random move out of the above */49NPE_t *make_random_move(NPE_t *expr);50/* make a copy of this NPE */51NPE_t *NPE_duplicate(NPE_t *expr);5253#endif545556