// Copyright (C) 2001 Jean-Marc Valin #include "vmethod.h" #include "net_types.h" #include #include "ObjectRef.h" #include "Vector.h" using namespace std; namespace FD { template ObjectRef logObj(ObjectRef in) { typedef typename T::basicType BaseType; BaseType f=dereference_cast (in); return ObjectRef(new T(BaseType(log(double(f))))); } template ObjectRef expObj(ObjectRef in) { typedef typename T::basicType BaseType; BaseType f=dereference_cast (in); return ObjectRef(new T(BaseType(exp(double(f))))); } template ObjectRef sinObj(ObjectRef in) { typedef typename T::basicType BaseType; BaseType f=dereference_cast (in); return ObjectRef(new T(BaseType(sin(double(f))))); } template ObjectRef cosObj(ObjectRef in) { typedef typename T::basicType BaseType; BaseType f=dereference_cast (in); return ObjectRef(new T(BaseType(cos(double(f))))); } REGISTER_VTABLE0(log, Float, logObj, 1) REGISTER_VTABLE0(log, Int, logObj, 2) REGISTER_VTABLE0(exp, Float, expObj, 1) REGISTER_VTABLE0(exp, Int, expObj, 2) REGISTER_VTABLE0(sin, Float, sinObj, 1) REGISTER_VTABLE0(sin, Int, sinObj, 2) REGISTER_VTABLE0(cos, Float, cosObj, 1) REGISTER_VTABLE0(cos, Int, cosObj, 2) }//namespace FD