fun args ( vararg args : Any )


fun args ( args : Iterable < * > )


fun setArgs ( args : Iterable < * > )


fun classpath ( vararg paths : Any )


fun setClasspath ( classpath : FileCollection )

/**
 * ## See [JavaExec.setClasspath]
 */


fun classpath ( compilation : KotlinCompilation < * > )

/**
 * Adds the runtime classpath of the given [compilation] to this run task
 */


= println ( "<STR_LIT>" )

/**
 * This function can only be used by JVM consumers
 */


public fun predict ( inputData : FloatData , inputTensorName : String = input , outputTensorName : String = output ) : Int

{ <EOL> return predict ( inputData , inputTensorName , outputTensorName ) { result -> <EOL> result . getLongArray ( <NUM_LIT:0> ) [ <NUM_LIT:0> ] . toInt ( ) <EOL> } <EOL> }

/**
 * Predicts the class of [inputData].
 *
 * @param [inputData] The single example with unknown label.
 * @param [inputTensorName] The name of input tensor.
 * @param [outputTensorName] The name of output tensor.
 * @return Predicted class index.
 */


{ <EOL> input = inputName <EOL> }


public fun output ( outputName : String )

{ <EOL> output = outputName <EOL> }


{ <EOL> return tfGraph . convertToString ( ) <EOL> }

/** Forms the graph description in string format. */


public fun copy ( copiedModelName : String ? = null ) : TensorFlowInferenceModel

{ <EOL> val model = TensorFlowInferenceModel ( tfGraph . copy ( ) ) <EOL> model . input = input <EOL> model . output = output <EOL> if ( copiedModelName != null ) model . name = name <EOL> copyVariablesToModel ( model , tfGraph . variableNames ( ) ) <EOL> model . isModelInitialized = true <EOL> return model <EOL> }


public fun load ( modelDirectory : File , loadOptimizerState : Boolean = false ) : TensorFlowInferenceModel

{ <EOL> val pathToModelDirectory = modelDirectory . absolutePath <EOL> if ( ! modelDirectory . exists ( ) ) { <EOL> throw NotDirectoryException ( pathToModelDirectory ) <EOL> } <EOL> val file = File ( "<STR_LIT>" ) <EOL> if ( ! file . exists ( ) ) throw FileNotFoundException ( "<STR_LIT>" + "<STR_LIT>" ) <EOL> logger . debug { "<STR_LIT>" } <EOL> val model = TensorFlowInferenceModel ( deserializeGraph ( file . readBytes ( ) ) ) <EOL> model . loadVariablesFromTxt ( pathToModelDirectory , loadOptimizerState ) <EOL> model . isModelInitialized = true <EOL> logger . debug { "<STR_LIT>" } <EOL> return model <EOL> }

/**
 * Loads tensorflow graphs and variable data (if required).
 * It loads graph from .pb file format and variable data from .txt files
 *
 * @param [modelDirectory] Path to directory with TensorFlow graph and variable data.
 * @param [loadOptimizerState] Loads optimizer internal variables data, if true.
 */


{ <EOL> var regex : Regex <EOL> var result : MatchResult ? <EOL> regex = Regex ( "<STR_LIT>" ) <EOL> result = regex . find ( "<STR_LIT>" ) <EOL> assertNotNull ( result ) <EOL> assertEquals ( "<STR_LIT>" , result ! ! . groupValues [ <NUM_LIT:1> ] ) <EOL> assertNull ( result . next ( ) ) <EOL> regex = Regex ( "<STR_LIT>" , RegexOption . IGNORE_CASE ) <EOL> result = regex . find ( "<STR_LIT>" ) <EOL> assertNotNull ( result ) <EOL> assertEquals ( "<STR_LIT>" , result ! ! . groupValues [ <NUM_LIT:1> ] ) <EOL> result = result . next ( ) <EOL> assertNotNull ( result ) <EOL> assertEquals ( "<STR_LIT>" , result ! ! . groupValues [ <NUM_LIT:1> ] ) <EOL> assertNull ( result . next ( ) ) <EOL> regex = Regex ( "<STR_LIT>" ) <EOL> result = regex . find ( "<STR_LIT>" ) <EOL> assertNotNull ( result ) <EOL> assertEquals ( "<STR_LIT>" , result ! ! . groupValues [ <NUM_LIT:1> ] ) <EOL> result = result . next ( ) <EOL> assertNotNull ( result ) <EOL> assertEquals ( "<STR_LIT>" , result ! ! . groupValues [ <NUM_LIT:1> ] ) <EOL> assertNull ( result . next ( ) ) <EOL> }

/**
 * Tests Pattern compilation modes and modes triggered in pattern strings
 */


fun getIntrinsic ( symbol : IrFunctionSymbol ) : IntrinsicMethod ?

/**
 * Returns [IntrinsicMethod] that should emit specific bytecode instead of a regular bytecode for calling [symbol],
 * or `null` if [symbol]'s call should not be replaced.
 */


fun rewritePluginDefinedOperationMarker ( v : InstructionAdapter , reifiedInsn : AbstractInsnNode , instructions : InsnList , type : IrType ) : Boolean

/**
 * Allows to process plugin-defined reified operation marker.
 * Reified operation marker is an INVOKESTATIC call to IntrinsicsSupport.reifiedOperationMarker(operationType, typeVariableName) followed
 * by actual operation to be reified.
 * For marker to be determined as plugin-defined, another special call should be inserted directly afterwards the operation.
 * This call is MagicApiIntrinsics.voidMagicApiCall(object). Object should be a string loaded by LDC instruction. Contents of the string is plugin-defined
 * and recommended way to pass data to a plugin.
 *
 * This function must return `true` if marker was processed.
 * If this method returns `false`, other plugins would be queried, and if others also return `false`, a regular intrinsic determined by operationType would be inserted.
 *
 * If marker was processed, this is plugin's responsibility to remove any calls to MagicApiIntrinsics.voidMagicApiCall and its arguments.
 *
 * Example of plugin-defined reified operation marker:
 *
 * ```
 * iconst(6) // operationType=6
 * aconst(T) // typeParamName=T
 * invokestatic(kotlin/jvm/internal/Intrinsics.reifiedOperationMarker)
 * aconst(null) // This is operation to be reified. In case of operationType=6, this is typeOf<T>().
 * // A KType instance would normally be generated on stack instead of null.
 * aconst("pluginDataString") // arbitrary constant string
 * invokestatic(kotlin/jvm/internal/MagicApiIntrinsics.voidMagicApiCall(Ljava/lang/Object;)V) // plugin marker call
 * ```
 *
 * Such approach with two markers was chosen mainly for compatibility reasons:
 * Call to voidMagicApiCall should be inserted directly after operationType-specific instruction (aconst(null) in the example with typeOf).
 * If we form bytecode this way, old compilers would be able to correctly inline normal reified operation here, even if they do not know anything about plugin reifications.
 * They won't remove invokestatic(voidMagicApiCall), but it is not a problem, since kotlin-stdlib has this function, and it is a no-op.
 */


fun get ( irType : IrType , scope : IrParcelerScope ? , parcelizeType : IrType , strict : Boolean = false , toplevel : Boolean = false ) : IrParcelSerializer

{ <EOL> fun strict ( ) = strict && ! irType . hasAnnotation ( RAWVALUE_ANNOTATION_FQNAME ) <EOL> scope . getCustomSerializer ( irType ) ? . let { parceler -> <EOL> return IrCustomParcelSerializer ( parceler ) <EOL> } <EOL> val classifier = irType . erasedUpperBound <EOL> val classifierFqName = classifier . fqNameWhenAvailable ? . asString ( ) <EOL> when ( classifierFqName ) { <EOL> "<STR_LIT:kotlin.String>" , "<STR_LIT>" -> <EOL> return stringSerializer <EOL> "<STR_LIT>" , "<STR_LIT>" -> <EOL> return charSequenceSerializer <EOL> "<STR_LIT>" -> <EOL> return bundleSerializer <EOL> "<STR_LIT>" -> <EOL> return persistableBundleSerializer <EOL> "<STR_LIT:kotlin.Byte>" , "<STR_LIT>" -> <EOL> return wrapNullableSerializerIfNeeded ( irType , byteSerializer ) <EOL> "<STR_LIT>" , "<STR_LIT>" -> <EOL> return wrapNullableSerializerIfNeeded ( irType , booleanSerializer ) <EOL> "<STR_LIT>" , "<STR_LIT>" -> <EOL> return wrapNullableSerializerIfNeeded ( irType , charSerializer ) <EOL> "<STR_LIT:kotlin.Short>" , "<STR_LIT>" -> <EOL> return wrapNullableSerializerIfNeeded ( irType , shortSerializer ) <EOL> "<STR_LIT:kotlin.Int>" , "<STR_LIT>" -> <EOL> return wrapNullableSerializerIfNeeded ( irType , intSerializer ) <EOL> "<STR_LIT:kotlin.Long>" , "<STR_LIT>" -> <EOL> return wrapNullableSerializerIfNeeded ( irType , longSerializer ) <EOL> "<STR_LIT>" , "<STR_LIT>" -> <EOL> return wrapNullableSerializerIfNeeded ( irType , floatSerializer ) <EOL> "<STR_LIT>" , "<STR_LIT>" -> <EOL> return wrapNullableSerializerIfNeeded ( irType , doubleSerializer ) <EOL> "<STR_LIT>" -> <EOL> return wrapNullableSerializerIfNeeded ( irType , fileDescriptorSerializer ) <EOL> "<STR_LIT>" -> <EOL> return wrapNullableSerializerIfNeeded ( irType , sizeSerializer ) <EOL> "<STR_LIT>" -> <EOL> return wrapNullableSerializerIfNeeded ( irType , sizeFSerializer ) <EOL> "<STR_LIT>" -> <EOL> if ( ! scope . hasCustomSerializer ( irBuiltIns . intType ) ) <EOL> return intArraySerializer <EOL> "<STR_LIT>" -> <EOL> if ( ! scope . hasCustomSerializer ( irBuiltIns . booleanType ) ) <EOL> return booleanArraySerializer <EOL> "<STR_LIT>" -> <EOL> if ( ! scope . hasCustomSerializer ( irBuiltIns . byteType ) ) <EOL> return byteArraySerializer <EOL> "<STR_LIT>" -> <EOL> if ( ! scope . hasCustomSerializer ( irBuiltIns . charType ) ) <EOL> return charArraySerializer <EOL> "<STR_LIT>" -> <EOL> if ( ! scope . hasCustomSerializer ( irBuiltIns . floatType ) ) <EOL> return floatArraySerializer <EOL> "<STR_LIT>" -> <EOL> if ( ! scope . hasCustomSerializer ( irBuiltIns . doubleType ) ) <EOL> return doubleArraySerializer <EOL> "<STR_LIT>" -> <EOL> if ( ! scope . hasCustomSerializer ( irBuiltIns . longType ) ) <EOL> return longArraySerializer <EOL> "<STR_LIT>" -> <EOL> if ( ! scope . hasCustomSerializer ( irBuiltIns . booleanType ) ) <EOL> return sparseBooleanArraySerializer <EOL> } <EOL> when ( classifierFqName ) { <EOL> "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , <EOL> "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , <EOL> "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" -> { <EOL> val elementType = irType . getArrayElementType ( irBuiltIns ) <EOL> if ( ! scope . hasCustomSerializer ( elementType ) ) { <EOL> when ( elementType . erasedUpperBound . fqNameWhenAvailable ? . asString ( ) ) { <EOL> "<STR_LIT>" , "<STR_LIT:kotlin.String>" -> <EOL> return stringArraySerializer <EOL> "<STR_LIT>" -> <EOL> return iBinderArraySerializer <EOL> } <EOL> } <EOL> val arrayType = <EOL> if ( classifier . defaultType . isPrimitiveArray ( ) ) classifier . defaultType else irBuiltIns . arrayClass . typeWith ( elementType ) <EOL> return wrapNullableSerializerIfNeeded ( irType , IrArrayParcelSerializer ( arrayType , elementType , get ( elementType , scope , parcelizeType , strict ( ) ) ) ) <EOL> } <EOL> "<STR_LIT>" -> <EOL> return IrSparseArrayParcelSerializer ( classifier , irBuiltIns . booleanType , get ( irBuiltIns . booleanType , scope , parcelizeType , strict ( ) ) ) <EOL> "<STR_LIT>" -> <EOL> return IrSparseArrayParcelSerializer ( classifier , irBuiltIns . intType , get ( irBuiltIns . intType , scope , parcelizeType , strict ( ) ) ) <EOL> "<STR_LIT>" -> <EOL> return IrSparseArrayParcelSerializer ( classifier , irBuiltIns . longType , get ( irBuiltIns . longType , scope , parcelizeType , strict ( ) ) ) <EOL> "<STR_LIT>" -> { <EOL> val elementType = ( irType as IrSimpleType ) . arguments . single ( ) . upperBound ( irBuiltIns ) <EOL> return IrSparseArrayParcelSerializer ( classifier , elementType , get ( elementType , scope , parcelizeType , strict ( ) ) ) <EOL> } <EOL> "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , <EOL> "<STR_LIT>" , "<STR_LIT>" , <EOL> "<STR_LIT>" , "<STR_LIT>" , <EOL> "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , <EOL> "<STR_LIT>" , "<STR_LIT>" , <EOL> "<STR_LIT>" , "<STR_LIT>" , <EOL> "<STR_LIT>" , "<STR_LIT>" -> { <EOL> val elementType = ( irType as IrSimpleType ) . arguments . single ( ) . upperBound ( irBuiltIns ) <EOL> if ( ! scope . hasCustomSerializer ( elementType ) && classifierFqName in setOf ( "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" ) ) { <EOL> when ( elementType . erasedUpperBound . fqNameWhenAvailable ? . asString ( ) ) { <EOL> "<STR_LIT>" -> <EOL> return iBinderListSerializer <EOL> "<STR_LIT:kotlin.String>" , "<STR_LIT>" -> <EOL> return stringListSerializer <EOL> } <EOL> } <EOL> return wrapNullableSerializerIfNeeded ( irType , IrListParcelSerializer ( classifier , elementType , get ( elementType , scope , parcelizeType , strict ( ) ) ) ) <EOL> } <EOL> "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , <EOL> "<STR_LIT>" , "<STR_LIT>" , <EOL> "<STR_LIT>" , "<STR_LIT>" , <EOL> "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , <EOL> "<STR_LIT>" -> { <EOL> val keyType = ( irType as IrSimpleType ) . arguments [ <NUM_LIT:0> ] . upperBound ( irBuiltIns ) <EOL> val valueType = irType . arguments [ <NUM_LIT:1> ] . upperBound ( irBuiltIns ) <EOL> val parceler = <EOL> IrMapParcelSerializer ( classifier , keyType , valueType , get ( keyType , scope , parcelizeType , strict ( ) ) , get ( valueType , scope , parcelizeType , strict ( ) ) ) <EOL> return wrapNullableSerializerIfNeeded ( irType , parceler ) <EOL> } <EOL> } <EOL> when { <EOL> classifier . isSubclassOfFqName ( "<STR_LIT>" ) <EOL> && ! ( toplevel && ( classifier . isObject || classifier . isEnumClass ) ) -> { <EOL> return if ( classifier . modality == Modality . FINAL && classifier . psiElement != null && ( classifier . isParcelize || classifier . hasCreatorField ) ) { <EOL> wrapNullableSerializerIfNeeded ( irType , IrEfficientParcelableParcelSerializer ( classifier ) ) <EOL> } else { <EOL> IrGenericParcelableParcelSerializer ( parcelizeType ) <EOL> } <EOL> } <EOL> classifier . isSubclassOfFqName ( "<STR_LIT>" ) -> <EOL> return iBinderSerializer <EOL> classifier . isObject -> <EOL> return IrObjectParcelSerializer ( classifier ) <EOL> classifier . isEnumClass -> <EOL> return wrapNullableSerializerIfNeeded ( irType , IrEnumParcelSerializer ( classifier ) ) <EOL> classifier . isSubclassOfFqName ( "<STR_LIT>" ) <EOL> || irType . isFunctionTypeOrSubtype ( ) || irType . isSuspendFunctionTypeOrSubtype ( ) -> <EOL> return serializableSerializer <EOL> strict ( ) -> <EOL> throw IllegalArgumentException ( "<STR_LIT>" ) <EOL> else -> <EOL> return IrGenericValueParcelSerializer ( parcelizeType ) <EOL> } <EOL> }

/**
 * Resolve the given [irType] to a corresponding [IrParcelSerializer]. This depends on the TypeParcelers which
 * are currently in [scope], as well as the type of the enclosing Parceleable class [parcelizeType], which is needed
 * to get a class loader for reflection based serialization. Beyond this, we need to know whether to allow
 * using read/writeValue for serialization (if [strict] is false). Beyond this, we need to know whether we are
 * producing parcelers for properties of a Parcelable (if [toplevel] is true), or for a complete Parcelable.
 */


public fun compareAndSet ( expect : T , update : T ) : Boolean

/**
 * Atomically compares the current [value] with [expect] and sets it to [update] if it is equal to [expect].
 * The result is `true` if the [value] was set to [update] and `false` otherwise.
 *
 * This function use a regular comparison using [Any.equals]. If both [expect] and [update] are equal to the
 * current [value], this function returns `true`, but it does not actually change the reference that is
 * stored in the [value].
 *
 * This method is **thread-safe** and can be safely invoked from concurrent coroutines without
 * external synchronization.
 */


@ Suppress ( "<STR_LIT:FunctionName>" ) <EOL> public fun < T > MutableStateFlow ( value : T ) : MutableStateFlow < T >

= StateFlowImpl ( value ? : NULL )

/**
 * Creates a [MutableStateFlow] with the given initial [value].
 */


public inline fun < T > MutableStateFlow < T > . updateAndGet ( function : ( T ) -> T ) : T

{ <EOL> while ( true ) { <EOL> val prevValue = value <EOL> val nextValue = function ( prevValue ) <EOL> if ( compareAndSet ( prevValue , nextValue ) ) { <EOL> return nextValue <EOL> } <EOL> } <EOL> }

/**
 * Updates the [MutableStateFlow.value] atomically using the specified [function] of its value, and returns the new
 * value.
 *
 * [function] may be evaluated multiple times, if [value] is being concurrently updated.
 */


public inline fun < T > MutableStateFlow < T > . getAndUpdate ( function : ( T ) -> T ) : T

{ <EOL> while ( true ) { <EOL> val prevValue = value <EOL> val nextValue = function ( prevValue ) <EOL> if ( compareAndSet ( prevValue , nextValue ) ) { <EOL> return prevValue <EOL> } <EOL> } <EOL> }

/**
 * Updates the [MutableStateFlow.value] atomically using the specified [function] of its value, and returns its
 * prior value.
 *
 * [function] may be evaluated multiple times, if [value] is being concurrently updated.
 */


public inline fun < T > MutableStateFlow < T > . update ( function : ( T ) -> T )

{ <EOL> while ( true ) { <EOL> val prevValue = value <EOL> val nextValue = function ( prevValue ) <EOL> if ( compareAndSet ( prevValue , nextValue ) ) { <EOL> return <EOL> } <EOL> } <EOL> }

/**
 * Updates the [MutableStateFlow.value] atomically using the specified [function] of its value.
 *
 * [function] may be evaluated multiple times, if [value] is being concurrently updated.
 */


@ Test <EOL> fun createZeroFilledByteArray ( )

{ <EOL> val dim1 = <NUM_LIT:5> <EOL> val dim2 = <NUM_LIT:7> <EOL> val dim3 = <NUM_LIT:3> <EOL> val dim4 = <NUM_LIT:2> <EOL> val a = mk . zeros < Byte > ( dim1 , dim2 , dim3 , dim4 ) <EOL> assertEquals ( dim1 * dim2 * dim3 * dim4 , a . size ) <EOL> assertEquals ( dim1 * dim2 * dim3 * dim4 , a . data . size ) <EOL> assertTrue { a . all { it == <NUM_LIT:0> . toByte ( ) } } <EOL> }

/**
 * This method checks if a byte array of a given size is correctly created with all elements set to zero.
 */


@ Test <EOL> fun createByteArrayFilledWithOnes ( )

{ <EOL> val dim1 = <NUM_LIT:5> <EOL> val dim2 = <NUM_LIT:7> <EOL> val dim3 = <NUM_LIT:3> <EOL> val dim4 = <NUM_LIT:2> <EOL> val a = mk . ones < Byte > ( dim1 , dim2 , dim3 , dim4 ) <EOL> assertEquals ( dim1 * dim2 * dim3 * dim4 , a . size ) <EOL> assertEquals ( dim1 * dim2 * dim3 * dim4 , a . data . size ) <EOL> assertTrue { a . all { it == <NUM_LIT:1> . toByte ( ) } } <EOL> }

/**
 * Creates a byte array filled with ones of a given size and checks if all elements are set to one.
 */


@ Test <EOL> fun createFourDimensionalArrayFromByteList ( )

{ <EOL> val list = <EOL> listOf ( listOf ( listOf ( listOf < Byte > ( <NUM_LIT:1> , <NUM_LIT:3> ) , listOf < Byte > ( <NUM_LIT:7> , <NUM_LIT:8> ) ) , listOf ( listOf < Byte > ( <NUM_LIT:4> , <NUM_LIT:7> ) , listOf < Byte > ( <NUM_LIT:9> , <NUM_LIT:2> ) ) ) ) <EOL> val a : D4Array < Byte > = mk . ndarray ( list ) <EOL> assertEquals ( list , a . toListD4 ( ) ) <EOL> }

/**
 * Creates a four-dimensional array from a list of byte lists
 * and checks if the array's list representation matches the input list.
 */


@ Test <EOL> fun createFourDimensionalArrayFromByteSet ( )

{ <EOL> val set = setOf < Byte > ( <NUM_LIT:1> , <NUM_LIT:3> , <NUM_LIT:8> , <NUM_LIT:4> , <NUM_LIT:9> , <NUM_LIT:2> , <NUM_LIT:7> , <NUM_LIT:5> , <NUM_LIT:11> , <NUM_LIT> , - <NUM_LIT:8> , - <NUM_LIT:1> ) <EOL> val shape = intArrayOf ( <NUM_LIT:2> , <NUM_LIT:3> , <NUM_LIT:1> , <NUM_LIT:2> ) <EOL> val a : D4Array < Byte > = mk . ndarray ( set , shape = shape ) <EOL> assertEquals ( set . size , a . size ) <EOL> assertEquals ( set , a . toSet ( ) ) <EOL> }

/**
 * Creates a four-dimensional array from a set of bytes
 * and checks if the array's set representation matches the input set.
 */


@ Test <EOL> fun createFourDimensionalArrayFromPrimitiveByteArray ( )

{ <EOL> val array = byteArrayOf ( <NUM_LIT:1> , <NUM_LIT:3> , <NUM_LIT:8> , <NUM_LIT:4> , <NUM_LIT:9> , <NUM_LIT:2> , <NUM_LIT:7> , <NUM_LIT:3> , <NUM_LIT:4> , <NUM_LIT:3> , <NUM_LIT:8> , <NUM_LIT:1> ) <EOL> val a = mk . ndarray ( array , <NUM_LIT:2> , <NUM_LIT:3> , <NUM_LIT:1> , <NUM_LIT:2> ) <EOL> assertEquals ( array . size , a . size ) <EOL> a . data . getByteArray ( ) shouldBe array <EOL> }

/**
 * Creates a four-dimensional array from a primitive ByteArray
 * and checks if the array's ByteArray representation matches the input ByteArray.
 */


@ Test <EOL> fun createByte4DArrayWithInitializationFunction ( )

{ <EOL> val a = mk . d4array < Byte > ( <NUM_LIT:2> , <NUM_LIT:3> , <NUM_LIT:1> , <NUM_LIT:2> ) { ( it + <NUM_LIT:3> ) . toByte ( ) } <EOL> val expected = byteArrayOf ( <NUM_LIT:3> , <NUM_LIT:4> , <NUM_LIT:5> , <NUM_LIT:6> , <NUM_LIT:7> , <NUM_LIT:8> , <NUM_LIT:9> , <NUM_LIT:10> , <NUM_LIT:11> , <NUM_LIT:12> , <NUM_LIT> , <NUM_LIT> ) <EOL> assertEquals ( expected . size , a . size ) <EOL> a . data . getByteArray ( ) shouldBe expected <EOL> }

/**
 * Creates a four-dimensional array with a given size using an initialization function
 * and checks if the array's ByteArray representation matches the expected output.
 */


@ Test <EOL> fun createByte4DArrayWithInitAndIndices ( )

{ <EOL> val a = mk . d4arrayIndices ( <NUM_LIT:2> , <NUM_LIT:3> , <NUM_LIT:1> , <NUM_LIT:2> ) { i , j , k , l -> ( i * j + k - l ) . toByte ( ) } <EOL> val expected = byteArrayOf ( <NUM_LIT:0> , - <NUM_LIT:1> , <NUM_LIT:0> , - <NUM_LIT:1> , <NUM_LIT:0> , - <NUM_LIT:1> , <NUM_LIT:0> , - <NUM_LIT:1> , <NUM_LIT:1> , <NUM_LIT:0> , <NUM_LIT:2> , <NUM_LIT:1> ) <EOL> assertEquals ( expected . size , a . size ) <EOL> a . data . getByteArray ( ) shouldBe expected <EOL> }

/**
 * Creates a four-dimensional array with a given size using an initialization function and indices.
 * Checks if the array's ByteArray representation matches the expected output.
 */


@ OptIn ( ExperimentalMultikApi :: class ) <EOL> @ Test <EOL> fun createAlignedByte4DArray ( )

{ <EOL> val list = listOf ( listOf ( listOf ( listOf < Byte > ( <NUM_LIT:1> , <NUM_LIT:3> ) , listOf < Byte > ( <NUM_LIT:8> ) ) , listOf ( listOf < Byte > ( <NUM_LIT:4> , <NUM_LIT:7> ) ) ) ) <EOL> val expected = listOf ( listOf ( listOf ( listOf < Byte > ( <NUM_LIT:1> , <NUM_LIT:3> ) , listOf < Byte > ( <NUM_LIT:8> , <NUM_LIT:0> ) ) , listOf ( listOf < Byte > ( <NUM_LIT:4> , <NUM_LIT:7> ) , listOf < Byte > ( <NUM_LIT:0> , <NUM_LIT:0> ) ) ) ) <EOL> val a : D4Array < Byte > = mk . createAlignedNDArray ( list , filling = <NUM_LIT:0.0> ) <EOL> assertEquals ( expected , a . toListD4 ( ) ) <EOL> }

/**
 * Tests the function 'createAlignedNDArray' that creates a four-dimensional array from a list of number lists.
 * The test asserts that:
 * - The output array's size matches the size of the longest list in the input
 * and all lists are filled to match this length.
 * - The lists shorter than the longest one are filled with the specified filling value.
 */


@ Test <EOL> fun createZeroFilledShortArray ( )

{ <EOL> val dim1 = <NUM_LIT:5> <EOL> val dim2 = <NUM_LIT:7> <EOL> val dim3 = <NUM_LIT:3> <EOL> val dim4 = <NUM_LIT:2> <EOL> val a = mk . zeros < Short > ( dim1 , dim2 , dim3 , dim4 ) <EOL> assertEquals ( dim1 * dim2 * dim3 * dim4 , a . size ) <EOL> assertEquals ( dim1 * dim2 * dim3 * dim4 , a . data . size ) <EOL> assertTrue { a . all { it == <NUM_LIT:0> . toShort ( ) } } <EOL> }

/**
 * This method checks if a short array of a given size is correctly created with all elements set to zero.
 */


@ Test <EOL> fun createShortArrayFilledWithOnes ( )

{ <EOL> val dim1 = <NUM_LIT:5> <EOL> val dim2 = <NUM_LIT:7> <EOL> val dim3 = <NUM_LIT:3> <EOL> val dim4 = <NUM_LIT:2> <EOL> val a = mk . ones < Short > ( dim1 , dim2 , dim3 , dim4 ) <EOL> assertEquals ( dim1 * dim2 * dim3 * dim4 , a . size ) <EOL> assertEquals ( dim1 * dim2 * dim3 * dim4 , a . data . size ) <EOL> assertTrue { a . all { it == <NUM_LIT:1> . toShort ( ) } } <EOL> }

/**
 * Creates a short array filled with ones of a given size and checks if all elements are set to one.
 */


@ Test <EOL> fun createFourDimensionalArrayFromShortList ( )

{ <EOL> val list = <EOL> listOf ( listOf ( listOf ( listOf < Short > ( <NUM_LIT:1> , <NUM_LIT:3> ) , listOf < Short > ( <NUM_LIT:7> , <NUM_LIT:8> ) ) , listOf ( listOf < Short > ( <NUM_LIT:4> , <NUM_LIT:7> ) , listOf < Short > ( <NUM_LIT:9> , <NUM_LIT:2> ) ) ) ) <EOL> val a : D4Array < Short > = mk . ndarray ( list ) <EOL> assertEquals ( list , a . toListD4 ( ) ) <EOL> }

/**
 * Creates a four-dimensional array from a list of short lists
 * and checks if the array's list representation matches the input list.
 */


@ Test <EOL> @ Ignore <EOL> fun createFourDimensionalArrayFromShortSet ( )

{ <EOL> val set = setOf < Short > ( <NUM_LIT:1> , <NUM_LIT:3> , <NUM_LIT:8> , <NUM_LIT:4> , <NUM_LIT:9> , <NUM_LIT:2> , <NUM_LIT:7> , <NUM_LIT:5> , <NUM_LIT:11> , <NUM_LIT> , - <NUM_LIT:8> , - <NUM_LIT:1> ) <EOL> val shape = intArrayOf ( <NUM_LIT:2> , <NUM_LIT:3> , <NUM_LIT:1> , <NUM_LIT:2> ) <EOL> val a : D4Array < Short > = mk . ndarray ( set , shape = shape ) <EOL> assertEquals ( set . size , a . size ) <EOL> assertEquals ( set , a . toSet ( ) ) <EOL> }

/**
 * Creates a four-dimensional array from a set of shorts
 * and checks if the array's set representation matches the input set.
 */


@ Test <EOL> fun createFourDimensionalArrayFromPrimitiveShortArray ( )

{ <EOL> val array = shortArrayOf ( <NUM_LIT:1> , <NUM_LIT:3> , <NUM_LIT:8> , <NUM_LIT:4> , <NUM_LIT:9> , <NUM_LIT:2> , <NUM_LIT:7> , <NUM_LIT:3> , <NUM_LIT:4> , <NUM_LIT:3> , <NUM_LIT:8> , <NUM_LIT:1> ) <EOL> val a = mk . ndarray ( array , <NUM_LIT:2> , <NUM_LIT:3> , <NUM_LIT:1> , <NUM_LIT:2> ) <EOL> assertEquals ( array . size , a . size ) <EOL> a . data . getShortArray ( ) shouldBe array <EOL> }

/**
 * Creates a four-dimensional array from a primitive ShortArray
 * and checks if the array's ShortArray representation matches the input ShortArray.
 */


@ Test <EOL> fun createShort4DArrayWithInitializationFunction ( )

{ <EOL> val a = mk . d4array < Short > ( <NUM_LIT:2> , <NUM_LIT:3> , <NUM_LIT:1> , <NUM_LIT:2> ) { ( it + <NUM_LIT:3> ) . toShort ( ) } <EOL> val expected = shortArrayOf ( <NUM_LIT:3> , <NUM_LIT:4> , <NUM_LIT:5> , <NUM_LIT:6> , <NUM_LIT:7> , <NUM_LIT:8> , <NUM_LIT:9> , <NUM_LIT:10> , <NUM_LIT:11> , <NUM_LIT:12> , <NUM_LIT> , <NUM_LIT> ) <EOL> assertEquals ( expected . size , a . size ) <EOL> a . data . getShortArray ( ) shouldBe expected <EOL> }

/**
 * Creates a four-dimensional array with a given size using an initialization function
 * and checks if the array's ShortArray representation matches the expected output.
 */


@ Test <EOL> fun createShort4DArrayWithInitAndIndices ( )

{ <EOL> val a = mk . d4arrayIndices ( <NUM_LIT:2> , <NUM_LIT:3> , <NUM_LIT:1> , <NUM_LIT:2> ) { i , j , k , l -> ( i * j + k - l ) . toShort ( ) } <EOL> val expected = shortArrayOf ( <NUM_LIT:0> , - <NUM_LIT:1> , <NUM_LIT:0> , - <NUM_LIT:1> , <NUM_LIT:0> , - <NUM_LIT:1> , <NUM_LIT:0> , - <NUM_LIT:1> , <NUM_LIT:1> , <NUM_LIT:0> , <NUM_LIT:2> , <NUM_LIT:1> ) <EOL> assertEquals ( expected . size , a . size ) <EOL> a . data . getShortArray ( ) shouldBe expected <EOL> }

/**
 * Creates a four-dimensional array with a given size using an initialization function and indices.
 * Checks if the array's ShortArray representation matches the expected output.
 */


@ OptIn ( ExperimentalMultikApi :: class ) <EOL> @ Test <EOL> fun createAlignedShort4DArray ( )

{ <EOL> val list = listOf ( listOf ( listOf ( listOf < Short > ( <NUM_LIT:1> , <NUM_LIT:3> ) , listOf < Short > ( <NUM_LIT:8> ) ) , listOf ( listOf < Short > ( <NUM_LIT:4> , <NUM_LIT:7> ) ) ) ) <EOL> val expected = listOf ( listOf ( listOf ( listOf < Short > ( <NUM_LIT:1> , <NUM_LIT:3> ) , listOf < Short > ( <NUM_LIT:8> , <NUM_LIT:0> ) ) , listOf ( listOf < Short > ( <NUM_LIT:4> , <NUM_LIT:7> ) , listOf < Short > ( <NUM_LIT:0> , <NUM_LIT:0> ) ) ) ) <EOL> val a : D4Array < Short > = mk . createAlignedNDArray ( list , filling = <NUM_LIT:0.0> ) <EOL> assertEquals ( expected , a . toListD4 ( ) ) <EOL> }


@ Test <EOL> fun createZeroFilledIntArray ( )

{ <EOL> val dim1 = <NUM_LIT:5> <EOL> val dim2 = <NUM_LIT:7> <EOL> val dim3 = <NUM_LIT:3> <EOL> val dim4 = <NUM_LIT:2> <EOL> val a = mk . zeros < Int > ( dim1 , dim2 , dim3 , dim4 ) <EOL> assertEquals ( dim1 * dim2 * dim3 * dim4 , a . size ) <EOL> assertEquals ( dim1 * dim2 * dim3 * dim4 , a . data . size ) <EOL> assertTrue { a . all { it == <NUM_LIT:0> } } <EOL> }

/**
 * This method checks if an integer array of a given size is correctly created with all elements set to zero.
 */


@ Test <EOL> fun createIntArrayFilledWithOnes ( )

{ <EOL> val dim1 = <NUM_LIT:5> <EOL> val dim2 = <NUM_LIT:7> <EOL> val dim3 = <NUM_LIT:3> <EOL> val dim4 = <NUM_LIT:2> <EOL> val a = mk . ones < Int > ( dim1 , dim2 , dim3 , dim4 ) <EOL> assertEquals ( dim1 * dim2 * dim3 * dim4 , a . size ) <EOL> assertEquals ( dim1 * dim2 * dim3 * dim4 , a . data . size ) <EOL> assertTrue { a . all { it == <NUM_LIT:1> } } <EOL> }

/**
 * Creates an integer array filled with ones of a given size and checks if all elements are set to one.
 */


@ Test <EOL> fun createFourDimensionalArrayFromIntList ( )

{ <EOL> val list = listOf ( listOf ( listOf ( listOf ( <NUM_LIT:1> , <NUM_LIT:3> ) , listOf ( <NUM_LIT:7> , <NUM_LIT:8> ) ) , listOf ( listOf ( <NUM_LIT:4> , <NUM_LIT:7> ) , listOf ( <NUM_LIT:9> , <NUM_LIT:2> ) ) ) ) <EOL> val a : D4Array < Int > = mk . ndarray ( list ) <EOL> assertEquals ( list , a . toListD4 ( ) ) <EOL> }

/**
 * Creates a four-dimensional array from a list of integer lists
 * and checks if the array's list representation matches the input list.
 */


@ Test <EOL> fun createFourDimensionalArrayFromIntSet ( )

{ <EOL> val set = setOf ( <NUM_LIT:1> , <NUM_LIT:3> , <NUM_LIT:8> , <NUM_LIT:4> , <NUM_LIT:9> , <NUM_LIT:2> , <NUM_LIT:7> , <NUM_LIT:5> , <NUM_LIT:11> , <NUM_LIT> , - <NUM_LIT:8> , - <NUM_LIT:1> ) <EOL> val shape = intArrayOf ( <NUM_LIT:2> , <NUM_LIT:3> , <NUM_LIT:1> , <NUM_LIT:2> ) <EOL> val a : D4Array < Int > = mk . ndarray ( set , shape = shape ) <EOL> assertEquals ( set . size , a . size ) <EOL> assertEquals ( set , a . toSet ( ) ) <EOL> }

/**
 * Creates a four-dimensional array from a set of integers
 * and checks if the array's set representation matches the input set.
 */


@ Test <EOL> fun createFourDimensionalArrayFromPrimitiveIntArray ( )

{ <EOL> val array = intArrayOf ( <NUM_LIT:1> , <NUM_LIT:3> , <NUM_LIT:8> , <NUM_LIT:4> , <NUM_LIT:9> , <NUM_LIT:2> , <NUM_LIT:7> , <NUM_LIT:3> , <NUM_LIT:4> , <NUM_LIT:3> , <NUM_LIT:8> , <NUM_LIT:1> ) <EOL> val a = mk . ndarray ( array , <NUM_LIT:2> , <NUM_LIT:3> , <NUM_LIT:1> , <NUM_LIT:2> ) <EOL> assertEquals ( array . size , a . size ) <EOL> a . data . getIntArray ( ) shouldBe array <EOL> }

/**
 * Creates a four-dimensional array from a primitive IntArray
 * and checks if the array's IntArray representation matches the input IntArray.
 */


@ Test <EOL> fun createInt4DArrayWithInitializationFunction ( )

{ <EOL> val a = mk . d4array < Int > ( <NUM_LIT:2> , <NUM_LIT:3> , <NUM_LIT:1> , <NUM_LIT:2> ) { ( it + <NUM_LIT:3> ) } <EOL> val expected = intArrayOf ( <NUM_LIT:3> , <NUM_LIT:4> , <NUM_LIT:5> , <NUM_LIT:6> , <NUM_LIT:7> , <NUM_LIT:8> , <NUM_LIT:9> , <NUM_LIT:10> , <NUM_LIT:11> , <NUM_LIT:12> , <NUM_LIT> , <NUM_LIT> ) <EOL> assertEquals ( expected . size , a . size ) <EOL> a . data . getIntArray ( ) shouldBe expected <EOL> }

/**
 * Creates a four-dimensional array with a given size using an initialization function
 * and checks if the array's IntArray representation matches the expected output.
 */


@ Test <EOL> fun createInt4DArrayWithInitAndIndices ( )

{ <EOL> val a = mk . d4arrayIndices ( <NUM_LIT:2> , <NUM_LIT:3> , <NUM_LIT:1> , <NUM_LIT:2> ) { i , j , k , l -> i * j + k - l } <EOL> val expected = intArrayOf ( <NUM_LIT:0> , - <NUM_LIT:1> , <NUM_LIT:0> , - <NUM_LIT:1> , <NUM_LIT:0> , - <NUM_LIT:1> , <NUM_LIT:0> , - <NUM_LIT:1> , <NUM_LIT:1> , <NUM_LIT:0> , <NUM_LIT:2> , <NUM_LIT:1> ) <EOL> assertEquals ( expected . size , a . size ) <EOL> a . data . getIntArray ( ) shouldBe expected <EOL> }

/**
 * Creates a four-dimensional array with a given size using an initialization function and indices.
 * Checks if the array's IntArray representation matches the expected output.
 */


@ OptIn ( ExperimentalMultikApi :: class ) <EOL> @ Test <EOL> fun createAlignedInt4DArray ( )

{ <EOL> val list = listOf ( listOf ( listOf ( listOf ( <NUM_LIT:1> , <NUM_LIT:3> ) , listOf ( <NUM_LIT:8> ) ) , listOf ( listOf ( <NUM_LIT:4> , <NUM_LIT:7> ) ) ) ) <EOL> val expected = listOf ( listOf ( listOf ( listOf ( <NUM_LIT:1> , <NUM_LIT:3> ) , listOf ( <NUM_LIT:8> , <NUM_LIT:0> ) ) , listOf ( listOf ( <NUM_LIT:4> , <NUM_LIT:7> ) , listOf ( <NUM_LIT:0> , <NUM_LIT:0> ) ) ) ) <EOL> val a : D4Array < Int > = mk . createAlignedNDArray ( list , filling = <NUM_LIT:0.0> ) <EOL> assertEquals ( expected , a . toListD4 ( ) ) <EOL> }


@ Test <EOL> fun createZeroFilledLongArray ( )

{ <EOL> val dim1 = <NUM_LIT:5> <EOL> val dim2 = <NUM_LIT:7> <EOL> val dim3 = <NUM_LIT:3> <EOL> val dim4 = <NUM_LIT:2> <EOL> val a = mk . zeros < Long > ( dim1 , dim2 , dim3 , dim4 ) <EOL> assertEquals ( dim1 * dim2 * dim3 * dim4 , a . size ) <EOL> assertEquals ( dim1 * dim2 * dim3 * dim4 , a . data . size ) <EOL> assertTrue { a . all { it == <NUM_LIT:0L> } } <EOL> }

/**
 * This method checks if a long array of a given size is correctly created with all elements set to zero.
 */


@ Test <EOL> fun createLongArrayFilledWithOnes ( )

{ <EOL> val dim1 = <NUM_LIT:5> <EOL> val dim2 = <NUM_LIT:7> <EOL> val dim3 = <NUM_LIT:3> <EOL> val dim4 = <NUM_LIT:2> <EOL> val a = mk . ones < Long > ( dim1 , dim2 , dim3 , dim4 ) <EOL> assertEquals ( dim1 * dim2 * dim3 * dim4 , a . size ) <EOL> assertEquals ( dim1 * dim2 * dim3 * dim4 , a . data . size ) <EOL> assertTrue { a . all { it == <NUM_LIT:1L> } } <EOL> }

/**
 * Creates a long array filled with ones of a given size and checks if all elements are set to one.
 */


@ Test <EOL> fun createFourDimensionalArrayFromLongList ( )

{ <EOL> val list = listOf ( listOf ( listOf ( listOf ( <NUM_LIT:1L> , <NUM_LIT:3L> ) , listOf ( <NUM_LIT> , <NUM_LIT> ) ) , listOf ( listOf ( <NUM_LIT> , <NUM_LIT> ) , listOf ( <NUM_LIT> , <NUM_LIT> ) ) ) ) <EOL> val a : D4Array < Long > = mk . ndarray ( list ) <EOL> assertEquals ( list , a . toListD4 ( ) ) <EOL> }

/**
 * Creates a four-dimensional array from a list of long lists
 * and checks if the array's list representation matches the input list.
 */


@ Test <EOL> fun createFourDimensionalArrayFromLongSet ( )

{ <EOL> val set = setOf ( <NUM_LIT:1L> , <NUM_LIT:3L> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , - <NUM_LIT> , - <NUM_LIT:1L> ) <EOL> val shape = intArrayOf ( <NUM_LIT:2> , <NUM_LIT:3> , <NUM_LIT:1> , <NUM_LIT:2> ) <EOL> val a : D4Array < Long > = mk . ndarray ( set , shape = shape ) <EOL> assertEquals ( set . size , a . size ) <EOL> assertEquals ( set , a . toSet ( ) ) <EOL> }

/**
 * Creates a four-dimensional array from a set of longs
 * and checks if the array's set representation matches the input set.
 */


@ Test <EOL> fun createFourDimensionalArrayFromPrimitiveLongArray ( )

{ <EOL> val array = longArrayOf ( <NUM_LIT:1> , <NUM_LIT:3> , <NUM_LIT:8> , <NUM_LIT:4> , <NUM_LIT:9> , <NUM_LIT:2> , <NUM_LIT:7> , <NUM_LIT:3> , <NUM_LIT:4> , <NUM_LIT:3> , <NUM_LIT:8> , <NUM_LIT:1> ) <EOL> val a = mk . ndarray ( array , <NUM_LIT:2> , <NUM_LIT:3> , <NUM_LIT:1> , <NUM_LIT:2> ) <EOL> assertEquals ( array . size , a . size ) <EOL> a . data . getLongArray ( ) shouldBe array <EOL> }

/**
 * Creates a four-dimensional array from a primitive LongArray
 * and checks if the array's LongArray representation matches the input LongArray.
 */


@ Test <EOL> fun createLong4DArrayWithInitializationFunction ( )

{ <EOL> val a = mk . d4array < Long > ( <NUM_LIT:2> , <NUM_LIT:3> , <NUM_LIT:1> , <NUM_LIT:2> ) { it + <NUM_LIT:3L> } <EOL> val expected = longArrayOf ( <NUM_LIT:3> , <NUM_LIT:4> , <NUM_LIT:5> , <NUM_LIT:6> , <NUM_LIT:7> , <NUM_LIT:8> , <NUM_LIT:9> , <NUM_LIT:10> , <NUM_LIT:11> , <NUM_LIT:12> , <NUM_LIT> , <NUM_LIT> ) <EOL> assertEquals ( expected . size , a . size ) <EOL> a . data . getLongArray ( ) shouldBe expected <EOL> }

/**
 * Creates a four-dimensional array with a given size using an initialization function
 * and checks if the array's LongArray representation matches the expected output.
 */


@ Test <EOL> fun createLong4DArrayWithInitAndIndices ( )

{ <EOL> val a = mk . d4arrayIndices < Long > ( <NUM_LIT:2> , <NUM_LIT:3> , <NUM_LIT:1> , <NUM_LIT:2> ) { i , j , k , l -> i * j + k . toLong ( ) - l } <EOL> val expected = longArrayOf ( <NUM_LIT:0> , - <NUM_LIT:1> , <NUM_LIT:0> , - <NUM_LIT:1> , <NUM_LIT:0> , - <NUM_LIT:1> , <NUM_LIT:0> , - <NUM_LIT:1> , <NUM_LIT:1> , <NUM_LIT:0> , <NUM_LIT:2> , <NUM_LIT:1> ) <EOL> assertEquals ( expected . size , a . size ) <EOL> a . data . getLongArray ( ) shouldBe expected <EOL> }

/**
 * Creates a four-dimensional array with a given size using an initialization function and indices.
 * Checks if the array's LongArray representation matches the expected output.
 */


@ OptIn ( ExperimentalMultikApi :: class ) <EOL> @ Test <EOL> fun createAlignedLong4DArray ( )

{ <EOL> val list = listOf ( listOf ( listOf ( listOf ( <NUM_LIT:1L> , <NUM_LIT:3L> ) , listOf ( <NUM_LIT> ) ) , listOf ( listOf ( <NUM_LIT> , <NUM_LIT> ) ) ) ) <EOL> val expected = listOf ( listOf ( listOf ( listOf ( <NUM_LIT:1L> , <NUM_LIT:3L> ) , listOf ( <NUM_LIT> , <NUM_LIT:0L> ) ) , listOf ( listOf ( <NUM_LIT> , <NUM_LIT> ) , listOf ( <NUM_LIT:0L> , <NUM_LIT:0L> ) ) ) ) <EOL> val a : D4Array < Long > = mk . createAlignedNDArray ( list , filling = <NUM_LIT:0.0> ) <EOL> assertEquals ( expected , a . toListD4 ( ) ) <EOL> }

/**
 * Tests the function 'createAlignedNDArray' that creates a four-dimensional array from a list of number lists.
 * The test asserts that:
 * - The output array's size matches the size of the longest list in the input
 * and all lists are filled to match this length.
 * - The lists shorter than the longest one are filled with the specified filling value.
 */


@ Test <EOL> fun createZeroFilledFloatArray ( )

{ <EOL> val dim1 = <NUM_LIT:5> <EOL> val dim2 = <NUM_LIT:7> <EOL> val dim3 = <NUM_LIT:3> <EOL> val dim4 = <NUM_LIT:2> <EOL> val a = mk . zeros < Float > ( dim1 , dim2 , dim3 , dim4 ) <EOL> assertEquals ( dim1 * dim2 * dim3 * dim4 , a . size ) <EOL> assertEquals ( dim1 * dim2 * dim3 * dim4 , a . data . size ) <EOL> assertTrue { a . all { it == <NUM_LIT> } } <EOL> }

/**
 * This method checks if a float array of a given size is correctly created with all elements set to zero.
 */


@ Test <EOL> fun createFloatArrayFilledWithOnes ( )

{ <EOL> val dim1 = <NUM_LIT:5> <EOL> val dim2 = <NUM_LIT:7> <EOL> val dim3 = <NUM_LIT:3> <EOL> val dim4 = <NUM_LIT:2> <EOL> val a = mk . ones < Float > ( dim1 , dim2 , dim3 , dim4 ) <EOL> assertEquals ( dim1 * dim2 * dim3 * dim4 , a . size ) <EOL> assertEquals ( dim1 * dim2 * dim3 * dim4 , a . data . size ) <EOL> assertTrue { a . all { it == <NUM_LIT> } } <EOL> }

/**
 * Creates a float array filled with ones of a given size and checks if all elements are set to one.
 */


@ Test <EOL> fun createFourDimensionalArrayFromFloatList ( )

{ <EOL> val list = listOf ( listOf ( listOf ( listOf ( <NUM_LIT> , <NUM_LIT> ) , listOf ( <NUM_LIT> , <NUM_LIT> ) ) , listOf ( listOf ( <NUM_LIT> , <NUM_LIT> ) , listOf ( <NUM_LIT> , <NUM_LIT> ) ) ) ) <EOL> val a : D4Array < Float > = mk . ndarray ( list ) <EOL> assertEquals ( list , a . toListD4 ( ) ) <EOL> }

/**
 * Creates a four-dimensional array from a list of float lists
 * and checks if the array's list representation matches the input list.
 */


@ Test <EOL> fun createFourDimensionalArrayFromFloatSet ( )

{ <EOL> val set = setOf ( <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , - <NUM_LIT> , - <NUM_LIT> ) <EOL> val shape = intArrayOf ( <NUM_LIT:2> , <NUM_LIT:3> , <NUM_LIT:1> , <NUM_LIT:2> ) <EOL> val a : D4Array < Float > = mk . ndarray ( set , shape = shape ) <EOL> assertEquals ( set . size , a . size ) <EOL> assertEquals ( set , a . toSet ( ) ) <EOL> }

/**
 * Creates a four-dimensional array from a set of floats
 * and checks if the array's set representation matches the input set.
 */


@ Test <EOL> fun createFourDimensionalArrayFromPrimitiveFloatArray ( )

{ <EOL> val array = floatArrayOf ( <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> ) <EOL> val a = mk . ndarray ( array , <NUM_LIT:2> , <NUM_LIT:3> , <NUM_LIT:1> , <NUM_LIT:2> ) <EOL> assertEquals ( array . size , a . size ) <EOL> a . data . getFloatArray ( ) shouldBe array <EOL> }

/**
 * Creates a four-dimensional array from a primitive FloatArray
 * and checks if the array's FloatArray representation matches the input FloatArray.
 */


@ Test <EOL> fun createFloat4DArrayWithInitializationFunction ( )

{ <EOL> val a = mk . d4array < Float > ( <NUM_LIT:2> , <NUM_LIT:3> , <NUM_LIT:1> , <NUM_LIT:2> ) { it + <NUM_LIT> } <EOL> val expected = floatArrayOf ( <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> ) <EOL> assertEquals ( expected . size , a . size ) <EOL> a . data . getFloatArray ( ) shouldBe expected <EOL> }

/**
 * Creates a four-dimensional array with a given size using an initialization function
 * and checks if the array's FloatArray representation matches the expected output.
 */


@ Test <EOL> fun createFloat4DArrayWithInitAndIndices ( )

{ <EOL> val a = mk . d4arrayIndices < Float > ( <NUM_LIT:2> , <NUM_LIT:3> , <NUM_LIT:1> , <NUM_LIT:2> ) { i , j , k , l -> i * j + k . toFloat ( ) - l } <EOL> val expected = floatArrayOf ( <NUM_LIT> , - <NUM_LIT> , <NUM_LIT> , - <NUM_LIT> , <NUM_LIT> , - <NUM_LIT> , <NUM_LIT> , - <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> ) <EOL> assertEquals ( expected . size , a . size ) <EOL> a . data . getFloatArray ( ) shouldBe expected <EOL> }

/**
 * Creates a four-dimensional array with a given size using an initialization function and indices.
 * Checks if the array's FloatArray representation matches the expected output.
 */


@ OptIn ( ExperimentalMultikApi :: class ) <EOL> @ Test <EOL> fun createAlignedFloat4DArray ( )

{ <EOL> val list = listOf ( listOf ( listOf ( listOf ( <NUM_LIT> , <NUM_LIT> ) , listOf ( <NUM_LIT> ) ) , listOf ( listOf ( <NUM_LIT> , <NUM_LIT> ) , ) ) ) <EOL> val expected = listOf ( listOf ( listOf ( listOf ( <NUM_LIT> , <NUM_LIT> ) , listOf ( <NUM_LIT> , <NUM_LIT> ) ) , listOf ( listOf ( <NUM_LIT> , <NUM_LIT> ) , listOf ( <NUM_LIT> , <NUM_LIT> ) ) ) ) <EOL> val a : D4Array < Float > = mk . createAlignedNDArray ( list , filling = <NUM_LIT:0.0> ) <EOL> assertEquals ( expected , a . toListD4 ( ) ) <EOL> }


@ Test <EOL> fun createZeroFilledDoubleArray ( )

{ <EOL> val dim1 = <NUM_LIT:5> <EOL> val dim2 = <NUM_LIT:7> <EOL> val dim3 = <NUM_LIT:3> <EOL> val dim4 = <NUM_LIT:2> <EOL> val a = mk . zeros < Double > ( dim1 , dim2 , dim3 , dim4 ) <EOL> assertEquals ( dim1 * dim2 * dim3 * dim4 , a . size ) <EOL> assertEquals ( dim1 * dim2 * dim3 * dim4 , a . data . size ) <EOL> assertTrue { a . all { it == <NUM_LIT:0.0> } } <EOL> }

/**
 * This method checks if a double array of a given size is correctly created with all elements set to zero.
 */


@ Test <EOL> fun createDoubleArrayFilledWithOnes ( )

{ <EOL> val dim1 = <NUM_LIT:5> <EOL> val dim2 = <NUM_LIT:7> <EOL> val dim3 = <NUM_LIT:3> <EOL> val dim4 = <NUM_LIT:2> <EOL> val a = mk . ones < Double > ( dim1 , dim2 , dim3 , dim4 ) <EOL> assertEquals ( dim1 * dim2 * dim3 * dim4 , a . size ) <EOL> assertEquals ( dim1 * dim2 * dim3 * dim4 , a . data . size ) <EOL> assertTrue { a . all { it == <NUM_LIT:1.0> } } <EOL> }

/**
 * Creates a double array filled with ones of a given size and checks if all elements are set to one.
 */


@ Test <EOL> fun createFourDimensionalArrayFromDoubleList ( )

{ <EOL> val list = <EOL> listOf ( listOf ( listOf ( listOf ( <NUM_LIT:1.0> , <NUM_LIT:3.0> ) , listOf ( <NUM_LIT> , <NUM_LIT> ) ) , listOf ( listOf ( <NUM_LIT> , <NUM_LIT> ) , listOf ( <NUM_LIT> , <NUM_LIT:2.0> ) ) ) ) <EOL> val a : D4Array < Double > = mk . ndarray ( list ) <EOL> assertEquals ( list , a . toListD4 ( ) ) <EOL> }

/**
 * Creates a four-dimensional array from a list of double lists
 * and checks if the array's list representation matches the input list.
 */


@ Test <EOL> fun createFourDimensionalArrayFromDoubleSet ( )

{ <EOL> val set = setOf ( <NUM_LIT:1.0> , <NUM_LIT:3.0> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT:2.0> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , - <NUM_LIT> , - <NUM_LIT:1.0> ) <EOL> val shape = intArrayOf ( <NUM_LIT:2> , <NUM_LIT:3> , <NUM_LIT:1> , <NUM_LIT:2> ) <EOL> val a : D4Array < Double > = mk . ndarray ( set , shape = shape ) <EOL> assertEquals ( set . size , a . size ) <EOL> assertEquals ( set , a . toSet ( ) ) <EOL> }

/**
 * Creates a four-dimensional array from a set of doubles
 * and checks if the array's set representation matches the input set.
 */


@ Test <EOL> fun createFourDimensionalArrayFromPrimitiveDoubleArray ( )

{ <EOL> val array = doubleArrayOf ( <NUM_LIT:1.0> , <NUM_LIT:3.0> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT:2.0> , <NUM_LIT> , <NUM_LIT:3.0> , <NUM_LIT> , <NUM_LIT:3.0> , <NUM_LIT> , <NUM_LIT:1.0> ) <EOL> val a = mk . ndarray ( array , <NUM_LIT:2> , <NUM_LIT:3> , <NUM_LIT:1> , <NUM_LIT:2> ) <EOL> assertEquals ( array . size , a . size ) <EOL> a . data . getDoubleArray ( ) shouldBe array <EOL> }

/**
 * Creates a four-dimensional array from a primitive DoubleArray
 * and checks if the array's DoubleArray representation matches the input DoubleArray.
 */


@ Test <EOL> fun createDouble4DArrayWithInitializationFunction ( )

{ <EOL> val a = mk . d4array < Double > ( <NUM_LIT:2> , <NUM_LIT:3> , <NUM_LIT:1> , <NUM_LIT:2> ) { it + <NUM_LIT:3.0> } <EOL> val expected = doubleArrayOf ( <NUM_LIT:3.0> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> ) <EOL> assertEquals ( expected . size , a . size ) <EOL> a . data . getDoubleArray ( ) shouldBe expected <EOL> }

/**
 * Creates a four-dimensional array with a given size using an initialization function
 * and checks if the array's DoubleArray representation matches the expected output.
 */


@ Test <EOL> fun createDouble4DArrayWithInitAndIndices ( )

{ <EOL> val a = mk . d4arrayIndices < Double > ( <NUM_LIT:2> , <NUM_LIT:3> , <NUM_LIT:1> , <NUM_LIT:2> ) { i , j , k , l -> i * j + k . toDouble ( ) - l } <EOL> val expected = doubleArrayOf ( <NUM_LIT:0.0> , - <NUM_LIT:1.0> , <NUM_LIT:0.0> , - <NUM_LIT:1.0> , <NUM_LIT:0.0> , - <NUM_LIT:1.0> , <NUM_LIT:0.0> , - <NUM_LIT:1.0> , <NUM_LIT:1.0> , <NUM_LIT:0.0> , <NUM_LIT:2.0> , <NUM_LIT:1.0> ) <EOL> assertEquals ( expected . size , a . size ) <EOL> a . data . getDoubleArray ( ) shouldBe expected <EOL> }

/**
 * Creates a four-dimensional array with a given size using an initialization function and indices.
 * Checks if the array's DoubleArray representation matches the expected output.
 */


@ OptIn ( ExperimentalMultikApi :: class ) <EOL> @ Test <EOL> fun createAlignedDouble4DArray ( )

{ <EOL> val list = listOf ( listOf ( listOf ( listOf ( <NUM_LIT:1.0> , <NUM_LIT:3.0> ) , listOf ( <NUM_LIT> ) ) , listOf ( listOf ( <NUM_LIT> , <NUM_LIT> ) , ) ) ) <EOL> val expected = listOf ( listOf ( listOf ( listOf ( <NUM_LIT:1.0> , <NUM_LIT:3.0> ) , listOf ( <NUM_LIT> , <NUM_LIT:0.0> ) ) , listOf ( listOf ( <NUM_LIT> , <NUM_LIT> ) , listOf ( <NUM_LIT:0.0> , <NUM_LIT:0.0> ) ) ) ) <EOL> val a : D4Array < Double > = mk . createAlignedNDArray ( list , filling = <NUM_LIT:0.0> ) <EOL> assertEquals ( expected , a . toListD4 ( ) ) <EOL> }


@ Test <EOL> fun createZeroFilledComplexFloatArray ( )

{ <EOL> val dim1 = <NUM_LIT:5> <EOL> val dim2 = <NUM_LIT:7> <EOL> val dim3 = <NUM_LIT:3> <EOL> val dim4 = <NUM_LIT:2> <EOL> val a = mk . zeros < ComplexFloat > ( dim1 , dim2 , dim3 , dim4 ) <EOL> assertEquals ( dim1 * dim2 * dim3 * dim4 , a . size ) <EOL> assertEquals ( dim1 * dim2 * dim3 * dim4 , a . data . size ) <EOL> assertTrue { a . all { it == ComplexFloat . zero } } <EOL> }

/**
 * This method checks if a ComplexFloat array of a given size is correctly created with all elements set to zero.
 */


@ Test <EOL> fun createComplexFloatArrayFilledWithOnes ( )

{ <EOL> val dim1 = <NUM_LIT:5> <EOL> val dim2 = <NUM_LIT:7> <EOL> val dim3 = <NUM_LIT:3> <EOL> val dim4 = <NUM_LIT:2> <EOL> val a = mk . ones < ComplexFloat > ( dim1 , dim2 , dim3 , dim4 ) <EOL> assertEquals ( dim1 * dim2 * dim3 * dim4 , a . size ) <EOL> assertEquals ( dim1 * dim2 * dim3 * dim4 , a . data . size ) <EOL> assertTrue { a . all { it == ComplexFloat . one } } <EOL> }

/**
 * Creates a ComplexFloat array filled with ones of a given size and checks if all elements are set to one.
 */


@ Test <EOL> fun createFourDimensionalArrayFromComplexFloatList ( )

{ <EOL> val list = listOf ( listOf ( listOf ( listOf ( <NUM_LIT> + <NUM_LIT> . i , <NUM_LIT> + <NUM_LIT> . i ) , listOf ( <NUM_LIT> + <NUM_LIT> . i , <NUM_LIT> + <NUM_LIT> . i ) ) , listOf ( listOf ( <NUM_LIT> + <NUM_LIT> . i , <NUM_LIT> + <NUM_LIT> . i ) , listOf ( <NUM_LIT> + <NUM_LIT> . i , <NUM_LIT> + <NUM_LIT> . i ) ) ) ) <EOL> val a : D4Array < ComplexFloat > = mk . ndarray ( list ) <EOL> assertEquals ( list , a . toListD4 ( ) ) <EOL> }

/**
 * Creates a four-dimensional array from a list of complex float lists
 * and checks if the array's list representation matches the input list.
 */


@ Test <EOL> fun createFourDimensionalArrayFromComplexFloatSet ( )

{ <EOL> val set = setOf ( <NUM_LIT> + <NUM_LIT> . i , <NUM_LIT> + <NUM_LIT> . i , <NUM_LIT> + <NUM_LIT> . i , <NUM_LIT> + <NUM_LIT> . i , <NUM_LIT> + <NUM_LIT> . i , <NUM_LIT> + <NUM_LIT> . i , <NUM_LIT> + <NUM_LIT> . i , <NUM_LIT> + <NUM_LIT> . i , <NUM_LIT> + <NUM_LIT> . i , <NUM_LIT> + <NUM_LIT> . i , - <NUM_LIT> + <NUM_LIT> . i , - <NUM_LIT> + <NUM_LIT> . i ) <EOL> val shape = intArrayOf ( <NUM_LIT:2> , <NUM_LIT:3> , <NUM_LIT:1> , <NUM_LIT:2> ) <EOL> val a : D4Array < ComplexFloat > = mk . ndarray ( set , shape = shape ) <EOL> assertEquals ( set . size , a . size ) <EOL> assertEquals ( set , a . toSet ( ) ) <EOL> }

/**
 * Creates a four-dimensional array from a set of complex floats
 * and checks if the array's set representation matches the input set.
 */


@ Test <EOL> fun createFourDimensionalArrayFromPrimitiveComplexFloatArray ( )

{ <EOL> val array = complexFloatArrayOf ( <NUM_LIT> + <NUM_LIT> . i , <NUM_LIT> + <NUM_LIT> . i , <NUM_LIT> + <NUM_LIT> . i , <NUM_LIT> + <NUM_LIT> . i , <NUM_LIT> + <NUM_LIT> . i , <NUM_LIT> + <NUM_LIT> . i , <NUM_LIT> + <NUM_LIT> . i , <NUM_LIT> + <NUM_LIT> . i , <NUM_LIT> + <NUM_LIT> . i , <NUM_LIT> + <NUM_LIT> . i , <NUM_LIT> + <NUM_LIT> . i , <NUM_LIT> + <NUM_LIT> . i ) <EOL> val a = mk . ndarray ( array , <NUM_LIT:2> , <NUM_LIT:3> , <NUM_LIT:1> , <NUM_LIT:2> ) <EOL> assertEquals ( array . size , a . size ) <EOL> a . data . getComplexFloatArray ( ) shouldBe array <EOL> }

/**
 * Creates a four-dimensional array from a primitive ComplexFloatArray
 * and checks if the array's ComplexFloatArray representation matches the input ComplexFloatArray.
 */


@ Test <EOL> fun createComplexFloat4DArrayWithInitializationFunction ( )

{ <EOL> val a = mk . d4array < ComplexFloat > ( <NUM_LIT:2> , <NUM_LIT:3> , <NUM_LIT:1> , <NUM_LIT:2> ) { ComplexFloat ( it + <NUM_LIT> , round ( ( it - <NUM_LIT> ) * <NUM_LIT> ) / <NUM_LIT> ) } <EOL> val expected = complexFloatArrayOf ( <NUM_LIT> - <NUM_LIT> . i , <NUM_LIT> + <NUM_LIT> . i , <NUM_LIT> + <NUM_LIT> . i , <NUM_LIT> + <NUM_LIT> . i , <NUM_LIT> + <NUM_LIT> . i , <NUM_LIT> + <NUM_LIT> . i , <NUM_LIT> + <NUM_LIT> . i , <NUM_LIT> + <NUM_LIT> . i , <NUM_LIT> + <NUM_LIT> . i , <NUM_LIT> + <NUM_LIT> . i , <NUM_LIT> + <NUM_LIT> . i , <NUM_LIT> + <NUM_LIT> . i ) <EOL> assertEquals ( expected . size , a . size ) <EOL> a . data . getComplexFloatArray ( ) shouldBe expected <EOL> }

/**
 * Creates a four-dimensional array with a given size using an initialization function
 * and checks if the array's ComplexFloatArray representation matches the expected output.
 */


@ Test <EOL> fun createComplexFloat4DArrayWithInitAndIndices ( )

{ <EOL> val a = mk . d4arrayIndices < ComplexFloat > ( <NUM_LIT:2> , <NUM_LIT:3> , <NUM_LIT:1> , <NUM_LIT:2> ) { i , j , k , l -> i * j + k - l + ComplexFloat ( <NUM_LIT:7> ) } <EOL> val expected = complexFloatArrayOf ( <NUM_LIT> + <NUM_LIT> . i , <NUM_LIT> + <NUM_LIT> . i , <NUM_LIT> + <NUM_LIT> . i , <NUM_LIT> + <NUM_LIT> . i , <NUM_LIT> + <NUM_LIT> . i , <NUM_LIT> + <NUM_LIT> . i , <NUM_LIT> + <NUM_LIT> . i , <NUM_LIT> + <NUM_LIT> . i , <NUM_LIT> + <NUM_LIT> . i , <NUM_LIT> + <NUM_LIT> . i , <NUM_LIT> + <NUM_LIT> . i , <NUM_LIT> + <NUM_LIT> . i ) <EOL> assertEquals ( expected . size , a . size ) <EOL> a . data . getComplexFloatArray ( ) shouldBe expected <EOL> }

/**
 * Creates a four-dimensional array with a given size using an initialization function and indices.
 * Checks if the array's ComplexFloatArray representation matches the expected output.
 */


@ Test <EOL> fun createZeroFilledComplexDoubleArray ( )

{ <EOL> val dim1 = <NUM_LIT:5> <EOL> val dim2 = <NUM_LIT:7> <EOL> val dim3 = <NUM_LIT:3> <EOL> val dim4 = <NUM_LIT:2> <EOL> val a = mk . zeros < ComplexDouble > ( dim1 , dim2 , dim3 , dim4 ) <EOL> assertEquals ( dim1 * dim2 * dim3 * dim4 , a . size ) <EOL> assertEquals ( dim1 * dim2 * dim3 * dim4 , a . data . size ) <EOL> assertTrue { a . all { it == ComplexDouble . zero } } <EOL> }

/**
 * This method checks if a ComplexDouble array of a given size is correctly created with all elements set to zero.
 */


@ Test <EOL> fun createComplexDoubleArrayFilledWithOnes ( )

{ <EOL> val dim1 = <NUM_LIT:5> <EOL> val dim2 = <NUM_LIT:7> <EOL> val dim3 = <NUM_LIT:3> <EOL> val dim4 = <NUM_LIT:2> <EOL> val a = mk . ones < ComplexDouble > ( dim1 , dim2 , dim3 , dim4 ) <EOL> assertEquals ( dim1 * dim2 * dim3 * dim4 , a . size ) <EOL> assertEquals ( dim1 * dim2 * dim3 * dim4 , a . data . size ) <EOL> assertTrue { a . all { it == ComplexDouble . one } } <EOL> }

/**
 * Creates a ComplexDouble array filled with ones of a given size and checks if all elements are set to one.
 */


@ Test <EOL> fun createFourDimensionalArrayFromComplexDoubleList ( )

{ <EOL> val list = listOf ( listOf ( listOf ( listOf ( <NUM_LIT:1.0> + <NUM_LIT> . i , <NUM_LIT:3.0> + <NUM_LIT> . i ) , listOf ( <NUM_LIT> + <NUM_LIT> . i , <NUM_LIT:8> + <NUM_LIT> . i ) ) , listOf ( listOf ( <NUM_LIT> + <NUM_LIT> . i , <NUM_LIT> + <NUM_LIT> . i ) , listOf ( <NUM_LIT> + <NUM_LIT> . i , <NUM_LIT:2.0> + <NUM_LIT> . i ) ) ) ) <EOL> val a : D4Array < ComplexDouble > = mk . ndarray ( list ) <EOL> assertEquals ( list , a . toListD4 ( ) ) <EOL> }

/**
 * Creates a four-dimensional array from a list of byte lists
 * and checks if the array's list representation matches the input list.
 */


@ Test <EOL> fun createFourDimensionalArrayFromComplexDoubleSet ( )

{ <EOL> val set = setOf ( <NUM_LIT:1.0> + <NUM_LIT> . i , <NUM_LIT:3.0> + <NUM_LIT> . i , <NUM_LIT> + <NUM_LIT> . i , <NUM_LIT> + <NUM_LIT> . i , <NUM_LIT> + <NUM_LIT> . i , <NUM_LIT:2.0> + <NUM_LIT> . i , <NUM_LIT> + <NUM_LIT> . i , <NUM_LIT> + <NUM_LIT> . i , <NUM_LIT> + <NUM_LIT> . i , <NUM_LIT> + <NUM_LIT> . i , - <NUM_LIT> + <NUM_LIT> . i , - <NUM_LIT:1.0> + <NUM_LIT> . i ) <EOL> val shape = intArrayOf ( <NUM_LIT:2> , <NUM_LIT:3> , <NUM_LIT:1> , <NUM_LIT:2> ) <EOL> val a : D4Array < ComplexDouble > = mk . ndarray ( set , shape = shape ) <EOL> assertEquals ( set . size , a . size ) <EOL> assertEquals ( set , a . toSet ( ) ) <EOL> }

/**
 * Creates a four-dimensional array from a set of complex doubles
 * and checks if the array's set representation matches the input set.
 */


@ Test <EOL> fun createFourDimensionalArrayFromPrimitiveComplexDoubleArray ( )

{ <EOL> val array = complexDoubleArrayOf ( <NUM_LIT:1.0> + <NUM_LIT> . i , <NUM_LIT:3.0> + <NUM_LIT> . i , <NUM_LIT> + <NUM_LIT> . i , <NUM_LIT> + <NUM_LIT> . i , <NUM_LIT> + <NUM_LIT> . i , <NUM_LIT:2.0> + <NUM_LIT> . i , <NUM_LIT> + <NUM_LIT> . i , <NUM_LIT:3.0> + <NUM_LIT> . i , <NUM_LIT> + <NUM_LIT> . i , <NUM_LIT:3.0> + <NUM_LIT> . i , <NUM_LIT> + <NUM_LIT> . i , <NUM_LIT:1.0> + <NUM_LIT> . i ) <EOL> val a = mk . ndarray ( array , <NUM_LIT:2> , <NUM_LIT:3> , <NUM_LIT:1> , <NUM_LIT:2> ) <EOL> assertEquals ( array . size , a . size ) <EOL> a . data . getComplexDoubleArray ( ) shouldBe array <EOL> }

/**
 * Creates a four-dimensional array from a primitive ComplexDoubleArray
 * and checks if the array's ComplexDoubleArray representation matches the input ComplexDoubleArray.
 */


@ Test <EOL> fun createComplexDouble4DArrayWithInitializationFunction ( )

{ <EOL> val a = mk . d4array < ComplexDouble > ( <NUM_LIT:2> , <NUM_LIT:3> , <NUM_LIT:1> , <NUM_LIT:2> ) { ComplexDouble ( it + <NUM_LIT> , round ( ( it - <NUM_LIT> ) * <NUM_LIT> ) / <NUM_LIT> ) } <EOL> val expected = complexDoubleArrayOf ( <NUM_LIT> - <NUM_LIT> . i , <NUM_LIT> + <NUM_LIT> . i , <NUM_LIT> + <NUM_LIT> . i , <NUM_LIT> + <NUM_LIT> . i , <NUM_LIT> + <NUM_LIT> . i , <NUM_LIT> + <NUM_LIT> . i , <NUM_LIT> + <NUM_LIT> . i , <NUM_LIT> + <NUM_LIT> . i , <NUM_LIT> + <NUM_LIT> . i , <NUM_LIT> + <NUM_LIT> . i , <NUM_LIT> + <NUM_LIT> . i , <NUM_LIT> + <NUM_LIT> . i ) <EOL> assertEquals ( expected . size , a . size ) <EOL> a . data . getComplexDoubleArray ( ) shouldBe expected <EOL> }

/**
 * Creates a four-dimensional array with a given size using an initialization function
 * and checks if the array's ComplexDoubleArray representation matches the expected output.
 */


@ Test <EOL> fun createComplexDouble4DArrayWithInitAndIndices ( )

{ <EOL> val a = mk . d4arrayIndices < ComplexDouble > ( <NUM_LIT:2> , <NUM_LIT:3> , <NUM_LIT:1> , <NUM_LIT:2> ) { i , j , k , l -> i * j + k - l + ComplexDouble ( <NUM_LIT:7> ) } <EOL> val expected = complexDoubleArrayOf ( <NUM_LIT> + <NUM_LIT> . i , <NUM_LIT> + <NUM_LIT> . i , <NUM_LIT> + <NUM_LIT> . i , <NUM_LIT> + <NUM_LIT> . i , <NUM_LIT> + <NUM_LIT> . i , <NUM_LIT> + <NUM_LIT> . i , <NUM_LIT> + <NUM_LIT> . i , <NUM_LIT> + <NUM_LIT> . i , <NUM_LIT> + <NUM_LIT> . i , <NUM_LIT> + <NUM_LIT> . i , <NUM_LIT> + <NUM_LIT> . i , <NUM_LIT> + <NUM_LIT> . i ) <EOL> assertEquals ( expected . size , a . size ) <EOL> a . data . getComplexDoubleArray ( ) shouldBe expected <EOL> }

/**
 * Creates a four-dimensional array with a given size using an initialization function and indices.
 * Checks if the array's ComplexDoubleArray representation matches the expected output.
 */


private fun FirCallableSymbol < * > . isEnhanceableIntersection ( ) : Boolean

{ <EOL> return this is FirIntersectionCallableSymbol && <EOL> dispatchReceiverClassLookupTagOrNull ( ) == owner . symbol . toLookupTag ( ) && <EOL> unwrapFakeOverrides < FirCallableSymbol < * > > ( ) . origin is FirDeclarationOrigin . Enhancement <EOL> }

/**
 * Intersection overrides with Java and Kotlin overridden symbols need to be enhanced so that we get non-flexible types
 * in the signature.
 * This is required for @PurelyImplements to work properly.
 *
 * We only enhance intersection overrides if their dispatch receiver is equal to [owner], i.e. we don't enhance inherited
 * intersection overrides.
 *
 * See compiler/testData/codegen/box/fakeOverride/javaInheritsKotlinIntersectionOverride.kt.
 */


private fun enhanceMethod ( firMethod : FirFunction , methodId : CallableId , name : Name ? , enhancedTypeParameters : List < FirTypeParameterRef > ? , isIntersectionOverride : Boolean , precomputedOverridden : List < FirCallableDeclaration > ? , ) : FirFunctionSymbol < * >

{ <EOL> val fakeSource = firMethod . source ? . fakeElement ( KtFakeSourceElementKind . Enhancement ) <EOL> val predefinedEnhancementInfo = <EOL> SignatureBuildingComponents . signature ( owner . symbol . classId , firMethod . computeJvmDescriptor { it . toConeKotlinTypeProbablyFlexible ( session , javaTypeParameterStack , fakeSource ) } ) . let { signature -> <EOL> PREDEFINED_FUNCTION_ENHANCEMENT_INFO_BY_SIGNATURE [ signature ] <EOL> } <EOL> predefinedEnhancementInfo ? . let { <EOL> assert ( it . parametersInfo . size == firMethod . valueParameters . size ) { <EOL> "<STR_LIT>" <EOL> } <EOL> } <EOL> val defaultQualifiers = firMethod . computeDefaultQualifiers ( ) <EOL> val overriddenMembers = precomputedOverridden ? : ( firMethod as? FirSimpleFunction ) ? . overridden ( ) . orEmpty ( ) <EOL> val hasReceiver = overriddenMembers . any { it . receiverParameter != null } <EOL> val newReceiverTypeRef = if ( firMethod is FirSimpleFunction && hasReceiver ) { <EOL> enhanceReceiverType ( firMethod , overriddenMembers , defaultQualifiers ) <EOL> } else null <EOL> val ( newReturnTypeRef , deferredCalc ) = if ( firMethod is FirSimpleFunction ) { <EOL> enhanceReturnType ( firMethod , overriddenMembers , defaultQualifiers , predefinedEnhancementInfo ) <EOL> } else { <EOL> firMethod . returnTypeRef to null <EOL> } <EOL> val enhancedValueParameterTypes = mutableListOf < FirResolvedTypeRef > ( ) <EOL> for ( ( index , valueParameter ) in firMethod . valueParameters . withIndex ( ) ) { <EOL> if ( hasReceiver && index == <NUM_LIT:0> ) continue <EOL> enhancedValueParameterTypes += enhanceValueParameterType ( firMethod , overriddenMembers , hasReceiver , defaultQualifiers , predefinedEnhancementInfo , valueParameter , if ( hasReceiver ) index - <NUM_LIT:1> else index ) <EOL> } <EOL> val functionSymbol : FirFunctionSymbol < * > <EOL> var isJavaRecordComponent = false <EOL> val typeParameterSubstitutionMap = mutableMapOf < FirTypeParameterSymbol , ConeKotlinType > ( ) <EOL> var typeParameterSubstitutor : ConeSubstitutor ? = null <EOL> val declarationOrigin = <EOL> if ( isIntersectionOverride ) FirDeclarationOrigin . IntersectionOverride else FirDeclarationOrigin . Enhancement <EOL> val function = when ( firMethod ) { <EOL> is FirConstructor -> { <EOL> val symbol = FirConstructorSymbol ( methodId ) . also { functionSymbol = it } <EOL> if ( firMethod . isPrimary ) { <EOL> FirPrimaryConstructorBuilder ( ) . apply { <EOL> returnTypeRef = newReturnTypeRef ! ! <EOL> val resolvedStatus = firMethod . status as? FirResolvedDeclarationStatus <EOL> status = if ( resolvedStatus != null ) { <EOL> FirResolvedDeclarationStatusImpl ( resolvedStatus . visibility , Modality . FINAL , resolvedStatus . effectiveVisibility ) <EOL> } else { <EOL> FirDeclarationStatusImpl ( firMethod . visibility , Modality . FINAL ) <EOL> } . apply { <EOL> isInner = firMethod . isInner <EOL> hasStableParameterNames = firMethod . hasStableParameterNames <EOL> } <EOL> this . symbol = symbol <EOL> dispatchReceiverType = firMethod . dispatchReceiverType <EOL> attributes = firMethod . attributes . copy ( ) <EOL> } <EOL> } else { <EOL> FirConstructorBuilder ( ) . apply { <EOL> returnTypeRef = newReturnTypeRef ! ! <EOL> status = firMethod . status <EOL> this . symbol = symbol <EOL> dispatchReceiverType = firMethod . dispatchReceiverType <EOL> attributes = firMethod . attributes . copy ( ) <EOL> } <EOL> } . apply { <EOL> source = firMethod . source <EOL> moduleData = this@FirSignatureEnhancement . moduleData <EOL> resolvePhase = FirResolvePhase . ANALYZED_DEPENDENCIES <EOL> origin = declarationOrigin <EOL> this . typeParameters += ( enhancedTypeParameters ? : firMethod . typeParameters ) <EOL> } <EOL> } <EOL> is FirSimpleFunction -> { <EOL> isJavaRecordComponent = firMethod . isJavaRecordComponent == true <EOL> FirSimpleFunctionBuilder ( ) . apply { <EOL> source = firMethod . source <EOL> moduleData = this@FirSignatureEnhancement . moduleData <EOL> origin = declarationOrigin <EOL> this . name = name ! ! <EOL> status = firMethod . status <EOL> symbol = if ( isIntersectionOverride ) { <EOL> FirIntersectionOverrideFunctionSymbol ( methodId , overriddenMembers . map { it . symbol } , containsMultipleNonSubsumed = ( firMethod . symbol as? FirIntersectionCallableSymbol ) ? . containsMultipleNonSubsumed == true , ) <EOL> } else { <EOL> FirNamedFunctionSymbol ( methodId ) <EOL> } . also { functionSymbol = it } <EOL> resolvePhase = FirResolvePhase . ANALYZED_DEPENDENCIES <EOL> typeParameters += ( enhancedTypeParameters ? : firMethod . typeParameters ) . map { typeParameter -> <EOL> require ( typeParameter is FirTypeParameter ) { <EOL> "<STR_LIT>" <EOL> } <EOL> val newTypeParameter = buildTypeParameterCopy ( typeParameter ) { <EOL> origin = declarationOrigin <EOL> symbol = FirTypeParameterSymbol ( ) <EOL> containingDeclarationSymbol = functionSymbol <EOL> } <EOL> typeParameterSubstitutionMap [ typeParameter . symbol ] = ConeTypeParameterTypeImpl ( newTypeParameter . symbol . toLookupTag ( ) , isNullable = false ) <EOL> newTypeParameter <EOL> } <EOL> if ( typeParameterSubstitutionMap . isNotEmpty ( ) ) { <EOL> typeParameterSubstitutor = ConeSubstitutorByMap . create ( typeParameterSubstitutionMap , session ) <EOL> } <EOL> returnTypeRef = if ( typeParameterSubstitutor != null && newReturnTypeRef is FirResolvedTypeRef ) { <EOL> newReturnTypeRef . withReplacedConeType ( typeParameterSubstitutor ? . substituteOrNull ( newReturnTypeRef . coneType ) ) <EOL> } else { <EOL> newReturnTypeRef ? : FirImplicitTypeRefImplWithoutSource <EOL> } <EOL> val substitutedReceiverTypeRef = newReceiverTypeRef ? . withReplacedConeType ( typeParameterSubstitutor ? . substituteOrNull ( newReceiverTypeRef . coneType ) ) <EOL> receiverParameter = substitutedReceiverTypeRef ? . let { receiverType -> <EOL> buildReceiverParameter { <EOL> typeRef = receiverType <EOL> annotations += firMethod . valueParameters . first ( ) . annotations <EOL> source = receiverType . source ? . fakeElement ( KtFakeSourceElementKind . ReceiverFromType ) <EOL> } <EOL> } <EOL> typeParameters . forEach { typeParameter -> <EOL> typeParameter . replaceBounds ( typeParameter . bounds . map { boundTypeRef -> <EOL> boundTypeRef . withReplacedConeType ( typeParameterSubstitutor ? . substituteOrNull ( boundTypeRef . coneType ) ) <EOL> } ) <EOL> } <EOL> dispatchReceiverType = firMethod . dispatchReceiverType <EOL> attributes = firMethod . attributes . copy ( ) . apply { <EOL> if ( deferredCalc != null ) { <EOL> deferredCallableCopyReturnType = if ( typeParameterSubstitutor != null ) { <EOL> DelegatingDeferredReturnTypeWithSubstitution ( deferredCalc , typeParameterSubstitutor ! ! ) <EOL> } else { <EOL> deferredCalc <EOL> } <EOL> } <EOL> } <EOL> } <EOL> } <EOL> else -> errorWithAttachment ( "<STR_LIT>" ) { <EOL> withFirEntry ( "<STR_LIT>" , firMethod ) <EOL> } <EOL> } . apply { <EOL> val newValueParameters = firMethod . valueParameters . zip ( enhancedValueParameterTypes ) { valueParameter , enhancedReturnType -> <EOL> valueParameter . defaultValue ? . replaceConeTypeOrNull ( enhancedReturnType . coneType ) <EOL> buildValueParameter { <EOL> source = valueParameter . source <EOL> containingFunctionSymbol = functionSymbol <EOL> moduleData = this@FirSignatureEnhancement . moduleData <EOL> origin = declarationOrigin <EOL> returnTypeRef = enhancedReturnType . withReplacedConeType ( typeParameterSubstitutor ? . substituteOrNull ( enhancedReturnType . coneType ) ) <EOL> this . name = valueParameter . name <EOL> symbol = FirValueParameterSymbol ( this . name ) <EOL> defaultValue = valueParameter . defaultValue <EOL> isCrossinline = valueParameter . isCrossinline <EOL> isNoinline = valueParameter . isNoinline <EOL> isVararg = valueParameter . isVararg <EOL> resolvePhase = FirResolvePhase . ANALYZED_DEPENDENCIES <EOL> annotations += valueParameter . annotations <EOL> } <EOL> } <EOL> this . valueParameters += newValueParameters <EOL> annotations += firMethod . annotations <EOL> deprecationsProvider = annotations . getDeprecationsProviderFromAnnotations ( session , fromJava = true ) <EOL> } . build ( ) . apply { <EOL> if ( isJavaRecordComponent ) { <EOL> this . isJavaRecordComponent = true <EOL> } <EOL> updateIsOperatorFlagIfNeeded ( this ) <EOL> } <EOL> return function . symbol <EOL> }

/**
 * @param enhancedTypeParameters pass enhanced type parameters that will be used instead of original ones.
 * **null** means that [enhanceMethod] will use the original type parameters to create an enhanced function
 */


fun performFirstRoundOfBoundsResolution ( typeParameters : List < FirTypeParameterRef > , source : KtSourceElement ? , ) : Pair < List < List < FirTypeRef > > , List < FirTypeParameterRef > >

{ <EOL> val initialBounds : MutableList < List < FirTypeRef > > = mutableListOf ( ) <EOL> val typeParametersCopy = ArrayList < FirTypeParameterRef > ( typeParameters . size ) <EOL> for ( typeParameter in typeParameters ) { <EOL> typeParametersCopy += if ( typeParameter is FirTypeParameter ) { <EOL> initialBounds . add ( typeParameter . bounds . toList ( ) ) <EOL> buildTypeParameterCopy ( typeParameter ) { <EOL> bounds . clear ( ) <EOL> typeParameter . bounds . mapTo ( bounds ) { <EOL> it . resolveIfJavaType ( session , javaTypeParameterStack , source , FirJavaTypeConversionMode . TYPE_PARAMETER_BOUND_FIRST_ROUND ) <EOL> } <EOL> } <EOL> } else { <EOL> typeParameter <EOL> } <EOL> } <EOL> return initialBounds to typeParametersCopy <EOL> }

/**
 * Perform first time initialization of bounds with FirResolvedTypeRef instances
 * But after that bounds are still not enhanced and more over might have not totally correct raw types bounds
 * (see the next step in the method performSecondRoundOfBoundsResolution)
 *
 * In case of A<T extends A>, or similar cases, the bound is converted to the flexible version A<*>..A<*>?,
 * while in the end it's assumed to be A<A<*>>..A<*>?
 *
 * That's necessary because at this stage it's not quite easy to come just to the final version since for that
 * we would the need upper bounds of all the type parameters that might not yet be initialized at the moment
 *
 * See the usages of FirJavaTypeConversionMode.TYPE_PARAMETER_BOUND_FIRST_ROUND
 */


private fun performSecondRoundOfBoundsResolution ( typeParameters : List < FirTypeParameterRef > , initialBounds : List < List < FirTypeRef > > , source : KtSourceElement ? , )

{ <EOL> var currentIndex = <NUM_LIT:0> <EOL> for ( typeParameter in typeParameters ) { <EOL> if ( typeParameter is FirTypeParameter ) { <EOL> typeParameter . replaceBounds ( initialBounds [ currentIndex ] . map { <EOL> it . resolveIfJavaType ( session , javaTypeParameterStack , source , FirJavaTypeConversionMode . TYPE_PARAMETER_BOUND_AFTER_FIRST_ROUND ) <EOL> } ) <EOL> currentIndex ++ <EOL> } <EOL> } <EOL> }

/**
 * In most cases that method doesn't change anything
 *
 * But the cases like A<T extends A>
 * After the first step we've got all bounds are initialized to potentially approximated version of raw types
 * And here, we compute the final version using previously initialized bounds
 *
 * So, mostly it works just as the first step, but assumes that bounds already contain FirResolvedTypeRef
 */


fun enhanceTypeParameterBoundsAfterFirstRound ( typeParameters : List < FirTypeParameterRef > , initialBounds : List < List < FirTypeRef > > , source : KtSourceElement ? , )

{ <EOL> performSecondRoundOfBoundsResolution ( typeParameters , initialBounds , source ) <EOL> typeParameters . replaceBounds { typeParameter , bound -> <EOL> enhanceTypeParameterBound ( typeParameter , bound , forceOnlyHeadTypeConstructor = true ) <EOL> } <EOL> typeParameters . replaceBounds { typeParameter , bound -> <EOL> enhanceTypeParameterBound ( typeParameter , bound , forceOnlyHeadTypeConstructor = false ) <EOL> } <EOL> }

/**
 * There are four rounds of bounds resolution for Java type parameters
 * 1. Plain conversion of Java types without any enhancement (with approximated raw types)
 * 2. The same conversion, but raw types are not computed precisely
 * 3. Enhancement for top-level types (no enhancement for arguments)
 * 4. Enhancement for the whole types (with arguments)
 *
 * This method requires type parameters that have already been run through the first round
 */


private fun enhanceReturnType ( owner : FirCallableDeclaration , overriddenMembers : List < FirCallableDeclaration > , defaultQualifiers : JavaTypeQualifiersByElementType ? , predefinedEnhancementInfo : PredefinedFunctionEnhancementInfo ? , ) : Pair < FirResolvedTypeRef ? , DeferredCallableCopyReturnType ? >

{ <EOL> val containerApplicabilityType = if ( owner is FirJavaField ) { <EOL> AnnotationQualifierApplicabilityType . FIELD <EOL> } else { <EOL> AnnotationQualifierApplicabilityType . METHOD_RETURN_TYPE <EOL> } <EOL> val forAnnotationMember = if ( owner is FirJavaField ) { <EOL> false <EOL> } else { <EOL> this . owner . classKind == ClassKind . ANNOTATION_CLASS <EOL> } <EOL> if ( overriddenMembers . any { it . returnTypeRef is FirImplicitTypeRef } ) { <EOL> val deferredReturnTypeCalculation = object : DeferredCallableCopyReturnType ( ) { <EOL> override fun computeReturnType ( calc : CallableCopyTypeCalculator ) : ConeKotlinType { <EOL> return owner . enhance ( overriddenMembers , owner , isCovariant = true , defaultQualifiers , containerApplicabilityType , typeInSignature = TypeInSignature . ReturnPossiblyDeferred ( calc ) , predefinedEnhancementInfo ? . returnTypeInfo , forAnnotationMember = forAnnotationMember ) . type <EOL> } <EOL> override fun toString ( ) : String = "<STR_LIT>" <EOL> } <EOL> return null to deferredReturnTypeCalculation <EOL> } <EOL> return owner . enhance ( overriddenMembers , owner , isCovariant = true , defaultQualifiers , containerApplicabilityType , TypeInSignature . Return , predefinedEnhancementInfo ? . returnTypeInfo , forAnnotationMember = forAnnotationMember ) to null <EOL> }

/**
 * Either returns a not-null [FirResolvedTypeRef] or a not-null [DeferredCallableCopyReturnType], never both.
 *
 * [DeferredCallableCopyReturnType] can only (but doesn't need to) be not-null when [overriddenMembers] is non-empty.
 */


abstract fun getClassesByClassId ( classId : ClassId ) : Collection < PsiClass >

/**
 * Gets a collection of [PsiClass] by [ClassId]
 *
 * In standalone mode, this is simply [PsiClassStub]-based [PsiClass]
 */


abstract fun createPermittedTypeSource ( psiTypeParameterSource : JavaElementPsiSource < out PsiClass > , permittedTypeIndex : Int , ) : JavaElementTypeSource < PsiClassType >

/**
 * @see com.intellij.psi.PsiClass.getPermitsListTypes
 */


protected fun assertActivationFunction ( act : Activation , inp : FloatArray , exp : FloatArray )

{ <EOL> EagerSession . create ( ) . use { session -> <EOL> val tf = Ops . create ( session ) <EOL> Assertions . assertArrayEquals ( exp , act . apply ( tf , tf . constant ( inp ) ) . asOutput ( ) . tensor ( ) . copyTo ( inp ) , EPS ) <EOL> } <EOL> }

/**
 * Checks if an Activation-function object with input [inp] gives valid result of [exp].
 *
 * For example, if you want to test [ReluActivation] with [inp] and [exp]
 * ```
 * val act = ReluActivation()
 * val inp = floatArrayOf(-1f, 0f, 1f)
 * val exp = floatArrayOf( 0f, 0f, 1f)
 *
 * assertActivationFunction(act, inp, exp) // Test passes
 * ```
 *
 * @param act activation function object
 * @param inp FloatArray applied to the activation function
 * @param exp FloatArray expected output for an activation function object [act] with input [inp]
 */


protected fun assertActivationFunction ( act : Activation , inp : Array < FloatArray > , exp : Array < FloatArray > )

{ <EOL> EagerSession . create ( ) . use { session -> <EOL> val tf = Ops . create ( session ) <EOL> val actual = act . apply ( tf , tf . constant ( inp ) ) . asOutput ( ) . tensor ( ) . copyTo ( inp ) <EOL> for ( i in <NUM_LIT:0> .. exp . lastIndex ) { <EOL> Assertions . assertArrayEquals ( exp [ i ] , actual [ i ] , EPS ) <EOL> } <EOL> } <EOL> }

/**
 * Checks if an Activation-function object with input [inp] gives a valid result of [exp].
 *
 * For example, if you want to test [ReluActivation] with [inp] and [exp]
 * ```
 * val act = ReluActivation()
 * val inp = arrayOf(floatArrayOf(-1f, -1f, -1f),
 * floatArrayOf(0f, 0f, 0f),
 * floatArrayOf(1f, 1f, 1f)
 * )
 * val exp = arrayOf(floatArrayOf( 0f, 0f, 0f),
 * floatArrayOf(0f, 0f, 0f),
 * floatArrayOf(1f, 1f, 1f)
 * )
 *
 * assertActivationFunction(act, inp, exp) // Test passes
 * ```
 *
 * @param act activation function object
 * @param inp Array`<FloatArray`> applied to the activation function
 * @param exp Array`<FloatArray`> expected output for an activation function object [act] with input [inp]
 */


protected fun assertActivationFunction ( act : Activation , inp : Array < Array < FloatArray > > , exp : Array < Array < FloatArray > > )

{ <EOL> EagerSession . create ( ) . use { session -> <EOL> val tf = Ops . create ( session ) <EOL> val actual = act . apply ( tf , tf . constant ( inp ) ) . asOutput ( ) . tensor ( ) . copyTo ( inp ) <EOL> for ( i in <NUM_LIT:0> .. exp . lastIndex ) { <EOL> for ( j in <NUM_LIT:0> .. exp [ i ] . lastIndex ) { <EOL> Assertions . assertArrayEquals ( exp [ i ] [ j ] , actual [ i ] [ j ] , EPS ) <EOL> } <EOL> } <EOL> } <EOL> }

/**
 * Accepts 3D float input values
 *
 * @see assertActivationFunction
 */


fun changedParamCount ( realValueParams : Int , thisParams : Int ) : Int

{ <EOL> val totalParams = realValueParams + thisParams <EOL> if ( totalParams == <NUM_LIT:0> ) return <NUM_LIT:1> <EOL> return ceil ( totalParams . toDouble ( ) / SLOTS_PER_INT . toDouble ( ) ) . toInt ( ) <EOL> }

/**
 * Calculates the number of 'changed' params needed based on the function's parameters.
 *
 * @param realValueParams The number of params defined by the user, those that are not implicit
 * (no extension or context receivers) or synthetic (no %composer, %changed or %defaults).
 * @param thisParams The number of implicit params, i.e. [IrFunction.thisParamCount]
 */


fun changedParamCountFromTotal ( totalParamsIncludingThisParams : Int ) : Int

{ <EOL> var realParams = totalParamsIncludingThisParams <EOL> realParams -- <EOL> realParams -- <EOL> var changedParams = <NUM_LIT:0> <EOL> do { <EOL> realParams -= SLOTS_PER_INT <EOL> changedParams ++ <EOL> } while ( realParams > <NUM_LIT:0> ) <EOL> return changedParams <EOL> }

/**
 * Calculates the number of 'changed' params needed based on the function's total amount of
 * parameters.
 *
 * @param totalParamsIncludingThisParams The total number of parameter including implicit and
 * synthetic ones.
 */


fun defaultParamCount ( valueParams : Int ) : Int

{ <EOL> return ceil ( valueParams . toDouble ( ) / BITS_PER_INT . toDouble ( ) ) . toInt ( ) <EOL> }

/**
 * Calculates the number of 'defaults' params needed based on the function's parameters.
 *
 * @param valueParams The numbers of params, usually the size of [IrFunction.valueParameters].
 * Which includes context receivers params, but not extension param nor synthetic params.
 */


fun translateJsCodeIntoStatementList ( code : IrExpression , context : JsIrBackendContext ? , container : IrDeclaration )

= <EOL> translateJsCodeIntoStatementList ( code , context , code . getStartSourceLocation ( container ) ? : container . fileOrNull ? . fileEntry ? . let { JsLocation ( it . name , <NUM_LIT:0> , <NUM_LIT:0> ) } )

/**
 * Returns null if constant expression could not be parsed.
 */


fun translateJsCodeIntoStatementList ( code : IrExpression , context : JsIrBackendContext ? , fileEntry : IrFileEntry )

= <EOL> translateJsCodeIntoStatementList ( code , context , code . getStartSourceLocation ( fileEntry ) ? : JsLocation ( fileEntry . name , <NUM_LIT:0> , <NUM_LIT:0> ) )


@ ObsoleteCoroutinesApi <EOL> public fun ticker ( delayMillis : Long , initialDelayMillis : Long = delayMillis , context : CoroutineContext = EmptyCoroutineContext , mode : TickerMode = TickerMode . FIXED_PERIOD ) : ReceiveChannel < Unit >

{ <EOL> require ( delayMillis >= <NUM_LIT:0> ) { "<STR_LIT>" } <EOL> require ( initialDelayMillis >= <NUM_LIT:0> ) { "<STR_LIT>" } <EOL> return GlobalScope . produce ( Dispatchers . Unconfined + context , capacity = <NUM_LIT:0> ) { <EOL> when ( mode ) { <EOL> TickerMode . FIXED_PERIOD -> fixedPeriodTicker ( delayMillis , initialDelayMillis , channel ) <EOL> TickerMode . FIXED_DELAY -> fixedDelayTicker ( delayMillis , initialDelayMillis , channel ) <EOL> } <EOL> } <EOL> }

/**
 * Creates a channel that produces the first item after the given initial delay and subsequent items with the
 * given delay between them.
 *
 * The resulting channel is a _rendezvous channel_. When receiver from this channel does not keep
 * up with receiving the elements from this channel, they are not being sent due to backpressure. The actual
 * timing behavior of ticker in this case is controlled by [mode] parameter which
 * is set to [TickerMode.FIXED_PERIOD] by default. See [TickerMode] for other details.
 *
 * This channel stops producing elements immediately after [ReceiveChannel.cancel] invocation.
 *
 * **Note** producer to this channel is dispatched via [Dispatchers.Unconfined] by default and started eagerly.
 *
 * **Note: Ticker channels are not currently integrated with structured concurrency and their api will change in the future.**
 *
 * @param delayMillis delay between each element in milliseconds.
 * @param initialDelayMillis delay after which the first element will be produced (it is equal to [delayMillis] by default) in milliseconds.
 * @param context context of the producing coroutine.
 * @param mode specifies behavior when elements are not received ([FIXED_PERIOD][TickerMode.FIXED_PERIOD] by default).
 */


@ Suppress ( "<STR_LIT:UNCHECKED_CAST>" ) <EOL> public fun < C > ColumnSet < C > . cols ( predicate : ColumnFilter < C > = { true } , ) : TransformableColumnSet < C >

= colsInternal ( predicate as ColumnFilter < * > ) as TransformableColumnSet < C >

/** @include [ColumnSetColsPredicateDocs] */


public operator fun < C > ColumnSet < C > . get ( predicate : ColumnFilter < C > = { true } , ) : TransformableColumnSet < C >

= cols ( predicate )


public fun ColumnsSelectionDsl < * > . cols ( predicate : ColumnFilter < * > = { true } , ) : TransformableColumnSet < * >

= this . asSingleColumn ( ) . colsInternal ( predicate )

/** @include [ColumnsSelectionDslColsPredicateDocs] */


public operator fun ColumnsSelectionDsl < * > . get ( predicate : ColumnFilter < * > = { true } , ) : TransformableColumnSet < * >

= cols ( predicate )


public fun SingleColumn < DataRow < * > > . cols ( predicate : ColumnFilter < * > = { true } , ) : TransformableColumnSet < * >

= this . ensureIsColumnGroup ( ) . colsInternal ( predicate )

/** @include [SingleColumnAnyRowColsPredicateDocs] */


public operator fun SingleColumn < DataRow < * > > . get ( predicate : ColumnFilter < * > = { true } , ) : TransformableColumnSet < * >

= cols ( predicate )

/**
 * @include [SingleColumnAnyRowColsPredicateDocs]
 */


public fun String . cols ( predicate : ColumnFilter < * > = { true } , ) : TransformableColumnSet < * >

= columnGroup ( this ) . cols ( predicate )

/** @include [StringColsPredicateDocs] */


public operator fun String . get ( predicate : ColumnFilter < * > = { true } , ) : TransformableColumnSet < * >

= cols ( predicate )


public fun KProperty < * > . cols ( predicate : ColumnFilter < * > = { true } , ) : TransformableColumnSet < * >

/** @include [KPropertyColsPredicateDocs] */


public operator fun KProperty < * > . get ( predicate : ColumnFilter < * > = { true } , ) : TransformableColumnSet < * >

= cols ( predicate )


public fun ColumnPath . cols ( predicate : ColumnFilter < * > = { true } , ) : TransformableColumnSet < * >

/** @include [ColumnPathPredicateDocs] */


public operator fun ColumnPath . get ( predicate : ColumnFilter < * > = { true } , ) : TransformableColumnSet < * >

= cols ( predicate )


public fun < C > ColumnsSelectionDsl < * > . cols ( firstCol : ColumnReference < C > , vararg otherCols : ColumnReference < C > , ) : ColumnSet < C >

= asSingleColumn ( ) . cols ( firstCol , * otherCols )

/** @include [ColumnsSelectionDslColsVarargColumnReferenceDocs] */


public operator fun < C > ColumnsSelectionDsl < * > . get ( firstCol : ColumnReference < C > , vararg otherCols : ColumnReference < C > , ) : ColumnSet < C >

= cols ( firstCol , * otherCols )


public fun < C > SingleColumn < DataRow < * > > . cols ( firstCol : ColumnReference < C > , vararg otherCols : ColumnReference < C > , ) : ColumnSet < C >

= colsInternal ( listOf ( firstCol , * otherCols ) ) . cast ( )

/** @include [SingleColumnColsVarargColumnReferenceDocs] */


public operator fun < C > SingleColumn < DataRow < * > > . get ( firstCol : ColumnReference < C > , vararg otherCols : ColumnReference < C > , ) : ColumnSet < C >

= cols ( firstCol , * otherCols )

/**
 * @include [SingleColumnColsVarargColumnReferenceDocs]
 */


public fun < C > String . cols ( firstCol : ColumnReference < C > , vararg otherCols : ColumnReference < C > , ) : ColumnSet < C >

= columnGroup ( this ) . cols ( firstCol , * otherCols )

/** @include [StringColsVarargColumnReferenceDocs] */


public operator fun < C > String . get ( firstCol : ColumnReference < C > , vararg otherCols : ColumnReference < C > , ) : ColumnSet < C >

= cols ( firstCol , * otherCols )


public fun < C > KProperty < * > . cols ( firstCol : ColumnReference < C > , vararg otherCols : ColumnReference < C > , ) : ColumnSet < C >

/** @include [KPropertyColsVarargColumnReferenceDocs] */


public operator fun < C > KProperty < * > . get ( firstCol : ColumnReference < C > , vararg otherCols : ColumnReference < C > , ) : ColumnSet < C >

= cols ( firstCol , * otherCols )


public fun < C > ColumnPath . cols ( firstCol : ColumnReference < C > , vararg otherCols : ColumnReference < C > , ) : ColumnSet < C >

/** @include [ColumnPathColsVarargColumnReferenceDocs] */


public operator fun < C > ColumnPath . get ( firstCol : ColumnReference < C > , vararg otherCols : ColumnReference < C > , ) : ColumnSet < C >

= cols ( firstCol , * otherCols )


@ Suppress ( "<STR_LIT:INAPPLICABLE_JVM_NAME>" ) <EOL> @ JvmName ( "<STR_LIT>" ) <EOL> public fun ColumnsSelectionDsl < * > . cols ( firstCol : String , vararg otherCols : String , ) : ColumnSet < * >

= cols < Any ? > ( firstCol , * otherCols )

/** @include [ColumnsSelectionDslVarargStringDocs] */


public fun < T > ColumnsSelectionDsl < * > . cols ( firstCol : String , vararg otherCols : String , ) : ColumnSet < T >

= this . asSingleColumn ( ) . cols ( firstCol , * otherCols ) . cast ( )


public operator fun ColumnsSelectionDsl < * > . get ( firstCol : String , vararg otherCols : String , ) : ColumnSet < * >


@ Suppress ( "<STR_LIT:INAPPLICABLE_JVM_NAME>" ) <EOL> @ JvmName ( "<STR_LIT>" ) <EOL> public fun SingleColumn < DataRow < * > > . cols ( firstCol : String , vararg otherCols : String , ) : ColumnSet < * >

/** @include [SingleColumnColsVarargStringDocs] */


public fun < T > SingleColumn < DataRow < * > > . cols ( firstCol : String , vararg otherCols : String , ) : ColumnSet < T >

= colsInternal ( listOf ( firstCol , * otherCols ) . map { pathOf ( it ) } ) . cast ( )


public operator fun SingleColumn < DataRow < * > > . get ( firstCol : String , vararg otherCols : String , ) : ColumnSet < * >

/**
 * @include [SingleColumnColsVarargStringDocs]
 */


@ Suppress ( "<STR_LIT:INAPPLICABLE_JVM_NAME>" ) <EOL> @ JvmName ( "<STR_LIT>" ) <EOL> public fun String . cols ( firstCol : String , vararg otherCols : String , ) : ColumnSet < * >

/** @include [StringColsVarargStringDocs] */


public fun < T > String . cols ( firstCol : String , vararg otherCols : String , ) : ColumnSet < T >

= columnGroup ( this ) . cols ( firstCol , * otherCols ) . cast ( )


public operator fun String . get ( firstCol : String , vararg otherCols : String , ) : ColumnSet < * >


@ Suppress ( "<STR_LIT:INAPPLICABLE_JVM_NAME>" ) <EOL> @ JvmName ( "<STR_LIT>" ) <EOL> public fun KProperty < * > . cols ( firstCol : String , vararg otherCols : String , ) : ColumnSet < * >

/** @include [KPropertiesColsVarargStringDocs] */


public fun < T > KProperty < * > . cols ( firstCol : String , vararg otherCols : String , ) : ColumnSet < T >


public operator fun KProperty < * > . get ( firstCol : String , vararg otherCols : String , ) : ColumnSet < * >


@ Suppress ( "<STR_LIT:INAPPLICABLE_JVM_NAME>" ) <EOL> @ JvmName ( "<STR_LIT>" ) <EOL> public fun ColumnPath . cols ( firstCol : String , vararg otherCols : String , ) : ColumnSet < * >

/** @include [ColumnPathColsVarargStringDocs] */


public fun < T > ColumnPath . cols ( firstCol : String , vararg otherCols : String , ) : ColumnSet < T >


public operator fun ColumnPath . get ( firstCol : String , vararg otherCols : String , ) : ColumnSet < * >


@ Suppress ( "<STR_LIT:INAPPLICABLE_JVM_NAME>" ) <EOL> @ JvmName ( "<STR_LIT>" ) <EOL> public fun ColumnsSelectionDsl < * > . cols ( firstCol : ColumnPath , vararg otherCols : ColumnPath , ) : ColumnSet < * >

/** @include [ColumnsSelectionDslVarargColumnPathDocs] */


public fun < T > ColumnsSelectionDsl < * > . cols ( firstCol : ColumnPath , vararg otherCols : ColumnPath , ) : ColumnSet < T >

= asSingleColumn ( ) . cols < T > ( firstCol , * otherCols )


public operator fun ColumnsSelectionDsl < * > . get ( firstCol : ColumnPath , vararg otherCols : ColumnPath , ) : ColumnSet < * >


@ Suppress ( "<STR_LIT:INAPPLICABLE_JVM_NAME>" ) <EOL> @ JvmName ( "<STR_LIT>" ) <EOL> public fun SingleColumn < DataRow < * > > . cols ( firstCol : ColumnPath , vararg otherCols : ColumnPath , ) : ColumnSet < * >

/** @include [SingleColumnColsVarargColumnPathDocs] */


public fun < T > SingleColumn < DataRow < * > > . cols ( firstCol : ColumnPath , vararg otherCols : ColumnPath , ) : ColumnSet < T >


public operator fun SingleColumn < DataRow < * > > . get ( firstCol : ColumnPath , vararg otherCols : ColumnPath , ) : ColumnSet < * >

/**
 * @include [SingleColumnColsVarargColumnPathDocs]
 */


@ Suppress ( "<STR_LIT:INAPPLICABLE_JVM_NAME>" ) <EOL> @ JvmName ( "<STR_LIT>" ) <EOL> public fun String . cols ( firstCol : ColumnPath , vararg otherCols : ColumnPath , ) : ColumnSet < * >

/** @include [StringColsVarargColumnPathDocs] */


public fun < T > String . cols ( firstCol : ColumnPath , vararg otherCols : ColumnPath , ) : ColumnSet < T >


public operator fun String . get ( firstCol : ColumnPath , vararg otherCols : ColumnPath , ) : ColumnSet < * >


@ Suppress ( "<STR_LIT:INAPPLICABLE_JVM_NAME>" ) <EOL> @ JvmName ( "<STR_LIT>" ) <EOL> public fun KProperty < * > . cols ( firstCol : ColumnPath , vararg otherCols : ColumnPath , ) : ColumnSet < * >

/** @include [KPropertiesColsVarargColumnPathDocs] */


public fun < T > KProperty < * > . cols ( firstCol : ColumnPath , vararg otherCols : ColumnPath , ) : ColumnSet < T >


public operator fun KProperty < * > . get ( firstCol : ColumnPath , vararg otherCols : ColumnPath , ) : ColumnSet < * >


@ Suppress ( "<STR_LIT:INAPPLICABLE_JVM_NAME>" ) <EOL> @ JvmName ( "<STR_LIT>" ) <EOL> public fun ColumnPath . cols ( firstCol : ColumnPath , vararg otherCols : ColumnPath , ) : ColumnSet < * >

/** @include [ColumnPathColsVarargColumnPathDocs] */


public fun < T > ColumnPath . cols ( firstCol : ColumnPath , vararg otherCols : ColumnPath , ) : ColumnSet < T >


public operator fun ColumnPath . get ( firstCol : ColumnPath , vararg otherCols : ColumnPath , ) : ColumnSet < * >


public fun < C > ColumnsSelectionDsl < * > . cols ( firstCol : KProperty < C > , vararg otherCols : KProperty < C > , ) : ColumnSet < C >

= this . asSingleColumn ( ) . cols ( firstCol , * otherCols )

/** @include [ColumnsSelectionDslColsVarargKPropertyDocs] */


public operator fun < C > ColumnsSelectionDsl < * > . get ( firstCol : KProperty < C > , vararg otherCols : KProperty < C > , ) : ColumnSet < C >

= cols ( firstCol , * otherCols )


public fun < C > SingleColumn < DataRow < * > > . cols ( firstCol : KProperty < C > , vararg otherCols : KProperty < C > , ) : ColumnSet < C >

= colsInternal ( listOf ( firstCol , * otherCols ) . map { pathOf ( it . name ) } ) . cast ( )

/** @include [SingleColumnColsVarargKPropertyDocs] */


public operator fun < C > SingleColumn < DataRow < * > > . get ( firstCol : KProperty < C > , vararg otherCols : KProperty < C > , ) : ColumnSet < C >

= cols ( firstCol , * otherCols )


public fun < C > String . cols ( firstCol : KProperty < C > , vararg otherCols : KProperty < C > , ) : ColumnSet < C >

/** @include [StringColsVarargKPropertyDocs] */


public operator fun < C > String . get ( firstCol : KProperty < C > , vararg otherCols : KProperty < C > , ) : ColumnSet < C >

= cols ( firstCol , * otherCols )


public fun < C > KProperty < * > . cols ( firstCol : KProperty < C > , vararg otherCols : KProperty < C > , ) : ColumnSet < C >

/** @include [KPropertyColsVarargKPropertyDocs] */


public operator fun < C > KProperty < * > . get ( firstCol : KProperty < C > , vararg otherCols : KProperty < C > , ) : ColumnSet < C >

= cols ( firstCol , * otherCols )


public fun < C > ColumnPath . cols ( firstCol : KProperty < C > , vararg otherCols : KProperty < C > , ) : ColumnSet < C >

/** @include [ColumnPathColsVarargKPropertyDocs] */


public operator fun < C > ColumnPath . get ( firstCol : KProperty < C > , vararg otherCols : KProperty < C > , ) : ColumnSet < C >

= cols ( firstCol , * otherCols )


@ Suppress ( "<STR_LIT:UNCHECKED_CAST>" ) <EOL> public fun < C > ColumnSet < C > . cols ( firstIndex : Int , vararg otherIndices : Int , ) : ColumnSet < C >

= colsInternal ( headPlusArray ( firstIndex , otherIndices ) ) as ColumnSet < C >

/** @include [ColumnSetColsIndicesDocs] */


public operator fun < C > ColumnSet < C > . get ( firstIndex : Int , vararg otherIndices : Int , ) : ColumnSet < C >

= cols ( firstIndex , * otherIndices )


@ Suppress ( "<STR_LIT:INAPPLICABLE_JVM_NAME>" ) <EOL> @ JvmName ( "<STR_LIT>" ) <EOL> public fun ColumnsSelectionDsl < * > . cols ( firstIndex : Int , vararg otherIndices : Int , ) : ColumnSet < * >

= cols < Any ? > ( firstIndex , * otherIndices )

/** @include [ColumnsSelectionDslColsIndicesDocs] */


public fun < T > ColumnsSelectionDsl < * > . cols ( firstIndex : Int , vararg otherIndices : Int , ) : ColumnSet < T >

= this . asSingleColumn ( ) . colsInternal ( headPlusArray ( firstIndex , otherIndices ) ) . cast ( )


@ Suppress ( "<STR_LIT:INAPPLICABLE_JVM_NAME>" ) <EOL> @ JvmName ( "<STR_LIT>" ) <EOL> public fun SingleColumn < DataRow < * > > . cols ( firstIndex : Int , vararg otherIndices : Int , ) : ColumnSet < * >

/** @include [SingleColumnColsIndicesDocs] */


public fun < T > SingleColumn < DataRow < * > > . cols ( firstIndex : Int , vararg otherIndices : Int , ) : ColumnSet < T >

= this . ensureIsColumnGroup ( ) . colsInternal ( headPlusArray ( firstIndex , otherIndices ) ) . cast ( )


@ Suppress ( "<STR_LIT:INAPPLICABLE_JVM_NAME>" ) <EOL> @ JvmName ( "<STR_LIT>" ) <EOL> public fun String . cols ( firstIndex : Int , vararg otherIndices : Int , ) : ColumnSet < * >


public fun < T > String . cols ( firstIndex : Int , vararg otherIndices : Int , ) : ColumnSet < T >

= columnGroup ( this ) . cols ( firstIndex , * otherIndices ) . cast ( )


@ Suppress ( "<STR_LIT:INAPPLICABLE_JVM_NAME>" ) <EOL> @ JvmName ( "<STR_LIT>" ) <EOL> public fun KProperty < * > . cols ( firstIndex : Int , vararg otherIndices : Int , ) : ColumnSet < * >

/** @include [KPropertyColsIndicesDocs] */


public fun < T > KProperty < * > . cols ( firstIndex : Int , vararg otherIndices : Int , ) : ColumnSet < T >


@ Suppress ( "<STR_LIT:INAPPLICABLE_JVM_NAME>" ) <EOL> @ JvmName ( "<STR_LIT>" ) <EOL> public fun ColumnPath . cols ( firstIndex : Int , vararg otherIndices : Int , ) : ColumnSet < * >

/** @include [ColumnPathColsIndicesDocs] */


public fun < T > ColumnPath . cols ( firstIndex : Int , vararg otherIndices : Int , ) : ColumnSet < T >


@ Suppress ( "<STR_LIT:UNCHECKED_CAST>" ) <EOL> public fun < C > ColumnSet < C > . cols ( range : IntRange ) : ColumnSet < C >

= colsInternal ( range ) as ColumnSet < C >

/** @include [ColumnSetColsRangeDocs] */


public operator fun < C > ColumnSet < C > . get ( range : IntRange ) : ColumnSet < C >

= cols ( range )


@ Suppress ( "<STR_LIT:INAPPLICABLE_JVM_NAME>" ) <EOL> @ JvmName ( "<STR_LIT>" ) <EOL> public fun ColumnsSelectionDsl < * > . cols ( range : IntRange ) : ColumnSet < * >

= <EOL> cols < Any ? > ( range )

/** @include [ColumnsSelectionDslColsRangeDocs] */


public fun < T > ColumnsSelectionDsl < * > . cols ( range : IntRange ) : ColumnSet < T >

= <EOL> this . asSingleColumn ( ) . colsInternal ( range ) . cast ( )


@ Suppress ( "<STR_LIT:INAPPLICABLE_JVM_NAME>" ) <EOL> @ JvmName ( "<STR_LIT>" ) <EOL> public fun SingleColumn < DataRow < * > > . cols ( range : IntRange ) : ColumnSet < * >

= <EOL> cols < Any ? > ( range )

/** @include [SingleColumnColsRangeDocs] */


public fun < T > SingleColumn < DataRow < * > > . cols ( range : IntRange ) : ColumnSet < T >

= <EOL> this . ensureIsColumnGroup ( ) . colsInternal ( range ) . cast ( )


@ Suppress ( "<STR_LIT:INAPPLICABLE_JVM_NAME>" ) <EOL> @ JvmName ( "<STR_LIT>" ) <EOL> public fun String . cols ( range : IntRange ) : ColumnSet < * >

= cols < Any ? > ( range )


public fun < T > String . cols ( range : IntRange ) : ColumnSet < T >

= columnGroup ( this ) . cols ( range ) . cast ( )


@ Suppress ( "<STR_LIT:INAPPLICABLE_JVM_NAME>" ) <EOL> @ JvmName ( "<STR_LIT>" ) <EOL> public fun KProperty < * > . cols ( range : IntRange ) : ColumnSet < * >

= cols < Any ? > ( range )

/** @include [KPropertyColsRangeDocs] */


public fun < T > KProperty < * > . cols ( range : IntRange ) : ColumnSet < T >


@ Suppress ( "<STR_LIT:INAPPLICABLE_JVM_NAME>" ) <EOL> @ JvmName ( "<STR_LIT>" ) <EOL> public fun ColumnPath . cols ( range : IntRange ) : ColumnSet < * >

= cols < Any ? > ( range )

/** @include [ColumnPathColsRangeDocs] */


public fun < T > ColumnPath . cols ( range : IntRange ) : ColumnSet < T >


internal fun ColumnsResolver < * > . colsInternal ( predicate : ColumnFilter < * > ) : TransformableColumnSet < * >

= <EOL> allColumnsInternal ( ) . transform { it . filter ( predicate ) }

/**
 * If this [ColumnsResolver] is a [SingleColumn], it
 * returns a new [ColumnSet] containing the columns inside of this [SingleColumn] that
 * match the given [predicate].
 *
 * Else, it returns a new [ColumnSet] containing all columns in this [ColumnsResolver] that
 * match the given [predicate].
 */


public fun parse ( value : String ) : KlibTarget

{ <EOL> require ( value . isNotBlank ( ) ) { "<STR_LIT>" } <EOL> if ( ! value . contains ( '<CHAR_LIT:.>' ) ) { <EOL> return KlibTarget ( value ) <EOL> } <EOL> val parts = value . split ( '<CHAR_LIT:.>' ) <EOL> if ( parts . size != <NUM_LIT:2> || parts . any { it . isBlank ( ) } ) { <EOL> throw IllegalArgumentException ( "<STR_LIT>" ) <EOL> } <EOL> return KlibTarget ( parts [ <NUM_LIT:0> ] , parts [ <NUM_LIT:1> ] ) <EOL> }

/**
 * Parses a [KlibTarget] from a [value] string in a long (`<targetName>.<configurableName>`)
 * or a short (`<targetName>`) format.
 *
 * @throws IllegalArgumentException if [value] does not conform the format.
 */


= super < AbstractMutableSet > . hashCode ( )

/**
 * We provide [equals], so as a matter of style, we should also provide [hashCode].
 * However, the implementation from [AbstractMutableSet] is enough.
 */


fun translateAccessors ( descriptor : VariableDescriptorWithAccessors , declaration : KtProperty ? , result : MutableList < JsPropertyInitializer > , context : TranslationContext )

{ <EOL> if ( descriptor is PropertyDescriptor && ( descriptor . modality == Modality . ABSTRACT || JsDescriptorUtils . isSimpleFinalProperty ( descriptor ) ) ) return <EOL> PropertyTranslator ( descriptor , declaration , context ) . translate ( result ) <EOL> }

/**
 * Translates single property /w accessors.
 */