11 return typeid(double)==obj_type ||
typeid(
float)==obj_type ||
typeid(int)==obj_type ||
typeid(
unsigned int)==obj_type;
15 if( obj.type()==
typeid(
double) ) {
return boost::any_cast<double const>(obj)==0.0; }
16 if( obj.type()==
typeid(
float) ) {
return boost::any_cast<float const>(obj)==0.0; }
17 if( obj.type()==
typeid(
int) ) {
return boost::any_cast<int const>(obj)==0; }
18 if( obj.type()==
typeid(
unsigned int) ) {
return boost::any_cast<unsigned int const>(obj)==0; }
26 if(
typeid(
double)==type ) {
return (
double)0.0; }
27 if(
typeid(
float)==type ) {
return (
float)0.0; }
28 if(
typeid(
int)==type ) {
return (
int)0; }
29 if(
typeid(
unsigned int)==type ) {
return (
unsigned int)0; }
37 if(
typeid(
double)==obj.type() ) {
return Magnitude<double>(obj); }
38 if(
typeid(
float)==obj.type() ) {
return Magnitude<float>(obj); }
39 if(
typeid(
int)==obj.type() ) {
return Magnitude<int>(obj); }
40 if(
typeid(
unsigned int)==obj.type() ) {
return Magnitude<unsigned int>(obj); }
50 if( result.type()==
typeid(
double) ) {
return boost::any_cast<double const>(result); }
51 if( result.type()==
typeid(
float) ) {
return (
double)boost::any_cast<float const>(result); }
52 if( result.type()==
typeid(
int) ) {
return (
double)boost::any_cast<int const>(result); }
53 if( result.type()==
typeid(
unsigned int) ) {
return (
double)boost::any_cast<unsigned int const>(result); }
56 return std::numeric_limits<double>::quiet_NaN();
72 if( type==
typeid(
double) ) {
return (
double)1.0; }
73 if( type==
typeid(
float) ) {
return (
float)1.0; }
74 if( type==
typeid(
int) ) {
return (
int)1; }
75 if( type==
typeid(
unsigned int) ) {
return (
unsigned int)1; }
83 if( in0.type()==
typeid(
double) ) {
return Add<double>(in0, in1); }
84 if( in0.type()==
typeid(
float) ) {
return Add<float>(in0, in1); }
85 if( in0.type()==
typeid(
int) ) {
return Add<int>(in0, in1); }
86 if( in0.type()==
typeid(
unsigned int) ) {
return Add<unsigned int>(in0, in1); }
94 if( in0.type()==
typeid(
double) ) {
return Subtract<double>(in0, in1); }
95 if( in0.type()==
typeid(
float) ) {
return Subtract<float>(in0, in1); }
96 if( in0.type()==
typeid(
int) ) {
return Subtract<int>(in0, in1); }
97 if( in0.type()==
typeid(
unsigned int) ) {
return Subtract<unsigned int>(in0, in1); }
105 if( obj.type()==
typeid(
double) ) {
return 1.0/boost::any_cast<double const>(obj); }
106 if( obj.type()==
typeid(
float) ) {
return (
float)1.0/boost::any_cast<float const>(obj); }
107 if( obj.type()==
typeid(
int) ) {
return 1.0/boost::any_cast<int const>(obj); }
108 if( obj.type()==
typeid(
unsigned int) ) {
return 1.0/boost::any_cast<unsigned int const>(obj); }
116 if( in0.type()==
typeid(
double) ) {
return Multiply<double>(in0, in1); }
117 if( in0.type()==
typeid(
float) ) {
return Multiply<float>(in0, in1); }
118 if( in0.type()==
typeid(
int) ) {
return Multiply<int>(in0, in1); }
119 if( in0.type()==
typeid(
unsigned int) ) {
return Multiply<unsigned int>(in0, in1); }
127 if( obj.type()==
typeid(
double) ) {
return std::sqrt(boost::any_cast<double>(obj)); }
128 if( obj.type()==
typeid(
float) ) {
return std::sqrt(boost::any_cast<float>(obj)); }
129 if( obj.type()==
typeid(
int) ) {
return std::sqrt(boost::any_cast<int>(obj)); }
130 if( obj.type()==
typeid(
unsigned int) ) {
return std::sqrt(boost::any_cast<unsigned int>(obj)); }
138 if(
typeid(
double)==obj.type() ) {
return std::log(Magnitude<double>(obj)); }
139 if(
typeid(
float)==obj.type() ) {
return std::log(Magnitude<float>(obj)); }
140 if(
typeid(
int)==obj.type() ) {
return std::log(Magnitude<int>(obj)); }
141 if(
typeid(
unsigned int)==obj.type() ) {
return std::log(Magnitude<unsigned int>(obj)); }
static boost::any SquareRoot(boost::any const &obj)
Compute the square root of an object.
static bool IsScalar(std::type_info const &obj_type)
Is a boost::any a scalar type (double, float, int, or unsigned int)?
static bool IsZero(boost::any const &obj)
Determine if a scalar is zero.
static boost::any OuterProduct(boost::any const &vec1, boost::any const &vec2)
The outer product between two scalars.
static boost::any Add(boost::any const &in0, boost::any const &in1)
Add two scalars together.
static double Norm(boost::any const &obj)
Get the norm of a scalar (the magnitude)
static boost::any Multiply(boost::any const &in0, boost::any const &in1)
Multiply two scalars.
static double InnerProduct(boost::any const &vec1, boost::any const &vec2)
The inner product between two scalars.
static boost::any Identity(std::type_info const &type)
Compute an identity object for a scalar.
static boost::any Subtract(boost::any const &in0, boost::any const &in1)
Subtract two scalars.
static double LogDeterminate(boost::any const &obj)
Compute the log-determinate.
static boost::any Inverse(boost::any const &obj)
The inverse.
static boost::any Zero(std::type_info const &type)
Compute a zero scalar.