diff --git a/.github/.keepalive b/.github/.keepalive deleted file mode 100644 index f6792dd..0000000 --- a/.github/.keepalive +++ /dev/null @@ -1 +0,0 @@ -2023-11-01T03:31:13.525Z diff --git a/CONTRIBUTORS b/CONTRIBUTORS index 0dae4fe..3bc3576 100644 --- a/CONTRIBUTORS +++ b/CONTRIBUTORS @@ -29,6 +29,7 @@ Ognjen Jevremović Philipp Burckhardt Pranav Goswami Ricky Reusser +Robert Gislason Roman Stetsyk <25715951+romanstetsyk@users.noreply.github.com> Ryan Seal Seyyed Parsa Neshaei @@ -37,4 +38,3 @@ Stephannie Jiménez Gacha Yernar Yergaziyev orimiles5 <97595296+orimiles5@users.noreply.github.com> rei2hu -Robert Gislason diff --git a/README.md b/README.md index 8851547..5613100 100644 --- a/README.md +++ b/README.md @@ -241,11 +241,11 @@ Rounds each element in a single-precision floating-point strided array `X` towar ```c #include -float X[] = { 1.1, 2.5, -3.5, 4.0, -5.9, 6.4, -7.0, 8.2 }; -uint8_t Mask[] = { 0, 0, 1, 0, 1, 1, 0, 0 }; +const float X[] = { 1.1, 2.5, -3.5, 4.0, -5.9, 6.4, -7.0, 8.2 }; +const uint8_t Mask[] = { 0, 0, 1, 0, 1, 1, 0, 0 }; float Y[] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; -int64_t N = 4; +const int64_t N = 4; stdlib_strided_smsktrunc( N, X, 2, Mask, 2, Y, 2 ); ``` @@ -289,21 +289,21 @@ void stdlib_strided_smsktrunc( const int64_t N, const float *X, const int64_t st int main( void ) { // Create an input strided array: - float X[] = { 1.1, 2.5, -3.5, 4.0, -5.9, 6.4, -7.0, 8.2 }; + const float X[] = { 1.1, 2.5, -3.5, 4.0, -5.9, 6.4, -7.0, 8.2 }; // Create a mask strided array: - uint8_t M[] = { 0, 0, 1, 0, 1, 1, 0, 0 }; + const uint8_t M[] = { 0, 0, 1, 0, 1, 1, 0, 0 }; // Create an output strided array: float Y[] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; // Specify the number of elements: - int64_t N = 4; + const int64_t N = 4; // Specify the stride lengths: - int64_t strideX = 2; - int64_t strideM = 2; - int64_t strideY = 2; + const int64_t strideX = 2; + const int64_t strideM = 2; + const int64_t strideY = 2; // Compute the results: stdlib_strided_smsktrunc( N, X, strideX, M, strideM, Y, strideY ); diff --git a/docs/types/index.d.ts b/docs/types/index.d.ts index a3f4cac..2bca817 100644 --- a/docs/types/index.d.ts +++ b/docs/types/index.d.ts @@ -45,7 +45,7 @@ interface Routine { * smsktrunc( x.length, x, 1, m, 1, y, 1 ); * // y => [ 1.0, 2.0, 0.0, 4.0, 0.0 ] */ - ( N: number, x: Float32Array, strideX: number, mask: Uint8Array, strideMask: number, y: Float32Array, strideY: number ): Float32Array; // tslint:disable-line:max-line-length + ( N: number, x: Float32Array, strideX: number, mask: Uint8Array, strideMask: number, y: Float32Array, strideY: number ): Float32Array; /** * Rounds each element in a single-precision floating-point strided array `x` toward zero according to a strided mask array and assigns the results to elements in a single-precision floating-point strided array `y` using alternative indexing semantics. @@ -73,7 +73,7 @@ interface Routine { * smsktrunc.ndarray( x.length, x, 1, 0, m, 1, 0, y, 1, 0 ); * // y => [ 1.0, 2.0, 0.0, 4.0, 0.0 ] */ - ndarray( N: number, x: Float32Array, strideX: number, offsetX: number, mask: Uint8Array, strideMask: number, offsetMask: number, y: Float32Array, strideY: number, offsetY: number ): Float32Array; // tslint:disable-line:max-line-length + ndarray( N: number, x: Float32Array, strideX: number, offsetX: number, mask: Uint8Array, strideMask: number, offsetMask: number, y: Float32Array, strideY: number, offsetY: number ): Float32Array; } /** diff --git a/examples/c/example.c b/examples/c/example.c index 5a09649..067fad4 100644 --- a/examples/c/example.c +++ b/examples/c/example.c @@ -22,21 +22,21 @@ int main( void ) { // Create an input strided array: - float x[] = { 1.1, 2.5, -3.5, 4.0, -5.9, 6.4, -7.0, 8.2 }; + const float x[] = { 1.1, 2.5, -3.5, 4.0, -5.9, 6.4, -7.0, 8.2 }; // Create a mask strided array: - uint8_t m[] = { 0, 0, 1, 0, 1, 1, 0, 0 }; + const uint8_t m[] = { 0, 0, 1, 0, 1, 1, 0, 0 }; // Create an output strided array: float y[] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; // Specify the number of elements: - int64_t N = 4; + const int64_t N = 4; // Specify the stride lengths: - int64_t strideX = 2; - int64_t strideM = 2; - int64_t strideY = 2; + const int64_t strideX = 2; + const int64_t strideM = 2; + const int64_t strideY = 2; // Compute the results: stdlib_strided_smsktrunc( N, x, strideX, m, strideM, y, strideY ); diff --git a/package.json b/package.json index 19b1ca2..66b4568 100644 --- a/package.json +++ b/package.json @@ -52,7 +52,7 @@ "@stdlib/array-float32": "^0.1.1", "@stdlib/array-uint8": "^0.1.1", "@stdlib/assert-is-browser": "^0.1.1", - "@stdlib/bench": "^0.1.0", + "@stdlib/bench": "^0.2.0", "@stdlib/math-base-assert-is-nanf": "^0.1.1", "@stdlib/math-base-special-pow": "^0.1.0", "@stdlib/random-base-uniform": "^0.1.0", diff --git a/src/smsktrunc.c b/src/smsktrunc.c index 444239e..3abe877 100644 --- a/src/smsktrunc.c +++ b/src/smsktrunc.c @@ -36,21 +36,21 @@ * include * * // Create an input strided array: -* float x[] = { 1.1, 2.5, -3.5, 4.0, -5.9, 6.4, -7.0, 8.2 }; +* const float x[] = { 1.1, 2.5, -3.5, 4.0, -5.9, 6.4, -7.0, 8.2 }; * * // Create a mask strided array: -* uint8_t m[] = { 0, 0, 1, 0, 1, 1, 0, 0 }; +* const uint8_t m[] = { 0, 0, 1, 0, 1, 1, 0, 0 }; * * // Create an output strided array: * float y[] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; * * // Specify the number of elements: -* int64_t N = 4; +* const int64_t N = 4; * * // Specify the stride lengths: -* int64_t strideX = 2; -* int64_t strideM = 2; -* int64_t strideY = 2; +* const int64_t strideX = 2; +* const int64_t strideM = 2; +* const int64_t strideY = 2; * * // Compute the results: * stdlib_strided_smsktrunc( N, x, strideX, m, strideM, y, strideY );