liblapackwrap 0.1

lapackwrap_real_double.h

Go to the documentation of this file.
00001 /*
00002  *Wrapper for a variety of LAPACK routines.
00003 
00004 Copyright (C) 2010 Joseph Pingenot
00005 
00006 This program is free software: you can redistribute it and/or modify
00007 it under the terms of the GNU Lesser General Public License as published by
00008 the Free Software Foundation, either version 3 of the License, or
00009 (at your option) any later version.
00010 
00011 This program is distributed in the hope that it will be useful,
00012 but WITHOUT ANY WARRANTY; without even the implied warranty of
00013 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014 GNU Lesser General Public License for more details.
00015 
00016 You should have received a copy of the GNU Lesser General Public License
00017 along with this program.  If not, see <http://www.gnu.org/licenses/>.
00018 
00019 */
00020 
00021 #ifndef _____LIBLAPACKWRAP_LAPACKWRAP_real_double_H______
00022 #define _____LIBLAPACKWRAP_LAPACKWRAP_real_double_H______
00023 
00024 #ifdef __cplusplus
00025 extern "C" {
00026 #endif
00027 
00028   /**\note Generic LLW data types are placed in this header file.
00029    *defining LLW_real_double_FOO helps translate the generic
00030    *  core lapackwrap and blaswrap patterns to the final version.
00031    *  An alternative method would be translating each genericized
00032    *  core datatype into the specific data type.  However, that would
00033    *  require a more complicated, multi-substitution method (e.g. with
00034    *  a perl script.  This may come later, when I've gotten more experience
00035    *  using this lib.
00036    */
00037 #include <liblapackwrap/lapackwrap_types_real_double.h>
00038 
00039   /**This is to ensure safety.
00040    *If you don't care, you can save some cycles at the expense of
00041    *  "guaranteeing" safety for the data you're passing in read-only
00042    *  by commenting out this define.  This will make all const arrays
00043    *  non-const and therefore not "guaranteed" to not be modified by the
00044    *  routines.  This is effected, in addition to the const keyword, by
00045    *  copying each array into a secondary one via memcopy().  Turning
00046    *  this off saves that copy, which is the largst cost of this safety.
00047    */
00048 #define LLW_CONST const
00049 
00050   /**wrapper around dstegr/dstegr_
00051    *\arg jobz passed straight into LAPACK
00052    *\arg range passed straight into LAPACK
00053    *\arg N passed straight into LAPACK
00054    *\arg D passed straight into LAPACK
00055    *\arg E passed straight into LAPACK
00056    *\arg VL passed straight into LAPACK
00057    *\arg VU passed straight into LAPACK
00058    *\arg IL passed straight into LAPACK
00059    *\arg IU passed straight into LAPACK
00060    *\arg M passed straight into LAPACK
00061    *\arg W passed straight into LAPACK
00062    *\arg Z passed straight into LAPACK
00063    *\arg LDZ passed straight into LAPACK
00064    *\arg ISUPPZ passed straight into LAPACK
00065    *\return INFO, 100*the following error values:
00066    * 1: Failed to allocate space.
00067    */
00068   int llw_real_double_stegr(char jobz, char range, int N, LLW_CONST LLW_real_double_REAL *D, LLW_CONST LLW_real_double_REAL *E, LLW_real_double_REAL VL, LLW_real_double_REAL VU, int IL, int IU, int *M, LLW_real_double_REAL* W, LLW_real_double_COMPLEX* Z, int LDZ, int* ISUPPZ);
00069   /**same as dstegr, but allocation of W, Z, and SUPPZ is done internally
00070    *\arg jobz passed straight into LAPACK
00071    *\arg range passed straight into LAPACK
00072    *\arg N passed straight into LAPACK
00073    *\arg D passed straight into LAPACK
00074    *\arg E passed straight into LAPACK
00075    *\arg VL passed straight into LAPACK
00076    *\arg VU passed straight into LAPACK
00077    *\arg IL passed straight into LAPACK
00078    *\arg IU passed straight into LAPACK
00079    *\arg M passed straight into LAPACK
00080    *\arg W pointer to a pointer to a LLW_real_double_REAL; will be used to store eigvals
00081    *\arg Z pointer to a pointer to a LLW_real_double_REAL; will be used to store eigvecs (column-major)
00082    *\arg LDZ pointer to an int; will be used to store number of eigvecs in Z
00083    *\arg ISUPPZ pointer to pointer to a LLW_real_double_REAL; will be used to store support of matrix.
00084    *\return INFO, 100*the following error values:
00085    * 1: Failed to allocate space.
00086    */
00087   int llw_real_double_stegr_a(char jobz, char range, int N, LLW_CONST LLW_real_double_REAL *D, LLW_CONST LLW_real_double_REAL *E, LLW_real_double_REAL VL, LLW_real_double_REAL VU, int IL, int IU, int *M, LLW_real_double_REAL** W, LLW_real_double_COMPLEX** Z, int *LDZ, int** ISUPPZ);
00088 
00089   /**This is the same as llw_real_double_sbtrd, but with dynamic allocation of D, E, and Q.
00090    */
00091   int llw_real_double_sbtrd_a(char vect, char uplo, int N, int KD, LLW_CONST LLW_real_double_COMPLEX* A, int LDAB, LLW_real_double_REAL** D, LLW_real_double_REAL **E, LLW_real_double_COMPLEX** Q);
00092   /**Gets the tri-diagonal matrix for a banded matrix.
00093    */
00094   int llw_real_double_sbtrd(char vect, char uplo, int N, int KD, LLW_CONST LLW_real_double_COMPLEX* AB, int LDAB, LLW_real_double_REAL* D, LLW_real_double_REAL* E, LLW_real_double_COMPLEX* Q, int LDQ);
00095 
00096   /**Gets the tridiagonal matrix for a symmetric matrix.
00097    *\param uplo 'U' if upper triangle is desired, 'L' if lower triangle
00098    *\param N size of an edge of A (since it's symmetric, is NxN)
00099    *\param A original matrix 
00100    *\param D the diagonal of the final tridiag matrix
00101    *\param E the upper (lower) subdiagonal.
00102    *\param TAU LLW_CONSTs (needed for llw_real_double_orgr to get Q
00103    *\param a_out pointer to a pointer to a LLW_real_double_REAL; used to save the resulting matrix (is A with output stored in it, as described by netlib's documentation on sytrd.
00104    *\return INFO, 100*the following error values:
00105    * 1: Failed to allocate space.
00106    *\note A is LLW_CONST, so it will be preserved.  If you want the tri-diagonal matrix, use a_out.
00107    */
00108   int llw_real_double_sytrd(char uplo, int N, LLW_CONST LLW_real_double_COMPLEX* A, LLW_real_double_REAL* D, LLW_real_double_REAL* E, LLW_real_double_COMPLEX* TAU, LLW_real_double_COMPLEX **a_out);
00109 
00110   /**Turns the output of a tridiagonalization into a matrix which will help convert the eigvals to the old basis
00111    *\return INFO, 100*the following error values:
00112    * 1: Failed to allocate space.
00113    *\note A is NOT LLW_CONST. orgtr will overwrite it.  This is probably what you want, so it's preserved.
00114    */
00115   int llw_real_double_orgtr(char uplo, int N, LLW_real_double_COMPLEX* A, LLW_real_double_COMPLEX* TAU);
00116 
00117 #ifdef __cplusplus
00118 }
00119 #endif
00120 
00121 
00122 #endif
 All Classes Files Functions Variables Defines