Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions lib/node_modules/@stdlib/blas/ext/base/dsorthp/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ The function has the following additional parameters:

- **offsetX**: starting index.

While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying buffer, the offset parameter supports indexing semantics based on starting a index. For example, to access only the last three elements:
While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying buffer, the offset parameter supports indexing semantics based on a starting index. For example, to access only the last three elements:

```javascript
var Float64Array = require( '@stdlib/array/float64' );
Expand Down Expand Up @@ -184,7 +184,7 @@ stdlib_strided_dsorthp( 2, -1.0, x, 1 );
The function accepts the following arguments:

- **N**: `[in] CBLAS_INT` number of indexed elements.
- **order**: `[in] double` sort order. If `order < 0.0`, the input strided array `x` is sorted in **decreasing** order. If `order > 0.0`, the input strided array `x` is sorted in **increasing** order. If `order == 0.0`, the input strided arrays are left unchanged.
- **order**: `[in] double` sort order. If `order < 0.0`, the input strided array is sorted in **decreasing** order. If `order > 0.0`, the input strided array is sorted in **increasing** order. If `order == 0.0`, the input strided array is left unchanged.
- **X**: `[inout] double*` input array.
- **strideX**: `[in] CBLAS_INT` stride length.

Expand All @@ -209,8 +209,8 @@ stdlib_strided_dsorthp_ndarray( 4, 1.0, x, 1, 0 );
The function accepts the following arguments:

- **N**: `[in] CBLAS_INT` number of indexed elements.
- **order**: `[in] double` sort order.
- **X**: `[inout] double*` input array. If `order < 0.0`, the input strided array `x` is sorted in **decreasing** order. If `order > 0.0`, the input strided array `x` is sorted in **increasing** order. If `order == 0.0`, the input strided arrays are left unchanged.
- **order**: `[in] double` sort order. If `order < 0.0`, the input strided array is sorted in **decreasing** order. If `order > 0.0`, the input strided array is sorted in **increasing** order. If `order == 0.0`, the input strided array is left unchanged.
- **X**: `[inout] double*` input array.
- **strideX**: `[in] CBLAS_INT` stride length.
- **offsetX**: `[in] CBLAS_INT` starting index.

Expand Down Expand Up @@ -258,7 +258,6 @@ int main( void ) {
printf( "x[ %i ] = %lf\n", i, x[ i ] );
}
}

```

</section>
Expand Down
3 changes: 0 additions & 3 deletions lib/node_modules/@stdlib/blas/ext/base/dsorthp/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@
"@stdlib/napi/argv-double",
"@stdlib/napi/argv-strided-float64array",
"@stdlib/math/base/assert/is-nan",
"@stdlib/math/base/special/floor",
"@stdlib/math/base/assert/is-positive-zero",
"@stdlib/strided/base/stride2offset",
"@stdlib/blas/base/shared"
Expand All @@ -60,7 +59,6 @@
"libpath": [],
"dependencies": [
"@stdlib/math/base/assert/is-nan",
"@stdlib/math/base/special/floor",
"@stdlib/math/base/assert/is-positive-zero",
"@stdlib/strided/base/stride2offset",
"@stdlib/blas/base/shared"
Expand All @@ -78,7 +76,6 @@
"libpath": [],
"dependencies": [
"@stdlib/math/base/assert/is-nan",
"@stdlib/math/base/special/floor",
"@stdlib/math/base/assert/is-positive-zero",
"@stdlib/strided/base/stride2offset",
"@stdlib/blas/base/shared"
Expand Down
7 changes: 3 additions & 4 deletions lib/node_modules/@stdlib/blas/ext/base/dsorthp/src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
#include "stdlib/math/base/assert/is_nan.h"
#include "stdlib/blas/base/shared.h"
#include "stdlib/strided/base/stride2offset.h"
#include "stdlib/math/base/special/floor.h"

/**
* Sorts a double-precision floating-point strided array using heapsort.
Expand Down Expand Up @@ -81,17 +80,17 @@ void API_SUFFIX(stdlib_strided_dsorthp_ndarray)( const CBLAS_INT N, const double
}
// For a positive stride, sorting in decreasing order is equivalent to providing a negative stride and sorting in increasing order, and, for a negative stride, sorting in decreasing order is equivalent to providing a positive stride and sorting in increasing order...
if ( order < 0.0 ) {
sx = strideX * -1;
sx = -strideX;
ox = offsetX - ( (N-1)*sx );
}else{
} else {
sx = strideX;
ox = offsetX;
}
// Set the initial heap size:
n = N;

// Specify an initial "parent" index for building the heap:
parent = stdlib_base_floor( N / 2 );
parent = ( N / 2 );

// Continue looping until the array is sorted...
while ( true ) {
Expand Down