More KDoc comments

This commit is contained in:
Iaroslav 2020-06-20 00:05:00 +07:00
parent e9ff33c4f9
commit ba499da2da
No known key found for this signature in database
GPG Key ID: 46E15E4A31B3BCD7
2 changed files with 14 additions and 1 deletions

View File

@ -3,6 +3,13 @@ package scientifik.kmath.asm.internal
import scientifik.kmath.expressions.Expression import scientifik.kmath.expressions.Expression
import scientifik.kmath.operations.Algebra import scientifik.kmath.operations.Algebra
/**
* [Expression] partial implementation to have it subclassed by actual implementations. Provides unified storage for
* objects needed to implement the expression.
*
* @property algebra the algebra to delegate calls.
* @property constants the constants array to have persistent objects to reference in [invoke].
*/
internal abstract class AsmCompiledExpression<T> internal constructor( internal abstract class AsmCompiledExpression<T> internal constructor(
@JvmField protected val algebra: Algebra<T>, @JvmField protected val algebra: Algebra<T>,
@JvmField protected val constants: Array<Any> @JvmField protected val constants: Array<Any>

View File

@ -2,7 +2,13 @@ package scientifik.kmath.asm.internal
import scientifik.kmath.ast.MST import scientifik.kmath.ast.MST
internal fun buildName(mst: MST, collision: Int = 0): String { /**
* Creates a class name for [AsmCompiledExpression] subclassed to implement [mst] provided.
*
* This methods helps to avoid collisions of class name to prevent loading several classes with the same name. If there
* is a colliding class, change [collision] parameter or leave it `0` to check existing classes recursively.
*/
internal tailrec fun buildName(mst: MST, collision: Int = 0): String {
val name = "scientifik.kmath.asm.generated.AsmCompiledExpression_${mst.hashCode()}_$collision" val name = "scientifik.kmath.asm.generated.AsmCompiledExpression_${mst.hashCode()}_$collision"
try { try {