Go to the documentation of this file.00001
00002 #ifndef bsta_io_parzen_sphere_h_
00003 #define bsta_io_parzen_sphere_h_
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #include <bsta/bsta_parzen_sphere.h>
00018 #include <vsl/vsl_binary_io.h>
00019 #include <vnl/io/vnl_io_vector_fixed.h>
00020 #include <vsl/vsl_vector_io.h>
00021 #include <vcl_iostream.h>
00022
00023
00024 template <class T, unsigned n>
00025 void
00026 vsl_b_write(vsl_b_ostream &os, const bsta_parzen_sphere<T,n>& g)
00027 {
00028 vsl_b_write(os,g.bandwidth());
00029
00030 typedef typename bsta_parzen<T,n>::vector_type vector_;
00031
00032 vcl_vector<vector_> samples = g.samples();
00033
00034 vsl_b_write(os,samples);
00035 }
00036
00037
00038 template <class T, unsigned n>
00039 void
00040 vsl_b_read(vsl_b_istream &is, bsta_parzen_sphere<T,n>& g)
00041 {
00042 typedef typename bsta_parzen<T,n>::vector_type vector_;
00043 vcl_vector<vector_> samples;
00044 T bandwidth;
00045 vsl_b_read(is, bandwidth);
00046 vsl_b_read(is, samples);
00047 g.set_bandwidth(bandwidth);
00048 g.insert_samples(samples);
00049 }
00050
00051
00052 template <class T, unsigned n>
00053 void
00054 vsl_print_summary(vcl_ostream &os, const bsta_parzen_sphere<T,n>& g)
00055 {
00056 os << "parzen (sphere) mean:"<<g.mean()<<" n_samples"<<g.size();
00057 }
00058
00059
00060 #endif // bsta_io_parzen_sphere_h_