Add adapters of scalar functions to MST and vice versa #150
@ -3,10 +3,29 @@ package kscience.kmath.ast.kotlingrad
|
|||||||
|
|||||||
import edu.umontreal.kotlingrad.experimental.*
|
import edu.umontreal.kotlingrad.experimental.*
|
||||||
import kscience.kmath.ast.MST
|
import kscience.kmath.ast.MST
|
||||||
import kscience.kmath.ast.MstExtendedField
|
import kscience.kmath.ast.MstExtendedField
|
||||||
|
import kscience.kmath.ast.MstExtendedField.unaryMinus
|
||||||
change to toMst() change to toMst()
|
|||||||
import kscience.kmath.operations.*
|
import kscience.kmath.operations.*
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Maps [SFun] objects to [MST]. Some unsupported operations like [Derivative] are bound and converted then.
|
* Maps [SFun] objects to [MST]. Some unsupported operations like [Derivative] are bound and converted then.
|
||||||
|
* [Power] operation is limited to constant right-hand side arguments.
|
||||||
change to toMst() change to toMst()
|
|||||||
|
*
|
||||||
change to toMst() change to toMst()
|
|||||||
|
* Detailed mapping is:
|
||||||
change to toMst() change to toMst()
|
|||||||
|
*
|
||||||
change to toMst() change to toMst()
|
|||||||
|
* - [SVar] -> [MstExtendedField.symbol];
|
||||||
change to toMst() change to toMst()
|
|||||||
|
* - [SConst] -> [MstExtendedField.number];
|
||||||
change to toMst() change to toMst()
|
|||||||
|
* - [Sum] -> [MstExtendedField.add];
|
||||||
change to toMst() change to toMst()
|
|||||||
|
* - [Prod] -> [MstExtendedField.multiply];
|
||||||
change to toMst() change to toMst()
|
|||||||
|
* - [Power] -> [MstExtendedField.power] (limited);
|
||||||
change to toMst() change to toMst()
|
|||||||
|
* - [Negative] -> [MstExtendedField.unaryMinus];
|
||||||
change to toMst() change to toMst()
|
|||||||
|
* - [Log] -> [MstExtendedField.ln] (left) / [MstExtendedField.ln] (right);
|
||||||
change to toMst() change to toMst()
|
|||||||
|
* - [Sine] -> [MstExtendedField.sin];
|
||||||
change to toMst() change to toMst()
|
|||||||
|
* - [Cosine] -> [MstExtendedField.cos];
|
||||||
change to toMst() change to toMst()
|
|||||||
|
* - [Tangent] -> [MstExtendedField.tan];
|
||||||
change to toMst() change to toMst()
|
|||||||
|
* - [DProd] is vector operation, and it is requested to be evaluated;
|
||||||
change to toMst() change to toMst()
|
|||||||
|
* - [SComposition] is also requested to be evaluated eagerly;
|
||||||
change to toMst() change to toMst()
|
|||||||
|
* - [VSumAll] is requested to be evaluated;
|
||||||
change to toMst() change to toMst()
|
|||||||
|
* - [Derivative] is requested to be evaluated.
|
||||||
change to toMst() change to toMst()
|
|||||||
*
|
*
|
||||||
* @receiver the scalar function.
|
* @receiver the scalar function.
|
||||||
* @return a node.
|
* @return a node.
|
||||||
@ -50,6 +69,13 @@ public fun <X : SFun<X>> MST.Symbolic.svar(proto: X): SVar<X> = SVar(proto, valu
|
|||||||
change to toMst() change to toMst()
change to toMst() change to toMst()
|
|||||||
/**
|
/**
|
||||||
* Maps [MST] objects to [SFun]. Unsupported operations throw [IllegalStateException].
|
* Maps [MST] objects to [SFun]. Unsupported operations throw [IllegalStateException].
|
||||||
*
|
*
|
||||||
|
* Detailed mapping is:
|
||||||
change to toMst() change to toMst()
|
|||||||
|
*
|
||||||
change to toMst() change to toMst()
|
|||||||
|
* - [MST.Numeric] -> [SConst];
|
||||||
change to toMst() change to toMst()
|
|||||||
|
* - [MST.Symbolic] -> [SVar];
|
||||||
change to toMst() change to toMst()
|
|||||||
|
* - [MST.Unary] -> [Negative], [Sine], [Cosine], [Tangent], [Power], [Log];
|
||||||
change to toMst() change to toMst()
|
|||||||
|
* - [MST.Binary] -> [Sum], [Prod], [Power].
|
||||||
change to toMst() change to toMst()
|
|||||||
|
*
|
||||||
change to toMst() change to toMst()
|
|||||||
* @receiver the node.
|
* @receiver the node.
|
||||||
* @param proto the prototype instance.
|
* @param proto the prototype instance.
|
||||||
* @return a scalar function.
|
* @return a scalar function.
|
||||||
|
|||||||
change to toMst() change to toMst()
change to toMst() change to toMst()
|
Loading…
Reference in New Issue
Block a user
change to toMst()
change to toMst()