public static void rank1UpdateMultL(ZMatrixRMaj A , double u[] , int offsetU,
                                        double gammaR ,
                                        int colA0,
                                        int w0 , int w1 )
    {
        for( int i = colA0; i < A.numRows; i++ ) {
            int startIndex = (i*A.numCols+w0)*2;
            double realSum = 0,imagSum=0;
            int rowIndex = startIndex;
            int indexU = (offsetU+w0)*2;
            for( int j = w0; j < w1; j++ ) {
                double realA = A.data[rowIndex++];
                double imajA = A.data[rowIndex++];

                double realU = u[indexU++];
                double imajU = u[indexU++];

                realSum += realA*realU - imajA*imajU;
                imagSum += realA*imajU + imajA*realU;
            }
            double realTmp = -gammaR*realSum;
            double imagTmp = -gammaR*imagSum;

            rowIndex = startIndex;
            indexU = (offsetU+w0)*2;
            for( int j = w0; j < w1; j++ ) {
                double realU = u[indexU++];
                double imagU = -u[indexU++];

                A.data[rowIndex++] += realTmp*realU - imagTmp*imagU;
                A.data[rowIndex++] += realTmp*imagU + imagTmp*realU;
            }
        }
    }
public static void rank1UpdateMultL ( ZMatrixRMaj A , double u [ ] , int offsetU , double gammaR , int colA0 , int w0 , int w1 ) { for ( int i = colA0 ; i < A . numRows ; i ++ ) { int startIndex = ( i * A . numCols + w0 ) * 2 ; double realSum = 0 , imagSum = 0 ; int rowIndex = startIndex ; int indexU = ( offsetU + w0 ) * 2 ; for ( int j = w0 ; j < w1 ; j ++ ) { double realA = A . data [ rowIndex ++ ] ; double imajA = A . data [ rowIndex ++ ] ; double realU = u [ indexU ++ ] ; double imajU = u [ indexU ++ ] ; realSum += realA * realU - imajA * imajU ; imagSum += realA * imajU + imajA * realU ; } double realTmp = - gammaR * realSum ; double imagTmp = - gammaR * imagSum ; rowIndex = startIndex ; indexU = ( offsetU + w0 ) * 2 ; for ( int j = w0 ; j < w1 ; j ++ ) { double realU = u [ indexU ++ ] ; double imagU = - u [ indexU ++ ] ; A . data [ rowIndex ++ ] += realTmp * realU - imagTmp * imagU ; A . data [ rowIndex ++ ] += realTmp * imagU + imagTmp * realU ; } } }
<p>
Performs a rank-1 update operation on the submatrix specified by w with the multiply on the left.<br>
<br>
A = A(I - &gamma;*u*u<sup>H</sup>)<br>
</p>
<p>
The order that matrix multiplies are performed has been carefully selected
to minimize the number of operations.
</p>

<p>
Before this can become a truly generic operation the submatrix specification needs
to be made more generic.
</p>