Skip to content

Commit 763c18f

Browse files
ShabiShett07kgryte
andauthored
refactor: reduce number of operations
Co-authored-by: Athan <[email protected]> Signed-off-by: Shabareesh Shetty <[email protected]>
1 parent b777f9e commit 763c18f

File tree

1 file changed

+5
-6
lines changed
  • lib/node_modules/@stdlib/blas/base/dtrmm/lib

1 file changed

+5
-6
lines changed

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

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -166,17 +166,16 @@ function dtrmm( side, uplo, transa, diag, M, N, alpha, A, strideA1, strideA2, of
166166
( !isrma && side === 'right' && uplo === 'lower' && transa === 'no-transpose' )
167167
) {
168168
for ( j = 0; j < N; j++ ) {
169+
ib = offsetB + ( j*sb0 );
169170
for ( k = 0; k < M; k++ ) {
170-
ob2 = offsetB + ( k * sb1 ) + ( j * sb0 );
171+
ob2 = ib + ( k * sb1 );
171172
tmp = alpha * B[ ob2 ];
173+
ia = offsetA + ( k*sa0 );
172174
for ( i = 0; i < k; i++ ) {
173-
oa2 = offsetA + ( i * sa1 ) + ( k * sa0 );
174-
ob = offsetB + ( i * sb1 ) + ( j * sb0 );
175-
B[ ob ] += ( tmp * A[ oa2 ] );
175+
B[ ib+(i*sb1) ] += ( tmp * A[ ia+(i*sa1) ] );
176176
}
177177
if ( nonunit ) {
178-
oa2 = offsetA + ( k * sa1 ) + ( k * sa0 );
179-
tmp *= A[ oa2 ];
178+
tmp *= A[ ia+(k*sa1) ];
180179
}
181180
B[ ob2 ] = tmp;
182181
}

0 commit comments

Comments
 (0)