contrib/brl/bbas/bsta/io/bsta_io_von_mises.h
Go to the documentation of this file.
00001 // This is brl/bbas/bsta/io/bsta_io_von_mises.h
00002 #ifndef bsta_io_von_mises_h_
00003 #define bsta_io_von_mises_h_
00004 //:
00005 // \file
00006 // \brief Binary I/O for spherical parzen windows
00007 // \author Joseph L. Mundy
00008 // \date October 12, 2008
00009 //
00010 // \verbatim
00011 //  Modifications
00012 // \endverbatim
00013 // Do not remove the following statement
00014 // Approved for Public Release, Distribution Unlimited (DISTAR Case 12529)
00015 //
00016 #include <bsta/bsta_von_mises.h>
00017 #include <bsta/bsta_parzen.h>
00018 #include <vsl/vsl_binary_io.h>
00019 #include <vnl/io/vnl_io_vector_fixed.h>
00020 #include <vcl_iostream.h>
00021 
00022 //: Binary save bsta_von_mises to stream.
00023 template <class T, unsigned n>
00024 void
00025 vsl_b_write(vsl_b_ostream &os, const bsta_von_mises<T,n>& vm)
00026 {
00027   vsl_b_write(os,vm.kappa());
00028 
00029   vsl_b_write(os,vm.mean());
00030 }
00031 
00032 //: Binary load bsta_von_mises from stream.
00033 template <class T, unsigned n>
00034 void
00035 vsl_b_read(vsl_b_istream &is, bsta_von_mises<T,n>& vm)
00036 {
00037   typename bsta_parzen<T,n>::vector_type mean;
00038   T kappa;
00039   vsl_b_read(is, kappa);
00040   vsl_b_read(is, mean);
00041   vm.set_kappa(kappa);
00042   vm.set_mean(mean);
00043 }
00044 
00045 //: Print summary
00046 template <class T, unsigned n>
00047 void
00048 vsl_print_summary(vcl_ostream &os, const bsta_von_mises<T,n>& vm)
00049 {
00050   os << "von_mises  mean:"<<vm.mean()<<" n_samples"<<vm.size();
00051 }
00052 
00053 
00054 #endif // bsta_io_von_mises_h_