libflame  revision_anchor
Functions
FLA_LQ_UT_unb_var2.c File Reference

(r)

Functions

FLA_Error FLA_LQ_UT_unb_var2 (FLA_Obj A, FLA_Obj T)

Function Documentation

References FLA_Apply_H2_UT(), FLA_Cont_with_3x3_to_2x2(), FLA_Copyt_external(), FLA_Gemvc_external(), FLA_Househ2_UT(), FLA_Obj_min_dim(), FLA_ONE, FLA_Part_2x2(), and FLA_Repart_2x2_to_3x3().

Referenced by FLA_LQ_UT_internal().

{
  FLA_Obj ATL,   ATR,      A00,  a01,     A02, 
          ABL,   ABR,      a10t, alpha11, a12t,
                           A20,  a21,     A22;

  FLA_Obj TTL,   TTR,      T00,  t01,   T02, 
          TBL,   TBR,      t10t, tau11, t12t,
                           T20,  t21,   T22;


  FLA_Part_2x2( A,    &ATL, &ATR,
                      &ABL, &ABR,     0, 0, FLA_TL );

  FLA_Part_2x2( T,    &TTL, &TTR,
                      &TBL, &TBR,     0, 0, FLA_TL );

  while ( FLA_Obj_min_dim( ABR ) > 0 ){

    FLA_Repart_2x2_to_3x3( ATL, /**/ ATR,       &A00,  /**/ &a01,     &A02,
                        /* ************* */   /* ************************** */
                                                &a10t, /**/ &alpha11, &a12t,
                           ABL, /**/ ABR,       &A20,  /**/ &a21,     &A22,
                           1, 1, FLA_BR );

    FLA_Repart_2x2_to_3x3( TTL, /**/ TTR,       &T00,  /**/ &t01,   &T02,
                        /* ************* */   /* ************************ */
                                                &t10t, /**/ &tau11, &t12t,
                           TBL, /**/ TBR,       &T20,  /**/ &t21,   &T22,
                           1, 1, FLA_BR );

    /*------------------------------------------------------------*/

    // Compute tau11 and u12t from alpha11 and a12t such that tau11 and u12t
    // determine a Householder transform H such that applying H from the
    // right to the row vector consisting of alpha11 and a12t annihilates
    // the entries in a12t (and updates alpha11).
    FLA_Househ2_UT( FLA_RIGHT, alpha11, a12t,
                    tau11 );

    // ( a21 A22 ) = ( a21 A22 ) H
    //
    // where H is formed from tau11 and u12t.
    FLA_Apply_H2_UT( FLA_RIGHT, tau11, a12t, a21, A22 );

    // t01 = conj(a01) + conj(A02) * u12t^T;
    FLA_Copyt_external( FLA_CONJ_NO_TRANSPOSE, a01, t01 );
    FLA_Gemvc_external( FLA_CONJ_NO_TRANSPOSE, FLA_NO_CONJUGATE, FLA_ONE, A02, a12t, FLA_ONE, t01 );

    /*------------------------------------------------------------*/

    FLA_Cont_with_3x3_to_2x2( &ATL, /**/ &ATR,       A00,  a01,     /**/ A02,
                                                     a10t, alpha11, /**/ a12t,
                            /* ************** */  /* ************************ */
                              &ABL, /**/ &ABR,       A20,  a21,     /**/ A22,
                              FLA_TL );

    FLA_Cont_with_3x3_to_2x2( &TTL, /**/ &TTR,       T00,  t01,   /**/ T02,
                                                     t10t, tau11, /**/ t12t,
                            /* ************** */  /* ********************** */
                              &TBL, /**/ &TBR,       T20,  t21,   /**/ T22,
                              FLA_TL );

  }

  return FLA_SUCCESS;
}