/*
  trigclass.h

  a toy class to illustrate the long DirectSearch class constructor.

  P.L. (Anne) Shepherd
  College of William and Mary

*/


#ifndef _toy_trig_
#define _toy_trig_

#include <iostream>
#include <cmath>
#include "vec.h"



class trigclass
{
public:
       
    trigclass(double x);
        
    void Sin_fcn(long vars, Vector<double> &v, double & f);

    void Cos_fcn(long vars, Vector<double> &v, double & f);    

    void Set_x_val(double new_x);
    
    double Get_y_val();

    /* the following two methods are friends rather then members because
     * we want our main program to be able to pass pointers to them.
     *
     * Note that in the calls masked by these methods, the void pointer
     * should be cast to a pointer of the class type.
     */
     
    friend void find_Sin(long vars, Vector<double> &v, double & f,
                    bool & success, void* t_ptr)
    {
        (*(trigclass*)t_ptr).Sin_fcn(vars, v, f);
        success = true;
    }
            
    friend void find_Cos(long vars, Vector<double> &v, double & f,
                    bool & success, void* t_ptr)
    {
        (*(trigclass*)t_ptr).Cos_fcn(vars, v, f);
        success = true;
    }

private:

    double mySin(Vector<double> & vec1);

    double myCos(Vector<double> & vec1);    


    double _x;


};



#endif
