Auxiliary data structure to unify weights of acoustics data according to the number of pings per emitter.  
 More...
#include <JAcousticsToolkit.hh>
 | 
| template<class T >  | 
|   | JWeight (T __begin, T __end) | 
|   | Constructor.  
  | 
|   | 
| double  | operator() (const int id) const | 
|   | Get weight.  
  | 
|   | 
 | 
| static bool  | getUnify () | 
|   | Get option to unify weights.  
  | 
|   | 
| static void  | setUnify (const bool unify) | 
|   | Set option to unify weights.  
  | 
|   | 
 | 
| static bool &  | get_unify () | 
|   | Get option to unify weights.  
  | 
|   | 
Auxiliary data structure to unify weights of acoustics data according to the number of pings per emitter. 
The default option is to unify the weights. 
Definition at line 53 of file JAcousticsToolkit.hh.
 
◆ JWeight()
template<class T > 
  
  
      
        
          | JACOUSTICS::JWeight::JWeight  | 
          ( | 
          T |           __begin,  | 
         
        
           | 
           | 
          T |           __end ) | 
         
       
   | 
  
inline   | 
  
 
Constructor. 
- Parameters
 - 
  
    | __begin | begin of data  | 
    | __end | end of data  | 
  
   
Definition at line 63 of file JAcousticsToolkit.hh.
   63                                :
   64      min(std::numeric_limits<size_t>::max())
 
   65    {
   66      for (T i = __begin; i != __end; ++i) {
   67        (*this)[i->getID()] += 1;
   68      }
   69 
   70      for (const_iterator i = this->begin(); i != this->end(); ++i) {
   71        if (i->second < 
min) {
 
   73        }
   74      }
   75    }
 
 
 
◆ getUnify()
  
  
      
        
          | static bool JACOUSTICS::JWeight::getUnify  | 
          ( | 
           | ) | 
           | 
         
       
   | 
  
inlinestatic   | 
  
 
Get option to unify weights. 
- Returns
 - option 
 
Definition at line 83 of file JAcousticsToolkit.hh.
   84    {
   86    }
static bool & get_unify()
Get option to unify weights.
 
 
 
 
◆ setUnify()
  
  
      
        
          | static void JACOUSTICS::JWeight::setUnify  | 
          ( | 
          const bool |           unify | ) | 
           | 
         
       
   | 
  
inlinestatic   | 
  
 
 
◆ operator()()
  
  
      
        
          | double JACOUSTICS::JWeight::operator()  | 
          ( | 
          const int |           id | ) | 
           const | 
         
       
   | 
  
inline   | 
  
 
Get weight. 
- Parameters
 - 
  
  
 
- Returns
 - weight 
 
Definition at line 106 of file JAcousticsToolkit.hh.
  107    {
  109        
  110        const_iterator p = this->find(id);
  111 
  112        if (p != this->end())
  113          return (
double) 
min / (double) p->second;
 
  114        else
  116 
  117      } else {
  118 
  119        return 1.0;
  120      }
  121    }
#define THROW(JException_t, A)
Marco for throwing exception with std::ostream compatible message.
 
Exception for accessing a value in a collection that is outside of its range.
 
static bool getUnify()
Get option to unify weights.
 
 
 
 
◆ get_unify()
  
  
      
        
          | static bool & JACOUSTICS::JWeight::get_unify  | 
          ( | 
           | ) | 
           | 
         
       
   | 
  
inlinestaticprivate   | 
  
 
Get option to unify weights. 
- Returns
 - option 
 
Definition at line 129 of file JAcousticsToolkit.hh.
  130    {
  131      static bool unify = true;
  132 
  133      return unify;
  134    }
 
 
 
◆ min
  
  
      
        
          | size_t JACOUSTICS::JWeight::min | 
         
       
   | 
  
private   | 
  
 
 
The documentation for this struct was generated from the following file: