1 #ifndef __JMATH__JMODEL__
2 #define __JMATH__JMODEL__
20 namespace JPP {
using namespace JMATH; }
45 for (
size_t i = 0;
i != this->size(); ++
i) {
61 if (index >= this->size()) {
62 this->resize(index + 1, 0.0);
77 const double eps = std::numeric_limits<double>::min())
const
79 for (
size_t i = 0;
i != this->size(); ++
i) {
80 if (fabs((*
this)[
i] - model[
i]) >= eps) {
96 for (
size_t i = 0;
i != this->size(); ++
i) {
97 (*this)[
i] = -(*this)[
i];
112 for (
size_t i = 0;
i != model.size(); ++
i) {
113 (*this)[
i] += model[
i];
128 for (
size_t i = 0;
i != model.size(); ++
i) {
129 (*this)[
i] -= model[
i];
144 for (
size_t i = 0;
i != this->size(); ++
i) {
145 (*this)[
i] *= factor;
160 for (
size_t i = 0;
i != this->size(); ++
i) {
161 (*this)[
i] /= factor;
179 for (
double value; in >> value; ) {
180 model.push_back(value);
198 for (JModel_t::const_iterator
i = model.begin();
i != model.end(); ++
i) {
199 out <<
FIXED(7,3) << *
i <<
' ';
Auxiliary base class for aritmetic operations of derived class types.
JModel_t & negate()
Negate model.
JModel_t & add(const JModel_t &model)
Add model.
JModel_t & mul(const double factor)
Scale model.
static const JZero zero
Function object to assign zero value.
Auxiliary data structure for floating point format specification.
bool equals(const JModel_t &model, const double eps=std::numeric_limits< double >::min()) const
Equality.
Definition of zero value for any class.
friend std::istream & operator>>(std::istream &in, JModel_t &model)
Write model to input stream.
Auxiliary class to assign zero value.
double & operator[](const size_t index)
Get value at given index.
Template definition of auxiliary base class for comparison of data structures.
JModel_t & sub(const JModel_t &model)
Subtract model.
then fatal The output file must have the wildcard in the e g root fi eval JPrintDetector a $DETECTOR O IDENTIFIER eval JPrintDetector a $DETECTOR O SUMMARY JAcoustics sh $DETECTOR_ID source JAcousticsToolkit sh CHECK_EXIT_CODE typeset A EMITTERS get_tripods $WORKDIR tripod txt EMITTERS get_transmitters $WORKDIR transmitter txt EMITTERS for EMITTER in
JModel_t & operator=(const JMATH::JZero &zero)
Reset.
JModel_t & div(const double factor)
Scale model.
Base class for data structures with artithmetic capabilities.
friend std::ostream & operator<<(std::ostream &out, const JModel_t &model)
Write model to output stream.