Jpp
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Classes | Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Static Private Member Functions | Friends | List of all members
JACOUSTICS::JModel Struct Reference

Model for fit to acoustics data. More...

#include <JModel.hh>

Inheritance diagram for JACOUSTICS::JModel:
JMATH::JMath< JModel > JLANG::JEquals< JModel > JTOOLS::JHashMapToolkit

Classes

struct  emitter_map
 Map emitter key to model parameters of emitter. More...
 
struct  JEmitter
 Emitter parameters. More...
 
struct  JString
 String parameters. More...
 
struct  string_map
 Map string identifier to model parameters of string. More...
 

Public Types

typedef size_t parameter_type
 Type definition of fit parameter. More...
 

Public Member Functions

 JModel ()
 Default constructor. More...
 
template<class T >
 JModel (T __begin, T __end)
 Constructor. More...
 
JModeloperator= (const JMATH::JZero &zero)
 Reset. More...
 
void clear ()
 Clear parameters. More...
 
void reset ()
 Reset parameters. More...
 
template<class T >
void set (const JModel &model, const T &value)
 Set parameters. More...
 
JModelnegate ()
 Negate model. More...
 
JModeladd (const JModel &model)
 Add model. More...
 
JModelsub (const JModel &model)
 Subtract model. More...
 
JModelmul (const double factor)
 Scale model. More...
 
JModeldiv (const double factor)
 Scale model. More...
 
bool equals (const JModel &model, const double precision=std::numeric_limits< double >::min()) const
 Check equality. More...
 
size_t getN () const
 Get number of fit parameters. More...
 
size_t getIndex (int id, double JString::*p) const
 Get index of fit parameter for given string. More...
 
size_t getIndex (const JEKey &id, double JEmitter::*p) const
 Get index of fir parameter for given emitter. More...
 
double operator[] (const size_t index) const
 Read/write access to fit parameter value by index. More...
 
double & operator[] (const size_t index)
 Read/write access to fit parameter value by index. More...
 
JModelmul (const JNullType &object)
 Multiply with object. More...
 

Static Public Member Functions

template<class JKey_t , class JValue_t , class JEvaluator_t >
static void reset (JHashMap< JKey_t, JValue_t, JEvaluator_t > &buffer)
 Reset buffer. More...
 
template<class JKey_t , class JValue_t , class JEvaluator_t >
static void set (JHashMap< JKey_t, JValue_t, JEvaluator_t > &target, const JHashMap< JKey_t, JValue_t, JEvaluator_t > &source, const JValue_t &value)
 Set values in target corresponding to keys in source. More...
 
template<class JKey_t , class JValue_t , class JEvaluator_t >
static void evaluate (JHashMap< JKey_t, JValue_t, JEvaluator_t > &buffer, JValue_t &(JValue_t::*f1)())
 Evaluate arithmetic operation on buffer. More...
 
template<class JKey_t , class JValue_t , class JEvaluator_t >
static void evaluate (JHashMap< JKey_t, JValue_t, JEvaluator_t > &first, const JHashMap< JKey_t, JValue_t, JEvaluator_t > &second, JValue_t &(JValue_t::*f1)(const JValue_t &))
 Evaluate arithmetic operation on buffers. More...
 
template<class JKey_t , class JValue_t , class JEvaluator_t >
static void evaluate (JHashMap< JKey_t, JValue_t, JEvaluator_t > &buffer, JValue_t &(JValue_t::*f1)(const double), const double factor)
 Evaluate arithmetic operation on buffer. More...
 
template<class JKey_t , class JValue_t , class JEvaluator_t >
static bool equals (const JHashMap< JKey_t, JValue_t, JEvaluator_t > &first, const JHashMap< JKey_t, JValue_t, JEvaluator_t > &second)
 Check equality of buffers. More...
 
template<class JKey_t , class JValue_t , class JEvaluator_t >
static bool equals (const JHashMap< JKey_t, JValue_t, JEvaluator_t > &first, const JHashMap< JKey_t, JValue_t, JEvaluator_t > &second, const double precision)
 Check equality of buffers. More...
 

Public Attributes

JACOUSTICS::JModel::string_map string
 
JACOUSTICS::JModel::emitter_map emitter
 

Static Private Member Functions

template<class T >
static size_t getN ()
 Get number of fit parameters corresponding to given data structure. More...
 
template<class JKey_t , class JValue_t , class JEvaluator_t >
static size_t getN (const JHashMap< JKey_t, JValue_t, JEvaluator_t > &buffer)
 Get number of fit parameters corresponding to given buffer. More...
 
template<class T >
static size_t getIndex (double T::*p)
 Get index of fit parameter in given data structure. More...
 
template<class JKey_t , class JValue_t , class JEvaluator_t >
static double getParameter (const JHashMap< JKey_t, JValue_t, JEvaluator_t > &buffer, const size_t index)
 Get fit parameter value at given index in buffer. More...
 
template<class JKey_t , class JValue_t , class JEvaluator_t >
static double & getParameter (JHashMap< JKey_t, JValue_t, JEvaluator_t > &buffer, const size_t index)
 Get fit parameter value at given index in buffer. More...
 

Friends

std::ostream & operator<< (std::ostream &out, const JModel &model)
 Write model parameters to output stream. More...
 

Detailed Description

Model for fit to acoustics data.

The model consists of string parameters and emitter parameters.
These parameters relate to the string identifer and emitter key, respectively.

Definition at line 42 of file JAcoustics/JModel.hh.

Member Typedef Documentation

Type definition of fit parameter.

Definition at line 55 of file JAcoustics/JModel.hh.

Constructor & Destructor Documentation

JACOUSTICS::JModel::JModel ( )
inline

Default constructor.

Definition at line 341 of file JAcoustics/JModel.hh.

342  {}
template<class T >
JACOUSTICS::JModel::JModel ( T  __begin,
T  __end 
)
inline

Constructor.

This constructor can be used to set up a default model (i.e. all values at zero) for the given set of hits.
The data type corresponding to the hits should provide for the following policy methods.

   int      getString();        // get string  identifier
   JEkey    getEKey();          // get emitter identifier
Parameters
__beginbegin of hits
__endend of hits

Definition at line 359 of file JAcoustics/JModel.hh.

360  {
361  for (T hit = __begin; hit != __end; ++hit) {
362 
363  if (!this->string.has(hit->getString())) {
364  this->string[hit->getString()] = JString();
365  }
366 
367  if (!this->emitter.has(hit->getEKey())) {
368  this->emitter[hit->getEKey()] = JEmitter();
369  }
370  }
371  }
JACOUSTICS::JModel::emitter_map emitter
Acoustic emitter.
Definition: JEmitter.hh:27
do set_variable OUTPUT_DIRECTORY $WORKDIR T
bool has(const T &value) const
Test whether given value is present.

Member Function Documentation

JModel& JACOUSTICS::JModel::operator= ( const JMATH::JZero zero)
inline

Reset.

Parameters
zerozero
Returns
this model

Definition at line 380 of file JAcoustics/JModel.hh.

381  {
382  this->reset();
383 
384  return *this;
385  }
void reset()
Reset parameters.
void JACOUSTICS::JModel::clear ( )
inline

Clear parameters.

Definition at line 391 of file JAcoustics/JModel.hh.

392  {
393  string .clear();
394  emitter.clear();
395  }
JACOUSTICS::JModel::emitter_map emitter
virtual void clear()
Clear.
Definition: JHashMap.hh:106
void JACOUSTICS::JModel::reset ( )
inline

Reset parameters.

Definition at line 401 of file JAcoustics/JModel.hh.

402  {
403  reset(string);
404  reset(emitter);
405  }
JACOUSTICS::JModel::emitter_map emitter
void reset()
Reset parameters.
template<class T >
void JACOUSTICS::JModel::set ( const JModel model,
const T value 
)
inline

Set parameters.

Parameters
modelmodel
valuevalue

Definition at line 415 of file JAcoustics/JModel.hh.

416  {
417  set(this->string, model.string, static_cast<const JString&> (value));
418  set(this->emitter, model.emitter, static_cast<const JEmitter&>(value));
419  }
void set(const JModel &model, const T &value)
Set parameters.
JACOUSTICS::JModel::emitter_map emitter
JACOUSTICS::JModel::string_map string
JModel& JACOUSTICS::JModel::negate ( )
inline

Negate model.

Returns
this model

Definition at line 427 of file JAcoustics/JModel.hh.

428  {
429  evaluate(this->string, &JString ::negate);
431 
432  return *this;
433  }
static void evaluate(JHashMap< JKey_t, JValue_t, JEvaluator_t > &buffer, JValue_t &(JValue_t::*f1)())
Evaluate arithmetic operation on buffer.
JACOUSTICS::JModel::emitter_map emitter
JString & negate()
Negate string.
JEmitter & negate()
Negate emitter.
JModel& JACOUSTICS::JModel::add ( const JModel model)
inline

Add model.

Parameters
modelmodel
Returns
this model

Definition at line 442 of file JAcoustics/JModel.hh.

443  {
444  evaluate(this->string, model.string, &JString ::add);
445  evaluate(this->emitter, model.emitter, &JEmitter::add);
446 
447  return *this;
448  }
JEmitter & add(const JEmitter &emitter)
Add emitter.
static void evaluate(JHashMap< JKey_t, JValue_t, JEvaluator_t > &buffer, JValue_t &(JValue_t::*f1)())
Evaluate arithmetic operation on buffer.
JACOUSTICS::JModel::emitter_map emitter
JACOUSTICS::JModel::string_map string
JString & add(const JString &string)
Add string.
JModel& JACOUSTICS::JModel::sub ( const JModel model)
inline

Subtract model.

Parameters
modelmodel
Returns
this model

Definition at line 457 of file JAcoustics/JModel.hh.

458  {
459  evaluate(this->string, model.string, &JString ::sub);
460  evaluate(this->emitter, model.emitter, &JEmitter::sub);
461 
462  return *this;
463  }
static void evaluate(JHashMap< JKey_t, JValue_t, JEvaluator_t > &buffer, JValue_t &(JValue_t::*f1)())
Evaluate arithmetic operation on buffer.
JACOUSTICS::JModel::emitter_map emitter
JACOUSTICS::JModel::string_map string
JEmitter & sub(const JEmitter &emitter)
Subtract emitter.
JString & sub(const JString &string)
Subtract string.
JModel& JACOUSTICS::JModel::mul ( const double  factor)
inline

Scale model.

Parameters
factormultiplication factor
Returns
this model

Definition at line 472 of file JAcoustics/JModel.hh.

473  {
474  evaluate(this->string, &JString ::mul, factor);
475  evaluate(this->emitter, &JEmitter::mul, factor);
476 
477  return *this;
478  }
static void evaluate(JHashMap< JKey_t, JValue_t, JEvaluator_t > &buffer, JValue_t &(JValue_t::*f1)())
Evaluate arithmetic operation on buffer.
JEmitter & mul(const double factor)
Scale emitter.
JACOUSTICS::JModel::emitter_map emitter
JString & mul(const double factor)
Scale string.
JModel& JACOUSTICS::JModel::div ( const double  factor)
inline

Scale model.

Parameters
factordivision factor
Returns
this model

Definition at line 487 of file JAcoustics/JModel.hh.

488  {
489  evaluate(this->string, &JString ::div, factor);
490  evaluate(this->emitter, &JEmitter::div, factor);
491 
492  return *this;
493  }
static void evaluate(JHashMap< JKey_t, JValue_t, JEvaluator_t > &buffer, JValue_t &(JValue_t::*f1)())
Evaluate arithmetic operation on buffer.
JACOUSTICS::JModel::emitter_map emitter
JString & div(const double factor)
Scale string.
JEmitter & div(const double factor)
Scale emitter.
bool JACOUSTICS::JModel::equals ( const JModel model,
const double  precision = std::numeric_limits<double>::min() 
) const
inline

Check equality.

Parameters
modelmodel
precisionprecision
Returns
true if models are equal; else false

Definition at line 503 of file JAcoustics/JModel.hh.

505  {
506  return (equals(this->string, model.string, precision) &&
507  equals(this->emitter, model.emitter, precision));
508  }
bool equals(const JModel &model, const double precision=std::numeric_limits< double >::min()) const
Check equality.
JACOUSTICS::JModel::emitter_map emitter
JACOUSTICS::JModel::string_map string
size_t JACOUSTICS::JModel::getN ( ) const
inline

Get number of fit parameters.

Returns
number of parameters

Definition at line 540 of file JAcoustics/JModel.hh.

541  {
542  return getN(string) + getN(emitter);
543  }
size_t getN() const
Get number of fit parameters.
JACOUSTICS::JModel::emitter_map emitter
size_t JACOUSTICS::JModel::getIndex ( int  id,
double JString::*  p 
) const
inline

Get index of fit parameter for given string.

Parameters
idstring identifier
ppointer to data member
Returns
parameter

Definition at line 553 of file JAcoustics/JModel.hh.

554  {
555  if (string.has(id))
556  return string.getIndex(id) * getN<JString>() + getIndex(p);
557  else
558  THROW(JValueOutOfRange, "Invalid identifier " << id);
559  }
#define THROW(JException_t, A)
Marco for throwing exception with std::ostream compatible message.
Definition: JException.hh:670
size_t getIndex(int id, double JString::*p) const
Get index of fit parameter for given string.
size_t JACOUSTICS::JModel::getIndex ( const JEKey id,
double JEmitter::*  p 
) const
inline

Get index of fir parameter for given emitter.

Parameters
idemitter identifier
ppointer to data member
Returns
parameter

Definition at line 569 of file JAcoustics/JModel.hh.

570  {
571  if (emitter.has(id))
572  return getN(string) + emitter.getIndex(id) * getN<JEmitter>() + getIndex(p);
573  else
574  THROW(JValueOutOfRange, "Invalid identifier " << id);
575  }
size_t getN() const
Get number of fit parameters.
#define THROW(JException_t, A)
Marco for throwing exception with std::ostream compatible message.
Definition: JException.hh:670
int getIndex(const T &value) const
Get index of given value.
JACOUSTICS::JModel::emitter_map emitter
size_t getIndex(int id, double JString::*p) const
Get index of fit parameter for given string.
bool has(const T &value) const
Test whether given value is present.
double JACOUSTICS::JModel::operator[] ( const size_t  index) const
inline

Read/write access to fit parameter value by index.

Parameters
indexindex
Returns
value (zero if absent)

Definition at line 584 of file JAcoustics/JModel.hh.

585  {
586  size_t i = index;
587 
588  if (i < getN(string)) { return getParameter(string, i); }
589 
590  i -= getN(string);
591 
592  if (i < getN(emitter)) { return getParameter(emitter, i); }
593 
594  THROW(JIndexOutOfRange, "Invalid index " << index << " >= " << getN());
595  }
size_t getN() const
Get number of fit parameters.
#define THROW(JException_t, A)
Marco for throwing exception with std::ostream compatible message.
Definition: JException.hh:670
JACOUSTICS::JModel::emitter_map emitter
static double getParameter(const JHashMap< JKey_t, JValue_t, JEvaluator_t > &buffer, const size_t index)
Get fit parameter value at given index in buffer.
double& JACOUSTICS::JModel::operator[] ( const size_t  index)
inline

Read/write access to fit parameter value by index.

Parameters
indexindex
Returns
value

Definition at line 604 of file JAcoustics/JModel.hh.

605  {
606  size_t i = index;
607 
608  if (i < getN(string)) { return getParameter(string, i); }
609 
610  i -= getN(string);
611 
612  if (i < getN(emitter)) { return getParameter(emitter, i); }
613 
614  THROW(JIndexOutOfRange, "Invalid index " << index << " >= " << getN());
615  }
size_t getN() const
Get number of fit parameters.
#define THROW(JException_t, A)
Marco for throwing exception with std::ostream compatible message.
Definition: JException.hh:670
JACOUSTICS::JModel::emitter_map emitter
static double getParameter(const JHashMap< JKey_t, JValue_t, JEvaluator_t > &buffer, const size_t index)
Get fit parameter value at given index in buffer.
template<class T >
static size_t JACOUSTICS::JModel::getN ( )
inlinestaticprivate

Get number of fit parameters corresponding to given data structure.

Returns
number of parameters

Definition at line 691 of file JAcoustics/JModel.hh.

692  {
693  return sizeof(T) / sizeof(double);
694  }
do set_variable OUTPUT_DIRECTORY $WORKDIR T
template<class JKey_t , class JValue_t , class JEvaluator_t >
static size_t JACOUSTICS::JModel::getN ( const JHashMap< JKey_t, JValue_t, JEvaluator_t > &  buffer)
inlinestaticprivate

Get number of fit parameters corresponding to given buffer.

Parameters
bufferbuffer
Returns
number of parameters

Definition at line 704 of file JAcoustics/JModel.hh.

705  {
706  return buffer.size() * getN<JValue_t>();
707  }
template<class T >
static size_t JACOUSTICS::JModel::getIndex ( double T::*  p)
inlinestaticprivate

Get index of fit parameter in given data structure.

Parameters
ppointer to data member
Returns
index

Definition at line 717 of file JAcoustics/JModel.hh.

718  {
719  T* __p__ = NULL;
720 
721  return ((double*) &(__p__->*p) - (double*) __p__);
722  }
do set_variable OUTPUT_DIRECTORY $WORKDIR T
template<class JKey_t , class JValue_t , class JEvaluator_t >
static double JACOUSTICS::JModel::getParameter ( const JHashMap< JKey_t, JValue_t, JEvaluator_t > &  buffer,
const size_t  index 
)
inlinestaticprivate

Get fit parameter value at given index in buffer.

Parameters
bufferbuffer
indexindex
Returns
value

Definition at line 733 of file JAcoustics/JModel.hh.

734  {
735  const size_t pos = index / getN<JValue_t>(); // position of element in buffer
736  const size_t offset = index % getN<JValue_t>(); // offset of parameter in element
737 
738  const JValue_t& value = buffer.data()[pos].second; // value of element at given position
739 
740  return ((const double*) &value)[offset]; // parameter at given offset
741  }
template<class JKey_t , class JValue_t , class JEvaluator_t >
static double& JACOUSTICS::JModel::getParameter ( JHashMap< JKey_t, JValue_t, JEvaluator_t > &  buffer,
const size_t  index 
)
inlinestaticprivate

Get fit parameter value at given index in buffer.

Parameters
bufferbuffer
indexindex
Returns
value

Definition at line 752 of file JAcoustics/JModel.hh.

753  {
754  const size_t pos = index / getN<JValue_t>(); // position of element in buffer
755  const size_t offset = index % getN<JValue_t>(); // offset of parameter in element
756 
757  JValue_t& value = buffer.data()[pos].second; // value of element at given position
758 
759  return ((double*) &value)[offset]; // parameter at given offset
760  }
JModel & JMATH::JMath< JModel , JNullType >::mul ( const JNullType object)
inlineinherited

Multiply with object.

Parameters
objectobject
Returns
result object

Definition at line 273 of file JMath.hh.

274  {
275  return static_cast<JFirst_t&>(*this) = JCalculator<JFirst_t>::calculator.mul(static_cast<const JFirst_t&>(*this), object);
276  }
Auxiliary class for arithmetic operations on objects.
Definition: JCalculator.hh:18
template<class JKey_t , class JValue_t , class JEvaluator_t >
static void JTOOLS::JHashMapToolkit::reset ( JHashMap< JKey_t, JValue_t, JEvaluator_t > &  buffer)
inlinestaticinherited

Reset buffer.

Parameters
bufferbuffer

Definition at line 32 of file JHashMapToolkit.hh.

33  {
34  for (typename JHashMap<JKey_t, JValue_t, JEvaluator_t>::iterator i = buffer.begin(); i != buffer.end(); ++i) {
35  i->second = JValue_t();
36  }
37  }
container_type::iterator iterator
Definition: JHashMap.hh:87
template<class JKey_t , class JValue_t , class JEvaluator_t >
static void JTOOLS::JHashMapToolkit::set ( JHashMap< JKey_t, JValue_t, JEvaluator_t > &  target,
const JHashMap< JKey_t, JValue_t, JEvaluator_t > &  source,
const JValue_t &  value 
)
inlinestaticinherited

Set values in target corresponding to keys in source.

Parameters
targettarget buffer
sourcesource buffer
valuevalue

Definition at line 48 of file JHashMapToolkit.hh.

51  {
52  target.clear();
53 
54  for (typename JHashMap<JKey_t, JValue_t, JEvaluator_t>::const_iterator i = source.begin(); i != source.end(); ++i) {
55  target[i->first] = value;
56  }
57  }
virtual void clear()
Clear.
Definition: JHashMap.hh:106
container_type::const_iterator const_iterator
Definition: JHashMap.hh:85
template<class JKey_t , class JValue_t , class JEvaluator_t >
static void JTOOLS::JHashMapToolkit::evaluate ( JHashMap< JKey_t, JValue_t, JEvaluator_t > &  buffer,
JValue_t &(JValue_t::*)()  f1 
)
inlinestaticinherited

Evaluate arithmetic operation on buffer.

Parameters
bufferbuffer
f1operation

Definition at line 67 of file JHashMapToolkit.hh.

69  {
70  for (typename JHashMap<JKey_t, JValue_t, JEvaluator_t>::iterator i = buffer.begin(); i != buffer.end(); ++i) {
71  (i->second.*f1)();
72  }
73  }
container_type::iterator iterator
Definition: JHashMap.hh:87
template<class JKey_t , class JValue_t , class JEvaluator_t >
static void JTOOLS::JHashMapToolkit::evaluate ( JHashMap< JKey_t, JValue_t, JEvaluator_t > &  first,
const JHashMap< JKey_t, JValue_t, JEvaluator_t > &  second,
JValue_t &(JValue_t::*)(const JValue_t &)  f1 
)
inlinestaticinherited

Evaluate arithmetic operation on buffers.

Parameters
firstfirst buffer
secondsecond buffer
f1operation

Definition at line 84 of file JHashMapToolkit.hh.

87  {
88  for (typename JHashMap<JKey_t, JValue_t, JEvaluator_t>::const_iterator i = second.begin(); i != second.end(); ++i) {
89  (first[i->first].*f1)(i->second);
90  }
91  }
container_type::const_iterator const_iterator
Definition: JHashMap.hh:85
template<class JKey_t , class JValue_t , class JEvaluator_t >
static void JTOOLS::JHashMapToolkit::evaluate ( JHashMap< JKey_t, JValue_t, JEvaluator_t > &  buffer,
JValue_t &(JValue_t::*)(const double)  f1,
const double  factor 
)
inlinestaticinherited

Evaluate arithmetic operation on buffer.

Parameters
bufferbuffer
f1operation
factorfactor

Definition at line 102 of file JHashMapToolkit.hh.

105  {
106  for (typename JHashMap<JKey_t, JValue_t, JEvaluator_t>::iterator i = buffer.begin(); i != buffer.end(); ++i) {
107  (i->second.*f1)(factor);
108  }
109  }
container_type::iterator iterator
Definition: JHashMap.hh:87
template<class JKey_t , class JValue_t , class JEvaluator_t >
static bool JTOOLS::JHashMapToolkit::equals ( const JHashMap< JKey_t, JValue_t, JEvaluator_t > &  first,
const JHashMap< JKey_t, JValue_t, JEvaluator_t > &  second 
)
inlinestaticinherited

Check equality of buffers.

Parameters
firstfirst buffer
secondsecond buffer
Returns
true if buffers are equal; else false

Definition at line 120 of file JHashMapToolkit.hh.

122  {
124  p = first .begin(),
125  q = second.begin(); ; ++p, ++q) {
126 
127  if (p != first.end() && q != second.end()) {
128 
129  if (p->first != q->first || p->second != q->second) {
130  return false;
131  }
132 
133  } else if (p == first.end() && q == second.end()) {
134 
135  return true;
136 
137  } else {
138 
139  return false;
140  }
141  }
142  }
container_type::const_iterator const_iterator
Definition: JHashMap.hh:85
template<class JKey_t , class JValue_t , class JEvaluator_t >
static bool JTOOLS::JHashMapToolkit::equals ( const JHashMap< JKey_t, JValue_t, JEvaluator_t > &  first,
const JHashMap< JKey_t, JValue_t, JEvaluator_t > &  second,
const double  precision 
)
inlinestaticinherited

Check equality of buffers.

Parameters
firstfirst buffer
secondsecond buffer
precisionprecision
Returns
true if buffers are equal; else false

Definition at line 154 of file JHashMapToolkit.hh.

157  {
159  p = first .begin(),
160  q = second.begin(); ; ++p, ++q) {
161 
162  if (p != first.end() && q != second.end()) {
163 
164  if (p->first != q->first || !p->second.equals(q->second, precision)) {
165  return false;
166  }
167 
168  } else if (p == first.end() && q == second.end()) {
169 
170  return true;
171 
172  } else {
173 
174  return false;
175  }
176  }
177  }
container_type::const_iterator const_iterator
Definition: JHashMap.hh:85

Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  out,
const JModel model 
)
friend

Write model parameters to output stream.

Parameters
outoutput stream
modelmodel
Returns
output stream

Definition at line 518 of file JAcoustics/JModel.hh.

519  {
520  using namespace std;
521  using namespace JPP;
522 
523  for (JHashMap<int, JString>::const_iterator i = model.string.begin(); i != model.string.end(); ++i) {
524  out << "string: " << setw(4) << i->first << ' ' << i->second << endl;
525  }
526 
527  for (JHashMap<JEKey, JEmitter>::const_iterator i = model.emitter.begin(); i != model.emitter.end(); ++i) {
528  out << "emitter: " << setw(2) << i->first << ' ' << i->second << endl;
529  }
530 
531  return out;
532  }
JACOUSTICS::JModel::emitter_map emitter
JACOUSTICS::JModel::string_map string
container_type::const_iterator const_iterator
Definition: JHashMap.hh:85

Member Data Documentation

JACOUSTICS::JModel::string_map JACOUSTICS::JModel::string
JACOUSTICS::JModel::emitter_map JACOUSTICS::JModel::emitter

The documentation for this struct was generated from the following file: