aboutsummaryrefslogtreecommitdiffstats
path: root/interface
diff options
context:
space:
mode:
authorastrojhgu <astrojhgu@ed2142bd-67ad-457f-ba7c-d818d4011675>2012-09-28 17:40:13 +0000
committerastrojhgu <astrojhgu@ed2142bd-67ad-457f-ba7c-d818d4011675>2012-09-28 17:40:13 +0000
commit03fed9caf531c13f5a6d8ba4b581f980fab2c8e6 (patch)
treec4ad5a60c764b16ef51eea85bf66ba99a4252416 /interface
parent3e12a1047ff1e9cfeab0b2b659563fa5042c0dfb (diff)
downloadopt-utilities-03fed9caf531c13f5a6d8ba4b581f980fab2c8e6.tar.bz2
ostream<<fitter()
git-svn-id: file:///home/svn/opt_utilities@247 ed2142bd-67ad-457f-ba7c-d818d4011675
Diffstat (limited to 'interface')
-rw-r--r--interface/opt_io.hpp55
1 files changed, 52 insertions, 3 deletions
diff --git a/interface/opt_io.hpp b/interface/opt_io.hpp
index f7b68d8..f81a14e 100644
--- a/interface/opt_io.hpp
+++ b/interface/opt_io.hpp
@@ -5,17 +5,17 @@
#include "core/fitter.hpp"
-namespace std
+namespace opt_utilities
{
template <typename Ty,typename Tx>
- std::ostream& operator<<(std::ostream& os,const opt_utilities::data<Ty,Tx>& d)
+ std::ostream& operator<<(std::ostream& os,const data<Ty,Tx>& d)
{
os<<d.get_x()<<"("<<-std::abs(d.get_x_lower_err())<<",+"<<std::abs(d.get_x_upper_err())<<") "<<d.get_y()<<"("<<-std::abs(d.get_y_lower_err())<<",+"<<std::abs(d.get_y_upper_err())<<") ";
return os;
}
template <typename Ty,typename Tx>
- std::ostream& operator<<(std::ostream& os,const opt_utilities::data_set<Ty,Tx>& ds)
+ std::ostream& operator<<(std::ostream& os,const data_set<Ty,Tx>& ds)
{
os<<"data set with size of "<<ds.size()<<"\n"
<<"[\n";
@@ -24,8 +24,57 @@ namespace std
{
os<<ds.get_data(i)<<"\n";
}
+ os<<"...\n";
+ os<<"...\n";
+ os<<"...\n";
os<<"]";
return os;
}
+
+ template<typename Ty,typename Tx,typename Tp,typename Ts,typename Tstr>
+ std::ostream& operator<<(std::ostream& os,const fitter<Ty,Tx,Tp,Ts,Tstr>& f)
+ {
+ os<<"Fitting session:\n";
+ os<<"Model:";
+ try
+ {
+ os<<f.get_model().get_type_name()<<"\n";
+ }
+ catch(const model_not_defined& e)
+ {
+ os<<"Undefined\n";
+ }
+ os<<"Statistic:";
+ try
+ {
+ os<<f.get_statistic().get_type_name()<<"\n";
+ }
+ catch(const statistic_not_defined& e)
+ {
+ os<<"Undefined\n";
+ }
+
+ os<<"Opt method:";
+ try
+ {
+ os<<f.get_opt_method().get_type_name()<<"\n";
+ }
+ catch(const opt_method_not_defined& e)
+ {
+ os<<"Undefined\n";
+ }
+
+ os<<"Data set:";
+ try
+ {
+ os<<f.get_data_set().get_type_name()<<"\n";
+ os<<f.get_data_set()<<"\n";
+ }
+ catch(const data_not_loaded& e)
+ {
+ os<<"Undefined\n";
+ }
+ return os;
+ }
}
#endif