1 /*
  2  *   Copyright (c) 2011, Michael Lehn
  3  *
  4  *   All rights reserved.
  5  *
  6  *   Redistribution and use in source and binary forms, with or without
  7  *   modification, are permitted provided that the following conditions
  8  *   are met:
  9  *
 10  *   1) Redistributions of source code must retain the above copyright
 11  *      notice, this list of conditions and the following disclaimer.
 12  *   2) Redistributions in binary form must reproduce the above copyright
 13  *      notice, this list of conditions and the following disclaimer in
 14  *      the documentation and/or other materials provided with the
 15  *      distribution.
 16  *   3) Neither the name of the FLENS development group nor the names of
 17  *      its contributors may be used to endorse or promote products derived
 18  *      from this software without specific prior written permission.
 19  *
 20  *   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
 21  *   "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
 22  *   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
 23  *   A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
 24  *   OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
 25  *   SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
 26  *   LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
 27  *   DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
 28  *   THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 29  *   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 30  *   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 31  */
 32 
 33 /* Based on
 34  *
 35       SUBROUTINE DLAQR2( WANTT, WANTZ, N, KTOP, KBOT, NW, H, LDH, ILOZ,
 36      $                   IHIZ, Z, LDZ, NS, ND, SR, SI, V, LDV, NH, T,
 37      $                   LDT, NV, WV, LDWV, WORK, LWORK )
 38  *
 39  *  -- LAPACK auxiliary routine (version 3.2.2)                        --
 40  *     Univ. of Tennessee, Univ. of California Berkeley,
 41  *     Univ. of Colorado Denver and NAG Ltd..
 42  *  -- June 2010                                                       --
 43  *
 44  */
 45 
 46 #ifndef FLENS_LAPACK_EIG_LAQR2_H
 47 #define FLENS_LAPACK_EIG_LAQR2_H 1
 48 
 49 #include <flens/matrixtypes/matrixtypes.h>
 50 #include <flens/vectortypes/vectortypes.h>
 51 
 52 namespace flens { namespace lapack {
 53 
 54 //== laqr2 =====================================================================
 55 template <typename IndexType, typename MT>
 56     IndexType
 57     laqr2_wsq(IndexType                 kTop,
 58               IndexType                 kBot,
 59               IndexType                 nw,
 60               const GeMatrix<MT>        &T);
 61 
 62 template <typename IndexType, typename MH, typename MZ, typename VSR,
 63           typename VSI, typename MV, typename MT, typename MWV, typename VWORK>
 64     void
 65     laqr2(bool                      wantT,
 66           bool                      wantZ,
 67           IndexType                 kTop,
 68           IndexType                 kBot,
 69           IndexType                 nw,
 70           GeMatrix<MH>              &H,
 71           IndexType                 iLoZ,
 72           IndexType                 iHiZ,
 73           GeMatrix<MZ>              &Z,
 74           IndexType                 &ns,
 75           IndexType                 &nd,
 76           DenseVector<VSR>          &sr,
 77           DenseVector<VSI>          &si,
 78           GeMatrix<MV>              &V,
 79           GeMatrix<MT>              &T,
 80           GeMatrix<MWV>             &WV,
 81           DenseVector<VWORK>        &work);
 82 
 83 //-- forwarding ----------------------------------------------------------------
 84 template <typename IndexType, typename MT>
 85     IndexType
 86     laqr2_wsq(IndexType                 kTop,
 87               IndexType                 kBot,
 88               IndexType                 nw,
 89               const MT                  &&T);
 90 
 91 
 92 template <typename IndexType, typename MH, typename MZ, typename VSR,
 93           typename VSI, typename MV, typename MT, typename MWV, typename VWORK>
 94     void
 95     laqr2(bool                      wantT,
 96           bool                      wantZ,
 97           IndexType                 kTop,
 98           IndexType                 kBot,
 99           IndexType                 nw,
100           MH                        &&H,
101           IndexType                 iLoZ,
102           IndexType                 iHiZ,
103           MZ                        &&Z,
104           IndexType                 &ns,
105           IndexType                 &nd,
106           VSR                       &&sr,
107           VSI                       &&si,
108           MV                        &&V,
109           MT                        &&T,
110           MWV                       &&WV,
111           VWORK                     &&work);
112 
113 } } // namespace lapack, flens
114 
115 #endif // FLENS_LAPACK_EIG_LAQR2_H