46 template<
unsigned int Precision>
56 template<
unsigned int Precision>
66 template<
unsigned int Precision>
99 template<
unsigned int Precision>
133 for(
j=m1;
j<=m2-1;
j++)
137 if( ctemp!=1 || stemp!=0 )
140 ap::vmove(work.getvector(n1, n2), a.getrow(jp1, n1, n2), ctemp);
141 ap::vsub(work.getvector(n1, n2), a.getrow(
j, n1, n2), stemp);
143 ap::vadd(a.getrow(
j, n1, n2), a.getrow(jp1, n1, n2), stemp);
144 ap::vmove(a.getrow(jp1, n1, n2), work.getvector(n1, n2));
154 for(
j=m1;
j<=m2-1;
j++)
158 if( ctemp!=1 || stemp!=0 )
161 a(
j+1,n1) = ctemp*temp-stemp*a(
j,n1);
162 a(
j,n1) = stemp*temp+ctemp*a(
j,n1);
175 for(
j=m2-1;
j>=m1;
j--)
179 if( ctemp!=1 || stemp!=0 )
182 ap::vmove(work.getvector(n1, n2), a.getrow(jp1, n1, n2), ctemp);
183 ap::vsub(work.getvector(n1, n2), a.getrow(
j, n1, n2), stemp);
185 ap::vadd(a.getrow(
j, n1, n2), a.getrow(jp1, n1, n2), stemp);
186 ap::vmove(a.getrow(jp1, n1, n2), work.getvector(n1, n2));
196 for(
j=m2-1;
j>=m1;
j--)
200 if( ctemp!=1 || stemp!=0 )
203 a(
j+1,n1) = ctemp*temp-stemp*a(
j,n1);
204 a(
j,n1) = stemp*temp+ctemp*a(
j,n1);
237 template<
unsigned int Precision>
267 for(
j=n1;
j<=n2-1;
j++)
271 if( ctemp!=1 || stemp!=0 )
274 ap::vmove(work.getvector(m1, m2), a.getcolumn(jp1, m1, m2), ctemp);
275 ap::vsub(work.getvector(m1, m2), a.getcolumn(
j, m1, m2), stemp);
277 ap::vadd(a.getcolumn(
j, m1, m2), a.getcolumn(jp1, m1, m2), stemp);
278 ap::vmove(a.getcolumn(jp1, m1, m2), work.getvector(m1, m2));
288 for(
j=n1;
j<=n2-1;
j++)
292 if( ctemp!=1 || stemp!=0 )
295 a(m1,
j+1) = ctemp*temp-stemp*a(m1,
j);
296 a(m1,
j) = stemp*temp+ctemp*a(m1,
j);
309 for(
j=n2-1;
j>=n1;
j--)
313 if( ctemp!=1 || stemp!=0 )
316 ap::vmove(work.getvector(m1, m2), a.getcolumn(jp1, m1, m2), ctemp);
317 ap::vsub(work.getvector(m1, m2), a.getcolumn(
j, m1, m2), stemp);
319 ap::vadd(a.getcolumn(
j, m1, m2), a.getcolumn(jp1, m1, m2), stemp);
320 ap::vmove(a.getcolumn(jp1, m1, m2), work.getvector(m1, m2));
330 for(
j=n2-1;
j>=n1;
j--)
334 if( ctemp!=1 || stemp!=0 )
337 a(m1,
j+1) = ctemp*temp-stemp*a(m1,
j);
338 a(m1,
j) = stemp*temp+ctemp*a(m1,
j);
354 template<
unsigned int Precision>
383 r = amp::sqrt<Precision>(amp::sqr<Precision>(f1)+amp::sqr<Precision>(g1));
386 if( amp::abs<Precision>(
f)>amp::abs<Precision>(
g) && cs<0 )
const CanonicalForm int s
void vmove(raw_vector< T > vdst, const_raw_vector< T > vsrc)
void vadd(raw_vector< T > vdst, const_raw_vector< T > vsrc)
void vmul(raw_vector< T > vdst, T2 alpha)
void vsub(raw_vector< T > vdst, const_raw_vector< T > vsrc)
void applyrotationsfromtheright(bool isforward, int m1, int m2, int n1, int n2, const ap::template_1d_array< amp::ampf< Precision > > &c, const ap::template_1d_array< amp::ampf< Precision > > &s, ap::template_2d_array< amp::ampf< Precision > > &a, ap::template_1d_array< amp::ampf< Precision > > &work)
void generaterotation(amp::ampf< Precision > f, amp::ampf< Precision > g, amp::ampf< Precision > &cs, amp::ampf< Precision > &sn, amp::ampf< Precision > &r)
void applyrotationsfromtheleft(bool isforward, int m1, int m2, int n1, int n2, const ap::template_1d_array< amp::ampf< Precision > > &c, const ap::template_1d_array< amp::ampf< Precision > > &s, ap::template_2d_array< amp::ampf< Precision > > &a, ap::template_1d_array< amp::ampf< Precision > > &work)