contrib/brl/bbas/bsta/io/bsta_io_gaussian_sphere.h

Go to the documentation of this file.
00001 // This is brl/bbas/bsta/io/bsta_io_gaussian_sphere.h
00002 #ifndef bsta_io_gaussian_sphere_h_
00003 #define bsta_io_gaussian_sphere_h_
00004 //:
00005 // \file
00006 // \brief Binary I/O for spherical gaussians
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_gaussian_sphere.h>
00016 #include <vsl/vsl_binary_io.h>
00017 #include <vnl/io/vnl_io_vector_fixed.h>
00018 
00019 //: Binary save bsta_gaussian_sphere to stream.
00020 template <class T, unsigned n>
00021 void
00022 vsl_b_write(vsl_b_ostream &os, const bsta_gaussian_sphere<T,n>& g)
00023 {
00024   vsl_b_write(os,g.mean());
00025   vsl_b_write(os,g.var());
00026 }
00027 
00028 //: Binary load bsta_gaussian_sphere from stream.
00029 template <class T, unsigned n>
00030 void
00031 vsl_b_read(vsl_b_istream &is, bsta_gaussian_sphere<T,n>& g)
00032 {
00033   typedef typename bsta_gaussian_sphere<T,n>::vector_type vector_;
00034   vector_ mean;
00035   T var;
00036   vsl_b_read(is, mean);
00037   vsl_b_read(is, var);
00038   g.set_mean(mean);
00039   g.set_var(var);
00040 }
00041 
00042 //: Print summary
00043 template <class T, unsigned n>
00044 void
00045 vsl_print_summary(vcl_ostream &os, const bsta_gaussian_sphere<T,n>& g)
00046 {
00047   os << "Gaussian (sphere) mean:"<<g.mean()<<" var:"<<g.var();
00048 }
00049 
00050 
00051 #endif // bsta_io_gaussian_sphere_h_

Generated on Mon Mar 8 05:30:33 2010 for contrib/brl/bbas/bsta by  doxygen 1.5.1