Diana  0.8.3
Arpack.hpp
00001 /* -----------------------------------------------------------------------------
00002  *  Diana process modelling, simulation and analysis software
00003  *  Copyright (c) 2005, Michael Krasnyk
00004  *  All rights reserved.
00005 
00006  *  This file is a part of Diana process modelling, simulation and analysis software
00007  *
00008  *  Diana is free software; you can redistribute it and/or modify it
00009  *  under the terms of the GNU General Public License as published
00010  *  by the Free Software Foundation (see accompanying file LICENSE)
00011  * -----------------------------------------------------------------------------
00012  *  $Id: Arpack.hpp 9369 2011-05-04 09:33:10Z miha $
00013  * -----------------------------------------------------------------------------
00014  *  Description:
00015  */
00016 
00017 #ifndef ARPACK__HPP
00018 #define ARPACK__HPP
00019 
00020 #include "Fortran.hpp"
00021 
00022 enum ArpackIparam{
00023   // IPARAM(1) = ISHIFT: method for selecting the implicit shifts.
00024   ArpackIparam_IShift  = 0,
00025   // IPARAM(2) = No longer referenced.
00026   // IPARAM(3) = MXITER
00027   // On INPUT:  maximum number of Arnoldi update iterations allowed.
00028   // On OUTPUT: actual number of Arnoldi update iterations taken. 
00029   ArpackIparam_MaxIter = 2,
00030   // IPARAM(4) = NB: blocksize to be used in the recurrence.
00031   // The code currently works only for NB = 1.
00032   ArpackIparam_NB = 3,
00033   // IPARAM(5) = NCONV: number of "converged" Ritz values.
00034   // This represents the number of Ritz values that satisfy the convergence criterion.
00035   ArpackIparam_NConv = 4,
00036   // IPARAM(6) = IUPD
00037   // No longer referenced. Implicit restarting is ALWAYS used.  
00038   // IPARAM(7) = MODE
00039   // On INPUT determines what type of eigenproblem is being solved.
00040   // Must be 1,2,3,4
00041   ArpackIparam_Mode = 6,
00042   // IPARAM(8) = NP
00043   ArpackIparam_NP = 7,
00044   // IPARAM(9) = NUMOP
00045   // OUTPUT: NUMOP  = total number of OP*x operations,
00046   ArpackIparam_NumOP = 8,
00047   // IPARAM(10) = NUMOPB
00048   // NUMOPB = total number of B*x operations if BMAT='G',
00049   ArpackIparam_NumOPB = 9,
00050   // IPARAM(11) = NUMREO
00051   // NUMREO = total number of steps of re-orthogonalization.
00052   ArpackIparam_NumREO = 10,
00053   ArpackIparam_Size,
00054 };
00055 
00056 enum ArpackMode{
00057   ArpackMode_Regular         = 1,
00058   ArpackMode_RegularInverse  = 2,
00059   ArpackMode_ShiftInvert     = 3,
00060   ArpackMode_Buckling        = 4,
00061   ArpackMode_Cayley          = 5,
00062 };
00063 
00064 // IPNTR   Integer array of length 14.  (OUTPUT)
00065 const int ArpackIpntr_Size=14;
00066 
00067 struct arpack_debug_t {
00068   fortrani logfil, ndigit, mgetv0, msaupd, msaup2, msaitr, mseigt, msapps, 
00069     msgets, mseupd, mnaupd, mnaup2, mnaitr, mneigh, mnapps, mngets, 
00070     mneupd, mcaupd, mcaup2, mcaitr, mceigh, mcapps, mcgets, mceupd;
00071 }debug_;
00072 
00073 // TODO: configuration of names (non-gcc mangling)
00074 #define DNAUPD (dnaupd_)
00075 #define DNEUPD (dneupd_)
00076 #define DSAUPD (dsaupd_)
00077 #define DSEUPD (dseupd_)
00078 
00079 extern "C" {
00080   void DNAUPD(fortrani& ido, const fortrans bmat, const fortrani& n, const fortrans which, const fortrani& nev,
00081               const fortrand& tol, fortrand* resid, const fortrani& ncv, fortrand* v, const fortrani& ldv,
00082               fortrani* iparam, fortrani* ipntr, fortrand* workd, fortrand* workl, const fortrani& lworkl,
00083               fortrani& info);
00084   void DNEUPD(const fortranl& rvec, const fortrans howmny, const fortranl* select, fortrand* dr, fortrand* di,
00085               fortrand* z, const fortrani& ldz, const fortrand& sigmar, const fortrand& sigmai,
00086               fortrand* workev, const fortrans bmat, const fortrani& n, const fortrans which, const fortrani& nev,
00087               const fortrand& tol, fortrand* resid, const fortrani& ncv, fortrand* v, const fortrani& ldv,
00088               fortrani* iparam, fortrani* ipntr, fortrand* workd, fortrand* workl, const fortrani& lworkl,
00089               fortrani& info);
00090   void DSAUPD(fortrani& ido, const fortrans bmat, const fortrani& n, const fortrans which, const fortrani& nev,
00091               const fortrand& tol, fortrand* resid, const fortrani& ncv, fortrand* v, const fortrani& ldv,
00092               fortrani* iparam, fortrani* ipntr, fortrand* workd, fortrand* workl, const fortrani& lworkl,
00093               fortrani& info);
00094   void DSEUPD(const fortranl& rvec, const fortrans howmny, const fortranl* select, fortrand* dr, 
00095               fortrand* z, const fortrani& ldz, const fortrand& sigmar, 
00096               const fortrans bmat, const fortrani& n, const fortrans which, const fortrani& nev,
00097               const fortrand& tol, fortrand* resid, const fortrani& ncv, fortrand* v, const fortrani& ldv,
00098               fortrani* iparam, fortrani* ipntr, fortrand* workd, fortrand* workl, const fortrani& lworkl,
00099               fortrani& info);
00100 };
00101 
00102 #endif // ARPACK__HPP