Changeset 9c0b20a in git
- Timestamp:
- Nov 25, 2010, 4:11:10 PM (13 years ago)
- Branches:
- (u'jengelh-datetime', 'ceac47cbc86fe4a15902392bdbb9bd2ae0ea02c6')(u'spielwiese', '00e2e9c41af3fde1273eb3633f4c0c7c3db2579d')
- Children:
- 488872b51cd1fa36918b12c9c2476c1edff62026
- Parents:
- c512d93f75cc91a718679d4a03b14439936966e2
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
Singular/extra.cc
rc512d9 r9c0b20a 3451 3451 } 3452 3452 else 3453 if (strcmp(sys_cmd, "LLL") == 0) 3454 { 3455 if (h!=NULL) 3456 { 3457 res->rtyp=h->Typ(); 3458 if (h->Typ()==MATRIX_CMD) 3459 { 3460 res->data=(char *)singntl_LLL((matrix)h->Data()); 3461 return FALSE; 3462 } 3463 else if (h->Typ()==INTMAT_CMD) 3464 { 3465 res->data=(char *)singntl_LLL((intvec*)h->Data()); 3466 return FALSE; 3467 } 3468 else return TRUE; 3469 } 3470 else return TRUE; 3471 } 3472 else 3453 3473 /*================= factoras =========================*/ 3454 3474 if (strcmp (sys_cmd, "factoras") == 0) -
factory/cf_hnf.cc
rc512d9 r9c0b20a 19 19 #include <NTL/mat_ZZ.h> 20 20 #include <NTL/HNF.h> 21 #include <NTL/LLL.h> 21 22 22 23 // The input matrix A is an n x m matrix of rank m (so n >= m), and D … … 40 41 return convertNTLmat_ZZ2FacCFMatrix(WW); 41 42 } 43 CFMatrix* cf_LLL(CFMatrix& A) 44 { 45 mat_ZZ *AA=convertFacCFMatrix2NTLmat_ZZ(A); 46 LLL_RR(*AA); 47 delete AA; 48 CFMatrix *r= convertNTLmat_ZZ2FacCFMatrix(*AA); 49 delete AA; 50 return r; 51 } 42 52 #endif -
factory/cf_hnf.h
rc512d9 r9c0b20a 24 24 CFMatrix* cf_HNF(CFMatrix& A); 25 25 26 // performs LLL reduction. 27 28 // B is an m x n matrix, viewed as m rows of n-vectors. m may be less 29 // than, equal to, or greater than n, and the rows need not be 30 // linearly independent. B is transformed into an LLL-reduced basis, 31 // and the return value is the rank r of B. The first m-r rows of B 32 // are zero. 33 34 // More specifically, elementary row transformations are performed on 35 // B so that the non-zero rows of new-B form an LLL-reduced basis 36 // for the lattice spanned by the rows of old-B. 37 // The default reduction parameter is delta=3/4, which means 38 // that the squared length of the first non-zero basis vector 39 // is no more than 2^{r-1} times that of the shortest vector in 40 // the lattice. 41 42 CFMatrix* cf_LLL(CFMatrix& A); 43 26 44 /*ENDPUBLIC*/ 27 45 -
kernel/clapsing.cc
rc512d9 r9c0b20a 1577 1577 } 1578 1578 } 1579 for(i=r;i>0;i--)1580 {1581 for(j=r;j>0;j--)1582 {1583 M(i,j)=convSingPFactoryP(MATELEM(m,i,j));1584 }1585 }1586 1579 CFMatrix *MM=cf_HNF(M); 1587 1580 for(i=r;i>0;i--) … … 1619 1612 { 1620 1613 for(j=r;j>0;j--) 1614 { 1615 IMATELEM(*mm,i,j)=convFactoryISingI((*MM)(i,j)); 1616 } 1617 } 1618 delete MM; 1619 return mm; 1620 } 1621 matrix singntl_LLL(matrix m ) 1622 { 1623 int r=m->rows(); 1624 int c=m->cols(); 1625 matrix res=mpNew(r,c); 1626 if (rField_is_Q(currRing)) 1627 { 1628 CFMatrix M(r,c); 1629 int i,j; 1630 for(i=r;i>0;i--) 1631 { 1632 for(j=c;j>0;j--) 1633 { 1634 M(i,j)=convSingPFactoryP(MATELEM(m,i,j)); 1635 } 1636 } 1637 CFMatrix *MM=cf_LLL(M); 1638 for(i=r;i>0;i--) 1639 { 1640 for(j=c;j>0;j--) 1641 { 1642 MATELEM(res,i,j)=convFactoryPSingP((*MM)(i,j)); 1643 } 1644 } 1645 delete MM; 1646 } 1647 return res; 1648 } 1649 intvec* singntl_LLL(intvec* m ) 1650 { 1651 int r=m->rows(); 1652 int c=m->cols(); 1653 setCharacteristic( 0 ); 1654 CFMatrix M(r,c); 1655 int i,j; 1656 for(i=r;i>0;i--) 1657 { 1658 for(j=r;j>0;j--) 1659 { 1660 M(i,j)=IMATELEM(*m,i,j); 1661 } 1662 } 1663 CFMatrix *MM=cf_LLL(M); 1664 intvec *mm=ivCopy(m); 1665 for(i=r;i>0;i--) 1666 { 1667 for(j=c;j>0;j--) 1621 1668 { 1622 1669 IMATELEM(*mm,i,j)=convFactoryISingI((*MM)(i,j)); -
kernel/clapsing.h
rc512d9 r9c0b20a 42 42 matrix singntl_HNF(matrix A); 43 43 intvec* singntl_HNF(intvec* A); 44 matrix singntl_LLL(matrix A); 45 intvec* singntl_LLL(intvec* A); 44 46 45 47 BOOLEAN singclap_isSqrFree(poly f);
Note: See TracChangeset
for help on using the changeset viewer.