version 1.1, 2000/12/22 10:03:28 |
version 1.3, 2003/02/14 22:29:09 |
|
|
/* |
/* |
* $OpenXM: $ |
* $OpenXM: OpenXM_contrib2/asir2000/engine/t-itv.c,v 1.2 2002/01/08 04:14:37 kondoh Exp $ |
*/ |
*/ |
#if defined(INTERVAL) |
#if defined(INTERVAL) |
#include "ca.h" |
#include "ca.h" |
#include "base.h" |
#include "base.h" |
#if PARI |
#if defined(PARI) |
#include "genpari.h" |
#include "genpari.h" |
#endif |
#endif |
|
|
Line 50 void additvp(Itv a, Itv b, Itv *c) |
|
Line 50 void additvp(Itv a, Itv b, Itv *c) |
|
addnum(0,a,b,c); |
addnum(0,a,b,c); |
else if ( (NID(a) == N_IP) && (NID(b) == N_R ) |
else if ( (NID(a) == N_IP) && (NID(b) == N_R ) |
||(NID(a) == N_R ) && (NID(b) == N_IP) ) |
||(NID(a) == N_R ) && (NID(b) == N_IP) ) |
additvd((Num)a,(Num)b,(ItvD *)c); |
additvd((Num)a,(Num)b,(IntervalDouble *)c); |
else { |
else { |
itvtois(a,&ai,&as); |
itvtois(a,&ai,&as); |
itvtois(b,&bi,&bs); |
itvtois(b,&bi,&bs); |
Line 73 void subitvp(Itv a, Itv b, Itv *c) |
|
Line 73 void subitvp(Itv a, Itv b, Itv *c) |
|
subnum(0,a,b,c); |
subnum(0,a,b,c); |
else if ( (NID(a) == N_IP) && (NID(b) == N_R ) |
else if ( (NID(a) == N_IP) && (NID(b) == N_R ) |
||(NID(a) == N_R ) && (NID(b) == N_IP) ) |
||(NID(a) == N_R ) && (NID(b) == N_IP) ) |
subitvd((Num)a,(Num)b,(ItvD *)c); |
subitvd((Num)a,(Num)b,(IntervalDouble *)c); |
else { |
else { |
itvtois(a,&ai,&as); |
itvtois(a,&ai,&as); |
itvtois(b,&bi,&bs); |
itvtois(b,&bi,&bs); |
Line 94 void mulitvp(Itv a, Itv b, Itv *c) |
|
Line 94 void mulitvp(Itv a, Itv b, Itv *c) |
|
mulnum(0,a,b,c); |
mulnum(0,a,b,c); |
else if ( (NID(a) == N_IP) && (NID(b) == N_R ) |
else if ( (NID(a) == N_IP) && (NID(b) == N_R ) |
||(NID(a) == N_R ) && (NID(b) == N_IP) ) |
||(NID(a) == N_R ) && (NID(b) == N_IP) ) |
mulitvd((Num)a,(Num)b,(ItvD *)c); |
mulitvd((Num)a,(Num)b,(IntervalDouble *)c); |
else { |
else { |
itvtois(a,&ai,&as); |
itvtois(a,&ai,&as); |
itvtois(b,&bi,&bs); |
itvtois(b,&bi,&bs); |
Line 176 void divitvp(Itv a, Itv b, Itv *c) |
|
Line 176 void divitvp(Itv a, Itv b, Itv *c) |
|
divnum(0,a,b,c); |
divnum(0,a,b,c); |
else if ( (NID(a) == N_IP) && (NID(b) == N_R ) |
else if ( (NID(a) == N_IP) && (NID(b) == N_R ) |
||(NID(a) == N_R ) && (NID(b) == N_IP) ) |
||(NID(a) == N_R ) && (NID(b) == N_IP) ) |
divitvd((Num)a,(Num)b,(ItvD *)c); |
divitvd((Num)a,(Num)b,(IntervalDouble *)c); |
else { |
else { |
itvtois(a,&ai,&as); |
itvtois(a,&ai,&as); |
itvtois(b,&bi,&bs); |
itvtois(b,&bi,&bs); |
Line 227 void pwritvp(Itv a, Num e, Itv *c) |
|
Line 227 void pwritvp(Itv a, Num e, Itv *c) |
|
else if ( NID(a) <= N_B ) |
else if ( NID(a) <= N_B ) |
pwrnum(0,a,e,c); |
pwrnum(0,a,e,c); |
else if ( !INT(e) ) { |
else if ( !INT(e) ) { |
#if PARI && 0 |
#if defined(PARI) && 0 |
GEN pa,pe,z; |
GEN pa,pe,z; |
int ltop,lbot; |
int ltop,lbot; |
|
|