forked from kscience/kmath
Mark polymorphic attribute getters and setters as unstable
This commit is contained in:
parent
82196250f6
commit
69b59b43f4
@ -21,11 +21,13 @@ public abstract class PolymorphicAttribute<T>(public val type: SafeType<T>) : At
|
||||
/**
|
||||
* Get a polymorphic attribute using attribute factory
|
||||
*/
|
||||
@UnstableAttributesAPI
|
||||
public operator fun <T> Attributes.get(attributeKeyBuilder: () -> PolymorphicAttribute<T>): T? = get(attributeKeyBuilder())
|
||||
|
||||
/**
|
||||
* Set a polymorphic attribute using its factory
|
||||
*/
|
||||
@UnstableAttributesAPI
|
||||
public operator fun <O, T> AttributesBuilder<O>.set(attributeKeyBuilder: () -> PolymorphicAttribute<T>, value: T) {
|
||||
set(attributeKeyBuilder(), value)
|
||||
}
|
||||
|
@ -24,7 +24,7 @@ public val <T> OptimizationProblem<T>.startPoint: Map<Symbol, T>
|
||||
get() = attributes[OptimizationStartPoint()] ?: error("Starting point not defined in $this")
|
||||
|
||||
public fun <T> AttributesBuilder<OptimizationProblem<T>>.startAt(startingPoint: Map<Symbol, T>) {
|
||||
set(::OptimizationStartPoint, startingPoint)
|
||||
set(OptimizationStartPoint(), startingPoint)
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user