Version 4.0.0
Main Page | Class Hierarchy | Class List | File List | Class Members | Related Pages

arnoldi.h

00001 /* seqpp/arnoldi.h
00002  *
00003  * Copyright (C) 2003 Laboratoire Statistique & Génome
00004  *
00005  * This program is free software; you can redistribute it and/or modify
00006  * it under the terms of the GNU General Public License as published by
00007  * the Free Software Foundation; either version 2 of the License, or (at
00008  * your option) any later version.
00009  *
00010  * This program is distributed in the hope that it will be useful, but
00011  * WITHOUT ANY WARRANTY; without even the implied warranty of
00012  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00013  * General Public License for more details.
00014  *
00015  * You should have received a copy of the GNU General Public License
00016  * along with this program; if not, write to the Free Software
00017  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00018  */
00019 
00028 #ifndef SEQPP_ARNOLDI_H
00029 #define SEQPP_ARNOLDI_H
00030 #include <cmath>
00031 #include <cstdlib>
00032 using namespace std;
00033 #include <iostream>
00034 
00035 #include <seqpp/arnoldi_const.h>
00036 
00037 
00038 // return the 1st vp of matrix A
00039 // and put the stationnary law in v
00040 double arnoldi( short size, 
00041                 double **A, double * v,
00042                 short order,
00043                 bool random = false );
00044 
00045 // return the 1st vp of matrix-line A
00046 // and put the stationnary law in v
00047 double arnoldi( short size, 
00048                 double *A, double * v,
00049                 short order,
00050                 bool random = false );
00051 
00052 // return the 2nd vp of matrix-line A
00053 // and put the associated vector in v
00054 double arnoldi_vp2( short size, 
00055                     double **A, double * v,
00056                     short order,
00057                     bool random = false );
00058 
00059 // return the 2nd vp of matrix-line A
00060 // and put the associated vector in v
00061 double arnoldi_vp2( short size, 
00062                     double *A, double * v,
00063                     short order,
00064                     bool random = false );
00065 
00066 
00067 double max_eigen(long m,double **H, double *vect_vp);
00068 
00069 double max_eigen_vp2(long m,double **H, double *vect_vp);
00070 
00071 
00072 /* fonction calculant les valeurs propres et vecteurs propres d'une */
00073 /* matrice hessienne H stockés (respectivement) dans values et vectors */
00074 /* cette fonction utilise la fonction fortran hqr2 */
00075 /* values doit être de taille (n,2) et vectors de taille (n,n) */
00076 /* n étant l'ordre de la matrice H */
00077 /* ces structure doivent avoir été crées au préalable */
00078 /* la fonction retourne ierr la valeurs de retour de hqr2 */
00079 /* attention on doit passer la matrice H transposée !! */
00080 long hqr2(long n,double **H,double **values,double **vectors);
00081 
00082 
00083 extern "C" {
00084 long hqr2_(long *nm,long *n,long *low,long *igh,double *h,double *re,double *im,double *z,long *ierr);
00085 }
00086 
00087 /* fonction calculant le produit scalaire de deux vecteurs de type double* */
00088 /* et retournant sa valeur, la longueur n des vecteurs doit être précisée */
00089 double scal_prod(long n,double *v1,double *v2);
00090 
00091 /* fonction normalisant un vecteur de taille n de type double* */
00092 /* a norme est euclidienne */
00093 void normalize(long n,double *v);
00094 /* fonction normalisant un vecteur de taille n de type double* */
00095 void  normalize_2_unit(long n,double *v);
00096 
00097 #endif



Download seq++ 4.0.0
Download previous versions
Statistique & Genome Home


Generated on Wed Mar 23 09:25:57 2005 for seqpp by doxygen 1.3.9.1