7#ifndef givensRotations_hh
8#define givensRotations_hh
36 const Qmatrix& q,
bool transpose)
38 , q_(q), transpose_(transpose) {}
54 virtual std::ostream&
info(std::ostream& os)
const;
58 const bool transpose_;
68 if (transpose_) j = q_.qbegin;
74 fncX(j->row1) = j->c*fncX(j->row1) + j->s*fncX(j->row2);
75 fncX(j->row2) = j->c*fncX(j->row2) - j->s*t;
77 fncX(j->row1) = j->c*fncX(j->row1) - j->s*fncX(j->row2);
78 fncX(j->row2) = j->c*fncX(j->row2) + j->s*t;
80 if (transpose_) j = j->next;
105 for (uint i = 0; i < dest.
dimX(); ++i) {
106 const J* j = q_.qbegin;
107 if (transpose_) j = q_.qend;
111 F t = dest(i, j->row1);
113 dest(i, j->row1) = j->c*dest(i, j->row1) - j->s*dest(i, j->row2);
114 dest(i, j->row2) = j->c*dest(i, j->row2) + j->s*t;
116 dest(i, j->row1) = j->c*dest(i, j->row1) + j->s*dest(i, j->row2);
117 dest(i, j->row2) = j->c*dest(i, j->row2) - j->s*t;
119 if (transpose_) j = j->previous;
133 for (uint i = 0; i < dest.
dimY(); ++i) {
134 const J* j = q_.qend;
135 if (transpose_) j = q_.qbegin;
139 F t = dest(j->row1, i);
141 dest(j->row1, i) = j->c*dest(j->row1, i) + j->s*dest(j->row2, i);
142 dest(j->row2, i) = j->c*dest(j->row2, i) - j->s*t;
144 dest(j->row1, i) = j->c*dest(j->row1, i) - j->s*dest(j->row2, i);
145 dest(j->row2, i) = j->c*dest(j->row2, i) + j->s*t;
147 if (transpose_) j = j->next;
148 else j = j->previous;
155 return os <<
concepts::typeOf(*
this)<<
"(" << this->dimX() <<
", " << q_ <<
')';
virtual const uint dimY() const
virtual const uint dimX() const
virtual uint dim() const =0
Returns the dimension of the space.
void multiply(const concepts::Matrix< F > &fact, concepts::Matrix< F > &dest) const
virtual void operator()(const concepts::Function< F > &fncY, concepts::Function< F > &fncX)
void multiplyFirst(const concepts::Matrix< F > &fact, concepts::Matrix< F > &dest) const
virtual std::ostream & info(std::ostream &os) const
Returns information in an output stream.
#define conceptsAssert(cond, exc)
std::string typeOf(const T &t)
Set< F > makeSet(uint n, const F &first,...)