drasil-lang-0.1.60.0: A framework for code and document generation for scientific software - Language SubPackage
Safe HaskellSafe-Inferred
LanguageHaskell2010

Language.Drasil.Expr.Class

Synopsis

Documentation

class ExprC r where Source #

Methods

lit :: Literal -> r Source #

($=) :: r -> r -> r infixr 4 Source #

($!=) :: r -> r -> r Source #

($<) :: r -> r -> r Source #

Smart constructor for ordering two equations.

($>) :: r -> r -> r Source #

Smart constructor for ordering two equations.

($<=) :: r -> r -> r Source #

Smart constructor for ordering two equations.

($>=) :: r -> r -> r Source #

Smart constructor for ordering two equations.

($.) :: r -> r -> r Source #

Smart constructor for the dot product of two equations.

addI :: r -> r -> r Source #

Add two expressions (Integers).

addRe :: r -> r -> r Source #

Add two expressions (Real numbers).

mulI :: r -> r -> r Source #

Multiply two expressions (Integers).

mulRe :: r -> r -> r Source #

Multiply two expressions (Real numbers).

($-) :: r -> r -> r Source #

($/) :: r -> r -> r infixl 7 Source #

($^) :: r -> r -> r infixr 8 Source #

($=>) :: r -> r -> r Source #

($<=>) :: r -> r -> r Source #

($&&) :: r -> r -> r infixr 9 Source #

($||) :: r -> r -> r infixr 9 Source #

abs_ :: r -> r Source #

Smart constructor for taking the absolute value of an expression.

neg :: r -> r Source #

Smart constructor for negating an expression.

log :: r -> r Source #

Smart constructor to take the log of an expression.

ln :: r -> r Source #

Smart constructor to take the ln of an expression.

sqrt :: r -> r Source #

Smart constructor to take the square root of an expression.

sin :: r -> r Source #

Smart constructor to apply sin to an expression.

cos :: r -> r Source #

Smart constructor to apply cos to an expression.

tan :: r -> r Source #

Smart constructor to apply tan to an expression.

sec :: r -> r Source #

Smart constructor to apply sec to an expression.

csc :: r -> r Source #

Smart constructor to apply csc to an expression.

cot :: r -> r Source #

Smart constructor to apply cot to an expression.

arcsin :: r -> r Source #

Smart constructor to apply arcsin to an expression.

arccos :: r -> r Source #

Smart constructor to apply arccos to an expression.

arctan :: r -> r Source #

Smart constructor to apply arctan to an expression.

exp :: r -> r Source #

Smart constructor for the exponential (base e) function.

dim :: r -> r Source #

Smart constructor for calculating the dimension of a vector.

norm :: r -> r Source #

Smart constructor for calculating the normal form of a vector.

negVec :: r -> r Source #

Smart constructor for negating vectors.

not_ :: r -> r Source #

Smart constructor for applying logical negation to an expression.

idx :: r -> r -> r Source #

Smart constructor for indexing.

defint :: Symbol -> r -> r -> r -> r Source #

Smart constructor for the summation, product, and integral functions over an interval.

defsum :: Symbol -> r -> r -> r -> r Source #

Smart constructor for the summation, product, and integral functions over an interval.

defprod :: Symbol -> r -> r -> r -> r Source #

Smart constructor for the summation, product, and integral functions over an interval.

realInterval :: HasUID c => c -> RealInterval r r -> r Source #

Smart constructor for 'real interval' membership.

euclidean :: [r] -> r Source #

Euclidean function : takes a vector and returns the sqrt of the sum-of-squares.

cross :: r -> r -> r Source #

Smart constructor to cross product two expressions.

vScale :: r -> r -> r Source #

Smart constructor for vector scaling

vAdd :: r -> r -> r Source #

Vector Addition

vSub :: r -> r -> r Source #

Vector Subtraction

completeCase :: [(r, r)] -> r Source #

Smart constructor for case statements with a complete set of cases.

incompleteCase :: [(r, r)] -> r Source #

Smart constructor for case statements with an incomplete set of cases.

matrix :: [[r]] -> r Source #

Create a matrix.

apply :: (HasUID f, HasSymbol f) => f -> [r] -> r Source #

Applies a given function with a list of parameters.

sy :: (HasUID c, HasSymbol c) => c -> r Source #

Create an Expr from a Symbolic Chunk.

Instances

Instances details
ExprC CodeExpr Source # 
Instance details

Defined in Language.Drasil.Expr.Class

Methods

lit :: Literal -> CodeExpr Source #

($=) :: CodeExpr -> CodeExpr -> CodeExpr Source #

($!=) :: CodeExpr -> CodeExpr -> CodeExpr Source #

($<) :: CodeExpr -> CodeExpr -> CodeExpr Source #

($>) :: CodeExpr -> CodeExpr -> CodeExpr Source #

($<=) :: CodeExpr -> CodeExpr -> CodeExpr Source #

($>=) :: CodeExpr -> CodeExpr -> CodeExpr Source #

($.) :: CodeExpr -> CodeExpr -> CodeExpr Source #

addI :: CodeExpr -> CodeExpr -> CodeExpr Source #

addRe :: CodeExpr -> CodeExpr -> CodeExpr Source #

mulI :: CodeExpr -> CodeExpr -> CodeExpr Source #

mulRe :: CodeExpr -> CodeExpr -> CodeExpr Source #

($-) :: CodeExpr -> CodeExpr -> CodeExpr Source #

($/) :: CodeExpr -> CodeExpr -> CodeExpr Source #

($^) :: CodeExpr -> CodeExpr -> CodeExpr Source #

($=>) :: CodeExpr -> CodeExpr -> CodeExpr Source #

($<=>) :: CodeExpr -> CodeExpr -> CodeExpr Source #

($&&) :: CodeExpr -> CodeExpr -> CodeExpr Source #

($||) :: CodeExpr -> CodeExpr -> CodeExpr Source #

abs_ :: CodeExpr -> CodeExpr Source #

neg :: CodeExpr -> CodeExpr Source #

log :: CodeExpr -> CodeExpr Source #

ln :: CodeExpr -> CodeExpr Source #

sqrt :: CodeExpr -> CodeExpr Source #

sin :: CodeExpr -> CodeExpr Source #

cos :: CodeExpr -> CodeExpr Source #

tan :: CodeExpr -> CodeExpr Source #

sec :: CodeExpr -> CodeExpr Source #

csc :: CodeExpr -> CodeExpr Source #

cot :: CodeExpr -> CodeExpr Source #

arcsin :: CodeExpr -> CodeExpr Source #

arccos :: CodeExpr -> CodeExpr Source #

arctan :: CodeExpr -> CodeExpr Source #

exp :: CodeExpr -> CodeExpr Source #

dim :: CodeExpr -> CodeExpr Source #

norm :: CodeExpr -> CodeExpr Source #

negVec :: CodeExpr -> CodeExpr Source #

not_ :: CodeExpr -> CodeExpr Source #

idx :: CodeExpr -> CodeExpr -> CodeExpr Source #

defint :: Symbol -> CodeExpr -> CodeExpr -> CodeExpr -> CodeExpr Source #

defsum :: Symbol -> CodeExpr -> CodeExpr -> CodeExpr -> CodeExpr Source #

defprod :: Symbol -> CodeExpr -> CodeExpr -> CodeExpr -> CodeExpr Source #

realInterval :: HasUID c => c -> RealInterval CodeExpr CodeExpr -> CodeExpr Source #

euclidean :: [CodeExpr] -> CodeExpr Source #

cross :: CodeExpr -> CodeExpr -> CodeExpr Source #

vScale :: CodeExpr -> CodeExpr -> CodeExpr Source #

vAdd :: CodeExpr -> CodeExpr -> CodeExpr Source #

vSub :: CodeExpr -> CodeExpr -> CodeExpr Source #

completeCase :: [(CodeExpr, CodeExpr)] -> CodeExpr Source #

incompleteCase :: [(CodeExpr, CodeExpr)] -> CodeExpr Source #

matrix :: [[CodeExpr]] -> CodeExpr Source #

apply :: (HasUID f, HasSymbol f) => f -> [CodeExpr] -> CodeExpr Source #

sy :: (HasUID c, HasSymbol c) => c -> CodeExpr Source #

ExprC Expr Source # 
Instance details

Defined in Language.Drasil.Expr.Class

Methods

lit :: Literal -> Expr Source #

($=) :: Expr -> Expr -> Expr Source #

($!=) :: Expr -> Expr -> Expr Source #

($<) :: Expr -> Expr -> Expr Source #

($>) :: Expr -> Expr -> Expr Source #

($<=) :: Expr -> Expr -> Expr Source #

($>=) :: Expr -> Expr -> Expr Source #

($.) :: Expr -> Expr -> Expr Source #

addI :: Expr -> Expr -> Expr Source #

addRe :: Expr -> Expr -> Expr Source #

mulI :: Expr -> Expr -> Expr Source #

mulRe :: Expr -> Expr -> Expr Source #

($-) :: Expr -> Expr -> Expr Source #

($/) :: Expr -> Expr -> Expr Source #

($^) :: Expr -> Expr -> Expr Source #

($=>) :: Expr -> Expr -> Expr Source #

($<=>) :: Expr -> Expr -> Expr Source #

($&&) :: Expr -> Expr -> Expr Source #

($||) :: Expr -> Expr -> Expr Source #

abs_ :: Expr -> Expr Source #

neg :: Expr -> Expr Source #

log :: Expr -> Expr Source #

ln :: Expr -> Expr Source #

sqrt :: Expr -> Expr Source #

sin :: Expr -> Expr Source #

cos :: Expr -> Expr Source #

tan :: Expr -> Expr Source #

sec :: Expr -> Expr Source #

csc :: Expr -> Expr Source #

cot :: Expr -> Expr Source #

arcsin :: Expr -> Expr Source #

arccos :: Expr -> Expr Source #

arctan :: Expr -> Expr Source #

exp :: Expr -> Expr Source #

dim :: Expr -> Expr Source #

norm :: Expr -> Expr Source #

negVec :: Expr -> Expr Source #

not_ :: Expr -> Expr Source #

idx :: Expr -> Expr -> Expr Source #

defint :: Symbol -> Expr -> Expr -> Expr -> Expr Source #

defsum :: Symbol -> Expr -> Expr -> Expr -> Expr Source #

defprod :: Symbol -> Expr -> Expr -> Expr -> Expr Source #

realInterval :: HasUID c => c -> RealInterval Expr Expr -> Expr Source #

euclidean :: [Expr] -> Expr Source #

cross :: Expr -> Expr -> Expr Source #

vScale :: Expr -> Expr -> Expr Source #

vAdd :: Expr -> Expr -> Expr Source #

vSub :: Expr -> Expr -> Expr Source #

completeCase :: [(Expr, Expr)] -> Expr Source #

incompleteCase :: [(Expr, Expr)] -> Expr Source #

matrix :: [[Expr]] -> Expr Source #

apply :: (HasUID f, HasSymbol f) => f -> [Expr] -> Expr Source #

sy :: (HasUID c, HasSymbol c) => c -> Expr Source #

ExprC ModelExpr Source # 
Instance details

Defined in Language.Drasil.Expr.Class

Methods

lit :: Literal -> ModelExpr Source #

($=) :: ModelExpr -> ModelExpr -> ModelExpr Source #

($!=) :: ModelExpr -> ModelExpr -> ModelExpr Source #

($<) :: ModelExpr -> ModelExpr -> ModelExpr Source #

($>) :: ModelExpr -> ModelExpr -> ModelExpr Source #

($<=) :: ModelExpr -> ModelExpr -> ModelExpr Source #

($>=) :: ModelExpr -> ModelExpr -> ModelExpr Source #

($.) :: ModelExpr -> ModelExpr -> ModelExpr Source #

addI :: ModelExpr -> ModelExpr -> ModelExpr Source #

addRe :: ModelExpr -> ModelExpr -> ModelExpr Source #

mulI :: ModelExpr -> ModelExpr -> ModelExpr Source #

mulRe :: ModelExpr -> ModelExpr -> ModelExpr Source #

($-) :: ModelExpr -> ModelExpr -> ModelExpr Source #

($/) :: ModelExpr -> ModelExpr -> ModelExpr Source #

($^) :: ModelExpr -> ModelExpr -> ModelExpr Source #

($=>) :: ModelExpr -> ModelExpr -> ModelExpr Source #

($<=>) :: ModelExpr -> ModelExpr -> ModelExpr Source #

($&&) :: ModelExpr -> ModelExpr -> ModelExpr Source #

($||) :: ModelExpr -> ModelExpr -> ModelExpr Source #

abs_ :: ModelExpr -> ModelExpr Source #

neg :: ModelExpr -> ModelExpr Source #

log :: ModelExpr -> ModelExpr Source #

ln :: ModelExpr -> ModelExpr Source #

sqrt :: ModelExpr -> ModelExpr Source #

sin :: ModelExpr -> ModelExpr Source #

cos :: ModelExpr -> ModelExpr Source #

tan :: ModelExpr -> ModelExpr Source #

sec :: ModelExpr -> ModelExpr Source #

csc :: ModelExpr -> ModelExpr Source #

cot :: ModelExpr -> ModelExpr Source #

arcsin :: ModelExpr -> ModelExpr Source #

arccos :: ModelExpr -> ModelExpr Source #

arctan :: ModelExpr -> ModelExpr Source #

exp :: ModelExpr -> ModelExpr Source #

dim :: ModelExpr -> ModelExpr Source #

norm :: ModelExpr -> ModelExpr Source #

negVec :: ModelExpr -> ModelExpr Source #

not_ :: ModelExpr -> ModelExpr Source #

idx :: ModelExpr -> ModelExpr -> ModelExpr Source #

defint :: Symbol -> ModelExpr -> ModelExpr -> ModelExpr -> ModelExpr Source #

defsum :: Symbol -> ModelExpr -> ModelExpr -> ModelExpr -> ModelExpr Source #

defprod :: Symbol -> ModelExpr -> ModelExpr -> ModelExpr -> ModelExpr Source #

realInterval :: HasUID c => c -> RealInterval ModelExpr ModelExpr -> ModelExpr Source #

euclidean :: [ModelExpr] -> ModelExpr Source #

cross :: ModelExpr -> ModelExpr -> ModelExpr Source #

vScale :: ModelExpr -> ModelExpr -> ModelExpr Source #

vAdd :: ModelExpr -> ModelExpr -> ModelExpr Source #

vSub :: ModelExpr -> ModelExpr -> ModelExpr Source #

completeCase :: [(ModelExpr, ModelExpr)] -> ModelExpr Source #

incompleteCase :: [(ModelExpr, ModelExpr)] -> ModelExpr Source #

matrix :: [[ModelExpr]] -> ModelExpr Source #

apply :: (HasUID f, HasSymbol f) => f -> [ModelExpr] -> ModelExpr Source #

sy :: (HasUID c, HasSymbol c) => c -> ModelExpr Source #

frac :: (ExprC r, LiteralC r) => Integer -> Integer -> r Source #

Smart constructor for fractions.

recip_ :: (ExprC r, LiteralC r) => r -> r Source #

Smart constructor for rational expressions (only in 1/x form).

square :: (ExprC r, LiteralC r) => r -> r Source #

Smart constructor to square a function.

half :: (ExprC r, LiteralC r) => r -> r Source #

Smart constructor to half a function exactly.

oneHalf :: (ExprC r, LiteralC r) => r Source #

1/2, as an expression.

oneThird :: (ExprC r, LiteralC r) => r Source #

1/3rd, as an expression.

apply1 :: (ExprC r, HasUID f, HasSymbol f, HasUID a, HasSymbol a) => f -> a -> r Source #

Similar to apply, but converts second argument into Symbols.

apply2 :: (ExprC r, HasUID f, HasSymbol f, HasUID a, HasSymbol a, HasUID b, HasSymbol b) => f -> a -> b -> r Source #

Similar to apply, but the applied function takes two parameters (which are both Symbols).

m2x2 :: ExprC r => r -> r -> r -> r -> r Source #

Create a two-by-two matrix from four given values. For example:

>>> m2x2 1 2 3 4
[ [1,2],
  [3,4] ]

vec2D :: ExprC r => r -> r -> r Source #

Create a 2D vector (a matrix with two rows, one column). First argument is placed above the second.

dgnl2x2 :: (ExprC r, LiteralC r) => r -> r -> r Source #

Creates a diagonal two-by-two matrix. For example:

>>> dgnl2x2 1 2
[ [1, 0],
  [0, 2] ]

rowVec :: ExprC r => [r] -> r Source #

Create a row vector

columnVec :: ExprC r => [r] -> r Source #

Create a column vector