Eigs.H

Go to the documentation of this file.
00001 // $Revision: 1.6 $  $Author: schwehr $  $Date: 2004/11/03 00:29:23 $
00002 /*
00003     Copyright (C) 2004  Kurt Schwehr
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
00008     (at your option) any later version.
00009 
00010     This program is distributed in the hope that it will be useful,
00011     but WITHOUT ANY WARRANTY; without even the implied warranty of
00012     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013     GNU 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., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00018 
00019 */
00020 #ifndef _EIGS_H_
00021 #define _EIGS_H_
00022 
00023 #include <gsl/gsl_eigen.h> 
00024 
00025 #include <vector>
00026 
00027 
00030 
00033 enum EigsEnum {KMAX=1, KINT=2, KMIN=3};
00034 
00035 
00036 
00037 
00040 size_t GetIndex(const EigsEnum which, const gsl_vector *v);
00041 
00052 
00053 bool GetEig(const EigsEnum which, const gsl_matrix *eigenvecs, const gsl_vector *eigenvals,
00054             float vec[3], float &val);
00055 
00064 bool GetEigs(const gsl_matrix *eigenvec, const gsl_vector *eigenval, float newEigs[9]);
00065 
00066 
00069 
00075 class S_Engine {
00076 public:
00077 
00085   S_Engine();
00086 
00087   ~S_Engine();  
00088 
00093   S_Engine(const std::vector<float> &s);
00094 
00097   bool setS(const std::vector<float> &s);
00098 
00102   bool getXYZ(const EigsEnum which, std::vector<float> &xyz) const;
00103 
00106   bool isValid() const {return(valid);}
00107 
00108   // FIX: could implement these...
00109   //S_Engine(const float s[6]);
00110   //S_Engine(const float s[7]);
00111   //bool getS(std::vector<float> &s);
00112   // Lisa Style ???
00113   //bool getEigs(std::vector<float> &V, vector<float> &T); ///< min, int, max sorted
00114   //bool getEig(const EigsEnum which, std::vector<float> &V, float &T);
00115 
00116   //bool getTau(const EigsEnum which, float &T);
00117   //bool getXYZ(const EigsEnum which, float &x, float &y, float &z);
00118   //bool getPTR(std::vector<float> &ptr);
00119   //bool getPTR(float &phi, float &theta, float &radius);
00120   //bool getLDI(float &length, float &dec, float &inc);
00121 private:
00122   bool init(); 
00123   bool valid; 
00124   std::vector<float> s; 
00125 
00126   gsl_eigen_symmv_workspace *w; 
00127   gsl_matrix *A; 
00128   gsl_vector *eigenval; 
00129   gsl_matrix *eigenvec; 
00130 
00136   float eigs[9];
00137 
00138   //vector<float> xyz; ///< size==9, min, int, max triples
00139   //vector<float> ptr; ///< size==9, min, int, max triples
00140   //vector<float> eigs; ///< same format as s_eigs
00141 };
00142 
00143 #endif // _EIGS_H_

Generated on Thu Mar 2 17:55:25 2006 for density by  doxygen 1.4.6