Skip to content

Commit

Permalink
refactor: use utility to resolve an index offset
Browse files Browse the repository at this point in the history
  • Loading branch information
kgryte committed Jul 1, 2024
1 parent 5418177 commit 43b84f7
Showing 1 changed file with 3 additions and 10 deletions.
13 changes: 3 additions & 10 deletions lib/node_modules/@stdlib/blas/base/dspmv/lib/dspmv.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@

var isLayout = require( '@stdlib/blas/base/assert/is-layout' );
var isMatrixTriangle = require( '@stdlib/blas/base/assert/is-matrix-triangle' );
var stride2offset = require( '@stdlib/strided/base/stride2offset' );
var format = require( '@stdlib/string/format' );
var base = require( './base.js' );

Expand Down Expand Up @@ -77,16 +78,8 @@ function dspmv( order, uplo, N, alpha, AP, x, strideX, beta, y, strideY ) {
if ( strideY === 0 ) {
throw new RangeError( format( 'invalid argument. Tenth argument must be non-zero. Value: `%d`.', strideY ) );
}
if ( strideX > 0 ) {
offsetX = 0;
} else {
offsetX = ( 1 - N ) * strideX;
}
if ( strideY > 0 ) {
offsetY = 0;
} else {
offsetY = ( 1 - N ) * strideY;
}
offsetX = stride2offset( N, strideX );
offsetY = stride2offset( N, strideY );
return base( order, uplo, N, alpha, AP, x, strideX, offsetX, beta, y, strideY, offsetY ); // eslint-disable-line max-len
}

Expand Down

1 comment on commit 43b84f7

@stdlib-bot
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Coverage Report

Package Statements Branches Functions Lines
blas/base/dspmv $\color{green}419/419$
$\color{green}+100.00\%$
$\color{green}47/47$
$\color{green}+100.00\%$
$\color{green}3/3$
$\color{green}+100.00\%$
$\color{green}419/419$
$\color{green}+100.00\%$

The above coverage report was generated for the changes in this push.

Please sign in to comment.