version 1.14, 2006/10/26 10:49:17 |
version 1.16, 2013/11/05 02:55:03 |
|
|
/* |
/* |
* $OpenXM: OpenXM_contrib2/asir2000/engine/dalg.c,v 1.13 2006/01/05 00:21:20 noro Exp $ |
* $OpenXM: OpenXM_contrib2/asir2000/engine/dalg.c,v 1.15 2007/02/13 07:12:54 noro Exp $ |
*/ |
*/ |
|
|
#include "ca.h" |
#include "ca.h" |
Line 378 void dalgtoalg(DAlg da,Alg *r) |
|
Line 378 void dalgtoalg(DAlg da,Alg *r) |
|
|
|
if ( !(nf=current_numberfield) ) |
if ( !(nf=current_numberfield) ) |
error("dalgtoalg : current_numberfield is not set"); |
error("dalgtoalg : current_numberfield is not set"); |
dtop(ALG,nf->vl,da->nm,&p); |
if ( !da ) *r = 0; |
invq(da->dn,&inv); |
else { |
mulpq(p,(P)inv,&p1); |
dtop(ALG,nf->vl,da->nm,&p); |
MKAlg(p1,*r); |
invq(da->dn,&inv); |
|
mulpq(p,(P)inv,&p1); |
|
MKAlg(p1,*r); |
|
} |
} |
} |
|
|
void simpdalg(DAlg da,DAlg *r) |
void simpdalg(DAlg da,DAlg *r) |
Line 571 int invdalg(DAlg a,DAlg *c) |
|
Line 574 int invdalg(DAlg a,DAlg *c) |
|
error("invdalg : division by 0"); |
error("invdalg : division by 0"); |
else if ( NID(a) == N_Q ) { |
else if ( NID(a) == N_Q ) { |
invq((Q)a,&dn); *c = (DAlg)dn; |
invq((Q)a,&dn); *c = (DAlg)dn; |
return; |
return 1; |
} |
} |
dim = nf->dim; |
dim = nf->dim; |
mb = nf->mb; |
mb = nf->mb; |
Line 659 NODE inv_or_split_dalg(DAlg a,DAlg *c) |
|
Line 662 NODE inv_or_split_dalg(DAlg a,DAlg *c) |
|
error("invdalg : division by 0"); |
error("invdalg : division by 0"); |
else if ( NID(a) == N_Q ) { |
else if ( NID(a) == N_Q ) { |
invq((Q)a,&dn); *c = (DAlg)dn; |
invq((Q)a,&dn); *c = (DAlg)dn; |
return; |
return 1; |
} |
} |
dim = nf->dim; |
dim = nf->dim; |
mb = nf->mb; |
mb = nf->mb; |