Add adapters of scalar functions to MST and vice versa #150

Merged
CommanderTvis merged 23 commits from kotlingrad into dev 2020-11-01 21:09:45 +03:00
Showing only changes of commit 31c71e0fad - Show all commits

View File

@ -3,10 +3,29 @@ package kscience.kmath.ast.kotlingrad
altavir commented 2020-10-13 15:36:56 +03:00 (Migrated from github.com)
Review

change to toMst()

change to toMst()
altavir commented 2020-10-13 15:36:56 +03:00 (Migrated from github.com)
Review

change to toMst()

change to toMst()
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
altavir commented 2020-10-13 15:36:56 +03:00 (Migrated from github.com)
Review

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.
altavir commented 2020-10-13 15:36:56 +03:00 (Migrated from github.com)
Review

change to toMst()

change to toMst()
*
altavir commented 2020-10-13 15:36:56 +03:00 (Migrated from github.com)
Review

change to toMst()

change to toMst()
* Detailed mapping is:
altavir commented 2020-10-13 15:36:56 +03:00 (Migrated from github.com)
Review

change to toMst()

change to toMst()
*
altavir commented 2020-10-13 15:36:56 +03:00 (Migrated from github.com)
Review

change to toMst()

change to toMst()
* - [SVar] -> [MstExtendedField.symbol];
altavir commented 2020-10-13 15:36:56 +03:00 (Migrated from github.com)
Review

change to toMst()

change to toMst()
* - [SConst] -> [MstExtendedField.number];
altavir commented 2020-10-13 15:36:56 +03:00 (Migrated from github.com)
Review

change to toMst()

change to toMst()
* - [Sum] -> [MstExtendedField.add];
altavir commented 2020-10-13 15:36:56 +03:00 (Migrated from github.com)
Review

change to toMst()

change to toMst()
* - [Prod] -> [MstExtendedField.multiply];
altavir commented 2020-10-13 15:36:56 +03:00 (Migrated from github.com)
Review

change to toMst()

change to toMst()
* - [Power] -> [MstExtendedField.power] (limited);
altavir commented 2020-10-13 15:36:56 +03:00 (Migrated from github.com)
Review

change to toMst()

change to toMst()
* - [Negative] -> [MstExtendedField.unaryMinus];
altavir commented 2020-10-13 15:36:56 +03:00 (Migrated from github.com)
Review

change to toMst()

change to toMst()
* - [Log] -> [MstExtendedField.ln] (left) / [MstExtendedField.ln] (right);
altavir commented 2020-10-13 15:36:56 +03:00 (Migrated from github.com)
Review

change to toMst()

change to toMst()
* - [Sine] -> [MstExtendedField.sin];
altavir commented 2020-10-13 15:36:56 +03:00 (Migrated from github.com)
Review

change to toMst()

change to toMst()
* - [Cosine] -> [MstExtendedField.cos];
altavir commented 2020-10-13 15:36:56 +03:00 (Migrated from github.com)
Review

change to toMst()

change to toMst()
* - [Tangent] -> [MstExtendedField.tan];
altavir commented 2020-10-13 15:36:56 +03:00 (Migrated from github.com)
Review

change to toMst()

change to toMst()
* - [DProd] is vector operation, and it is requested to be evaluated;
altavir commented 2020-10-13 15:36:56 +03:00 (Migrated from github.com)
Review

change to toMst()

change to toMst()
* - [SComposition] is also requested to be evaluated eagerly;
altavir commented 2020-10-13 15:36:56 +03:00 (Migrated from github.com)
Review

change to toMst()

change to toMst()
* - [VSumAll] is requested to be evaluated;
altavir commented 2020-10-13 15:36:56 +03:00 (Migrated from github.com)
Review

change to toMst()

change to toMst()
* - [Derivative] is requested to be evaluated.
altavir commented 2020-10-13 15:36:56 +03:00 (Migrated from github.com)
Review

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
altavir commented 2020-10-13 15:36:56 +03:00 (Migrated from github.com)
Review

change to toMst()

change to toMst()
altavir commented 2020-10-13 15:36:56 +03:00 (Migrated from github.com)
Review

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:
altavir commented 2020-10-13 15:36:56 +03:00 (Migrated from github.com)
Review

change to toMst()

change to toMst()
*
altavir commented 2020-10-13 15:36:56 +03:00 (Migrated from github.com)
Review

change to toMst()

change to toMst()
* - [MST.Numeric] -> [SConst];
altavir commented 2020-10-13 15:36:56 +03:00 (Migrated from github.com)
Review

change to toMst()

change to toMst()
* - [MST.Symbolic] -> [SVar];
altavir commented 2020-10-13 15:36:56 +03:00 (Migrated from github.com)
Review

change to toMst()

change to toMst()
* - [MST.Unary] -> [Negative], [Sine], [Cosine], [Tangent], [Power], [Log];
altavir commented 2020-10-13 15:36:56 +03:00 (Migrated from github.com)
Review

change to toMst()

change to toMst()
* - [MST.Binary] -> [Sum], [Prod], [Power].
altavir commented 2020-10-13 15:36:56 +03:00 (Migrated from github.com)
Review

change to toMst()

change to toMst()
*
altavir commented 2020-10-13 15:36:56 +03:00 (Migrated from github.com)
Review

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.

altavir commented 2020-10-13 15:36:56 +03:00 (Migrated from github.com)
Review

change to toMst()

change to toMst()
altavir commented 2020-10-13 15:36:56 +03:00 (Migrated from github.com)
Review

change to toMst()

change to toMst()