40 template<
unsigned int Precision>
44 template<
unsigned int Precision>
48 template<
unsigned int Precision>
53 template<
unsigned int Precision>
58 template<
unsigned int Precision>
65 template<
unsigned int Precision>
76 template<
unsigned int Precision>
83 template<
unsigned int Precision>
94 template<
unsigned int Precision>
109 template<
unsigned int Precision>
112 template<
unsigned int Precision>
135 template<
unsigned int Precision>
156 result = amp::abs<Precision>(
x(i1));
161 for(ix=i1; ix<=i2; ix++)
165 absxi = amp::abs<Precision>(
x(ix));
168 ssq = 1+ssq*amp::sqr<Precision>(scl/absxi);
173 ssq = ssq+amp::sqr<Precision>(absxi/scl);
177 result = scl*amp::sqrt<Precision>(ssq);
182 template<
unsigned int Precision>
193 a = amp::abs<Precision>(
x(
result));
194 for(
i=i1+1;
i<=i2;
i++)
196 if( amp::abs<Precision>(
x(
i))>amp::abs<Precision>(
x(
result)) )
205 template<
unsigned int Precision>
217 a = amp::abs<Precision>(
x(
result,
j));
218 for(
i=i1+1;
i<=i2;
i++)
220 if( amp::abs<Precision>(
x(
i,
j))>amp::abs<Precision>(
x(
result,
j)) )
229 template<
unsigned int Precision>
241 a = amp::abs<Precision>(
x(
i,
result));
242 for(
j=j1+1;
j<=j2;
j++)
244 if( amp::abs<Precision>(
x(
i,
j))>amp::abs<Precision>(
x(
i,
result)) )
253 template<
unsigned int Precision>
267 for(
j=j1;
j<=j2;
j++)
271 for(
i=i1;
i<=i2;
i++)
275 work(
j) = work(
j)+amp::abs<Precision>(a(
i,
j));
279 for(
j=j1;
j<=j2;
j++)
287 template<
unsigned int Precision>
303 if( is1>is2 || js1>js2 )
309 for(isrc=is1; isrc<=is2; isrc++)
312 ap::vmove(
b.getrow(idst, jd1, jd2), a.getrow(isrc, js1, js2));
317 template<
unsigned int Precision>
337 for(
i=i1;
i<=i2-1;
i++)
343 ap::vmove(work.getvector(1,
l), a.getcolumn(
j, ips, i2));
344 ap::vmove(a.getcolumn(
j, ips, i2), a.getrow(
i, jps, j2));
345 ap::vmove(a.getrow(
i, jps, j2), work.getvector(1,
l));
350 template<
unsigned int Precision>
366 if( is1>is2 || js1>js2 )
372 for(isrc=is1; isrc<=is2; isrc++)
375 ap::vmove(
b.getcolumn(jdst, id1, id2), a.getrow(isrc, js1, js2));
380 template<
unsigned int Precision>
418 for(
i=iy1;
i<=iy2;
i++)
431 for(
i=i1;
i<=i2;
i++)
455 for(
i=iy1;
i<=iy2;
i++)
468 for(
i=i1;
i<=i2;
i++)
471 ap::vadd(
y.getvector(iy1, iy2), a.getrow(
i, j1, j2),
v);
477 template<
unsigned int Precision>
488 xabs = amp::abs<Precision>(
x);
489 yabs = amp::abs<Precision>(
y);
490 w = amp::maximum<Precision>(xabs, yabs);
491 z = amp::minimum<Precision>(xabs, yabs);
498 result =
w*amp::sqrt<Precision>(1+amp::sqr<Precision>(z/
w));
504 template<
unsigned int Precision>
565 if( arows<=0 || acols<=0 || brows<=0 || bcols<=0 )
586 for(
i=ci1;
i<=ci2;
i++)
588 for(
j=cj1;
j<=cj2;
j++)
596 for(
i=ci1;
i<=ci2;
i++)
605 if( !transa && !transb )
607 for(
l=ai1;
l<=ai2;
l++)
609 for(r=bi1; r<=bi2; r++)
613 ap::vadd(c.getrow(
k, cj1, cj2),
b.getrow(r, bj1, bj2),
v);
622 if( !transa && transb )
624 if( arows*acols<brows*bcols )
626 for(r=bi1; r<=bi2; r++)
628 for(
l=ai1;
l<=ai2;
l++)
631 c(ci1+
l-ai1,cj1+r-bi1) = c(ci1+
l-ai1,cj1+r-bi1)+
alpha*
v;
638 for(
l=ai1;
l<=ai2;
l++)
640 for(r=bi1; r<=bi2; r++)
643 c(ci1+
l-ai1,cj1+r-bi1) = c(ci1+
l-ai1,cj1+r-bi1)+
alpha*
v;
653 if( transa && !transb )
655 for(
l=aj1;
l<=aj2;
l++)
657 for(r=bi1; r<=bi2; r++)
661 ap::vadd(c.getrow(
k, cj1, cj2),
b.getrow(r, bj1, bj2),
v);
670 if( transa && transb )
672 if( arows*acols<brows*bcols )
674 for(r=bi1; r<=bi2; r++)
676 for(
i=1;
i<=crows;
i++)
680 for(
l=ai1;
l<=ai2;
l++)
684 ap::vadd(work.getvector(1, crows), a.getrow(
l, aj1, aj2),
v);
686 ap::vadd(c.getcolumn(
k, ci1, ci2), work.getvector(1, crows));
692 for(
l=aj1;
l<=aj2;
l++)
695 ap::vmove(work.getvector(1,
k), a.getcolumn(
l, ai1, ai2));
696 for(r=bi1; r<=bi2; r++)
699 c(ci1+
l-aj1,cj1+r-bi1) = c(ci1+
l-aj1,cj1+r-bi1)+
alpha*
v;
static void make_assertion(bool bClause)
const CanonicalForm int const CFList const Variable & y
const Variable & v
< [in] a sqrfree bivariate poly
int maxint(int m1, int m2)
T vdotproduct(const_raw_vector< T > v1, const_raw_vector< T > v2)
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)
int columnidxabsmax(const ap::template_2d_array< amp::ampf< Precision > > &x, int i1, int i2, int j)
void matrixmatrixmultiply(const ap::template_2d_array< amp::ampf< Precision > > &a, int ai1, int ai2, int aj1, int aj2, bool transa, const ap::template_2d_array< amp::ampf< Precision > > &b, int bi1, int bi2, int bj1, int bj2, bool transb, amp::ampf< Precision > alpha, ap::template_2d_array< amp::ampf< Precision > > &c, int ci1, int ci2, int cj1, int cj2, amp::ampf< Precision > beta, ap::template_1d_array< amp::ampf< Precision > > &work)
int rowidxabsmax(const ap::template_2d_array< amp::ampf< Precision > > &x, int j1, int j2, int i)
void copyandtranspose(const ap::template_2d_array< amp::ampf< Precision > > &a, int is1, int is2, int js1, int js2, ap::template_2d_array< amp::ampf< Precision > > &b, int id1, int id2, int jd1, int jd2)
amp::ampf< Precision > vectornorm2(const ap::template_1d_array< amp::ampf< Precision > > &x, int i1, int i2)
amp::ampf< Precision > upperhessenberg1norm(const ap::template_2d_array< amp::ampf< Precision > > &a, int i1, int i2, int j1, int j2, ap::template_1d_array< amp::ampf< Precision > > &work)
void matrixvectormultiply(const ap::template_2d_array< amp::ampf< Precision > > &a, int i1, int i2, int j1, int j2, bool trans, const ap::template_1d_array< amp::ampf< Precision > > &x, int ix1, int ix2, amp::ampf< Precision > alpha, ap::template_1d_array< amp::ampf< Precision > > &y, int iy1, int iy2, amp::ampf< Precision > beta)
amp::ampf< Precision > pythag2(amp::ampf< Precision > x, amp::ampf< Precision > y)
void inplacetranspose(ap::template_2d_array< amp::ampf< Precision > > &a, int i1, int i2, int j1, int j2, ap::template_1d_array< amp::ampf< Precision > > &work)
void copymatrix(const ap::template_2d_array< amp::ampf< Precision > > &a, int is1, int is2, int js1, int js2, ap::template_2d_array< amp::ampf< Precision > > &b, int id1, int id2, int jd1, int jd2)
int vectoridxabsmax(const ap::template_1d_array< amp::ampf< Precision > > &x, int i1, int i2)