scattering_lambert.h

00001 
00005 #pragma once
00006 
00007 #include <usml/ocean/scattering_model.h>
00008 
00009 namespace usml {
00010 namespace ocean {
00011 
00012 using namespace usml::ublas ;
00013 using namespace usml::types ;
00014 
00015 using boost::numeric::ublas::vector;
00016 
00019 
00043 class USML_DECLSPEC scattering_lambert : public scattering_model {
00044 
00045 public:
00046 
00054     scattering_lambert( double bss = -27.0 ) :
00055         _coeff(pow(10.0,bss/10.0)) {}
00056 
00068         virtual void scattering( const wposition1& location,
00069                 const seq_vector& frequencies, double de_incident, double de_scattered,
00070                 double az_incident, double az_scattered, vector<double>* amplitude )
00071         {
00072                 noalias(*amplitude) = scalar_vector<double>( frequencies.size(),
00073                                 abs( _coeff * sin( de_incident ) * sin( de_scattered ) ) ) ;
00074                                 // fast assignment of scalar to vector
00075         }
00076 
00092     virtual void scattering( const wposition& location,
00093         const seq_vector& frequencies, double de_incident, matrix<double> de_scattered,
00094         double az_incident, matrix<double> az_scattered,
00095                 matrix< vector<double> >* amplitude )
00096     {
00097         for (size_t n = 0; n < location.size1 (); ++n ) {
00098                 for (size_t m = 0; m < location.size2 (); ++ m) {
00099                         (*amplitude).operator()(n,m) = scalar_vector<double>(
00100                                         frequencies.size(),
00101                                         abs( _coeff * sin(de_incident) * sin(de_scattered(n,m)) ) ) ;
00102                 }
00103         }
00104     }
00105 
00106 private:
00107 
00111         double _coeff ;
00112 };
00113 
00115 }   // end of namespace ocean
00116 }   // end of namespace usml

Generated on 4 May 2015 for USML by  doxygen 1.6.1