Changeset e85cfd for src/solver/givens.hpp
- Timestamp:
- Apr 9, 2013, 9:45:13 AM (13 years ago)
- Children:
- 0bd47e
- Parents:
- 4a709e
- File:
-
- 1 edited
-
src/solver/givens.hpp (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/solver/givens.hpp
r4a709e re85cfd 42 42 public: 43 43 Givens(bool register_ = true) : 44 T(register_)45 {}44 T(register_) 45 {} 46 46 47 47 Givens(int size, bool register_ = true) : 48 T(size, register_)48 T(size, register_) 49 49 {} 50 50 … … 63 63 if (fabs(this->Mat(j,i)) > DBL_EPSILON) { 64 64 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); 68 68 69 for (int k=i; k<n; k++) {69 for (int k=i; k<n; k++) { 70 70 71 t = c * this->Mat(i,k) + s * this->Mat(j,k);71 t = c * this->Mat(i,k) + s * this->Mat(j,k); 72 72 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); 75 75 76 this->Mat(i,k) = t;76 this->Mat(i,k) = t; 77 77 78 }78 } 79 79 80 t = c * this->Rhs(i) + s * this->Rhs(j);80 t = c * this->Rhs(i) + s * this->Rhs(j); 81 81 82 this->Rhs(j) = c * this->Rhs(j) - s * this->Rhs(i);82 this->Rhs(j) = c * this->Rhs(j) - s * this->Rhs(i); 83 83 84 this->Rhs(i) = t;84 this->Rhs(i) = t; 85 85 86 this->Mat(j,i) = 0.0;86 this->Mat(j,i) = 0.0; 87 87 88 88 }
Note:
See TracChangeset
for help on using the changeset viewer.
