MUQ  0.4.3
muq::Modeling::ScalarAlgebra Class Reference

Linear algebra for scalar objects. More...

#include <ScalarAlgebra.h>

Detailed Description

Linear algebra for scalar objects.

Definition at line 13 of file ScalarAlgebra.h.

Public Member Functions

 ScalarAlgebra ()
 
virtual ~ScalarAlgebra ()
 

Static Public Member Functions

static bool IsScalar (std::type_info const &obj_type)
 Is a boost::any a scalar type (double, float, int, or unsigned int)? More...
 
static bool IsZero (boost::any const &obj)
 Determine if a scalar is zero. More...
 
static boost::any Zero (std::type_info const &type)
 Compute a zero scalar. More...
 
static double Norm (boost::any const &obj)
 Get the norm of a scalar (the magnitude) More...
 
static double InnerProduct (boost::any const &vec1, boost::any const &vec2)
 The inner product between two scalars. More...
 
static boost::any OuterProduct (boost::any const &vec1, boost::any const &vec2)
 The outer product between two scalars. More...
 
static boost::any Identity (std::type_info const &type)
 Compute an identity object for a scalar. More...
 
static boost::any Add (boost::any const &in0, boost::any const &in1)
 Add two scalars together. More...
 
static boost::any Subtract (boost::any const &in0, boost::any const &in1)
 Subtract two scalars. More...
 
static boost::any Multiply (boost::any const &in0, boost::any const &in1)
 Multiply two scalars. More...
 
static boost::any Inverse (boost::any const &obj)
 The inverse. More...
 
static boost::any SquareRoot (boost::any const &obj)
 Compute the square root of an object. More...
 
static double LogDeterminate (boost::any const &obj)
 Compute the log-determinate. More...
 

Constructor & Destructor Documentation

◆ ScalarAlgebra()

ScalarAlgebra::ScalarAlgebra ( )

Definition at line 5 of file ScalarAlgebra.cpp.

◆ ~ScalarAlgebra()

ScalarAlgebra::~ScalarAlgebra ( )
virtual

Definition at line 7 of file ScalarAlgebra.cpp.

Member Function Documentation

◆ Add() [1/3]

boost::any ScalarAlgebra::Add ( boost::any const &  in0,
boost::any const &  in1 
)
static

Add two scalars together.

Parameters
[in]in0The first input
[in]in1The second input
Returns
The addition of in0 and in1 (in0+in1)

Definition at line 82 of file ScalarAlgebra.cpp.

Referenced by muq::Modeling::AnyAlgebra::Add().

◆ Add() [2/3]

template<typename type0 , typename type1 >
static boost::any muq::Modeling::ScalarAlgebra::Add ( boost::any const &  in0,
boost::any const &  in1 
)
inlinestaticprivate

Add two scalars together.

Parameters
[in]in0The first input
[in]in1The second input
Returns
The addition of in0 and in1 (in0+in1)

Definition at line 136 of file ScalarAlgebra.h.

◆ Add() [3/3]

template<typename type0 >
static boost::any muq::Modeling::ScalarAlgebra::Add ( boost::any const &  in0,
boost::any const &  in1 
)
inlinestaticprivate

Add two scalars together.

Parameters
[in]in0The first input
[in]in1The second input
Returns
The addition of in0 and in1 (in0+in1)

Definition at line 150 of file ScalarAlgebra.h.

◆ Identity()

boost::any ScalarAlgebra::Identity ( std::type_info const &  type)
static

Compute an identity object for a scalar.

Parameters
[in]typeThe type—return an identity of this type
Returns
An identity of some type

Definition at line 71 of file ScalarAlgebra.cpp.

Referenced by muq::Modeling::AnyAlgebra::Identity().

◆ InnerProduct()

double ScalarAlgebra::InnerProduct ( boost::any const &  vec1,
boost::any const &  vec2 
)
static

The inner product between two scalars.

Parameters
[in]vec1The first scalar
[in]vec2The second scalar
Returns
The inner product

Definition at line 47 of file ScalarAlgebra.cpp.

References Multiply().

Referenced by muq::Modeling::AnyAlgebra::InnerProduct().

◆ Inverse()

boost::any ScalarAlgebra::Inverse ( boost::any const &  obj)
static

The inverse.

Parameters
[in]objWe need the inverse of this object
Returns
The inverse

Definition at line 104 of file ScalarAlgebra.cpp.

Referenced by muq::Modeling::AnyAlgebra::Inverse().

◆ IsScalar()

◆ IsZero()

bool ScalarAlgebra::IsZero ( boost::any const &  obj)
static

Determine if a scalar is zero.

Parameters
[in]objAn input scalar
Returns
true: if obj is zero, false: if obj is not zero

Definition at line 14 of file ScalarAlgebra.cpp.

Referenced by muq::Modeling::AnyAlgebra::IsZero().

◆ LogDeterminate()

double ScalarAlgebra::LogDeterminate ( boost::any const &  obj)
static

Compute the log-determinate.

Parameters
[in]objWe need the determinate of this object
Returns
The determinate

Definition at line 137 of file ScalarAlgebra.cpp.

Referenced by muq::Modeling::AnyAlgebra::LogDeterminate().

◆ Magnitude()

template<typename type >
static double muq::Modeling::ScalarAlgebra::Magnitude ( boost::any const &  obj)
inlinestaticprivate

The magnitude of a scalar.

Parameters
[in]objWe need the magnitude of this scalar
Returns
The magnitude

Definition at line 123 of file ScalarAlgebra.h.

◆ Multiply() [1/3]

boost::any ScalarAlgebra::Multiply ( boost::any const &  in0,
boost::any const &  in1 
)
static

Multiply two scalars.

Parameters
[in]in0The first input
[in]in1The second input
Returns
The multiplication of in0 and in1 (in0*in1)

Definition at line 115 of file ScalarAlgebra.cpp.

Referenced by InnerProduct(), muq::Modeling::AnyAlgebra::Multiply(), and OuterProduct().

◆ Multiply() [2/3]

template<typename type0 , typename type1 >
static boost::any muq::Modeling::ScalarAlgebra::Multiply ( boost::any const &  in0,
boost::any const &  in1 
)
inlinestaticprivate

Multiply two scalars.

Parameters
[in]in0The first input
[in]in1The second input
Returns
The multiplication of in0 and in1 (in0*in1)

Definition at line 200 of file ScalarAlgebra.h.

◆ Multiply() [3/3]

template<typename type0 >
static boost::any muq::Modeling::ScalarAlgebra::Multiply ( boost::any const &  in0,
boost::any const &  in1 
)
inlinestaticprivate

Multiply two scalars.

Parameters
[in]in0The first input
[in]in1The second input
Returns
The multiplication of in0 and in1 (in0*in1)

Definition at line 214 of file ScalarAlgebra.h.

◆ Norm()

double ScalarAlgebra::Norm ( boost::any const &  obj)
static

Get the norm of a scalar (the magnitude)

Parameters
[in]objWe need the magnitude of this scalar
Returns
The magnitude

Definition at line 36 of file ScalarAlgebra.cpp.

Referenced by muq::Modeling::AnyAlgebra::Norm().

◆ OuterProduct()

boost::any ScalarAlgebra::OuterProduct ( boost::any const &  vec1,
boost::any const &  vec2 
)
static

The outer product between two scalars.

Parameters
[in]vec1The first scalar
[in]vec2The second scalar
Returns
The outer product

Definition at line 59 of file ScalarAlgebra.cpp.

References Multiply().

Referenced by muq::Modeling::AnyAlgebra::OuterProduct().

◆ SquareRoot()

boost::any ScalarAlgebra::SquareRoot ( boost::any const &  obj)
static

Compute the square root of an object.

Parameters
[in]objWe need the square root of this object
Returns
The square root

Definition at line 126 of file ScalarAlgebra.cpp.

Referenced by muq::Modeling::AnyAlgebra::SquareRoot().

◆ Subtract() [1/3]

boost::any ScalarAlgebra::Subtract ( boost::any const &  in0,
boost::any const &  in1 
)
static

Subtract two scalars.

Parameters
[in]in0The first input
[in]in1The second input
Returns
The subtraction of in0 and in1 (in0-in1)

Definition at line 93 of file ScalarAlgebra.cpp.

Referenced by muq::Modeling::AnyAlgebra::Subtract().

◆ Subtract() [2/3]

template<typename type0 , typename type1 >
static boost::any muq::Modeling::ScalarAlgebra::Subtract ( boost::any const &  in0,
boost::any const &  in1 
)
inlinestaticprivate

Subtract two scalars.

Parameters
[in]in0The first input
[in]in1The second input
Returns
The subtraction of in0 and in1 (in0-in1)

Definition at line 168 of file ScalarAlgebra.h.

◆ Subtract() [3/3]

template<typename type0 >
static boost::any muq::Modeling::ScalarAlgebra::Subtract ( boost::any const &  in0,
boost::any const &  in1 
)
inlinestaticprivate

Subtract two scalars.

Parameters
[in]in0The first input
[in]in1The second input
Returns
The subtraction of in0 and in1 (in0-in1)

Definition at line 182 of file ScalarAlgebra.h.

◆ Zero()

boost::any ScalarAlgebra::Zero ( std::type_info const &  type)
static

Compute a zero scalar.

Parameters
[in]typeWe need a zero object of this type

Definition at line 25 of file ScalarAlgebra.cpp.

Referenced by muq::Modeling::AnyAlgebra::Zero().


The documentation for this class was generated from the following files: