Gp (1) - Página de manual de Linux gp - PARI calculator Sinopsis Descripción Invoca la calculadora PARI-GP, cargando el archivo1, file2. (Escrito en el lenguaje GP) en el inicio. Gp es una calculadora programable avanzada, que calcula simbólicamente tanto tiempo como sea posible, numéricamente donde sea necesario, y contiene una abundancia de funciones de teoría numérica (curvas elípticas, teoría de campo de clase). Se puede programar con el lenguaje de scripting GP. Sus tipos de datos básicos son números enteros, números reales, números racionales exactos, números algebraicos, números p - adicos, enteros modulares (números enteros modulo n), números complejos, polinomios, funciones racionales y series de potencias, formas cuadráticas binarias integrales, matrices, Vectores y listas, cadenas de caracteres y combinaciones recursivas de éstas. Opciones Las opciones de línea de comandos están disponibles tanto en formato corto (-f) como en POSIX (-fast). Los argumentos numéricos pueden ser seguidos por un modificador k. M o G a la conveniencia de los usuarios en ese caso el argumento se multiplica por 103, 106 ó 109 respectivamente. - f, --fácil Inicio rápido (o ajustes de fábrica). No lea. gprc (ver abajo) al iniciar. - p, --primelimit limit Al arrancar, gp calcula una tabla de pequeños primos utilizados en aplicaciones de teoría numérica. Si se establece primelimit, la tabla incluye primos hasta ese límite en lugar del predeterminado. Unoreasonably altos valores aumentará considerablemente el tiempo de inicio. Valores excesivamente pequeños harán que algunas funciones de teoría numérica fallen con el mensaje no suficientemente precomputado primos. - q, --quiet Modo silencioso. No imprima los encabezados o los números de la historia, no diga adiós. - s, --stacksize limit Tamaño de la pila interna de gp asignada al inicio. Cuando gp se queda sin espacio, interrumpe el cálculo actual y genera una excepción de desbordamiento de pila. Si esto ocurre con frecuencia, empiece con una pila más grande. El tamaño de la pila también se puede aumentar desde dentro de gp, utilizando el valor predeterminado (parisize,.) Puede ser conveniente establecer stacksize desde su. gprc. Tenga en cuenta que los cálculos con una pila más pequeña pueden ser más eficientes debido a la mejor localidad de datos. La mayoría de los cálculos deben necesitar menos de 20 MB. --emacs gp se puede ejecutar en un shell de Emacs (consulte el manual del usuario de GP para más detalles). Este indicador es necesario para una interacción fluida con el paquete Emacs (pari. el). Se establece automáticamente por el paquete pari. el, y producirá rarezas de visualización agradable si lo establece fuera de una sesión de Emacs. --help imprime un resumen de las opciones de línea de comandos disponibles. --probar ejecuta gp en modo de prueba: suprime la impresión de números de historial y envuelve líneas de salida largas (para obtener la salida de lectura de lectura). Sólo para bancos. --texmacs gp se puede ejecutar desde un frontend de TeXmacs. Esta bandera es establecida por TeXmacs, para habilitar canales de comunicación de propósito especial. No lo establezca usted mismo. --versión salida información de la versión (banner) y luego salir. --version-short output número de versión y luego salir. Utilícelo para obtener ayuda en línea. Para obtener ayuda en línea extendida (más precisamente, para llamar al programa de ayuda externa, gphelp de forma predeterminada) quit (o q) o EOF (Ctrl-D) para salir de gp. Lo siguiente funciona sólo cuando gp estaba vinculado con la biblioteca GNU readline: teclas de flecha para editar y ver el historial de entrada. TAB para la finalización automática Manuales El siguiente material está incluido en la distribución estándar (originalmente en formato TeX): Guía del usuario de PARI / GP (users. dvi) Guía del usuario de la biblioteca PARI (library. dvi) PARI / GP, a Tutorial (tutorial. dvi) Tarjeta de referencia PARI / GP (refcard. ps): 4 páginas, basada en una versión anterior de Joseph H. Silverman. Pariemacs. txt explica el uso del paquete pari. el y cómo personalizarlo (prompt, colores). Archivos gp principal ejecutable HOME /.gprc (o GPRC si se establece) leer al principio de la ejecución por cada shell gp. Se proporciona un valor predeterminado gprc gprc. dft con la distribución. Si no se encuentra este archivo, se comprueba en su lugar / etc / gprc. Pari. log archivo de registro por defecto (puede ser cambiado en. gprc o interactivamente usando default ()) pari. ps default psfile usado para salida postscript (como arriba) gphelp programa de ayuda externa predeterminado pari. el elisp package to run pari in Un shell de Emacs. Se debe cargar desde el archivo. emacs..gp GP programs Ambiente GPRC lugar para buscar el archivo de usuarios gprc (antes de HOME /.gprc. / Gprc y / etc / gprc en este orden). El directorio GPDATADIR contiene datos precomputados. Por ahora, los archivos de Galois resolventes en el directorio galdata /, necesarios por la función polgalois, en grados 8 a 11. GPHELP nombre del programa de ayuda externa invocado por. y. Atajos GPTMPDIR nombre del directorio donde se generarán los archivos temporales. Home Page Listas de correo Hay tres listas de correo dedicadas al paquete PARI / GP (cortesía de Dan Bernstein), y la mayoría de la retroalimentación debe dirigirse a ellos. Son: - pari-announce (moderado): para que anunciemos los cambios de la versión principal. - pari-dev: para todo lo relacionado con el desarrollo de PARI, incluyendo sugerencias, preguntas técnicas, reportes de bugs o parches. - Pari-usuarios: para todo lo demás. Para suscribirse, envíe mensajes vacíos, respectivamente, a los Informes de errores. Los errores deben ser enviados en línea a nuestro sistema de seguimiento de errores, disponible en la página principal de PARI o directamente desde la URL pari. math. u-bordeaux. fr/Bugs. Esa página. Trivia A pesar del G líder, GP no tiene nada que ver con GNU. La primera versión se llamaba originalmente GPC, para Gran calculadora programable. Por alguna razón, el C al final se dejó caer. PARI no tiene nada que ver con la capital francesa. El nombre es un retruécano sobre las etapas tempranas de los proyectos cuando los autores comenzaron a poner en práctica una biblioteca para Pascal ARIthmetic en el lenguaje de programación de PASCAL (cambiaron rápidamente a C). Blaise Pascal (1623-1662) fue un famoso matemático y filósofo francés que fue uno de los fundadores de la probabilidad e ideó una de las primeras máquinas aritméticas. Una vez propuso la siguiente prueba de la existencia de Dios para los incrédulos: si existe o no, no pierdo nada creyendo en Él, mientras que si lo hace y yo me porté mal. Este es el llamado pari de Pascal (Pascals Wager). Tenga en cuenta que PARI también significa hada en persa. Autores PARI fue originalmente escrito por Christian Batut, Dominique Bernardi, Henri Cohen y Michel Olivier en el Laboratorio A2X (Universidad Bordeaux I, Francia), y fue mantenido por Henri Cohen hasta la versión 1.39.15 (1995), y por Karim Belabas desde entonces. Un gran número de personas han contribuido a las mejoras sucesivas que eventualmente resultaron en la presente versión. Consulte el archivo AUTORES en la distribución. Ver también Copiar Este programa es un software libre que puede redistribuirlo y / o modificarlo bajo los términos de la Licencia Pública General GNU publicada por la Free Software Foundation. Este programa se distribuye con la esperanza de que será útil, pero SIN NINGUNA GARANTÍA, ni siquiera la garantía implícita de COMERCIABILIDAD o ADECUACIÓN PARA UN PROPÓSITO PARTICULAR. Consulte la Licencia Pública General GNU para obtener más detalles. Debería haber recibido una copia de la Licencia Pública General de GNU junto con este programa si no, escriba a la Fundación de Software Libre, Inc. 675 Mass Ave, Cambridge, MA 02139, EE. UU. Referido porPARI / GP Preguntas Frecuentes Este documento es mantenido por Karim Belabas. El actual responsable de PARI / GP (comentarios bienvenidos). Se esfuerza por ser útil para todas las versiones de PARI / GP pero, por el momento, documenta el comportamiento de las últimas versiones en las ramas estable y de prueba. Y puede sugerir las características introducidas en la versión de desarrollo, disponible sólo a través de GIT. Preguntas Generalidades Qué es PARI / GP PARI / GP es un sistema de álgebra computacional ampliamente utilizado diseñado para cálculos rápidos en teoría numérica (factorizaciones, teoría de números algebraicos, curvas elípticas), pero también contiene un gran número de otras funciones útiles para calcular con Entidades matemáticas tales como matrices, polinomios, series de potencias, números algebraicos, etc. y muchas funciones trascendentales. PARI es una biblioteca C (compatible con C). Escribir programas C (o C) y vincularlos a libpari es la única manera de acceder al conjunto completo de rutinas PARI (puede instalar la mayoría de ellos bajo gp, pero esto no es tan portátil). Producirá código mucho más rápido para aplicaciones de bajo nivel. Gp es un shell interactivo que da acceso a las funciones PARI, más fácil de usar. Los scripts de bajo nivel suelen ser 4 veces más lentos que el código C escrito directamente. Los scripts de alto nivel, cuyo tiempo de ejecución está dominado por unas pocas llamadas a las funciones de PARI, no incurren en ningún castigo. GP es el nombre del lenguaje de scripting de gps. ¿Qué es gp2c? Es el compilador GP-to-C. Compila secuencias de comandos GP para el lenguaje C, facilitando la tarea de escribir programas PARI. Puede automatizadamente compilarlos al código de objeto y cargar las funciones resultantes en gp. Las secuencias de comandos de bajo nivel compiladas por gp2c normalmente se ejecutan 3 o 4 veces más rápido. Actualmente, gp2c sólo entiende un subconjunto del lenguaje GP, y algunas funcionalidades están restringidas a los sistemas operativos Unix. Qué es GNU readline Es una biblioteca, que proporciona facilidades de edición de líneas (movimiento del cursor, historial de comandos, finalización, etc.). Todas las aplicaciones creadas con esta biblioteca, por ejemplo el shell bash, se benefician de una interfaz de usuario consistente y conveniente. Se recomienda encarecidamente asegurarse de que readline esté presente en su sistema antes de construir el gp usted mismo (readline está incluido en el binario de Windows que distribuimos). De hecho, antes de ejecutar Configurar para que este último tenga la oportunidad de detectarlo. La shell gp funcionará sin edición de línea, pero escribir será tedioso. Qué es GNU MP GNU MP, o GMP para abreviar, es una biblioteca multiprecisión, que en particular proporciona rutinas asintóticamente rápidas para operaciones aritméticas entre enteros. El núcleo de multiprecisión PARI puede utilizar implementaciones nativas o hacer buen uso de GMP si está disponible. Le recomendamos que descargue e instale GMP antes de Configurar PARI. Asegúrese de descargar la versión 4.2 o posterior, debido a este problema. ¿Cómo puedo reportar errores o solicitar nuevas características? Utilice el sistema de seguimiento de errores de PARI / GPs. Otros pueden ver y comentar su solicitud, y usted será notificado individualmente cada vez que una solución está comprometida con el servidor GIT. ¿Necesito citar formalmente a PARI / GP en mi trabajo? Si ha utilizado PARI / GP en la preparación de un trabajo, entonces sí, lo apreciaríamos. Cuando un autor cita formalmente el uso de un sistema o un paquete de álgebra computacional en la bibliografía de un artículo, los desarrolladores del sistema reciben crédito en índices de citas. Esta práctica fomenta el desarrollo de sistemas y paquetes y ayuda a dar reconocimiento a este trabajo que es similar al que disfrutan aquellos que publican artículos de investigación. También hace que sus resultados experimentales sean reproducibles. Usted puede citar a PARI en el siguiente formulario (formato BibTeX) (por favor, cambie el número de versión para que coincida con la versión que realmente utilizó), lo que se traduciría en algo así como ¿Cuáles son los términos de licencia PARI / GP es software libre. Se publica bajo la Licencia Pública General GNU (GPL para abreviar) publicada por la Fundación de Software Libre, ya sea la versión 2 de la Licencia, o (a su opción) cualquier versión posterior. ¿Por qué utilizar una licencia tan restrictiva como la GPL? ¿Lo va a cambiar? La respuesta corta a la segunda pregunta es no. Estamos muy contentos con la GPL. La licencia original (para todas las versiones 1.xx) era propietaria, demasiado casualmente redactada, y llevada a varios conflictos. A partir de la versión 2.0, queríamos una licencia bien conocida para todo el paquete PARI / GP, que dejaría a los contribuyentes seguros con el uso futuro de su código y, en la medida de lo posible, no impediría que nadie ayudara. Pronto se acordó que PARI / GP debería convertirse en software libre. La GPL era una elección natural. Es ciertamente bien sabido, y satisfizo a cada desarrollador implicado en el proyecto, así como sus patrones respectivos. Para este último, las alternativas habrían sido más restrictivas, ciertamente no más cercanas a la LGPL, BSD o la licencia Artística. La mayoría de los Sistemas de Álgebra de Computadora también usan la GPL, presumiblemente por razones relacionadas. ¿Es este el sitio web del PARI Sí. Había una separación entre pari. math. u-bordeaux. fr/ (orientado al desarrollador) y math. u-bordeaux. fr/ belabas / pari (orientado al usuario). Ambos sitios se fusionaron el 13 de octubre de 2012. ¿Existe una documentación? La distribución de pruebas incluye dos manuales de usuario (para la calculadora GP y la librería C de libpari), un tutorial, una guía de desarrolladores demasiado corta y una tarjeta de referencia. Versiones en línea o descargables están disponibles en pari. math. u-bordeaux. fr/doc. html. Para obtener más información sobre los algoritmos utilizados, echa un vistazo a Henri Cohens dos libros (Textos de Posgrado en Matemáticas 138 y 193. Springer). ¿Se ha traducido la documentación a. No sólo Inglés. PARI es escrito por un pequeño grupo de voluntarios, y el mantenimiento de una documentación adecuada en un solo idioma ya ha demostrado ser una tarea desalentadora. Por favor, no nos acosen con solicitudes de traducción o conferencias sobre el imperialismo lingüístico. Algunos desarrolladores pasan a ser hablantes nativos de francés, y son realmente conscientes de una serie de problemas lingüísticos inquietantes. Pero esto no implica que tengamos tiempo ilimitado para traducir documentos existentes, por no mencionar crear y mantener otros nuevos. PARI es software libre, y usted es bienvenido para emprender o patrocinar un esfuerzo de traducción al idioma de su elección. Por favor notifíquenos si lo hace. ¿Cuál es la versión actual? La versión estable actual es pari-2.9.0. La instantánea de prueba es pari-2.6.1. - La última rama de desarrollo está siempre disponible vía GIT. Mantenemos simultáneamente dos versiones (o ramas) de PARI: número impar impar de versión, por ejemplo, 2.5.x: sólo modificado para arreglar grandes problemas, los cuales son curables con pequeños cambios. Ni las mejoras menores, ni los cambios complicados se incorporan. El objetivo principal es no alterar los scripts o código de trabajo. Por lo tanto, puede actualizar con confianza desde un nivel de patch a otro, dentro de la misma rama de versión, p. 2.5.x a 2.5.y. Esta rama puede estar muy por detrás de las pruebas. En este caso, contendrá errores más conocidos y carecerá de algunas características útiles. Probando incluso un número de versión menor, por ejemplo, 2.4.x: esta es una versión de desarrollo, y nada está garantizado, aunque todo funciona normalmente. Las secciones grandes del código se modifican, las características aparecen o se cancelan, las interfaces cambian según la regeneración que recibimos, muchos bugs son fijos y nuevos se deslizan adentro. Eventualmente, la versión de la prueba coalesces en una estable y una nueva rama de la prueba se comienza . En ambas ramas, las versiones numeradas (o instantáneas) se liberan cada vez que nos sentimos preparados: compilan sin advertencias y pasan todas nuestras pruebas de regresión en un gran número de sistemas. Dado que esto lleva mucho tiempo, estos lanzamientos son mucho menos frecuentes de lo que nos gustaría. Mientras tanto, nuestro servidor GIT le permite descargar el código más reciente en cualquier sucursal. ¿Qué versión debo utilizar? Depende de sus necesidades, describimos algunos escenarios plausibles a continuación. En primer lugar, siempre use la versión más reciente en una rama determinada, estable o de prueba. Si es estable puede ejecutar sus scripts sin problemas, y no necesita ninguna de las características más recientes, sólo uso estable Si sólo desea dar PARI / GP un intento o ya han tenido problemas con estable. Luego pruebe las pruebas. En general, contiene menos errores, más funciones y funciones pueden ser órdenes de magnitudes más rápido. Si tiene problemas con las pruebas. Utilice por favor nuestro servidor de GIT: su problema es probablemente resuelto ya. Si no es así, comunique su problema usando nuestro sistema de seguimiento de errores. A continuación, actualizar tan pronto como el problema se resuelve normalmente por lo menos uno o dos días después. (Las personas que envían un informe de error se notifican individualmente cada vez que una solución a su problema está comprometida con el servidor GIT.) Versión 2.1.4 ¿Qué significa esto? El número de versión tiene tres componentes M. m.p. Por ejemplo, 2.1.4: M es el número de versión principal, y sólo cambió una vez desde que se creó PARI / GP. M es el número de versión secundaria. Los números de versión impar corresponden a versiones estables, los números pares corresponden a las versiones de prueba. P es la revisión del parche y cambia con frecuencia. La idea es que el patchlevel es golpeado cada vez que una serie de modificaciones se ha completado, y el número de versión menor se incrementa cuando una versión de prueba se considera lo suficientemente robusta como para convertirse en la nueva versión estable. A continuación, se crea una nueva rama de pruebas. Esto tiene una serie de implicaciones en términos de estabilidad de la interfaz. ¿Cuándo estará disponible la próxima versión Cuando esté lista. No tenemos un horario definido: si le molesta un problema en particular o desea ver nuevas mejoras, utilice la versión de desarrollo disponible a través de GIT. Aquí está la historia de versiones pasadas. Por favor, hazlo tú mismo: dependiendo de la lista en la que te interese, envía un correo electrónico a uno de Incluir ya sea suscribirte o darse de baja en el asunto del mensaje. Para anular la suscripción, asegúrese de utilizar la misma cuenta de correo electrónico que cuando se suscribió originalmente. Tengo un problema con una lista. ¿A quién debo contactar Problemas de Instalación / Construcción Problema de Matemáticas :: Pari Por favor reportelo directamente a Math :: Pari autor y mantenedor Ilya Zakharevich. Problema de PariEmacs Por favor informe directamente al mantenedor del paquete pariemacs Olivier Ramar. Obtener fuentes de PARI que busqué xxx. gz desde la página de descarga, y los archivos están dañados Algunos navegadores web silenciosamente ampliar cualquier cosa que el servidor web les dice es gzipd. Y sin embargo le ofrecerá guardarlo con el final. gz, ahora inapropiado. Usted probablemente está mirando xxx bajo el nombre de xxx. gz. Bajo Unix, el archivo xxx. gz debe averiguar cuál es realmente el formato de archivo. Los tamaños de archivo también deben ser un tell-tale. ¿Dónde está su servidor CVS / Subversion Se han ido. Ahora usamos GIT. Qué es GIT GIT es un sistema de control de revisión de código abierto. Para los desarrolladores de PARI / GP, proporciona control de fuente transparente de la red. Para usuarios comunes, proporciona una forma muy conveniente de obtener versiones parcheadas (sólo código fuente) entre versiones, o seguir las ramas de desarrollo. Los clientes GIT están disponibles para todas las plataformas principales: Unix, MacOS, Windows. En particular, el cliente de línea de comandos git está disponible en todas las distribuciones de Linux. Cuando su cliente GIT se conecta a nuestro servidor de repositorios GIT por primera vez, copia el código fuente en su disco duro, exactamente como si hubiera obtenido y extraído una versión de origen. PARI puede ser compilado e instalado de la manera habitual. Conexiones posteriores actualizar su copia local utilizando las últimas fuentes disponibles, la búsqueda sólo los archivos modificados. Es fácil restringir a una rama de versión específica, a instantáneas liberadas o revertir su repositorio local a una copia más antigua. Más detalles sobre la configuración de GIT para PARI. He actualizado de GIT y la construcción falla En primer lugar, no hay garantía de que las fuentes de borde de sangrado del servidor de desarrollo de hecho compilar. Usted puede tener mala suerte, y obtener una versión rota. Más probablemente, se han agregado nuevos módulos de código, que no fueron compilados. Simplemente intente ejecutar Configurar después de actualizar, los nuevos archivos serán tomados en cuenta por los Makefiles recién generados. También puede intentar hacer una limpieza si todavía tiene problemas. Configurar no encontrado Si obtiene un mensaje de error del comando de formulario no encontrado al intentar Configurar pari,. No está en la ruta de búsqueda para los comandos. Necesita escribir en el directorio toplevel. He construido gp y la edición de líneas no funciona Necesitas instalar GNU readline primero, luego ejecuta Configurar. Compruebe la salida Configurar para asegurarse de que se detecta la biblioteca readline. Puedes ayudar a Configurar con las banderas si instalaste tu biblioteca en un lugar exótico, o instalaste muchas y Configurar recoge el incorrecto. Intente hacer una limpieza antes de reportar un error: puede ser que una compilación anterior con opciones de configuración incorrectas interfiera con el intento ahora correcto. Estoy usando --with-xxx pero Configure sigue seleccionando la biblioteca incorrecta Por ejemplo Configurar --with-gmp path. Pero el libgmp predeterminado se encuentra en lugar del previsto. El comando es un alias para Configurar --with-gmp-lib path / lib --with-gmp-include ruta / include y un problema común es que lib64 fue diseñado en lugar de lib. La solución es escribir un override específico como en Linux: readline / ncurses no encontradas Las distribuciones de Linux tienen paquetes readline y readline-devel separados. Si sólo se instala readline, Configure se quejará: readline está allí para que los binarios precompilados puedan funcionar correctamente, necesita que ambos estén instalados para compilar programas con soporte de readline. Configure también puede quejarse de que falte libncurses. so en cuyo caso, instale el paquete ncurses-devel. (Algunas distribuciones le permiten instalar readline-devel sin ncurses-devel, que es un error en su manejo de dependencias de paquetes.) Linux: X11 bibliotecas gráficas no encontradas variante de esta FAQ. Se ha informado de que en las distribuciones SuSE, es necesario instalar xorg-x11-libs y xorg-x11. A veces, una compilación anterior (por ejemplo, interrumpida o después de una actualización de GIT) interfiere con la compilación subsiguiente, elimina de forma limpia toda la información almacenada en caché del directorio de compilación. Mis fuentes están en el nombre del directorio que contiene espacios. Construir rompe misteriosamente. Esto se informó específicamente en Mac OS X, al intentar compilar GNU readline. El mensaje exacto era: Esto fue causado por un directorio llamado Macintosh HD hasta la cadena de directorio entre el directorio de inicio de usuarios y la raíz. En particular, la variable de entorno HOME contiene espacios, algo que readline-5 configuración no puede manejar. Algunas versiones de PARI no podían manejarlas tampoco, pero esto ya no debería ser el caso. Si renombrar los directorios ofensivos no es una opción, una solución simple fue hacer lo siguiente, luego cd to / tmp / tmpreadline y reiniciar el procedimiento estándar. Lo anterior crea una derivación (enlace simbólico) desde / tmp / tmpreadline (no contiene espacios) al directorio en el que teníamos intención de trabajar. Adapte a sus necesidades específicas. Utilizando fuentes GIT, la compilación falla en parse. y Este archivo yacc debe ser procesado con un bison GNU lo suficientemente reciente. Versión 2.4 o superior. La distribución ya contiene los archivos compilados parse. c y parse. h. Por lo tanto este problema es específico para GIT: las personas que descargan la distribución no necesitan bisontes. No puedo construir un 64bit sparcv9 ejecutable En la arquitectura sparcv9, un binario de 32 bits se produce de forma predeterminada. Para reemplazar esto, necesitas escribir algo como (GNU cc) Es posible que desee especificar kernelnone-gmp en su lugar, pero es crucial usar el núcleo nativo portátil y no el sparcv9, ya que este último es específico de 32 bits. (Dado que sparc64 no admite la multiplicación de operandos de 64 bits en hardware, no había ningún punto en el portar el núcleo del ensamblador PARC sparc32). Puede encontrar problemas adicionales si el enlazador capta algunas bibliotecas de 32 bits en lugar de su equivalente de 64 bits. Esto puede ocurrir para bibliotecas instaladas por el usuario como libgcc o libgmp. En este caso, intente desactivar LDLIBRARYPATH (o restablecerlo a un valor adecuado) y, posiblemente, establecer LDRUNPATH en el directorio de 64 bits. Im utilizando SELinux y pari-dyn falla con permiso denegado Esto surgió en Fedora Core 6 como Bug 621. Andrew van Herick informó sobre el problema y trabajó en torno a ello mediante el ajuste de la política de seguridad SELinux. Utilizando las interfaces gráficas de Fedoras, esto se hace de la siguiente manera: En Gnome, vaya a Haga clic en la pestaña SELinux debajo de habilitar el cuadro con la etiqueta Tengo un error interno del compilador. No intentamos soportar compiladores rotos. Puede intentar compilar el módulo de código defectuoso utilizando un nivel de optimización inferior (por ejemplo, - O en lugar de - O3). O cambiar a una versión estable de un compilador fiable, p. Gcc Nuestra plataforma de integración continua reporta el estado actual de las ramas master (testing) y stable con respecto a una serie de arquitecturas y compiladores. Gcc-2.96 es una versión no oficial de gcc que desafortunadamente se distribuyó con muchas distribuciones de Linux. Estas versiones iniciales están mal rotas en varias arquitecturas, por ejemplo, ia64. Actualizar Im utilizando MacOS X y. Produce un fallo de segmentación. Como en el error 565. Primero, intenta actualizar tu versión de XCode. En particular, compruebe el número de compilación de gcc (por ejemplo, en encabezados gp, Apple Computer Inc. build xxx). Construye lt 5300 son muy buggy, construir 5363 funciona bien. Estoy usando MacOS X y hacer banco falla horriblemente. Por ejemplo bezout (32,432) devuelve 1,0,32. En primer lugar, intente actualizar PARI a la versión 2.7.0 o superior, que incluye una solución para el problema. Si todavía no funciona, por favor notifíquenos y luego siga leyendo: Este es un error doloroso en el compilador predeterminado de OS X Lion (LLVM build 2335.15.00), reportado como Bug 1252. Le sugerimos intentar instalar GCC-4.5, el La opción más simple es utilizar MacPorts en este caso debería ver su casa. Otra posibilidad, como solución temporal, que produce un binario gp más lento, pero evita la reinstalación de gcc: Aparece un mensaje BUG en el conjunto de pruebas del programa. En la versión 2.9 y superior, algo está mal. Por favor notifíquenos. En versiones pre-2.9, el banco de programas probó la característica de instalación, que no es compatible con todos los sistemas. Revise el archivo de diferencias relevante mencionado al final de la salida del banco de fabricación. Si la única diferencia viene de una instalación o uso fallido de addii. Sólo significa que install () no está soportado en su sistema por lo que no podrá utilizar esta función. Además de eso, puede ignorar con seguridad la Advertencia. Mi propio programa compilado OK, pero cuando intento ejecutarlo, obtengo un error al cargar bibliotecas compartidas: libpari. so En la mayoría de las plataformas, make install construye e instala una librería PARI compartida libpari. so (lo que significa que las funciones necesarias se cargan desde La biblioteca en tiempo de ejecución, no copiada en el archivo ejecutable en tiempo de enlace). Por defecto, esta biblioteca va a / usr / local / lib /. Desafortunadamente, esto a menudo no es suficiente para que su sistema sea consciente de la nueva biblioteca. Dado que el comando de enlace en su Makefile probablemente especifica algo como con LIBDIR apuntando al directorio que contiene libpari. so. La fase de enlace tiene éxito. Desafortunadamente, esto no se registra en el binario donde se puede encontrar la biblioteca compartida, y ejecutar el binario falla con el error anterior. Puede comprobar con ldd myprog cuáles son las bibliotecas compartidas que necesita su programa y cuáles son encontradas por el cargador dinámico de lib: esto debería fallar con un mensaje similar al anterior. Las siguientes soluciones están disponibles: Ejecute algo similar a ldconfig para que su sistema sea consciente de la nueva biblioteca. (Requiere poderes de root.) Hardcode un runpath dinámico en tu binario, añadiendo algo como - Wl, - rpath mi libpath exótica en el comando de enlace de tu Makefile. Vea los ejemplos / Makefile para saber cómo hacerlo en su sistema. (Esta es la solución elegida para el binario gp.) Requerir que todos los usuarios del programa cambien su LDLIBRARYPATH. Esto puede ser tan fácil como agregar en un archivo. bashprofile. Otra posibilidad es ejecutar en lugar de myprog. GP Specific ¿Cómo puedo personalizar los enlaces de teclas Esto es posible sólo si la biblioteca readline se compila en (el encabezado gp proporciona esta información al inicio). En este caso, debe crear un archivo. inputrc. Puede crear esto en su directorio personal bajo Unix o en cualquier lugar que desee, a continuación, establezca la variable de entorno INPUTRC en la ruta completa del archivo. inputrc. En este archivo, puede asociar acciones a secuencias de pulsaciones de teclas, p. Asocia Esc 1 5 C. la secuencia producida pulsando Control-RightArrow en mi sistema, a la acción forward-word. Mueva el cursor a la derecha por una palabra. Del mismo modo, las otras líneas asocian Control-LeftArrow a backward-word. UpArrow a la historia-búsqueda-hacia atrás. Y DownArrow a la búsqueda de la historia. Para obtener más información, consulte el manual de readlines. Para determinar qué secuencia está asociada a una combinación dada de pulsaciones de teclas, puede pulsar Control-V. Luego presione las teclas correspondientes. Gp imprimirá la secuencia correspondiente, con Esc codificado como. La lista de comandos enlazados y asociaciones de teclas asociadas está disponible mediante bind - p en el shell bash. He configurado PARI para usar readline y la terminación TAB sólo funciona si la finalización es única en lugar de mostrar todas las posibles compleciones Este es el comportamiento de readline predeterminado. Cuando hay más de una coincidencia, al tocar TAB una vez sólo completa el prefijo común más largo. Golpear TAB una segunda vez y luego muestra la lista de posibles conclusiones. Puede obtener el segundo comportamiento directamente después de un solo TAB añadiendo HOME /.inputrc (archivo de configuración readlines). Cómo buscar readlines historial de comandos bajo gp Readline proporciona una gran cantidad de funciones para buscar en el historial de comandos las líneas que contienen una cadena especificada. Hay dos modos de búsqueda: incremental (búsqueda mientras escribe) y no incremental (escriba un prefijo y, a continuación, inicie la búsqueda). Algunos de estos comandos están enlazados por defecto (todos ellos de forma incremental): Algunos están desvinculados (todos ellos no incrementales): Los dos últimos proporcionan la terminación de historial de estilo GAP / Magma para enlazarlos a la UpArrow y DownArrow. Agregue en HOME /.inputrc (archivo de configuración readlines). El resultado x es la entrada de historia n, pero no se comportan igual La función simplificar se aplica al resultado de gps, antes de almacenarlo en el historial, pero después de que el comando se evalúa completamente, en particular después de cualquier asignación de variable tiene lugar. Heres un ejemplo: a es todavía un polinomio de grado 0 en x, pero 1 ha sido simplificado. Puede simplificarse cuando quiera asegurarse de que un objeto tenga el tipo más simple posible esperado. Cómo puedo ordenar aumentando el valor absoluto Sustituir la función de comparación por defecto por un cierre anónimo: o por una función auxiliar de propósito especial La última solución, por desgracia, crea una función cmp globalmente visible. Puede utilizar la siguiente construcción intermedia para restringir subrutinas ad hoc a un ámbito de función: ¿Cómo puedo escribir un procedimiento (valor de retorno anulado)? Utilice return (). Sin argumentos. Quiero definir funciones dentro de una función de usuario Por ejemplo, sucede lo siguiente a trabajar pero éste no lo hace De hecho, llamar a este último define la función f (x) cuya definición es la que no es lo que se pretendía. De hecho, la gramática GP indica que el final de una definición de función es el final de la secuencia de expresión más larga después del prototipo. Y lo anterior es desafortunadamente una secuencia de expresión válida. La solución es sencilla: cuando se evalúa una llamada a init, se evalúa primero el código entre paréntesis, definiendo por separado f entonces g. Los argumentos no inicializados se establecen en 0 Quiero un error en lugar de Por razones de compatibilidad con versiones anteriores de GP (que utilizó los argumentos de función para declarar variables locales, antes de la introducción de mi), un argumento no inicializado a una función de usuario se establece en 0 : In current GP, there is no reason to add unnecessary variables in the argument list, AND we have the possibility to explicitly set a default value as in So a missing argument is probably a mistake and it would be more useful to get a warning than to silently go on with incorrect data, as for built-in functions : To enable this (backward incompatible) behaviour, set default(strictargs,1) before defining the function, or set strictargs 1 in your gprc: Can I install() a C function returning a GEN which may be NULL GEN being a pointer type, it is valid C to set a variable of type GEN to NULL and interpret this as a sentinel value. But this value is invalid to the GP interpreter, which expects only non - NULL objects. So when your instaled function happens to return NULL. the evaluator will crash with a Segmentation Fault. The correct solution, as when trying to install functions whose prototype is not supported by GP, is to write a small wrapper function and install that one instead. The following dirty trick also works in pure GP, without needing to mess with C code (not recommended). NULL is allowed in a very particular situation by the GP evaluator: to encode missing arguments in functions. So the following works: input() does not work from a script It does. Read the following from a file (or copy-paste it) Then typing fun() from the gp prompt waits for some user input. The reason why the simpler does not work, is that input() reads expression from the program standard input ( stdin ). As you are reading the script into gp, the script itself is fed into stdin. So input gets some data, specifically the return value of which is 0, then returns immediately. In the meantime, the expanded a2 isa2 has been printed, as a2 is a2 since at this point the value of a has not been modified. If you re-read the same commands into gp, it will now print a2 is 0. How can I read from a file one item at a time Indeed, read does not work since it reads in the whole file, and all intermediate values are discarded. The simplest solution is to write all data into a vector or list and save the latter. Another solution is to use the readvec function. It returns a vector whose entries contain the results of all expression sequences from the file. Let file contain Then A few amusing hacks: if you read in a file using r ( not with read ), all history entries will be filled, and you can later access them individually. The following construction could be helpful: On a Unix system, you can use the following trick (courtesy of Markus Endres) to input the n - th line of a given file . On a Unix system, you can use the following beautiful hack (courtesy of Bill Allombert) using named fifo files: create a fifo and start reading from it. In another shell, write your data to it. For example: The possibility of handling file objects in GP without resorting to such extremities is in the TODO list. How can I read space-separated data from a file, one line at a time Best answer: go and learn one of awk / sed / perl / python and preprocess your file Second best answer: you asked for it How can I read numbers from a file and store them into a vector How can I input integers in hexadecimal You may use the following function, courtesy of Martin Larsen on pari-user. The above does not work with gp2c, because of eval. Here is a more robust (and more efficient) version In pari-2.6. and above, the above can be streamlined as Is there a tutorial for extern Here is a worked out example for Cremonas mwrank. How can I loop over permutations How can I loop over all subsets of S How can I loop over subsets of S with k elements How can I loop over partitions In 2.6.1 and higher, use forpart(). For older versions, adapt the following code: How can I loop over divisors of polynomials Use fordiv. it is no longer specific to integers. I want bigger lists, 65533 is not enough Use pari-2.2.6 or newer: the limit is gone. Lists can be about as large as vectors (roughly 2 24 entries). If you are using an older version, this is not straightforward, since the limit is hardcoded into the object representation. You can break up your list into smaller chunks (use vectors of vectors) You can use a 64-bit machine: the limit goes from 2 16 - 3 to 2 46 - 3 I want more variables, 16383 is not enough Not straightforward, this is hardcoded into the object representation. You can use vectors instead of separate variables ( x1, x2 etc. instead of x1, x2 ). You can use a 64-bit machine: the limit goes from 2 14 - 1 to 2 16 - 1 How can I increase maximal recursion depth The maximal recursion depth is governed by the maximal stack space allocated to the gp process (not to be confused with gps stack). Use the following commands from the shell, before starting gp, to increase the process stack size to 20000 kbytes, say: If your shell is sh-based (bash, ksh, sh, zsh): If your shell is csh-based (csh, tcsh): Timing functions do not take system time into account where the second command actually requires about 10 seconds on my machine. This is intentional. PARI supports four timing functions clock. times. ftime and getrusage. The last one is chosen by default, since it is the most reliable, and it reports user time . not system or wallclock time. In particular, it should not depend on the system load. If you really want wallclock time, use Timer does not work when extern is involved The time elapsed in commands called via extern is not taken into account by gps timer. You may want to use A patch was proposed to take into account the children of the main gp process, but the current behaviour was deemed preferable. How can I timeout a command Features Should I use PARIs native kernel or the GMP kernel The GMP kernel is faster than the native one. Here are detailed benchmarks for integer and floating point arithmetic, comparing the two kernels. The only drawback of using the GMP kernel is that it is sometimes slightly slower for tiny inputs, and that the GMP-enabled PARI library is not compatible with the native one. In particular, all programs built using a native shared library must be rebuilt if it is replaced by a GMP-enabled one. Can PARI handle arbitrarily large numbers It depends on what you mean by handle. On a 32 bit machines, PARI cannot even represent integers larger than 2(229), or floating point numbers whose absolute binary exponent is larger than 230. But the main problem is that PARIs native kernel does not include enough fast algorithms that would enable it to process huge numbers in a decent time. (Integer multiplication is almost linear, but integer division is quadratic, for instance.) I would say mantissas of 10000 decimal digits are a sensible practical limit for intensive number crunching with PARIs native kernel. Using the GMP kernel. almost linear algorithms are available, and only the physical limitations of PARIs representation of integers and floats remain. Why are floating point operations so slow when precision is large Karatsuba multiplication was not enabled by default for type tREAL until version 2.2.4 included and a quadratic algorithm was used instead. Starting from version 2.2.5, this is no longer the case. Note that all division algorithms in the native kernel are quadratic, though. Almost linear algorithms are available through the GMP kernel. Why are divisions so slow All division algorithms in the current PARI kernel are quadratic. Almost linear algorithms are available through the GMP kernel. How do I enable the GMP kernel if you do not want to mess up with the binaries built using the native kernel. Using the GMP kernel, my session dies on a huge division This is a general problem in GMP before version 4.2. It may allocate a huge amount of memory in the process stack space (using alloca ). The best solution is to upgrade to GMP version 4.2 or higher. Otherwise, one can increase the maximum size of the process stack segment before starting gp from the shell. Alternatively, you can configure an old GMP with but this will slow down GMP. Do you have Fast Fourier Transforms Not publicly exported. The library functions FFTinit and FFT are available for classic (complex) polynomial FFT. The integer arithmetic uses DFT-based almost-linear algorithm, but do not export the transformed inputs: you cannot precondition on a constant operand, for instance. Why is cos(Pi) -1 but sin(Pi) -5.04870979 E-29 and not exactly 0 For gp, Pi is a rational approximation to pi, not exactly pi. With default precision it is within 10 -28 of pi. In particular, its sine is not 0. In fact cos(Pi) is not -1 either, but rather a real number close to -1: How do I get the list of variables appearing in an expression Here is a possibility, using 2.7. syntax: This code recursively inspects all components of an expression. It works around the following complication: there is no builtin function returning the components of an object, Vec works when applied to most types handled by variable. but tRFRAC and tPOLMOD must still be treated separately. In version 2.8. and above, use the built-in variables How can I expand a multivariate polynomial The reason is that PARI only knows about univariate polynomials (whose coefficient may themselves be polynomials, thus emulating multivariate algebra). The result above is really a simplified form of There is no flat or sparse representation of polynomials, and in particular no way to obtain parentheses-free expanded expressions like On the other hand, the following routine (courtesy of Michael Somos) comes close to what was requested: Mod(yx, y-1) returns 0 If you expected to get Mod(x, y-1), you need to understand the concept of variable priority. Due to variable priority, the computation takes place in Q(y)x in which 0 is the correct result. Please see subst(p, x, polroots(p)1) is huge Assuming p has exact coefficients, then the output of polroots. is exact to the current accuracy. This means that for each (non-zero) x in the output vector, there exists a complex root z of p such that the relative error x - z / x is small: its base-10 logarithm is less than - realprecision. This is guaranteed by the algorithm, due to Shnhage and refined by Gourdon, and any other behaviour is a bug worth reporting. On the other hand, the value p(x) itself may be large. For instance, with 28 digits of accuracy: Do you support sparse matrices/polynomials How does PARI factor integers The integer factorizer implements a variety of algorithms: Trial Division (all primes up to certain bound, plus user-defined private primetable, via addprimes ), Pure powers, Shankss SQUFOF, Pollard-Brent rho, Lenstras ECM (with Brent and Montgomery improvements), MPQS (self-initializing, single large prime variation). Output primes are BPSW-pseudoprimes. How efficient is factorint How does it compare with other free implementations It cannot compare with special-purpose high-performance implementations, especially non portable ones. PARIs ECM is slower than GMP-ECM (portable), written by Paul Zimmermann on top of GMP. comparative benches needed here . PARIs Quadratic Sieve routinely (less than 1 minute) factors general numbers in the 60 digits range. A few minutes are needed for 70 digits, a few hours for 80 and it has not really been tested in the 90 range. Besides PARI, we are aware of two other free MPQS implementations: mpqs4linux. written by Jens Franke, (ix86Linux)-specific. PPMQS-2.8. written by S. Tomabechi, ix86-specific, available for Windows or Linux. On my P4 1.6GHz, PARIs MPQS is 2 to 4 times faster than PPMPQS-2.8 in the 60 digits range, 2 times faster for 70 digits, and gets increasingly slower afterwards. E. g is already 3 times slower for 80 digits. We have not tested mpqs4linux . Are the factors guaranteed to be primes The factors output are not proven primes if they are larger than 2 64. They are Baillie-Pomerance-Selfridge-Wagstaff pseudoprimes, among which no composite has been found yet, although it is expected infinitely many exist. If you need a proven factorization, use Another possibility is to set This ensures that a true primality proof is computed whenever we do not explicitly ask for partial factorization. This will slow down PARI if largish primes turn up often. I monitor isprime() at g2 and I get untested integer messages. Can I trust the output Yes The message looks like: It is harmless: during tests of Pocklington-Lehmer type, isprime() calls factor() which may produce this message, but it does go on to prove recursively that the prime factors encountered really are prime. What primality tests do you use ispseudoprime(N) uses Baillie-Pomerance-Selfridge-Wagstaff deterministic test, which is a strong Rabin-Miller test for base 2, followed by a strong Lucas test for the sequence (P, -1), where P is the smallest positive integer such that P2 - 4 is not a square modulo N. It has been checked that no composite smaller than 2 64 passes this test. ispseudoprime(N, k) with k gt 0. performs a strong Rabin-Miller test for k randomly chosen bases (with end-matching to catch roots of -1). This variant is about as fast as ispseudoprime(N) when k 3. and slower afterwards. isprime(N) first performs an ispseudoprime test. If N is larger than 2 64. Selfridge-Pocklington-Lehmer p-1 test is performed if N-1 is smooth (factored part is larger than N 1/3 -- Konyagin-Pomerance or more involved algorithms based on lattice reduction are not implemented). Otherwise we use APR-CL (Adleman-Pomerance-Rumely, Cohen-Lenstra). A number of improvements should be implemented: N1 test and combined N-1/N1 tests, higher cyclotomic tests (Bosma-Van der Hulst). An ECPP would be nice. PARIs APR-CL can prove primality of numbers with 1000 digits in a few hours. Some examples on a 2.8GHz Pentium IV: Do you have AKS In its present form (January 2006), the Agrawal-Kayal-Saxena primality test is not practical for large numbers. Efficiency not being a primary concern, it is a simple exercise in GP programming to implement the algorithm. I monitor factorint() at g4, and ECM seems to be stuck You get messages of the form and the last line is repeated seemingly forever. The short answer is: ECM is still making progress, although the diagnostics do not show it (detailed explanation ). MPQS gives a sizing marginal warning This problem is specific to version 2.2.10 and occurs while factoring smallish integers with MPQS. For instance This diagnostic was left in place to detect suboptimal behaviour with respect to the chosen tunings. This is not a bug and the result is correct. The associated tuning problem is fixed in 2.2.11. Let Knfinit(x21). Routine xxx dies on ideal J 5, 4 0, 1 Assuming that K. zk 1, x (which it should be, given nfinit s current implementation), J is not an ideal. It is a matrix in HNF form, but the Z-module generated by its columns is not an O K - module ( exercise ). In fact, the two ideals above 5 are PARI routines transform suitable objects (element in K, prime ideal) to an ideal (matrix in HNF), but do not check that matrices of the right dimension do indeed correspond to ideals, which would be quite costly. If you are unsure about how to input ideals, use idealhnf systematically, or ideals produced by other PARI routines. If you insist on finding the O K - module generated by the columns of your matrix, you may use something like For better efficiency, J is put in HNF form first. You can also use directly idealhnf if your matrix does not have maximal rank, yielding the faster variant: As written, this assumes J is contained in O K and does not work if J has Z-rank 0 or 1, but you get the idea. How to compute nfinit(P) when I cannot factor disc(P) Use something like This computes an nf structure from P . containing a tentative maximal order, which is only required to be maximal at primes less than B . The result is guaranteed to be correct whenever the field discriminant is B - smooth, i. e. has no prime divisor larger than B . If it has (at least two distinct) large prime divisors, on the other hand, the result will be wrong. If such prime factors of the discriminant are known, you can use for each such p . or addprimes(L) for a list L of such primes. The output can be certified, independently of B: nfcertify(nf) outputs either an empty vector: all is fine, the nf structure is correct or a vector of composite integers, which you must factor in order to produce a proven (possibly different) result you may then use addprimes with the corresponding prime divisors. Which computations depend on the truth of the GRH The routines bnfinit and quadclassunit assume the truth of the Generalized Riemann Hypothesis, in order to have a small set of generators for the class group. From 2.4.0 on, they assume no more than the GRH. They are marginally slower than before, but no longer output wrong results (that we know of ). to certify the bnf unconditionally. If the discriminant is large, this will be slow . and may overflow the possibilities of the implementation. Results obtained using a certified bnf do not depend on the GRH. Note that output from quadclassunit cannot be certified. Use bnfinit instead if certification is important. Finally, quadunit and quadregulator do not assume the GRH (and are much slower than quadclassunit ). This paragraph is relevant for version numbers less than 2.4.0 In fact, bnfinit assumed more than GRH, namely that the ideals of norm less than 0.3 log( disc(K) ) 2 generate the class group of K. This is not known even under the GRH, which implies the above with 12 in place of 0.3, a famous result of Eric Bach the constant can be further optimized depending on the signature and assuming the discriminant is large enough, but not down to 0.3 in any case. Also, there are counter-examples even for relatively large discriminants. unlucky random seeds actually gave a wrong result. So, technically, any result computed using a bnf from bnfinit was conditional, depending on a heuristic strengthening of a result already depending on the GRH. One could make sure that no more than the GRH is used with instead of bnfinit(P) . This is slower, of course. At worst about 40 times slower when the original result would have been right. The routine quadclassunit had the same problem as bnfinit (0.3 being replaced by 0.2). If you want to use no more than the GRH, use Besides all functions using a bnf argument, the routines bnfclassunit. bnfclgp. bnfreg are trivial wrappers around bnfinit and make the same assumptions. All these routines predate the introduction of member functions and are now obsolete: bnfinit gives much more information in about the same time, is about as easy to use (using member functions), and has the further advantage of being an init function. ellap(E, p) is very slow when p is large, or even raises an exception If E/Fp has complex multiplication by a principal imaginary quadratic order, we use a very fast explicit formula (quadratic in log p). Otherwise we rely on Shanks-Mestres baby-step giant step method, whose run-time is unfortunately exponential. Hence this naive algorithm becomes unreasonable when p has about 30 decimal digits. To go beyond that (assuming you are running PARI version 2.4.3 or higher), please install the optional package SEAdata. implementing the Schoof-Elkies-Atkin algorithm. It should work at least up to 400 decimal digits, way beyond cryptographic sizes. Can I use Cremonas mwrank with gp You may use SAGE. As for most external stand-alone programs without a graphical user interface, you may also call mwrank directly from gp, using extern. What is a BIB. What happens when my input doesnt make sense Many routines expect operands of a specified type and shape, for instance nf, bnf, bnr, ell, modpr structures, or satisfying certain documented preconditions, e. g. an integer which is actually a prime. For reasons of efficiency, PARI routines trust the user input and only perform minimal sanity checks. When a subtle undetected violation is performed, any of the following may occur: a regular exception is raised, the PARI stack overflows, a SIGSEGV or SIGBUS signal is generated, or we enter an infinite loop. The function can also quietly return a mathematically meaningless result: junk in, junk out. Bugs in this class (Bad Input Bugs, or BIBs for short) are never fixed whenever a noticeable code complication or performance penalty would occur. All PARI objects and internals are exposed and at your disposal, which is both convenient and unsafe. There are plans to add more semantic to PARI types so that e. g. an ell structure would record the fact that it is not an arbitrary vector, but actually associated to an elliptic curve. Not yet. intnum() gives ridiculous results This paragraph applies to versions prior to 2.2.9. For instance The first integral should be indistinguishable from the integral to infinity, which is sqrt(Pi)/4. and the second is exactly Pi/2. Numeric integration evaluates the function at regularly spaced points in the integration interval, then uses a standard quadrature rule. This is tried for a few decreasing values of the subdivision diameter until the value appears to stabilize (in fact, was accurately predicted by interpolation from the four last values). This gives incorrect results for functions of period a large power of 2 as in the second example. Or if most of the weight is concentrated in a very small interval as in the first example, where the function is essentially 0 in most of the interval. For the time being, the user must break the integral into harmless chunks, or perform relevant change of variables herself. E. g make sure the function varies slowly, move singularities to the boundary or (better) remove them, restrict the interval to a region where the function is not negligible. Starting from version 2.2.9, we use the double exponential method instead of standard Romberg, and get better results: It still helps a lot to split the integral into pieces, and indicate the growth rate and oscillation pattern of the function at their boundary, and possibly to use more sampling points for oscillating functions. Otherwise, loss of accuracy may be expected. Modular objects behave strangely Elementary operations involving INTMOD s and POLMOD s with different moduli p and q first project both operands to the quotient modulo the ideal (p, q) . In the above, the moduli 2 and 3 are coprime and we obtain the 0 ring. This explains the first example. For the second, notice that the result of Mod(1,2)x is a polynomial in (Z/2Z)x whose constant coefficient is Mod(0,2). Another example is whereas one might expect Mod(0,4) instead. Modular object operate with respect to a fixed modulus, which is never increased (it may be replaced by a strict divisor as explained above). To keep track of accuracy, you may use PADIC s, but operations will be much slower than with INTMOD s. If efficiency is a primary concern, use INT s, keeping track of denominators separately, and reduce with relevant moduli to avoid coefficient explosion. Is PARI suitable for high performance computation It depends on what you mean by that. PARI was not written to handle huge objects (e. g. millions of digits, dimension in the thousands). It can do it, but different algorithms should be used for these ranges, which are not currently implemented. PARI is quite good for heavy-duty computations in algebraic number theory. System Specific How can I get/use GP under Windows A self-installing binary is available from the download page. How can I get GP2C under Windows We do not distribute any GP2C binaries for Windows currently: GP2C generates C files that need to be compiled with a C compiler. If you do not have a working C compilation environment, then GP2C cannot work for you. Users with a working C compilation environment can build GP2C from source. I cannot read in a GP file I am assuming that you started the GP. EXE program by (double) clicking on the PARI link which was created on the windows Desktop. Check the Properties of the link in the right-click menu. If you did not tamper with it at installation time, it states that the program starts in directory This is where GP expects to find its input files. That is if you type in this will work if and only if we have a file foo or foo. gp in Update the path default in gprc. txt if you want to store your GP files in some other directory. Another possibility: some Windows editors, e. g. NotePad, automatically append a. txt suffix to the files they create. Make sure your file is really called foo and not foo. txt. Cutn Paste does not work Right click on the GP icon and change Properties-gtMisc. select Quick Edit and deselect Fast Pasting. See also the GAP help pages on the subject. I cannot enter the - key You are running a keyboard driver for some non-English languages. These drivers catch the character to produce the circumflex accent and do not pass it properly to PARI. You may try to type a SPACE after the dead key, to produce a true it may or may not fix the problem. The Delete key does not work This depends on your Windows installation and the compilers used when building the binary. It may work properly, or it may emit a beep and prints a tilde character . In the latter case, no fix is known: use Backspace instead, or readline commands. I would like a 64-bit gp. exe application. Since pari-2.7.5, we now distribute both 32-bit and 64-bit binaries. What is Cygwin Do I need it for GP Cygwin is a UNIX environment for Windows, developed by Red Hat Software. It consists of two parts: A library (DLL, called cygwin1.dll) which acts as a UNIX emulation layer providing substantial UNIX functionality. A collection of tools, ported from UNIX, which provide UNIX/Linux look and feel. The gp. exe binary we provide used to rely on the DLL (which we distributed together with the binary), but this is no longer the case. If you wish to compile gp yourself, as described in the manual for Unix systems, you need the Cygwin building tools. I installed Cygwin, but cant get it to build gp If the error looks like then you did not install the full Cygwin distribution (specifically, you are missing Cygwins gcc here). In the example above, there are already versions of gcc and make available from the mingw compiler, adding to the confusion. How can I build a libpari DLL Using recent Cygwin development tools (downloaded March 20 2003) and GIT version of PARI, a DLL is produced which at least works under Cygwin. I do not know whether it still works in other build environments. Please test and report How can I get/use gp under MacOS 9 and below This version of gp is not maintained anymore. You can get a 6 years-old legacy binary gp-2.0.14.sit. bin from the FTP archives. This is a sit archive, which may be extracted using StuffIt expander. How can I get/use gp under MacOS X and above You can get gp from the Fink or MacPorts distribution. But both only provide the stable version of pari, and you may want to try new features. Alternatively you can install Apples Developer Tools, which should be on one of your installations CDs. The current name of the tool suite is XCode. Then you can compile pari yourself: download the Unix source archive ( pari. tgz. tar. gz format). It is also possible to download PARI sources via GIT. extract the content of the archive: tar zxf pari. tgz change directory to the extracted folder pari xxx / read README file You probably want to read this FAQ. which solves a very common problem. I cant get readline to work under MacOS X.4 (or later) Towards the end, Configure prints the message You can still compile gp. but line editing, history and command completion will not work. Synopsis Although a libreadline. dylib library is part of OS 10.4, it is a fake: a simple link to a replacement library, editline. which is only partially compatible with readline. So we must install the true readline library. Step 1 Step 2 Extract the archive ( tar zxf readline-6.3.tar. gz ), then copy-paste the following in a Terminal: This installs a proper shared library for readline, under /usr/local (thus it does not disturb your vendors libraries and wont cause problems in other parts of the system). Now rejoice: you have solved the readline problem once and for all. Step 3 Now, you can compile and install PARI, making sure that the proper readline is used: Caveat. It is in principle possible to install readline in a different location by using when configuring readline. Dont do that. this breaks the library, which will now raise a runpath error on startup ( dyld: library not loaded ). The technical reason is that libreadlines install-name is set incorrectly when libreadline is created, in this case. How can I get hi-res graphics under MacOS Under MacOS 9 and below, you cant. With MacOS X, if you have installed an XFree server and X11 developers libraries, then compile gp as explained above. it should pick up the X11 installation. Starting from version 2.6.0, hi-res graphics should work out of the box: Configure will default to the plotps graphic engine, which requires no external library. make install fails for pari-2.7.0 Indeed it fails with This is a glitch affecting OS/X systems, when building without GMP. In the file change the target install-lib-dyn-link. by prepending a - (minus) sign on the first line. So that on line 498 becomes Then you can re-run Configure and make install should work. An identifier which does not refer to a value. A non-referential identifier will usually print as a string containing its name. Expressions containing non-referential identifiers will not be evaluated, though they may be simplified. Non-referential identifiers represent unknowns or parameters when performing algebraic derivations. How to get a value referring to an identifier. The identifier may be the name of a variable containing a value. But the value referring to the identifier is distinct from the value in the variable. One may manipulate a value referring to an identifier even if it is not the name of a variable. How to declare a global variable. How to declare a local variable. There is my for declaring a local variable with lexical scope and local for declaring a variable with dynamic scope. local can be used to change the value of a global as seen by any functions which are called while the local scope is in effect. The null literal. How to handle an exception. Calling Error() invokes the GAP debugger, which is similar to a Lisp debugger. In particular, all the commands available in the GAP REPL are still available. Variables can be inspected and modified while in the debugger but any changes will be lost when the debugger is quitted. One uses quit or D to exit the debugger. These commands also cause the top-level GAP REPL exit if used while not in a debugger. If Error() is invoked while in the GAP debugger, the debugger will be invoked recursively. One must use quit for each level of debugger recursion to return to the top - level GAP REPL. to print the top four functions on the stack when the error occurred. Use DownEnv() and UpEnv() to move down the stacki. e. from callee to callerand UpEnv() to move up the stack. The commands take the number of levels to move down or up: When the debugger is invoked, it will print a message. It may give the user the option of providing a value with the return statement so that a computation can be continued: finally block
No comments:
Post a Comment