本文整理汇总了C++中Cone::compute方法的典型用法代码示例。如果您正苦于以下问题:C++ Cone::compute方法的具体用法?C++ Cone::compute怎么用?C++ Cone::compute使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Cone
的用法示例。
在下文中一共展示了Cone::compute方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: exit
template<typename Integer> int process_data(OptionsHandler& options) {
#ifndef NCATCH
try {
#endif
Output<Integer> Out; //all the information relevant for output is collected in this object
options.applyOutputOptions(Out);
string name_in=options.getOutputName()+".in";
const char* file_in=name_in.c_str();
ifstream in;
in.open(file_in,ifstream::in);
if ( !in.is_open() ) {
cerr << "error: Failed to open file "<<name_in<<"."<<endl;
exit(1);
}
//read the file
map <Type::InputType, vector< vector<Integer> > > input = readNormalizInput<Integer>(in, options);
options.activateDefaultMode(); // only if no real cone property is given!
Out.set_lattice_ideal_input(input.count(Type::lattice_ideal)>0);
in.close();
if (verbose) {
cout << "************************************************************" << endl;
cout << "Compute: " << options.getToCompute() << endl;
}
Cone<Integer> MyCone = Cone<Integer>(input);
if (options.isUseBigInteger()) {
MyCone.deactivateChangeOfPrecision();
}
// MyCone.compute(ConeProperty::HilbertBasis,ConeProperty::HilbertSeries));
try {
MyCone.compute(options.getToCompute());
} catch(const NotComputableException& ) {
std::cout << "Not all desired properties could be computed." << endl;
std::cout << "Writing only available data." << endl;
}
Out.setCone(MyCone);
Out.write_files();
#ifndef NCATCH
} catch(const BadInputException& ) {
cerr << "BadInputException caught... exiting." << endl;
exit(1);
} catch(const FatalException& e) {
cerr << e.what() << endl;
cerr << "FatalException caught... exiting." << endl;
exit(2);
} catch(const NormalizException& ) {
cerr << "NormalizException caught... exiting." << endl;
exit(3);
} catch(const std::exception& e) {
cerr << "std::exception caught... \""<< e.what()<<"\" ... exiting." << endl;
exit(4);
}
#endif
return 0;
}