Skip to content

Commit

Permalink
remove old deprecated methods
Browse files Browse the repository at this point in the history
  • Loading branch information
Martmists-GH committed Dec 18, 2024
1 parent 2c182af commit 7041298
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 61 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ repositories {
}

dependencies {
implementation("com.martmists.ndarray-simd:ndarray-simd:1.2.0")
implementation("com.martmists.ndarray-simd:ndarray-simd:1.2.1")
}
```

Expand Down
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ plugins {
}

group = "com.martmists.ndarray-simd"
version = "1.2.0"
version = "1.2.1"
val isProduction = (findProperty("production") ?: System.getProperty("production")) != null

repositories {
Expand Down
63 changes: 4 additions & 59 deletions src/commonMain/kotlin/com/martmists/ndarray/simd/F64Array.kt
Original file line number Diff line number Diff line change
Expand Up @@ -1528,18 +1528,6 @@ interface F64Array {
return F64FlatArray.create(DoubleArray(rows * cols).apply { fill(init) }).reshape(rows, cols)
}

/**
* Creates a new array with the given shape, filled with the given value.
*
* @param shape the shape of the array
* @param init the initialization value
* @return the created array
*/
@JvmStatic
@JvmName("fullArray")
@Deprecated("Use full instead", ReplaceWith("full(*shape, init=init)"))
fun full(shape: IntArray, init: Double): F64Array = full(*shape, init=init)

/**
* Creates a 2D identity matrix of the given size.
*
Expand Down Expand Up @@ -1605,17 +1593,6 @@ interface F64Array {
@JvmStatic
fun zeros(rows: Int, cols: Int): F64TwoAxisArray = full(rows, cols, init=0.0)

/**
* Creates a new array with the given shape, filled with zeros.
*
* @param shape the shape of the array
* @return the created array
*/
@JvmStatic
@JvmName("zerosArray")
@Deprecated("Use zeros instead", ReplaceWith("zeros(*shape)"))
fun zeros(shape: IntArray): F64Array = full(*shape, init=0.0)

/**
* Creates a new array with the given shape, filled with ones.
*
Expand All @@ -1636,17 +1613,6 @@ interface F64Array {
@JvmStatic
fun ones(rows: Int, cols: Int): F64TwoAxisArray = full(rows, cols, init=1.0)

/**
* Creates a new array with the given shape, filled with ones.
*
* @param shape the shape of the array
* @return the created array
*/
@JvmStatic
@JvmName("onesArray")
@Deprecated("Use ones instead", ReplaceWith("ones(*shape)"))
fun ones(shape: IntArray): F64Array = full(*shape, init=1.0)

/**
* Creates a new array from the given list of rows.
*
Expand Down Expand Up @@ -1702,29 +1668,6 @@ interface F64Array {
return result
}

// TODO: Replace Random with @JvmOverloads
/**
* Creates an array of the given shape with random values.
* The values are uniformly distributed between 0 (inclusive) and 1 (exclusive).
*
* @param shape the shape of the array
* @return the created array
* @since 1.0.7
*/
@JvmStatic
fun random(vararg shape: Int): F64Array = random(*shape, random = Random)

/**
* Creates an array of the given shape with random values.
* The values are uniformly distributed between 0 (inclusive) and 1 (exclusive).
*
* @param rows the number of rows
* @param cols the number of columns
* @return the created array
* @since 1.2.0
*/
fun random(rows: Int, cols: Int): F64TwoAxisArray = random(rows, cols, random = Random)

/**
* Creates an array of the given shape with random values.
* The values are uniformly distributed between 0 (inclusive) and 1 (exclusive).
Expand All @@ -1735,7 +1678,8 @@ interface F64Array {
* @since 1.0.7
*/
@JvmStatic
fun random(vararg shape: Int, random: Random): F64Array = F64FlatArray.create(DoubleArray(shape.product()) { random.nextDouble() }).reshape(*shape)
@JvmOverloads
fun random(vararg shape: Int, random: Random = Random): F64Array = F64FlatArray.create(DoubleArray(shape.product()) { random.nextDouble() }).reshape(*shape)

/**
* Creates an array of the given shape with random values.
Expand All @@ -1748,7 +1692,8 @@ interface F64Array {
* @since 1.2.0
*/
@JvmStatic
fun random(rows: Int, cols: Int, random: Random): F64TwoAxisArray = F64FlatArray.create(DoubleArray(rows * cols) { random.nextDouble() }).reshape(rows, cols)
@JvmOverloads
fun random(rows: Int, cols: Int, random: Random = Random): F64TwoAxisArray = F64FlatArray.create(DoubleArray(rows * cols) { random.nextDouble() }).reshape(rows, cols)

/**
* Creates an array with a linear range of values.
Expand Down

0 comments on commit 7041298

Please sign in to comment.