130const complex
conj(
const complex &z);
131const complex
csqr(
const complex &z);
145class const_raw_vector
176class raw_vector :
public const_raw_vector<T>
193 if(
v1.GetStep()==1 &&
v2.GetStep()==1 )
199 const T *p1 =
v1.GetData();
200 const T *p2 =
v2.GetData();
201 int imax =
v1.GetLength()/4;
203 for(
i=imax;
i!=0;
i--)
205 r += (*p1)*(*p2) + p1[1]*p2[1] + p1[2]*p2[2] + p1[3]*p2[3];
209 for(
i=0;
i<
v1.GetLength()%4;
i++)
210 r += (*(p1++))*(*(p2++));
221 const T *p1 =
v1.GetData();
222 const T *p2 =
v2.GetData();
223 int imax =
v1.GetLength()/4;
225 for(
i=0;
i<imax;
i++)
231 for(
i=0;
i<
v1.GetLength()%4;
i++)
249 if(
vdst.GetStep()==1 &&
vsrc.GetStep()==1 )
254 T *p1 =
vdst.GetData();
255 const T *p2 =
vsrc.GetData();
256 int imax =
vdst.GetLength()/2;
258 for(
i=imax;
i!=0;
i--)
265 if(
vdst.GetLength()%2 != 0)
276 T *p1 =
vdst.GetData();
277 const T *p2 =
vsrc.GetData();
278 int imax =
vdst.GetLength()/4;
280 for(
i=0;
i<imax;
i++)
289 for(
i=0;
i<
vdst.GetLength()%4;
i++)
292 p1 +=
vdst.GetStep();
293 p2 +=
vsrc.GetStep();
307 if(
vdst.GetStep()==1 &&
vsrc.GetStep()==1 )
312 T *p1 =
vdst.GetData();
313 const T *p2 =
vsrc.GetData();
314 int imax =
vdst.GetLength()/2;
316 for(
i=0;
i<imax;
i++)
323 if(
vdst.GetLength()%2 != 0)
334 T *p1 =
vdst.GetData();
335 const T *p2 =
vsrc.GetData();
336 int imax =
vdst.GetLength()/4;
338 for(
i=imax;
i!=0;
i--)
347 for(
i=0;
i<
vdst.GetLength()%4;
i++)
350 p1 +=
vdst.GetStep();
351 p2 +=
vsrc.GetStep();
361template<
class T,
class T2>
365 if(
vdst.GetStep()==1 &&
vsrc.GetStep()==1 )
370 T *p1 =
vdst.GetData();
371 const T *p2 =
vsrc.GetData();
372 int imax =
vdst.GetLength()/4;
374 for(
i=imax;
i!=0;
i--)
383 for(
i=0;
i<
vdst.GetLength()%4;
i++)
384 *(p1++) =
alpha*(*(p2++));
394 T *p1 =
vdst.GetData();
395 const T *p2 =
vsrc.GetData();
396 int imax =
vdst.GetLength()/4;
398 for(
i=0;
i<imax;
i++)
407 for(
i=0;
i<
vdst.GetLength()%4;
i++)
410 p1 +=
vdst.GetStep();
411 p2 +=
vsrc.GetStep();
425 if(
vdst.GetStep()==1 &&
vsrc.GetStep()==1 )
430 T *p1 =
vdst.GetData();
431 const T *p2 =
vsrc.GetData();
432 int imax =
vdst.GetLength()/4;
434 for(
i=imax;
i!=0;
i--)
443 for(
i=0;
i<
vdst.GetLength()%4;
i++)
454 T *p1 =
vdst.GetData();
455 const T *p2 =
vsrc.GetData();
456 int imax =
vdst.GetLength()/4;
458 for(
i=0;
i<imax;
i++)
467 for(
i=0;
i<
vdst.GetLength()%4;
i++)
470 p1 +=
vdst.GetStep();
471 p2 +=
vsrc.GetStep();
481template<
class T,
class T2>
485 if(
vdst.GetStep()==1 &&
vsrc.GetStep()==1 )
490 T *p1 =
vdst.GetData();
491 const T *p2 =
vsrc.GetData();
492 int imax =
vdst.GetLength()/4;
494 for(
i=imax;
i!=0;
i--)
497 p1[1] +=
alpha*p2[1];
498 p1[2] +=
alpha*p2[2];
499 p1[3] +=
alpha*p2[3];
503 for(
i=0;
i<
vdst.GetLength()%4;
i++)
504 *(p1++) +=
alpha*(*(p2++));
514 T *p1 =
vdst.GetData();
515 const T *p2 =
vsrc.GetData();
516 int imax =
vdst.GetLength()/4;
518 for(
i=0;
i<imax;
i++)
527 for(
i=0;
i<
vdst.GetLength()%4;
i++)
530 p1 +=
vdst.GetStep();
531 p2 +=
vsrc.GetStep();
545 if(
vdst.GetStep()==1 &&
vsrc.GetStep()==1 )
550 T *p1 =
vdst.GetData();
551 const T *p2 =
vsrc.GetData();
552 int imax =
vdst.GetLength()/4;
554 for(
i=imax;
i!=0;
i--)
563 for(
i=0;
i<
vdst.GetLength()%4;
i++)
574 T *p1 =
vdst.GetData();
575 const T *p2 =
vsrc.GetData();
576 int imax =
vdst.GetLength()/4;
578 for(
i=0;
i<imax;
i++)
587 for(
i=0;
i<
vdst.GetLength()%4;
i++)
590 p1 +=
vdst.GetStep();
591 p2 +=
vsrc.GetStep();
601template<
class T,
class T2>
611template<
class T,
class T2>
614 if(
vdst.GetStep()==1 )
619 T *p1 =
vdst.GetData();
620 int imax =
vdst.GetLength()/4;
622 for(
i=imax;
i!=0;
i--)
630 for(
i=0;
i<
vdst.GetLength()%4;
i++)
640 T *p1 =
vdst.GetData();
641 int imax =
vdst.GetLength()/4;
643 for(
i=0;
i<imax;
i++)
651 for(
i=0;
i<
vdst.GetLength()%4;
i++)
654 p1 +=
vdst.GetStep();
665class template_1d_array
688 #ifndef UNSAFE_MEM_COPY
713 #ifndef UNSAFE_MEM_COPY
759 (*
this)(
i) = pContent[
i-
iLow];
815class template_2d_array
842 #ifndef UNSAFE_MEM_COPY
869 #ifndef UNSAFE_MEM_COPY
1007double sqr(
double x);
1008int maxint(
int m1,
int m2);
1009int minint(
int m1,
int m2);
1010double maxreal(
double m1,
double m2);
1011double minreal(
double m1,
double m2);
1036 class incorrectPrecision :
public exception {};
1037 class overflow :
public exception {};
1038 class divisionByZero :
public exception {};
1039 class sqrtOfNegativeNumber :
public exception {};
1040 class invalidConversion :
public exception {};
1041 class invalidString :
public exception {};
1042 class internalError :
public exception {};
1043 class domainError :
public exception {};
1095 template<
unsigned int Precision>
1142#ifndef _AMP_NO_TEMPLATE_CONSTRUCTORS
1143 template<
unsigned int Precision2>
1183#ifndef _AMP_NO_TEMPLATE_CONSTRUCTORS
1184 template<
unsigned int Precision2>
1187 if( (
void*)
this==(
void*)(&r) )
1258 template<
unsigned int Precision>
1263 WerrorS(
"incorrectPrecision");
1266 template<
unsigned int Precision>
1274 template<
unsigned int Precision>
1282 template<
unsigned int Precision>
1290 template<
unsigned int Precision>
1298 template<
unsigned int Precision>
1306 template<
unsigned int Precision>
1312 template<
unsigned int Precision>
1315 if( rval->refCount==1 )
1324 template<
unsigned int Precision>
1330 template<
unsigned int Precision>
1333 if( !isFiniteNumber() )
1338 template<
unsigned int Precision>
1344 template<
unsigned int Precision>
1347 if( !isFiniteNumber() )
1352 template<
unsigned int Precision>
1355 return getUlpOf(*
this);
1358 template<
unsigned int Precision>
1364 template<
unsigned int Precision>
1370 if( !isFiniteNumber() )
1410 template<
unsigned int Precision>
1418 if( !isFiniteNumber() )
1457 template<
unsigned int Precision>
1464 if( !isFiniteNumber() )
1501 template<
unsigned int Precision>
1504 if( !
x.isFiniteNumber() )
1524 template<
unsigned int Precision>
1533 template<
unsigned int Precision>
1547 template<
unsigned int Precision>
1561 template<
unsigned int Precision>
1570 template<
unsigned int Precision>
1578 template<
unsigned int Precision>
1584 template<
unsigned int Precision>
1595 template<
unsigned int Precision>
1606 template<
unsigned int Precision>
1617 template<
unsigned int Precision>
1620 return mpfr_cmp(
op1.getReadPtr(), op2.getReadPtr())==0;
1623 template<
unsigned int Precision>
1626 return mpfr_cmp(
op1.getReadPtr(), op2.getReadPtr())!=0;
1629 template<
unsigned int Precision>
1632 return mpfr_cmp(
op1.getReadPtr(), op2.getReadPtr())<0;
1635 template<
unsigned int Precision>
1638 return mpfr_cmp(
op1.getReadPtr(), op2.getReadPtr())>0;
1641 template<
unsigned int Precision>
1644 return mpfr_cmp(
op1.getReadPtr(), op2.getReadPtr())<=0;
1647 template<
unsigned int Precision>
1650 return mpfr_cmp(
op1.getReadPtr(), op2.getReadPtr())>=0;
1656 template<
unsigned int Precision>
1662 template<
unsigned int Precision>
1670 template<
unsigned int Precision>
1678 template<
unsigned int Precision>
1687 template<
unsigned int Precision>
1695 template<
unsigned int Precision>
1706 template<
unsigned int Precision>
1715 template<
unsigned int Precision>
1726 template<
unsigned int Precision>
1735 template<
unsigned int Precision>
1744 template<
unsigned int Precision>
1753 template<
unsigned int Precision>
1762 template<
unsigned int Precision>
1779 template<
unsigned int Precision>
1788 template<
unsigned int Precision>
1805 template<
unsigned int Precision>
1822 template<
unsigned int Precision>
1839 template<
unsigned int Precision>
1844 if( !
x.isFiniteNumber() )
1859 template<
unsigned int Precision>
1871 #define __AMP_BINARY_OPI(type) \
1872 template<unsigned int Precision> const ampf<Precision> operator+(const signed type& op1, const ampf<Precision>& op2) { return ampf<Precision>(op1)+op2; } \
1873 template<unsigned int Precision> const ampf<Precision> operator+(const unsigned type& op1, const ampf<Precision>& op2) { return ampf<Precision>(op1)+op2; } \
1874 template<unsigned int Precision> const ampf<Precision> operator+(const ampf<Precision>& op1, const signed type& op2) { return op1+ampf<Precision>(op2); } \
1875 template<unsigned int Precision> const ampf<Precision> operator+(const ampf<Precision>& op1, const unsigned type& op2) { return op1+ampf<Precision>(op2); } \
1876 template<unsigned int Precision> const ampf<Precision> operator-(const signed type& op1, const ampf<Precision>& op2) { return ampf<Precision>(op1)-op2; } \
1877 template<unsigned int Precision> const ampf<Precision> operator-(const unsigned type& op1, const ampf<Precision>& op2) { return ampf<Precision>(op1)-op2; } \
1878 template<unsigned int Precision> const ampf<Precision> operator-(const ampf<Precision>& op1, const signed type& op2) { return op1-ampf<Precision>(op2); } \
1879 template<unsigned int Precision> const ampf<Precision> operator-(const ampf<Precision>& op1, const unsigned type& op2) { return op1-ampf<Precision>(op2); } \
1880 template<unsigned int Precision> const ampf<Precision> operator*(const signed type& op1, const ampf<Precision>& op2) { return ampf<Precision>(op1)*op2; } \
1881 template<unsigned int Precision> const ampf<Precision> operator*(const unsigned type& op1, const ampf<Precision>& op2) { return ampf<Precision>(op1)*op2; } \
1882 template<unsigned int Precision> const ampf<Precision> operator*(const ampf<Precision>& op1, const signed type& op2) { return op1*ampf<Precision>(op2); } \
1883 template<unsigned int Precision> const ampf<Precision> operator*(const ampf<Precision>& op1, const unsigned type& op2) { return op1*ampf<Precision>(op2); } \
1884 template<unsigned int Precision> const ampf<Precision> operator/(const signed type& op1, const ampf<Precision>& op2) { return ampf<Precision>(op1)/op2; } \
1885 template<unsigned int Precision> const ampf<Precision> operator/(const unsigned type& op1, const ampf<Precision>& op2) { return ampf<Precision>(op1)/op2; } \
1886 template<unsigned int Precision> const ampf<Precision> operator/(const ampf<Precision>& op1, const signed type& op2) { return op1/ampf<Precision>(op2); } \
1887 template<unsigned int Precision> const ampf<Precision> operator/(const ampf<Precision>& op1, const unsigned type& op2) { return op1/ampf<Precision>(op2); } \
1888 template<unsigned int Precision> bool operator==(const signed type& op1, const ampf<Precision>& op2) { return ampf<Precision>(op1)==op2; } \
1889 template<unsigned int Precision> bool operator==(const unsigned type& op1, const ampf<Precision>& op2) { return ampf<Precision>(op1)==op2; } \
1890 template<unsigned int Precision> bool operator==(const ampf<Precision>& op1, const signed type& op2) { return op1==ampf<Precision>(op2); } \
1891 template<unsigned int Precision> bool operator==(const ampf<Precision>& op1, const unsigned type& op2) { return op1==ampf<Precision>(op2); } \
1892 template<unsigned int Precision> bool operator!=(const signed type& op1, const ampf<Precision>& op2) { return ampf<Precision>(op1)!=op2; } \
1893 template<unsigned int Precision> bool operator!=(const unsigned type& op1, const ampf<Precision>& op2) { return ampf<Precision>(op1)!=op2; } \
1894 template<unsigned int Precision> bool operator!=(const ampf<Precision>& op1, const signed type& op2) { return op1!=ampf<Precision>(op2); } \
1895 template<unsigned int Precision> bool operator!=(const ampf<Precision>& op1, const unsigned type& op2) { return op1!=ampf<Precision>(op2); } \
1896 template<unsigned int Precision> bool operator<=(const signed type& op1, const ampf<Precision>& op2) { return ampf<Precision>(op1)<=op2; } \
1897 template<unsigned int Precision> bool operator<=(const unsigned type& op1, const ampf<Precision>& op2) { return ampf<Precision>(op1)<=op2; } \
1898 template<unsigned int Precision> bool operator<=(const ampf<Precision>& op1, const signed type& op2) { return op1<=ampf<Precision>(op2); } \
1899 template<unsigned int Precision> bool operator<=(const ampf<Precision>& op1, const unsigned type& op2) { return op1<=ampf<Precision>(op2); } \
1900 template<unsigned int Precision> bool operator>=(const signed type& op1, const ampf<Precision>& op2) { return ampf<Precision>(op1)>=op2; } \
1901 template<unsigned int Precision> bool operator>=(const unsigned type& op1, const ampf<Precision>& op2) { return ampf<Precision>(op1)>=op2; } \
1902 template<unsigned int Precision> bool operator>=(const ampf<Precision>& op1, const signed type& op2) { return op1>=ampf<Precision>(op2); } \
1903 template<unsigned int Precision> bool operator>=(const ampf<Precision>& op1, const unsigned type& op2) { return op1>=ampf<Precision>(op2); } \
1904 template<unsigned int Precision> bool operator<(const signed type& op1, const ampf<Precision>& op2) { return ampf<Precision>(op1)<op2; } \
1905 template<unsigned int Precision> bool operator<(const unsigned type& op1, const ampf<Precision>& op2) { return ampf<Precision>(op1)<op2; } \
1906 template<unsigned int Precision> bool operator<(const ampf<Precision>& op1, const signed type& op2) { return op1<ampf<Precision>(op2); } \
1907 template<unsigned int Precision> bool operator<(const ampf<Precision>& op1, const unsigned type& op2) { return op1<ampf<Precision>(op2); } \
1908 template<unsigned int Precision> bool operator>(const signed type& op1, const ampf<Precision>& op2) { return ampf<Precision>(op1)>op2; } \
1909 template<unsigned int Precision> bool operator>(const unsigned type& op1, const ampf<Precision>& op2) { return ampf<Precision>(op1)>op2; } \
1910 template<unsigned int Precision> bool operator>(const ampf<Precision>& op1, const signed type& op2) { return op1>ampf<Precision>(op2); } \
1911 template<unsigned int Precision> bool operator>(const ampf<Precision>& op1, const unsigned type& op2) { return op1>ampf<Precision>(op2); }
1916 #undef __AMP_BINARY_OPI
1917 #define __AMP_BINARY_OPF(type) \
1918 template<unsigned int Precision> const ampf<Precision> operator+(const type& op1, const ampf<Precision>& op2) { return ampf<Precision>(op1)+op2; } \
1919 template<unsigned int Precision> const ampf<Precision> operator+(const ampf<Precision>& op1, const type& op2) { return op1+ampf<Precision>(op2); } \
1920 template<unsigned int Precision> const ampf<Precision> operator-(const type& op1, const ampf<Precision>& op2) { return ampf<Precision>(op1)-op2; } \
1921 template<unsigned int Precision> const ampf<Precision> operator-(const ampf<Precision>& op1, const type& op2) { return op1-ampf<Precision>(op2); } \
1922 template<unsigned int Precision> const ampf<Precision> operator*(const type& op1, const ampf<Precision>& op2) { return ampf<Precision>(op1)*op2; } \
1923 template<unsigned int Precision> const ampf<Precision> operator*(const ampf<Precision>& op1, const type& op2) { return op1*ampf<Precision>(op2); } \
1924 template<unsigned int Precision> const ampf<Precision> operator/(const type& op1, const ampf<Precision>& op2) { return ampf<Precision>(op1)/op2; } \
1925 template<unsigned int Precision> const ampf<Precision> operator/(const ampf<Precision>& op1, const type& op2) { return op1/ampf<Precision>(op2); } \
1926 template<unsigned int Precision> bool operator==(const type& op1, const ampf<Precision>& op2) { return ampf<Precision>(op1)==op2; } \
1927 template<unsigned int Precision> bool operator==(const ampf<Precision>& op1, const type& op2) { return op1==ampf<Precision>(op2); } \
1928 template<unsigned int Precision> bool operator!=(const type& op1, const ampf<Precision>& op2) { return ampf<Precision>(op1)!=op2; } \
1929 template<unsigned int Precision> bool operator!=(const ampf<Precision>& op1, const type& op2) { return op1!=ampf<Precision>(op2); } \
1930 template<unsigned int Precision> bool operator<=(const type& op1, const ampf<Precision>& op2) { return ampf<Precision>(op1)<=op2; } \
1931 template<unsigned int Precision> bool operator<=(const ampf<Precision>& op1, const type& op2) { return op1<=ampf<Precision>(op2); } \
1932 template<unsigned int Precision> bool operator>=(const type& op1, const ampf<Precision>& op2) { return ampf<Precision>(op1)>=op2; } \
1933 template<unsigned int Precision> bool operator>=(const ampf<Precision>& op1, const type& op2) { return op1>=ampf<Precision>(op2); } \
1934 template<unsigned int Precision> bool operator<(const type& op1, const ampf<Precision>& op2) { return ampf<Precision>(op1)<op2; } \
1935 template<unsigned int Precision> bool operator<(const ampf<Precision>& op1, const type& op2) { return op1<ampf<Precision>(op2); } \
1936 template<unsigned int Precision> bool operator>(const type& op1, const ampf<Precision>& op2) { return ampf<Precision>(op1)>op2; } \
1937 template<unsigned int Precision> bool operator>(const ampf<Precision>& op1, const type& op2) { return op1>ampf<Precision>(op2); }
1941 #undef __AMP_BINARY_OPF
1946 template<
unsigned int Precision>
1954 template<
unsigned int Precision>
1963 template<
unsigned int Precision>
1972 template<
unsigned int Precision>
1980 template<
unsigned int Precision>
1988 template<
unsigned int Precision>
1996 template<
unsigned int Precision>
2004 template<
unsigned int Precision>
2012 template<
unsigned int Precision>
2020 template<
unsigned int Precision>
2028 template<
unsigned int Precision>
2036 template<
unsigned int Precision>
2044 template<
unsigned int Precision>
2052 template<
unsigned int Precision>
2060 template<
unsigned int Precision>
2068 template<
unsigned int Precision>
2076 template<
unsigned int Precision>
2084 template<
unsigned int Precision>
2095 template<
unsigned int Precision>
2114#ifndef _AMP_NO_TEMPLATE_CONSTRUCTORS
2115 template<
unsigned int Prec2>
2138#ifndef _AMP_NO_TEMPLATE_CONSTRUCTORS
2139 template<
unsigned int Precision2>
2154 template<
unsigned int Precision>
2158 template<
unsigned int Precision>
2162 template<
unsigned int Precision>
2166 template<
unsigned int Precision>
2170 template<
unsigned int Precision>
2174 template<
unsigned int Precision>
2178 template<
unsigned int Precision>
2182 template<
unsigned int Precision>
2186 template<
unsigned int Precision>
2195 template<
unsigned int Precision>
2199 template<
unsigned int Precision>
2222 template<
unsigned int Precision>
2229 template<
unsigned int Precision>
2247 template<
unsigned int Precision>
2253 template<
unsigned int Precision>
2263 #define __AMP_BINARY_OPI(type) \
2264 template<unsigned int Precision> const campf<Precision> operator+ (const signed type& op1, const campf<Precision>& op2) { return campf<Precision>(op1+op2.x, op2.y); } \
2265 template<unsigned int Precision> const campf<Precision> operator+ (const unsigned type& op1, const campf<Precision>& op2) { return campf<Precision>(op1+op2.x, op2.y); } \
2266 template<unsigned int Precision> const campf<Precision> operator+ (const campf<Precision>& op1, const signed type& op2) { return campf<Precision>(op1.x+op2, op1.y); } \
2267 template<unsigned int Precision> const campf<Precision> operator+ (const campf<Precision>& op1, const unsigned type& op2) { return campf<Precision>(op1.x+op2, op1.y); } \
2268 template<unsigned int Precision> const campf<Precision> operator- (const signed type& op1, const campf<Precision>& op2) { return campf<Precision>(op1-op2.x, -op2.y); } \
2269 template<unsigned int Precision> const campf<Precision> operator- (const unsigned type& op1, const campf<Precision>& op2) { return campf<Precision>(op1-op2.x, -op2.y); } \
2270 template<unsigned int Precision> const campf<Precision> operator- (const campf<Precision>& op1, const signed type& op2) { return campf<Precision>(op1.x-op2, op1.y); } \
2271 template<unsigned int Precision> const campf<Precision> operator- (const campf<Precision>& op1, const unsigned type& op2) { return campf<Precision>(op1.x-op2, op1.y); } \
2272 template<unsigned int Precision> const campf<Precision> operator* (const signed type& op1, const campf<Precision>& op2) { return campf<Precision>(op1*op2.x, op1*op2.y); } \
2273 template<unsigned int Precision> const campf<Precision> operator* (const unsigned type& op1, const campf<Precision>& op2) { return campf<Precision>(op1*op2.x, op1*op2.y); } \
2274 template<unsigned int Precision> const campf<Precision> operator* (const campf<Precision>& op1, const signed type& op2) { return campf<Precision>(op2*op1.x, op2*op1.y); } \
2275 template<unsigned int Precision> const campf<Precision> operator* (const campf<Precision>& op1, const unsigned type& op2) { return campf<Precision>(op2*op1.x, op2*op1.y); } \
2276 template<unsigned int Precision> const campf<Precision> operator/ (const signed type& op1, const campf<Precision>& op2) { return campf<Precision>(ampf<Precision>(op1),ampf<Precision>(0))/op2; } \
2277 template<unsigned int Precision> const campf<Precision> operator/ (const unsigned type& op1, const campf<Precision>& op2) { return campf<Precision>(ampf<Precision>(op1),ampf<Precision>(0))/op2; } \
2278 template<unsigned int Precision> const campf<Precision> operator/ (const campf<Precision>& op1, const signed type& op2) { return campf<Precision>(op1.x/op2, op1.y/op2); } \
2279 template<unsigned int Precision> const campf<Precision> operator/ (const campf<Precision>& op1, const unsigned type& op2) { return campf<Precision>(op1.x/op2, op1.y/op2); } \
2280 template<unsigned int Precision> bool operator==(const signed type& op1, const campf<Precision>& op2) { return op1==op2.x && op2.y==0; } \
2281 template<unsigned int Precision> bool operator==(const unsigned type& op1, const campf<Precision>& op2) { return op1==op2.x && op2.y==0; } \
2282 template<unsigned int Precision> bool operator==(const campf<Precision>& op1, const signed type& op2) { return op1.x==op2 && op1.y==0; } \
2283 template<unsigned int Precision> bool operator==(const campf<Precision>& op1, const unsigned type& op2) { return op1.x==op2 && op1.y==0; } \
2284 template<unsigned int Precision> bool operator!=(const campf<Precision>& op1, const signed type& op2) { return op1.x!=op2 || op1.y!=0; } \
2285 template<unsigned int Precision> bool operator!=(const campf<Precision>& op1, const unsigned type& op2) { return op1.x!=op2 || op1.y!=0; } \
2286 template<unsigned int Precision> bool operator!=(const signed type& op1, const campf<Precision>& op2) { return op1!=op2.x || op2.y!=0; } \
2287 template<unsigned int Precision> bool operator!=(const unsigned type& op1, const campf<Precision>& op2) { return op1!=op2.x || op2.y!=0; }
2292 #undef __AMP_BINARY_OPI
2293 #define __AMP_BINARY_OPF(type) \
2294 template<unsigned int Precision> const campf<Precision> operator+ (const type& op1, const campf<Precision>& op2) { return campf<Precision>(op1+op2.x, op2.y); } \
2295 template<unsigned int Precision> const campf<Precision> operator+ (const campf<Precision>& op1, const type& op2) { return campf<Precision>(op1.x+op2, op1.y); } \
2296 template<unsigned int Precision> const campf<Precision> operator- (const type& op1, const campf<Precision>& op2) { return campf<Precision>(op1-op2.x, -op2.y); } \
2297 template<unsigned int Precision> const campf<Precision> operator- (const campf<Precision>& op1, const type& op2) { return campf<Precision>(op1.x-op2, op1.y); } \
2298 template<unsigned int Precision> const campf<Precision> operator* (const type& op1, const campf<Precision>& op2) { return campf<Precision>(op1*op2.x, op1*op2.y); } \
2299 template<unsigned int Precision> const campf<Precision> operator* (const campf<Precision>& op1, const type& op2) { return campf<Precision>(op2*op1.x, op2*op1.y); } \
2300 template<unsigned int Precision> const campf<Precision> operator/ (const type& op1, const campf<Precision>& op2) { return campf<Precision>(ampf<Precision>(op1),ampf<Precision>(0))/op2; } \
2301 template<unsigned int Precision> const campf<Precision> operator/ (const campf<Precision>& op1, const type& op2) { return campf<Precision>(op1.x/op2, op1.y/op2); } \
2302 template<unsigned int Precision> bool operator==(const type& op1, const campf<Precision>& op2) { return op1==op2.x && op2.y==0; } \
2303 template<unsigned int Precision> bool operator==(const campf<Precision>& op1, const type& op2) { return op1.x==op2 && op1.y==0; } \
2304 template<unsigned int Precision> bool operator!=(const type& op1, const campf<Precision>& op2) { return op1!=op2.x || op2.y!=0; } \
2305 template<unsigned int Precision> bool operator!=(const campf<Precision>& op1, const type& op2) { return op1.x!=op2 || op1.y!=0; }
2310 #undef __AMP_BINARY_OPF
2315 template<
unsigned int Precision>
2319 int i, cnt =
v1.GetLength();
2322 mpfr_record *r =
NULL;
2323 mpfr_record *t =
NULL;
2329 for(
i=0;
i<cnt;
i++)
2349 template<
unsigned int Precision>
2353 int i, cnt =
vDst.GetLength();
2358 for(
i=0;
i<cnt;
i++)
2366 template<
unsigned int Precision>
2370 int i, cnt =
vDst.GetLength();
2373 for(
i=0;
i<cnt;
i++)
2383 template<
unsigned int Precision,
class T2>
2387 int i, cnt =
vDst.GetLength();
2391 for(
i=0;
i<cnt;
i++)
2401 template<
unsigned int Precision>
2405 int i, cnt =
vDst.GetLength();
2408 for(
i=0;
i<cnt;
i++)
2418 template<
unsigned int Precision,
class T2>
2422 int i, cnt =
vDst.GetLength();
2426 for(
i=0;
i<cnt;
i++)
2437 template<
unsigned int Precision>
2441 int i, cnt =
vDst.GetLength();
2444 for(
i=0;
i<cnt;
i++)
2454 template<
unsigned int Precision,
class T2>
2460 template<
unsigned int Precision,
class T2>
2463 int i, cnt =
vDst.GetLength();
2466 for(
i=0;
i<cnt;
i++)
2517 template<
unsigned int Precision>
2521 template<
unsigned int Precision>
2530 template<
unsigned int Precision>
2581 template<
unsigned int Precision>
2611 mx = amp::maximum<Precision>(amp::abs<Precision>(
x(
j)),
mx);
2635 mx = amp::maximum<Precision>(amp::abs<Precision>(
alpha), amp::abs<Precision>(
xnorm));
2676 template<
unsigned int Precision>
2689 if(
tau==0 ||
n1>
n2 || m1>m2 )
2701 for(
i=m1;
i<=m2;
i++)
2710 for(
i=m1;
i<=m2;
i++)
2746 template<
unsigned int Precision>
2761 if(
tau==0 ||
n1>
n2 || m1>m2 )
2770 for(
i=m1;
i<=m2;
i++)
2779 for(
i=m1;
i<=m2;
i++)
2829 template<
unsigned int Precision>
2835 template<
unsigned int Precision>
2842 template<
unsigned int Precision>
2852 template<
unsigned int Precision>
2859 template<
unsigned int Precision>
2869 template<
unsigned int Precision>
2876 template<
unsigned int Precision>
2882 template<
unsigned int Precision>
2889 template<
unsigned int Precision>
2899 template<
unsigned int Precision>
2906 template<
unsigned int Precision>
2916 template<
unsigned int Precision>
2975 template<
unsigned int Precision>
3005 tauq.setbounds(0, n-1);
3006 taup.setbounds(0, n-1);
3010 tauq.setbounds(0,
m-1);
3011 taup.setbounds(0,
m-1);
3019 for(
i=0;
i<=n-1;
i++)
3026 reflections::generatereflection<Precision>(t,
m-
i,
ltau);
3034 reflections::applyreflectionfromtheleft<Precision>(a,
ltau, t,
i,
m-1,
i+1, n-1,
work);
3043 reflections::generatereflection<Precision>(t, n-1-
i,
ltau);
3051 reflections::applyreflectionfromtheright<Precision>(a,
ltau, t,
i+1,
m-1,
i+1, n-1,
work);
3065 for(
i=0;
i<=
m-1;
i++)
3072 reflections::generatereflection<Precision>(t, n-
i,
ltau);
3080 reflections::applyreflectionfromtheright<Precision>(a,
ltau, t,
i+1,
m-1,
i, n-1,
work);
3089 reflections::generatereflection<Precision>(t,
m-1-
i,
ltau);
3097 reflections::applyreflectionfromtheleft<Precision>(a,
ltau, t,
i+1,
m-1,
i+1, n-1,
work);
3129 template<
unsigned int Precision>
3152 for(
i=0;
i<=
m-1;
i++)
3203 template<
unsigned int Precision>
3273 reflections::applyreflectionfromtheright<Precision>(z,
tauq(
i),
v, 0,
zrows-1,
i,
m-1,
work);
3277 reflections::applyreflectionfromtheleft<Precision>(z,
tauq(
i),
v,
i,
m-1, 0,
zcolumns-1,
work);
3321 reflections::applyreflectionfromtheright<Precision>(z,
tauq(
i),
v, 0,
zrows-1,
i+1,
m-1,
work);
3325 reflections::applyreflectionfromtheleft<Precision>(z,
tauq(
i),
v,
i+1,
m-1, 0,
zcolumns-1,
work);
3356 template<
unsigned int Precision>
3370 if(
m==0 || n==0 ||
ptrows==0 )
3381 for(
j=0;
j<=n-1;
j++)
3430 template<
unsigned int Precision>
3504 reflections::applyreflectionfromtheright<Precision>(z,
taup(
i),
v, 0,
zrows-1,
i+1, n-1,
work);
3508 reflections::applyreflectionfromtheleft<Precision>(z,
taup(
i),
v,
i+1, n-1, 0,
zcolumns-1,
work);
3551 reflections::applyreflectionfromtheright<Precision>(z,
taup(
i),
v, 0,
zrows-1,
i, n-1,
work);
3555 reflections::applyreflectionfromtheleft<Precision>(z,
taup(
i),
v,
i, n-1, 0,
zcolumns-1,
work);
3586 template<
unsigned int Precision>
3604 d.setbounds(0, n-1);
3605 e.setbounds(0, n-1);
3606 for(
i=0;
i<=n-2;
i++)
3611 d(n-1) =
b(n-1,n-1);
3615 d.setbounds(0,
m-1);
3616 e.setbounds(0,
m-1);
3617 for(
i=0;
i<=
m-2;
i++)
3622 d(
m-1) =
b(
m-1,
m-1);
3631 template<
unsigned int Precision>
3671 reflections::generatereflection<Precision>(t,
mmip1,
ltau);
3679 reflections::applyreflectionfromtheleft<Precision>(a,
ltau, t,
i,
m,
i+1, n,
work);
3690 reflections::generatereflection<Precision>(t,
nmi,
ltau);
3698 reflections::applyreflectionfromtheright<Precision>(a,
ltau, t,
i+1,
m,
i+1, n,
work);
3720 reflections::generatereflection<Precision>(t,
nmip1,
ltau);
3728 reflections::applyreflectionfromtheright<Precision>(a,
ltau, t,
i+1,
m,
i, n,
work);
3739 reflections::generatereflection<Precision>(t,
mmi,
ltau);
3747 reflections::applyreflectionfromtheleft<Precision>(a,
ltau, t,
i+1,
m,
i+1, n,
work);
3762 template<
unsigned int Precision>
3836 template<
unsigned int Precision>
3909 reflections::applyreflectionfromtheright<Precision>(z,
tauq(
i),
v, 1,
zrows,
i,
m,
work);
3959 reflections::applyreflectionfromtheright<Precision>(z,
tauq(
i),
v, 1,
zrows,
i+1,
m,
work);
3977 template<
unsigned int Precision>
3994 if(
m==0 || n==0 ||
ptrows==0 )
4031 reflections::applyreflectionfromtheright<Precision>(
pt,
taup(
i),
v, 1,
ptrows,
i+1, n,
work);
4041 reflections::applyreflectionfromtheright<Precision>(
pt,
taup(
i),
v, 1,
ptrows,
i, n,
work);
4051 template<
unsigned int Precision>
4129 reflections::applyreflectionfromtheright<Precision>(z,
taup(
i),
v, 1,
zrows,
i+1, n,
work);
4133 reflections::applyreflectionfromtheleft<Precision>(z,
taup(
i),
v,
i+1, n, 1,
zcolumns,
work);
4177 reflections::applyreflectionfromtheright<Precision>(z,
taup(
i),
v, 1,
zrows,
i, n,
work);
4181 reflections::applyreflectionfromtheleft<Precision>(z,
taup(
i),
v,
i, n, 1,
zcolumns,
work);
4194 template<
unsigned int Precision>
4214 for(
i=1;
i<=n-1;
i++)
4225 for(
i=1;
i<=
m-1;
i++)
4277 template<
unsigned int Precision>
4282 template<
unsigned int Precision>
4289 template<
unsigned int Precision>
4294 template<
unsigned int Precision>
4299 template<
unsigned int Precision>
4306 template<
unsigned int Precision>
4352 template<
unsigned int Precision>
4371 work.setbounds(0, n-1);
4379 for(
i=0;
i<=
k-1;
i++)
4386 reflections::generatereflection<Precision>(t,
m-
i,
tmp);
4396 reflections::applyreflectionfromtheleft<Precision>(a,
tau(
i), t,
i,
m-1,
i+1, n-1,
work);
4422 template<
unsigned int Precision>
4452 for(
i=0;
i<=
m-1;
i++)
4470 for(
i=
k-1;
i>=0;
i--)
4478 reflections::applyreflectionfromtheleft<Precision>(q,
tau(
i),
v,
i,
m-1, 0,
qcolumns-1,
work);
4498 template<
unsigned int Precision>
4513 r.setbounds(0,
m-1, 0, n-1);
4514 for(
i=0;
i<=n-1;
i++)
4518 for(
i=1;
i<=
m-1;
i++)
4520 ap::vmove(r.getrow(
i, 0, n-1), r.getrow(0, 0, n-1));
4522 for(
i=0;
i<=
k-1;
i++)
4532 template<
unsigned int Precision>
4548 work.setbounds(1, n);
4564 reflections::generatereflection<Precision>(t,
mmip1,
tmp);
4574 reflections::applyreflectionfromtheleft<Precision>(a,
tau(
i), t,
i,
m,
i+1, n,
work);
4583 template<
unsigned int Precision>
4641 reflections::applyreflectionfromtheleft<Precision>(q,
tau(
i),
v,
i,
m, 1,
qcolumns,
work);
4649 template<
unsigned int Precision>
4668 work.setbounds(1,
m);
4670 q.setbounds(1,
m, 1,
m);
4671 r.setbounds(1,
m, 1, n);
4687 ap::vmove(r.getrow(
i, 1, n), r.getrow(1, 1, n));
4737 template<
unsigned int Precision>
4742 template<
unsigned int Precision>
4749 template<
unsigned int Precision>
4754 template<
unsigned int Precision>
4759 template<
unsigned int Precision>
4766 template<
unsigned int Precision>
4808 template<
unsigned int Precision>
4825 work.setbounds(0,
m);
4829 for(
i=0;
i<=
k-1;
i++)
4836 reflections::generatereflection<Precision>(t, n-
i,
tmp);
4846 reflections::applyreflectionfromtheright<Precision>(a,
tau(
i), t,
i+1,
m-1,
i, n-1,
work);
4872 template<
unsigned int Precision>
4889 if(
m<=0 || n<=0 ||
qrows<=0 )
4899 q.setbounds(0,
qrows-1, 0, n-1);
4904 for(
j=0;
j<=n-1;
j++)
4920 for(
i=
k-1;
i>=0;
i--)
4928 reflections::applyreflectionfromtheright<Precision>(q,
tau(
i),
v, 0,
qrows-1,
i, n-1,
work);
4948 template<
unsigned int Precision>
4962 l.setbounds(0,
m-1, 0, n-1);
4963 for(
i=0;
i<=n-1;
i++)
4967 for(
i=1;
i<=
m-1;
i++)
4971 for(
i=0;
i<=
m-1;
i++)
4983 template<
unsigned int Precision>
5001 work.setbounds(1,
m);
5017 reflections::generatereflection<Precision>(t,
nmip1,
tmp);
5027 reflections::applyreflectionfromtheright<Precision>(a,
tau(
i), t,
i+1,
m,
i, n,
work);
5037 template<
unsigned int Precision>
5055 if(
m==0 || n==0 ||
qrows==0 )
5065 q.setbounds(1,
qrows, 1, n);
5095 reflections::applyreflectionfromtheright<Precision>(q,
tau(
i),
v, 1,
qrows,
i, n,
work);
5103 template<
unsigned int Precision>
5119 q.setbounds(1, n, 1, n);
5120 l.setbounds(1,
m, 1, n);
5188 template<
unsigned int Precision>
5192 template<
unsigned int Precision>
5196 template<
unsigned int Precision>
5201 template<
unsigned int Precision>
5206 template<
unsigned int Precision>
5213 template<
unsigned int Precision>
5224 template<
unsigned int Precision>
5231 template<
unsigned int Precision>
5242 template<
unsigned int Precision>
5257 template<
unsigned int Precision>
5260 template<
unsigned int Precision>
5283 template<
unsigned int Precision>
5313 absxi = amp::abs<Precision>(
x(
ix));
5330 template<
unsigned int Precision>
5341 a = amp::abs<Precision>(
x(
result));
5344 if( amp::abs<Precision>(
x(
i))>amp::abs<Precision>(
x(
result)) )
5353 template<
unsigned int Precision>
5365 a = amp::abs<Precision>(
x(
result,
j));
5368 if( amp::abs<Precision>(
x(
i,
j))>amp::abs<Precision>(
x(
result,
j)) )
5377 template<
unsigned int Precision>
5389 a = amp::abs<Precision>(
x(
i,
result));
5392 if( amp::abs<Precision>(
x(
i,
j))>amp::abs<Precision>(
x(
i,
result)) )
5401 template<
unsigned int Precision>
5435 template<
unsigned int Precision>
5465 template<
unsigned int Precision>
5498 template<
unsigned int Precision>
5528 template<
unsigned int Precision>
5625 template<
unsigned int Precision>
5636 xabs = amp::abs<Precision>(
x);
5637 yabs = amp::abs<Precision>(
y);
5638 w = amp::maximum<Precision>(
xabs,
yabs);
5639 z = amp::minimum<Precision>(
xabs,
yabs);
5646 result =
w*amp::sqrt<Precision>(1+amp::sqr<Precision>(z/
w));
5652 template<
unsigned int Precision>
5898 template<
unsigned int Precision>
5908 template<
unsigned int Precision>
5918 template<
unsigned int Precision>
5951 template<
unsigned int Precision>
5969 if( m1>m2 ||
n1>
n2 )
5985 for(
j=m1;
j<=m2-1;
j++)
6006 for(
j=m1;
j<=m2-1;
j++)
6027 for(
j=m2-1;
j>=m1;
j--)
6048 for(
j=m2-1;
j>=m1;
j--)
6089 template<
unsigned int Precision>
6206 template<
unsigned int Precision>
6235 r = amp::sqrt<Precision>(amp::sqr<Precision>(f1)+amp::sqr<Precision>(
g1));
6238 if( amp::abs<Precision>(
f)>amp::abs<Precision>(
g) &&
cs<0 )
6291 template<
unsigned int Precision>
6303 template<
unsigned int Precision>
6315 template<
unsigned int Precision>
6330 template<
unsigned int Precision>
6333 template<
unsigned int Precision>
6339 template<
unsigned int Precision>
6429 template<
unsigned int Precision>
6448 ap::vmove(
d1.getvector(1, n), d.getvector(0, n-1));
6451 e1.setbounds(1, n-1);
6452 ap::vmove(
e1.getvector(1, n-1), e.getvector(0, n-2));
6454 result =
bidiagonalsvddecompositioninternal<Precision>(
d1,
e1, n,
isupper,
isfractionalaccuracyrequired, u, 0,
nru, c, 0,
ncc,
vt, 0,
ncvt);
6455 ap::vmove(d.getvector(0, n-1),
d1.getvector(1, n));
6472 template<
unsigned int Precision>
6488 result =
bidiagonalsvddecompositioninternal<Precision>(d, e, n,
isupper,
isfractionalaccuracyrequired, u, 1,
nru, c, 1,
ncc,
vt, 1,
ncvt);
6496 template<
unsigned int Precision>
6595 work0.setbounds(1, n-1);
6596 work1.setbounds(1, n-1);
6597 work2.setbounds(1, n-1);
6598 work3.setbounds(1, n-1);
6611 etemp.setbounds(1, n);
6612 for(
i=1;
i<=n-1;
i++)
6617 for(
i=1;
i<=n-1;
i++)
6636 for(
i=1;
i<=n-1;
i++)
6638 rotations::generaterotation<Precision>(d(
i), e(
i),
cs,
sn, r);
6677 smax = amp::maximum<Precision>(
smax, amp::abs<Precision>(d(
i)));
6679 for(
i=1;
i<=n-1;
i++)
6681 smax = amp::maximum<Precision>(
smax, amp::abs<Precision>(e(
i)));
6690 sminoa = amp::abs<Precision>(d(1));
6696 mu = amp::abs<Precision>(d(
i))*(
mu/(
mu+amp::abs<Precision>(e(
i-1))));
6753 if(
tol<0 && amp::abs<Precision>(d(
m))<=
thresh )
6757 smax = amp::abs<Precision>(d(
m));
6763 abss = amp::abs<Precision>(d(
ll));
6764 abse = amp::abs<Precision>(e(
ll));
6871 if( amp::abs<Precision>(d(
ll))>=amp::abs<Precision>(d(
m)) )
6899 if( amp::abs<Precision>(e(
m-1))<=amp::abs<Precision>(
tol)*amp::abs<Precision>(d(
m)) || (
tol<0 && amp::abs<Precision>(e(
m-1))<=
thresh) )
6911 mu = amp::abs<Precision>(d(
ll));
6916 if( amp::abs<Precision>(e(
lll))<=
tol*
mu )
6923 mu = amp::abs<Precision>(d(
lll+1))*(
mu/(
mu+amp::abs<Precision>(e(
lll))));
6939 if( amp::abs<Precision>(e(
ll))<=amp::abs<Precision>(
tol)*amp::abs<Precision>(d(
ll)) || (
tol<0 && amp::abs<Precision>(e(
ll))<=
thresh) )
6951 mu = amp::abs<Precision>(d(
m));
6956 if( amp::abs<Precision>(e(
lll))<=
tol*
mu )
6963 mu = amp::abs<Precision>(d(
lll))*(
mu/(
mu+amp::abs<Precision>(e(
lll))));
6995 sll = amp::abs<Precision>(d(
ll));
7000 sll = amp::abs<Precision>(d(
m));
7009 if( amp::sqr<Precision>(shift/
sll)<
eps )
7037 rotations::generaterotation<Precision>(d(
i)*
cs, e(
i),
cs,
sn, r);
7072 if( amp::abs<Precision>(e(
m-1))<=
thresh )
7088 rotations::generaterotation<Precision>(d(
i)*
cs, e(
i-1),
cs,
sn, r);
7123 if( amp::abs<Precision>(e(
ll))<=
thresh )
7146 rotations::generaterotation<Precision>(
f,
g,
cosr,
sinr, r);
7155 rotations::generaterotation<Precision>(
f,
g,
cosl,
sinl, r);
7190 if( amp::abs<Precision>(e(
m-1))<=
thresh )
7206 rotations::generaterotation<Precision>(
f,
g,
cosr,
sinr, r);
7215 rotations::generaterotation<Precision>(
f,
g,
cosl,
sinl, r);
7234 if( amp::abs<Precision>(e(
ll))<=
thresh )
7286 for(
i=1;
i<=n-1;
i++)
7294 for(
j=2;
j<=n+1-
i;
j++)
7337 template<
unsigned int Precision>
7346 result = amp::abs<Precision>(a);
7350 result = -amp::abs<Precision>(a);
7356 template<
unsigned int Precision>
7374 fa = amp::abs<Precision>(
f);
7375 ga = amp::abs<Precision>(
g);
7376 ha = amp::abs<Precision>(
h);
7377 fhmn = amp::minimum<Precision>(
fa,
ha);
7378 fhmx = amp::maximum<Precision>(
fa,
ha);
7388 ssmax = amp::maximum<Precision>(
fhmx,
ga)*amp::sqrt<Precision>(1+amp::sqr<Precision>(amp::minimum<Precision>(
fhmx,
ga)/amp::maximum<Precision>(
fhmx,
ga)));
7398 c = 2/(amp::sqrt<Precision>(
aas*
aas+
au)+amp::sqrt<Precision>(
at*
at+
au));
7420 c = 1/(amp::sqrt<Precision>(1+amp::sqr<Precision>(
aas*
au))+amp::sqrt<Precision>(1+amp::sqr<Precision>(
at*
au)));
7430 template<
unsigned int Precision>
7469 fa = amp::abs<Precision>(
ft);
7471 ha = amp::abs<Precision>(
h);
7496 ga = amp::abs<Precision>(
gt);
7559 s = amp::sqrt<Precision>(
tt+
mm);
7562 r = amp::abs<Precision>(
m);
7566 r = amp::sqrt<Precision>(
l*
l+
mm);
7588 t = (
m/(
s+t)+
m/(r+
l))*(1+a);
7590 l = amp::sqrt<Precision>(t*t+4);
7687 template<
unsigned int Precision>
7697 template<
unsigned int Precision>
7759 template<
unsigned int Precision>
7809 u.setbounds(0,
nru-1, 0,
ncu-1);
7815 u.setbounds(0,
nru-1, 0,
ncu-1);
7844 qr::rmatrixqr<Precision>(a,
m, n,
tau);
7845 for(
i=0;
i<=n-1;
i++)
7847 for(
j=0;
j<=
i-1;
j++)
7852 bidiagonal::rmatrixbd<Precision>(a, n, n,
tauq,
taup);
7853 bidiagonal::rmatrixbdunpackpt<Precision>(a, n, n,
taup,
nrvt,
vt);
7854 bidiagonal::rmatrixbdunpackdiagonals<Precision>(a, n, n,
isupper,
w, e);
7855 result = bdsvd::rmatrixbdsvd<Precision>(
w, e, n,
isupper,
false, u, 0, a, 0,
vt,
ncvt);
7864 qr::rmatrixqr<Precision>(a,
m, n,
tau);
7865 qr::rmatrixqrunpackq<Precision>(a,
m, n,
tau,
ncu, u);
7866 for(
i=0;
i<=n-1;
i++)
7868 for(
j=0;
j<=
i-1;
j++)
7873 bidiagonal::rmatrixbd<Precision>(a, n, n,
tauq,
taup);
7874 bidiagonal::rmatrixbdunpackpt<Precision>(a, n, n,
taup,
nrvt,
vt);
7875 bidiagonal::rmatrixbdunpackdiagonals<Precision>(a, n, n,
isupper,
w, e);
7882 bidiagonal::rmatrixbdmultiplybyq<Precision>(a, n, n,
tauq, u,
m, n,
true,
false);
7883 result = bdsvd::rmatrixbdsvd<Precision>(
w, e, n,
isupper,
false, u,
m, a, 0,
vt,
ncvt);
7892 bidiagonal::rmatrixbdunpackq<Precision>(a, n, n,
tauq, n, t2);
7893 blas::copymatrix<Precision>(u, 0,
m-1, 0, n-1, a, 0,
m-1, 0, n-1);
7894 blas::inplacetranspose<Precision>(t2, 0, n-1, 0, n-1,
work);
7895 result = bdsvd::rmatrixbdsvd<Precision>(
w, e, n,
isupper,
false, u, 0, t2, n,
vt,
ncvt);
7896 blas::matrixmatrixmultiply<Precision>(a, 0,
m-1, 0, n-1,
false, t2, 0, n-1, 0, n-1,
true,
amp::ampf<Precision>(
"1.0"), u, 0,
m-1, 0, n-1,
amp::ampf<Precision>(
"0.0"),
work);
7914 lq::rmatrixlq<Precision>(a,
m, n,
tau);
7915 for(
i=0;
i<=
m-1;
i++)
7917 for(
j=
i+1;
j<=
m-1;
j++)
7922 bidiagonal::rmatrixbd<Precision>(a,
m,
m,
tauq,
taup);
7923 bidiagonal::rmatrixbdunpackq<Precision>(a,
m,
m,
tauq,
ncu, u);
7924 bidiagonal::rmatrixbdunpackdiagonals<Precision>(a,
m,
m,
isupper,
w, e);
7925 work.setbounds(1,
m);
7926 blas::inplacetranspose<Precision>(u, 0,
nru-1, 0,
ncu-1,
work);
7927 result = bdsvd::rmatrixbdsvd<Precision>(
w, e,
m,
isupper,
false, a, 0, u,
nru,
vt, 0);
7928 blas::inplacetranspose<Precision>(u, 0,
nru-1, 0,
ncu-1,
work);
7937 lq::rmatrixlq<Precision>(a,
m, n,
tau);
7938 lq::rmatrixlqunpackq<Precision>(a,
m, n,
tau,
nrvt,
vt);
7939 for(
i=0;
i<=
m-1;
i++)
7941 for(
j=
i+1;
j<=
m-1;
j++)
7946 bidiagonal::rmatrixbd<Precision>(a,
m,
m,
tauq,
taup);
7947 bidiagonal::rmatrixbdunpackq<Precision>(a,
m,
m,
tauq,
ncu, u);
7948 bidiagonal::rmatrixbdunpackdiagonals<Precision>(a,
m,
m,
isupper,
w, e);
7950 blas::inplacetranspose<Precision>(u, 0,
nru-1, 0,
ncu-1,
work);
7957 bidiagonal::rmatrixbdmultiplybyp<Precision>(a,
m,
m,
taup,
vt,
m, n,
false,
true);
7958 result = bdsvd::rmatrixbdsvd<Precision>(
w, e,
m,
isupper,
false, a, 0, u,
nru,
vt, n);
7966 bidiagonal::rmatrixbdunpackpt<Precision>(a,
m,
m,
taup,
m, t2);
7967 result = bdsvd::rmatrixbdsvd<Precision>(
w, e,
m,
isupper,
false, a, 0, u,
nru, t2,
m);
7968 blas::copymatrix<Precision>(
vt, 0,
m-1, 0, n-1, a, 0,
m-1, 0, n-1);
7969 blas::matrixmatrixmultiply<Precision>(t2, 0,
m-1, 0,
m-1,
false, a, 0,
m-1, 0, n-1,
false,
amp::ampf<Precision>(
"1.0"),
vt, 0,
m-1, 0, n-1,
amp::ampf<Precision>(
"0.0"),
work);
7971 blas::inplacetranspose<Precision>(u, 0,
nru-1, 0,
ncu-1,
work);
7982 bidiagonal::rmatrixbd<Precision>(a,
m, n,
tauq,
taup);
7983 bidiagonal::rmatrixbdunpackq<Precision>(a,
m, n,
tauq,
ncu, u);
7984 bidiagonal::rmatrixbdunpackpt<Precision>(a,
m, n,
taup,
nrvt,
vt);
7985 bidiagonal::rmatrixbdunpackdiagonals<Precision>(a,
m, n,
isupper,
w, e);
7986 work.setbounds(1,
m);
7987 blas::inplacetranspose<Precision>(u, 0,
nru-1, 0,
ncu-1,
work);
7988 result = bdsvd::rmatrixbdsvd<Precision>(
w, e,
minmn,
isupper,
false, a, 0, u,
nru,
vt,
ncvt);
7989 blas::inplacetranspose<Precision>(u, 0,
nru-1, 0,
ncu-1,
work);
7996 bidiagonal::rmatrixbd<Precision>(a,
m, n,
tauq,
taup);
7997 bidiagonal::rmatrixbdunpackq<Precision>(a,
m, n,
tauq,
ncu, u);
7998 bidiagonal::rmatrixbdunpackpt<Precision>(a,
m, n,
taup,
nrvt,
vt);
7999 bidiagonal::rmatrixbdunpackdiagonals<Precision>(a,
m, n,
isupper,
w, e);
8006 result = bdsvd::rmatrixbdsvd<Precision>(
w, e,
minmn,
isupper,
false, u,
nru, a, 0,
vt,
ncvt);
8015 blas::copyandtranspose<Precision>(u, 0,
m-1, 0,
minmn-1, t2, 0,
minmn-1, 0,
m-1);
8016 result = bdsvd::rmatrixbdsvd<Precision>(
w, e,
minmn,
isupper,
false, u, 0, t2,
m,
vt,
ncvt);
8017 blas::copyandtranspose<Precision>(t2, 0,
minmn-1, 0,
m-1, u, 0,
m-1, 0,
minmn-1);
8027 template<
unsigned int Precision>
8077 u.setbounds(1,
nru, 1,
ncu);
8083 u.setbounds(1,
nru, 1,
ncu);
8112 qr::qrdecomposition<Precision>(a,
m, n,
tau);
8115 for(
j=1;
j<=
i-1;
j++)
8120 bidiagonal::tobidiagonal<Precision>(a, n, n,
tauq,
taup);
8121 bidiagonal::unpackptfrombidiagonal<Precision>(a, n, n,
taup,
nrvt,
vt);
8122 bidiagonal::unpackdiagonalsfrombidiagonal<Precision>(a, n, n,
isupper,
w, e);
8123 result = bdsvd::bidiagonalsvddecomposition<Precision>(
w, e, n,
isupper,
false, u, 0, a, 0,
vt,
ncvt);
8132 qr::qrdecomposition<Precision>(a,
m, n,
tau);
8133 qr::unpackqfromqr<Precision>(a,
m, n,
tau,
ncu, u);
8136 for(
j=1;
j<=
i-1;
j++)
8141 bidiagonal::tobidiagonal<Precision>(a, n, n,
tauq,
taup);
8142 bidiagonal::unpackptfrombidiagonal<Precision>(a, n, n,
taup,
nrvt,
vt);
8143 bidiagonal::unpackdiagonalsfrombidiagonal<Precision>(a, n, n,
isupper,
w, e);
8150 bidiagonal::multiplybyqfrombidiagonal<Precision>(a, n, n,
tauq, u,
m, n,
true,
false);
8151 result = bdsvd::bidiagonalsvddecomposition<Precision>(
w, e, n,
isupper,
false, u,
m, a, 0,
vt,
ncvt);
8160 bidiagonal::unpackqfrombidiagonal<Precision>(a, n, n,
tauq, n, t2);
8161 blas::copymatrix<Precision>(u, 1,
m, 1, n, a, 1,
m, 1, n);
8162 blas::inplacetranspose<Precision>(t2, 1, n, 1, n,
work);
8163 result = bdsvd::bidiagonalsvddecomposition<Precision>(
w, e, n,
isupper,
false, u, 0, t2, n,
vt,
ncvt);
8164 blas::matrixmatrixmultiply<Precision>(a, 1,
m, 1, n,
false, t2, 1, n, 1, n,
true,
amp::ampf<Precision>(
"1.0"), u, 1,
m, 1, n,
amp::ampf<Precision>(
"0.0"),
work);
8182 lq::lqdecomposition<Precision>(a,
m, n,
tau);
8183 for(
i=1;
i<=
m-1;
i++)
8185 for(
j=
i+1;
j<=
m;
j++)
8190 bidiagonal::tobidiagonal<Precision>(a,
m,
m,
tauq,
taup);
8191 bidiagonal::unpackqfrombidiagonal<Precision>(a,
m,
m,
tauq,
ncu, u);
8192 bidiagonal::unpackdiagonalsfrombidiagonal<Precision>(a,
m,
m,
isupper,
w, e);
8193 work.setbounds(1,
m);
8194 blas::inplacetranspose<Precision>(u, 1,
nru, 1,
ncu,
work);
8195 result = bdsvd::bidiagonalsvddecomposition<Precision>(
w, e,
m,
isupper,
false, a, 0, u,
nru,
vt, 0);
8196 blas::inplacetranspose<Precision>(u, 1,
nru, 1,
ncu,
work);
8205 lq::lqdecomposition<Precision>(a,
m, n,
tau);
8206 lq::unpackqfromlq<Precision>(a,
m, n,
tau,
nrvt,
vt);
8207 for(
i=1;
i<=
m-1;
i++)
8209 for(
j=
i+1;
j<=
m;
j++)
8214 bidiagonal::tobidiagonal<Precision>(a,
m,
m,
tauq,
taup);
8215 bidiagonal::unpackqfrombidiagonal<Precision>(a,
m,
m,
tauq,
ncu, u);
8216 bidiagonal::unpackdiagonalsfrombidiagonal<Precision>(a,
m,
m,
isupper,
w, e);
8218 blas::inplacetranspose<Precision>(u, 1,
nru, 1,
ncu,
work);
8225 bidiagonal::multiplybypfrombidiagonal<Precision>(a,
m,
m,
taup,
vt,
m, n,
false,
true);
8226 result = bdsvd::bidiagonalsvddecomposition<Precision>(
w, e,
m,
isupper,
false, a, 0, u,
nru,
vt, n);
8234 bidiagonal::unpackptfrombidiagonal<Precision>(a,
m,
m,
taup,
m, t2);
8235 result = bdsvd::bidiagonalsvddecomposition<Precision>(
w, e,
m,
isupper,
false, a, 0, u,
nru, t2,
m);
8236 blas::copymatrix<Precision>(
vt, 1,
m, 1, n, a, 1,
m, 1, n);
8237 blas::matrixmatrixmultiply<Precision>(t2, 1,
m, 1,
m,
false, a, 1,
m, 1, n,
false,
amp::ampf<Precision>(
"1.0"),
vt, 1,
m, 1, n,
amp::ampf<Precision>(
"0.0"),
work);
8239 blas::inplacetranspose<Precision>(u, 1,
nru, 1,
ncu,
work);
8250 bidiagonal::tobidiagonal<Precision>(a,
m, n,
tauq,
taup);
8251 bidiagonal::unpackqfrombidiagonal<Precision>(a,
m, n,
tauq,
ncu, u);
8252 bidiagonal::unpackptfrombidiagonal<Precision>(a,
m, n,
taup,
nrvt,
vt);
8253 bidiagonal::unpackdiagonalsfrombidiagonal<Precision>(a,
m, n,
isupper,
w, e);
8254 work.setbounds(1,
m);
8255 blas::inplacetranspose<Precision>(u, 1,
nru, 1,
ncu,
work);
8256 result = bdsvd::bidiagonalsvddecomposition<Precision>(
w, e,
minmn,
isupper,
false, a, 0, u,
nru,
vt,
ncvt);
8257 blas::inplacetranspose<Precision>(u, 1,
nru, 1,
ncu,
work);
8264 bidiagonal::tobidiagonal<Precision>(a,
m, n,
tauq,
taup);
8265 bidiagonal::unpackqfrombidiagonal<Precision>(a,
m, n,
tauq,
ncu, u);
8266 bidiagonal::unpackptfrombidiagonal<Precision>(a,
m, n,
taup,
nrvt,
vt);
8267 bidiagonal::unpackdiagonalsfrombidiagonal<Precision>(a,
m, n,
isupper,
w, e);
8274 result = bdsvd::bidiagonalsvddecomposition<Precision>(
w, e,
minmn,
isupper,
false, u,
nru, a, 0,
vt,
ncvt);
8283 blas::copyandtranspose<Precision>(u, 1,
m, 1,
minmn, t2, 1,
minmn, 1,
m);
8284 result = bdsvd::bidiagonalsvddecomposition<Precision>(
w, e,
minmn,
isupper,
false, u, 0, t2,
m,
vt,
ncvt);
8285 blas::copyandtranspose<Precision>(t2, 1,
minmn, 1,
m, u, 1,
m, 1,
minmn);
#define __AMP_BINARY_OPF(type)
#define __AMP_BINARY_OPI(type)
void tau(int **points, int sizePoints, int k)
ampf & operator/=(const T &v)
ampf & operator-=(const T &v)
static const ampf getAlgoPascalEpsilon()
static const ampf getMaxNumber()
void InitializeAsSLong(signed long v)
void InitializeAsULong(unsigned long v)
static const ampf getAlgoPascalMaxNumber()
static const ampf getUlp256()
bool isNegativeNumber() const
void InitializeAsDouble(long double v)
static const ampf getAlgoPascalMinNumber()
static const ampf getMinNumber()
static const ampf getUlp()
ampf & operator+=(const T &v)
static const ampf getAlgoPascalMaxNumber()
static const ampf getRandom()
bool isPositiveNumber() const
void InitializeAsString(const char *s)
static const ampf getUlp512()
mpfr_srcptr getReadPtr() const
static const ampf getUlp512()
static const ampf getRandom()
static const ampf getAlgoPascalEpsilon()
ampf & operator=(long double v)
static const ampf getUlpOf(const ampf &x)
static const ampf getUlp()
std::string toHex() const
ampf & operator*=(const T &v)
static const ampf getMinNumber()
bool isFiniteNumber() const
ampf(const ampf< Precision2 > &r)
std::string toDec() const
ampf(const std::string &s)
static const ampf getMaxNumber()
static const ampf getUlp256()
static const ampf getAlgoPascalMinNumber()
campf & operator=(long double v)
campf(const ampf< Precision > &_x)
campf(const ampf< Precision > &_x, const ampf< Precision > &_y)
campf(const campf< Prec2 > &z)
void initialize(int Precision)
mpfr_reference(const mpfr_reference &r)
mpfr_reference & operator=(const mpfr_reference &r)
mpfr_srcptr getReadPtr() const
static gmp_randstate_t * getRandState()
static gmp_randstate_t * getRandState()
static void deleteMpfr(mpfr_record *ref)
static mpfr_record * newMpfr(unsigned int Precision)
static void deleteMpfr(mpfr_record *ref)
static mpfr_record_ptr & getList(unsigned int Precision)
static mpfr_record * newMpfr(unsigned int Precision)
static void make_assertion(bool bClause)
complex & operator+=(const double &v)
complex & operator+=(const complex &z)
complex(const double &_x)
complex & operator-=(const complex &z)
complex & operator=(const double &v)
complex & operator-=(const double &v)
complex & operator*=(const complex &z)
complex & operator*=(const double &v)
complex & operator/=(const double &v)
complex & operator/=(const complex &z)
complex(const double &_x, const double &_y)
complex(const complex &z)
const T * GetData() const
const_raw_vector(const T *Data, int Length, int Step)
raw_vector(T *Data, int Length, int Step)
raw_vector< T > getvector(int iStart, int iEnd)
int gethighbound(int iBoundNum=0) const
bool wrongIdx(int i) const
const_raw_vector< T > getvector(int iStart, int iEnd) const
const T & operator()(int i) const
int getlowbound(int iBoundNum=0) const
void setcontent(int iLow, int iHigh, const T *pContent)
template_1d_array(const template_1d_array &rhs)
void setbounds(int iLow, int iHigh)
const template_1d_array & operator=(const template_1d_array &rhs)
const T * getcontent() const
void setcontent(int iLow1, int iHigh1, int iLow2, int iHigh2, const T *pContent)
template_2d_array(const template_2d_array &rhs)
const T & operator()(int i1, int i2) const
void setbounds(int iLow1, int iHigh1, int iLow2, int iHigh2)
bool wrongRow(int i) const
bool wrongColumn(int j) const
const T * getcontent() const
int getlowbound(int iBoundNum) const
const_raw_vector< T > getcolumn(int iColumn, int iRowStart, int iRowEnd) const
const template_2d_array & operator=(const template_2d_array &rhs)
raw_vector< T > getrow(int iRow, int iColumnStart, int iColumnEnd)
raw_vector< T > getcolumn(int iColumn, int iRowStart, int iRowEnd)
int gethighbound(int iBoundNum) const
const_raw_vector< T > getrow(int iRow, int iColumnStart, int iColumnEnd) const
T & operator()(int i1, int i2)
static BOOLEAN fa(leftv res, leftv args)
const CanonicalForm int s
const CanonicalForm int const CFList const Variable & y
const Variable & v
< [in] a sqrfree bivariate poly
void WerrorS(const char *s)
static matrix mu(matrix A, const ring R)
campf< Precision > & operator-=(campf< Precision > &lhs, const campf< Precision > &rhs)
campf< Precision > & operator*=(campf< Precision > &lhs, const campf< Precision > &rhs)
const ampf< Precision > abs(const ampf< Precision > &x)
const ampf< Precision > cos(const ampf< Precision > &x)
const ampf< Precision > halfpi()
campf< Precision > & operator/=(campf< Precision > &lhs, const campf< Precision > &rhs)
const signed long floor(const ampf< Precision > &x)
const bool operator>(const ampf< Precision > &op1, const ampf< Precision > &op2)
const ampf< Precision > operator-(const ampf< Precision > &op1)
void vAdd(ap::raw_vector< ampf< Precision > > vDst, ap::const_raw_vector< ampf< Precision > > vSrc)
const signed long ceil(const ampf< Precision > &x)
const ampf< Precision > abscomplex(const campf< Precision > &z)
const ampf< Precision > operator/(const ampf< Precision > &op1, const ampf< Precision > &op2)
const ampf< Precision > cosh(const ampf< Precision > &x)
const ampf< Precision > ldexp2(const ampf< Precision > &x, mp_exp_t exponent)
const ampf< Precision > maximum(const ampf< Precision > &x, const ampf< Precision > &y)
const ampf< Precision > exp(const ampf< Precision > &x)
const ampf< Precision > sqrt(const ampf< Precision > &x)
const campf< Precision > conj(const campf< Precision > &z)
const ampf< Precision > twopi()
const bool operator>=(const ampf< Precision > &op1, const ampf< Precision > &op2)
void vMoveNeg(ap::raw_vector< ampf< Precision > > vDst, ap::const_raw_vector< ampf< Precision > > vSrc)
const ampf< Precision > atan2(const ampf< Precision > &y, const ampf< Precision > &x)
const campf< Precision > csqr(const campf< Precision > &z)
const ampf< Precision > log2(const ampf< Precision > &x)
const bool operator<=(const ampf< Precision > &op1, const ampf< Precision > &op2)
const ampf< Precision > operator+(const ampf< Precision > &op1)
const bool operator!=(const ampf< Precision > &op1, const ampf< Precision > &op2)
void vMove(ap::raw_vector< ampf< Precision > > vDst, ap::const_raw_vector< ampf< Precision > > vSrc)
const ampf< Precision > log10(const ampf< Precision > &x)
const ampf< Precision > asin(const ampf< Precision > &x)
const bool operator<(const ampf< Precision > &op1, const ampf< Precision > &op2)
const ampf< Precision > pow(const ampf< Precision > &x, const ampf< Precision > &y)
campf< Precision > & operator+=(campf< Precision > &lhs, const campf< Precision > &rhs)
const ampf< Precision > tanh(const ampf< Precision > &x)
const ampf< Precision > frexp2(const ampf< Precision > &x, mp_exp_t *exponent)
void vSub(ap::raw_vector< ampf< Precision > > vDst, ap::const_raw_vector< ampf< Precision > > vSrc)
const ampf< Precision > atan(const ampf< Precision > &x)
void vMul(ap::raw_vector< ampf< Precision > > vDst, T2 alpha)
const int sign(const ampf< Precision > &x)
const ampf< Precision > sin(const ampf< Precision > &x)
mpfr_record * mpfr_record_ptr
const ampf< Precision > sqr(const ampf< Precision > &x)
const ampf< Precision > minimum(const ampf< Precision > &x, const ampf< Precision > &y)
const ampf< Precision > sinh(const ampf< Precision > &x)
const ampf< Precision > operator*(const ampf< Precision > &op1, const ampf< Precision > &op2)
const signed long trunc(const ampf< Precision > &x)
const ampf< Precision > frac(const ampf< Precision > &x)
const bool operator==(const ampf< Precision > &op1, const ampf< Precision > &op2)
const ampf< Precision > acos(const ampf< Precision > &x)
const ampf< Precision > tan(const ampf< Precision > &x)
const signed long round(const ampf< Precision > &x)
const ampf< Precision > log(const ampf< Precision > &x)
int maxint(int m1, int m2)
template_2d_array< double > real_2d_array
template_1d_array< bool > boolean_1d_array
template_2d_array< bool > boolean_2d_array
const complex operator*(const complex &lhs, const complex &rhs)
const complex csqr(const complex &z)
T vdotproduct(const_raw_vector< T > v1, const_raw_vector< T > v2)
const double machineepsilon
void vmove(raw_vector< T > vdst, const_raw_vector< T > vsrc)
template_2d_array< int > integer_2d_array
const double minrealnumber
template_2d_array< complex > complex_2d_array
void vmoveneg(raw_vector< T > vdst, const_raw_vector< T > vsrc)
void vadd(raw_vector< T > vdst, const_raw_vector< T > vsrc)
int randominteger(int maxv)
double maxreal(double m1, double m2)
const double abscomplex(const complex &z)
template_1d_array< complex > complex_1d_array
const bool operator!=(const complex &lhs, const complex &rhs)
double minreal(double m1, double m2)
int minint(int m1, int m2)
void vmul(raw_vector< T > vdst, T2 alpha)
void vsub(raw_vector< T > vdst, const_raw_vector< T > vsrc)
const complex conj(const complex &z)
const complex operator+(const complex &lhs)
const complex operator/(const complex &lhs, const complex &rhs)
template_1d_array< int > integer_1d_array
const double maxrealnumber
const bool operator==(const complex &lhs, const complex &rhs)
const complex operator-(const complex &lhs)
template_1d_array< double > real_1d_array
bool bidiagonalsvddecomposition(ap::template_1d_array< amp::ampf< Precision > > &d, ap::template_1d_array< amp::ampf< Precision > > e, int n, bool isupper, bool isfractionalaccuracyrequired, ap::template_2d_array< amp::ampf< Precision > > &u, int nru, ap::template_2d_array< amp::ampf< Precision > > &c, int ncc, ap::template_2d_array< amp::ampf< Precision > > &vt, int ncvt)
amp::ampf< Precision > extsignbdsqr(amp::ampf< Precision > a, amp::ampf< Precision > b)
bool bidiagonalsvddecompositioninternal(ap::template_1d_array< amp::ampf< Precision > > &d, ap::template_1d_array< amp::ampf< Precision > > e, int n, bool isupper, bool isfractionalaccuracyrequired, ap::template_2d_array< amp::ampf< Precision > > &u, int ustart, int nru, ap::template_2d_array< amp::ampf< Precision > > &c, int cstart, int ncc, ap::template_2d_array< amp::ampf< Precision > > &vt, int vstart, int ncvt)
bool rmatrixbdsvd(ap::template_1d_array< amp::ampf< Precision > > &d, ap::template_1d_array< amp::ampf< Precision > > e, int n, bool isupper, bool isfractionalaccuracyrequired, ap::template_2d_array< amp::ampf< Precision > > &u, int nru, ap::template_2d_array< amp::ampf< Precision > > &c, int ncc, ap::template_2d_array< amp::ampf< Precision > > &vt, int ncvt)
void svdv2x2(amp::ampf< Precision > f, amp::ampf< Precision > g, amp::ampf< Precision > h, amp::ampf< Precision > &ssmin, amp::ampf< Precision > &ssmax, amp::ampf< Precision > &snr, amp::ampf< Precision > &csr, amp::ampf< Precision > &snl, amp::ampf< Precision > &csl)
void svd2x2(amp::ampf< Precision > f, amp::ampf< Precision > g, amp::ampf< Precision > h, amp::ampf< Precision > &ssmin, amp::ampf< Precision > &ssmax)
void unpackptfrombidiagonal(const ap::template_2d_array< amp::ampf< Precision > > &qp, int m, int n, const ap::template_1d_array< amp::ampf< Precision > > &taup, int ptrows, ap::template_2d_array< amp::ampf< Precision > > &pt)
void multiplybyqfrombidiagonal(const ap::template_2d_array< amp::ampf< Precision > > &qp, int m, int n, const ap::template_1d_array< amp::ampf< Precision > > &tauq, ap::template_2d_array< amp::ampf< Precision > > &z, int zrows, int zcolumns, bool fromtheright, bool dotranspose)
void rmatrixbdunpackpt(const ap::template_2d_array< amp::ampf< Precision > > &qp, int m, int n, const ap::template_1d_array< amp::ampf< Precision > > &taup, int ptrows, ap::template_2d_array< amp::ampf< Precision > > &pt)
void unpackqfrombidiagonal(const ap::template_2d_array< amp::ampf< Precision > > &qp, int m, int n, const ap::template_1d_array< amp::ampf< Precision > > &tauq, int qcolumns, ap::template_2d_array< amp::ampf< Precision > > &q)
void rmatrixbdunpackq(const ap::template_2d_array< amp::ampf< Precision > > &qp, int m, int n, const ap::template_1d_array< amp::ampf< Precision > > &tauq, int qcolumns, ap::template_2d_array< amp::ampf< Precision > > &q)
void rmatrixbdmultiplybyq(const ap::template_2d_array< amp::ampf< Precision > > &qp, int m, int n, const ap::template_1d_array< amp::ampf< Precision > > &tauq, ap::template_2d_array< amp::ampf< Precision > > &z, int zrows, int zcolumns, bool fromtheright, bool dotranspose)
void unpackdiagonalsfrombidiagonal(const ap::template_2d_array< amp::ampf< Precision > > &b, int m, int n, bool &isupper, ap::template_1d_array< amp::ampf< Precision > > &d, ap::template_1d_array< amp::ampf< Precision > > &e)
void rmatrixbdunpackdiagonals(const ap::template_2d_array< amp::ampf< Precision > > &b, int m, int n, bool &isupper, ap::template_1d_array< amp::ampf< Precision > > &d, ap::template_1d_array< amp::ampf< Precision > > &e)
void tobidiagonal(ap::template_2d_array< amp::ampf< Precision > > &a, int m, int n, ap::template_1d_array< amp::ampf< Precision > > &tauq, ap::template_1d_array< amp::ampf< Precision > > &taup)
void rmatrixbd(ap::template_2d_array< amp::ampf< Precision > > &a, int m, int n, ap::template_1d_array< amp::ampf< Precision > > &tauq, ap::template_1d_array< amp::ampf< Precision > > &taup)
void rmatrixbdmultiplybyp(const ap::template_2d_array< amp::ampf< Precision > > &qp, int m, int n, const ap::template_1d_array< amp::ampf< Precision > > &taup, ap::template_2d_array< amp::ampf< Precision > > &z, int zrows, int zcolumns, bool fromtheright, bool dotranspose)
void multiplybypfrombidiagonal(const ap::template_2d_array< amp::ampf< Precision > > &qp, int m, int n, const ap::template_1d_array< amp::ampf< Precision > > &taup, ap::template_2d_array< amp::ampf< Precision > > &z, int zrows, int zcolumns, bool fromtheright, bool dotranspose)
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)
void rmatrixlq(ap::template_2d_array< amp::ampf< Precision > > &a, int m, int n, ap::template_1d_array< amp::ampf< Precision > > &tau)
void rmatrixlqunpackl(const ap::template_2d_array< amp::ampf< Precision > > &a, int m, int n, ap::template_2d_array< amp::ampf< Precision > > &l)
void lqdecomposition(ap::template_2d_array< amp::ampf< Precision > > &a, int m, int n, ap::template_1d_array< amp::ampf< Precision > > &tau)
void rmatrixlqunpackq(const ap::template_2d_array< amp::ampf< Precision > > &a, int m, int n, const ap::template_1d_array< amp::ampf< Precision > > &tau, int qrows, ap::template_2d_array< amp::ampf< Precision > > &q)
void unpackqfromlq(const ap::template_2d_array< amp::ampf< Precision > > &a, int m, int n, const ap::template_1d_array< amp::ampf< Precision > > &tau, int qrows, ap::template_2d_array< amp::ampf< Precision > > &q)
void lqdecompositionunpacked(ap::template_2d_array< amp::ampf< Precision > > a, int m, int n, ap::template_2d_array< amp::ampf< Precision > > &l, ap::template_2d_array< amp::ampf< Precision > > &q)
void rmatrixqr(ap::template_2d_array< amp::ampf< Precision > > &a, int m, int n, ap::template_1d_array< amp::ampf< Precision > > &tau)
void rmatrixqrunpackq(const ap::template_2d_array< amp::ampf< Precision > > &a, int m, int n, const ap::template_1d_array< amp::ampf< Precision > > &tau, int qcolumns, ap::template_2d_array< amp::ampf< Precision > > &q)
void qrdecomposition(ap::template_2d_array< amp::ampf< Precision > > &a, int m, int n, ap::template_1d_array< amp::ampf< Precision > > &tau)
void unpackqfromqr(const ap::template_2d_array< amp::ampf< Precision > > &a, int m, int n, const ap::template_1d_array< amp::ampf< Precision > > &tau, int qcolumns, ap::template_2d_array< amp::ampf< Precision > > &q)
void rmatrixqrunpackr(const ap::template_2d_array< amp::ampf< Precision > > &a, int m, int n, ap::template_2d_array< amp::ampf< Precision > > &r)
void qrdecompositionunpacked(ap::template_2d_array< amp::ampf< Precision > > a, int m, int n, ap::template_2d_array< amp::ampf< Precision > > &q, ap::template_2d_array< amp::ampf< Precision > > &r)
void generatereflection(ap::template_1d_array< amp::ampf< Precision > > &x, int n, amp::ampf< Precision > &tau)
void applyreflectionfromtheright(ap::template_2d_array< amp::ampf< Precision > > &c, amp::ampf< Precision > tau, const ap::template_1d_array< amp::ampf< Precision > > &v, int m1, int m2, int n1, int n2, ap::template_1d_array< amp::ampf< Precision > > &work)
void applyreflectionfromtheleft(ap::template_2d_array< amp::ampf< Precision > > &c, amp::ampf< Precision > tau, const ap::template_1d_array< amp::ampf< Precision > > &v, int m1, int m2, int n1, int n2, ap::template_1d_array< amp::ampf< Precision > > &work)
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)
bool rmatrixsvd(ap::template_2d_array< amp::ampf< Precision > > a, int m, int n, int uneeded, int vtneeded, int additionalmemory, ap::template_1d_array< amp::ampf< Precision > > &w, ap::template_2d_array< amp::ampf< Precision > > &u, ap::template_2d_array< amp::ampf< Precision > > &vt)
bool svddecomposition(ap::template_2d_array< amp::ampf< Precision > > a, int m, int n, int uneeded, int vtneeded, int additionalmemory, ap::template_1d_array< amp::ampf< Precision > > &w, ap::template_2d_array< amp::ampf< Precision > > &u, ap::template_2d_array< amp::ampf< Precision > > &vt)