00001 // This is brl/bbas/bsta/io/bsta_io_beta.h 00002 #ifndef bsta_io_beta_h_ 00003 #define bsta_io_beta_h_ 00004 //: 00005 // \file 00006 // \brief Binary I/O for full betas 00007 // \author Matt Leotta (mleotta@lems.brown.edu) 00008 // \date March 28, 2006 00009 // 00010 // \verbatim 00011 // Modifications 00012 // <none yet> 00013 // \endverbatim 00014 00015 #include <bsta/bsta_beta.h> 00016 #include <vsl/vsl_binary_io.h> 00017 #include <vnl/io/vnl_io_vector_fixed.h> 00018 #include <vnl/io/vnl_io_matrix_fixed.h> 00019 #include <vcl_iostream.h> 00020 00021 //: Binary save bsta_beta to stream. 00022 template <class T> 00023 void 00024 vsl_b_write(vsl_b_ostream &os, const bsta_beta<T>& g) 00025 { 00026 vsl_b_write(os,g.alpha()); 00027 vsl_b_write(os,g.beta()); 00028 } 00029 00030 //: Binary load bsta_beta from stream. 00031 template <class T> 00032 void 00033 vsl_b_read(vsl_b_istream &is, bsta_beta<T>& g) 00034 { 00035 T alpha; 00036 T beta; 00037 vsl_b_read(is, alpha); 00038 vsl_b_read(is, beta); 00039 g.set_alpha_beta(alpha, beta); 00040 } 00041 00042 //: Print summary 00043 template <class T> 00044 void 00045 vsl_print_summary(vcl_ostream &os, const bsta_beta<T>& g) 00046 { 00047 os << "Beta - alpha:"<<g.alpha()<<" beta:"<<g.beta(); 00048 } 00049 00050 00051 #endif // bsta_io_beta_h_