summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorhub.wag@gmail.com <hub.wag@gmail.com@8e3bb3c2-eed4-f18f-5264-0b6c94e6926d>2013-04-12 00:04:08 +0000
committerhub.wag@gmail.com <hub.wag@gmail.com@8e3bb3c2-eed4-f18f-5264-0b6c94e6926d>2013-04-12 00:04:08 +0000
commitb66953101a196371faf55effb37fd2928832e8e5 (patch)
tree46e7427c8e06699618fb8e52bfcfd739c5d3998f /src
parent0c0078181f915b9224de69fd52842a77c40ea96c (diff)
Updated the README and cleaned the phat.cpp command line options. Now the options match the names in the readme. Small changes to the bit_tree_pivot_column.h.
git-svn-id: https://phat.googlecode.com/svn/trunk@30 8e3bb3c2-eed4-f18f-5264-0b6c94e6926d
Diffstat (limited to 'src')
-rw-r--r--src/phat.cpp40
1 files changed, 20 insertions, 20 deletions
diff --git a/src/phat.cpp b/src/phat.cpp
index 6fec0c8..43ebedc 100644
--- a/src/phat.cpp
+++ b/src/phat.cpp
@@ -30,7 +30,7 @@
#include <phat/algorithms/chunk_reduction.h>
-enum Representation_type {VEC_VEC, VEC_SET, SPARSE_PIVOT, FULL_PIVOT, BIT_TREE_PIVOT};
+enum Representation_type {VECTOR_VECTOR, VECTOR_SET, SPARSE_PIVOT_COLUMN, FULL_PIVOT_COLUMN, BIT_TREE_PIVOT_COLUMN};
enum Algorithm_type {STANDARD, TWIST, ROW, CHUNK };
void print_help() {
@@ -43,8 +43,8 @@ void print_help() {
std::cerr << "--help -- prints this screen" << std::endl;
std::cerr << "--verbose -- verbose output" << std::endl;
std::cerr << "--dualize -- use dualization approach" << std::endl;
- std::cerr << "--vec-vec, --vec-set, --full-pivot, --sparse-pivot, --bit-tree-pivot -- selects a representation data structure for boundary matrices (default is '--sparse-pivot')" << std::endl;
- std::cerr << "--standard, --twist, --chunk, --row -- selects a reduction algorithm (default is '--twist')" << std::endl;
+ std::cerr << "--vector_vector, --vector_set, --full_pivot_column, --sparse_pivot_column, --bit_tree_pivot_column -- selects a representation data structure for boundary matrices (default is '--bit_tree_pivot_column')" << std::endl;
+ std::cerr << "--standard, --twist, --chunk, --row -- selects a reduction algorithm (default is '--chunk')" << std::endl;
}
void print_help_and_exit() {
@@ -53,7 +53,7 @@ void print_help_and_exit() {
}
void parse_command_line( int argc, char** argv, bool& use_binary, Representation_type& rep_type, Algorithm_type& reduction,
- std::string& input_filename, std::string& output_filename, bool& verbose, bool& dualize ) {
+ std::string& input_filename, std::string& output_filename, bool& verbose, bool& dualize) {
if( argc < 3 ) print_help_and_exit();
@@ -66,11 +66,11 @@ void parse_command_line( int argc, char** argv, bool& use_binary, Representation
if( option == "--ascii" ) use_binary = false;
else if( option == "--binary" ) use_binary = true;
else if( option == "--dualize" ) dualize = true;
- else if( option == "--vec-vec" ) rep_type = VEC_VEC;
- else if( option == "--vec-set" ) rep_type = VEC_SET;
- else if( option == "--full-pivot" ) rep_type = FULL_PIVOT;
- else if( option == "--bit-tree-pivot" ) rep_type = BIT_TREE_PIVOT;
- else if( option == "--sparse-pivot" ) rep_type = SPARSE_PIVOT;
+ else if( option == "--vector_vector" ) rep_type = VECTOR_VECTOR;
+ else if( option == "--vector_set" ) rep_type = VECTOR_SET;
+ else if( option == "--full_pivot_column" ) rep_type = FULL_PIVOT_COLUMN;
+ else if( option == "--bit_tree_pivot_column" ) rep_type = BIT_TREE_PIVOT_COLUMN;
+ else if( option == "--sparse_pivot_column" ) rep_type = SPARSE_PIVOT_COLUMN;
else if( option == "--standard" ) reduction = STANDARD;
else if( option == "--twist" ) reduction = TWIST;
else if( option == "--row" ) reduction = ROW;
@@ -86,8 +86,8 @@ void parse_command_line( int argc, char** argv, bool& use_binary, Representation
template<typename Representation, typename Algorithm>
void generic_compute_pairing( std::string input_filename,
std::string output_filename,
- bool use_binary,
- bool verbose,
+ bool use_binary,
+ bool verbose,
bool dualize ) {
phat::boundary_matrix< Representation > matrix;
@@ -95,7 +95,7 @@ void generic_compute_pairing( std::string input_filename,
double read_timer = omp_get_wtime();
if( use_binary ) {
- LOG( "Reading input file " << input_filename << " in binary mode" )
+ LOG( "Reading input file " << input_filename << " in binary mode" )
read_successful = matrix.load_binary( input_filename );
} else {
LOG( "Reading input file " << input_filename << " in ascii mode" )
@@ -134,8 +134,8 @@ void generic_compute_pairing( std::string input_filename,
int main( int argc, char** argv )
{
bool use_binary = true; // interpret input as binary or ascii file
- Representation_type rep_type = SPARSE_PIVOT; // representation class
- Algorithm_type reduction = TWIST; // reduction algorithm
+ Representation_type rep_type = BIT_TREE_PIVOT_COLUMN; // representation class
+ Algorithm_type reduction = CHUNK; // reduction algorithm
std::string input_filename; // name of file that contains the boundary matrix
std::string output_filename; // name of file that will contain the persistence pairs
bool verbose = false; // print timings / info
@@ -144,35 +144,35 @@ int main( int argc, char** argv )
parse_command_line( argc, argv, use_binary, rep_type, reduction, input_filename, output_filename, verbose, dualize );
switch( rep_type ) {
- case VEC_VEC: switch( reduction ) {
+ case VECTOR_VECTOR: switch( reduction ) {
case STANDARD: CALL_GENERIC_CODE(phat::vector_vector, phat::standard_reduction) break;
case TWIST: CALL_GENERIC_CODE(phat::vector_vector, phat::twist_reduction) break;
case ROW: CALL_GENERIC_CODE(phat::vector_vector, phat::row_reduction) break;
case CHUNK: CALL_GENERIC_CODE(phat::vector_vector, phat::chunk_reduction) break;
} break;
- case VEC_SET: switch( reduction ) {
+ case VECTOR_SET: switch( reduction ) {
case STANDARD: CALL_GENERIC_CODE(phat::vector_set, phat::standard_reduction) break;
case TWIST: CALL_GENERIC_CODE(phat::vector_set, phat::twist_reduction) break;
case ROW: CALL_GENERIC_CODE(phat::vector_set, phat::row_reduction) break;
case CHUNK: CALL_GENERIC_CODE(phat::vector_set, phat::chunk_reduction) break;
} break;
- case FULL_PIVOT: switch( reduction ) {
+ case FULL_PIVOT_COLUMN: switch( reduction ) {
case STANDARD: CALL_GENERIC_CODE(phat::full_pivot_column, phat::standard_reduction) break;
case TWIST: CALL_GENERIC_CODE(phat::full_pivot_column, phat::twist_reduction) break;
case ROW: CALL_GENERIC_CODE(phat::full_pivot_column, phat::row_reduction) break;
case CHUNK: CALL_GENERIC_CODE(phat::full_pivot_column, phat::chunk_reduction) break;
} break;
- case BIT_TREE_PIVOT: switch( reduction ) {
- case STANDARD: CALL_GENERIC_CODE(phat::bit_tree_pivot_column, phat::standard_reduction) break;
+ case BIT_TREE_PIVOT_COLUMN: switch( reduction ) {
+ case STANDARD: CALL_GENERIC_CODE(phat::bit_tree_pivot_column, phat::standard_reduction) break;
case TWIST: CALL_GENERIC_CODE(phat::bit_tree_pivot_column, phat::twist_reduction) break;
case ROW: CALL_GENERIC_CODE(phat::bit_tree_pivot_column, phat::row_reduction) break;
case CHUNK: CALL_GENERIC_CODE(phat::bit_tree_pivot_column, phat::chunk_reduction) break;
} break;
- case SPARSE_PIVOT: switch( reduction ) {
+ case SPARSE_PIVOT_COLUMN: switch( reduction ) {
case STANDARD: CALL_GENERIC_CODE(phat::sparse_pivot_column, phat::standard_reduction) break;
case TWIST: CALL_GENERIC_CODE(phat::sparse_pivot_column, phat::twist_reduction) break;
case ROW: CALL_GENERIC_CODE(phat::sparse_pivot_column, phat::row_reduction) break;