const char TanFunction::REPR[]="tan";
+const char ACosFunction::REPR[]="acos";
+
+const char ASinFunction::REPR[]="asin";
+
+const char ATanFunction::REPR[]="atan";
+
+const char CoshFunction::REPR[]="cosh";
+
+const char SinhFunction::REPR[]="sinh";
+
+const char TanhFunction::REPR[]="tanh";
+
const char SqrtFunction::REPR[]="sqrt";
const char AbsFunction::REPR[]="abs";
return new SinFunction;
if(tmp==TanFunction::REPR)
return new TanFunction;
+ if(tmp==ACosFunction::REPR)
+ return new ACosFunction;
+ if(tmp==ASinFunction::REPR)
+ return new ASinFunction;
+ if(tmp==ATanFunction::REPR)
+ return new ATanFunction;
+ if(tmp==CoshFunction::REPR)
+ return new CoshFunction;
+ if(tmp==SinhFunction::REPR)
+ return new SinhFunction;
+ if(tmp==TanhFunction::REPR)
+ return new TanhFunction;
if(tmp==SqrtFunction::REPR)
return new SqrtFunction;
if(tmp==AbsFunction::REPR)
return true;
}
+ACosFunction::~ACosFunction()
+{
+}
+
+void ACosFunction::operate(std::vector<Value *>& stack) const throw(INTERP_KERNEL::Exception)
+{
+ Value *val=stack.back();
+ val->acos();
+}
+
+void ACosFunction::operateX86(std::vector<std::string>& asmb) const throw(INTERP_KERNEL::Exception)
+{
+ throw INTERP_KERNEL::Exception("Assembly Not implemented yet !");
+}
+
+const char *ACosFunction::getRepr() const
+{
+ return REPR;
+}
+
+bool ACosFunction::isACall() const
+{
+ return true;
+}
+
+ASinFunction::~ASinFunction()
+{
+}
+
+void ASinFunction::operate(std::vector<Value *>& stack) const throw(INTERP_KERNEL::Exception)
+{
+ Value *val=stack.back();
+ val->asin();
+}
+
+void ASinFunction::operateX86(std::vector<std::string>& asmb) const throw(INTERP_KERNEL::Exception)
+{
+ throw INTERP_KERNEL::Exception("Assembly Not implemented yet !");
+}
+
+const char *ASinFunction::getRepr() const
+{
+ return REPR;
+}
+
+bool ASinFunction::isACall() const
+{
+ return true;
+}
+
+ATanFunction::~ATanFunction()
+{
+}
+
+void ATanFunction::operate(std::vector<Value *>& stack) const throw(INTERP_KERNEL::Exception)
+{
+ Value *val=stack.back();
+ val->atan();
+}
+
+void ATanFunction::operateX86(std::vector<std::string>& asmb) const throw(INTERP_KERNEL::Exception)
+{
+ throw INTERP_KERNEL::Exception("Assembly Not implemented yet !");
+}
+
+const char *ATanFunction::getRepr() const
+{
+ return REPR;
+}
+
+bool ATanFunction::isACall() const
+{
+ return true;
+}
+
+CoshFunction::~CoshFunction()
+{
+}
+
+void CoshFunction::operate(std::vector<Value *>& stack) const throw(INTERP_KERNEL::Exception)
+{
+ Value *val=stack.back();
+ val->cosh();
+}
+
+void CoshFunction::operateX86(std::vector<std::string>& asmb) const throw(INTERP_KERNEL::Exception)
+{
+ throw INTERP_KERNEL::Exception("Assembly Not implemented yet !");
+}
+
+const char *CoshFunction::getRepr() const
+{
+ return REPR;
+}
+
+bool CoshFunction::isACall() const
+{
+ return true;
+}
+
+SinhFunction::~SinhFunction()
+{
+}
+
+void SinhFunction::operate(std::vector<Value *>& stack) const throw(INTERP_KERNEL::Exception)
+{
+ Value *val=stack.back();
+ val->sinh();
+}
+
+void SinhFunction::operateX86(std::vector<std::string>& asmb) const throw(INTERP_KERNEL::Exception)
+{
+ throw INTERP_KERNEL::Exception("Assembly Not implemented yet !");
+}
+
+const char *SinhFunction::getRepr() const
+{
+ return REPR;
+}
+
+bool SinhFunction::isACall() const
+{
+ return true;
+}
+
+TanhFunction::~TanhFunction()
+{
+}
+
+void TanhFunction::operate(std::vector<Value *>& stack) const throw(INTERP_KERNEL::Exception)
+{
+ Value *val=stack.back();
+ val->tanh();
+}
+
+void TanhFunction::operateX86(std::vector<std::string>& asmb) const throw(INTERP_KERNEL::Exception)
+{
+ throw INTERP_KERNEL::Exception("Assembly Not implemented yet !");
+}
+
+const char *TanhFunction::getRepr() const
+{
+ return REPR;
+}
+
+bool TanhFunction::isACall() const
+{
+ return true;
+}
+
SqrtFunction::~SqrtFunction()
{
}
static const char REPR[];
};
+ class INTERPKERNEL_EXPORT ACosFunction : public UnaryFunction
+ {
+ public:
+ ~ACosFunction();
+ void operate(std::vector<Value *>& stack) const throw(INTERP_KERNEL::Exception);
+ void operateX86(std::vector<std::string>& asmb) const throw(INTERP_KERNEL::Exception);
+ const char *getRepr() const;
+ bool isACall() const;
+ public:
+ static const char REPR[];
+ };
+
+ class INTERPKERNEL_EXPORT ASinFunction : public UnaryFunction
+ {
+ public:
+ ~ASinFunction();
+ void operate(std::vector<Value *>& stack) const throw(INTERP_KERNEL::Exception);
+ void operateX86(std::vector<std::string>& asmb) const throw(INTERP_KERNEL::Exception);
+ const char *getRepr() const;
+ bool isACall() const;
+ public:
+ static const char REPR[];
+ };
+
+ class INTERPKERNEL_EXPORT ATanFunction : public UnaryFunction
+ {
+ public:
+ ~ATanFunction();
+ void operate(std::vector<Value *>& stack) const throw(INTERP_KERNEL::Exception);
+ void operateX86(std::vector<std::string>& asmb) const throw(INTERP_KERNEL::Exception);
+ const char *getRepr() const;
+ bool isACall() const;
+ public:
+ static const char REPR[];
+ };
+
+ class INTERPKERNEL_EXPORT CoshFunction : public UnaryFunction
+ {
+ public:
+ ~CoshFunction();
+ void operate(std::vector<Value *>& stack) const throw(INTERP_KERNEL::Exception);
+ void operateX86(std::vector<std::string>& asmb) const throw(INTERP_KERNEL::Exception);
+ const char *getRepr() const;
+ bool isACall() const;
+ public:
+ static const char REPR[];
+ };
+
+ class INTERPKERNEL_EXPORT SinhFunction : public UnaryFunction
+ {
+ public:
+ ~SinhFunction();
+ void operate(std::vector<Value *>& stack) const throw(INTERP_KERNEL::Exception);
+ void operateX86(std::vector<std::string>& asmb) const throw(INTERP_KERNEL::Exception);
+ const char *getRepr() const;
+ bool isACall() const;
+ public:
+ static const char REPR[];
+ };
+
+ class INTERPKERNEL_EXPORT TanhFunction : public UnaryFunction
+ {
+ public:
+ ~TanhFunction();
+ void operate(std::vector<Value *>& stack) const throw(INTERP_KERNEL::Exception);
+ void operateX86(std::vector<std::string>& asmb) const throw(INTERP_KERNEL::Exception);
+ const char *getRepr() const;
+ bool isACall() const;
+ public:
+ static const char REPR[];
+ };
+
class INTERPKERNEL_EXPORT SqrtFunction : public UnaryFunction
{
public:
_data=std::tan(_data);
}
+void ValueDouble::acos() throw(INTERP_KERNEL::Exception)
+{
+ _data=std::acos(_data);
+}
+
+void ValueDouble::asin() throw(INTERP_KERNEL::Exception)
+{
+ _data=std::asin(_data);
+}
+
+void ValueDouble::atan() throw(INTERP_KERNEL::Exception)
+{
+ _data=std::atan(_data);
+}
+
+void ValueDouble::cosh() throw(INTERP_KERNEL::Exception)
+{
+ _data=std::cosh(_data);
+}
+
+void ValueDouble::sinh() throw(INTERP_KERNEL::Exception)
+{
+ _data=std::sinh(_data);
+}
+
+void ValueDouble::tanh() throw(INTERP_KERNEL::Exception)
+{
+ _data=std::tanh(_data);
+}
+
void ValueDouble::abs() throw(INTERP_KERNEL::Exception)
{
if(_data<0.)
unsupportedOp(TanFunction::REPR);
}
+void ValueUnit::acos() throw(INTERP_KERNEL::Exception)
+{
+ unsupportedOp(ACosFunction::REPR);
+}
+
+void ValueUnit::asin() throw(INTERP_KERNEL::Exception)
+{
+ unsupportedOp(ASinFunction::REPR);
+}
+
+void ValueUnit::atan() throw(INTERP_KERNEL::Exception)
+{
+ unsupportedOp(ATanFunction::REPR);
+}
+
+void ValueUnit::cosh() throw(INTERP_KERNEL::Exception)
+{
+ unsupportedOp(CoshFunction::REPR);
+}
+
+void ValueUnit::sinh() throw(INTERP_KERNEL::Exception)
+{
+ unsupportedOp(SinhFunction::REPR);
+}
+
+void ValueUnit::tanh() throw(INTERP_KERNEL::Exception)
+{
+ unsupportedOp(TanhFunction::REPR);
+}
+
void ValueUnit::abs() throw(INTERP_KERNEL::Exception)
{
unsupportedOp(AbsFunction::REPR);
std::transform(_dest_data,_dest_data+_sz_dest_data,_dest_data,std::ptr_fun<double,double>(std::tan));
}
+void ValueDoubleExpr::acos() throw(INTERP_KERNEL::Exception)
+{
+ double *it=std::find_if(_dest_data,_dest_data+_sz_dest_data,std::bind2nd(std::less<double>(),-1.));
+ if(it!=_dest_data+_sz_dest_data)
+ throw INTERP_KERNEL::Exception("Trying to apply acos on < 1. value !");
+ it=std::find_if(_dest_data,_dest_data+_sz_dest_data,std::bind2nd(std::greater<double>(),1.));
+ if(it!=_dest_data+_sz_dest_data)
+ throw INTERP_KERNEL::Exception("Trying to apply acos on > 1. value !");
+ std::transform(_dest_data,_dest_data+_sz_dest_data,_dest_data,std::ptr_fun<double,double>(std::acos));
+}
+
+void ValueDoubleExpr::asin() throw(INTERP_KERNEL::Exception)
+{
+ double *it=std::find_if(_dest_data,_dest_data+_sz_dest_data,std::bind2nd(std::less<double>(),-1.));
+ if(it!=_dest_data+_sz_dest_data)
+ throw INTERP_KERNEL::Exception("Trying to apply asin on < 1. value !");
+ it=std::find_if(_dest_data,_dest_data+_sz_dest_data,std::bind2nd(std::greater<double>(),1.));
+ if(it!=_dest_data+_sz_dest_data)
+ throw INTERP_KERNEL::Exception("Trying to apply asin on > 1. value !");
+ std::transform(_dest_data,_dest_data+_sz_dest_data,_dest_data,std::ptr_fun<double,double>(std::asin));
+}
+
+void ValueDoubleExpr::atan() throw(INTERP_KERNEL::Exception)
+{
+ std::transform(_dest_data,_dest_data+_sz_dest_data,_dest_data,std::ptr_fun<double,double>(std::atan));
+}
+
+void ValueDoubleExpr::cosh() throw(INTERP_KERNEL::Exception)
+{
+ std::transform(_dest_data,_dest_data+_sz_dest_data,_dest_data,std::ptr_fun<double,double>(std::cosh));
+}
+
+void ValueDoubleExpr::sinh() throw(INTERP_KERNEL::Exception)
+{
+ std::transform(_dest_data,_dest_data+_sz_dest_data,_dest_data,std::ptr_fun<double,double>(std::sinh));
+}
+
+void ValueDoubleExpr::tanh() throw(INTERP_KERNEL::Exception)
+{
+ std::transform(_dest_data,_dest_data+_sz_dest_data,_dest_data,std::ptr_fun<double,double>(std::tanh));
+}
+
void ValueDoubleExpr::abs() throw(INTERP_KERNEL::Exception)
{
std::transform(_dest_data,_dest_data+_sz_dest_data,_dest_data,std::ptr_fun<double,double>(fabs));
virtual void cos() throw(INTERP_KERNEL::Exception) = 0;
virtual void sin() throw(INTERP_KERNEL::Exception) = 0;
virtual void tan() throw(INTERP_KERNEL::Exception) = 0;
+ virtual void acos() throw(INTERP_KERNEL::Exception) = 0;
+ virtual void asin() throw(INTERP_KERNEL::Exception) = 0;
+ virtual void atan() throw(INTERP_KERNEL::Exception) = 0;
+ virtual void cosh() throw(INTERP_KERNEL::Exception) = 0;
+ virtual void sinh() throw(INTERP_KERNEL::Exception) = 0;
+ virtual void tanh() throw(INTERP_KERNEL::Exception) = 0;
virtual void abs() throw(INTERP_KERNEL::Exception) = 0;
virtual void exp() throw(INTERP_KERNEL::Exception) = 0;
virtual void ln() throw(INTERP_KERNEL::Exception) = 0;
void cos() throw(INTERP_KERNEL::Exception);
void sin() throw(INTERP_KERNEL::Exception);
void tan() throw(INTERP_KERNEL::Exception);
+ void acos() throw(INTERP_KERNEL::Exception);
+ void asin() throw(INTERP_KERNEL::Exception);
+ void atan() throw(INTERP_KERNEL::Exception);
+ void cosh() throw(INTERP_KERNEL::Exception);
+ void sinh() throw(INTERP_KERNEL::Exception);
+ void tanh() throw(INTERP_KERNEL::Exception);
void abs() throw(INTERP_KERNEL::Exception);
void exp() throw(INTERP_KERNEL::Exception);
void ln() throw(INTERP_KERNEL::Exception);
void cos() throw(INTERP_KERNEL::Exception);
void sin() throw(INTERP_KERNEL::Exception);
void tan() throw(INTERP_KERNEL::Exception);
+ void acos() throw(INTERP_KERNEL::Exception);
+ void asin() throw(INTERP_KERNEL::Exception);
+ void atan() throw(INTERP_KERNEL::Exception);
+ void cosh() throw(INTERP_KERNEL::Exception);
+ void sinh() throw(INTERP_KERNEL::Exception);
+ void tanh() throw(INTERP_KERNEL::Exception);
void abs() throw(INTERP_KERNEL::Exception);
void exp() throw(INTERP_KERNEL::Exception);
void ln() throw(INTERP_KERNEL::Exception);
void cos() throw(INTERP_KERNEL::Exception);
void sin() throw(INTERP_KERNEL::Exception);
void tan() throw(INTERP_KERNEL::Exception);
+ void acos() throw(INTERP_KERNEL::Exception);
+ void asin() throw(INTERP_KERNEL::Exception);
+ void atan() throw(INTERP_KERNEL::Exception);
+ void cosh() throw(INTERP_KERNEL::Exception);
+ void sinh() throw(INTERP_KERNEL::Exception);
+ void tanh() throw(INTERP_KERNEL::Exception);
void abs() throw(INTERP_KERNEL::Exception);
void exp() throw(INTERP_KERNEL::Exception);
void ln() throw(INTERP_KERNEL::Exception);