Fit model.  
 More...
#include <JModel.hh>
 | 
| std::istream &  | operator>> (std::istream &in, JModel_t &model) | 
|   | Write model to input stream.  
  | 
|   | 
| std::ostream &  | operator<< (std::ostream &out, const JModel_t &model) | 
|   | Write model to output stream.  
  | 
|   | 
Fit model. 
Definition at line 29 of file JMath/JModel.hh.
 
◆ parameter_type
◆ operator=()
Reset. 
- Parameters
 - 
  
  
 
- Returns
 - this model 
 
Definition at line 43 of file JMath/JModel.hh.
   44    {
   45      for (size_t i = 0; i != this->size(); ++i) {
   46        (*this)[i] = 0.0;
   47      }
   48 
   49      return *this;
   50    }
 
 
 
◆ operator[]()
  
  
      
        
          | double & JMATH::JModel_t::operator[]  | 
          ( | 
          const size_t |           index | ) | 
           | 
         
       
   | 
  
inline   | 
  
 
Get value at given index. 
- Parameters
 - 
  
  
 
- Returns
 - value 
 
Definition at line 59 of file JMath/JModel.hh.
   60    {
   61      if (index >= this->size()) {
   62        this->resize(index + 1, 0.0);
   63      }
   64 
   66    }
 
 
 
◆ equals()
  
  
      
        
          | bool JMATH::JModel_t::equals  | 
          ( | 
          const JModel_t & |           model,  | 
         
        
           | 
           | 
          const double |           eps = std::numeric_limits<double>::min() ) const | 
         
       
   | 
  
inline   | 
  
 
Equality. 
- Parameters
 - 
  
    | model | model  | 
    | eps | numerical precision  | 
  
   
- Returns
 - true if model's identical; else false 
 
Definition at line 76 of file JMath/JModel.hh.
   78    {
   79      for (size_t i = 0; i != this->size(); ++i) {
   80        if (fabs((*this)[i] - model[i]) >= eps) {
   81          return false;
   82        }
   83      }
   84 
   85      return true;
   86    }
 
 
 
◆ negate()
Negate model. 
- Returns
 - this model 
 
Definition at line 94 of file JMath/JModel.hh.
   95    {
   96      for (size_t i = 0; i != this->size(); ++i) {
   97        (*this)[i] = -(*this)[i];
   98      }
   99 
  100      return *this;
  101    }
 
 
 
◆ add()
Add model. 
- Parameters
 - 
  
  
 
- Returns
 - this model 
 
Definition at line 110 of file JMath/JModel.hh.
  111    {
  112      for (
size_t i = 0; i != 
model.size(); ++i) {
 
  113        (*this)[i] += 
model[i];
 
  114      }
  115 
  116      return *this;
  117    }
 
 
 
◆ sub()
Subtract model. 
- Parameters
 - 
  
  
 
- Returns
 - this model 
 
Definition at line 126 of file JMath/JModel.hh.
  127    {
  128      for (
size_t i = 0; i != 
model.size(); ++i) {
 
  129        (*this)[i] -= 
model[i];
 
  130      }
  131 
  132      return *this;
  133    }
 
 
 
◆ mul() [1/2]
  
  
      
        
          | JModel_t & JMATH::JModel_t::mul  | 
          ( | 
          const double |           factor | ) | 
           | 
         
       
   | 
  
inline   | 
  
 
Scale model. 
- Parameters
 - 
  
    | factor | multiplication factor  | 
  
   
- Returns
 - this model 
 
Definition at line 142 of file JMath/JModel.hh.
  143    {
  144      for (size_t i = 0; i != this->size(); ++i) {
  145        (*this)[i] *= factor;
  146      }
  147 
  148      return *this;
  149    }
 
 
 
◆ div()
  
  
      
        
          | JModel_t & JMATH::JModel_t::div  | 
          ( | 
          const double |           factor | ) | 
           | 
         
       
   | 
  
inline   | 
  
 
Scale model. 
- Parameters
 - 
  
  
 
- Returns
 - this model 
 
Definition at line 158 of file JMath/JModel.hh.
  159    {
  160      for (size_t i = 0; i != this->size(); ++i) {
  161        (*this)[i] /= factor;
  162      }
  163 
  164      return *this;
  165    }
 
 
 
◆ mul() [2/2]
Multiply with object. 
- Parameters
 - 
  
  
 
- Returns
 - result object 
 
Definition at line 354 of file JMath.hh.
  355    {
  356      return static_cast<JFirst_t&>(*this) = JFirst_t().mul(static_cast<const JFirst_t&>(*this), object);
  357    }
 
 
 
◆ operator>>
  
  
      
        
          | std::istream & operator>>  | 
          ( | 
          std::istream & |           in,  | 
         
        
           | 
           | 
          JModel_t & |           model ) | 
         
       
   | 
  
friend   | 
  
 
Write model to input stream. 
- Parameters
 - 
  
    | in | input stream  | 
    | model | model  | 
  
   
- Returns
 - input stream 
 
Definition at line 175 of file JMath/JModel.hh.
  176    {
  178 
  179      for (double value; in >> value; ) {
  180        model.push_back(value);
 
  181      }
  182 
  183      return in;
  184    }
 
 
 
◆ operator<<
  
  
      
        
          | std::ostream & operator<<  | 
          ( | 
          std::ostream & |           out,  | 
         
        
           | 
           | 
          const JModel_t & |           model ) | 
         
       
   | 
  
friend   | 
  
 
Write model to output stream. 
- Parameters
 - 
  
    | out | output stream  | 
    | model | model  | 
  
   
- Returns
 - output stream 
 
Definition at line 194 of file JMath/JModel.hh.
  195    {
  197 
  198      for (JModel_t::const_iterator i = 
model.begin(); i != 
model.end(); ++i) {
 
  199        out << 
FIXED(7,3) << *i  << 
' ';
 
  200      }
  201 
  202      return out;
  203    }
Auxiliary data structure for floating point format specification.
 
 
 
 
The documentation for this struct was generated from the following file: