@@ -25,7 +25,7 @@ <h1><a href="index.html">All files</a> base.js</h1>
2525 < div class ='fl pad1y space-right2 '>
2626 < span class ="strong "> 100% </ span >
2727 < span class ="quiet "> Statements</ span >
28- < span class ='fraction '> 287/287 </ span >
28+ < span class ='fraction '> 278/278 </ span >
2929 </ div >
3030
3131
@@ -46,7 +46,7 @@ <h1><a href="index.html">All files</a> base.js</h1>
4646 < div class ='fl pad1y space-right2 '>
4747 < span class ="strong "> 100% </ span >
4848 < span class ="quiet "> Lines</ span >
49- < span class ='fraction '> 287/287 </ span >
49+ < span class ='fraction '> 278/278 </ span >
5050 </ div >
5151
5252
@@ -341,16 +341,7 @@ <h1><a href="index.html">All files</a> base.js</h1>
341341< a name ='L276 '> </ a > < a href ='#L276 '> 276</ a >
342342< a name ='L277 '> </ a > < a href ='#L277 '> 277</ a >
343343< a name ='L278 '> </ a > < a href ='#L278 '> 278</ a >
344- < a name ='L279 '> </ a > < a href ='#L279 '> 279</ a >
345- < a name ='L280 '> </ a > < a href ='#L280 '> 280</ a >
346- < a name ='L281 '> </ a > < a href ='#L281 '> 281</ a >
347- < a name ='L282 '> </ a > < a href ='#L282 '> 282</ a >
348- < a name ='L283 '> </ a > < a href ='#L283 '> 283</ a >
349- < a name ='L284 '> </ a > < a href ='#L284 '> 284</ a >
350- < a name ='L285 '> </ a > < a href ='#L285 '> 285</ a >
351- < a name ='L286 '> </ a > < a href ='#L286 '> 286</ a >
352- < a name ='L287 '> </ a > < a href ='#L287 '> 287</ a >
353- < a name ='L288 '> </ a > < a href ='#L288 '> 288</ a > </ td > < td class ="line-coverage quiet "> < span class ="cline-any cline-yes "> 3x</ span >
344+ < a name ='L279 '> </ a > < a href ='#L279 '> 279</ a > </ td > < td class ="line-coverage quiet "> < span class ="cline-any cline-yes "> 3x</ span >
354345< span class ="cline-any cline-yes "> 3x</ span >
355346< span class ="cline-any cline-yes "> 3x</ span >
356347< span class ="cline-any cline-yes "> 3x</ span >
@@ -440,18 +431,6 @@ <h1><a href="index.html">All files</a> base.js</h1>
440431< span class ="cline-any cline-yes "> 61x</ span >
441432< span class ="cline-any cline-yes "> 61x</ span >
442433< span class ="cline-any cline-yes "> 61x</ span >
443- < span class ="cline-any cline-yes "> 61x</ span >
444- < span class ="cline-any cline-yes "> 61x</ span >
445- < span class ="cline-any cline-yes "> 61x</ span >
446- < span class ="cline-any cline-yes "> 61x</ span >
447- < span class ="cline-any cline-yes "> 61x</ span >
448- < span class ="cline-any cline-yes "> 61x</ span >
449- < span class ="cline-any cline-yes "> 4x</ span >
450- < span class ="cline-any cline-yes "> 61x</ span >
451- < span class ="cline-any cline-yes "> 57x</ span >
452- < span class ="cline-any cline-yes "> 57x</ span >
453- < span class ="cline-any cline-yes "> 61x</ span >
454- < span class ="cline-any cline-yes "> 61x</ span >
455434< span class ="cline-any cline-yes "> 31x</ span >
456435< span class ="cline-any cline-yes "> 31x</ span >
457436< span class ="cline-any cline-yes "> 31x</ span >
@@ -464,7 +443,10 @@ <h1><a href="index.html">All files</a> base.js</h1>
464443< span class ="cline-any cline-yes "> 61x</ span >
465444< span class ="cline-any cline-yes "> 61x</ span >
466445< span class ="cline-any cline-yes "> 61x</ span >
446+ < span class ="cline-any cline-yes "> 4x</ span >
467447< span class ="cline-any cline-yes "> 61x</ span >
448+ < span class ="cline-any cline-yes "> 57x</ span >
449+ < span class ="cline-any cline-yes "> 57x</ span >
468450< span class ="cline-any cline-yes "> 61x</ span >
469451< span class ="cline-any cline-yes "> 61x</ span >
470452< span class ="cline-any cline-yes "> 61x</ span >
@@ -667,7 +649,7 @@ <h1><a href="index.html">All files</a> base.js</h1>
667649// MAIN //
668650
669651/**
670- * Solves one of the systems of equations `A*x = b` or `A^T*x = b` or `A^H*x = b` where `b` and `x` are `N` element complex vectors and `A` is an `N` by `N` unit, or non-unit, upper or lower triangular complex matrix.
652+ * Solves one of the systems of equations `A*x = b` or `A^T*x = b` or `A^H*x = b` where `b` and `x` are `N` element vectors and `A` is an `N` by `N` unit, or non-unit, upper or lower triangular matrix.
671653*
672654* @private
673655* @param {string} uplo - specifies whether `A` is an upper or lower triangular matrix
@@ -721,61 +703,52 @@ <h1><a href="index.html">All files</a> base.js</h1>
721703 var i1;
722704 var ia;
723705
724- // Layout
725- isrm = isRowMajor( [ strideA1, strideA2 ] );
706+ // Note on variable naming convention: sa#, ix#, i# where # corresponds to the loop number, with `0` being the innermost loop...
726707
727- // Diagonal
708+ isrm = isRowMajor( [ strideA1, strideA2 ] );
728709 nonunit = ( diag === 'non-unit' );
729710
730- // Reinterpret arrays to raw numeric views
711+ if ( isrm ) {
712+ // For row-major matrices, the last dimension has the fastest changing index...
713+ sa0 = strideA2 * 2; // stride increment for innermost loop
714+ sa1 = strideA1 * 2; // stride increment for outermost loop
715+ } else { // isColMajor
716+ // For column-major matrices, the first dimension has the fastest changing index...
717+ sa0 = strideA1 * 2; // stride increment for innermost loop
718+ sa1 = strideA2 * 2; // stride increment for outermost loop
719+ }
720+ // Reinterpret arrays to real-valued views
731721 viewA = reinterpret( A, 0 );
732722 viewX = reinterpret( x, 0 );
733-
734- // Set sign to handle conjugation: flip the imaginary part for conjugate-transpose
735723 if ( trans === 'conjugate-transpose' ) {
736724 sign = -1;
737725 } else {
738726 sign = 1;
739727 }
740-
741- if ( isrm ) {
742- // For row-major matrices, the last dimension has the fastest changing index...
743- sa0 = strideA2 * 2; // offset increment for innermost loop
744- sa1 = strideA1 * 2; // offset increment for outermost loop
745- } else { // isColMajor
746- // For column-major matrices, the first dimension has the fastest changing index...
747- sa0 = strideA1 * 2; // offset increment for innermost loop
748- sa1 = strideA2 * 2; // offset increment for outermost loop
749- }
750-
751- // Vector indexing base
752728 oa = offsetA * 2;
753729 ox = offsetX * 2;
754-
755- // Vector strides
756730 sx = strideX * 2;
757-
758731 doa2 = sa1 + sa0;
759732
760733 if (
761734 ( !isrm && uplo === 'upper' && trans === 'no-transpose' ) ||
762735 ( isrm && uplo === 'lower' && trans !== 'no-transpose' )
763736 ) {
764- ix1 = ox + ( ( N - 1 ) * sx );
765- oa2 = oa + ( doa2 * ( N - 1 ) );
737+ ix1 = ox + ((N-1)*sx );
738+ oa2 = oa + (doa2*(N-1) );
766739 for ( i1 = N - 1; i1 >= 0; i1-- ) {
767740 rex = viewX[ ix1 ];
768- imx = viewX[ ix1 + 1 ];
741+ imx = viewX[ ix1+ 1 ];
769742 if ( rex !== 0.0 || imx !== 0.0 ) {
770743 if ( nonunit ) {
771744 ia = oa2;
772745 rea = viewA[ ia ];
773- ima = sign * viewA[ ia + 1 ];
774- magsq = f32( ( rea * rea ) + ( ima * ima ) );
775- retmp = f32( f32( ( rex * rea ) + ( imx * ima ) ) / magsq );
776- imtmp = f32( f32( ( imx * rea ) - ( rex * ima ) ) / magsq );
746+ ima = sign * viewA[ ia+ 1 ];
747+ magsq = f32(f32( rea* rea) + f32( ima* ima) );
748+ retmp = f32(( f32(rex* rea) + f32( imx* ima) ) / magsq );
749+ imtmp = f32(( f32(imx* rea) - f32( rex* ima) ) / magsq );
777750 viewX[ ix1 ] = retmp;
778- viewX[ ix1 + 1 ] = imtmp;
751+ viewX[ ix1+ 1 ] = imtmp;
779752 } else {
780753 retmp = rex;
781754 imtmp = imx;
@@ -784,13 +757,13 @@ <h1><a href="index.html">All files</a> base.js</h1>
784757 ix0 = ix1 - sx;
785758 for ( i0 = i1 - 1; i0 >= 0; i0-- ) {
786759 rea = viewA[ ia ];
787- ima = sign * viewA[ ia + 1 ];
760+ ima = sign * viewA[ ia+ 1 ];
788761 rex = viewX[ ix0 ];
789- imx = viewX[ ix0 + 1 ];
790- remul = f32( ( retmp * rea ) - ( imtmp * ima ) );
791- immul = f32( ( retmp * ima ) + ( imtmp * rea ) );
792- viewX[ ix0 ] = f32( rex - remul );
793- viewX[ ix0 + 1 ] = f32( imx - immul );
762+ imx = viewX[ ix0+ 1 ];
763+ remul = f32(f32( retmp* rea) - f32( imtmp* ima) );
764+ immul = f32(f32( retmp* ima) + f32( imtmp* rea) );
765+ viewX[ ix0 ] = f32(rex - remul);
766+ viewX[ ix0+ 1 ] = f32(imx - immul);
794767 ix0 -= sx;
795768 ia -= sa0;
796769 }
@@ -808,17 +781,17 @@ <h1><a href="index.html">All files</a> base.js</h1>
808781 oa2 = oa;
809782 for ( i1 = 0; i1 < N; i1++ ) {
810783 rex = viewX[ ix1 ];
811- imx = viewX[ ix1 + 1 ];
784+ imx = viewX[ ix1+ 1 ];
812785 if ( rex !== 0.0 || imx !== 0.0 ) {
813786 if ( nonunit ) {
814787 ia = oa2;
815788 rea = viewA[ ia ];
816- ima = sign * viewA[ ia + 1 ];
817- magsq = f32( ( rea * rea ) + ( ima * ima ) );
818- retmp = f32( f32( ( rex * rea ) + ( imx * ima ) ) / magsq );
819- imtmp = f32( f32( ( imx * rea ) - ( rex * ima ) ) / magsq );
789+ ima = sign * viewA[ ia+ 1 ];
790+ magsq = f32(f32( rea* rea) + f32( ima* ima) );
791+ retmp = f32(f32(f32( rex* rea) + f32( imx* ima) ) / magsq );
792+ imtmp = f32(f32(f32( imx* rea) - f32( rex* ima) ) / magsq );
820793 viewX[ ix1 ] = retmp;
821- viewX[ ix1 + 1 ] = imtmp;
794+ viewX[ ix1+ 1 ] = imtmp;
822795 } else {
823796 retmp = rex;
824797 imtmp = imx;
@@ -827,13 +800,13 @@ <h1><a href="index.html">All files</a> base.js</h1>
827800 ix0 = ix1 + sx;
828801 for ( i0 = i1 + 1; i0 < N; i0++ ) {
829802 rea = viewA[ ia ];
830- ima = sign * viewA[ ia + 1 ];
803+ ima = sign * viewA[ ia+ 1 ];
831804 rex = viewX[ ix0 ];
832- imx = viewX[ ix0 + 1 ];
833- remul = f32( ( retmp * rea ) - ( imtmp * ima ) );
834- immul = f32( ( retmp * ima ) + ( imtmp * rea ) );
835- viewX[ ix0 ] = f32( rex - remul );
836- viewX[ ix0 + 1 ] = f32( imx - immul );
805+ imx = viewX[ ix0+ 1 ];
806+ remul = f32(f32( retmp* rea) - f32( imtmp* ima) );
807+ immul = f32(f32( retmp* ima) + f32( imtmp* rea) );
808+ viewX[ ix0 ] = f32(rex - remul);
809+ viewX[ ix0+ 1 ] = f32(imx - immul);
837810 ia += sa0;
838811 ix0 += sx;
839812 }
@@ -851,69 +824,69 @@ <h1><a href="index.html">All files</a> base.js</h1>
851824 oa2 = oa;
852825 for ( i1 = 0; i1 < N; i1++ ) {
853826 rex = viewX[ ix1 ];
854- imx = viewX[ ix1 + 1 ];
827+ imx = viewX[ ix1+ 1 ];
855828 retmp = rex;
856829 imtmp = imx;
857830 ix0 = ox;
858831 ia = oa2;
859832 for ( i0 = 0; i0 < i1; i0++ ) {
860833 rea = viewA[ ia ];
861- ima = sign * viewA[ ia + 1 ];
834+ ima = sign * viewA[ ia+ 1 ];
862835 rex = viewX[ ix0 ];
863- imx = viewX[ ix0 + 1 ];
864- retmp = f32( retmp - f32( ( rex * rea ) - ( imx * ima ) ) );
865- imtmp = f32( imtmp - f32( ( rex * ima ) + ( imx * rea ) ) );
836+ imx = viewX[ ix0+ 1 ];
837+ retmp = f32(retmp - f32(f32( rex* rea) - f32( imx* ima)) );
838+ imtmp = f32(imtmp - f32(f32( rex* ima) + f32( imx* rea)) );
866839 ix0 += sx;
867840 ia += sa0;
868841 }
869842 if ( nonunit ) {
870843 rea = viewA[ ia ];
871- ima = sign * viewA[ ia + 1 ];
872- magsq = f32( ( rea * rea ) + ( ima * ima ) );
873- remul = f32( ( retmp * rea ) + ( imtmp * ima ) );
874- immul = f32( ( imtmp * rea ) - ( retmp * ima ) );
875- retmp = f32( remul / magsq );
876- imtmp = f32( immul / magsq );
844+ ima = sign * viewA[ ia+ 1 ];
845+ magsq = f32(f32( rea* rea) + f32( ima* ima) );
846+ remul = f32(f32( retmp* rea) + f32( imtmp* ima) );
847+ immul = f32(f32( imtmp* rea) - f32( retmp* ima) );
848+ retmp = f32(remul / magsq);
849+ imtmp = f32(immul / magsq);
877850 }
878851 viewX[ ix1 ] = retmp;
879- viewX[ ix1 + 1 ] = imtmp;
852+ viewX[ ix1+ 1 ] = imtmp;
880853 ix1 += sx;
881854 oa2 += sa1;
882855 }
883856 return x;
884857 }
885858 // ( !isrm && uplo === 'lower' && trans !== 'no-transpose' ) || ( isrm && uplo === 'upper' && trans === 'no-transpose' )
886- ix1 = ox + ( ( N - 1 ) * sx );
859+ ix1 = ox + ((N-1)*sx );
887860 ixend = ix1;
888- oa2 = oa + ( doa2 * ( N - 1 ) );
861+ oa2 = oa + (doa2*(N-1) );
889862 for ( i1 = N - 1; i1 >= 0; i1-- ) {
890863 rex = viewX[ ix1 ];
891- imx = viewX[ ix1 + 1 ];
864+ imx = viewX[ ix1+ 1 ];
892865 retmp = rex;
893866 imtmp = imx;
894867 ix0 = ixend;
895868 ia = oa2;
896869 for ( i0 = N - 1; i0 > i1; i0-- ) {
897870 rea = viewA[ ia ];
898- ima = sign * viewA[ ia + 1 ];
871+ ima = sign * viewA[ ia+ 1 ];
899872 rex = viewX[ ix0 ];
900- imx = viewX[ ix0 + 1 ];
901- retmp = f32( retmp - f32( ( rex * rea ) - ( imx * ima ) ) );
902- imtmp = f32( imtmp - f32( ( rex * ima ) + ( imx * rea ) ) );
873+ imx = viewX[ ix0+ 1 ];
874+ retmp = f32(retmp - f32(f32( rex* rea) - f32( imx* ima)) );
875+ imtmp = f32(imtmp - f32(f32( rex* ima) + f32( imx* rea)) );
903876 ia -= sa0;
904877 ix0 -= sx;
905878 }
906879 if ( nonunit ) {
907880 rea = viewA[ ia ];
908- ima = sign * viewA[ ia + 1 ];
909- magsq = f32( ( rea * rea ) + ( ima * ima ) );
910- remul = f32( ( retmp * rea ) + ( imtmp * ima ) );
911- immul = f32( ( imtmp * rea ) - ( retmp * ima ) );
912- retmp = f32( remul / magsq );
913- imtmp = f32( immul / magsq );
881+ ima = sign * viewA[ ia+ 1 ];
882+ magsq = f32(f32( rea* rea) + f32( ima* ima) );
883+ remul = f32(f32( retmp* rea) + f32( imtmp* ima) );
884+ immul = f32(f32( imtmp* rea) - f32( retmp* ima) );
885+ retmp = f32(remul / magsq);
886+ imtmp = f32(immul / magsq);
914887 }
915888 viewX[ ix1 ] = retmp;
916- viewX[ ix1 + 1 ] = imtmp;
889+ viewX[ ix1+ 1 ] = imtmp;
917890 ix1 -= sx;
918891 oa2 -= sa1;
919892 }
@@ -931,7 +904,7 @@ <h1><a href="index.html">All files</a> base.js</h1>
931904 < div class ='footer quiet pad2 space-top1 center small '>
932905 Code coverage generated by
933906 < a href ="https://istanbul.js.org/ " target ="_blank " rel ="noopener noreferrer "> istanbul</ a >
934- at 2026-04-18T18:34:02.767Z
907+ at 2026-04-18T19:02:06.743Z
935908 </ div >
936909 < script src ="prettify.js "> </ script >
937910 < script >
0 commit comments