Figure 1: Class CFeed and non-member operations

class CFeed {
// class data members
protected:
   unsigned long m_N;   // number of independent variables
   double        m_f;   // function value
   double       *m_df;  // first order partials 
   double       *m_ddf; // Jacobian: second order partials
public:
// creation, destruction, assignement
   CFeed(const CFeed &);        // class constructor
   CFeed(unsigned long  = 0,    // full constructor
      double   = 0, 
      double * = 0, 
      double * = 0);
   ~CFeed(void);                // destructor 
   CFeed &   operator=(const CFeed &);    // equal operator
// arithmetic operators
   CFeed &   operator+=(const CFeed &);   
   CFeed &   operator+=(const double);    
   CFeed     operator+(const CFeed &);    
   CFeed     operator+(const double);     
   CFeed &   operator-=(const CFeed &);   
   CFeed &   operator-=(const double);    
   CFeed     operator-(const CFeed &);    
   CFeed     operator-(const double);     
   CFeed &   operator*=(const CFeed &);   
   CFeed &   operator*=(const double);    
   CFeed     operator*(const CFeed &);    
   CFeed     operator*(const double);     
   CFeed &   operator/=(const CFeed &);   
   CFeed &   operator/=(const double);    
   CFeed     operator/(const CFeed &);    
   CFeed     operator/(const double);     
// special
   CFeed &   operator-(void);           // unary minus operator
   CFeed     operator()(const CFeed &); // call operator 
                                        // (chain rule) 
// I/O
   double    operator()(void);            // call operator; 
                                          // return base value
   double    operator()(unsigned long);   // call operator; 
                                          // return 1st partial
   double    operator()(unsigned long, 
                unsigned long);           // call operator; 
                                          // return 2nd partial
   unsigned long    size(void);           // return size of 
                                          // feed object
// Math
   friend CFeed exp(const CFeed &);   // exponential
   friend CFeed log(const CFeed &);   // natural logrithm
   friend CFeed log10(const CFeed &); // base 10 logrithm
   friend CFeed sqrt(const CFeed &);  // square root
   friend CFeed sin(const CFeed &);   // sine
   friend CFeed cos(const CFeed &);   // cosine
   friend CFeed tan(const CFeed &);   // tangent
   friend CFeed asin(const CFeed &);  // arc sine
   friend CFeed acos(const CFeed &);  // arc cosine
   friend CFeed atan(const CFeed &);  // arc tangent
   friend CFeed sinh(const CFeed &);  // hyperbolic sine
   friend CFeed cosh(const CFeed &);  // hyperbolic cosine
   friend CFeed tanh(const CFeed &);  // hyperbolic tangent
   friend CFeed pow(const CFeed &,const CFeed &); // feed^feed 
   friend CFeed pow(const CFeed &,const double);  // feed^double
   friend CFeed pow(const double,const CFeed &);  // double^feed 
// I/O
friend ostream & operator<<(ostream &,CFeed &); // write output
};
            
// non-member operators
            
CFeed operator+(const double, const CFeed &);   // double + feed
CFeed operator-(const double, const CFeed &);   // double - feed
CFeed operator*(const double, const CFeed &);   // double * feed
CFeed operator/(const double, const CFeed &);   // double / feed