inline boost::filesystem::path complete_path( boost::filesystem::path const& p) { #if BOOST_FILESYSTEM_VERSION >= 3 return boost::HPX_FILESYSTEM3::complete(p, initial_path()); #else return boost::filesystem::complete(p, initial_path()); #endif }
inline boost::filesystem::path canonical_path( boost::filesystem::path const& p, boost::system::error_code& ec) { #if BOOST_VERSION > 104900 && BOOST_FILESYSTEM_VERSION >= 3 return boost::filesystem::canonical(p, initial_path(), ec); #else return resolve(p, initial_path()); #endif }
// Run the block substitution algorithm to generate an improved consensus sequence std::string run_block_substitution(const std::string& base, const std::vector<HMMInputData>& input, const std::vector<std::string>& alts) { std::string result = base; // assume models for all the reads have the same k assert(!input.empty()); const uint32_t k = input[0].read->pore_model[input[0].strand].k; uint32_t max_rounds = 6; uint32_t round = 0; while(round++ < max_rounds) { PathConsVector paths; PathCons initial_path(result); paths.push_back(initial_path); generate_alt_paths(paths, result, alts, k); score_paths(paths, input); if(paths[0].path == result) break; result = paths[0].path; } return result; }
int main(int argc, char ** argv) { /* all in one initialize */ initialize(argc, argv); /* whole-search loop */ for(;;) { /* create initial-path by each mode */ initial_path(); /* search-turn loop */ for(;;) { /* search */ search(); /* counting turn-num */ num_counter(TURN_COUNTER, ADD); /* search-turn terminate */ if(loop_terminate() == YES) {break;} } /* counting turn-num */ num_counter(SEARCH_COUNTER, ADD); /* whole-search-terminate */ if(search_terminate() == YES) {break;} } /* finalize procedure */ finalize(); return 0; }
include_paths() : was_sys_include_path(false), current_dir(initial_path()), current_rel_dir(initial_path()) {}
namespace filesystem { // query functions ---------------------------------------------------------// bool exists( const path & ph ); bool is_directory( const path & ph ); // VC++ 7.0 and earlier has a serious namespace bug that causes a clash // between boost::filesystem::is_empty and the unrelated type trait // boost::is_empty. The workaround for those who must use broken versions // of VC++ is to use the function _is_empty. All others should use the // correct is_empty name. bool _is_empty( const path & ph ); // deprecated # if !defined( BOOST_MSVC ) || BOOST_MSVC > 1300 inline bool is_empty( const path & ph ) { return _is_empty( ph ); } # endif // operations --------------------------------------------------------------// void create_directory( const path & directory_ph ); bool remove( const path & ph ); unsigned long remove_all( const path & ph ); void rename( const path & from_path, const path & to_path ); void copy_file( const path & from_file_ph, const path & to_file_ph ); path current_path(); const path & initial_path(); path system_complete( const path & ph ); path complete( const path & ph, const path & base = initial_path() ); // directory_iterator ------------------------------------------------------// class directory_iterator : public boost::iterator< std::input_iterator_tag, path, std::ptrdiff_t, const path *, const path & > { private: typedef directory_iterator self; public: directory_iterator(); // creates the "end" iterator explicit directory_iterator( const path & p ); reference operator*() const { return m_deref(); } pointer operator->() const { return &m_deref(); } self & operator++() { m_inc(); return *this; } friend bool operator==( const self & x, const self & y ) { return x.m_imp == y.m_imp; } friend bool operator!=( const self & x, const self & y ) { return !(x.m_imp == y.m_imp); } struct path_proxy // allows *i++ to work, as required by std { path pv; explicit path_proxy( const path & p ) : pv(p) {} path operator*() const { return pv; } }; path_proxy operator++(int) { path_proxy pp( m_deref() ); ++*this; return pp; } private: class dir_itr_imp; // shared_ptr provides shallow-copy semantics required for InputIterators typedef boost::shared_ptr< dir_itr_imp > m_imp_ptr; m_imp_ptr m_imp; reference m_deref() const; void m_inc(); }; } // namespace filesystem