Ignore:
Timestamp:
Apr 9, 2013, 9:45:13 AM (13 years ago)
Author:
Julian Iseringhausen <isering@…>
Children:
0bd47e
Parents:
4a709e
Message:

Work.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/solver/givens.hpp

    r4a709e re85cfd  
    4242public:
    4343  Givens(bool register_ = true) :
    44     T(register_)
    45   {}
     44  T(register_)
     45{}
    4646
    4747  Givens(int size, bool register_ = true) :
    48     T(size, register_)
     48  T(size, register_)
    4949  {}
    5050
     
    6363      if (fabs(this->Mat(j,i)) > DBL_EPSILON) {
    6464
    65         t = 1.0 / sqrt(this->Mat(i,i)*this->Mat(i,i) + this->Mat(j,i)*this->Mat(j,i));
    66         s = t * this->Mat(j,i);
    67         c = t * this->Mat(i,i);
     65        t = 1.0 / sqrt(this->Mat(i,i)*this->Mat(i,i) + this->Mat(j,i)*this->Mat(j,i));
     66        s = t * this->Mat(j,i);
     67        c = t * this->Mat(i,i);
    6868
    69         for (int k=i; k<n; k++) {
     69        for (int k=i; k<n; k++) {
    7070
    71           t = c * this->Mat(i,k) + s * this->Mat(j,k);
     71          t = c * this->Mat(i,k) + s * this->Mat(j,k);
    7272
    73           if (k != i)
    74             this->Mat(j,k) = c * this->Mat(j,k) - s * this->Mat(i,k);
     73          if (k != i)
     74            this->Mat(j,k) = c * this->Mat(j,k) - s * this->Mat(i,k);
    7575
    76           this->Mat(i,k) = t;
     76          this->Mat(i,k) = t;
    7777
    78         }
     78        }
    7979
    80         t = c * this->Rhs(i) + s * this->Rhs(j);
     80        t = c * this->Rhs(i) + s * this->Rhs(j);
    8181
    82         this->Rhs(j) = c * this->Rhs(j) - s * this->Rhs(i);
     82        this->Rhs(j) = c * this->Rhs(j) - s * this->Rhs(i);
    8383
    84         this->Rhs(i) = t;
     84        this->Rhs(i) = t;
    8585
    86         this->Mat(j,i) = 0.0;
     86        this->Mat(j,i) = 0.0;
    8787
    8888      }
Note: See TracChangeset for help on using the changeset viewer.