Changeset d98d1b in git


Ignore:
Timestamp:
Oct 25, 2010, 4:09:29 PM (14 years ago)
Author:
Frank Seelisch <seelisch@…>
Branches:
(u'fieker-DuVal', '117eb8c30fc9e991c4decca4832b1d19036c4c65')(u'spielwiese', 'b4f17ed1d25f93d46dbe29e4b499baecc2fd51bb')
Children:
8730345c41037290c50978c95d29abe8d5606708
Parents:
386a8636dfd438b85470e212f44acfc042909ef7
Message:
bug fix in qr double shift

git-svn-id: file:///usr/local/Singular/svn/trunk@13561 2c84dea3-7e68-4137-9b89-c4e89433aadc
File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/linearAlgebra.cc

    r386a86 rd98d1b  
    10491049  MATELEM(c,3,1) = ppMult_qq(MATELEM(H,2,1), MATELEM(H,3,2));
    10501050  nDelete(&trace); nDelete(&det);
    1051  
    1052   matrix uVec; matrix hMat;
    1053   tmp1 = hessenbergStep(c, uVec, hMat, tolerance); nDelete(&tmp1);
    1054   /* now replace H by hMat * H * hMat: */
    1055   matrix wMat = mpMult(hMat, H); idDelete((ideal*)&H);
    1056   matrix H1 = mpMult(wMat, hMat);
    1057   idDelete((ideal*)&wMat); idDelete((ideal*)&hMat);
    1058   /* now need to re-establish Hessenberg form of H1 and put it in H */
    1059   hessenberg(H1, wMat, H, tolerance);
    1060   idDelete((ideal*)&wMat); idDelete((ideal*)&H1);
     1051
     1052  /* for applying hessenbergStep, we need to make sure that c[1, 1] is
     1053     not zero */
     1054  if ((MATELEM(c,1,1) != NULL) &&
     1055      ((MATELEM(c,2,1) != NULL) || (MATELEM(c,3,1) != NULL))) 
     1056  {
     1057    matrix uVec; matrix hMat;
     1058    tmp1 = hessenbergStep(c, uVec, hMat, tolerance); nDelete(&tmp1);
     1059    /* now replace H by hMat * H * hMat: */
     1060    matrix wMat = mpMult(hMat, H); idDelete((ideal*)&H);
     1061    matrix H1 = mpMult(wMat, hMat);
     1062    idDelete((ideal*)&wMat); idDelete((ideal*)&hMat);
     1063    /* now need to re-establish Hessenberg form of H1 and put it in H */
     1064    hessenberg(H1, wMat, H, tolerance);
     1065    idDelete((ideal*)&wMat); idDelete((ideal*)&H1);
     1066  }
     1067  else if ((MATELEM(c,1,1) == NULL) && (MATELEM(c,2,1) != NULL))
     1068  {
     1069    swapRows(1, 2, H);
     1070    swapColumns(1, 2, H);
     1071  }
     1072  else if ((MATELEM(c,1,1) == NULL) && (MATELEM(c,3,1) != NULL))
     1073  {
     1074    swapRows(1, 3, H);
     1075    swapColumns(1, 3, H);
     1076  }
     1077  else
     1078  { /* c is the zero vector or a multiple of e_1;
     1079       no hessenbergStep needed */ }
    10611080}
    10621081
Note: See TracChangeset for help on using the changeset viewer.