version 1.33, 2016/04/01 03:04:35 |
version 1.37, 2017/08/30 09:40:30 |
|
|
/* $OpenXM: OpenXM_contrib2/asir2000/builtin/parif.c,v 1.32 2015/08/21 06:00:29 noro Exp $ */ |
/* $OpenXM: OpenXM_contrib2/asir2000/builtin/parif.c,v 1.36 2017/03/31 06:10:13 ohara Exp $ */ |
#include "ca.h" |
#include "ca.h" |
#include "parse.h" |
#include "parse.h" |
#include "ox.h" |
#include "ox.h" |
Line 104 void reset_ox_pari() |
|
Line 104 void reset_ox_pari() |
|
pointer evalparif(FUNC f,NODE arg) |
pointer evalparif(FUNC f,NODE arg) |
{ |
{ |
int ac,intarg,opt,prec; |
int ac,intarg,opt,prec; |
Q q,r,narg; |
Q q,r,narg,cmd; |
|
Real sec; |
NODE nd,oxarg,t,t1,n; |
NODE nd,oxarg,t,t1,n; |
STRING name; |
STRING name; |
USINT ui; |
USINT ui; |
|
LIST list; |
Obj ret,dmy; |
Obj ret,dmy; |
mpfr_func mpfr_function; |
mpfr_func mpfr_function; |
V v; |
V v; |
Line 127 pointer evalparif(FUNC f,NODE arg) |
|
Line 129 pointer evalparif(FUNC f,NODE arg) |
|
MKNODE(nd,0,0); |
MKNODE(nd,0,0); |
r = (Q)bevalf((FUNC)v->priv,0); |
r = (Q)bevalf((FUNC)v->priv,0); |
}else { |
}else { |
|
#if !defined(VISUAL) |
MKSTR(name,"ox_pari"); |
MKSTR(name,"ox_pari"); |
nd = mknode(2,NULL,name); |
nd = mknode(2,NULL,name); |
Pox_launch_nox(nd,&r); |
Pox_launch_nox(nd,&r); |
|
#else |
|
error("Please load names.rr from latest asir-contrib library before using pari functions."); |
|
#endif |
} |
} |
ox_pari_stream = r; |
ox_pari_stream = r; |
ox_pari_stream_initialized = 1; |
ox_pari_stream_initialized = 1; |
Line 149 pointer evalparif(FUNC f,NODE arg) |
|
Line 155 pointer evalparif(FUNC f,NODE arg) |
|
STOQ(ac,narg); |
STOQ(ac,narg); |
oxarg = mknode(3,ox_pari_stream,name,narg); |
oxarg = mknode(3,ox_pari_stream,name,narg); |
Pox_execute_function(oxarg,&dmy); |
Pox_execute_function(oxarg,&dmy); |
oxarg = mknode(1,ox_pari_stream); |
|
ox_get_pari_result = 1; |
ox_get_pari_result = 1; |
|
#if defined(VISUAL) || defined(__MINGW32__) |
|
#define SM_popCMO 262 |
|
STOQ(SM_popCMO,cmd); |
|
oxarg = mknode(2,ox_pari_stream,cmd); |
|
Pox_push_cmd(oxarg,&dmy); |
|
nd = mknode(1,ox_pari_stream); |
|
MKLIST(list,nd); |
|
MKReal(1.0/8,sec); |
|
oxarg = mknode(2,list,sec); |
|
ret=0; |
|
do { |
|
check_intr(); |
|
Pox_select(oxarg,&list); |
|
oxarg = mknode(1,list); |
|
Plength(oxarg,&ret); |
|
}while (!ret); |
|
oxarg = mknode(1,ox_pari_stream); |
|
Pox_get(oxarg,&ret); |
|
#else |
|
oxarg = mknode(1,ox_pari_stream); |
Pox_pop_cmo(oxarg,&ret); |
Pox_pop_cmo(oxarg,&ret); |
|
#endif |
ox_get_pari_result = 0; |
ox_get_pari_result = 0; |
if ( ret && OID(ret) == O_ERR ) { |
if ( ret && OID(ret) == O_ERR ) { |
char buf[BUFSIZ]; |
char buf[BUFSIZ]; |
Line 174 struct pariftab { |
|
Line 200 struct pariftab { |
|
|
|
/* |
/* |
* type = 1 => argc = 1, second arg = precision |
* type = 1 => argc = 1, second arg = precision |
* type = 2 => argc = 1, second arg = optional (long int) |
* type = 2 => argc = 1, second arg = (long int)0 |
* |
* |
*/ |
*/ |
/* |
/* |