Changeset 42 for trunk/src/SVD.h


Ignore:
Timestamp:
Feb 26, 2004, 4:06:20 PM (18 years ago)
Author:
Jari Häkkinen
Message:

Made a major revision of matrix and vector classes. Everything compiles
but the binaries have not been tested.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/SVD.h

    r11 r42  
    11// $Id$
    22
    3 #ifndef _THEP_CPPTOOLS_SVD_
    4 #define _THEP_CPPTOOLS_SVD_
     3#ifndef _theplu_cpptools_svd_
     4#define _theplu_cpptools_svd_
    55
    6 // C++ tools include
    7 /////////////////////
    86#include "matrix.h"
    97#include "vector.h"
    10 #include <gsl/gsl_vector.h>
    118
    12 
    13 // Standard includes
    14 ////////////////////
    15 #include <iostream>
    16 #include <cmath>   
    17 #include <cstdlib> //To include srand() and rand()
    18 #include <ctime>
    19 
    20 
    21 namespace thep_cpp_tools
    22 
     9namespace theplu {
     10namespace cpptools { 
    2311
    2412  /**
     
    3018     V = Orthogonal matrix, size NxN\n
    3119     A = U S V' = (MxN)(NxN)(NxN) = (MxN)\n   
     20
     21     Shouldn't there be a reference to the algortithm here?
     22
    3223     @version 1.0 $Revision$ $Date$
    3324  */
    3425
    3526  class SVD
    36   {   
    37     static const double MAXTOL = 1E-6;
     27  {
     28    static const double MAXTOL = 1E-6;
    3829
    39     enum SVDtypes
    40       {
    41   Unmodified,
    42   Modified,
    43   Jacobi,
    44   Solver
    45       };
     30    enum SVDtypes {
     31      Unmodified,
     32      Modified,
     33      Jacobi,
     34      Solver
     35    };
    4636
    4737  public:
     
    4939       The default constructor should only be used for testing!!!
    5040    */
    51     SVD();
     41    SVD(void);
    5242
    5343   
     
    5747       object.
    5848    */
    59     SVD( const thep_gsl_api::matrix& );
     49    SVD( const gslapi::matrix& );
    6050   
    6151    /**
     
    6757    */
    6858
    69     SVD( const thep_gsl_api::matrix&, const thep_gsl_api::vector& b);
     59    SVD( const gslapi::matrix&, const gslapi::vector& b);
    7060    ~SVD();
    7161
     
    8676       executed.
    8777    */
    88     thep_gsl_api::matrix get_u() const { return A_; }
     78    gslapi::matrix get_u() const { return A_; }
    8979
    9080    /**
     
    9282       executed.
    9383    */
    94     thep_gsl_api::matrix get_v() const { return V_; }
     84    gslapi::matrix get_v() const { return V_; }
    9585
    9686
     
    10292    */
    10393
    104     thep_gsl_api::vector get_x() const { return x_; }
     94    gslapi::vector get_x() const { return x_; }
    10595
    10696    /**
     
    10898       executed.
    10999    */
    110     thep_gsl_api::matrix get_s() const;
     100    gslapi::matrix get_s() const;
    111101
    112102
     
    114104       Function returning diagonal matrix S in vector form.
    115105    */
    116     thep_gsl_api::vector get_s_vec() const { return s_; }
     106    gslapi::vector get_s_vec() const { return s_; }
    117107
    118108
     
    128118  private:
    129119
    130     thep_gsl_api::matrix A_, V_;   
    131     thep_gsl_api::vector s_, b_, x_;
     120    gslapi::matrix A_, V_;   
     121    gslapi::vector s_, b_, x_;
    132122    bool loaded_, solver_;
    133123
     
    137127    bool process_jacobi();
    138128    bool process_solver();
     129
     130    double norm(gslapi::matrix& A) const; // move into class gslapi::matrix?
    139131  }; 
    140 };
     132
     133}} // of namespace cpptools and namespace theplu
    141134
    142135#endif
Note: See TracChangeset for help on using the changeset viewer.