From feb0c9dde9bbda9a2ecfa3bc30893610801fb001 Mon Sep 17 00:00:00 2001 From: David Mayerich Date: Thu, 8 Dec 2016 12:34:49 -0600 Subject: [PATCH] network processing for distance fields - debugging --- stim/image/image.h | 11 ----------- stim/parser/arguments.h | 102 +++++++++++++++++++++++++++++++++++++++++++++++++++++------------------------------------------------- stim/structures/kdtree.cuh | 2 +- 3 files changed, 54 insertions(+), 61 deletions(-) diff --git a/stim/image/image.h b/stim/image/image.h index abea2e8..543d102 100644 --- a/stim/image/image.h +++ b/stim/image/image.h @@ -76,17 +76,6 @@ class image{ /// Returns the value for "white" based on the dynamic range (assumes white is 1.0 for floating point images) T white(){ return std::numeric_limits::max(); - //if(typeid(T) == typeid(unsigned char)) return UCHAR_MAX; - //if(typeid(T) == typeid(unsigned short)) return SHRT_MAX; - //if(typeid(T) == typeid(unsigned)) return UINT_MAX; - //if(typeid(T) == typeid(unsigned long)) return ULONG_MAX; - //if(typeid(T) == typeid(unsigned long long)) return ULLONG_MAX; - //if(typeid(T) == typeid(float)) return 1.0f; - //if(typeid(T) == typeid(double)) return 1.0; - - std::cout<<"ERROR in stim::image::white - no white value known for this data type"< #endif +/**The arglist class implements command line arguments. + Example: + + 1) Create an arglist instance: + + stim::arglist args; + + 2) Add arguments: + + args.add("help", "prints this help"); + args.add("foo", "foo takes a single integer value", "", "[intval]"); + args.add("bar", "bar takes two floating point values", "", "[value1], [value2]"); + + 3) Parse the command line: + + args.parse(argc, argv); + + 4) You generally want to immediately test for help and output available arguments: + + if(args["help"].is_set()) + std::cout< arg_vector(){ return args; } - ///Returns an object describing the argument - - /// @param _name is the name of the requested argument - cmd_option operator[](std::string _name){ - std::vector::iterator it; - it = find(opts.begin(), opts.end(), _name);// - opts.begin(); + ///Returns an object describing the argument - if(it == opts.end()){ - std::cout<<"ERROR - Unspecified parameter name: "<<_name<::iterator it; + it = find(opts.begin(), opts.end(), _name);// - opts.begin(); - return *it; + if(it == opts.end()){ + std::cout<<"ERROR - Unspecified parameter name: "<<_name<(bb, h_reference_points, reference_count); - std::vector > reference_points(reference_count); // restore the reference points in particular way + std::vector < typename kdtree::point > reference_points(reference_count); // restore the reference points in particular way for (size_t j = 0; j < reference_count; j++) for (size_t i = 0; i < D; i++) reference_points[j].dim[i] = h_reference_points[j * D + i]; -- libgit2 0.21.4