diff --git a/build.gradle.kts b/build.gradle.kts index 4de6d8bad..86394d792 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -10,7 +10,9 @@ allprojects { maven("http://logicrunch.research.it.uu.se/maven") { isAllowInsecureProtocol = true } - maven("https://oss.sonatype.org/content/repositories/snapshots") + maven("https://oss.sonatype.org/content/repositories/snapshots") { + + } mavenCentral() } @@ -27,11 +29,13 @@ subprojects { dokkaSourceSets.all { val readmeFile = File(this@subprojects.projectDir, "README.md") - if (readmeFile.exists()) includes.setFrom(includes + readmeFile.absolutePath) + if (readmeFile.exists()) includes.from(readmeFile.absolutePath) externalDocumentationLink("http://ejml.org/javadoc/") externalDocumentationLink("https://commons.apache.org/proper/commons-math/javadocs/api-3.6.1/") externalDocumentationLink("https://deeplearning4j.org/api/latest/") + externalDocumentationLink("https://axelclk.bitbucket.io/symja/javadoc/") externalDocumentationLink("https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-core/") + externalDocumentationLink("https://breandan.net/kotlingrad/kotlingrad/", "https://breandan.net/kotlingrad/kotlingrad/kotlingrad/package-list") } } } diff --git a/gradle.properties b/gradle.properties index 7e9516660..3aaade368 100644 --- a/gradle.properties +++ b/gradle.properties @@ -9,5 +9,5 @@ kotlin.mpp.stability.nowarn=true kotlin.native.enableDependencyPropagation=false kotlin.parallel.tasks.in.project=true org.gradle.configureondemand=true -org.gradle.jvmargs=-XX:MaxMetaspaceSize=1G +org.gradle.jvmargs=-XX:MaxMetaspaceSize=2G org.gradle.parallel=true diff --git a/kmath-symja/build.gradle.kts b/kmath-symja/build.gradle.kts index c06020bb6..c67b42e3f 100644 --- a/kmath-symja/build.gradle.kts +++ b/kmath-symja/build.gradle.kts @@ -11,7 +11,14 @@ plugins { description = "Symja integration module" dependencies { - api("org.matheclipse:matheclipse-core:2.0.0-SNAPSHOT") + api("org.matheclipse:matheclipse-core:2.0.0-SNAPSHOT") { + // Incorrect transitive dependency org.apfloat:apfloat:1.10.0-SNAPSHOT + exclude("org.apfloat", "apfloat") + } + + // Replace for org.apfloat:apfloat:1.10.0-SNAPSHOT + api("org.apfloat:apfloat:1.10.0") + api(project(":kmath-core")) testImplementation("org.slf4j:slf4j-simple:1.7.30") } diff --git a/kmath-symja/src/main/kotlin/space/kscience/kmath/symja/SymjaExpression.kt b/kmath-symja/src/main/kotlin/space/kscience/kmath/symja/SymjaExpression.kt index 301678916..a6773c709 100644 --- a/kmath-symja/src/main/kotlin/space/kscience/kmath/symja/SymjaExpression.kt +++ b/kmath-symja/src/main/kotlin/space/kscience/kmath/symja/SymjaExpression.kt @@ -7,17 +7,28 @@ package space.kscience.kmath.symja import org.matheclipse.core.eval.ExprEvaluator import org.matheclipse.core.expression.F -import space.kscience.kmath.expressions.DifferentiableExpression +import space.kscience.kmath.expressions.SpecialDifferentiableExpression import space.kscience.kmath.expressions.MST import space.kscience.kmath.expressions.Symbol import space.kscience.kmath.expressions.interpret import space.kscience.kmath.operations.NumericAlgebra +/** + * Represents [MST] based [DifferentiableExpression] relying on [Symja](https://github.com/axkr/symja_android_library). + * + * The principle of this API is converting the [mst] to an [org.matheclipse.core.interfaces.IExpr], differentiating it + * with Symja's [F.D], then converting [org.matheclipse.core.interfaces.IExpr] back to [MST]. + * + * @param T The type of number. + * @param A The [NumericAlgebra] of [T]. + * @property algebra The [A] instance. + * @property mst The [MST] node. + */ public class SymjaExpression>( public val algebra: A, public val mst: MST, public val evaluator: ExprEvaluator = DEFAULT_EVALUATOR, -) : DifferentiableExpression> { +) : SpecialDifferentiableExpression> { public override fun invoke(arguments: Map): T = mst.interpret(algebra, arguments) public override fun derivativeOrNull(symbols: List): SymjaExpression = SymjaExpression(