Jpp
|
Model for fit to acoustics data. More...
#include <JModel.hh>
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... | |
JModel & | operator= (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... | |
JModel & | negate () |
Negate model. More... | |
JModel & | add (const JModel &model) |
Add model. More... | |
JModel & | sub (const JModel &model) |
Subtract model. More... | |
JModel & | mul (const double factor) |
Scale model. More... | |
JModel & | div (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... | |
JModel & | mul (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... | |
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.
typedef size_t JACOUSTICS::JModel::parameter_type |
Type definition of fit parameter.
Definition at line 55 of file JAcoustics/JModel.hh.
|
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
__begin | begin of hits |
__end | end of hits |
Definition at line 359 of file JAcoustics/JModel.hh.
|
inline |
|
inline |
Clear parameters.
Definition at line 391 of file JAcoustics/JModel.hh.
|
inline |
Reset parameters.
Definition at line 401 of file JAcoustics/JModel.hh.
Set parameters.
model | model |
value | value |
Definition at line 415 of file JAcoustics/JModel.hh.
|
inline |
Negate model.
Definition at line 427 of file JAcoustics/JModel.hh.
Add model.
model | model |
Definition at line 442 of file JAcoustics/JModel.hh.
Subtract model.
model | model |
Definition at line 457 of file JAcoustics/JModel.hh.
|
inline |
Scale model.
factor | multiplication factor |
Definition at line 472 of file JAcoustics/JModel.hh.
|
inline |
Scale model.
factor | division factor |
Definition at line 487 of file JAcoustics/JModel.hh.
|
inline |
Check equality.
model | model |
precision | precision |
Definition at line 503 of file JAcoustics/JModel.hh.
|
inline |
Get number of fit parameters.
Definition at line 540 of file JAcoustics/JModel.hh.
|
inline |
Get index of fit parameter for given string.
id | string identifier |
p | pointer to data member |
Definition at line 553 of file JAcoustics/JModel.hh.
|
inline |
Get index of fir parameter for given emitter.
id | emitter identifier |
p | pointer to data member |
Definition at line 569 of file JAcoustics/JModel.hh.
|
inline |
Read/write access to fit parameter value by index.
index | index |
Definition at line 584 of file JAcoustics/JModel.hh.
|
inline |
Read/write access to fit parameter value by index.
index | index |
Definition at line 604 of file JAcoustics/JModel.hh.
|
inlinestaticprivate |
Get number of fit parameters corresponding to given data structure.
Definition at line 691 of file JAcoustics/JModel.hh.
|
inlinestaticprivate |
Get number of fit parameters corresponding to given buffer.
buffer | buffer |
Definition at line 704 of file JAcoustics/JModel.hh.
|
inlinestaticprivate |
Get index of fit parameter in given data structure.
p | pointer to data member |
Definition at line 717 of file JAcoustics/JModel.hh.
|
inlinestaticprivate |
Get fit parameter value at given index in buffer.
buffer | buffer |
index | index |
Definition at line 733 of file JAcoustics/JModel.hh.
|
inlinestaticprivate |
Get fit parameter value at given index in buffer.
buffer | buffer |
index | index |
Definition at line 752 of file JAcoustics/JModel.hh.
|
inlineinherited |
Multiply with object.
object | object |
Definition at line 273 of file JMath.hh.
|
inlinestaticinherited |
Reset buffer.
buffer | buffer |
Definition at line 32 of file JHashMapToolkit.hh.
|
inlinestaticinherited |
Set values in target corresponding to keys in source.
target | target buffer |
source | source buffer |
value | value |
Definition at line 48 of file JHashMapToolkit.hh.
|
inlinestaticinherited |
Evaluate arithmetic operation on buffer.
buffer | buffer |
f1 | operation |
Definition at line 67 of file JHashMapToolkit.hh.
|
inlinestaticinherited |
Evaluate arithmetic operation on buffers.
first | first buffer |
second | second buffer |
f1 | operation |
Definition at line 84 of file JHashMapToolkit.hh.
|
inlinestaticinherited |
Evaluate arithmetic operation on buffer.
buffer | buffer |
f1 | operation |
factor | factor |
Definition at line 102 of file JHashMapToolkit.hh.
|
inlinestaticinherited |
Check equality of buffers.
first | first buffer |
second | second buffer |
Definition at line 120 of file JHashMapToolkit.hh.
|
inlinestaticinherited |
Check equality of buffers.
first | first buffer |
second | second buffer |
precision | precision |
Definition at line 154 of file JHashMapToolkit.hh.
|
friend |
Write model parameters to output stream.
out | output stream |
model | model |
Definition at line 518 of file JAcoustics/JModel.hh.
JACOUSTICS::JModel::string_map JACOUSTICS::JModel::string |
JACOUSTICS::JModel::emitter_map JACOUSTICS::JModel::emitter |