OASIS
Open Algebra Software
Loading...
Searching...
No Matches
Oasis Namespace Reference

Classes

class  Add
 The Add expression adds two expressions together. More...
 
class  BinaryExpression
 A binary expression. More...
 
class  BoundedBinaryExpression
 
class  BoundedExpression
 
class  BoundedUnaryExpression
 
class  DefiniteIntegral
 
class  Derivative
 The Derivative class template calculates the derivative of given expressions. More...
 
class  Divide
 The Divide expression divides two expressions. More...
 
class  EulerNumber
 An 'EulerNumber' number. More...
 
class  Exponent
 The exponent expression creates an exponent two expressions. More...
 
class  Expression
 An expression. More...
 
class  Imaginary
 An 'imaginary' number. More...
 
class  Integral
 The Integral expression integrates the two expressions together. More...
 
class  LeafExpression
 A leaf expression. More...
 
class  Log
 The Log expression represents the logarithm of a base and an argument. More...
 
class  Magnitude
 
class  Matrix
 A matrix. More...
 
class  Multiply
 The Multiply expression multiplies two expressions. More...
 
class  Negate
 
class  Pi
 Mathematical Constant Pi. More...
 
class  Real
 A real number. More...
 
class  SerializationVisitor
 
class  Subtract
 The Subtract expression subtracts two expressions. More...
 
class  Summation
 
class  UnaryExpression
 
class  Undefined
 An undefined expression. More...
 
class  Variable
 An algebraic variable. More...
 

Concepts

concept  IOperand
 A concept for an operand of a binary expression.
 
concept  IAssociativeAndCommutative
 
concept  IExpression
 An expression concept.
 
concept  IsAnyOf
 Checks if type T is same as any of the provided types in U.
 
concept  DerivedFromBinaryExpression
 
concept  DerivedFromUnaryExpression
 

Typedefs

typedef Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic, Eigen::RowMajor > MatrixXXD
 
typedef Eigen::Matrix< double, Eigen::Dynamic, 1 > Matrix1D
 

Enumerations

enum class  ExpressionType {
  None , Real , Imaginary , Variable ,
  Add , Subtract , Multiply , Divide ,
  Exponent , Log , Integral , Limit ,
  Derivative , Negate , Sqrt , Matrix ,
  Pi , EulerNumber , Magnitude
}
 The type of an expression. More...
 
enum  ExpressionCategory : uint32_t {
  None = 0 , Associative = 1 , Commutative = 1 << 1 , BinExp = 1 << 2 ,
  UnExp = 1 << 3
}
 The category of an expression. More...
 

Functions

template<template< typename, typename > typename T>
requires IAssociativeAndCommutative<T>
auto BuildFromVector (const std::vector< std::unique_ptr< Expression > > &ops) -> std::unique_ptr< T< Expression, Expression > >
 Builds a reasonably balanced binary expression from a vector of operands.
 
auto SolveLinearSystems (std::vector< std::unique_ptr< Expression > > &exprs) -> std::map< std::string, double >
 
auto SolveLinearSystems (MatrixXXD &matrix) -> Matrix1D
 
auto SolveLinearSystems (MatrixXXD &matrixA, Matrix1D &matrixb) -> Matrix1D
 From the form Ax=b.
 
auto ConstructMatrices (const std::vector< std::unique_ptr< Expression > > &exprs) -> std::pair< std::pair< MatrixXXD, Matrix1D >, std::map< std::string, Eigen::Index > >
 
template<class u , class v >
auto GetMapValue (std::map< u, v > &map, u key, v nextValue) -> std::pair< v, bool >
 
template<IExpression T>
requires DerivedFromBinaryExpression<T>
auto RecursiveCast (const Expression &other) -> std::unique_ptr< T >
 
template<IExpression T>
requires DerivedFromUnaryExpression<T>
auto RecursiveCast (const Expression &other) -> std::unique_ptr< T >
 
template<IExpression T>
auto RecursiveCast (const Expression &other) -> std::unique_ptr< T >
 

Typedef Documentation

◆ Matrix1D

typedef Eigen::Matrix< double, Eigen::Dynamic, 1 > Oasis::Matrix1D

◆ MatrixXXD

typedef Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic, Eigen::RowMajor > Oasis::MatrixXXD

Enumeration Type Documentation

◆ ExpressionCategory

enum Oasis::ExpressionCategory : uint32_t

The category of an expression.

Enumerator
None 
Associative 
Commutative 
BinExp 
UnExp 

◆ ExpressionType

enum class Oasis::ExpressionType
strong

The type of an expression.

Enumerator
None 
Real 
Imaginary 
Variable 
Add 
Subtract 
Multiply 
Divide 
Exponent 
Log 
Integral 
Limit 
Derivative 
Negate 
Sqrt 
Matrix 
Pi 
EulerNumber 
Magnitude 

Function Documentation

◆ BuildFromVector()

template<template< typename, typename > typename T>
requires IAssociativeAndCommutative<T>
auto Oasis::BuildFromVector ( const std::vector< std::unique_ptr< Expression > > & ops) -> std::unique_ptr<T<Expression, Expression>>

Builds a reasonably balanced binary expression from a vector of operands.

Template Parameters
TThe type of the binary expression, e.g. Add or Multiply.
Parameters
opsThe vector of operands. Must have a minimum of 2 operands.
Returns
A binary expression with the operands in the vector, or a nullptr if ops.size() <=1.

◆ ConstructMatrices()

auto Oasis::ConstructMatrices ( const std::vector< std::unique_ptr< Expression > > & exprs) -> std::pair<std::pair<MatrixXXD, Matrix1D>, std::map<std::string, Eigen::Index>>
Parameters
exprsA vector of simplified expressions
Returns
Dynamic Float matrix with the provided expressions inserted

◆ GetMapValue()

template<class u , class v >
auto Oasis::GetMapValue ( std::map< u, v > & map,
u key,
v nextValue ) -> std::pair<v, bool>
Template Parameters
ukey type
vvalue type
Parameters
mapA map that maps some key to a value
keyThe key you are searching for
nextValueWhat the next assigned value should be assuming that the key doesn't already have one. If no value is found, this value will be assigned to this key.
Returns
returns the value that is associated with the key and a boolean to say whether the nextValue was used.

◆ RecursiveCast() [1/3]

template<IExpression T>
requires DerivedFromBinaryExpression<T>
auto Oasis::RecursiveCast ( const Expression & other) -> std::unique_ptr<T>

◆ RecursiveCast() [2/3]

template<IExpression T>
requires DerivedFromUnaryExpression<T>
auto Oasis::RecursiveCast ( const Expression & other) -> std::unique_ptr<T>

◆ RecursiveCast() [3/3]

template<IExpression T>
auto Oasis::RecursiveCast ( const Expression & other) -> std::unique_ptr<T>

◆ SolveLinearSystems() [1/3]

auto Oasis::SolveLinearSystems ( MatrixXXD & matrix) -> Matrix1D
Parameters
matrixto solve (in row echelon form)
Returns
matrix of values that solves the input matrix

◆ SolveLinearSystems() [2/3]

auto Oasis::SolveLinearSystems ( MatrixXXD & matrixA,
Matrix1D & matrixb ) -> Matrix1D

From the form Ax=b.

Parameters
matrixAMatrix that holds coefficients
matrixbMatrix that holds constants
Returns
x matrix that solves the A and b matrices

◆ SolveLinearSystems() [3/3]

auto Oasis::SolveLinearSystems ( std::vector< std::unique_ptr< Expression > > & exprs) -> std::map<std::string, double>
Parameters
exprsA vector of expressions
Returns
map of variable to their values