30 const unsigned int Precision=300;
34 ap::template_2d_array< amp::ampf<Precision> >
a;
45 amp::ampf<Precision> materr;
46 amp::ampf<Precision> orterr;
47 amp::ampf<Precision> othererr;
48 amp::ampf<Precision> threshold;
49 amp::ampf<Precision> failthreshold;
50 amp::ampf<Precision> failr;
60 threshold = 5*100*amp::ampf<Precision>::getAlgoPascalEpsilon();
61 failthreshold = amp::ampf<Precision>(
"5.0E-3");
62 a.setbounds(1, max_i, 1, max_j);
68 for(i=1; i<=max_i; i++)
70 for(j=1; j<=max_j; j++)
73 Print(
" to svd:%d,%d=%s\n",i,j,str);
74 a(i,j) = amp::ampf<Precision>(str);
78 ap::template_2d_array< amp::ampf<Precision> > u;
79 ap::template_2d_array< amp::ampf<Precision> > vt;
80 ap::template_1d_array< amp::ampf<Precision> >
w;
81 svd::svddecomposition<Precision>(
a, max_i, max_j, 2, 2, 2,
w, u, vt);
83 Mu=
mpNew(max_i,max_i);
84 Mw=
mpNew(max_i,max_j);
85 Mvt=
mpNew(max_j,max_j);
94 for(i=1;i<=
si_min(max_i,max_j);i++)
101 for(j=1;j<=max_j;j++)
112 L->
m[0].
data=(
char*)Mu;
113 L->
m[1].
data=(
char*)Mw;
114 L->
m[2].
data=(
char*)Mvt;
static int si_min(const int a, const int b)
const CanonicalForm CFMap CFMap int &both_non_zero int n
INLINE_THIS void Init(int l=0)
matrix mpNew(int r, int c)
create a r x c zero-matrix
std::string toString(const gfan::ZCone *const c)
#define MATELEM(mat, i, j)