Fix AttributeBuilder inlining

This commit is contained in:
Alexander Nozik 2024-03-27 09:58:28 +03:00
parent 255d4ba6b7
commit 2fe04040c6
3 changed files with 5 additions and 5 deletions

View File

@ -92,7 +92,7 @@ public inline fun <reified T : Any> GaussIntegrator<T>.integrate(
range: ClosedRange<Double>,
order: Int = 10,
intervals: Int = 10,
attributesBuilder: AttributesBuilder<UnivariateIntegrand<T>>.() -> Unit = {},
noinline attributesBuilder: AttributesBuilder<UnivariateIntegrand<T>>.() -> Unit = {},
noinline function: (Double) -> T,
): UnivariateIntegrand<T> {
require(range.endInclusive > range.start) { "The range upper bound should be higher than lower bound" }

View File

@ -29,6 +29,6 @@ public fun <T> MultivariateIntegrand<T>.withAttributes(
): MultivariateIntegrand<T> = withAttributes(attributes.modified(block))
public inline fun <reified T : Any> MultivariateIntegrand(
attributeBuilder: AttributesBuilder<MultivariateIntegrand<T>>.() -> Unit,
noinline attributeBuilder: AttributesBuilder<MultivariateIntegrand<T>>.() -> Unit,
noinline function: (Point<T>) -> T,
): MultivariateIntegrand<T> = MultivariateIntegrand(safeTypeOf<T>(), Attributes(attributeBuilder), function)

View File

@ -30,7 +30,7 @@ public fun <T> UnivariateIntegrand<T>.withAttributes(
): UnivariateIntegrand<T> = withAttributes(attributes.modified(block))
public inline fun <reified T : Any> UnivariateIntegrand(
attributeBuilder: AttributesBuilder<UnivariateIntegrand<T>>.() -> Unit,
noinline attributeBuilder: AttributesBuilder<UnivariateIntegrand<T>>.() -> Unit,
noinline function: (Double) -> T,
): UnivariateIntegrand<T> = UnivariateIntegrand(safeTypeOf(), Attributes(attributeBuilder), function)
@ -68,7 +68,7 @@ public fun AttributesBuilder<UnivariateIntegrand<*>>.integrationNodes(vararg nod
*/
@UnstableKMathAPI
public inline fun <reified T : Any> UnivariateIntegrator<T>.integrate(
attributesBuilder: AttributesBuilder<UnivariateIntegrand<T>>.() -> Unit,
noinline attributesBuilder: AttributesBuilder<UnivariateIntegrand<T>>.() -> Unit,
noinline function: (Double) -> T,
): UnivariateIntegrand<T> = integrate(UnivariateIntegrand(attributesBuilder, function))
@ -79,7 +79,7 @@ public inline fun <reified T : Any> UnivariateIntegrator<T>.integrate(
@UnstableKMathAPI
public inline fun <reified T : Any> UnivariateIntegrator<T>.integrate(
range: ClosedRange<Double>,
attributeBuilder: AttributesBuilder<UnivariateIntegrand<T>>.() -> Unit = {},
noinline attributeBuilder: AttributesBuilder<UnivariateIntegrand<T>>.() -> Unit = {},
noinline function: (Double) -> T,
): UnivariateIntegrand<T> {