ASM Bytecode Generation to unwrap Expressions of adv-expr API #94
9
kmath-asm/build.gradle.kts
Normal file
@ -0,0 +1,9 @@
|
||||
|
||||
plugins {
|
||||
Probably should be implementation Probably should be implementation
|
||||
id("scientifik.jvm")
|
||||
Probably should be implementation Probably should be implementation
|
||||
}
|
||||
Probably should be implementation Probably should be implementation
|
||||
|
||||
Probably should be implementation Probably should be implementation
|
||||
dependencies {
|
||||
Probably should be implementation Probably should be implementation
|
||||
api(project(path = ":kmath-core"))
|
||||
Probably should be implementation Probably should be implementation
|
||||
api("org.ow2.asm:asm:8.0.1")
|
||||
Probably should be implementation Probably should be implementation
|
||||
api("org.ow2.asm:asm-commons:8.0.1")
|
||||
Probably should be implementation Probably should be implementation
|
||||
}
|
||||
Probably should be implementation Probably should be implementation
|
@ -0,0 +1,385 @@
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Space is not actually used. Space is not actually used.
Not used Not used
Not used Not used
|
||||
package scientifik.kmath.expressions
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
import org.objectweb.asm.ClassWriter
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
import org.objectweb.asm.Label
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
import org.objectweb.asm.MethodVisitor
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
import org.objectweb.asm.Opcodes.*
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
import scientifik.kmath.operations.Algebra
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
import scientifik.kmath.operations.Field
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
import scientifik.kmath.operations.Space
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
import java.io.File
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
abstract class AsmCompiled<T>(@JvmField val algebra: Algebra<T>, @JvmField val constants: MutableList<T>) {
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
abstract fun evaluate(arguments: Map<String, T>): T
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
}
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
class AsmGenerationContext<T>(classOfT: Class<*>, private val algebra: Algebra<T>, private val className: String) {
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
private class ClassLoader(parent: java.lang.ClassLoader) : java.lang.ClassLoader(parent) {
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
internal fun defineClass(name: String?, b: ByteArray): Class<*> = defineClass(name, b, 0, b.size)
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
}
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
private val classLoader: ClassLoader = ClassLoader(javaClass.classLoader)
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
@Suppress("PrivatePropertyName")
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
private val T_ALGEBRA_CLASS: String = algebra.javaClass.name.replace(oldChar = '.', newChar = '/')
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
@Suppress("PrivatePropertyName")
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
private val T_CLASS: String = classOfT.name.replace('.', '/')
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
private val constants: MutableList<T> = mutableListOf()
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
private val asmCompiledClassWriter = ClassWriter(0)
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
private val slashesClassName: String = className.replace(oldChar = '.', newChar = '/')
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
private val evaluateMethodVisitor: MethodVisitor
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
private val evaluateThisVar: Int = 0
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
private val evaluateArgumentsVar: Int = 1
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
private var evaluateL0: Label
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
private lateinit var evaluateL1: Label
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
var maxStack: Int = 0
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
init {
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
asmCompiledClassWriter.visit(
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
V1_8,
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
ACC_PUBLIC or ACC_FINAL or ACC_SUPER,
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
slashesClassName,
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
"L$ASM_COMPILED_CLASS<L$T_CLASS;>;",
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
ASM_COMPILED_CLASS,
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
arrayOf()
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
)
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
asmCompiledClassWriter.run {
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
visitMethod(ACC_PUBLIC, "<init>", "(L$ALGEBRA_CLASS;L$LIST_CLASS;)V", null, null).run {
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
val thisVar = 0
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
val algebraVar = 1
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
val constantsVar = 2
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
val l0 = Label()
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
visitLabel(l0)
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
visitVarInsn(ALOAD, thisVar)
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
visitVarInsn(ALOAD, algebraVar)
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
visitVarInsn(ALOAD, constantsVar)
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
visitMethodInsn(
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
INVOKESPECIAL,
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
ASM_COMPILED_CLASS,
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
"<init>",
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
"(L$ALGEBRA_CLASS;L$LIST_CLASS;)V",
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
false
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
)
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
val l1 = Label()
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
visitLabel(l1)
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
visitInsn(RETURN)
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
val l2 = Label()
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
visitLabel(l2)
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
visitLocalVariable("this", "L$slashesClassName;", null, l0, l2, thisVar)
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
visitLocalVariable(
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
"algebra",
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
"L$ALGEBRA_CLASS;",
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
"L$ALGEBRA_CLASS<L$T_CLASS;>;",
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
l0,
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
l2,
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
algebraVar
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
)
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
visitLocalVariable("constants", "L$LIST_CLASS;", "L$LIST_CLASS<L$T_CLASS;>;", l0, l2, constantsVar)
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
visitMaxs(3, 3)
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
visitEnd()
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
}
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
evaluateMethodVisitor = visitMethod(
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
ACC_PUBLIC or ACC_FINAL,
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
"evaluate",
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
"(L$MAP_CLASS;)L$T_CLASS;",
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
"(L$MAP_CLASS<L$STRING_CLASS;+L$T_CLASS;>;)L$T_CLASS;",
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
null
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
)
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
evaluateMethodVisitor.run {
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
visitCode()
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
evaluateL0 = Label()
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
visitLabel(evaluateL0)
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
}
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
}
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
}
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
@Suppress("UNCHECKED_CAST")
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
fun generate(): AsmCompiled<T> {
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
evaluateMethodVisitor.run {
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
visitInsn(ARETURN)
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
evaluateL1 = Label()
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
visitLabel(evaluateL1)
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
visitLocalVariable(
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
"this",
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
"L$slashesClassName;",
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
T_CLASS,
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
evaluateL0,
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
evaluateL1,
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
evaluateThisVar
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
)
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
visitLocalVariable(
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
"arguments",
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
"L$MAP_CLASS;",
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
"L$MAP_CLASS<L$STRING_CLASS;+L$T_CLASS;>;",
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
evaluateL0,
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
evaluateL1,
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
evaluateArgumentsVar
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
)
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
visitMaxs(maxStack + 1, 2)
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
visitEnd()
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
}
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
asmCompiledClassWriter.visitMethod(
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
ACC_PUBLIC or ACC_FINAL or ACC_BRIDGE or ACC_SYNTHETIC,
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
"evaluate",
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
"(L$MAP_CLASS;)L$OBJECT_CLASS;",
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
null,
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
null
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
).run {
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
val thisVar = 0
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
visitCode()
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
val l0 = Label()
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
visitLabel(l0)
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
visitVarInsn(ALOAD, 0)
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
visitVarInsn(ALOAD, 1)
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
visitMethodInsn(INVOKEVIRTUAL, slashesClassName, "evaluate", "(L$MAP_CLASS;)L$T_CLASS;", false)
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
visitInsn(ARETURN)
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
val l1 = Label()
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
visitLabel(l1)
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
visitLocalVariable(
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
"this",
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
"L$slashesClassName;",
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
T_CLASS,
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
l0,
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
l1,
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
thisVar
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
)
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
visitMaxs(2, 2)
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
visitEnd()
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
}
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
asmCompiledClassWriter.visitEnd()
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
return classLoader
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
.defineClass(className, asmCompiledClassWriter.toByteArray())
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
.constructors
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
.first()
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
.newInstance(algebra, constants) as AsmCompiled<T>
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
}
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
fun visitLoadFromConstants(value: T) {
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
val idx = if (value in constants) constants.indexOf(value) else constants.apply { add(value) }.lastIndex
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
maxStack++
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
evaluateMethodVisitor.run {
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
visitLoadThis()
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
visitFieldInsn(GETFIELD, slashesClassName, "constants", "L$LIST_CLASS;")
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
visitLdcOrIConstInsn(idx)
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
visitMethodInsn(INVOKEINTERFACE, LIST_CLASS, "get", "(I)L$OBJECT_CLASS;", true)
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
visitCastToT()
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
}
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
}
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
private fun visitLoadThis(): Unit = evaluateMethodVisitor.visitVarInsn(ALOAD, evaluateThisVar)
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
fun visitNumberConstant(value: Number): Unit = evaluateMethodVisitor.visitLdcInsn(value)
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
fun visitLoadFromVariables(name: String, defaultValue: T? = null) = evaluateMethodVisitor.run {
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
maxStack++
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
visitVarInsn(ALOAD, evaluateArgumentsVar)
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
if (defaultValue != null) {
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
visitLdcInsn(name)
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
visitLoadFromConstants(defaultValue)
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
visitMethodInsn(
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
INVOKEINTERFACE,
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
MAP_CLASS,
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
"getOrDefault",
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
"(L$OBJECT_CLASS;L$OBJECT_CLASS;)L$OBJECT_CLASS;",
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
true
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
)
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
visitCastToT()
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
return
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
}
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
visitLdcInsn(name)
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
visitMethodInsn(INVOKEINTERFACE, MAP_CLASS, "get", "(L$OBJECT_CLASS;)L$OBJECT_CLASS;", true)
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
visitCastToT()
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
}
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
fun visitLoadAlgebra() {
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
evaluateMethodVisitor.visitVarInsn(ALOAD, evaluateThisVar)
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
evaluateMethodVisitor.visitFieldInsn(
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
GETFIELD,
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
ASM_COMPILED_CLASS, "algebra", "L$ALGEBRA_CLASS;"
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
)
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
evaluateMethodVisitor.visitTypeInsn(CHECKCAST, T_ALGEBRA_CLASS)
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
}
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
fun visitInvokeAlgebraOperation(owner: String, method: String, descriptor: String) {
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
maxStack++
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
evaluateMethodVisitor.visitMethodInsn(INVOKEINTERFACE, owner, method, descriptor, true)
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
visitCastToT()
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
}
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
fun visitCastToT() {
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
evaluateMethodVisitor.visitTypeInsn(CHECKCAST, T_CLASS)
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
}
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
companion object {
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
const val ASM_COMPILED_CLASS = "scientifik/kmath/expressions/AsmCompiled"
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
const val LIST_CLASS = "java/util/List"
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
const val MAP_CLASS = "java/util/Map"
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
const val OBJECT_CLASS = "java/lang/Object"
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
const val ALGEBRA_CLASS = "scientifik/kmath/operations/Algebra"
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
const val SPACE_CLASS = "scientifik/kmath/operations/Space"
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
const val SPACE_OPERATIONS_CLASS = "scientifik/kmath/operations/SpaceOperations"
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
const val FIELD_CLASS = "scientifik/kmath/operations/Field"
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
const val STRING_CLASS = "java/lang/String"
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
}
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
}
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
interface AsmExpression<T> {
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
fun invoke(gen: AsmGenerationContext<T>)
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
}
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
internal class AsmVariableExpression<T>(val name: String, val default: T? = null) :
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
AsmExpression<T> {
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
override fun invoke(gen: AsmGenerationContext<T>) {
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
gen.visitLoadFromVariables(name, default)
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
}
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
}
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
internal class AsmConstantExpression<T>(val value: T) :
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
AsmExpression<T> {
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
override fun invoke(gen: AsmGenerationContext<T>) {
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
gen.visitLoadFromConstants(value)
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
}
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
}
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
internal class AsmSumExpression<T>(
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
val first: AsmExpression<T>,
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
val second: AsmExpression<T>
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
) : AsmExpression<T> {
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
override fun invoke(gen: AsmGenerationContext<T>) {
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
gen.visitLoadAlgebra()
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
first.invoke(gen)
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
second.invoke(gen)
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
gen.visitInvokeAlgebraOperation(
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
owner = AsmGenerationContext.SPACE_OPERATIONS_CLASS,
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
method = "add",
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
descriptor = "(L${AsmGenerationContext.OBJECT_CLASS};L${AsmGenerationContext.OBJECT_CLASS};)L${AsmGenerationContext.OBJECT_CLASS};"
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
)
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
}
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
}
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
internal class AsmProductExpression<T>(
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
val first: AsmExpression<T>,
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
val second: AsmExpression<T>
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
) : AsmExpression<T> {
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
override fun invoke(gen: AsmGenerationContext<T>) {
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
gen.visitLoadAlgebra()
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
first.invoke(gen)
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
second.invoke(gen)
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
gen.visitInvokeAlgebraOperation(
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
owner = AsmGenerationContext.SPACE_CLASS,
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
method = "times",
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
descriptor = "(L${AsmGenerationContext.OBJECT_CLASS};L${AsmGenerationContext.OBJECT_CLASS};)L${AsmGenerationContext.OBJECT_CLASS};"
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
)
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
}
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
}
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
internal class AsmConstProductExpression<T>(
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
val expr: AsmExpression<T>,
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
val const: Number
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
) : AsmExpression<T> {
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
override fun invoke(gen: AsmGenerationContext<T>) {
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
gen.visitLoadAlgebra()
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
expr.invoke(gen)
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
gen.visitNumberConstant(const)
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
gen.visitInvokeAlgebraOperation(
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
owner = AsmGenerationContext.SPACE_CLASS,
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
method = "multiply",
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
descriptor = "(L${AsmGenerationContext.OBJECT_CLASS};L${AsmGenerationContext.OBJECT_CLASS};)L${AsmGenerationContext.OBJECT_CLASS};"
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
)
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
}
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
}
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
internal class AsmDivExpression<T>(
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
val expr: AsmExpression<T>,
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
val second: AsmExpression<T>
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
) : AsmExpression<T> {
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
override fun invoke(gen: AsmGenerationContext<T>) {
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
gen.visitLoadAlgebra()
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
expr.invoke(gen)
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
second.invoke(gen)
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
gen.visitInvokeAlgebraOperation(
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
owner = AsmGenerationContext.FIELD_CLASS,
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
method = "divide",
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
descriptor = "(L${AsmGenerationContext.OBJECT_CLASS};L${AsmGenerationContext.OBJECT_CLASS};)L${AsmGenerationContext.OBJECT_CLASS};"
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
)
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
}
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
}
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
open class AsmFunctionalExpressionSpace<T>(
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
val space: Space<T>,
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
one: T
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
) : Space<AsmExpression<T>>,
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
ExpressionSpace<T, AsmExpression<T>> {
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
override val zero: AsmExpression<T> =
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
AsmConstantExpression(space.zero)
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
override fun const(value: T): AsmExpression<T> =
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
AsmConstantExpression(value)
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
override fun variable(name: String, default: T?): AsmExpression<T> =
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
AsmVariableExpression(
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
name,
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
default
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
)
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
override fun add(a: AsmExpression<T>, b: AsmExpression<T>): AsmExpression<T> =
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
AsmSumExpression(a, b)
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
override fun multiply(a: AsmExpression<T>, k: Number): AsmExpression<T> =
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
AsmConstProductExpression(a, k)
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
operator fun AsmExpression<T>.plus(arg: T) = this + const(arg)
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
operator fun AsmExpression<T>.minus(arg: T) = this - const(arg)
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
operator fun T.plus(arg: AsmExpression<T>) = arg + this
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
operator fun T.minus(arg: AsmExpression<T>) = arg - this
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
}
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
class AsmFunctionalExpressionField<T>(val field: Field<T>) : ExpressionField<T, AsmExpression<T>>,
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
AsmFunctionalExpressionSpace<T>(field, field.one) {
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
override val one: AsmExpression<T>
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
get() = const(this.field.one)
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
override fun const(value: Double): AsmExpression<T> = const(field.run { one * value })
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
override fun multiply(a: AsmExpression<T>, b: AsmExpression<T>): AsmExpression<T> =
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
AsmProductExpression(a, b)
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
override fun divide(a: AsmExpression<T>, b: AsmExpression<T>): AsmExpression<T> =
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
AsmDivExpression(a, b)
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
operator fun AsmExpression<T>.times(arg: T) = this * const(arg)
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
operator fun AsmExpression<T>.div(arg: T) = this / const(arg)
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
operator fun T.times(arg: AsmExpression<T>) = arg * this
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
operator fun T.div(arg: AsmExpression<T>) = arg / this
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
||||
}
|
||||
Add suppress for unused parameters and documentation. Add suppress for unused parameters and documentation.
Space is not actually used. Space is not actually used.
Not used Not used
|
@ -0,0 +1,17 @@
|
||||
package scientifik.kmath.expressions
|
||||
|
||||
import org.objectweb.asm.MethodVisitor
|
||||
import org.objectweb.asm.Opcodes
|
||||
|
||||
fun MethodVisitor.visitLdcOrIConstInsn(value: Int) {
|
||||
when (value) {
|
||||
-1 -> visitInsn(Opcodes.ICONST_M1)
|
||||
0 -> visitInsn(Opcodes.ICONST_0)
|
||||
1 -> visitInsn(Opcodes.ICONST_1)
|
||||
2 -> visitInsn(Opcodes.ICONST_2)
|
||||
3 -> visitInsn(Opcodes.ICONST_3)
|
||||
4 -> visitInsn(Opcodes.ICONST_4)
|
||||
5 -> visitInsn(Opcodes.ICONST_5)
|
||||
else -> visitLdcInsn(value)
|
||||
}
|
||||
}
|
@ -0,0 +1,23 @@
|
||||
package scientifik.kmath.expressions
|
||||
|
||||
import scientifik.kmath.operations.RealField
|
||||
import kotlin.test.Test
|
||||
import kotlin.test.assertEquals
|
||||
|
||||
class AsmTest {
|
||||
@Test
|
||||
fun test() {
|
||||
val expr = AsmSumExpression(AsmConstantExpression(1.0), AsmVariableExpression("x"))
|
||||
|
||||
val gen = AsmGenerationContext(
|
||||
java.lang.Double::class.java,
|
||||
RealField,
|
||||
"MyAsmCompiled"
|
||||
)
|
||||
|
||||
expr.invoke(gen)
|
||||
val compiled = gen.generate()
|
||||
val value = compiled.evaluate(mapOf("x" to 25.0))
|
||||
assertEquals(26.0, value)
|
||||
}
|
||||
}
|
@ -15,7 +15,7 @@ operator fun <T> Expression<T>.invoke(vararg pairs: Pair<String, T>): T = invoke
|
||||
/**
|
||||
* A context for expression construction
|
||||
*/
|
||||
interface ExpressionContext<T, E : Expression<T>> {
|
||||
interface ExpressionContext<T, E> {
|
||||
/**
|
||||
* Introduce a variable into expression context
|
||||
*/
|
||||
@ -29,11 +29,11 @@ interface ExpressionContext<T, E : Expression<T>> {
|
||||
fun produce(node: SyntaxTreeNode): E
|
||||
}
|
||||
|
||||
interface ExpressionSpace<T, E : Expression<T>> : Space<E>, ExpressionContext<T, E> {
|
||||
interface ExpressionSpace<T, E> : Space<E>, ExpressionContext<T, E> {
|
||||
|
||||
open fun produceSingular(value: String): E = variable(value)
|
||||
fun produceSingular(value: String): E = variable(value)
|
||||
|
||||
open fun produceUnary(operation: String, value: E): E {
|
||||
fun produceUnary(operation: String, value: E): E {
|
||||
return when (operation) {
|
||||
UnaryNode.PLUS_OPERATION -> value
|
||||
UnaryNode.MINUS_OPERATION -> -value
|
||||
@ -41,7 +41,7 @@ interface ExpressionSpace<T, E : Expression<T>> : Space<E>, ExpressionContext<T,
|
||||
}
|
||||
}
|
||||
|
||||
open fun produceBinary(operation: String, left: E, right: E): E {
|
||||
fun produceBinary(operation: String, left: E, right: E): E {
|
||||
return when (operation) {
|
||||
BinaryNode.PLUS_OPERATION -> left + right
|
||||
BinaryNode.MINUS_OPERATION -> left - right
|
||||
@ -75,7 +75,7 @@ interface ExpressionSpace<T, E : Expression<T>> : Space<E>, ExpressionContext<T,
|
||||
}
|
||||
}
|
||||
|
||||
interface ExpressionField<T, E : Expression<T>> : Field<E>, ExpressionSpace<T, E> {
|
||||
interface ExpressionField<T, E> : Field<E>, ExpressionSpace<T, E> {
|
||||
fun const(value: Double): E = one.times(value)
|
||||
|
||||
override fun produce(node: SyntaxTreeNode): E {
|
||||
|
@ -44,5 +44,6 @@ include(
|
||||
":kmath-dimensions",
|
||||
":kmath-for-real",
|
||||
":kmath-geometry",
|
||||
":examples"
|
||||
":examples",
|
||||
":kmath-asm"
|
||||
)
|
||||
|
Probably should be implementation
Probably should be implementation