/* TRANSAX - Axial Transportation Polytope Generator TRANSPLAN - Planar Transportation Polytope Generator This material is based upon work supported by the National Science Foundation under Grant #DMS-0135345. Copyright (C) 2006 Edward D. Kim. http://www.math.ucdavis.edu/~ekim/ */ #include #include #include #include #include #include #include #include #include #include #include #ifndef _TRANS_H #define _TRANS_H using namespace std; typedef vector intvec; class trans { public: /* Constructor: This basically remains empty, since it is easier to build the multi-margin by using the add_margin_size method. Intialized with either string "axial" or "planar" */ trans(string init_transp_type); /* True if transp_type is "axial" */ bool is_axial(); /* True if transp_type is "planar" */ bool is_planar(); /* This method is called in the main program to stuff the user's command-line selections into the object's properties. */ void add_margin_size( unsigned long int margin_size ); /* Returns the number of margins. i.e. this is an n-way polytope for which n? */ unsigned long int margin_count(); /* Returns the size of the Nth margin: For example, if the margin sizes specified were 2x5x6, then margin_size(3) = 6. */ unsigned long int margin_size( unsigned long int margin_number ); /* Returns the ambient dimension of the polytope: The product of all margin sizes */ unsigned long int dim(); /* Returns the number of rows in matrix A */ unsigned long int row_count(); /* Returns the product of the first how_many margins. */ unsigned long int product_of_first_margins(unsigned long int how_many); /* Converts a multiindex into a single index. */ unsigned long int multiindex_to_singleindex(intvec multiindex); /* Converts a single index into a multiindex. */ intvec singleindex_to_multiindex(unsigned long int singleindex); /* Computes the LHS matrix A. This computation is dependent on transp_type. */ string compute_matrix_a(); /* Displays the computed LHS matrix to the screen. */ void view_matrix_a(); /* Obtains a columns of matrix A. */ intvec matrix_a_column(unsigned long int col); /* Stores the colmuns of matrix A. This is separated out from computing A so that fewer functions are dependent on transp_type. */ string store_a_transpose(); /* Displays the transpose of matrix A. */ void view_matrix_a_transpose(); /* Constructs the point configuration of the columns of A. */ string make_point_configuraton_polymake_file(); /* Applies Polymake's Gale Transform. */ string apply_gale_transform(); /* Returns the private Gale Transform. */ // vector return_gale_transform(); /* Computes regular triangulations of the Gale Transform with TOPCOM, as well as simplex complements. */ string find_regular_triangulations(); string count_regular_triangulations(); /* Generates cone interior polymake files. */ string generate_cones(); /* Displays regular triangulation data. */ void disp_triangs(); /* Computes cone relative interiors, finds chamber interior points, and generates polytopes. */ string find_chamberinterior_point_and_make_polytopes(); /* Checks cone interiors for proper calculation */ void check_cone_interiors(); /* Generates one random polytope. */ string generate_one_random_polytope(); string find_regular_triangulations_and_generate_polytopes(); void single_chamber_take_triangulation_complement(unsigned long int triangulation_number); void single_chamber_generate_cones(unsigned long int triangulation_num); string single_chamber_find_chamberinterior_point_and_make_polytope(unsigned long int triangulation_num); private: string transp_type; intvec margin_sizes; vector matrix_a; vector matrix_a_columns; vector gale_transform; vector triangulation_heights; vector b_vectors; vector< vector > triangulation_data; vector< vector > triangulation_data_complement; vector< vector > rhs_vectors; vector cone_filenames; vector cones; }; #endif #ifndef _TRANS_CPP #include "trans.cpp" #endif