Skip to content

Commit 993b4e6

Browse files
committed
feat: add branch 4 logic in base.js
--- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: na - task: lint_package_json status: na - task: lint_repl_help status: na - task: lint_javascript_src status: passed - task: lint_javascript_cli status: na - task: lint_javascript_examples status: na - task: lint_javascript_tests status: na - task: lint_javascript_benchmarks status: na - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: na - task: lint_c_examples status: na - task: lint_c_benchmarks status: na - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: passed - task: lint_typescript_tests status: na - task: lint_license_headers status: passed ---
1 parent b1b38aa commit 993b4e6

File tree

1 file changed

+38
-7
lines changed
  • lib/node_modules/@stdlib/blas/base/ctpmv/lib

1 file changed

+38
-7
lines changed

lib/node_modules/@stdlib/blas/base/ctpmv/lib/base.js

Lines changed: 38 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -46,13 +46,13 @@ var muladd = require( '@stdlib/complex/float32/base/mul-add' ).assign;
4646
* @returns {Complex64Array} `x`
4747
*
4848
* @example
49-
* var Complex64Array = require( '@stdlib/array/float64' );
49+
* var Complex64Array = require( '@stdlib/array/complex64' );
5050
*
51-
* var AP = new Complex64Array( [ ] );
52-
* var x = new Complex64Array( [ ] );
51+
* var AP = new Complex64Array( [ 1.0, 1.0, 2.0, 2.0, 4.0, 4.0, 3.0, 3.0, 5.0, 5.0, 6.0, 6.0 ] );
52+
* var x = new Complex64Array( [ 1.0, 1.0, 2.0, 2.0, 3.0, 3.0 ] );
5353
*
54-
* ctpmv( 'row-major', 'upper', 'no-transpose', 'unit', 3, AP, 1, 0, x, 1, 0 );
55-
* // x => <Complex64Array>[ ]
54+
* ctpmv( 'row-major', 'lower', 'no-transpose', 'non-unit', 3, AP, 1, 0, x, 1, 0 );
55+
* // x => <Complex64Array>[ 0.0, 2.0, 0.0, 20.0, 0.0, 62.0 ]
5656
*/
5757
function ctpmv( order, uplo, trans, diag, N, AP, strideAP, offsetAP, x, strideX, offsetX ) { // eslint-disable-line max-params, max-len
5858
var nonunit;
@@ -62,7 +62,6 @@ function ctpmv( order, uplo, trans, diag, N, AP, strideAP, offsetAP, x, strideX,
6262
var imtmp;
6363
var isrm;
6464
var sign;
65-
var imx;
6665
var rex;
6766
var imx;
6867
var rea;
@@ -209,9 +208,41 @@ function ctpmv( order, uplo, trans, diag, N, AP, strideAP, offsetAP, x, strideX,
209208
}
210209
return x;
211210
}
211+
// ( !isrm && uplo === 'lower' && trans !== 'no-transpose' ) || ( isrm && uplo === 'upper' && trans === 'no-transpose' )
212+
ix1 = ox;
213+
for ( i1 = 0; i1 < N; i1++ ) {
214+
rex = viewX[ ix1 ];
215+
imx = viewX[ ix1 + 1 ];
216+
iap = kk;
217+
ix0 = ix1;
218+
if ( nonunit ) {
219+
rea = viewAP[ iap ];
220+
ima = sign * viewAP[ iap + 1 ];
221+
retmp = f32( ( rea * rex ) - ( ima * imx ) );
222+
imtmp = f32( ( rea * imx ) + ( ima * rex ) );
223+
} else {
224+
retmp = rex;
225+
imtmp = imx;
226+
}
227+
for ( i0 = i1+1; i0 < N; i0++ ) {
228+
ix0 += sx;
229+
iap += sap;
230+
rea = viewAP[ iap ];
231+
ima = sign * viewAP[ iap + 1 ];
232+
rex = viewX[ ix0 ];
233+
imx = viewX[ ix0 + 1 ];
234+
retmp += f32( ( rea * rex ) - ( ima * imx ) );
235+
imtmp += f32( ( rea * imx ) + ( ima * rex ) );
236+
}
237+
viewX[ ix1 ] = retmp;
238+
viewX[ ix1 + 1 ] = imtmp;
239+
ix1 += sx;
240+
kk += ( N - i1 ) * sap;
241+
}
242+
return x;
212243
}
213244

214245

215246
// EXPORTS //
216247

217-
module.exports = ctpmv;
248+
module.exports = ctpmv;

0 commit comments

Comments
 (0)