GenSolver


Equation

Namespace: Informedica.GenSolver.Lib

Functions that handle the Equation type that either represents a ProductEquation
y = x1 * x2 ... * xn
or a SumEquations
y = x1 * x2
... * xn

Nested types and modules

TypeDescription
Equation

An equation is either a ProductEquation or a Sumequation, the first variable is the dependent variable, i.e. the result of the equation, the second part are the independent variables in the equation

EquationException

Equation exception

Message

Error messages

Functions and values

Function or valueDescription
apply fp fs _arg1
Signature: fp:(Variable -> Variable list -> '?7045) -> fs:(Variable -> Variable list -> '?7045) -> _arg1:Equation -> '?7045
Type parameters: '?7045

Apply fp to a ProductEquation and fs to a SumEquation.

contains v
Signature: v:Variable -> Equation -> bool

Check whether an Equation contains a Variable v

create c succ fail (y, xs)
Signature: c:(Variable * Variable list -> '?7038) -> succ:('?7038 -> '?7039) -> fail:(Message -> '?7039) -> (y:Variable * xs:Variable list) -> '?7039
Type parameters: '?7038, '?7039

Create an Equation with an y and xs. Fails if a variable is added more than one time using the fail function. The type of Equation product or sum is determined by the constructor c.

createProductEq
Signature: (Equation -> Equation) -> (Message -> Equation) -> Variable * Variable list -> Equation

Create an ProductEquation with an y and xs. Fails if a variable is added more than one time using the fail function.

createProductEqExc
Signature: Variable * Variable list -> Equation

Create an ProductEquation with an y and xs. Fails if a variable is added more than one time raising an exception.

createSumEq
Signature: (Equation -> Equation) -> (Message -> Equation) -> Variable * Variable list -> Equation

Create an SumEquation with an y and xs. Fails if a variable is added more than one time using the fail function.

createSumEqExc
Signature: Variable * Variable list -> Equation

Create an SumEquation with an y and xs. Fails if a variable is added more than one time raising an exception.

equals eq1 eq2
Signature: eq1:Equation -> eq2:Equation -> bool

Check whether Equations eq1 and eq2 are equal

find vr eq
Signature: vr:Variable -> eq:Equation -> Variable list

Find a Variable vr in an Equation eq and return the result in a list

findName n eq
Signature: n:Name -> eq:Equation -> Variable list

Find a Variable with Name n in an Equation eq and return the result as a list

isProduct
Signature: Equation -> bool

Check whether an Equation is a product equation

isSolvable _arg1
Signature: _arg1:Equation -> bool
isSolved _arg1
Signature: _arg1:Equation -> bool
isSum
Signature: Equation -> bool

Check whether an Equation is a sum equation

nonZeroOrNegative e
Signature: e:Equation -> Equation

Make sure that the Variables in the Equation can only contain positive non zero values.

raiseExc m
Signature: m:Message -> '?7036
Type parameters: '?7036

Raise an EquationException with Message m.

replace v e
Signature: v:Variable -> e:Equation -> Equation

Replace a Variable v in the Equation e.

solve e
Signature: e:Equation -> Variable list

Solve an equation e, return a list of changed Variables.

toVars
Signature: Equation -> Variable list

Turn an Equation into a list of Variable

Fork me on GitHub