-
-
Notifications
You must be signed in to change notification settings - Fork 610
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor update blas/ext/base/dsumkbn2
to follow current project conventions
#1995
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -47,7 +47,7 @@ var abs = require( '@stdlib/math/base/special/abs' ); | |
* var floor = require( '@stdlib/math/base/special/floor' ); | ||
* | ||
* var x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); | ||
* var N = floor( x.length / 2 ); | ||
* var N = 4; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same comment. |
||
* | ||
* var v = dsumkbn2( N, x, 2, 1 ); | ||
* // returns 5.0 | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,7 +20,8 @@ | |
|
||
// MODULES // | ||
|
||
var Float64Array = require( '@stdlib/array/float64' ); | ||
var minViewBufferIndex = require( '@stdlib/strided/base/min-view-buffer-index' ); | ||
var offsetView = require( '@stdlib/strided/base/offset-view' ); | ||
var addon = require( './dsumkbn2.native.js' ); | ||
|
||
|
||
|
@@ -40,17 +41,16 @@ var addon = require( './dsumkbn2.native.js' ); | |
* var floor = require( '@stdlib/math/base/special/floor' ); | ||
* | ||
* var x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); | ||
* var N = floor( x.length / 2 ); | ||
* var N = 4; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same comment. |
||
* | ||
* var v = dsumkbn2( N, x, 2, 1 ); | ||
* // returns 5.0 | ||
*/ | ||
function dsumkbn2( N, x, stride, offset ) { | ||
var view; | ||
if ( stride < 0 ) { | ||
offset += (N-1) * stride; | ||
} | ||
view = new Float64Array( x.buffer, x.byteOffset+(x.BYTES_PER_ELEMENT*offset), x.length-offset ); // eslint-disable-line max-len | ||
offset = minViewBufferIndex( N, stride, offset ); | ||
view = offsetView( x, offset ); | ||
|
||
return addon( N, view, stride ); | ||
} | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,40 +1,45 @@ | ||
{ | ||
"options": {}, | ||
"fields": [ | ||
{ | ||
"field": "src", | ||
"resolve": true, | ||
"relative": true | ||
}, | ||
{ | ||
"field": "include", | ||
"resolve": true, | ||
"relative": true | ||
}, | ||
{ | ||
"field": "libraries", | ||
"resolve": false, | ||
"relative": false | ||
}, | ||
{ | ||
"field": "libpath", | ||
"resolve": true, | ||
"relative": false | ||
} | ||
], | ||
"confs": [ | ||
{ | ||
"src": [ | ||
"./src/dsumkbn2.c" | ||
], | ||
"include": [ | ||
"./include" | ||
], | ||
"libraries": [ | ||
"-lm" | ||
], | ||
"libpath": [], | ||
"dependencies": [] | ||
} | ||
] | ||
} | ||
"options": {}, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @Planeshifter This file is missing build configurations. |
||
"fields": [ | ||
{ | ||
"field": "src", | ||
"resolve": true, | ||
"relative": true | ||
}, | ||
{ | ||
"field": "include", | ||
"resolve": true, | ||
"relative": true | ||
}, | ||
{ | ||
"field": "libraries", | ||
"resolve": false, | ||
"relative": false | ||
}, | ||
{ | ||
"field": "libpath", | ||
"resolve": true, | ||
"relative": false | ||
} | ||
], | ||
"confs": [ | ||
{ | ||
"src": [ | ||
"./src/dsumkbn2.c" | ||
], | ||
"include": [ | ||
"./include" | ||
], | ||
"libraries": [ | ||
"-lm" | ||
], | ||
"libpath": [], | ||
"dependencies": [ | ||
"@stdlib/napi/export", | ||
"@stdlib/napi/argv", | ||
"@stdlib/napi/argv-int64", | ||
"@stdlib/napi/argv-strided-float64array" | ||
] | ||
} | ||
] | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Planeshifter
floor
should be have been removed. Would be good to ensure that ESLint can run on these examples.