Changeset 35715c in git
- Timestamp:
- Dec 1, 2010, 5:01:09 PM (13 years ago)
- Branches:
- (u'spielwiese', '0d6b7fcd9813a1ca1ed4220cfa2b104b97a0a003')
- Children:
- 47b559d8a480780a6380da801528adb53dca1000
- Parents:
- af71455603162123e6412ac27852bb08ea8f5126
- Location:
- kernel
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/linearAlgebra.cc
raf7145 r35715c 861 861 } 862 862 nDelete(&denominator); 863 /* 864 // inspect the following for inaccuracies in the computation; 865 // norm of u should be 2 by construction 866 poly o = NULL; 867 for (int j = 1; j <= rr; j++) 868 o = pAdd(o, ppMult_qq(MATELEM(uVec, j, 1), MATELEM(uVec, j, 1))); 869 printf("norm of u = %s\n", pString(o)); 870 printMatrix(vVec); printMatrix(uVec); 871 pDelete(&o); 872 */ 863 873 864 /* finished building vector u; now turn to pMat */ 874 865 pMat = mpNew(rr, rr); … … 1272 1263 } 1273 1264 1265 /* This codes makes no assumption about the monomial ordering in the current 1266 base ring. */ 1274 1267 void henselFactors(const poly h, const poly f0, const poly g0, const int d, 1275 1268 poly &f, poly &g) 1276 1269 { 1277 f = NULL; 1278 g = NULL; 1279 } 1280 1270 int n = (int)pDeg(f0); 1271 int m = (int)pDeg(g0); 1272 matrix fMat = mpNew(n, d + 1); /* fMat[i, j] is the coefficient of 1273 x^(j-1) * y^(i-1) in f */ 1274 matrix gMat = mpNew(m, d + 1); /* gMat[i, j] is the coefficient of 1275 x^(j-1) * y^(i-1) in g */ 1276 1277 f = pOne(); pSetExp(f, 2, n); pSetm(f); // initialization: f = y^n 1278 g = pOne(); pSetExp(g, 2, m); pSetm(g); // initialization: g = y^m 1279 1280 /* initial step: read off coefficients of f0 and g0 */ 1281 poly l = pAdd(pCopy(f0), pNeg(pCopy(f))); // l = f0 - f = f0 - y^n 1282 while (l != NULL) 1283 { 1284 int e = pGetExp(l, 2); 1285 number c = pGetCoeff(l); 1286 poly matEntry = pOne(); pSetCoeff(matEntry, nCopy(c)); 1287 MATELEM(fMat, e + 1, 1) = matEntry; 1288 l = pNext(l); 1289 } 1290 l = pAdd(pCopy(g0), pNeg(pCopy(g))); // l = g0 - g = g0 - y^m 1291 while (l != NULL) 1292 { 1293 int e = pGetExp(l, 2); 1294 number c = pGetCoeff(l); 1295 poly matEntry = pOne(); pSetCoeff(matEntry, nCopy(c)); 1296 MATELEM(gMat, e + 1, 1) = matEntry; 1297 l = pNext(l); 1298 } 1299 1300 /* loop for computing entries of fMat and gMat in columns 2..(d+1) 1301 which correspond to the x-exponents 1..d */ 1302 int p = m; if (n < m) p = n; // p = min{m, n} 1303 for (int exp = 1; exp <= d; exp++) 1304 { 1305 matrix aMat = mpNew(p, n + m); // container for matrix A of linear system 1306 matrix xVec = mpNew(n + m, 1); // container for unknowns of linear system 1307 matrix bVec = mpNew(p, 1); // container for result vector 1308 1309 // continue here 1310 1311 1312 /* clean-up */ 1313 idDelete((ideal*)&aMat); 1314 idDelete((ideal*)&xVec); 1315 idDelete((ideal*)&bVec); 1316 } 1317 1318 /* build f and g from fMat and gMat, respectively */ 1319 for (int i = 0; i < n; i++) 1320 for (int j = 0; j <= d; j++) 1321 { 1322 poly term = pCopy(MATELEM(fMat, i + 1, j + 1)); // coeff 1323 if (term != NULL) 1324 { 1325 pSetExp(term, 1, j); // ... * x^j 1326 pSetExp(term, 2, i); // ... * y^i 1327 pSetm(term); 1328 f = pAdd(f, term); 1329 } 1330 } 1331 for (int i = 0; i < m; i++) 1332 for (int j = 0; j <= d; j++) 1333 { 1334 poly term = pCopy(MATELEM(gMat, i + 1, j + 1)); // coeff 1335 if (term != NULL) 1336 { 1337 pSetExp(term, 1, j); // ... * x^j 1338 pSetExp(term, 2, i); // ... * y^i 1339 pSetm(term); 1340 g = pAdd(g, term); 1341 } 1342 } 1343 1344 /* clean-up */ 1345 idDelete((ideal*)&fMat); 1346 idDelete((ideal*)&gMat); 1347 } 1348 -
kernel/linearAlgebra.h
raf7145 r35715c 219 219 220 220 /** 221 * Solves the linear system A *x = b, where A is an (nx n)-matrix221 * Solves the linear system A * x = b, where A is an (m x n)-matrix 222 222 * which is given by its LU-decomposition. 223 223 * … … 461 461 * polynomial in y of degree m + n with coefficients in K[[x]]. Suppose there 462 462 * are two monic factors f_0(y) (of degree n) and g_0(y) of degree (m) such 463 * that h(0, y) = f_0(y) * g_0(y) , and an integer d >= 0. Then there are464 * monic polynomials in y with coefficients in K[[x]], namely f(x, y) of465 * degree n and g(x, y) of degree m such that463 * that h(0, y) = f_0(y) * g_0(y) and <f_0, g_0> = K[y]. Fix an integer d >= 0. 464 * Then there are monic polynomials in y with coefficients in K[[x]], namely 465 * f(x, y) of degree n and g(x, y) of degree m such that 466 466 * h(x, y) = f(x, y) * g(x, y) modulo <x^(d+1)> (*). 467 467 * … … 471 471 * The method expects the ground ring to contain at least two variables; then 472 472 * x is the first ring variable and y the second one. 473 * 474 * This code was place here since the algorithm works by successively solving 475 * d linear equation systems. It is hence an application of other methods 476 * defined in this h-file and its corresponding cc-file. 477 * 473 478 **/ 474 479 void henselFactors(
Note: See TracChangeset
for help on using the changeset viewer.