From 738094a8d8f11fefc709f3c19eb08d8b461504d9 Mon Sep 17 00:00:00 2001 From: pcpa Date: Sat, 13 Dec 2014 21:05:42 -0200 Subject: [PATCH] Update to sagemath 6.4.1 --- .gitignore | 1 + Jmol.js | 1663 ------- JmolHelp.html | 79 - sagemath-4ti2.patch | 8 +- sagemath-cbc.patch | 6 +- sagemath-cremona.patch | 8 +- sagemath-cryptominisat.patch | 6 +- sagemath-ecl-unicode.patch | 100 - sagemath-extensions.patch | 6 +- sagemath-fes.patch | 6 +- sagemath-gap-hap.patch | 6 +- sagemath-lrcalc.patch | 6 +- sagemath-lrslib.patch | 6 +- sagemath-nauty.patch | 6 +- sagemath-ntl6.patch | 1422 ------ sagemath-pari.patch | 12 +- sagemath-pari2.7.patch | 8511 ---------------------------------- sagemath-png.patch | 10 +- sagemath-readonly.patch | 6 +- sagemath-rpmbuild.patch | 24 +- sagemath-sagedoc.patch | 38 +- sagemath-sagenb.patch | 125 +- sagemath-scons.patch | 6 +- sagemath-scripts.patch | 187 +- sagemath-sphinx.patch | 139 - sagemath.spec | 130 +- sources | 2 +- 27 files changed, 276 insertions(+), 12243 deletions(-) delete mode 100644 Jmol.js delete mode 100644 JmolHelp.html delete mode 100644 sagemath-ecl-unicode.patch delete mode 100644 sagemath-ntl6.patch delete mode 100644 sagemath-pari2.7.patch delete mode 100644 sagemath-sphinx.patch diff --git a/.gitignore b/.gitignore index 941e8c6..3c23a60 100644 --- a/.gitignore +++ b/.gitignore @@ -6,3 +6,4 @@ /sage-6.1.1.tar.gz /sage-6.2.tar.gz /sage-6.3.tar.gz +/sage-6.4.1.tar.gz diff --git a/Jmol.js b/Jmol.js deleted file mode 100644 index 5258856..0000000 --- a/Jmol.js +++ /dev/null @@ -1,1663 +0,0 @@ -/* Jmol 12.0 script library Jmol.js 9:48 PM 1/31/2011 Bob Hanson - - checkbox heirarchy -- see http://chemapps.stolaf.edu/jmol/docs/examples-11/check.htm - - based on: - * - * Copyright (C) 2004-2005 Miguel, Jmol Development, www.jmol.org - * - * Contact: hansonr@stolaf.edu - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA - * 02111-1307 USA. - */ - -// for documentation see www.jmol.org/jslibrary - -try{if(typeof(_jmol)!="undefined")exit() - -// place "?NOAPPLET" on your command line to check applet control action with a textarea -// place "?JMOLJAR=xxxxx" to use a specific jar file - -// bob hanson -- jmolResize(w,h) -- resizes absolutely or by percent (w or h 0.5 means 50%) -// angel herraez -- update of jmolResize(w,h,targetSuffix) so it is not tied to first applet -// bob hanson -- jmolEvaluate -- evaluates molecular math 8:37 AM 2/23/2007 -// bob hanson -- jmolScriptMessage -- returns all "scriptStatus" messages 8:37 AM 2/23/2007 -// bob hanson -- jmolScriptEcho -- returns all "scriptEcho" messages 8:37 AM 2/23/2007 -// bob hanson -- jmolScriptWait -- 11:31 AM 5/2/2006 -// bob hanson -- remove trailing separatorHTML in radio groups -- 12:18 PM 5/6/2006 -// bob hanson -- adds support for dynamic DOM script nodes 7:04 AM 5/19/2006 -// bob hanson -- adds try/catch for wiki - multiple code passes 7:05 AM 5/19/2006 -// bob hanson -- auto-initiates to defaultdir/defaultjar -- change as desired. -// bob hanson -- adding save/restore orientation w/ and w/o delay 11:49 AM 5/25/2006 -// bob hanson -- adding AjaxJS service 11:16 AM 6/3/2006 -// bob hanson -- fix for iframes not available for finding applet -// bob hanson -- added applet fake ?NOAPPLET URL flag -// bob hanson -- added jmolSetCallback(calbackName, funcName) 3:32 PM 6/13/2006 -// used PRIOR to jmolApplet() or jmolAppletInline() -// added 4th array element in jmolRadioGroup -- title -// added and id around link, checkbox, radio, menu -// fixing AJAX loads for MSIE/Opera-Mozilla incompatibility -// -- renamed Jmol-11.js from Jmol-new.js; JmolApplet.jar from JmolAppletProto.jar -// renamed Jmol.js for Jmol 11 distribution -// -- modified jmolRestoreOrientation() to be immediate, no 1-second delay -// bob hanson -- jmolScriptWait always returns a string -- 11:23 AM 9/16/2006 -// bh -- jmolCommandInput() -// bh -- jmolSetTranslation(TF) -- forces translation even if there might be message callback issues -// bh -- minor fixes suggested by Angel -// bh -- adds jmolSetSyncId() and jmolGetSyncId() -// bh 3/2008 -- adds jmolAppendInlineScript() and jmolAppendInlineArray() -// bh 3/2008 -- fixes IE7 bug in relation to jmolLoadInlineArray() -// bh 6/2008 -- adds jmolSetAppletWindow() -// Angel H. 6/2008 -- added html " - var t = "" - if (labelHtml.toLowerCase().indexOf("")>=0) { - t += eospan - eospan = ""; - } - t += "" +eospan; - if (_jmol.debugAlert) - alert(t); - return _jmolDocumentWrite(t); -} - -function jmolStartNewRadioGroup() { - ++_jmol.radioGroupCount; -} - -function jmolRadioGroup(arrayOfRadioButtons, separatorHtml, groupName, id, title) { - /* - - array: [radio1,radio2,radio3...] - where radioN = ["script","label",isSelected,"id","title"] - - */ - - _jmolInitCheck(); - var type = typeof arrayOfRadioButtons; - if (type != "object" || type == null || ! arrayOfRadioButtons.length) { - alert("invalid arrayOfRadioButtons"); - return; - } - separatorHtml != undefined && separatorHtml != null || (separatorHtml = "  "); - var len = arrayOfRadioButtons.length; - jmolStartNewRadioGroup(); - groupName || (groupName = "jmolRadioGroup" + (_jmol.radioGroupCount - 1)); - var t = ""; - for (var i = 0; i < len; ++i) { - if (i == len - 1) - separatorHtml = ""; - var radio = arrayOfRadioButtons[i]; - type = typeof radio; - if (type == "object") { - t += _jmolRadio(radio[0], radio[1], radio[2], separatorHtml, groupName, (radio.length > 3 ? radio[3]: (id ? id : groupName)+"_"+i), (radio.length > 4 ? radio[4] : 0), title); - } else { - t += _jmolRadio(radio, null, null, separatorHtml, groupName, (id ? id : groupName)+"_"+i, title); - } - } - t+="" - if (_jmol.debugAlert) - alert(t); - return _jmolDocumentWrite(t); -} - - -function jmolRadio(script, labelHtml, isChecked, separatorHtml, groupName, id, title) { - _jmolInitCheck(); - if (_jmol.radioGroupCount == 0) - ++_jmol.radioGroupCount; - var t = _jmolRadio(script, labelHtml, isChecked, separatorHtml, groupName, (id ? id : groupName + "_" + _jmol.radioCount), title ? title : 0); - if (_jmol.debugAlert) - alert(t); - return _jmolDocumentWrite(t); -} - -function jmolLink(script, label, id, title) { - _jmolInitCheck(); - id != undefined && id != null || (id = "jmolLink" + _jmol.linkCount); - label != undefined && label != null || (label = script.substring(0, 32)); - ++_jmol.linkCount; - var scriptIndex = _jmolAddScript(script); - var t = "" + label + ""; - if (_jmol.debugAlert) - alert(t); - return _jmolDocumentWrite(t); -} - -function jmolCommandInput(label, size, id, title) { - _jmolInitCheck(); - id != undefined && id != null || (id = "jmolCmd" + _jmol.cmdCount); - label != undefined && label != null || (label = "Execute"); - size != undefined && !isNaN(size) || (size = 60); - ++_jmol.cmdCount; - var t = ""; - if (_jmol.debugAlert) - alert(t); - return _jmolDocumentWrite(t); -} - -function _jmolCommandKeyPress(e, id, target) { - var keycode = (window.event ? window.event.keyCode : e ? e.which : 0); - if (keycode == 13) { - var inputBox = document.getElementById(id) - _jmolScriptExecute(inputBox, inputBox.value, target) - } -} - -function _jmolScriptExecute(element,script,target) { - if (typeof(script) == "object") - script[0](element, script, target) - else - jmolScript(script, target) -} - -function jmolMenu(arrayOfMenuItems, size, id, title) { - _jmolInitCheck(); - id != undefined && id != null || (id = "jmolMenu" + _jmol.menuCount); - ++_jmol.menuCount; - var type = typeof arrayOfMenuItems; - if (type != null && type == "object" && arrayOfMenuItems.length) { - var len = arrayOfMenuItems.length; - if (typeof size != "number" || size == 1) - size = null; - else if (size < 0) - size = len; - var sizeText = size ? " size='" + size + "' " : ""; - var t = "" - if (labelHtml.toLowerCase().indexOf("")>=0) { - t += eospan - eospan = ""; - } - t += "" +eospan + separatorHtml; - - return t; -} - -function _jmolFindApplet(target) { - // first look for the target in the current window - var applet = _jmolFindAppletInWindow(_jmol.appletWindow != null ? _jmol.appletWindow : window, target); - // THEN look for the target in child frames - if (applet == undefined) - applet = _jmolSearchFrames(window, target); - // FINALLY look for the target in sibling frames - if (applet == undefined) - applet = _jmolSearchFrames(top, target); // look starting in top frame - return applet; -} - -function _jmolGetApplet(targetSuffix){ - var target = "jmolApplet" + (targetSuffix ? targetSuffix : "0"); - var applet = _jmolFindApplet(target); - if (applet) return applet - _jmol.alerted || alert("could not find applet " + target); - _jmol.alerted = true; - return null -} - -function _jmolSearchFrames(win, target) { - var applet; - var frames = win.frames; - if (frames && frames.length) { // look in all the frames below this window - try{ - for (var i = 0; i < frames.length; ++i) { - applet = _jmolSearchFrames(frames[i], target); - if (applet) - return applet; - } - }catch(e) { - if (_jmol.debugAlert) - alert("Jmol.js _jmolSearchFrames cannot access " + win.name + ".frame[" + i + "] consider using jmolSetAppletWindow()") - } - } - return applet = _jmolFindAppletInWindow(win, target) -} - -function _jmolFindAppletInWindow(win, target) { - var doc = win.document; - if (doc.getElementById(target)) - return doc.getElementById(target); - else if (doc.applets) - return doc.applets[target]; - else - return doc[target]; -} - -function _jmolAddScript(script) { - if (!script) - return 0; - var index = _jmol.scripts.length; - _jmol.scripts[index] = script; - return index; -} - -function _jmolClick(elementClicked, scriptIndex, targetSuffix) { - _jmol.element = elementClicked; - _jmolScriptExecute(elementClicked, _jmol.scripts[scriptIndex], targetSuffix); -} - -function _jmolMenuSelected(menuObject, targetSuffix) { - var scriptIndex = menuObject.value; - if (scriptIndex != undefined) { - _jmolScriptExecute(menuObject, _jmol.scripts[scriptIndex], targetSuffix); - return; - } - var len = menuObject.length; - if (typeof len == "number") { - for (var i = 0; i < len; ++i) { - if (menuObject[i].selected) { - _jmolClick(menuObject[i], menuObject[i].value, targetSuffix); - return; - } - } - } - alert("?Que? menu selected bug #8734"); -} - - -_jmol.checkboxMasters = {}; -_jmol.checkboxItems = {}; - -function jmolSetCheckboxGroup(chkMaster,chkBox) { - var id = chkMaster; - if(typeof(id)=="number")id = "jmolCheckbox" + id; - chkMaster = document.getElementById(id); - if (!chkMaster)alert("jmolSetCheckboxGroup: master checkbox not found: " + id); - var m = _jmol.checkboxMasters[id] = {}; - m.chkMaster = chkMaster; - m.chkGroup = {}; - for (var i = 1; i < arguments.length; i++){ - var id = arguments[i]; - if(typeof(id)=="number")id = "jmolCheckbox" + id; - checkboxItem = document.getElementById(id); - if (!checkboxItem)alert("jmolSetCheckboxGroup: group checkbox not found: " + id); - m.chkGroup[id] = checkboxItem; - _jmol.checkboxItems[id] = m; - } -} - -function _jmolNotifyMaster(m){ - //called when a group item is checked - var allOn = true; - var allOff = true; - for (var chkBox in m.chkGroup){ - if(m.chkGroup[chkBox].checked) - allOff = false; - else - allOn = false; - } - if (allOn)m.chkMaster.checked = true; - if (allOff)m.chkMaster.checked = false; - if ((allOn || allOff) && _jmol.checkboxItems[m.chkMaster.id]) - _jmolNotifyMaster(_jmol.checkboxItems[m.chkMaster.id]) -} - -function _jmolNotifyGroup(m, isOn){ - //called when a master item is checked - for (var chkBox in m.chkGroup){ - var item = m.chkGroup[chkBox] - item.checked = isOn; - if (_jmol.checkboxMasters[item.id]) - _jmolNotifyGroup(_jmol.checkboxMasters[item.id], isOn) - } -} - -function _jmolCbClick(ckbox, whenChecked, whenUnchecked, targetSuffix) { - _jmol.control = ckbox - _jmolClick(ckbox, ckbox.checked ? whenChecked : whenUnchecked, targetSuffix); - if(_jmol.checkboxMasters[ckbox.id]) - _jmolNotifyGroup(_jmol.checkboxMasters[ckbox.id], ckbox.checked) - if(_jmol.checkboxItems[ckbox.id]) - _jmolNotifyMaster(_jmol.checkboxItems[ckbox.id]) -} - -function _jmolCbOver(ckbox, whenChecked, whenUnchecked) { - window.status = _jmol.scripts[ckbox.checked ? whenUnchecked : whenChecked]; -} - -function _jmolMouseOver(scriptIndex) { - window.status = _jmol.scripts[scriptIndex]; -} - -function _jmolMouseOut() { - window.status = " "; - return true; -} - -function _jmolSetCodebase(codebase) { - _jmol.codebase = codebase ? codebase : "."; - if (_jmol.debugAlert) - alert("jmolCodebase=" + _jmol.codebase); -} - -function _jmolOnloadResetForms() { - // must be evaluated ONLY once - _jmol.previousOnloadHandler = window.onload; - window.onload = - function() { - with (_jmol) { - if (buttonCount+checkboxCount+menuCount+radioCount+radioGroupCount > 0) { - var forms = document.forms; - for (var i = forms.length; --i >= 0; ) - forms[i].reset(); - } - if (previousOnloadHandler) - previousOnloadHandler(); - } - } -} - -//////////////////////////////////// -/////extensions for getProperty///// -//////////////////////////////////// - - -function _jmolEvalJSON(s,key){ - s=s+"" - if(!s)return [] - if(s.charAt(0)!="{"){ - if(s.indexOf(" | ")>=0)s=s.replace(/\ \|\ /g, "\n") - return s - } - var A = eval("("+s+")") - if(!A)return - if(key && A[key])A=A[key] - return A -} - -function _jmolEnumerateObject(A,key){ - var sout="" - if(typeof(A) == "string" && A!="null"){ - sout+="\n"+key+"=\""+A+"\"" - }else if(!isNaN(A)||A==null){ - sout+="\n"+key+"="+(A+""==""?"null":A) - }else if(A.length){ - sout+=key+"=[]" - for(var i=0;ib[0]?-1:0) -} - -function _jmolSortMessages(A){ - if(!A || typeof(A)!="object")return [] - var B = [] - for(var i=A.length-1;i>=0;i--)for(var j=0;j=0;) - for(var j=0;j< Ret[i].length;j++) - s+=Ret[i][j]+"\n" - return s -} - -function jmolScriptWaitOutput(script, targetSuffix) { - targetSuffix == undefined && (targetSuffix="0") - var ret = "" - try{ - if (script) { - _jmolCheckBrowser(); - var applet=_jmolGetApplet(targetSuffix); - if (applet) ret += applet.scriptWaitOutput(script); - } - }catch(e){ - } - return ret; -} - -function jmolEvaluate(molecularMath, targetSuffix) { - - //carries out molecular math on a model - - targetSuffix == undefined && (targetSuffix="0") - var result = "" + jmolGetPropertyAsJavaObject("evaluate", molecularMath, targetSuffix); - var s = result.replace(/\-*\d+/,"") - if (s == "" && !isNaN(parseInt(result)))return parseInt(result); - var s = result.replace(/\-*\d*\.\d*/,"") - if (s == "" && !isNaN(parseFloat(result)))return parseFloat(result); - return result; -} - -function jmolScriptEcho(script, targetSuffix) { - // returns a newline-separated list of all echos from a script - targetSuffix == undefined && (targetSuffix="0") - var Ret=jmolScriptWaitAsArray(script, targetSuffix) - var s = "" - for(var i=Ret.length;--i>=0;) - for(var j=Ret[i].length;--j>=0;) - if (Ret[i][j][1] == "scriptEcho")s+=Ret[i][j][3]+"\n" - return s.replace(/ \| /g, "\n") -} - - -function jmolScriptMessage(script, targetSuffix) { - // returns a newline-separated list of all messages from a script, ending with "script completed\n" - targetSuffix == undefined && (targetSuffix="0") - var Ret=jmolScriptWaitAsArray(script, targetSuffix) - var s = "" - for(var i=Ret.length;--i>=0;) - for(var j=Ret[i].length;--j>=0;) - if (Ret[i][j][1] == "scriptStatus")s+=Ret[i][j][3]+"\n" - return s.replace(/ \| /g, "\n") -} - - -function jmolScriptWaitAsArray(script, targetSuffix) { - var ret = "" - try{ - jmolGetStatus("scriptEcho,scriptMessage,scriptStatus,scriptError",targetSuffix) - if (script) { - _jmolCheckBrowser(); - var applet=_jmolGetApplet(targetSuffix); - if (applet) ret += applet.scriptWait(script); - ret = _jmolEvalJSON(ret,"jmolStatus") - if(typeof ret == "object") - return ret - } - }catch(e){ - } - return [[ret]] -} - - - -//////////// save/restore orientation ///////////// - -function jmolSaveOrientation(id, targetSuffix) { - targetSuffix == undefined && (targetSuffix="0") - return _jmol["savedOrientation"+id] = jmolGetPropertyAsArray("orientationInfo","info",targetSuffix).moveTo -} - -function jmolRestoreOrientation(id, targetSuffix) { - targetSuffix == undefined && (targetSuffix="0") - var s=_jmol["savedOrientation"+id] - if (!s || s == "")return - s=s.replace(/1\.0/,"0") - return jmolScriptWait(s,targetSuffix) -} - -function jmolRestoreOrientationDelayed(id, delay, targetSuffix) { - arguments.length < 2 && (delay=1) - targetSuffix == undefined && (targetSuffix="0") - var s=_jmol["savedOrientation"+id] - if (!s || s == "")return - s=s.replace(/1\.0/,delay) - return jmolScriptWait(s,targetSuffix) -} - -//////////// add parameter ///////////// -/* - * for adding callbacks or other parameters. Use: - - jmolSetDocument(0) - var s= jmolApplet(....) - s = jmolAppletAddParam(s,"messageCallback", "myFunctionName") - document.write(s) - jmolSetDocument(document) // if you want to then write buttons and such normally - - */ - -function jmolAppletAddParam(appletCode,name,value){ - return (value == "" ? appletCode : appletCode.replace(/\\n" - +"" - +"Applet would be here" - +"

" - +"" - return _jmolDocumentWrite(s) - } - - _jmolFindApplet = function(){return jmolApplet0} - - jmolApplet0 = { - script: function(script){document.getElementById("fakeApplet").value="\njmolScript:\n"+script} - ,scriptWait: function(script){document.getElementById("fakeApplet").value="\njmolScriptWait:\n"+script} - ,loadInline: function(data,script){document.getElementById("fakeApplet").value="\njmolLoadInline data:\n"+data+"\n\nscript:\n"+script} - } -} - - -/////////////////////////////////////////// - - // This should no longer be needed, jmolResizeApplet() is better; kept for backwards compatibility - /* - Resizes absolutely (pixels) or by percent of window (w or h 0.5 means 50%). - targetSuffix is optional and defaults to zero (first applet in page). - Both w and h are optional, but needed if you want to use targetSuffix. - h defaults to w - w defaults to 100% of window - If either w or h is between 0 and 1, then it is taken as percent/100. - If either w or h is greater than 1, then it is taken as a size (pixels). - */ -function jmolResize(w,h,targetSuffix) { - _jmol.alerted = true; - var percentW = (!w ? 100 : w <= 1 && w > 0 ? w * 100 : 0); - var percentH = (!h ? percentW : h <= 1 && h > 0 ? h * 100 : 0); - if (_jmol.browser=="msie") { - var width=document.body.clientWidth; - var height=document.body.clientHeight; - } else { - var netscapeScrollWidth=15; - var width=window.innerWidth - netscapeScrollWidth; - var height=window.innerHeight-netscapeScrollWidth; - } - var applet = _jmolGetApplet(targetSuffix); - if(!applet)return; - applet.style.width = (percentW ? width * percentW/100 : w)+"px"; - applet.style.height = (percentH ? height * percentH/100 : (h ? h : w))+"px"; - //title=width + " " + height + " " + (new Date()); -} - -// 13 Jun 09 -- makes jmolResize() obsolete (kept for backwards compatibility) -function jmolResizeApplet(size,targetSuffix) { - // See _jmolGetAppletSize() for the formats accepted as size [same used by jmolApplet()] - // Special case: an empty value for width or height is accepted, meaning no change in that dimension. - _jmol.alerted = true; - var applet = _jmolGetApplet(targetSuffix); - if(!applet)return; - var sz = _jmolGetAppletSize(size, "px"); - sz[0] && (applet.style.width = sz[0]); - sz[1] && (applet.style.height = sz[1]); -} - -function _jmolGetAppletSize(size, units) { - /* Accepts single number or 2-value array, each one can be one of: - percent (text string ending %), decimal 0 to 1 (percent/100), number, or text string (interpreted as nr.) - [width, height] array of strings is returned, with units added if specified. - Percent is relative to container div or element (which should have explicitly set size). - */ - var width, height; - if ( (typeof size) == "object" && size != null ) { - width = size[0]; height = size[1]; - } else { - width = height = size; - } - return [_jmolFixDim(width, units), _jmolFixDim(height, units)]; -} - -function _jmolFixDim(x, units) { - var sx = "" + x; - return (sx.length == 0 ? (units ? "" : _jmol.allowedJmolSize[2]) - : sx.indexOf("%") == sx.length-1 ? sx - : (x = parseFloat(x)) <= 1 && x > 0 ? x * 100 + "%" - : (isNaN(x = Math.floor(x)) ? _jmol.allowedJmolSize[2] - : x < _jmol.allowedJmolSize[0] ? _jmol.allowedJmolSize[0] - : x > _jmol.allowedJmolSize[1] ? _jmol.allowedJmolSize[1] - : x) + (units ? units : "")); -} - - - - diff --git a/JmolHelp.html b/JmolHelp.html deleted file mode 100644 index 16bc59e..0000000 --- a/JmolHelp.html +++ /dev/null @@ -1,79 +0,0 @@ - - - - - - - JmolHelp - - - -

-

Brief Help for the Jmol 3-D viewer

-
-
-
Reorient View
-
To reorient the view place cursor over the image, hold down -the mouse button and drag.
-
Zoom View
-
To -zoom place the cursor over the image hold down the shift key and the -mouse button while dragging down to zoom in or up to zoom out.
Change Applet Size
-
Select the desired size from the pop-up menu in the "Display" tab -available in the "Advanced Controls" or click on the "Open in own -window" button.  The resulting window's size can be adjusted.
-
-
Adjust Colors and Mesh
-
Select desired colors and translucency using the menus and -checkboxes in the "Colors & Mesh" tab available in the "Advanced -Controls".
-
-
Save as Static Image
-
Click on the "Get Static Image to Save" button in the "Display" tab available in the "Advanced Controls".
-
-
Download to open in Jmol Application
-
Click on the "Download View" button in the "Display" tab -available in the "Advanced Controls".  The file you download can -be opened using the Jmol application.  Using the application the -view can be further adjusted and web pages with the live view embedded -can be created (see below).
-
-
Start/Stop Spinning
-
Use the "Spin" checkbox in the "Display" tab available in the "Advanced Controls".
-
High/Low Quality Display
-
Use the "High Quality" checkbox in the "Display" tab available in -the "Advanced Controls".  Note memory requirements are -significantly more for the better display.  This can slow the -applets response and sometimes causes blank displays.

-
- - -
Embedding the live image in another web page, adding annotation -and advanced control of view
-
-
-
    -
  1. Download the view to your computer using the download button in -the Display tab.  You can then open the file in the Jmol -application available from the Jmol web -site
  2. -
  3. Simple examples of adding annotation are provided in the Export-to-Web -tutorial, which also describes how to use the downloaded document to -embed the live image in an arbitrary web page.
  4. -
  5. More detailed information on changing the way Jmol displays -things using Jmol commands is available in the Jmol scripting -documentation, the Jmol web site -and the Jmol wiki.
  6. -
  7. It is also possible to use Jmol commands to adjust the display -within Sage.  To do this -right-click (control-click) in the applet window to get the applet -pop-up menu.  In the advanced submenu select "Console".  You -can type Jmol script commands into the console.
  8. -
-
By Jonathan Gutow
-June 2011
-
-
-
- - \ No newline at end of file diff --git a/sagemath-4ti2.patch b/sagemath-4ti2.patch index f4dc6dc..a5cf30f 100644 --- a/sagemath-4ti2.patch +++ b/sagemath-4ti2.patch @@ -1,7 +1,7 @@ diff -up src/sage/sandpiles/sandpile.py.orig src/sage/sandpiles/sandpile.py ---- src/sage/sandpiles/sandpile.py.orig 2014-01-28 16:01:55.841188856 -0200 -+++ src/sage/sandpiles/sandpile.py 2014-01-28 16:02:07.914189318 -0200 -@@ -24,8 +24,6 @@ packages. An alternative is to install +--- src/sage/sandpiles/sandpile.py.orig 2014-11-18 15:24:27.192127311 -0200 ++++ src/sage/sandpiles/sandpile.py 2014-11-18 15:24:38.049127454 -0200 +@@ -23,8 +23,6 @@ packages. An alternative is to install following variable to the correct path. """ @@ -10,7 +10,7 @@ diff -up src/sage/sandpiles/sandpile.py.orig src/sage/sandpiles/sandpile.py r""" Sage Sandpiles -@@ -4097,7 +4095,7 @@ class SandpileDivisor(dict): +@@ -4096,7 +4094,7 @@ class SandpileDivisor(dict): sign_file.close() # compute try: diff --git a/sagemath-cbc.patch b/sagemath-cbc.patch index 4d3b132..da1ab8a 100644 --- a/sagemath-cbc.patch +++ b/sagemath-cbc.patch @@ -1,7 +1,7 @@ diff -up src/module_list.py.orig src/module_list.py ---- src/module_list.py.orig 2014-08-12 14:22:43.914983839 -0300 -+++ src/module_list.py 2014-08-12 14:22:55.283984274 -0300 -@@ -2148,7 +2148,7 @@ if (os.path.isfile(SAGE_INC + "/cplex.h" +--- src/module_list.py.orig 2014-11-18 15:28:48.952130767 -0200 ++++ src/module_list.py 2014-11-18 15:28:57.040130873 -0200 +@@ -2168,7 +2168,7 @@ if (os.path.isfile(SAGE_INC + "/cplex.h" libraries = ["stdc++", "cplex"]) ) diff --git a/sagemath-cremona.patch b/sagemath-cremona.patch index 6548aa1..f230daa 100644 --- a/sagemath-cremona.patch +++ b/sagemath-cremona.patch @@ -1,7 +1,7 @@ diff -up src/sage/databases/cremona.py.orig src/sage/databases/cremona.py ---- src/sage/databases/cremona.py.orig 2014-08-12 14:17:40.563972222 -0300 -+++ src/sage/databases/cremona.py 2014-08-12 14:17:51.891972656 -0300 -@@ -814,14 +814,9 @@ class MiniCremonaDatabase(SQLDatabase): +--- src/sage/databases/cremona.py.orig 2014-11-18 15:26:03.247128579 -0200 ++++ src/sage/databases/cremona.py 2014-11-18 15:26:16.920128759 -0200 +@@ -819,14 +819,9 @@ class MiniCremonaDatabase(SQLDatabase): if N < self.largest_conductor(): message = "There is no elliptic curve with label " + label \ + " in the database" @@ -17,7 +17,7 @@ diff -up src/sage/databases/cremona.py.orig src/sage/databases/cremona.py raise ValueError(message) ainvs = eval(c[0]) data = {'cremona_label': label, -@@ -1656,10 +1651,12 @@ def CremonaDatabase(name=None,mini=None, +@@ -1669,10 +1664,12 @@ def CremonaDatabase(name=None,mini=None, if name is None and not set_global: return _db if set_global and name is None: diff --git a/sagemath-cryptominisat.patch b/sagemath-cryptominisat.patch index e937762..a5e9ffd 100644 --- a/sagemath-cryptominisat.patch +++ b/sagemath-cryptominisat.patch @@ -1,7 +1,7 @@ diff -up src/module_list.py.orig src/module_list.py ---- src/module_list.py.orig 2014-08-12 14:24:04.771986935 -0300 -+++ src/module_list.py 2014-08-12 14:24:13.962987287 -0300 -@@ -2158,7 +2158,7 @@ if 1: +--- src/module_list.py.orig 2014-11-18 15:30:01.952131730 -0200 ++++ src/module_list.py 2014-11-18 15:30:08.968131823 -0200 +@@ -2177,7 +2177,7 @@ if 1: ) diff --git a/sagemath-ecl-unicode.patch b/sagemath-ecl-unicode.patch deleted file mode 100644 index 0c31810..0000000 --- a/sagemath-ecl-unicode.patch +++ /dev/null @@ -1,100 +0,0 @@ -diff -up src/sage/libs/ecl.pxd.orig src/sage/libs/ecl.pxd ---- src/sage/libs/ecl.pxd.orig 2014-03-12 13:06:42.944532214 -0300 -+++ src/sage/libs/ecl.pxd 2014-03-12 13:06:45.560532100 -0300 -@@ -134,6 +134,7 @@ cdef extern from "ecl/ecl.h": - cl_object ecl_read_from_cstring_safe(char *s, cl_object err) - cl_object cl_write_to_string(cl_narg narg, cl_object o) - cl_object ecl_cstring_to_base_string_or_nil(char *s) -+ cl_object si_coerce_to_base_string(cl_object x) - - # S-expr evaluation and function calls - -diff -up src/sage/libs/ecl.pyx.orig src/sage/libs/ecl.pyx ---- src/sage/libs/ecl.pyx.orig 2014-03-12 13:06:42.949532214 -0300 -+++ src/sage/libs/ecl.pyx 2014-03-12 13:07:55.483529040 -0300 -@@ -329,17 +329,19 @@ cdef cl_object ecl_safe_eval(cl_object f - ... - RuntimeError: ECL says: Console interrupt. - """ -+ cdef cl_object s - ecl_sig_on() - cl_funcall(2,safe_eval_clobj,form) - ecl_sig_off() - - if ecl_nvalues > 1: -- raise RuntimeError, "ECL says: "+ecl_base_string_pointer_safe(ecl_values(1)) -+ s = si_coerce_to_base_string(ecl_values(1)) -+ raise RuntimeError, "ECL says: "+ecl_base_string_pointer_safe(s) - else: - return ecl_values(0) - - cdef cl_object ecl_safe_funcall(cl_object func, cl_object arg) except NULL: -- cdef cl_object l -+ cdef cl_object l, s - l = cl_cons(func,cl_cons(arg,Cnil)); - - ecl_sig_on() -@@ -347,17 +349,20 @@ cdef cl_object ecl_safe_funcall(cl_objec - ecl_sig_off() - - if ecl_nvalues > 1: -- raise RuntimeError, "ECL says: "+ecl_base_string_pointer_safe(ecl_values(1)) -+ s = si_coerce_to_base_string(ecl_values(1)) -+ raise RuntimeError, "ECL says: "+ecl_base_string_pointer_safe(s) - else: - return ecl_values(0) - - cdef cl_object ecl_safe_apply(cl_object func, cl_object args) except NULL: -+ cdef cl_object s - ecl_sig_on() - cl_funcall(3,safe_apply_clobj,func,args) - ecl_sig_off() - - if ecl_nvalues > 1: -- raise RuntimeError, "ECL says: "+ecl_base_string_pointer_safe(ecl_values(1)) -+ s = si_coerce_to_base_string(ecl_values(1)) -+ raise RuntimeError, "ECL says: "+ecl_base_string_pointer_safe(s) - else: - return ecl_values(0) - -@@ -407,10 +412,11 @@ def print_objects(): - HELLO - """ - -- cdef cl_object c -+ cdef cl_object c, s - c = list_of_objects - while True: -- print ecl_base_string_pointer_safe(cl_write_to_string(1,cl_car(c))) -+ s = si_coerce_to_base_string(cl_write_to_string(1,cl_car(c))) -+ print ecl_base_string_pointer_safe(s) - c=cl_cadr(c) - if c == Cnil: - break -@@ -485,6 +491,7 @@ cdef cl_object python_to_ecl(pyobj) exce - raise TypeError,"Unimplemented type for python_to_ecl" - - cdef ecl_to_python(cl_object o): -+ cdef cl_object s - cdef Integer N - # conversions from an ecl object to a python object. - -@@ -519,7 +526,8 @@ cdef ecl_to_python(cl_object o): - return tuple(L) - return L - else: -- return ecl_base_string_pointer_safe(cl_write_to_string(1,o)) -+ s = si_coerce_to_base_string(cl_write_to_string(1,o)) -+ return ecl_base_string_pointer_safe(s) - - #Maxima's BFLOAT multiprecision float type can be read with: - #def bfloat_to_python(e): -@@ -735,7 +743,7 @@ cdef class EclObject: - - """ - cdef cl_object s -- s = cl_write_to_string(1,self.obj) -+ s = si_coerce_to_base_string(cl_write_to_string(1,self.obj)) - return ecl_base_string_pointer_safe(s) - - def __hash__(self): diff --git a/sagemath-extensions.patch b/sagemath-extensions.patch index 5d6e824..c94f202 100644 --- a/sagemath-extensions.patch +++ b/sagemath-extensions.patch @@ -1,7 +1,7 @@ diff -up src/module_list.py.orig src/module_list.py ---- src/module_list.py.orig 2014-08-12 14:02:16.914936853 -0300 -+++ src/module_list.py 2014-08-12 14:02:26.626937225 -0300 -@@ -2103,7 +2103,8 @@ ext_modules = [ +--- src/module_list.py.orig 2014-11-18 13:23:35.915031576 -0200 ++++ src/module_list.py 2014-11-18 13:23:46.515031716 -0200 +@@ -2126,7 +2126,8 @@ ext_modules = [ # These extensions are to be compiled only if the # corresponding packages have been installed diff --git a/sagemath-fes.patch b/sagemath-fes.patch index 870cb18..4d8c859 100644 --- a/sagemath-fes.patch +++ b/sagemath-fes.patch @@ -1,7 +1,7 @@ diff -up src/module_list.py.orig src/module_list.py ---- src/module_list.py.orig 2014-08-12 14:23:31.642985666 -0300 -+++ src/module_list.py 2014-08-12 14:23:39.051985950 -0300 -@@ -2107,7 +2107,7 @@ ext_modules = [ +--- src/module_list.py.orig 2014-11-18 15:29:30.360131313 -0200 ++++ src/module_list.py 2014-11-18 15:29:37.432131407 -0200 +@@ -2130,7 +2130,7 @@ ext_modules = [ def is_package_installed(name): return False diff --git a/sagemath-gap-hap.patch b/sagemath-gap-hap.patch index 778bedd..46540af 100644 --- a/sagemath-gap-hap.patch +++ b/sagemath-gap-hap.patch @@ -1,6 +1,6 @@ diff -up src/sage/groups/perm_gps/permgroup.py.orig src/sage/groups/perm_gps/permgroup.py ---- src/sage/groups/perm_gps/permgroup.py.orig 2014-08-12 14:19:36.779976673 -0300 -+++ src/sage/groups/perm_gps/permgroup.py 2014-08-12 14:19:44.435976966 -0300 +--- src/sage/groups/perm_gps/permgroup.py.orig 2014-11-18 15:27:46.545129943 -0200 ++++ src/sage/groups/perm_gps/permgroup.py 2014-11-18 15:27:53.760130038 -0200 @@ -180,8 +180,7 @@ def hap_decorator(f): """ @wraps(f) @@ -11,7 +11,7 @@ diff -up src/sage/groups/perm_gps/permgroup.py.orig src/sage/groups/perm_gps/per load_hap() from sage.rings.arith import is_prime if not (p == 0 or is_prime(p)): -@@ -3934,8 +3933,7 @@ class PermutationGroup_generic(group.Gro +@@ -3979,8 +3978,7 @@ class PermutationGroup_generic(group.Gro - David Joyner and Graham Ellis """ diff --git a/sagemath-lrcalc.patch b/sagemath-lrcalc.patch index 2e0c369..640fd2d 100644 --- a/sagemath-lrcalc.patch +++ b/sagemath-lrcalc.patch @@ -1,7 +1,7 @@ diff -up src/module_list.py.orig src/module_list.py ---- src/module_list.py.orig 2014-08-12 14:22:06.954982423 -0300 -+++ src/module_list.py 2014-08-12 14:22:15.018982732 -0300 -@@ -2191,7 +2191,7 @@ if UNAME[0] == "Darwin" and not UNAME[2] +--- src/module_list.py.orig 2014-11-18 15:28:17.313130349 -0200 ++++ src/module_list.py 2014-11-18 15:28:24.520130444 -0200 +@@ -2210,7 +2210,7 @@ if UNAME[0] == "Darwin" and not UNAME[2] ) diff --git a/sagemath-lrslib.patch b/sagemath-lrslib.patch index 988d923..d7ad0ad 100644 --- a/sagemath-lrslib.patch +++ b/sagemath-lrslib.patch @@ -1,7 +1,7 @@ diff -up src/sage/geometry/polyhedron/base.py.orig src/sage/geometry/polyhedron/base.py ---- src/sage/geometry/polyhedron/base.py.orig 2014-08-12 14:18:21.763973800 -0300 -+++ src/sage/geometry/polyhedron/base.py 2014-08-12 14:18:29.539974098 -0300 -@@ -3494,11 +3494,6 @@ class Polyhedron_base(Element): +--- src/sage/geometry/polyhedron/base.py.orig 2014-11-18 15:26:45.817129141 -0200 ++++ src/sage/geometry/polyhedron/base.py 2014-11-18 15:26:53.185129238 -0200 +@@ -3515,11 +3515,6 @@ class Polyhedron_base(Element): David Avis's lrs program. """ diff --git a/sagemath-nauty.patch b/sagemath-nauty.patch index 76f5350..c810d40 100644 --- a/sagemath-nauty.patch +++ b/sagemath-nauty.patch @@ -1,7 +1,7 @@ diff -up src/sage/graphs/graph_generators.py.orig src/sage/graphs/graph_generators.py ---- src/sage/graphs/graph_generators.py.orig 2014-08-12 14:19:00.906975299 -0300 -+++ src/sage/graphs/graph_generators.py 2014-08-12 14:19:08.986975608 -0300 -@@ -830,7 +830,7 @@ class GraphGenerators(): +--- src/sage/graphs/graph_generators.py.orig 2014-11-18 15:27:15.584129534 -0200 ++++ src/sage/graphs/graph_generators.py 2014-11-18 15:27:23.352129636 -0200 +@@ -833,7 +833,7 @@ class GraphGenerators(): """ import subprocess from sage.misc.package import is_package_installed diff --git a/sagemath-ntl6.patch b/sagemath-ntl6.patch deleted file mode 100644 index 76aa555..0000000 --- a/sagemath-ntl6.patch +++ /dev/null @@ -1,1422 +0,0 @@ ---- src/c_lib/include/ntl_wrap.h.orig 2014-05-13 16:22:05.526912185 -0300 -+++ src/c_lib/include/ntl_wrap.h 2014-05-13 16:26:37.997931724 -0300 -@@ -40,91 +40,92 @@ EXTERN void setup_NTL_error_callback(voi - //////// ZZ ////////// - - #ifndef __cplusplus --struct ZZ; -+typedef struct ZZ ZZ; - #endif - --EXTERN int ZZ_to_int(const struct ZZ* x); --EXTERN struct ZZ* int_to_ZZ(int value); --EXTERN void ZZ_to_mpz(mpz_t* output, const struct ZZ* x); --EXTERN void mpz_to_ZZ(struct ZZ *output, const mpz_t* x); --EXTERN void ZZ_set_from_int(struct ZZ* x, int value); -+EXTERN int ZZ_to_int(const ZZ* x); -+EXTERN ZZ* int_to_ZZ(int value); -+EXTERN void ZZ_to_mpz(mpz_t* output, const ZZ* x); -+EXTERN void mpz_to_ZZ(ZZ *output, const mpz_t* x); -+EXTERN void ZZ_set_from_int(ZZ* x, int value); - /*Random-number generation */ --//EXTERN void setSeed(const struct ZZ* n); --//EXTERN struct ZZ* ZZ_randomBnd(const struct ZZ* x); --//EXTERN struct ZZ* ZZ_randomBits(long n); -+//EXTERN void setSeed(const ZZ* n); -+//EXTERN ZZ* ZZ_randomBnd(const ZZ* x); -+//EXTERN ZZ* ZZ_randomBits(long n); - - #ifdef __cplusplus --EXTERN long ZZ_remove(struct ZZ& x, const struct ZZ& a, const struct ZZ& p); -+EXTERN long ZZ_remove(ZZ& x, const ZZ& a, const ZZ& p); - #endif - - //////// ZZ_p ////////// - - #ifndef __cplusplus --struct ZZ_p; -+typedef struct ZZ_p ZZ_p; -+typedef struct ZZ_pContext ZZ_pContext; - #endif - - #ifdef __cplusplus // sorry, if you want a C version, feel free to add it - EXTERN int ZZ_p_to_int(const ZZ_p& x); - EXTERN ZZ_p int_to_ZZ_p(int value); - #endif --EXTERN void ZZ_p_set_from_int(struct ZZ_p* x, int value); --EXTERN struct ZZ_p* ZZ_p_pow(const struct ZZ_p* x, long e); --EXTERN void ntl_ZZ_set_modulus(struct ZZ* x); --EXTERN struct ZZ_p* ZZ_p_inv(struct ZZ_p* x); --EXTERN struct ZZ_p* ZZ_p_neg(struct ZZ_p* x); --EXTERN struct ZZ_p* ZZ_p_random(void); --EXTERN void ZZ_p_modulus(struct ZZ* mod, const struct ZZ_p* x); -+EXTERN void ZZ_p_set_from_int(ZZ_p* x, int value); -+EXTERN ZZ_p* ZZ_p_pow(const ZZ_p* x, long e); -+EXTERN void ntl_ZZ_set_modulus(ZZ* x); -+EXTERN ZZ_p* ZZ_p_inv(ZZ_p* x); -+EXTERN ZZ_p* ZZ_p_neg(ZZ_p* x); -+EXTERN ZZ_p* ZZ_p_random(void); -+EXTERN void ZZ_p_modulus(ZZ* mod, const ZZ_p* x); - - --EXTERN struct ZZ_pContext* ZZ_pContext_new(struct ZZ* p); --EXTERN struct ZZ_pContext* ZZ_pContext_construct(void* mem, struct ZZ* p); -+EXTERN ZZ_pContext* ZZ_pContext_new(ZZ* p); -+EXTERN ZZ_pContext* ZZ_pContext_construct(void* mem, ZZ* p); - - //////// ZZX ////////// - #ifndef __cplusplus --struct ZZX; -+typedef struct ZZX ZZX; - #endif - --EXTERN char* ZZX_repr(struct ZZX* x); --EXTERN struct ZZX* ZZX_copy(struct ZZX* x); --EXTERN void ZZX_setitem_from_int(struct ZZX* x, long i, int value); --EXTERN int ZZX_getitem_as_int(struct ZZX* x, long i); --EXTERN void ZZX_getitem_as_mpz(mpz_t* output, struct ZZX* x, long i); --EXTERN struct ZZX* ZZX_div(struct ZZX* x, struct ZZX* y, int* divisible); --EXTERN void ZZX_quo_rem(struct ZZX* x, struct ZZX* other, struct ZZX** r, struct ZZX** q); --EXTERN struct ZZX* ZZX_square(struct ZZX* x); --EXTERN int ZZX_equal(struct ZZX* x, struct ZZX* y); --EXTERN int ZZX_is_monic(struct ZZX* x); --EXTERN struct ZZX* ZZX_neg(struct ZZX* x); --EXTERN struct ZZX* ZZX_left_shift(struct ZZX* x, long n); --EXTERN struct ZZX* ZZX_right_shift(struct ZZX* x, long n); --EXTERN char* ZZX_content(struct ZZX* x); --EXTERN struct ZZX* ZZX_primitive_part(struct ZZX* x); --EXTERN void ZZX_pseudo_quo_rem(struct ZZX* x, struct ZZX* y, struct ZZX** r, struct ZZX** q); --EXTERN struct ZZX* ZZX_gcd(struct ZZX* x, struct ZZX* y); --EXTERN void ZZX_xgcd(struct ZZX* x, struct ZZX* y, struct ZZ** r, struct ZZX** s, struct ZZX** t, int proof); --EXTERN long ZZX_degree(struct ZZX* x); --EXTERN struct ZZ* ZZX_leading_coefficient(struct ZZX* x); --EXTERN char* ZZX_constant_term(struct ZZX* x); --EXTERN void ZZX_set_x(struct ZZX* x); --EXTERN int ZZX_is_x(struct ZZX* x); --EXTERN struct ZZX* ZZX_derivative(struct ZZX* x); --EXTERN struct ZZX* ZZX_reverse(struct ZZX* x); --EXTERN struct ZZX* ZZX_reverse_hi(struct ZZX* x, int hi); --EXTERN struct ZZX* ZZX_truncate(struct ZZX* x, long m); --EXTERN struct ZZX* ZZX_multiply_and_truncate(struct ZZX* x, struct ZZX* y, long m); --EXTERN struct ZZX* ZZX_square_and_truncate(struct ZZX* x, long m); --EXTERN struct ZZX* ZZX_invert_and_truncate(struct ZZX* x, long m); --EXTERN struct ZZX* ZZX_multiply_mod(struct ZZX* x, struct ZZX* y, struct ZZX* modulus); --EXTERN struct ZZ* ZZX_trace_mod(struct ZZX* x, struct ZZX* y); --/* EXTERN struct ZZ* ZZX_polyeval(struct ZZX* f, struct ZZ* a); */ --EXTERN char* ZZX_trace_list(struct ZZX* x); --EXTERN struct ZZ* ZZX_resultant(struct ZZX* x, struct ZZX* y, int proof); --EXTERN struct ZZ* ZZX_norm_mod(struct ZZX* x, struct ZZX* y, int proof); --EXTERN struct ZZ* ZZX_discriminant(struct ZZX* x, int proof); --EXTERN struct ZZX* ZZX_charpoly_mod(struct ZZX* x, struct ZZX* y, int proof); --EXTERN struct ZZX* ZZX_minpoly_mod(struct ZZX* x, struct ZZX* y); --EXTERN void ZZX_clear(struct ZZX* x); --EXTERN void ZZX_preallocate_space(struct ZZX* x, long n); -+EXTERN char* ZZX_repr(ZZX* x); -+EXTERN ZZX* ZZX_copy(ZZX* x); -+EXTERN void ZZX_setitem_from_int(ZZX* x, long i, int value); -+EXTERN int ZZX_getitem_as_int(ZZX* x, long i); -+EXTERN void ZZX_getitem_as_mpz(mpz_t* output, ZZX* x, long i); -+EXTERN ZZX* ZZX_div(ZZX* x, ZZX* y, int* divisible); -+EXTERN void ZZX_quo_rem(ZZX* x, ZZX* other, ZZX** r, ZZX** q); -+EXTERN ZZX* ZZX_square(ZZX* x); -+EXTERN int ZZX_equal(ZZX* x, ZZX* y); -+EXTERN int ZZX_is_monic(ZZX* x); -+EXTERN ZZX* ZZX_neg(ZZX* x); -+EXTERN ZZX* ZZX_left_shift(ZZX* x, long n); -+EXTERN ZZX* ZZX_right_shift(ZZX* x, long n); -+EXTERN char* ZZX_content(ZZX* x); -+EXTERN ZZX* ZZX_primitive_part(ZZX* x); -+EXTERN void ZZX_pseudo_quo_rem(ZZX* x, ZZX* y, ZZX** r, ZZX** q); -+EXTERN ZZX* ZZX_gcd(ZZX* x, ZZX* y); -+EXTERN void ZZX_xgcd(ZZX* x, ZZX* y, ZZ** r, ZZX** s, ZZX** t, int proof); -+EXTERN long ZZX_degree(ZZX* x); -+EXTERN ZZ* ZZX_leading_coefficient(ZZX* x); -+EXTERN char* ZZX_constant_term(ZZX* x); -+EXTERN void ZZX_set_x(ZZX* x); -+EXTERN int ZZX_is_x(ZZX* x); -+EXTERN ZZX* ZZX_derivative(ZZX* x); -+EXTERN ZZX* ZZX_reverse(ZZX* x); -+EXTERN ZZX* ZZX_reverse_hi(ZZX* x, int hi); -+EXTERN ZZX* ZZX_truncate(ZZX* x, long m); -+EXTERN ZZX* ZZX_multiply_and_truncate(ZZX* x, ZZX* y, long m); -+EXTERN ZZX* ZZX_square_and_truncate(ZZX* x, long m); -+EXTERN ZZX* ZZX_invert_and_truncate(ZZX* x, long m); -+EXTERN ZZX* ZZX_multiply_mod(ZZX* x, ZZX* y, ZZX* modulus); -+EXTERN ZZ* ZZX_trace_mod(ZZX* x, ZZX* y); -+/* EXTERN ZZ* ZZX_polyeval(ZZX* f, ZZ* a); */ -+EXTERN char* ZZX_trace_list(ZZX* x); -+EXTERN ZZ* ZZX_resultant(ZZX* x, ZZX* y, int proof); -+EXTERN ZZ* ZZX_norm_mod(ZZX* x, ZZX* y, int proof); -+EXTERN ZZ* ZZX_discriminant(ZZX* x, int proof); -+EXTERN ZZX* ZZX_charpoly_mod(ZZX* x, ZZX* y, int proof); -+EXTERN ZZX* ZZX_minpoly_mod(ZZX* x, ZZX* y); -+EXTERN void ZZX_clear(ZZX* x); -+EXTERN void ZZX_preallocate_space(ZZX* x, long n); - - //////// ZZXFactoring ////////// - -@@ -132,76 +133,77 @@ EXTERN void ZZX_preallocate_space(struct - // e -- point to list of e longs (the exponents) - // n -- length of above two lists - // The lists v and e are mallocd, and must be freed by the calling code. --EXTERN void ZZX_squarefree_decomposition(struct ZZX*** v, long** e, long* n, struct ZZX* x); -+EXTERN void ZZX_squarefree_decomposition(ZZX*** v, long** e, long* n, ZZX* x); - - - //////// ZZ_pX ////////// - #ifndef __cplusplus --struct ZZ_pX; -+typedef struct ZZ_pX ZZ_pX; - #endif - --EXTERN struct ZZ_pX* ZZ_pX_init(); --//EXTERN char* ZZ_pX_repr(struct ZZ_pX* x); --/* EXTERN struct ZZ_pX* ZZ_pX_copy(struct ZZ_pX* x); */ --/* EXTERN void ZZ_pX_setitem_from_int(struct ZZ_pX* x, long i, int value); */ --/* EXTERN int ZZ_pX_getitem_as_int(struct ZZ_pX* x, long i); */ --/* EXTERN struct ZZ_pX* ZZ_pX_div(struct ZZ_pX* x, struct ZZ_pX* y, int* divisible); */ --/* EXTERN struct ZZ_pX* ZZ_pX_mod(struct ZZ_pX* x, struct ZZ_pX* y); */ --/* EXTERN void ZZ_pX_quo_rem(struct ZZ_pX* x, struct ZZ_pX* other, struct ZZ_pX** r, struct ZZ_pX** q); */ --/* EXTERN struct ZZ_pX* ZZ_pX_square(struct ZZ_pX* x); */ --/* EXTERN int ZZ_pX_equal(struct ZZ_pX* x, struct ZZ_pX* y); */ --/* EXTERN int ZZ_pX_is_monic(struct ZZ_pX* x); */ --/* EXTERN struct ZZ_pX* ZZ_pX_neg(struct ZZ_pX* x); */ --/* EXTERN struct ZZ_pX* ZZ_pX_left_shift(struct ZZ_pX* x, long n); */ --/* EXTERN struct ZZ_pX* ZZ_pX_right_shift(struct ZZ_pX* x, long n); */ --/* EXTERN void ZZ_pX_quo_rem(struct ZZ_pX* x, struct ZZ_pX* y, struct ZZ_pX** r, struct ZZ_pX** q); */ --/* EXTERN struct ZZ_pX* ZZ_pX_gcd(struct ZZ_pX* x, struct ZZ_pX* y); */ --/* EXTERN void ZZ_pX_xgcd(struct ZZ_pX** d, struct ZZ_pX** s, struct ZZ_pX** t, struct ZZ_pX* a, struct ZZ_pX* b); */ --/* EXTERN void ZZ_pX_plain_xgcd(struct ZZ_pX** d, struct ZZ_pX** s, struct ZZ_pX** t, struct ZZ_pX* a, struct ZZ_pX* b); */ --/* EXTERN long ZZ_pX_degree(struct ZZ_pX* x); */ --/* EXTERN void ZZ_pX_set_x(struct ZZ_pX* x); */ --/* EXTERN int ZZ_pX_is_x(struct ZZ_pX* x); */ --/* EXTERN struct ZZ_pX* ZZ_pX_derivative(struct ZZ_pX* x); */ --/* EXTERN struct ZZ_pX* ZZ_pX_reverse(struct ZZ_pX* x); */ --/* EXTERN struct ZZ_pX* ZZ_pX_reverse_hi(struct ZZ_pX* x, int hi); */ --/* EXTERN struct ZZ_pX* ZZ_pX_truncate(struct ZZ_pX* x, long m); */ --/* EXTERN struct ZZ_pX* ZZ_pX_multiply_and_truncate(struct ZZ_pX* x, struct ZZ_pX* y, long m); */ --/* EXTERN struct ZZ_pX* ZZ_pX_square_and_truncate(struct ZZ_pX* x, long m); */ --/* EXTERN struct ZZ_pX* ZZ_pX_invert_and_truncate(struct ZZ_pX* x, long m); */ --/* EXTERN struct ZZ_pX* ZZ_pX_multiply_mod(struct ZZ_pX* x, struct ZZ_pX* y, struct ZZ_pX* modulus); */ --/* EXTERN struct ZZ_p* ZZ_pX_trace_mod(struct ZZ_pX* x, struct ZZ_pX* y); */ --EXTERN char* ZZ_pX_trace_list(struct ZZ_pX* x); --/* EXTERN struct ZZ_p* ZZ_pX_resultant(struct ZZ_pX* x, struct ZZ_pX* y); */ --/* EXTERN struct ZZ_p* ZZ_pX_norm_mod(struct ZZ_pX* x, struct ZZ_pX* y); */ --/* EXTERN struct ZZ_pX* ZZ_pX_charpoly_mod(struct ZZ_pX* x, struct ZZ_pX* y); */ --/* EXTERN struct ZZ_pX* ZZ_pX_minpoly_mod(struct ZZ_pX* x, struct ZZ_pX* y); */ --/* EXTERN void ZZ_pX_clear(struct ZZ_pX* x); */ --// EXTERN void ZZ_pX_preallocate_space(struct ZZ_pX* x, long n); -+EXTERN ZZ_pX* ZZ_pX_init(); -+//EXTERN char* ZZ_pX_repr(ZZ_pX* x); -+/* EXTERN ZZ_pX* ZZ_pX_copy(ZZ_pX* x); */ -+/* EXTERN void ZZ_pX_setitem_from_int(ZZ_pX* x, long i, int value); */ -+/* EXTERN int ZZ_pX_getitem_as_int(ZZ_pX* x, long i); */ -+/* EXTERN ZZ_pX* ZZ_pX_div(ZZ_pX* x, ZZ_pX* y, int* divisible); */ -+/* EXTERN ZZ_pX* ZZ_pX_mod(ZZ_pX* x, ZZ_pX* y); */ -+/* EXTERN void ZZ_pX_quo_rem(ZZ_pX* x, ZZ_pX* other, ZZ_pX** r, ZZ_pX** q); */ -+/* EXTERN ZZ_pX* ZZ_pX_square(ZZ_pX* x); */ -+/* EXTERN int ZZ_pX_equal(ZZ_pX* x, ZZ_pX* y); */ -+/* EXTERN int ZZ_pX_is_monic(ZZ_pX* x); */ -+/* EXTERN ZZ_pX* ZZ_pX_neg(ZZ_pX* x); */ -+/* EXTERN ZZ_pX* ZZ_pX_left_shift(ZZ_pX* x, long n); */ -+/* EXTERN ZZ_pX* ZZ_pX_right_shift(ZZ_pX* x, long n); */ -+/* EXTERN void ZZ_pX_quo_rem(ZZ_pX* x, ZZ_pX* y, ZZ_pX** r, ZZ_pX** q); */ -+/* EXTERN ZZ_pX* ZZ_pX_gcd(ZZ_pX* x, ZZ_pX* y); */ -+/* EXTERN void ZZ_pX_xgcd(ZZ_pX** d, ZZ_pX** s, ZZ_pX** t, ZZ_pX* a, ZZ_pX* b); */ -+/* EXTERN void ZZ_pX_plain_xgcd(ZZ_pX** d, ZZ_pX** s, ZZ_pX** t, ZZ_pX* a, ZZ_pX* b); */ -+/* EXTERN long ZZ_pX_degree(ZZ_pX* x); */ -+/* EXTERN void ZZ_pX_set_x(ZZ_pX* x); */ -+/* EXTERN int ZZ_pX_is_x(ZZ_pX* x); */ -+/* EXTERN ZZ_pX* ZZ_pX_derivative(ZZ_pX* x); */ -+/* EXTERN ZZ_pX* ZZ_pX_reverse(ZZ_pX* x); */ -+/* EXTERN ZZ_pX* ZZ_pX_reverse_hi(ZZ_pX* x, int hi); */ -+/* EXTERN ZZ_pX* ZZ_pX_truncate(ZZ_pX* x, long m); */ -+/* EXTERN ZZ_pX* ZZ_pX_multiply_and_truncate(ZZ_pX* x, ZZ_pX* y, long m); */ -+/* EXTERN ZZ_pX* ZZ_pX_square_and_truncate(ZZ_pX* x, long m); */ -+/* EXTERN ZZ_pX* ZZ_pX_invert_and_truncate(ZZ_pX* x, long m); */ -+/* EXTERN ZZ_pX* ZZ_pX_multiply_mod(ZZ_pX* x, ZZ_pX* y, ZZ_pX* modulus); */ -+/* EXTERN ZZ_p* ZZ_pX_trace_mod(ZZ_pX* x, ZZ_pX* y); */ -+EXTERN char* ZZ_pX_trace_list(ZZ_pX* x); -+/* EXTERN ZZ_p* ZZ_pX_resultant(ZZ_pX* x, ZZ_pX* y); */ -+/* EXTERN ZZ_p* ZZ_pX_norm_mod(ZZ_pX* x, ZZ_pX* y); */ -+/* EXTERN ZZ_pX* ZZ_pX_charpoly_mod(ZZ_pX* x, ZZ_pX* y); */ -+/* EXTERN ZZ_pX* ZZ_pX_minpoly_mod(ZZ_pX* x, ZZ_pX* y); */ -+/* EXTERN void ZZ_pX_clear(ZZ_pX* x); */ -+// EXTERN void ZZ_pX_preallocate_space(ZZ_pX* x, long n); - - // Factoring elements of ZZ_pX: - // OUTPUT: v -- pointer to list of n ZZ_pX elements (the irred factors) - // e -- point to list of e longs (the exponents) - // n -- length of above two lists - // The lists v and e are mallocd, and must be freed by the calling code. --EXTERN void ZZ_pX_factor(struct ZZ_pX*** v, long** e, long* n, struct ZZ_pX* x, long verbose); --EXTERN void ZZ_pX_linear_roots(struct ZZ_p*** v, long* n, struct ZZ_pX* f); -+EXTERN void ZZ_pX_factor(ZZ_pX*** v, long** e, long* n, ZZ_pX* x, long verbose); -+EXTERN void ZZ_pX_linear_roots(ZZ_p*** v, long* n, ZZ_pX* f); - - #ifdef __cplusplus --EXTERN void ZZ_pX_conv_modulus(struct ZZ_pX &fout, const struct ZZ_pX &fin, const struct ZZ_pContext &mod); --EXTERN void ZZ_pEX_conv_modulus(struct ZZ_pEX &fout, const struct ZZ_pEX &fin, const struct ZZ_pContext &mod); --EXTERN void ZZ_pX_min_val_coeff(long &valuation, long &index, const struct ZZ_pX &f, const struct ZZ &p); --EXTERN long ZZ_pX_get_val_coeff(const struct ZZ_pX &f, const struct ZZ &p, long i); --EXTERN void ZZ_pX_left_pshift(struct ZZ_pX &x, const struct ZZ_pX &a, const struct ZZ &pn, const struct ZZ_pContext &c); --EXTERN void ZZ_pX_right_pshift(struct ZZ_pX &x, const struct ZZ_pX &a, const struct ZZ &pn, const struct ZZ_pContext &c); --EXTERN void ZZ_pX_InvMod_newton_unram(struct ZZ_pX &x, const struct ZZ_pX &a, const struct ZZ_pXModulus &F, const struct ZZ_pContext &cpn, const struct ZZ_pContext &cp); --EXTERN void ZZ_pX_InvMod_newton_ram(struct ZZ_pX &x, const struct ZZ_pX &a, const struct ZZ_pXModulus &F, const struct ZZ_pContext &cpn); -+EXTERN void ZZ_pX_conv_modulus(ZZ_pX &fout, const ZZ_pX &fin, const ZZ_pContext &mod); -+EXTERN void ZZ_pEX_conv_modulus(ZZ_pEX &fout, const ZZ_pEX &fin, const ZZ_pContext &mod); -+EXTERN void ZZ_pX_min_val_coeff(long &valuation, long &index, const ZZ_pX &f, const ZZ &p); -+EXTERN long ZZ_pX_get_val_coeff(const ZZ_pX &f, const ZZ &p, long i); -+EXTERN void ZZ_pX_left_pshift(ZZ_pX &x, const ZZ_pX &a, const ZZ &pn, const ZZ_pContext &c); -+EXTERN void ZZ_pX_right_pshift(ZZ_pX &x, const ZZ_pX &a, const ZZ &pn, const ZZ_pContext &c); -+EXTERN void ZZ_pX_InvMod_newton_unram(ZZ_pX &x, const ZZ_pX &a, const ZZ_pXModulus &F, const ZZ_pContext &cpn, const ZZ_pContext &cp); -+EXTERN void ZZ_pX_InvMod_newton_ram(ZZ_pX &x, const ZZ_pX &a, const ZZ_pXModulus &F, const ZZ_pContext &cpn); - - #endif - - //////// zz_p ////////// - - #ifndef __cplusplus --struct zz_p; -+typedef struct zz_p zz_p; -+typedef struct zz_pContext zz_pContext; - #endif - - #define zz_p_set_from_long( obj1, obj2 )\ -@@ -209,14 +211,14 @@ struct zz_p; - #define NTL_zz_p_DOUBLE_EQUALS( obj1, obj2 )\ - (obj1) == (obj2) - --EXTERN struct zz_pContext* zz_pContext_new(long p); --EXTERN struct zz_pContext* zz_pContext_construct(void* mem, long p); --EXTERN void zz_pContext_restore(struct zz_pContext* ctx); -+EXTERN zz_pContext* zz_pContext_new(long p); -+EXTERN zz_pContext* zz_pContext_construct(void* mem, long p); -+EXTERN void zz_pContext_restore(zz_pContext* ctx); - - //////// zz_pX ////////// - - #ifndef __cplusplus --struct zz_pX; -+typedef struct ZZ_pX ZZ_pX; - #endif - - #define NTL_zz_pX_DOUBLE_EQUALS( obj1, obj2 )\ -@@ -225,104 +227,107 @@ struct zz_pX; - //////// ZZ_pEContext /////////////// - - #ifndef __cplusplus --struct ZZ_pEContext; -+typedef struct ZZ_pEContext ZZ_pEContext; - #endif - --EXTERN struct ZZ_pEContext* ZZ_pEContext_new(struct ZZ_pX *f); --EXTERN struct ZZ_pEContext* ZZ_pEContext_construct(void* mem, struct ZZ_pX *f); --EXTERN void ZZ_pEContext_restore(struct ZZ_pEContext* ctx); -+EXTERN ZZ_pEContext* ZZ_pEContext_new(ZZ_pX *f); -+EXTERN ZZ_pEContext* ZZ_pEContext_construct(void* mem, ZZ_pX *f); -+EXTERN void ZZ_pEContext_restore(ZZ_pEContext* ctx); - - //////// ZZ_pE //////////// - - #ifndef __cplusplus --struct ZZ_pE; -+typedef struct ZZ_pE ZZ_pE; - #endif - --EXTERN struct ZZ_pX ZZ_pE_to_ZZ_pX(struct ZZ_pE x); -+EXTERN ZZ_pX ZZ_pE_to_ZZ_pX(ZZ_pE x); - - //////// ZZ_pEX ///////// - - #ifndef __cplusplus --struct ZZ_pEX; -+typedef struct ZZ_pEX ZZ_pEX; - #endif - - //////// mat_ZZ ////////// - - #ifndef __cplusplus --typedef struct {} mat_ZZ; -+typedef struct mat_ZZ mat_ZZ; - #endif - - EXTERN void mat_ZZ_SetDims(mat_ZZ* mZZ, long nrows, long ncols); - EXTERN mat_ZZ* mat_ZZ_pow(const mat_ZZ* x, long e); - EXTERN long mat_ZZ_nrows(const mat_ZZ* x); - EXTERN long mat_ZZ_ncols(const mat_ZZ* x); --EXTERN void mat_ZZ_setitem(mat_ZZ* x, int i, int j, const struct ZZ* z); --EXTERN struct ZZ* mat_ZZ_getitem(const mat_ZZ* x, int i, int j); --EXTERN struct ZZ* mat_ZZ_determinant(const mat_ZZ* x, long deterministic); --EXTERN mat_ZZ* mat_ZZ_HNF(const mat_ZZ* A, const struct ZZ* D); --EXTERN struct ZZX* mat_ZZ_charpoly(const mat_ZZ* A); --EXTERN long mat_ZZ_LLL(struct ZZ **det, mat_ZZ *x, long a, long b, long verbose); --EXTERN long mat_ZZ_LLL_U(struct ZZ **det, mat_ZZ *x, mat_ZZ *U, long a, long b, long verbose); -+EXTERN void mat_ZZ_setitem(mat_ZZ* x, int i, int j, const ZZ* z); -+EXTERN ZZ* mat_ZZ_getitem(const mat_ZZ* x, int i, int j); -+EXTERN ZZ* mat_ZZ_determinant(const mat_ZZ* x, long deterministic); -+EXTERN mat_ZZ* mat_ZZ_HNF(const mat_ZZ* A, const ZZ* D); -+EXTERN ZZX* mat_ZZ_charpoly(const mat_ZZ* A); -+EXTERN long mat_ZZ_LLL(ZZ **det, mat_ZZ *x, long a, long b, long verbose); -+EXTERN long mat_ZZ_LLL_U(ZZ **det, mat_ZZ *x, mat_ZZ *U, long a, long b, long verbose); - - /* //////// ZZ_p ////////// */ - /* #ifndef __cplusplus */ --/* struct ZZ_p; */ -+/* typedef struct ZZ_p ZZ_p; */ - /* #endif */ - --/* EXTERN void ZZ_p_set_modulus(const struct ZZ* p); */ --/* EXTERN struct ZZ_p* new_ZZ_p(void); */ --/* EXTERN void del_ZZ_p(struct ZZ_p* x); */ --/* EXTERN struct ZZ_p* ZZ_p_add(const struct ZZ_p* x, const struct ZZ_p* y); */ --/* EXTERN struct ZZ_p* ZZ_p_sub(const struct ZZ_p* x, const struct ZZ_p* y); */ --/* EXTERN struct ZZ_p* ZZ_p_mul(const struct ZZ_p* x, const struct ZZ_p* y); */ --/* EXTERN struct ZZ_p* ZZ_p_pow(const struct ZZ_p* x, long e); */ --/* EXTERN int ZZ_p_is_zero(struct ZZ_p*x ); */ --/* EXTERN int ZZ_p_is_one(struct ZZ_p*x ); */ -+/* EXTERN void ZZ_p_set_modulus(const ZZ* p); */ -+/* EXTERN ZZ_p* new_ZZ_p(void); */ -+/* EXTERN void del_ZZ_p(ZZ_p* x); */ -+/* EXTERN ZZ_p* ZZ_p_add(const ZZ_p* x, const ZZ_p* y); */ -+/* EXTERN ZZ_p* ZZ_p_sub(const ZZ_p* x, const ZZ_p* y); */ -+/* EXTERN ZZ_p* ZZ_p_mul(const ZZ_p* x, const ZZ_p* y); */ -+/* EXTERN ZZ_p* ZZ_p_pow(const ZZ_p* x, long e); */ -+/* EXTERN int ZZ_p_is_zero(ZZ_p*x ); */ -+/* EXTERN int ZZ_p_is_one(ZZ_p*x ); */ - - - //////// ZZ_pE ////////// - #ifndef __cplusplus --struct ZZ_pE; -+typedef struct ZZ_pE ZZ_pE; - #endif - --// EXTERN struct ZZ_pE* new_ZZ_pE -+// EXTERN ZZ_pE* new_ZZ_pE - - - - //////// ZZ_pEX ////////// - - //#ifndef __cplusplus --//struct ZZ_pEX; -+//typedef struct ZZ_pEX ZZ_pEX; - //#endif - --//EXTERN struct ZZ_pEX* new_ZZ_pEX -+//EXTERN ZZ_pEX* new_ZZ_pEX - - /////// GF2X //////////////// - #ifndef __cplusplus --struct GF2X; -+typedef struct GF2X GF2X; - #endif - - /////// GF2EContext //////////////// - - #ifndef __cplusplus --struct GF2EContext; -+typedef struct GF2E GF2E; -+typedef struct GF2EContext GF2EContext; - #endif -+typedef GF2X GF2X_c; - --EXTERN struct GF2EContext* GF2EContext_new(struct GF2X_c* p); --EXTERN struct GF2EContext* GF2EContext_construct(void *mem, const struct GF2X *p); -+EXTERN GF2EContext* GF2EContext_new(GF2X_c* p); -+EXTERN GF2EContext* GF2EContext_construct(void *mem, const GF2X *p); - - //////// mat_GF2E ////////// - - #ifndef __cplusplus --typedef struct {} mat_GF2E; -+typedef struct mat_GF2E mat_GF2E; - #endif - --EXTERN void mat_GF2E_setitem(mat_GF2E* x, int i, int j, const struct GF2E* z); -+EXTERN void mat_GF2E_setitem(mat_GF2E* x, int i, int j, const GF2E* z); - - //////// mat_GF2 ////////// - - #ifndef __cplusplus --typedef struct {} mat_GF2; -+typedef struct GF2 GF2; -+typedef struct mat_GF2 mat_GF2; - #endif - --EXTERN void mat_GF2_setitem(mat_GF2* x, int i, int j, const struct GF2* z); -+EXTERN void mat_GF2_setitem(mat_GF2* x, int i, int j, const GF2* z); ---- src/c_lib/src/ntl_wrap.cpp.orig 2014-05-13 16:22:05.531912186 -0300 -+++ src/c_lib/src/ntl_wrap.cpp 2014-05-13 16:22:11.181912591 -0300 -@@ -29,7 +29,7 @@ int ZZ_to_int(const ZZ* x) - - /* Returns a *new* ZZ object. - AUTHOR: David Harvey (2008-06-08) */ --struct ZZ* int_to_ZZ(int value) -+ZZ* int_to_ZZ(int value) - { - ZZ* output = new ZZ(); - conv(*output, value); -@@ -40,7 +40,7 @@ struct ZZ* int_to_ZZ(int value) - Assumes output has been mpz_init'd. - AUTHOR: David Harvey - Joel B. Mohler moved the ZZX_getitem_as_mpz code out to this function (2007-03-13) */ --void ZZ_to_mpz(mpz_t* output, const struct ZZ* x) -+void ZZ_to_mpz(mpz_t* output, const ZZ* x) - { - unsigned char stack_bytes[4096]; - int use_heap; -@@ -62,7 +62,7 @@ void ZZ_to_mpz(mpz_t* output, const stru - /* Copies the mpz_t into the ZZ - AUTHOR: Joel B. Mohler (2007-03-15) */ - // This should be changed to an mpz_t not an mpz_t* --void mpz_to_ZZ(struct ZZ* output, const mpz_t *x) -+void mpz_to_ZZ(ZZ* output, const mpz_t *x) - { - unsigned char stack_bytes[4096]; - int use_heap; -@@ -86,7 +86,7 @@ void ZZ_set_from_int(ZZ* x, int value) - conv(*x, value); - } - --long ZZ_remove(struct ZZ &dest, const struct ZZ &src, const struct ZZ &f) -+long ZZ_remove(ZZ &dest, const ZZ &src, const ZZ &f) - { - // Based on the code for mpz_remove - ZZ fpow[40]; // inexaustible...until year 2020 or so -@@ -172,12 +172,12 @@ void ZZ_p_set_from_int(ZZ_p* x, int valu - conv(*x, value); - } - --void ZZ_p_modulus(struct ZZ* mod, const struct ZZ_p* x) -+void ZZ_p_modulus(ZZ* mod, const ZZ_p* x) - { - (*mod) = x->modulus(); - } - --struct ZZ_p* ZZ_p_pow(const struct ZZ_p* x, long e) -+ZZ_p* ZZ_p_pow(const ZZ_p* x, long e) - { - ZZ_p *z = new ZZ_p(); - power(*z, *x, e); -@@ -203,7 +203,7 @@ ZZ_p* ZZ_p_random(void) - return z; - } - --struct ZZ_p* ZZ_p_neg(struct ZZ_p* x) -+ZZ_p* ZZ_p_neg(ZZ_p* x) - { - return new ZZ_p(-(*x)); - } -@@ -214,7 +214,7 @@ struct ZZ_p* ZZ_p_neg(struct ZZ_p* x) - //////// ZZX ////////// - /////////////////////////////////////////////// - --char* ZZX_repr(struct ZZX* x) -+char* ZZX_repr(ZZX* x) - { - ostringstream instore; - instore << (*x); -@@ -224,13 +224,13 @@ char* ZZX_repr(struct ZZX* x) - return buf; - } - --struct ZZX* ZZX_copy(struct ZZX* x) { -+ZZX* ZZX_copy(ZZX* x) { - return new ZZX(*x); - } - - /* Sets ith coefficient of x to value. - AUTHOR: David Harvey (2006-06-08) */ --void ZZX_setitem_from_int(struct ZZX* x, long i, int value) -+void ZZX_setitem_from_int(ZZX* x, long i, int value) - { - SetCoeff(*x, i, value); - } -@@ -238,7 +238,7 @@ void ZZX_setitem_from_int(struct ZZX* x, - /* Returns ith coefficient of x. - Return value is only valid if the result should fit into an int. - AUTHOR: David Harvey (2006-06-08) */ --int ZZX_getitem_as_int(struct ZZX* x, long i) -+int ZZX_getitem_as_int(ZZX* x, long i) - { - return ZZ_to_int(&coeff(*x, i)); - } -@@ -246,75 +246,75 @@ int ZZX_getitem_as_int(struct ZZX* x, lo - /* Copies ith coefficient of x to output. - Assumes output has been mpz_init'd. - AUTHOR: David Harvey (2007-02) */ --void ZZX_getitem_as_mpz(mpz_t* output, struct ZZX* x, long i) -+void ZZX_getitem_as_mpz(mpz_t* output, ZZX* x, long i) - { - const ZZ& z = coeff(*x, i); - ZZ_to_mpz(output, &z); - } - --struct ZZX* ZZX_div(struct ZZX* x, struct ZZX* y, int* divisible) -+ZZX* ZZX_div(ZZX* x, ZZX* y, int* divisible) - { -- struct ZZX* z = new ZZX(); -+ ZZX* z = new ZZX(); - *divisible = divide(*z, *x, *y); - return z; - } - - - --void ZZX_quo_rem(struct ZZX* x, struct ZZX* other, struct ZZX** r, struct ZZX** q) -+void ZZX_quo_rem(ZZX* x, ZZX* other, ZZX** r, ZZX** q) - { -- struct ZZX *qq = new ZZX(), *rr = new ZZX(); -+ ZZX *qq = new ZZX(), *rr = new ZZX(); - DivRem(*qq, *rr, *x, *other); - *r = rr; *q = qq; - } - - --struct ZZX* ZZX_square(struct ZZX* x) -+ZZX* ZZX_square(ZZX* x) - { -- struct ZZX* s = new ZZX(); -+ ZZX* s = new ZZX(); - sqr(*s, *x); - return s; - } - - --int ZZX_is_monic(struct ZZX* x) -+int ZZX_is_monic(ZZX* x) - { - return IsOne(LeadCoeff(*x)); - } - - --struct ZZX* ZZX_neg(struct ZZX* x) -+ZZX* ZZX_neg(ZZX* x) - { -- struct ZZX* y = new ZZX(); -+ ZZX* y = new ZZX(); - *y = -*x; - return y; - } - - --struct ZZX* ZZX_left_shift(struct ZZX* x, long n) -+ZZX* ZZX_left_shift(ZZX* x, long n) - { -- struct ZZX* y = new ZZX(); -+ ZZX* y = new ZZX(); - LeftShift(*y, *x, n); - return y; - } - - --struct ZZX* ZZX_right_shift(struct ZZX* x, long n) -+ZZX* ZZX_right_shift(ZZX* x, long n) - { -- struct ZZX* y = new ZZX(); -+ ZZX* y = new ZZX(); - RightShift(*y, *x, n); - return y; - } - --struct ZZX* ZZX_primitive_part(struct ZZX* x) -+ZZX* ZZX_primitive_part(ZZX* x) - { -- struct ZZX* p = new ZZX(); -+ ZZX* p = new ZZX(); - PrimitivePart(*p, *x); - return p; - } - - --void ZZX_pseudo_quo_rem(struct ZZX* x, struct ZZX* y, struct ZZX** r, struct ZZX** q) -+void ZZX_pseudo_quo_rem(ZZX* x, ZZX* y, ZZX** r, ZZX** q) - { - *r = new ZZX(); - *q = new ZZX(); -@@ -322,16 +322,16 @@ void ZZX_pseudo_quo_rem(struct ZZX* x, s - } - - --struct ZZX* ZZX_gcd(struct ZZX* x, struct ZZX* y) -+ZZX* ZZX_gcd(ZZX* x, ZZX* y) - { -- struct ZZX* g = new ZZX(); -+ ZZX* g = new ZZX(); - GCD(*g, *x, *y); - return g; - } - - --void ZZX_xgcd(struct ZZX* x, struct ZZX* y, struct ZZ** r, struct ZZX** s, -- struct ZZX** t, int proof) -+void ZZX_xgcd(ZZX* x, ZZX* y, ZZ** r, ZZX** s, -+ ZZX** t, int proof) - { - *r = new ZZ(); - *s = new ZZX(); -@@ -340,24 +340,24 @@ void ZZX_xgcd(struct ZZX* x, struct ZZX* - } - - --long ZZX_degree(struct ZZX* x) -+long ZZX_degree(ZZX* x) - { - return deg(*x); - } - --void ZZX_set_x(struct ZZX* x) -+void ZZX_set_x(ZZX* x) - { - SetX(*x); - } - - --int ZZX_is_x(struct ZZX* x) -+int ZZX_is_x(ZZX* x) - { - return IsX(*x); - } - - --struct ZZX* ZZX_derivative(struct ZZX* x) -+ZZX* ZZX_derivative(ZZX* x) - { - ZZX* d = new ZZX(); - diff(*d, *x); -@@ -365,14 +365,14 @@ struct ZZX* ZZX_derivative(struct ZZX* x - } - - --struct ZZX* ZZX_reverse(struct ZZX* x) -+ZZX* ZZX_reverse(ZZX* x) - { - ZZX* r = new ZZX(); - reverse(*r, *x); - return r; - } - --struct ZZX* ZZX_reverse_hi(struct ZZX* x, int hi) -+ZZX* ZZX_reverse_hi(ZZX* x, int hi) - { - ZZX* r = new ZZX(); - reverse(*r, *x, hi); -@@ -380,7 +380,7 @@ struct ZZX* ZZX_reverse_hi(struct ZZX* x - } - - --struct ZZX* ZZX_truncate(struct ZZX* x, long m) -+ZZX* ZZX_truncate(ZZX* x, long m) - { - ZZX* t = new ZZX(); - trunc(*t, *x, m); -@@ -388,7 +388,7 @@ struct ZZX* ZZX_truncate(struct ZZX* x, - } - - --struct ZZX* ZZX_multiply_and_truncate(struct ZZX* x, struct ZZX* y, long m) -+ZZX* ZZX_multiply_and_truncate(ZZX* x, ZZX* y, long m) - { - ZZX* t = new ZZX(); - MulTrunc(*t, *x, *y, m); -@@ -396,7 +396,7 @@ struct ZZX* ZZX_multiply_and_truncate(st - } - - --struct ZZX* ZZX_square_and_truncate(struct ZZX* x, long m) -+ZZX* ZZX_square_and_truncate(ZZX* x, long m) - { - ZZX* t = new ZZX(); - SqrTrunc(*t, *x, m); -@@ -404,7 +404,7 @@ struct ZZX* ZZX_square_and_truncate(stru - } - - --struct ZZX* ZZX_invert_and_truncate(struct ZZX* x, long m) -+ZZX* ZZX_invert_and_truncate(ZZX* x, long m) - { - ZZX* t = new ZZX(); - InvTrunc(*t, *x, m); -@@ -412,7 +412,7 @@ struct ZZX* ZZX_invert_and_truncate(stru - } - - --struct ZZX* ZZX_multiply_mod(struct ZZX* x, struct ZZX* y, struct ZZX* modulus) -+ZZX* ZZX_multiply_mod(ZZX* x, ZZX* y, ZZX* modulus) - { - ZZX* p = new ZZX(); - MulMod(*p, *x, *y, *modulus); -@@ -420,7 +420,7 @@ struct ZZX* ZZX_multiply_mod(struct ZZX* - } - - --struct ZZ* ZZX_trace_mod(struct ZZX* x, struct ZZX* y) -+ZZ* ZZX_trace_mod(ZZX* x, ZZX* y) - { - ZZ* p = new ZZ(); - TraceMod(*p, *x, *y); -@@ -428,7 +428,7 @@ struct ZZ* ZZX_trace_mod(struct ZZX* x, - } - - --char* ZZX_trace_list(struct ZZX* x) -+char* ZZX_trace_list(ZZX* x) - { - vec_ZZ v; - TraceVec(v, *x); -@@ -441,7 +441,7 @@ char* ZZX_trace_list(struct ZZX* x) - } - - --struct ZZ* ZZX_resultant(struct ZZX* x, struct ZZX* y, int proof) -+ZZ* ZZX_resultant(ZZX* x, ZZX* y, int proof) - { - ZZ* res = new ZZ(); - resultant(*res, *x, *y, proof); -@@ -449,7 +449,7 @@ struct ZZ* ZZX_resultant(struct ZZX* x, - } - - --struct ZZ* ZZX_norm_mod(struct ZZX* x, struct ZZX* y, int proof) -+ZZ* ZZX_norm_mod(ZZX* x, ZZX* y, int proof) - { - ZZ* res = new ZZ(); - NormMod(*res, *x, *y, proof); -@@ -457,7 +457,7 @@ struct ZZ* ZZX_norm_mod(struct ZZX* x, s - } - - --struct ZZ* ZZX_discriminant(struct ZZX* x, int proof) -+ZZ* ZZX_discriminant(ZZX* x, int proof) - { - ZZ* d = new ZZ(); - discriminant(*d, *x, proof); -@@ -465,7 +465,7 @@ struct ZZ* ZZX_discriminant(struct ZZX* - } - - --struct ZZX* ZZX_charpoly_mod(struct ZZX* x, struct ZZX* y, int proof) -+ZZX* ZZX_charpoly_mod(ZZX* x, ZZX* y, int proof) - { - ZZX* f = new ZZX(); - CharPolyMod(*f, *x, *y, proof); -@@ -473,7 +473,7 @@ struct ZZX* ZZX_charpoly_mod(struct ZZX* - } - - --struct ZZX* ZZX_minpoly_mod(struct ZZX* x, struct ZZX* y) -+ZZX* ZZX_minpoly_mod(ZZX* x, ZZX* y) - { - ZZX* f = new ZZX(); - MinPolyMod(*f, *x, *y); -@@ -481,19 +481,19 @@ struct ZZX* ZZX_minpoly_mod(struct ZZX* - } - - --void ZZX_clear(struct ZZX* x) -+void ZZX_clear(ZZX* x) - { - clear(*x); - } - - --void ZZX_preallocate_space(struct ZZX* x, long n) -+void ZZX_preallocate_space(ZZX* x, long n) - { - x->SetMaxLength(n); - } - - /* --EXTERN struct ZZ* ZZX_polyeval(struct ZZX* f, struct ZZ* a) -+EXTERN ZZ* ZZX_polyeval(ZZX* f, ZZ* a) - { - ZZ* b = new ZZ(); - *b = PolyEval(*f, *a); -@@ -501,7 +501,7 @@ EXTERN struct ZZ* ZZX_polyeval(struct ZZ - } - */ - --void ZZX_squarefree_decomposition(struct ZZX*** v, long** e, long* n, struct ZZX* x) -+void ZZX_squarefree_decomposition(ZZX*** v, long** e, long* n, ZZX* x) - { - vec_pair_ZZX_long factors; - SquareFreeDecomp(factors, *x); -@@ -518,7 +518,7 @@ void ZZX_squarefree_decomposition(struct - //////// ZZ_pX ////////// - /////////////////////////////////////////////// - --// char* ZZ_pX_repr(struct ZZ_pX* x) -+// char* ZZ_pX_repr(ZZ_pX* x) - // { - // ostringstream instore; - // instore << (*x); -@@ -528,17 +528,17 @@ void ZZX_squarefree_decomposition(struct - // return buf; - // } - --// void ZZ_pX_dealloc(struct ZZ_pX* x) { -+// void ZZ_pX_dealloc(ZZ_pX* x) { - // delete x; - // } - --// struct ZZ_pX* ZZ_pX_copy(struct ZZ_pX* x) { -+// ZZ_pX* ZZ_pX_copy(ZZ_pX* x) { - // return new ZZ_pX(*x); - // } - - // /* Sets ith coefficient of x to value. - // AUTHOR: David Harvey (2008-06-08) */ --// void ZZ_pX_setitem_from_int(struct ZZ_pX* x, long i, int value) -+// void ZZ_pX_setitem_from_int(ZZ_pX* x, long i, int value) - // { - // SetCoeff(*x, i, value); - // } -@@ -546,26 +546,26 @@ void ZZX_squarefree_decomposition(struct - // /* Returns ith coefficient of x. - // Return value is only valid if the result should fit into an int. - // AUTHOR: David Harvey (2008-06-08) */ --// int ZZ_pX_getitem_as_int(struct ZZ_pX* x, long i) -+// int ZZ_pX_getitem_as_int(ZZ_pX* x, long i) - // { - // return ZZ_to_int(&rep(coeff(*x, i))); - // } - --// struct ZZ_pX* ZZ_pX_add(struct ZZ_pX* x, struct ZZ_pX* y) -+// ZZ_pX* ZZ_pX_add(ZZ_pX* x, ZZ_pX* y) - // { - // ZZ_pX *z = new ZZ_pX(); - // add(*z, *x, *y); - // return z; - // } - --// struct ZZ_pX* ZZ_pX_sub(struct ZZ_pX* x, struct ZZ_pX* y) -+// ZZ_pX* ZZ_pX_sub(ZZ_pX* x, ZZ_pX* y) - // { - // ZZ_pX *z = new ZZ_pX(); - // sub(*z, *x, *y); - // return z; - // } - --// struct ZZ_pX* ZZ_pX_mul(struct ZZ_pX* x, struct ZZ_pX* y) -+// ZZ_pX* ZZ_pX_mul(ZZ_pX* x, ZZ_pX* y) - // { - // ZZ_pX *z = new ZZ_pX(); - // mul(*z, *x, *y); -@@ -573,24 +573,24 @@ void ZZX_squarefree_decomposition(struct - // } - - --// struct ZZ_pX* ZZ_pX_div(struct ZZ_pX* x, struct ZZ_pX* y, int* divisible) -+// ZZ_pX* ZZ_pX_div(ZZ_pX* x, ZZ_pX* y, int* divisible) - // { --// struct ZZ_pX* z = new ZZ_pX(); -+// ZZ_pX* z = new ZZ_pX(); - // *divisible = divide(*z, *x, *y); - // return z; - // } - - --// struct ZZ_pX* ZZ_pX_mod(struct ZZ_pX* x, struct ZZ_pX* y) -+// ZZ_pX* ZZ_pX_mod(ZZ_pX* x, ZZ_pX* y) - // { --// struct ZZ_pX* z = new ZZ_pX(); -+// ZZ_pX* z = new ZZ_pX(); - // rem(*z, *x, *y); - // return z; - // } - - - --// void ZZ_pX_quo_rem(struct ZZ_pX* x, struct ZZ_pX* y, struct ZZ_pX** r, struct ZZ_pX** q) -+// void ZZ_pX_quo_rem(ZZ_pX* x, ZZ_pX* y, ZZ_pX** r, ZZ_pX** q) - // { - // *r = new ZZ_pX(); - // *q = new ZZ_pX(); -@@ -598,55 +598,55 @@ void ZZX_squarefree_decomposition(struct - // } - - --// struct ZZ_pX* ZZ_pX_square(struct ZZ_pX* x) -+// ZZ_pX* ZZ_pX_square(ZZ_pX* x) - // { --// struct ZZ_pX* s = new ZZ_pX(); -+// ZZ_pX* s = new ZZ_pX(); - // sqr(*s, *x); - // return s; - // } - - - --// int ZZ_pX_is_monic(struct ZZ_pX* x) -+// int ZZ_pX_is_monic(ZZ_pX* x) - // { - // IsOne(LeadCoeff(*x)); - // } - - --// struct ZZ_pX* ZZ_pX_neg(struct ZZ_pX* x) -+// ZZ_pX* ZZ_pX_neg(ZZ_pX* x) - // { --// struct ZZ_pX* y = new ZZ_pX(); -+// ZZ_pX* y = new ZZ_pX(); - // *y = -*x; - // return y; - // } - - --// struct ZZ_pX* ZZ_pX_left_shift(struct ZZ_pX* x, long n) -+// ZZ_pX* ZZ_pX_left_shift(ZZ_pX* x, long n) - // { --// struct ZZ_pX* y = new ZZ_pX(); -+// ZZ_pX* y = new ZZ_pX(); - // LeftShift(*y, *x, n); - // return y; - // } - - --// struct ZZ_pX* ZZ_pX_right_shift(struct ZZ_pX* x, long n) -+// ZZ_pX* ZZ_pX_right_shift(ZZ_pX* x, long n) - // { --// struct ZZ_pX* y = new ZZ_pX(); -+// ZZ_pX* y = new ZZ_pX(); - // RightShift(*y, *x, n); - // return y; - // } - - - --// struct ZZ_pX* ZZ_pX_gcd(struct ZZ_pX* x, struct ZZ_pX* y) -+// ZZ_pX* ZZ_pX_gcd(ZZ_pX* x, ZZ_pX* y) - // { --// struct ZZ_pX* g = new ZZ_pX(); -+// ZZ_pX* g = new ZZ_pX(); - // GCD(*g, *x, *y); - // return g; - // } - - --// void ZZ_pX_xgcd(struct ZZ_pX** d, struct ZZ_pX** s, struct ZZ_pX** t, struct ZZ_pX* a, struct ZZ_pX* b) -+// void ZZ_pX_xgcd(ZZ_pX** d, ZZ_pX** s, ZZ_pX** t, ZZ_pX* a, ZZ_pX* b) - // { - // *d = new ZZ_pX(); - // *s = new ZZ_pX(); -@@ -654,7 +654,7 @@ void ZZX_squarefree_decomposition(struct - // XGCD(**d, **s, **t, *a, *b); - // } - --// void ZZ_pX_plain_xgcd(struct ZZ_pX** d, struct ZZ_pX** s, struct ZZ_pX** t, struct ZZ_pX* a, struct ZZ_pX* b) -+// void ZZ_pX_plain_xgcd(ZZ_pX** d, ZZ_pX** s, ZZ_pX** t, ZZ_pX* a, ZZ_pX* b) - // { - // *d = new ZZ_pX(); - // *s = new ZZ_pX(); -@@ -662,25 +662,25 @@ void ZZX_squarefree_decomposition(struct - // PlainXGCD(**d, **s, **t, *a, *b); - // } - --// ZZ_p* ZZ_pX_leading_coefficient(struct ZZ_pX* x) -+// ZZ_p* ZZ_pX_leading_coefficient(ZZ_pX* x) - // { - // return new ZZ_p(LeadCoeff(*x)); - // } - - --// void ZZ_pX_set_x(struct ZZ_pX* x) -+// void ZZ_pX_set_x(ZZ_pX* x) - // { - // SetX(*x); - // } - - --// int ZZ_pX_is_x(struct ZZ_pX* x) -+// int ZZ_pX_is_x(ZZ_pX* x) - // { - // return IsX(*x); - // } - - --// struct ZZ_pX* ZZ_pX_derivative(struct ZZ_pX* x) -+// ZZ_pX* ZZ_pX_derivative(ZZ_pX* x) - // { - // ZZ_pX* d = new ZZ_pX(); - // diff(*d, *x); -@@ -688,14 +688,14 @@ void ZZX_squarefree_decomposition(struct - // } - - --// struct ZZ_pX* ZZ_pX_reverse(struct ZZ_pX* x) -+// ZZ_pX* ZZ_pX_reverse(ZZ_pX* x) - // { - // ZZ_pX* r = new ZZ_pX(); - // reverse(*r, *x); - // return r; - // } - --// struct ZZ_pX* ZZ_pX_reverse_hi(struct ZZ_pX* x, int hi) -+// ZZ_pX* ZZ_pX_reverse_hi(ZZ_pX* x, int hi) - // { - // ZZ_pX* r = new ZZ_pX(); - // reverse(*r, *x, hi); -@@ -703,7 +703,7 @@ void ZZX_squarefree_decomposition(struct - // } - - --// struct ZZ_pX* ZZ_pX_truncate(struct ZZ_pX* x, long m) -+// ZZ_pX* ZZ_pX_truncate(ZZ_pX* x, long m) - // { - // ZZ_pX* t = new ZZ_pX(); - // trunc(*t, *x, m); -@@ -711,7 +711,7 @@ void ZZX_squarefree_decomposition(struct - // } - - --// struct ZZ_pX* ZZ_pX_multiply_and_truncate(struct ZZ_pX* x, struct ZZ_pX* y, long m) -+// ZZ_pX* ZZ_pX_multiply_and_truncate(ZZ_pX* x, ZZ_pX* y, long m) - // { - // ZZ_pX* t = new ZZ_pX(); - // MulTrunc(*t, *x, *y, m); -@@ -719,7 +719,7 @@ void ZZX_squarefree_decomposition(struct - // } - - --// struct ZZ_pX* ZZ_pX_square_and_truncate(struct ZZ_pX* x, long m) -+// ZZ_pX* ZZ_pX_square_and_truncate(ZZ_pX* x, long m) - // { - // ZZ_pX* t = new ZZ_pX(); - // SqrTrunc(*t, *x, m); -@@ -727,7 +727,7 @@ void ZZX_squarefree_decomposition(struct - // } - - --// struct ZZ_pX* ZZ_pX_invert_and_truncate(struct ZZ_pX* x, long m) -+// ZZ_pX* ZZ_pX_invert_and_truncate(ZZ_pX* x, long m) - // { - // ZZ_pX* t = new ZZ_pX(); - // InvTrunc(*t, *x, m); -@@ -735,7 +735,7 @@ void ZZX_squarefree_decomposition(struct - // } - - --// struct ZZ_pX* ZZ_pX_multiply_mod(struct ZZ_pX* x, struct ZZ_pX* y, struct ZZ_pX* modulus) -+// ZZ_pX* ZZ_pX_multiply_mod(ZZ_pX* x, ZZ_pX* y, ZZ_pX* modulus) - // { - // ZZ_pX* p = new ZZ_pX(); - // MulMod(*p, *x, *y, *modulus); -@@ -743,7 +743,7 @@ void ZZX_squarefree_decomposition(struct - // } - - --// struct ZZ_p* ZZ_pX_trace_mod(struct ZZ_pX* x, struct ZZ_pX* y) -+// ZZ_p* ZZ_pX_trace_mod(ZZ_pX* x, ZZ_pX* y) - // { - // ZZ_p* p = new ZZ_p(); - // TraceMod(*p, *x, *y); -@@ -751,7 +751,7 @@ void ZZX_squarefree_decomposition(struct - // } - - --char* ZZ_pX_trace_list(struct ZZ_pX* x) -+char* ZZ_pX_trace_list(ZZ_pX* x) - { - vec_ZZ_p v; - TraceVec(v, *x); -@@ -764,7 +764,7 @@ char* ZZ_pX_trace_list(struct ZZ_pX* x) - } - - --// struct ZZ_p* ZZ_pX_resultant(struct ZZ_pX* x, struct ZZ_pX* y) -+// ZZ_p* ZZ_pX_resultant(ZZ_pX* x, ZZ_pX* y) - // { - // ZZ_p* res = new ZZ_p(); - // resultant(*res, *x, *y); -@@ -772,7 +772,7 @@ char* ZZ_pX_trace_list(struct ZZ_pX* x) - // } - - --// struct ZZ_p* ZZ_pX_norm_mod(struct ZZ_pX* x, struct ZZ_pX* y) -+// ZZ_p* ZZ_pX_norm_mod(ZZ_pX* x, ZZ_pX* y) - // { - // ZZ_p* res = new ZZ_p(); - // NormMod(*res, *x, *y); -@@ -781,7 +781,7 @@ char* ZZ_pX_trace_list(struct ZZ_pX* x) - - - --// struct ZZ_pX* ZZ_pX_charpoly_mod(struct ZZ_pX* x, struct ZZ_pX* y) -+// ZZ_pX* ZZ_pX_charpoly_mod(ZZ_pX* x, ZZ_pX* y) - // { - // ZZ_pX* f = new ZZ_pX(); - // CharPolyMod(*f, *x, *y); -@@ -789,7 +789,7 @@ char* ZZ_pX_trace_list(struct ZZ_pX* x) - // } - - --// struct ZZ_pX* ZZ_pX_minpoly_mod(struct ZZ_pX* x, struct ZZ_pX* y) -+// ZZ_pX* ZZ_pX_minpoly_mod(ZZ_pX* x, ZZ_pX* y) - // { - // ZZ_pX* f = new ZZ_pX(); - // MinPolyMod(*f, *x, *y); -@@ -797,18 +797,18 @@ char* ZZ_pX_trace_list(struct ZZ_pX* x) - // } - - --// void ZZ_pX_clear(struct ZZ_pX* x) -+// void ZZ_pX_clear(ZZ_pX* x) - // { - // clear(*x); - // } - - --// void ZZ_pX_preallocate_space(struct ZZ_pX* x, long n) -+// void ZZ_pX_preallocate_space(ZZ_pX* x, long n) - // { - // x->SetMaxLength(n); - // } - --void ZZ_pX_factor(struct ZZ_pX*** v, long** e, long* n, struct ZZ_pX* x, long verbose) -+void ZZ_pX_factor(ZZ_pX*** v, long** e, long* n, ZZ_pX* x, long verbose) - { - long i; - vec_pair_ZZ_pX_long factors; -@@ -822,7 +822,7 @@ void ZZ_pX_factor(struct ZZ_pX*** v, lon - } - } - --void ZZ_pX_linear_roots(struct ZZ_p*** v, long* n, struct ZZ_pX* f) -+void ZZ_pX_linear_roots(ZZ_p*** v, long* n, ZZ_pX* f) - { - long i; - vec_ZZ_p w; -@@ -836,7 +836,7 @@ void ZZ_pX_linear_roots(struct ZZ_p*** v - - /////////// ZZ_pE ////////////// - --struct ZZ_pX ZZ_pE_to_ZZ_pX(struct ZZ_pE x) -+ZZ_pX ZZ_pE_to_ZZ_pX(ZZ_pE x) - { - return ZZ_pX(rep(x)); - } -@@ -867,45 +867,45 @@ long mat_ZZ_ncols(const mat_ZZ* x) - return x->NumCols(); - } - --void mat_ZZ_setitem(mat_ZZ* x, int i, int j, const struct ZZ* z) -+void mat_ZZ_setitem(mat_ZZ* x, int i, int j, const ZZ* z) - { - (*x)[i][j] = *z; - - } - --struct ZZ* mat_ZZ_getitem(const mat_ZZ* x, int i, int j) -+ZZ* mat_ZZ_getitem(const mat_ZZ* x, int i, int j) - { - return new ZZ((*x)(i,j)); - } - --struct ZZ* mat_ZZ_determinant(const mat_ZZ* x, long deterministic) -+ZZ* mat_ZZ_determinant(const mat_ZZ* x, long deterministic) - { - ZZ* d = new ZZ(); - determinant(*d, *x, deterministic); - return d; - } - --mat_ZZ* mat_ZZ_HNF(const mat_ZZ* A, const struct ZZ* D) -+mat_ZZ* mat_ZZ_HNF(const mat_ZZ* A, const ZZ* D) - { - mat_ZZ* W = new mat_ZZ(); - HNF(*W, *A, *D); - return W; - } - --long mat_ZZ_LLL(struct ZZ **det, mat_ZZ *x, long a, long b, long verbose) -+long mat_ZZ_LLL(ZZ **det, mat_ZZ *x, long a, long b, long verbose) - { - *det = new ZZ(); - return LLL(**det,*x,a,b,verbose); - } - --long mat_ZZ_LLL_U(struct ZZ **det, mat_ZZ *x, mat_ZZ *U, long a, long b, long verbose) -+long mat_ZZ_LLL_U(ZZ **det, mat_ZZ *x, mat_ZZ *U, long a, long b, long verbose) - { - *det = new ZZ(); - return LLL(**det,*x,*U,a,b,verbose); - } - - --struct ZZX* mat_ZZ_charpoly(const mat_ZZ* A) -+ZZX* mat_ZZ_charpoly(const mat_ZZ* A) - { - ZZX* f = new ZZX(); - CharPoly(*f, *A); -@@ -928,12 +928,12 @@ GF2EContext* GF2EContext_new(const GF2X - } - - --void mat_GF2E_setitem(mat_GF2E* x, int i, int j, const struct GF2E* z) -+void mat_GF2E_setitem(mat_GF2E* x, int i, int j, const GF2E* z) - { - (*x)[i][j] = *z; - } - --void mat_GF2_setitem(mat_GF2* x, int i, int j, const struct GF2* z) -+void mat_GF2_setitem(mat_GF2* x, int i, int j, const GF2* z) - { - (*x)[i][j] = *z; - } -@@ -1022,7 +1022,7 @@ void ZZ_pEX_conv_modulus(ZZ_pEX &fout, c - fout.normalize(); - } - --void ZZ_pX_min_val_coeff(long & valuation, long &index, const struct ZZ_pX &f, const struct ZZ &p) -+void ZZ_pX_min_val_coeff(long & valuation, long &index, const ZZ_pX &f, const ZZ &p) - { - // Sets index, where the indexth coefficient of f has the minimum p-adic valuation. - // Sets valuation to be this valuation. -@@ -1067,7 +1067,7 @@ void ZZ_pX_min_val_coeff(long & valuatio - delete u; - } - --long ZZ_pX_get_val_coeff(const struct ZZ_pX &f, const struct ZZ &p, long i) -+long ZZ_pX_get_val_coeff(const ZZ_pX &f, const ZZ &p, long i) - { - // Gets the p-adic valuation of the ith coefficient of f. - ZZ *u = new ZZ(); -@@ -1076,7 +1076,7 @@ long ZZ_pX_get_val_coeff(const struct ZZ - return ans; - } - --void ZZ_pX_left_pshift(struct ZZ_pX &x, const struct ZZ_pX &a, const struct ZZ &pn, const struct ZZ_pContext &c) -+void ZZ_pX_left_pshift(ZZ_pX &x, const ZZ_pX &a, const ZZ &pn, const ZZ_pContext &c) - { - // Multiplies each coefficient by pn, and sets the context of the answer to c. - -@@ -1102,7 +1102,7 @@ void ZZ_pX_left_pshift(struct ZZ_pX &x, - x.normalize(); - } - --void ZZ_pX_right_pshift(struct ZZ_pX &x, const struct ZZ_pX &a, const struct ZZ &pn, const struct ZZ_pContext &c) -+void ZZ_pX_right_pshift(ZZ_pX &x, const ZZ_pX &a, const ZZ &pn, const ZZ_pContext &c) - { - // Divides each coefficient by pn, and sets the context of the answer to c. - -@@ -1128,7 +1128,7 @@ void ZZ_pX_right_pshift(struct ZZ_pX &x, - x.normalize(); - } - --void ZZ_pX_InvMod_newton_unram(struct ZZ_pX &x, const struct ZZ_pX &a, const struct ZZ_pXModulus &F, const struct ZZ_pContext &cpn, const struct ZZ_pContext &cp) -+void ZZ_pX_InvMod_newton_unram(ZZ_pX &x, const ZZ_pX &a, const ZZ_pXModulus &F, const ZZ_pContext &cpn, const ZZ_pContext &cp) - { - //int j; - cp.restore(); -@@ -1163,7 +1163,7 @@ void ZZ_pX_InvMod_newton_unram(struct ZZ - delete xn; - } - --void ZZ_pX_InvMod_newton_ram(struct ZZ_pX &x, const struct ZZ_pX &a, const struct ZZ_pXModulus &F, const struct ZZ_pContext &cpn) -+void ZZ_pX_InvMod_newton_ram(ZZ_pX &x, const ZZ_pX &a, const ZZ_pXModulus &F, const ZZ_pContext &cpn) - { - //int j; - cpn.restore(); ---- src/sage/libs/ntl/decl.pxi.orig 2014-05-13 16:22:05.531912186 -0300 -+++ src/sage/libs/ntl/decl.pxi 2014-05-13 16:29:45.226945150 -0300 -@@ -22,7 +22,7 @@ from sage.libs.ntl.ntl_ZZ_pEX_decl cimpo - - cdef extern from "ntl_wrap.h": - #### mat_ZZ_c -- cdef cppclass mat_ZZ_c "mat_ZZ": -+ ctypedef struct mat_ZZ_c "mat_ZZ": - pass - - # Some boiler-plate -@@ -92,7 +92,7 @@ cdef extern from "ntl_wrap.h": - cdef long mat_ZZ_G_BKZ_RR_U "G_BKZ_RR"(mat_ZZ_c B, mat_ZZ_c U, double delta, long BlockSize, long prune, int check, long verbose) - - #### GF2_c -- ctypedef struct GF2_c "struct GF2": -+ ctypedef struct GF2_c "GF2": - pass - - GF2_c* GF2_new "New"() -@@ -118,7 +118,7 @@ cdef extern from "ntl_wrap.h": - - #### GF2X_c - -- ctypedef struct GF2X_c "struct GF2X": -+ ctypedef struct GF2X_c "GF2X": - pass - - long *GF2XHexOutput_c "(&GF2X::HexOutput)" # work-around for Cython bug -@@ -175,7 +175,7 @@ cdef extern from "ntl_wrap.h": - void GF2X_BuildIrred "BuildIrred" (GF2X_c f, long n) - - #### GF2XModulus_c -- ctypedef struct GF2XModulus_c "struct GF2XModulus": -+ ctypedef struct GF2XModulus_c "GF2XModulus": - pass - - GF2X_c GF2XModulus_GF2X "GF2X" (GF2XModulus_c m) -@@ -184,7 +184,7 @@ cdef extern from "ntl_wrap.h": - - #### GF2EContext_c - -- ctypedef struct GF2EContext_c "struct GF2EContext": -+ ctypedef struct GF2EContext_c "GF2EContext": - void (*restore)() - - GF2EContext_c* GF2EContext_new "New"() -@@ -195,7 +195,7 @@ cdef extern from "ntl_wrap.h": - void GF2EContext_delete "Delete"(GF2EContext_c *mem) - - #### GF2E_c -- ctypedef struct GF2E_c "struct GF2E": -+ ctypedef struct GF2E_c "GF2E": - pass - - void GF2E_init "GF2E::init"(GF2X_c x) -@@ -230,7 +230,7 @@ cdef extern from "ntl_wrap.h": - GF2_c GF2E_trace "trace"(GF2E_c x) - - #### GF2EX_c -- ctypedef struct GF2EX_c "struct GF2EX": -+ ctypedef struct GF2EX_c "GF2EX": - pass - - GF2EX_c* GF2EX_new "New"() -@@ -249,7 +249,7 @@ cdef extern from "ntl_wrap.h": - int GF2EX_IsZero "IsZero"(GF2EX_c x) - - #### vec_GF2E_c -- ctypedef struct vec_GF2E_c "struct vec_GF2E": -+ ctypedef struct vec_GF2E_c "vec_GF2E": - pass - - vec_GF2E_c* vec_GF2E_new "New"() -@@ -260,7 +260,7 @@ cdef extern from "ntl_wrap.h": - object vec_GF2E_to_PyString "_to_PyString"(vec_GF2E_c *x) - - #### mat_GF2E_c -- cdef cppclass mat_GF2E_c "mat_GF2E": -+ ctypedef struct mat_GF2E_c "mat_GF2E": - void (*SetDims)(long nrows, long ncols) - long (*NumRows)() - long (*NumCols)() -@@ -299,7 +299,7 @@ cdef extern from "ntl_wrap.h": - void mat_GF2E_conv_vec_GF2E(mat_GF2E_c out, vec_GF2E_c inp) - - #### vec_GF2_c -- ctypedef struct vec_GF2_c "struct vec_GF2": -+ ctypedef struct vec_GF2_c "vec_GF2": - pass - - vec_GF2_c* vec_GF2_new "New"() -@@ -311,7 +311,7 @@ cdef extern from "ntl_wrap.h": - - - #### mat_GF2_c -- cdef cppclass mat_GF2_c "mat_GF2": -+ ctypedef struct mat_GF2_c "mat_GF2": - void (*SetDims)(long nrows, long ncols) - long (*NumRows)() - long (*NumCols)() diff --git a/sagemath-pari.patch b/sagemath-pari.patch index ed7c40b..4ce8923 100644 --- a/sagemath-pari.patch +++ b/sagemath-pari.patch @@ -1,6 +1,7 @@ ---- src/sage/libs/pari/pari_instance.pxd.orig 2014-05-10 15:49:08.954184083 -0300 -+++ src/sage/libs/pari/pari_instance.pxd 2014-05-10 15:49:13.304183771 -0300 -@@ -5,6 +5,10 @@ cimport cython +diff -up src/sage/libs/pari/pari_instance.pxd.orig src/sage/libs/pari/pari_instance.pxd +--- src/sage/libs/pari/pari_instance.pxd.orig 2014-11-18 15:25:03.591127791 -0200 ++++ src/sage/libs/pari/pari_instance.pxd 2014-11-18 15:25:18.999127995 -0200 +@@ -6,6 +6,10 @@ cimport cython from sage.libs.pari.gen cimport gen @@ -11,8 +12,9 @@ cpdef long prec_bits_to_words(unsigned long prec_in_bits) @cython.final ---- src/sage/libs/pari/pari_instance.pyx.orig 2014-05-10 15:49:06.437184263 -0300 -+++ src/sage/libs/pari/pari_instance.pyx 2014-05-10 15:49:13.307183771 -0300 +diff -up src/sage/libs/pari/pari_instance.pyx.orig src/sage/libs/pari/pari_instance.pyx +--- src/sage/libs/pari/pari_instance.pyx.orig 2014-11-18 15:25:16.287127959 -0200 ++++ src/sage/libs/pari/pari_instance.pyx 2014-11-18 15:25:19.000127995 -0200 @@ -437,7 +437,12 @@ cdef class PariInstance(sage.structure.p # The size here doesn't really matter, because we will allocate # our own stack anyway. We ask PARI not to set up signal and diff --git a/sagemath-pari2.7.patch b/sagemath-pari2.7.patch deleted file mode 100644 index cf3dd9a..0000000 --- a/sagemath-pari2.7.patch +++ /dev/null @@ -1,8511 +0,0 @@ -diff -up src/doc/de/tutorial/interfaces.rst.orig src/doc/de/tutorial/interfaces.rst ---- src/doc/de/tutorial/interfaces.rst.orig 2014-08-13 11:16:54.311162302 -0300 -+++ src/doc/de/tutorial/interfaces.rst 2014-08-13 11:16:57.547162426 -0300 -@@ -135,7 +135,7 @@ Dinge mit ihr berechnen. - sage: e.elltors() - [1, [], []] - sage: e.ellglobalred() -- [10351, [1, -1, 0, -1], 1] -+ [10351, [1, -1, 0, -1], 1, [11, 1; 941, 1], [[1, 5, 0, 1], [1, 5, 0, 1]]] - sage: f = e.ellchangecurve([1,-1,0,-1]) - sage: f[:5] - [1, -1, 0, 4, 3] -diff -up src/doc/de/tutorial/tour_advanced.rst.orig src/doc/de/tutorial/tour_advanced.rst ---- src/doc/de/tutorial/tour_advanced.rst.orig 2014-08-13 11:16:54.313162302 -0300 -+++ src/doc/de/tutorial/tour_advanced.rst 2014-08-13 11:16:57.548162426 -0300 -@@ -359,12 +359,12 @@ Nun berechnen wir mehrere Invarianten vo - - sage: G.gens() - (Dirichlet character modulo 20 of conductor 4 mapping 11 |--> -1, 17 |--> 1, -- Dirichlet character modulo 20 of conductor 5 mapping 11 |--> 1, 17 |--> -i) -+ Dirichlet character modulo 20 of conductor 5 mapping 11 |--> 1, 17 |--> i) - - sage: G.unit_gens() - (11, 17) - sage: G.zeta() -- -i -+ i - sage: G.zeta_order() - 4 - -diff -up src/doc/en/bordeaux_2008/nf_galois_groups.rst.orig src/doc/en/bordeaux_2008/nf_galois_groups.rst ---- src/doc/en/bordeaux_2008/nf_galois_groups.rst.orig 2014-08-13 11:16:54.315162302 -0300 -+++ src/doc/en/bordeaux_2008/nf_galois_groups.rst 2014-08-13 11:16:57.548162426 -0300 -@@ -311,7 +311,7 @@ ideal classes containing :math:`(5,\sqrt - sage: category(C) - Category of groups - sage: C.gens() -- (Fractional ideal class (5, a), Fractional ideal class (3, a)) -+ (Fractional ideal class (2, a), Fractional ideal class (3, a)) - - - Arithmetic in the class group -@@ -328,17 +328,17 @@ means "the product of the 0th and 1st ge - sage: K. = QuadraticField(-30) - sage: C = K.class_group() - sage: C.0 -- Fractional ideal class (5, a) -+ Fractional ideal class (2, a) - sage: C.0.ideal() -- Fractional ideal (5, a) -+ Fractional ideal (2, a) - sage: I = C.0 * C.1 - sage: I -- Fractional ideal class (2, a) -+ Fractional ideal class (5, a) - - - Next we find that the class of the fractional ideal - :math:`(2,\sqrt{-30}+4/3)` is equal to the ideal class --:math:`I`. -+:math:`C.0`. - - .. link - -@@ -348,7 +348,7 @@ Next we find that the class of the fract - sage: J = C(A) - sage: J - Fractional ideal class (2/3, 1/3*a) -- sage: J == I -+ sage: J == C.0 - True - - -diff -up src/doc/en/tutorial/interfaces.rst.orig src/doc/en/tutorial/interfaces.rst ---- src/doc/en/tutorial/interfaces.rst.orig 2014-08-13 11:16:54.317162302 -0300 -+++ src/doc/en/tutorial/interfaces.rst 2014-08-13 11:16:57.549162426 -0300 -@@ -132,7 +132,7 @@ things about it. - sage: e.elltors() - [1, [], []] - sage: e.ellglobalred() -- [10351, [1, -1, 0, -1], 1] -+ [10351, [1, -1, 0, -1], 1, [11, 1; 941, 1], [[1, 5, 0, 1], [1, 5, 0, 1]]] - sage: f = e.ellchangecurve([1,-1,0,-1]) - sage: f[:5] - [1, -1, 0, 4, 3] -diff -up src/doc/en/tutorial/tour_advanced.rst.orig src/doc/en/tutorial/tour_advanced.rst ---- src/doc/en/tutorial/tour_advanced.rst.orig 2014-08-13 11:16:54.319162302 -0300 -+++ src/doc/en/tutorial/tour_advanced.rst 2014-08-13 11:16:57.549162426 -0300 -@@ -357,12 +357,12 @@ We next compute several invariants of `` - - sage: G.gens() - (Dirichlet character modulo 20 of conductor 4 mapping 11 |--> -1, 17 |--> 1, -- Dirichlet character modulo 20 of conductor 5 mapping 11 |--> 1, 17 |--> -i) -+ Dirichlet character modulo 20 of conductor 5 mapping 11 |--> 1, 17 |--> i) - - sage: G.unit_gens() - (11, 17) - sage: G.zeta() -- -i -+ i - sage: G.zeta_order() - 4 - -diff -up src/doc/fr/tutorial/interfaces.rst.orig src/doc/fr/tutorial/interfaces.rst ---- src/doc/fr/tutorial/interfaces.rst.orig 2014-08-13 11:16:54.320162302 -0300 -+++ src/doc/fr/tutorial/interfaces.rst 2014-08-13 11:16:57.550162426 -0300 -@@ -133,7 +133,7 @@ calculs avec. - sage: e.elltors() - [1, [], []] - sage: e.ellglobalred() -- [10351, [1, -1, 0, -1], 1] -+ [10351, [1, -1, 0, -1], 1, [11, 1; 941, 1], [[1, 5, 0, 1], [1, 5, 0, 1]]] - sage: f = e.ellchangecurve([1,-1,0,-1]) - sage: f[:5] - [1, -1, 0, 4, 3] -diff -up src/doc/fr/tutorial/tour_advanced.rst.orig src/doc/fr/tutorial/tour_advanced.rst ---- src/doc/fr/tutorial/tour_advanced.rst.orig 2014-08-13 11:16:54.322162302 -0300 -+++ src/doc/fr/tutorial/tour_advanced.rst 2014-08-13 11:16:57.550162426 -0300 -@@ -357,12 +357,12 @@ Nous calculons ensuite différents invar - - sage: G.gens() - (Dirichlet character modulo 20 of conductor 4 mapping 11 |--> -1, 17 |--> 1, -- Dirichlet character modulo 20 of conductor 5 mapping 11 |--> 1, 17 |--> -i) -+ Dirichlet character modulo 20 of conductor 5 mapping 11 |--> 1, 17 |--> i) - - sage: G.unit_gens() - (11, 17) - sage: G.zeta() -- -i -+ i - sage: G.zeta_order() - 4 - -diff -up src/doc/ru/tutorial/interfaces.rst.orig src/doc/ru/tutorial/interfaces.rst ---- src/doc/ru/tutorial/interfaces.rst.orig 2014-08-13 11:16:54.324162302 -0300 -+++ src/doc/ru/tutorial/interfaces.rst 2014-08-13 11:16:57.551162426 -0300 -@@ -128,7 +128,7 @@ что-нибудь. - sage: e.elltors() - [1, [], []] - sage: e.ellglobalred() -- [10351, [1, -1, 0, -1], 1] -+ [10351, [1, -1, 0, -1], 1, [11, 1; 941, 1], [[1, 5, 0, 1], [1, 5, 0, 1]]] - sage: f = e.ellchangecurve([1,-1,0,-1]) - sage: f[:5] - [1, -1, 0, 4, 3] -diff -up src/doc/ru/tutorial/tour_advanced.rst.orig src/doc/ru/tutorial/tour_advanced.rst ---- src/doc/ru/tutorial/tour_advanced.rst.orig 2014-08-13 11:16:54.326162302 -0300 -+++ src/doc/ru/tutorial/tour_advanced.rst 2014-08-13 11:16:57.551162426 -0300 -@@ -322,12 +322,12 @@ Теперь посчитаем неск - - sage: G.gens() - (Dirichlet character modulo 20 of conductor 4 mapping 11 |--> -1, 17 |--> 1, -- Dirichlet character modulo 20 of conductor 5 mapping 11 |--> 1, 17 |--> -i) -+ Dirichlet character modulo 20 of conductor 5 mapping 11 |--> 1, 17 |--> i) - - sage: G.unit_gens() - (11, 17) - sage: G.zeta() -- -i -+ i - sage: G.zeta_order() - 4 - -diff -up src/ext/pari/dokchitser/computel.gp.orig src/ext/pari/dokchitser/computel.gp ---- src/ext/pari/dokchitser/computel.gp.orig 2014-08-13 11:16:54.327162302 -0300 -+++ src/ext/pari/dokchitser/computel.gp 2014-08-13 11:16:57.552162426 -0300 -@@ -169,7 +169,7 @@ errprint(x)=if(type(x)=="t_COMPLEX",x=ab - - { - gammaseries(z0,terms, -- Avec,Bvec,Qvec,n,z,err,res,c0,c1,c2,c3,sinser,reflect,digits,srprec,negint)= -+ Avec,Bvec,Qvec,n,z,err,res,c0,c1,c2,c3,sinser,reflect,digits_,srprec,negint)= - srprec=default(seriesprecision); - if (z0==real(round(z0)),z0=real(round(z0))); \\ you don't want to know - negint=type(z0)=="t_INT" && z0<=0; \\ z0 is a pole -@@ -181,17 +181,17 @@ gammaseries(z0,terms, - if (z0==1, res=gamma(1+x), - if (z0==2, res=gamma(1+x)*(1+x), - \\ otherwise use Luke's rational approximations for psi(x) -- digits=default(realprecision); \\ save working precision -- default(realprecision,digits+3); \\ and work with 3 digits more -+ digits_=default(realprecision); \\ save working precision -+ default(realprecision,digits_+3); \\ and work with 3 digits more - reflect=real(z0)<0.5; \\ left of 1/2 use reflection formula - if (reflect,z0=1-z0); -- z=subst(Ser(precision(1.*z0,digits+3)+X),X,x); -+ z=subst(Ser(precision(1.*z0,digits_+3)+X),X,x); - \\ work with z0+x as a variable gives power series in X as an answer - Avec=[1,(z+6)/2,(z^2+82*z+96)/6,(z^3+387*z^2+2906*z+1920)/12]; - Bvec=[1,4,8*z+28,14*z^2+204*z+310]; - Qvec=[0,0,0,Avec[4]/Bvec[4]]; - n=4; -- until(err<0.1^(digits+1.5), \\ Luke's recursions for psi(x) -+ until(err<0.1^(digits_+1.5), \\ Luke's recursions for psi(x) - c1=(2*n-1)*(3*(n-1)*z+7*n^2-9*n-6); - c2=-(2*n-3)*(z-n-1)*(3*(n-1)*z-7*n^2+19*n-4); - c3=(2*n-1)*(n-3)*(z-n)*(z-n-1)*(z+n-4); -@@ -208,7 +208,7 @@ gammaseries(z0,terms, - if (negint,sinser[1]=0); \\ taking slight care at integers<0 - res=subst(Pi/res/Ser(sinser),x,-x); - ); -- default(realprecision,digits); -+ default(realprecision,digits_); - ))))); - default(seriesprecision,srprec); - res; -@@ -231,10 +231,10 @@ fullgamma(ss) = if(ss!=lastFGs,lastFGs=s - - { - fullgammaseries(ss,extraterms, -- digits,GSD)= -- digits=default(realprecision); -+ digits_,GSD)= -+ digits_=default(realprecision); - if (lastFGSs!=ss || lastFGSterms!=extraterms, -- GSD=sum(j=1,numpoles,(abs((ss+poles[j])/2-round(real((ss+poles[j])/2)))<10^(2-digits)) * PoleOrders[j] )+extraterms; -+ GSD=sum(j=1,numpoles,(abs((ss+poles[j])/2-round(real((ss+poles[j])/2)))<10^(2-digits_)) * PoleOrders[j] )+extraterms; - lastFGSs=ss; - lastFGSterms=extraterms; - lastFGSval=subst(prod(j=1,length(gammaV),gammaseries((ss+gammaV[j])/2,GSD)),x,S/2); -@@ -297,7 +297,8 @@ SeriesToContFrac(vec, - while (1, - res=concat(res,[vec[1]]); - ind=0; -- until(ind==length(vec) || abs(vec[ind+1])>10^-asympdigits,ind++;vec[ind]=0); -+ \\ Sage fix: asympdigits -> asympdigits+1 -+ until(ind==length(vec) || abs(vec[ind+1])>10^-(asympdigits+1),ind++;vec[ind]=0); - if(ind>=length(vec),break); - res=concat(res,[ind]); - vec=Vec(x^ind/Ser(vec)); -diff -up src/ext/pari/simon/ell.gp.orig src/ext/pari/simon/ell.gp ---- src/ext/pari/simon/ell.gp.orig 2014-08-13 11:16:54.329162302 -0300 -+++ src/ext/pari/simon/ell.gp 2014-08-13 11:16:57.553162426 -0300 -@@ -84,6 +84,11 @@ - - */ - -+ -+nf_scalar_or_multable_to_alg(nf, z) = { -+ if (type(z) == "t_MAT", nfbasistoalg(nf, z[,1]), z); -+} -+ - { - \\ - \\ Usual global variables -@@ -505,7 +510,7 @@ if( DEBUGLEVEL_ell >= 5, print(" end - if( DEBUGLEVEL_ell >= 5, print(" end of nfissquaremodp")); - return(0)); - if( valap, -- zlog = ideallog(nf,a*(nfbasistoalg(nf,p[5])/p.p)^valap,zinit) -+ zlog = ideallog(nf,a*(nf_scalar_or_multable_to_alg(nf,p[5])/p.p)^valap,zinit) - , - zlog = ideallog(nf,a,zinit)); - for( i = 1, #zinit[2][2], -@@ -533,7 +538,7 @@ if( DEBUGLEVEL_ell >= 5, print(" end - if( DEBUGLEVEL_ell >= 5, print(" end of nfissquaremodpq")); - return(0)); - zinit = idealstar(nf,idealpow(nf,p,q-vala),2); -- zlog = ideallog(nf,a*nfbasistoalg(nf,p[5]/2)^vala,zinit); -+ zlog = ideallog(nf,a*nf_scalar_or_multable_to_alg(nf,p[5]/2)^vala,zinit); - for( i = 1, #zinit[2][2], - if( !(zinit[2][2][i]%2) && (zlog[i]%2), - if( DEBUGLEVEL_ell >= 5, print(" end of nfissquaremodpq")); -@@ -556,7 +561,7 @@ if( DEBUGLEVEL_ell >= 5, print(" end - return(0)); - if( f%2, error("nfsqrtmodpq: a is not a square, odd valuation")); - a = nfalgtobasis(nf,a); -- if( f, aaa = nfeltpow(nf,nfeltdiv(nf,a,p[5]/p.p),f), aaa = a); -+ if( f, aaa = nfeltpow(nf,nfeltdiv(nf,a,nf_scalar_or_multable_to_alg(nf,p[5]/p.p)),f), aaa = a); - p_hnf = idealhnf(nf,p); - p_ini = nfmodprinit(nf,p); - if( DEBUGLEVEL_ell >= 5, print(" p_hnf = ",p_hnf)); -@@ -680,7 +685,7 @@ if( DEBUGLEVEL_ell >= 5, print("fin de n - if( q > 2*v, - if( DEBUGLEVEL_ell >= 5, print("fin de nflemma7")); - return(-1)); -- if( nfissquaremodpq(nf,gx*nfbasistoalg(nf,p[5]/2)^lambda,p,q), -+ if( nfissquaremodpq(nf,gx*nf_scalar_or_multable_to_alg(nf,p[5]/2)^lambda,p,q), - if( DEBUGLEVEL_ell >= 5, print("fin de nflemma7")); - return(1)) - , -@@ -694,7 +699,7 @@ if( DEBUGLEVEL_ell >= 5, print("fin de n - if( q > 2*v, - if( DEBUGLEVEL_ell >= 5, print("fin de nflemma7")); - return(-1)); -- if( nfissquaremodpq(nf,gx*nfbasistoalg(nf,p[5]/2)^lambda,p,q), -+ if( nfissquaremodpq(nf,gx*nf_scalar_or_multable_to_alg(nf,p[5]/2)^lambda,p,q), - if( DEBUGLEVEL_ell >= 5, print("fin de nflemma7")); - return(0)) - ); -@@ -772,7 +777,7 @@ if( DEBUGLEVEL_ell >= 4, print(" end - cont = idealval(nf,polcoeff(pol,0),p); - for( i = 1, deg, - if( cont, cont = min(cont,idealval(nf,polcoeff(pol,i),p)))); -- if( cont, pi = nfbasistoalg(nf,p[5]/p.p)); -+ if( cont, pi = nf_scalar_or_multable_to_alg(nf,p[5]/p.p)); - if( cont > 1, pol *= pi^(2*(cont\2))); - - \\ On essaye des valeurs de x au hasard -@@ -984,7 +989,7 @@ if( DEBUGLEVEL_ell >= 2, print(" Algori - if( DEBUGLEVEL_ell >= 3, print(" starting bnfell2descent_viaisog")); - if( variable(bnf.pol) != 'y, - error("bnfell2descent_viaisog: the variable of the number field must be y")); -- ell = ellinit(Mod(lift(ell),bnf.pol),1); -+ ell = ellinit(Mod(lift(ell),bnf.pol)); - - if( ell.disc == 0, - error("bnfell2descent_viaisog: singular curve !!")); -@@ -1231,7 +1236,7 @@ if( DEBUGLEVEL_ell >= 4, print(" bbbn - SL = idealfactor(bbbnf,SL1)[,1]~; - sunL = bnfsunit(bbbnf,SL); - fondsunL = concat(bbbnf.futu,vector(#sunL[1],i,nfbasistoalg(bbbnf,sunL[1][i]))); -- normfondsunL = norm(rnfeltabstorel( rrrnf,fondsunL)); -+ normfondsunL = vector(#fondsunL, i, norm(rnfeltabstorel(rrrnf,fondsunL[i]))); - SK = idealfactor(bnf,idealnorm(bbbnf,SL1))[,1]~; - sunK = bnfsunit(bnf,SK); - fondsunK = concat(bnf.futu,vector(#sunK[1],i,nfbasistoalg(bnf,sunK[1][i]))); -@@ -1500,7 +1505,7 @@ if( DEBUGLEVEL_ell >= 4, print(" star - nf = bnf.nf; - unnf = Mod(1,nf.pol); - ellnf = ell*unnf; -- if( #ellnf <= 5, ellnf = ellinit(ellnf,1)); -+ if( #ellnf <= 5, ellnf = ellinit(ellnf)); - - A = ellnf.a2; if( DEBUGLEVEL_ell >= 2, print(" A = ",A)); - B = ellnf.a4; if( DEBUGLEVEL_ell >= 2, print(" B = ",B)); -@@ -1887,7 +1892,8 @@ if( DEBUGLEVEL_ell >= 4, print(" end - local(urst,urst1,den,factden,eqtheta,rnfeq,bbnf,ext,rang,f); - - if( DEBUGLEVEL_ell >= 3, print(" starting bnfellrank")); -- if( #ell <= 5, ell = ellinit(ell,1)); -+ if( #ell < 5, ell = ellinit(ell)); -+ ell = vector(5, i, ell[i]); - - \\ removes the coefficients a1 and a3 - urst = [1,0,0,0]; -diff -up src/ext/pari/simon/ellQ.gp.orig src/ext/pari/simon/ellQ.gp ---- src/ext/pari/simon/ellQ.gp.orig 2014-08-13 11:16:54.331162303 -0300 -+++ src/ext/pari/simon/ellQ.gp 2014-08-13 11:16:57.555162426 -0300 -@@ -117,7 +117,7 @@ - Courbes de la forme : k*y^2 = x^3+A*x^2+B*x+C - sans 2-torsion, A,B,C entiers. - gp > bnf = bnfinit(x^3+A*x^2+B*x+C); -- gp > ell = ellinit([0,A,0,B,C],1); -+ gp > ell = ellinit([0,A,0,B,C]); - gp > rank = ell2descent_gen(ell,bnf,k); - - Courbes avec #E[2](Q) >= 2 : -@@ -833,7 +833,7 @@ if( DEBUGLEVEL_ell >= 4, print(" end - \\ returns all the points Q on ell such that 2Q = P. - my(pol2,ratroots,half,x2,y2,P2); - -- if(#ell < 13, ell=ellinit(ell,1)); -+ if(#ell < 13, ell=ellinit(ell)); - - pol2 = Pol([4,ell.b2,2*ell.b4,ell.b6]); \\ 2-division polynomial - -@@ -880,7 +880,7 @@ if( DEBUGLEVEL_ell >= 3, print(" E[2] - my(torseven,P2); - - if( DEBUGLEVEL_ell >= 4, print(" computing the 2^n-torsion")); -- if(#ell < 13, ell=ellinit(ell,1)); -+ if(#ell < 13, ell=ellinit(ell)); - torseven = elltors2(ell); - - while( torseven[1] != 1, -@@ -976,7 +976,7 @@ if( DEBUGLEVEL_ell >= 5, print(" ell - d = #listgen; - if( d == 0, return([])); - -- if( #ell < 13, ell = ellinit(ell,1)); -+ if( #ell < 13, ell = ellinit(ell)); - - if( K != 1, - if( ell.a1 != 0 || ell.a3 != 0, error(" ellredgen: a1*a3 != 0")); -@@ -1323,7 +1323,7 @@ my(A,B,C,polrel,polprime,ttheta,badprime - - if( DEBUGLEVEL_ell >= 4, print(" starting ell2descent_gen")); - -- if( #ell < 13, ell = ellinit(ell,1)); -+ if( #ell < 13, ell = ellinit(ell)); - - if( ell.a1 != 0 || ell.a3 != 0, - error(" ell2descent_gen: the curve is not of the form [0,a,0,b,c]")); -@@ -1579,7 +1579,7 @@ if( DEBUGLEVEL_ell >= 4, print(" end - my(urst,urst1,den,eqell,tors2,bnf,rang,time1); - - if( DEBUGLEVEL_ell >= 3, print(" starting ellrank")); -- if( #ell < 13, ell = ellinit(ell,1)); -+ if( #ell < 13, ell = ellinit(ell)); - - \\ kill the coefficients a1 and a3 - urst = [1,0,0,0]; -@@ -1915,7 +1915,7 @@ if( DEBUGLEVEL_ell >= 4, print(" end - my(P,Pfact,tors,listpointstriv,KS2prod,KS2gen,listpoints,pointgen,n1,n2,certain,apinit,bpinit,np1,np2,listpoints2,aux1,aux2,certainp,rang,strange); - - if( DEBUGLEVEL_ell >= 2, print(" Algorithm of 2-descent via isogenies")); -- if( #ell < 13, ell = ellinit(ell,1)); -+ if( #ell < 13, ell = ellinit(ell)); - - if( ell.disc == 0, - error(" ell2descent_viaisog: singular curve !!")); -diff -up src/sage/calculus/calculus.py.orig src/sage/calculus/calculus.py ---- src/sage/calculus/calculus.py.orig 2014-08-13 11:16:54.333162303 -0300 -+++ src/sage/calculus/calculus.py 2014-08-13 11:16:57.555162426 -0300 -@@ -767,13 +767,13 @@ def nintegral(ex, x, a, b, - to high precision:: - - sage: gp.eval('intnum(x=17,42,exp(-x^2)*log(x))') -- '2.565728500561051482917356396 E-127' # 32-bit -- '2.5657285005610514829173563961304785900 E-127' # 64-bit -+ '2.565728500561051482917356396 E-127' # 32-bit -+ '2.5657285005610514829173563961304785900 E-127' # 64-bit - sage: old_prec = gp.set_real_precision(50) - sage: gp.eval('intnum(x=17,42,exp(-x^2)*log(x))') - '2.5657285005610514829173563961304785900147709554020 E-127' - sage: gp.set_real_precision(old_prec) -- 50 -+ 57 - - Note that the input function above is a string in PARI syntax. - """ -diff -up src/sage/functions/exp_integral.py.orig src/sage/functions/exp_integral.py ---- src/sage/functions/exp_integral.py.orig 2014-08-13 11:16:54.335162303 -0300 -+++ src/sage/functions/exp_integral.py 2014-08-13 11:16:57.556162426 -0300 -@@ -1493,10 +1493,10 @@ def exponential_integral_1(x, n=0): - - sage: exponential_integral_1(2) - 0.0489005107080611 -- sage: exponential_integral_1(2,4) # abs tol 1e-18 -+ sage: exponential_integral_1(2, 4) # abs tol 1e-18 - [0.0489005107080611, 0.00377935240984891, 0.000360082452162659, 0.0000376656228439245] -- sage: exponential_integral_1(40,5) -- [1.03677326145166e-19, 2.22854325868847e-37, 6.33732515501151e-55, 2.02336191509997e-72, 6.88522610630764e-90] -+ sage: exponential_integral_1(40, 5) -+ [0.000000000000000, 2.22854325868847e-37, 6.33732515501151e-55, 2.02336191509997e-72, 6.88522610630764e-90] - sage: exponential_integral_1(0) - +Infinity - sage: r = exponential_integral_1(RealField(150)(1)) -@@ -1569,7 +1569,7 @@ def exponential_integral_1(x, n=0): - if n <= 0: - # Add extra bits to the input. - # (experimentally verified -- Jeroen Demeyer) -- inprec = prec + math.ceil(math.log(2*prec)) -+ inprec = prec + 5 + math.ceil(math.log(prec)) - x = RealField(inprec)(x)._pari_() - return R(x.eint1()) - else: -diff -up src/sage/groups/generic.py.orig src/sage/groups/generic.py ---- src/sage/groups/generic.py.orig 2014-08-13 11:16:54.336162303 -0300 -+++ src/sage/groups/generic.py 2014-08-13 11:16:57.556162426 -0300 -@@ -420,8 +420,7 @@ def bsgs(a, b, bounds, operation='*', id - sage: F. = GF(37^5) - sage: E = EllipticCurve(F, [1,1]) - sage: P = E.lift_x(a); P -- (a : 28*a^4 + 15*a^3 + 14*a^2 + 7 : 1) # 32-bit -- (a : 9*a^4 + 22*a^3 + 23*a^2 + 30 : 1) # 64-bit -+ (a : 28*a^4 + 15*a^3 + 14*a^2 + 7 : 1) - - This will return a multiple of the order of P:: - -@@ -853,8 +852,8 @@ def discrete_log_lambda(a, base, bounds, - sage: F. = GF(37^5) - sage: E = EllipticCurve(F, [1,1]) - sage: P = E.lift_x(a); P -- (a : 9*a^4 + 22*a^3 + 23*a^2 + 30 : 1) # 32-bit -- (a : 28*a^4 + 15*a^3 + 14*a^2 + 7 : 1) # 64-bit -+ (a : 28*a^4 + 15*a^3 + 14*a^2 + 7 : 1) # 32-bit -+ (a : 9*a^4 + 22*a^3 + 23*a^2 + 30 : 1) # 64-bit - - This will return a multiple of the order of P:: - -diff -up src/sage/interfaces/gp.py.orig src/sage/interfaces/gp.py ---- src/sage/interfaces/gp.py.orig 2014-08-13 11:16:54.339162303 -0300 -+++ src/sage/interfaces/gp.py 2014-08-13 11:16:57.556162426 -0300 -@@ -24,7 +24,7 @@ PARI interpreter):: - - sage: E = gp.ellinit([1,2,3,4,5]) - sage: E.ellglobalred() -- [10351, [1, -1, 0, -1], 1] -+ [10351, [1, -1, 0, -1], 1, [11, 1; 941, 1], [[1, 5, 0, 1], [1, 5, 0, 1]]] - sage: E.ellan(20) - [1, 1, 0, -1, -3, 0, -1, -3, -3, -3, -1, 0, 1, -1, 0, -1, 5, -3, 4, 3] - -@@ -113,7 +113,7 @@ Test error recovery:: - PARI/GP ERROR: - *** at top-level: sage[...]=1/0 - *** ^-- -- *** _/_: division by zero -+ *** _/_: impossible inverse in gdiv: 0. - - AUTHORS: - -@@ -322,9 +322,16 @@ class Gp(Expect): - - get_real_precision = get_precision - -- def set_precision(self, prec=None): -+ def set_precision(self, prec): - """ -- Sets the PARI precision (in decimal digits) for real computations, and returns the old value. -+ Sets the PARI precision (in decimal digits) for real -+ computations, and returns the old value. -+ -+ .. NOTE:: -+ -+ PARI/GP rounds up precisions to the nearest machine word, -+ so the result of :meth:`get_precision` is not always the -+ same as the last value inputted to :meth:`set_precision`. - - EXAMPLES:: - -@@ -332,9 +339,9 @@ class Gp(Expect): - 28 # 32-bit - 38 # 64-bit - sage: gp.get_precision() -- 53 -+ 57 - sage: gp.set_precision(old_prec) -- 53 -+ 57 - sage: gp.get_precision() - 28 # 32-bit - 38 # 64-bit -@@ -436,25 +443,23 @@ class Gp(Expect): - return m - t - return m - -- def set_default(self, var=None, value=None): -+ def set_default(self, var, value): - """ - Set a PARI gp configuration variable, and return the old value. - - INPUT: - -- - ``var`` (string, default None) -- the name of a PARI gp -+ - ``var`` (string) -- the name of a PARI gp - configuration variable. (See ``gp.default()`` for a list.) - - ``value`` -- the value to set the variable to. - - EXAMPLES:: - -- sage: old_prec = gp.set_default('realprecision',100); old_prec -- 28 # 32-bit -- 38 # 64-bit -+ sage: old_prec = gp.set_default('realprecision', 110) - sage: gp.get_default('realprecision') -- 100 -- sage: gp.set_default('realprecision',old_prec) -- 100 -+ 115 -+ sage: gp.set_default('realprecision', old_prec) -+ 115 - sage: gp.get_default('realprecision') - 28 # 32-bit - 38 # 64-bit -@@ -463,13 +468,13 @@ class Gp(Expect): - self._eval_line('default(%s,%s)'%(var,value)) - return old - -- def get_default(self, var=None): -+ def get_default(self, var): - """ - Return the current value of a PARI gp configuration variable. - - INPUT: - -- - ``var`` (string, default None) -- the name of a PARI gp -+ - ``var`` (string) -- the name of a PARI gp - configuration variable. (See ``gp.default()`` for a list.) - - OUTPUT: -@@ -808,13 +813,16 @@ class GpElement(ExpectElement): - - sage: E = gp('ellinit([1,2,3,4,5])') - sage: loads(dumps(E)) == E -+ True -+ sage: x = gp.Pi()/3 -+ sage: loads(dumps(x)) == x - False -- sage: loads(E.dumps()) -- [1, 2, 3, 4, 5, 9, 11, 29, 35, -183, -3429, -10351, 6128487/10351, [-1.618909932267371342378000940, -0.3155450338663143288109995302 - 2.092547096911958607981689447*I, -0.3155450338663143288109995302 + 2.092547096911958607981689447*I]~, 2.780740013766729771063197627, 1.390370006883364885531598814 - 1.068749776356193066159263548*I, 3.109648242324380328550149122 + 1.009741959000000000000000000 E-28*I, 1.554824121162190164275074561 + 1.064374745210273756943885994*I, 2.971915267817909670771647951] # 32-bit -- [1, 2, 3, 4, 5, 9, 11, 29, 35, -183, -3429, -10351, 6128487/10351, [-1.6189099322673713423780009396072169751, -0.31554503386631432881099953019639151248 - 2.0925470969119586079816894466366945829*I, -0.31554503386631432881099953019639151248 + 2.0925470969119586079816894466366945829*I]~, 2.7807400137667297710631976271813584994, 1.3903700068833648855315988135906792497 - 1.0687497763561930661592635474375038788*I, 3.1096482423243803285501491221965830079 + 2.3509887016445750160000000000000000000 E-38*I, 1.5548241211621901642750745610982915040 + 1.0643747452102737569438859937299427442*I, 2.9719152678179096707716479509361896060] # 64-bit -- sage: E -- [1, 2, 3, 4, 5, 9, 11, 29, 35, -183, -3429, -10351, 6128487/10351, [-1.618909932267371342378000940, -0.3155450338663143288109995302 - 2.092547096911958607981689447*I, -0.3155450338663143288109995302 + 2.092547096911958607981689447*I]~, 2.780740013766729771063197627, 1.390370006883364885531598814 - 1.068749776356193066159263548*I, 3.109648242324380328550149122 + 1.009741959 E-28*I, 1.554824121162190164275074561 + 1.064374745210273756943885994*I, 2.971915267817909670771647951] # 32-bit -- [1, 2, 3, 4, 5, 9, 11, 29, 35, -183, -3429, -10351, 6128487/10351, [-1.6189099322673713423780009396072169751, -0.31554503386631432881099953019639151248 - 2.0925470969119586079816894466366945829*I, -0.31554503386631432881099953019639151248 + 2.0925470969119586079816894466366945829*I]~, 2.7807400137667297710631976271813584994, 1.3903700068833648855315988135906792497 - 1.0687497763561930661592635474375038788*I, 3.1096482423243803285501491221965830079 + 2.350988701644575016 E-38*I, 1.5548241211621901642750745610982915040 + 1.0643747452102737569438859937299427442*I, 2.9719152678179096707716479509361896060] # 64-bit -+ sage: x -+ 1.047197551196597746154214461 # 32-bit -+ 1.0471975511965977461542144610931676281 # 64-bit -+ sage: loads(dumps(x)) -+ 1.047197551196597746154214461 # 32-bit -+ 1.0471975511965977461542144610931676281 # 64-bit - - The two elliptic curves look the same, but internally the floating - point numbers are slightly different. -diff -up src/sage/lfunctions/dokchitser.py.orig src/sage/lfunctions/dokchitser.py ---- src/sage/lfunctions/dokchitser.py.orig 2014-08-13 11:16:54.340162303 -0300 -+++ src/sage/lfunctions/dokchitser.py 2014-08-13 11:16:57.557162426 -0300 -@@ -108,7 +108,7 @@ class Dokchitser(SageObject): - sage: L.taylor_series(1,4) - 0.000000000000000 + 0.305999773834052*z + 0.186547797268162*z^2 - 0.136791463097188*z^3 + O(z^4) - sage: L.check_functional_equation() -- 6.11218974800000e-18 # 32-bit -+ 6.11218974700000e-18 # 32-bit - 6.04442711160669e-18 # 64-bit - - RANK 2 ELLIPTIC CURVE: -@@ -125,8 +125,8 @@ class Dokchitser(SageObject): - sage: L.derivative(1,E.rank()) - 1.51863300057685 - sage: L.taylor_series(1,4) -- 2.90759778535572e-20 + (-1.64772676916085e-20)*z + 0.759316500288427*z^2 - 0.430302337583362*z^3 + O(z^4) # 32-bit -- -3.11623283109075e-21 + (1.76595961125962e-21)*z + 0.759316500288427*z^2 - 0.430302337583362*z^3 + O(z^4) # 64-bit -+ 2.90760251490292e-20 + (-1.64772944938078e-20)*z + 0.759316500288427*z^2 - 0.430302337583362*z^3 + O(z^4) # 32-bit -+ -3.11661104824958e-21 + (1.76617394576638e-21)*z + 0.759316500288427*z^2 - 0.430302337583362*z^3 + O(z^4) # 64-bit - - RAMANUJAN DELTA L-FUNCTION: - -@@ -218,7 +218,9 @@ class Dokchitser(SageObject): - except AttributeError: - logfile = None - # For debugging -- #logfile = os.path.join(DOT_SAGE, 'dokchitser.log') -+ import os -+ from sage.env import DOT_SAGE -+ logfile = os.path.join(DOT_SAGE, 'dokchitser.log') - g = sage.interfaces.gp.Gp(script_subdirectory='dokchitser', logfile=logfile) - g.read('computel.gp') - self.__gp = g -@@ -484,7 +486,7 @@ class Dokchitser(SageObject): - sage: E = EllipticCurve('389a') - sage: L = E.lseries().dokchitser(200) - sage: L.taylor_series(1,3) -- 6.2240188634103774348273446965620801288836328651973234573133e-73 + (-3.527132447498646306292650465494647003849868770...e-73)*z + 0.75931650028842677023019260789472201907809751649492435158581*z^2 + O(z^3) -+ -9.094...e-82 + (5.1538...e-82)*z + 0.75931650028842677023019260789472201907809751649492435158581*z^2 + O(z^3) - """ - self.__check_init() - a = self.__CC(a) -diff -up src/sage/libs/pari/decl.pxi.orig src/sage/libs/pari/decl.pxi ---- src/sage/libs/pari/decl.pxi.orig 2014-08-13 11:16:54.343162303 -0300 -+++ src/sage/libs/pari/decl.pxi 2014-08-13 11:18:04.961165007 -0300 -@@ -16,16 +16,14 @@ AUTHORS: - - - Jeroen Demeyer (2010-08-15): big clean up (#9898) - -+ - Jeroen Demeyer (2014-02-09): upgrade to PARI 2.7 (#15767) -+ - """ - - include 'sage/ext/cdefs.pxi' - --cdef extern from 'setjmp.h': -- struct __jmp_buf_tag: -- pass -- ctypedef __jmp_buf_tag jmp_buf -- int setjmp (jmp_buf __env) -- int longjmp (jmp_buf __env, int val) -+cdef extern from '': -+ ctypedef void* va_list - - ctypedef unsigned long ulong - -@@ -35,6 +33,46 @@ cdef extern from 'pari/paricfg.h': - - cdef extern from 'pari/pari.h': - ctypedef long* GEN -+ ctypedef char* byteptr -+ -+ # Various structures that we don't use in Sage but which need to be -+ # declared, otherwise Cython complains. -+ struct bb_group: -+ pass -+ struct bb_field: -+ pass -+ struct bb_algebra: -+ pass -+ struct qfr_data: -+ pass -+ struct nfmaxord_t: -+ pass -+ struct forcomposite_t: -+ pass -+ struct forpart_t: -+ pass -+ struct forprime_t: -+ pass -+ struct forvec_t: -+ pass -+ struct entree: -+ pass -+ struct gp_context: -+ pass -+ struct pariFILE: -+ pass -+ struct pari_mt: -+ pass -+ struct pari_thread: -+ pass -+ struct pari_timer: -+ pass -+ struct GENbin: -+ pass -+ struct hashentry: -+ pass -+ struct hashtable: -+ pass - - # PARI types: these are actually an enum type, but that doesn't - # matter for Cython. -@@ -49,13 +87,19 @@ cdef extern from 'pari/pari.h': - - # parierr.h - -- int syntaxer, bugparier, alarmer, openfiler, talker, flagerr, \ -- impl, archer, notfuncer, precer, typeer, consister, user, \ -- errpile, overflower, matinv1, mattype1, arither1, primer1, \ -- invmoder, constpoler, notpoler, redpoler, zeropoler, operi, \ -- operf, gdiver, memer, negexper, sqrter5, noer -+ int e_SYNTAX, e_BUG, \ -+ e_ALARM, e_FILE, \ -+ e_MISC, e_FLAG, e_IMPL, e_ARCH, e_PACKAGE, e_NOTFUNC, \ -+ e_PREC, e_TYPE, e_DIM, e_VAR, e_PRIORITY, e_USER, \ -+ e_STACK, e_OVERFLOW, e_DOMAIN, e_COMPONENT, \ -+ e_MAXPRIME, \ -+ e_CONSTPOL, e_IRREDPOL, e_COPRIME, e_PRIME, e_MODULUS, e_ROOTS0, \ -+ e_OP, e_TYPE2, e_INV, \ -+ e_MEM, \ -+ e_SQRTN, \ -+ e_NONE - -- int warner, warnprec, warnfile, warnmem -+ int warner, warnprec, warnfile, warnmem, warnuser - - # parigen.h - -@@ -93,20 +137,20 @@ cdef extern from 'pari/pari.h': - - # paricast.h - -- long mael2(GEN,long,long) -- long mael3(GEN,long,long,long) -- long mael4(GEN,long,long,long,long) -- long mael5(GEN,long,long,long,long,long) -- long mael(GEN,long,long) -- GEN gmael1(GEN,long) -- GEN gmael2(GEN,long,long) -- GEN gmael3(GEN,long,long,long) -- GEN gmael4(GEN,long,long,long,long) -- GEN gmael5(GEN,long,long,long,long,long) -- GEN gmael(GEN,long,long) -- GEN gel(GEN,long) -- GEN gcoeff(GEN,long,long) -- long coeff(GEN,long,long) -+ long mael2(GEN, long, long) -+ long mael3(GEN, long, long, long) -+ long mael4(GEN, long, long, long, long) -+ long mael5(GEN, long, long, long, long, long) -+ long mael(GEN, long, long) -+ GEN gmael1(GEN, long) -+ GEN gmael2(GEN, long, long) -+ GEN gmael3(GEN, long, long, long) -+ GEN gmael4(GEN, long, long, long, long) -+ GEN gmael5(GEN, long, long, long, long, long) -+ GEN gmael(GEN, long, long) -+ GEN gel(GEN, long) -+ GEN gcoeff(GEN, long, long) -+ long coeff(GEN, long, long) - - # paricom.h - -@@ -131,11 +175,14 @@ cdef extern from 'pari/pari.h': - ulong Fl_add(ulong a, ulong b, ulong p) - long Fl_center(ulong u, ulong p, ulong ps2) - ulong Fl_div(ulong a, ulong b, ulong p) -+ ulong Fl_double(ulong a, ulong p) - ulong Fl_mul(ulong a, ulong b, ulong p) - ulong Fl_neg(ulong x, ulong p) - ulong Fl_sqr(ulong a, ulong p) - ulong Fl_sub(ulong a, ulong b, ulong p) -+ ulong Fl_triple(ulong a, ulong p) - GEN absi(GEN x) -+ GEN absi_shallow(GEN x) - GEN absr(GEN x) - int absrnz_equal1(GEN x) - int absrnz_equal2n(GEN x) -@@ -165,11 +212,13 @@ cdef extern from 'pari/pari.h': - void affui(ulong s, GEN x) - void affur(ulong s, GEN x) - GEN cgetg(long x, long y) -+ GEN cgetg_block(long x, long y) - GEN cgetg_copy(GEN x, long *plx) - GEN cgeti(long x) - GEN cgetineg(long x) - GEN cgetipos(long x) - GEN cgetr(long x) -+ GEN cgetr_block(long prec) - int cmpir(GEN x, GEN y) - int cmpis(GEN x, long y) - int cmpiu(GEN x, ulong y) -@@ -215,19 +264,23 @@ cdef extern from 'pari/pari.h': - int equalui(ulong x, GEN y) - long evalexpo(long x) - long evallg(long x) -+ long evalprecp(long x) - long evalvalp(long x) - long expi(GEN x) - long expu(ulong x) - void fixlg(GEN z, long ly) - GEN fractor(GEN x, long prec) - GEN icopy(GEN x) -+ GEN icopyspec(GEN x, long nx) - GEN icopy_avma(GEN x, pari_sp av) -+ ulong int_bit(GEN x, long n) - GEN itor(GEN x, long prec) - long itos(GEN x) - long itos_or_0(GEN x) - ulong itou(GEN x) - ulong itou_or_0(GEN x) - GEN leafcopy(GEN x) -+ GEN leafcopy_avma(GEN x, pari_sp av) - double maxdd(double x, double y) - long maxss(long x, long y) - long maxuu(ulong x, ulong y) -@@ -248,6 +301,7 @@ cdef extern from 'pari/pari.h': - GEN modss(long x, long y) - void modssz(long s, long y, GEN z) - GEN mpabs(GEN x) -+ GEN mpabs_shallow(GEN x) - GEN mpadd(GEN x, GEN y) - void mpaddz(GEN x, GEN y, GEN z) - void mpaff(GEN x, GEN y) -@@ -262,7 +316,7 @@ cdef extern from 'pari/pari.h': - GEN mpneg(GEN x) - int mpodd(GEN x) - GEN mpround(GEN x) -- GEN mpshift(GEN x,long s) -+ GEN mpshift(GEN x, long s) - GEN mpsqr(GEN x) - GEN mpsub(GEN x, GEN y) - void mpsubz(GEN x, GEN y, GEN z) -@@ -289,6 +343,7 @@ cdef extern from 'pari/pari.h': - GEN rdivsi(long x, GEN y, long prec) - GEN rdivss(long x, long y, long prec) - GEN real2n(long n, long prec) -+ GEN real_m2n(long n, long prec) - GEN real_0(long prec) - GEN real_0_bit(long bitprec) - GEN real_1(long prec) -@@ -305,15 +360,20 @@ cdef extern from 'pari/pari.h': - long sdivsi(long x, GEN y) - long sdivsi_rem(long x, GEN y, long *rem) - long sdivss_rem(long x, long y, long *rem) -+ ulong udiviu_rem(GEN n, ulong d, ulong *r) -+ ulong udivuu_rem(ulong x, ulong y, ulong *r) - void setabssign(GEN x) - void shift_left(GEN z2, GEN z1, long min, long M, ulong f, ulong sh) - void shift_right(GEN z2, GEN z1, long min, long M, ulong f, ulong sh) - ulong shiftl(ulong x, ulong y) - ulong shiftlr(ulong x, ulong y) - GEN shiftr(GEN x, long n) -+ void shiftr_inplace(GEN z, long d) - long smodis(GEN x, long y) - long smodss(long x, long y) - void stackdummy(pari_sp av, pari_sp ltop) -+ char *stack_malloc(size_t N) -+ char *stack_calloc(size_t N) - GEN stoi(long x) - GEN stor(long x, long prec) - GEN subii(GEN x, GEN y) -@@ -338,7 +398,7 @@ cdef extern from 'pari/pari.h': - void togglesign_safe(GEN *px) - void affectsign(GEN x, GEN y) - void affectsign_safe(GEN x, GEN *py) -- GEN truedivii(GEN a,GEN b) -+ GEN truedivii(GEN a, GEN b) - GEN truedivis(GEN a, long b) - GEN truedivsi(long a, GEN b) - ulong udivui_rem(ulong x, GEN y, ulong *rem) -@@ -351,28 +411,51 @@ cdef extern from 'pari/pari.h': - GEN uutoineg(ulong x, ulong y) - long vali(GEN x) - -+ # OBSOLETE -+ -+ GEN bernvec(long nomb) -+ - # F2x.c - -+ GEN F2c_to_Flc(GEN x) - GEN F2c_to_ZC(GEN x) -+ GEN F2c_to_mod(GEN x) -+ GEN F2m_rowslice(GEN x, long a, long b) -+ GEN F2m_to_Flm(GEN z) - GEN F2m_to_ZM(GEN z) -+ GEN F2m_to_mod(GEN z) - void F2v_add_inplace(GEN x, GEN y) -+ ulong F2v_dotproduct(GEN x, GEN y) -+ GEN F2v_slice(GEN x, long a, long b) -+ GEN F2x_F2xq_eval(GEN Q, GEN x, GEN T) -+ GEN F2x_F2xqV_eval(GEN P, GEN V, GEN T) - GEN F2x_1_add(GEN y) - GEN F2x_add(GEN x, GEN y) -+ GEN F2x_deflate(GEN x0, long d) - long F2x_degree(GEN x) - GEN F2x_deriv(GEN x) - GEN F2x_divrem(GEN x, GEN y, GEN *pr) -+ void F2x_even_odd(GEN p, GEN *pe, GEN *po) - GEN F2x_extgcd(GEN a, GEN b, GEN *ptu, GEN *ptv) - GEN F2x_gcd(GEN a, GEN b) -+ GEN F2x_halfgcd(GEN a, GEN b) -+ int F2x_issquare(GEN a) - GEN F2x_mul(GEN x, GEN y) - GEN F2x_rem(GEN x, GEN y) -+ GEN F2x_shift(GEN y, long d) - GEN F2x_sqr(GEN x) -+ GEN F2x_sqrt(GEN x) - GEN F2x_to_F2v(GEN x, long n) - GEN F2x_to_Flx(GEN x) - GEN F2x_to_ZX(GEN x) -+ long F2x_valrem(GEN x, GEN *Z) - GEN F2xC_to_ZXC(GEN x) - GEN F2xV_to_F2m(GEN v, long n) -+ GEN F2xq_Artin_Schreier(GEN a, GEN T) -+ GEN FlxqXQV_autsum(GEN aut, long n, GEN S, GEN T, ulong p) -+ GEN F2xq_autpow(GEN x, long n, GEN T) - GEN F2xq_conjvec(GEN x, GEN T) -- GEN F2xq_div(GEN x,GEN y,GEN T) -+ GEN F2xq_div(GEN x, GEN y, GEN T) - GEN F2xq_inv(GEN x, GEN T) - GEN F2xq_invsafe(GEN x, GEN T) - GEN F2xq_log(GEN a, GEN g, GEN ord, GEN T) -@@ -380,46 +463,86 @@ cdef extern from 'pari/pari.h': - GEN F2xq_mul(GEN x, GEN y, GEN pol) - GEN F2xq_order(GEN a, GEN ord, GEN T) - GEN F2xq_pow(GEN x, GEN n, GEN pol) -+ GEN F2xq_powu(GEN x, ulong n, GEN pol) - GEN F2xq_powers(GEN x, long l, GEN T) -- GEN F2xq_sqr(GEN x,GEN pol) -+ GEN F2xq_sqr(GEN x, GEN pol) - GEN F2xq_sqrt(GEN a, GEN T) -+ GEN F2xq_sqrt_fast(GEN c, GEN sqx, GEN T) - GEN F2xq_sqrtn(GEN a, GEN n, GEN T, GEN *zeta) - ulong F2xq_trace(GEN x, GEN T) - GEN Flm_to_F2m(GEN x) - GEN Flv_to_F2v(GEN x) - GEN Flx_to_F2x(GEN x) -- GEN Z_to_F2x(GEN x, long sv) -+ GEN Rg_to_F2xq(GEN x, GEN T) -+ GEN RgM_to_F2m(GEN x) -+ GEN RgV_to_F2v(GEN x) -+ GEN RgX_to_F2x(GEN x) -+ GEN Z_to_F2x(GEN x, long v) - GEN ZM_to_F2m(GEN x) - GEN ZV_to_F2v(GEN x) - GEN ZX_to_F2x(GEN x) -+ GEN ZXT_to_FlxT(GEN z, ulong p) - GEN ZXX_to_F2xX(GEN B, long v) - GEN gener_F2xq(GEN T, GEN *po) -+ bb_field *get_F2xq_field(void **E, GEN T) - GEN random_F2x(long d, long vs) - -+ # F2xqE.c -+ -+ GEN F2xq_ellcard(GEN a2, GEN a6, GEN T) -+ GEN F2xq_ellgens(GEN a2, GEN a6, GEN ch, GEN D, GEN m, GEN T) -+ GEN F2xq_ellgroup(GEN a2, GEN a6, GEN N, GEN T, GEN *pt_m) -+ GEN F2xqE_add(GEN P, GEN Q, GEN a2, GEN T) -+ GEN F2xqE_changepoint(GEN x, GEN ch, GEN T) -+ GEN F2xqE_changepointinv(GEN x, GEN ch, GEN T) -+ GEN F2xqE_dbl(GEN P, GEN a2, GEN T) -+ GEN F2xqE_log(GEN a, GEN b, GEN o, GEN a2, GEN T) -+ GEN F2xqE_mul(GEN P, GEN n, GEN a2, GEN T) -+ GEN F2xqE_neg(GEN P, GEN a2, GEN T) -+ GEN F2xqE_order(GEN z, GEN o, GEN a2, GEN T) -+ GEN F2xqE_sub(GEN P, GEN Q, GEN a2, GEN T) -+ GEN F2xqE_tatepairing(GEN t, GEN s, GEN m, GEN a2, GEN T) -+ GEN F2xqE_weilpairing(GEN t, GEN s, GEN m, GEN a2, GEN T) -+ bb_group * get_F2xqE_group(void **E, GEN a2, GEN a6, GEN T) -+ GEN RgE_to_F2xqE(GEN x, GEN T) -+ GEN random_F2xqE(GEN a2, GEN a6, GEN T) -+ - # Flx.c - - GEN Fl_to_Flx(ulong x, long sv) -+ GEN Flc_to_ZC(GEN z) - GEN Flm_to_FlxV(GEN x, long sv) -- GEN Flm_to_FlxX(GEN x, long v,long w) -+ GEN Flm_to_FlxX(GEN x, long v, long w) - GEN Flm_to_ZM(GEN z) - GEN Flv_to_Flx(GEN x, long vs) - GEN Flv_to_ZV(GEN z) - GEN Flv_polint(GEN xa, GEN ya, ulong p, long vs) - GEN Flv_roots_to_pol(GEN a, ulong p, long vs) -+ GEN Fly_to_FlxY(GEN B, long v) -+ GEN Flx_Fl_add(GEN y, ulong x, ulong p) - GEN Flx_Fl_mul(GEN y, ulong x, ulong p) -- GEN Flx_to_Flv(GEN x, long N) -- GEN Flx_to_ZX(GEN z) -- GEN Flx_to_ZX_inplace(GEN z) -+ GEN Flx_Fl_mul_to_monic(GEN y, ulong x, ulong p) -+ GEN Flx_Flxq_eval(GEN f, GEN x, GEN T, ulong p) -+ GEN Flx_FlxqV_eval(GEN f, GEN x, GEN T, ulong p) - GEN Flx_add(GEN x, GEN y, ulong p) -+ GEN Flx_deflate(GEN x0, long d) - GEN Flx_deriv(GEN z, ulong p) -+ GEN Flx_double(GEN y, ulong p) - GEN Flx_div_by_X_x(GEN a, ulong x, ulong p, ulong *rem) - GEN Flx_divrem(GEN x, GEN y, ulong p, GEN *pr) -+ int Flx_equal(GEN V, GEN W) - ulong Flx_eval(GEN x, ulong y, ulong p) - GEN Flx_extgcd(GEN a, GEN b, ulong p, GEN *ptu, GEN *ptv) - ulong Flx_extresultant(GEN a, GEN b, ulong p, GEN *ptU, GEN *ptV) - GEN Flx_gcd(GEN a, GEN b, ulong p) -- GEN Flx_gcd_i(GEN a, GEN b, ulong p) -+ GEN Flx_get_red(GEN T, ulong p) -+ GEN Flx_halfgcd(GEN a, GEN b, ulong p) -+ GEN Flx_inflate(GEN x0, long d) -+ GEN Flx_invBarrett(GEN T, ulong p) - int Flx_is_squarefree(GEN z, ulong p) -+ int Flx_is_smooth(GEN g, long r, ulong p) -+ GEN Flx_mod_Xn1(GEN T, ulong n, ulong p) -+ GEN Flx_mod_Xnm1(GEN T, ulong n, ulong p) - GEN Flx_mul(GEN x, GEN y, ulong p) - GEN Flx_neg(GEN x, ulong p) - GEN Flx_neg_inplace(GEN x, ulong p) -@@ -431,381 +554,1411 @@ cdef extern from 'pari/pari.h': - GEN Flx_renormalize(GEN x, long l) - ulong Flx_resultant(GEN a, GEN b, ulong p) - GEN Flx_shift(GEN a, long n) -+ GEN Flx_splitting(GEN p, long k) - GEN Flx_sqr(GEN x, ulong p) - GEN Flx_sub(GEN x, GEN y, ulong p) -+ GEN Flx_to_Flv(GEN x, long N) -+ GEN Flx_to_FlxX(GEN z, long v) -+ GEN Flx_to_ZX(GEN z) -+ GEN Flx_to_ZX_inplace(GEN z) -+ GEN Flx_triple(GEN y, ulong p) -+ long Flx_val(GEN x) -+ long Flx_valrem(GEN x, GEN *Z) -+ GEN FlxC_to_ZXC(GEN x) -+ GEN FlxM_Flx_add_shallow(GEN x, GEN y, ulong p) - GEN FlxM_to_ZXM(GEN z) -+ GEN FlxT_red(GEN z, ulong p) -+ GEN FlxV_to_ZXV(GEN x) -+ GEN FlxV_Flc_mul(GEN V, GEN W, ulong p) -+ GEN FlxV_red(GEN z, ulong p) - GEN FlxV_to_Flm(GEN v, long n) -+ GEN FlxX_Fl_mul(GEN x, ulong y, ulong p) -+ GEN FlxX_Flx_add(GEN y, GEN x, ulong p) -+ GEN FlxX_Flx_mul(GEN x, GEN y, ulong p) - GEN FlxX_add(GEN P, GEN Q, ulong p) -+ GEN FlxX_double(GEN x, ulong p) -+ GEN FlxX_neg(GEN x, ulong p) -+ GEN FlxX_sub(GEN P, GEN Q, ulong p) -+ GEN FlxX_swap(GEN x, long n, long ws) -+ GEN FlxX_renormalize(GEN x, long lx) - GEN FlxX_shift(GEN a, long n) - GEN FlxX_to_Flm(GEN v, long n) - GEN FlxX_to_ZXX(GEN B) -- GEN FlxYqQ_pow(GEN x, GEN n, GEN S, GEN T, ulong p) -- GEN Flxq_inv(GEN x,GEN T,ulong p) -+ GEN FlxX_triple(GEN x, ulong p) -+ GEN FlxY_Flxq_evalx(GEN P, GEN x, GEN T, ulong p) -+ GEN FlxY_Flx_div(GEN x, GEN y, ulong p) -+ GEN FlxY_evalx(GEN Q, ulong x, ulong p) -+ GEN FlxYqq_pow(GEN x, GEN n, GEN S, GEN T, ulong p) -+ GEN Flxq_autpow(GEN x, ulong n, GEN T, ulong p) -+ GEN Flxq_autsum(GEN x, ulong n, GEN T, ulong p) -+ GEN Flxq_charpoly(GEN x, GEN T, ulong p) -+ GEN Flxq_conjvec(GEN x, GEN T, ulong p) -+ GEN Flxq_div(GEN x, GEN y, GEN T, ulong p) -+ GEN Flxq_inv(GEN x, GEN T, ulong p) - GEN Flxq_invsafe(GEN x, GEN T, ulong p) -- GEN Flxq_mul(GEN y,GEN x,GEN T,ulong p) -+ int Flxq_issquare(GEN x, GEN T, ulong p) -+ int Flxq_is2npower(GEN x, long n, GEN T, ulong p) -+ GEN Flxq_log(GEN a, GEN g, GEN ord, GEN T, ulong p) -+ GEN Flxq_lroot(GEN a, GEN T, long p) -+ GEN Flxq_lroot_fast(GEN a, GEN sqx, GEN T, long p) -+ GEN Flxq_matrix_pow(GEN y, long n, long m, GEN P, ulong l) -+ GEN Flxq_minpoly(GEN x, GEN T, ulong p) -+ GEN Flxq_mul(GEN x, GEN y, GEN T, ulong p) -+ ulong Flxq_norm(GEN x, GEN T, ulong p) -+ GEN Flxq_order(GEN a, GEN ord, GEN T, ulong p) - GEN Flxq_pow(GEN x, GEN n, GEN T, ulong p) -+ GEN Flxq_powu(GEN x, ulong n, GEN T, ulong p) - GEN Flxq_powers(GEN x, long l, GEN T, ulong p) -- GEN Flxq_sqr(GEN y,GEN T,ulong p) -- GEN FlxqX_normalize(GEN z, GEN T, ulong p) -+ GEN Flxq_sqr(GEN y, GEN T, ulong p) -+ GEN Flxq_sqrt(GEN a, GEN T, ulong p) -+ GEN Flxq_sqrtn(GEN a, GEN n, GEN T, ulong p, GEN *zetan) -+ ulong Flxq_trace(GEN x, GEN T, ulong p) -+ GEN FlxqV_dotproduct(GEN x, GEN y, GEN T, ulong p) -+ GEN FlxqV_roots_to_pol(GEN V, GEN T, ulong p, long v) -+ GEN FlxqX_FlxqXQ_eval(GEN Q, GEN x, GEN S, GEN T, ulong p) -+ GEN FlxqX_FlxqXQV_eval(GEN P, GEN V, GEN S, GEN T, ulong p) - GEN FlxqX_Flxq_mul(GEN P, GEN U, GEN T, ulong p) -- GEN FlxqX_red(GEN z, GEN T, ulong p) -+ GEN FlxqX_Flxq_mul_to_monic(GEN P, GEN U, GEN T, ulong p) -+ GEN FlxqX_divrem(GEN x, GEN y, GEN T, ulong p, GEN *pr) -+ GEN FlxqX_extgcd(GEN a, GEN b, GEN T, ulong p, GEN *ptu, GEN *ptv) -+ GEN FlxqX_gcd(GEN P, GEN Q, GEN T, ulong p) -+ GEN FlxqX_invBarrett(GEN T, GEN Q, ulong p) - GEN FlxqX_mul(GEN x, GEN y, GEN T, ulong p) -+ GEN FlxqX_normalize(GEN z, GEN T, ulong p) -+ GEN FlxqX_pow(GEN V, long n, GEN T, ulong p) -+ GEN FlxqX_red(GEN z, GEN T, ulong p) -+ GEN FlxqX_rem_Barrett(GEN x, GEN mg, GEN T, GEN Q, ulong p) - GEN FlxqX_safegcd(GEN P, GEN Q, GEN T, ulong p) - GEN FlxqX_sqr(GEN x, GEN T, ulong p) -- GEN FlxqX_divrem(GEN x, GEN y, GEN T, ulong p, GEN *pr) -+ GEN FlxqXQ_div(GEN x, GEN y, GEN S, GEN T, ulong p) -+ GEN FlxqXQ_inv(GEN x, GEN S, GEN T, ulong p) -+ GEN FlxqXQ_invsafe(GEN x, GEN S, GEN T, ulong p) -+ GEN FlxqXQ_matrix_pow(GEN x, long n, long m, GEN S, GEN T, ulong p) -+ GEN FlxqXQ_mul(GEN x, GEN y, GEN S, GEN T, ulong p) - GEN FlxqXQ_pow(GEN x, GEN n, GEN S, GEN T, ulong p) -+ GEN FlxqXQ_powers(GEN x, long n, GEN S, GEN T, ulong p) -+ GEN FlxqXQ_sqr(GEN x, GEN S, GEN T, ulong p) -+ GEN FlxqXQV_autpow(GEN x, long n, GEN S, GEN T, ulong p) -+ GEN FlxqXV_prod(GEN V, GEN T, ulong p) -+ GEN Kronecker_to_FlxqX(GEN z, GEN T, ulong p) -+ ulong Rg_to_F2(GEN x) -+ ulong Rg_to_Fl(GEN x, ulong p) -+ GEN Rg_to_Flxq(GEN x, GEN T, ulong p) -+ GEN RgX_to_Flx(GEN x, ulong p) - GEN Z_to_Flx(GEN x, ulong p, long v) -- GEN ZM_to_Flm(GEN x, ulong p) -- GEN ZV_to_Flv(GEN x, ulong p) - GEN ZX_to_Flx(GEN x, ulong p) - GEN ZXV_to_FlxV(GEN v, ulong p) - GEN ZXX_to_FlxX(GEN B, ulong p, long v) -- GEN polx_Flx(long sv) -- GEN zero_Flx(long sv) -+ GEN ZXXV_to_FlxXV(GEN V, ulong p, long v) -+ GEN gener_Flxq(GEN T, ulong p, GEN *o) -+ long get_Flx_degree(GEN T) -+ GEN get_Flx_mod(GEN T) -+ long get_Flx_var(GEN T) -+ bb_field *get_Flxq_field(void **E, GEN T, ulong p) -+ GEN pol1_FlxX(long v, long sv) -+ GEN random_Flx(long d1, long v, ulong p) -+ GEN zxX_to_Kronecker(GEN P, GEN Q) -+ -+ # FlxqE.c -+ -+ GEN Flxq_ellcard(GEN a4, GEN a6, GEN T, ulong p) -+ GEN Flxq_ellgens(GEN a4, GEN a6, GEN ch, GEN D, GEN m, GEN T, ulong p) -+ GEN Flxq_ellgroup(GEN a4, GEN a6, GEN N, GEN T, ulong p, GEN *pt_m) -+ GEN Flxq_ellj(GEN a4, GEN a6, GEN T, ulong p) -+ GEN FlxqE_add(GEN P, GEN Q, GEN a4, GEN T, ulong p) -+ GEN FlxqE_changepoint(GEN x, GEN ch, GEN T, ulong p) -+ GEN FlxqE_changepointinv(GEN x, GEN ch, GEN T, ulong p) -+ GEN FlxqE_dbl(GEN P, GEN a4, GEN T, ulong p) -+ GEN FlxqE_log(GEN a, GEN b, GEN o, GEN a4, GEN T, ulong p) -+ GEN FlxqE_mul(GEN P, GEN n, GEN a4, GEN T, ulong p) -+ GEN FlxqE_neg(GEN P, GEN T, ulong p) -+ GEN FlxqE_order(GEN z, GEN o, GEN a4, GEN T, ulong p) -+ GEN FlxqE_sub(GEN P, GEN Q, GEN a4, GEN T, ulong p) -+ GEN FlxqE_tatepairing(GEN t, GEN s, GEN m, GEN a4, GEN T, ulong p) -+ GEN FlxqE_weilpairing(GEN t, GEN s, GEN m, GEN a4, GEN T, ulong p) -+ bb_group * get_FlxqE_group(void **E, GEN a4, GEN a6, GEN T, ulong p) -+ GEN RgE_to_FlxqE(GEN x, GEN T, ulong p) -+ GEN random_FlxqE(GEN a4, GEN a6, GEN T, ulong p) -+ -+ # FpE.c -+ -+ long Fl_elltrace(ulong a4, ulong a6, ulong p) -+ GEN Fle_add(GEN P, GEN Q, ulong a4, ulong p) -+ GEN Fle_dbl(GEN P, ulong a4, ulong p) -+ GEN Fle_mul(GEN P, GEN n, ulong a4, ulong p) -+ GEN Fle_mulu(GEN P, ulong n, ulong a4, ulong p) -+ GEN Fle_order(GEN z, GEN o, ulong a4, ulong p) -+ GEN Fle_sub(GEN P, GEN Q, ulong a4, ulong p) -+ GEN Fp_ellcard(GEN a4, GEN a6, GEN p) -+ GEN Fp_elldivpol(GEN a4, GEN a6, long n, GEN p) -+ GEN Fp_ellgens(GEN a4, GEN a6, GEN ch, GEN D, GEN m, GEN p) -+ GEN Fp_ellgroup(GEN a4, GEN a6, GEN N, GEN p, GEN *pt_m) -+ GEN Fp_ellj(GEN a4, GEN a6, GEN p) -+ GEN Fp_ffellcard(GEN a4, GEN a6, GEN q, long n, GEN p) -+ GEN FpE_add(GEN P, GEN Q, GEN a4, GEN p) -+ GEN FpE_changepoint(GEN x, GEN ch, GEN p) -+ GEN FpE_changepointinv(GEN x, GEN ch, GEN p) -+ GEN FpE_dbl(GEN P, GEN a4, GEN p) -+ GEN FpE_log(GEN a, GEN b, GEN o, GEN a4, GEN p) -+ GEN FpE_mul(GEN P, GEN n, GEN a4, GEN p) -+ GEN FpE_neg(GEN P, GEN p) -+ GEN FpE_order(GEN z, GEN o, GEN a4, GEN p) -+ GEN FpE_sub(GEN P, GEN Q, GEN a4, GEN p) -+ GEN FpE_to_mod(GEN P, GEN p) -+ GEN FpE_tatepairing(GEN t, GEN s, GEN m, GEN a4, GEN p) -+ GEN FpE_weilpairing(GEN t, GEN s, GEN m, GEN a4, GEN p) -+ GEN FpXQ_ellcard(GEN a4, GEN a6, GEN T, GEN p) -+ GEN FpXQ_elldivpol(GEN a4, GEN a6, long n, GEN T, GEN p) -+ GEN FpXQ_ellgens(GEN a4, GEN a6, GEN ch, GEN D, GEN m, GEN T, GEN p) -+ GEN FpXQ_ellgroup(GEN a4, GEN a6, GEN N, GEN T, GEN p, GEN *pt_m) -+ GEN FpXQ_ellj(GEN a4, GEN a6, GEN T, GEN p) -+ GEN FpXQE_add(GEN P, GEN Q, GEN a4, GEN T, GEN p) -+ GEN FpXQE_changepoint(GEN x, GEN ch, GEN T, GEN p) -+ GEN FpXQE_changepointinv(GEN x, GEN ch, GEN T, GEN p) -+ GEN FpXQE_dbl(GEN P, GEN a4, GEN T, GEN p) -+ GEN FpXQE_log(GEN a, GEN b, GEN o, GEN a4, GEN T, GEN p) -+ GEN FpXQE_mul(GEN P, GEN n, GEN a4, GEN T, GEN p) -+ GEN FpXQE_neg(GEN P, GEN T, GEN p) -+ GEN FpXQE_order(GEN z, GEN o, GEN a4, GEN T, GEN p) -+ GEN FpXQE_sub(GEN P, GEN Q, GEN a4, GEN T, GEN p) -+ GEN FpXQE_tatepairing(GEN t, GEN s, GEN m, GEN a4, GEN T, GEN p) -+ GEN FpXQE_weilpairing(GEN t, GEN s, GEN m, GEN a4, GEN T, GEN p) -+ GEN Fq_elldivpolmod(GEN a4, GEN a6, long n, GEN h, GEN T, GEN p) -+ GEN RgE_to_FpE(GEN x, GEN p) -+ GEN RgE_to_FpXQE(GEN x, GEN T, GEN p) -+ bb_group * get_FpE_group(void **E, GEN a4, GEN a6, GEN p) -+ bb_group * get_FpXQE_group(void **E, GEN a4, GEN a6, GEN T, GEN p) -+ GEN elltrace_extension(GEN t, long n, GEN p) -+ GEN random_Fle(ulong a4, ulong a6, ulong p) -+ GEN random_FpE(GEN a4, GEN a6, GEN p) -+ GEN random_FpXQE(GEN a4, GEN a6, GEN T, GEN p) -+ -+ # FpX.c -+ -+ int Fp_issquare(GEN x, GEN p) -+ GEN Fp_FpX_sub(GEN x, GEN y, GEN p) -+ GEN Fp_FpXQ_log(GEN a, GEN g, GEN ord, GEN T, GEN p) -+ GEN FpV_inv(GEN x, GEN p) -+ GEN FpV_roots_to_pol(GEN V, GEN p, long v) -+ GEN FpX_Fp_add(GEN x, GEN y, GEN p) -+ GEN FpX_Fp_add_shallow(GEN y, GEN x, GEN p) -+ GEN FpX_Fp_mul(GEN x, GEN y, GEN p) -+ GEN FpX_Fp_mul_to_monic(GEN y, GEN x, GEN p) -+ GEN FpX_Fp_mulspec(GEN y, GEN x, GEN p, long ly) -+ GEN FpX_Fp_sub(GEN x, GEN y, GEN p) -+ GEN FpX_Fp_sub_shallow(GEN y, GEN x, GEN p) -+ GEN FpX_FpXQ_eval(GEN f, GEN x, GEN T, GEN p) -+ GEN FpX_FpXQV_eval(GEN f, GEN x, GEN T, GEN p) -+ GEN FpX_add(GEN x, GEN y, GEN p) -+ GEN FpX_center(GEN x, GEN p, GEN pov2) -+ GEN FpX_chinese_coprime(GEN x, GEN y, GEN Tx, GEN Ty, GEN Tz, GEN p) -+ GEN FpX_deriv(GEN x, GEN p) -+ GEN FpX_disc(GEN x, GEN p) -+ GEN FpX_div_by_X_x(GEN a, GEN x, GEN p, GEN *r) -+ GEN FpX_divrem(GEN x, GEN y, GEN p, GEN *pr) -+ GEN FpX_eval(GEN x, GEN y, GEN p) -+ GEN FpX_extgcd(GEN x, GEN y, GEN p, GEN *ptu, GEN *ptv) -+ GEN FpX_gcd(GEN x, GEN y, GEN p) -+ GEN FpX_get_red(GEN T, GEN p) -+ GEN FpX_halfgcd(GEN x, GEN y, GEN p) -+ GEN FpX_invBarrett(GEN T, GEN p) -+ int FpX_is_squarefree(GEN f, GEN p) -+ GEN FpX_mul(GEN x, GEN y, GEN p) -+ GEN FpX_mulspec(GEN a, GEN b, GEN p, long na, long nb) -+ GEN FpX_mulu(GEN x, ulong y, GEN p) -+ GEN FpX_neg(GEN x, GEN p) -+ GEN FpX_normalize(GEN z, GEN p) -+ GEN FpX_red(GEN z, GEN p) -+ GEN FpX_rem(GEN x, GEN y, GEN p) -+ GEN FpX_rescale(GEN P, GEN h, GEN p) -+ GEN FpX_resultant(GEN a, GEN b, GEN p) -+ GEN FpX_sqr(GEN x, GEN p) -+ GEN FpX_sub(GEN x, GEN y, GEN p) -+ long FpX_valrem(GEN x0, GEN t, GEN p, GEN *py) -+ GEN FpXQ_autpow(GEN x, ulong n, GEN T, GEN p) -+ GEN FpXQ_autpowers(GEN aut, long f, GEN T, GEN p) -+ GEN FpXQ_autsum(GEN x, ulong n, GEN T, GEN p) -+ GEN FpXQ_charpoly(GEN x, GEN T, GEN p) -+ GEN FpXQ_conjvec(GEN x, GEN T, GEN p) -+ GEN FpXQ_div(GEN x, GEN y, GEN T, GEN p) -+ GEN FpXQ_inv(GEN x, GEN T, GEN p) -+ GEN FpXQ_invsafe(GEN x, GEN T, GEN p) -+ int FpXQ_issquare(GEN x, GEN T, GEN p) -+ GEN FpXQ_log(GEN a, GEN g, GEN ord, GEN T, GEN p) -+ GEN FpXQ_matrix_pow(GEN y, long n, long m, GEN P, GEN l) -+ GEN FpXQ_minpoly(GEN x, GEN T, GEN p) -+ GEN FpXQ_mul(GEN y, GEN x, GEN T, GEN p) -+ GEN FpXQ_norm(GEN x, GEN T, GEN p) -+ GEN FpXQ_order(GEN a, GEN ord, GEN T, GEN p) -+ GEN FpXQ_pow(GEN x, GEN n, GEN T, GEN p) -+ GEN FpXQ_powu(GEN x, ulong n, GEN T, GEN p) -+ GEN FpXQ_powers(GEN x, long l, GEN T, GEN p) -+ GEN FpXQ_red(GEN x, GEN T, GEN p) -+ GEN FpXQ_sqr(GEN y, GEN T, GEN p) -+ GEN FpXQ_sqrt(GEN a, GEN T, GEN p) -+ GEN FpXQ_sqrtn(GEN a, GEN n, GEN T, GEN p, GEN *zetan) -+ GEN FpXQ_trace(GEN x, GEN T, GEN p) -+ GEN FpXQC_to_mod(GEN z, GEN T, GEN p) -+ GEN FpXT_red(GEN z, GEN p) -+ GEN FpXV_prod(GEN V, GEN p) -+ GEN FpXV_red(GEN z, GEN p) -+ int Fq_issquare(GEN x, GEN T, GEN p) -+ GEN FqV_inv(GEN x, GEN T, GEN p) -+ GEN Z_to_FpX(GEN a, GEN p, long v) -+ GEN gener_FpXQ(GEN T, GEN p, GEN *o) -+ GEN gener_FpXQ_local(GEN T, GEN p, GEN L) -+ long get_FpX_degree(GEN T) -+ GEN get_FpX_mod(GEN T) -+ long get_FpX_var(GEN T) -+ bb_group *get_FpXQ_star(void **E, GEN T, GEN p) -+ GEN random_FpX(long d, long v, GEN p) -+ -+ # FpX_factor.c -+ -+ GEN F2x_factor(GEN f) -+ int F2x_is_irred(GEN f) -+ void F2xV_to_FlxV_inplace(GEN v) -+ void F2xV_to_ZXV_inplace(GEN v) -+ int Flx_is_irred(GEN f, ulong p) -+ GEN Flx_degfact(GEN f, ulong p) -+ GEN Flx_factor(GEN f, ulong p) -+ long Flx_nbfact(GEN z, ulong p) -+ GEN Flx_nbfact_by_degree(GEN z, long *nb, ulong p) -+ long Flx_nbroots(GEN f, ulong p) -+ ulong Flx_oneroot(GEN f, ulong p) -+ GEN Flx_roots(GEN f, ulong p) -+ GEN FlxqX_Frobenius(GEN S, GEN T, ulong p) -+ GEN FlxqXQ_halfFrobenius(GEN a, GEN S, GEN T, ulong p) -+ long FlxqX_nbroots(GEN f, GEN T, ulong p) -+ void FlxV_to_ZXV_inplace(GEN v) -+ GEN FpX_degfact(GEN f, GEN p) -+ int FpX_is_irred(GEN f, GEN p) -+ int FpX_is_totally_split(GEN f, GEN p) -+ GEN FpX_factor(GEN f, GEN p) -+ GEN FpX_factorff(GEN P, GEN T, GEN p) -+ long FpX_nbfact(GEN f, GEN p) -+ long FpX_nbroots(GEN f, GEN p) -+ GEN FpX_oneroot(GEN f, GEN p) -+ GEN FpX_roots(GEN f, GEN p) -+ GEN FpX_rootsff(GEN P, GEN T, GEN p) -+ GEN FpXQX_Frobenius(GEN S, GEN T, GEN p) -+ long FpXQX_nbfact(GEN u, GEN T, GEN p) -+ long FpXQX_nbroots(GEN f, GEN T, GEN p) -+ GEN FpXQXQ_halfFrobenius(GEN a, GEN S, GEN T, GEN p) -+ GEN FqX_deriv(GEN f, GEN T, GEN p) -+ GEN FqX_factor(GEN x, GEN T, GEN p) -+ long FqX_is_squarefree(GEN P, GEN T, GEN p) -+ long FqX_nbfact(GEN u, GEN T, GEN p) -+ long FqX_nbroots(GEN f, GEN T, GEN p) -+ GEN FqX_roots(GEN f, GEN T, GEN p) -+ GEN factcantor(GEN x, GEN p) -+ GEN factorff(GEN f, GEN p, GEN a) -+ GEN factormod0(GEN f, GEN p, long flag) -+ GEN polrootsff(GEN f, GEN p, GEN T) -+ GEN rootmod0(GEN f, GEN p, long flag) -+ -+ # FpXX.c -+ -+ GEN FpXQX_FpXQ_mul(GEN P, GEN U, GEN T, GEN p) -+ GEN FpXQX_FpXQXQV_eval(GEN P, GEN V, GEN S, GEN T, GEN p) -+ GEN FpXQX_FpXQXQ_eval(GEN P, GEN x, GEN S, GEN T, GEN p) -+ GEN FpXQX_divrem(GEN x, GEN y, GEN T, GEN p, GEN *pr) -+ GEN FpXQX_divrem_Barrett(GEN x, GEN B, GEN S, GEN T, GEN p, GEN *pr) -+ GEN FpXQX_extgcd(GEN x, GEN y, GEN T, GEN p, GEN *ptu, GEN *ptv) -+ GEN FpXQX_gcd(GEN P, GEN Q, GEN T, GEN p) -+ GEN FpXQX_invBarrett(GEN S, GEN T, GEN p) -+ GEN FpXQX_mul(GEN x, GEN y, GEN T, GEN p) -+ GEN FpXQX_red(GEN z, GEN T, GEN p) -+ GEN FpXQX_rem(GEN x, GEN S, GEN T, GEN p) -+ GEN FpXQX_rem_Barrett(GEN x, GEN mg, GEN S, GEN T, GEN p) -+ GEN FpXQX_sqr(GEN x, GEN T, GEN p) -+ GEN FpXQXQ_div(GEN x, GEN y, GEN S, GEN T, GEN p) -+ GEN FpXQXQ_inv(GEN x, GEN S, GEN T, GEN p) -+ GEN FpXQXQ_invsafe(GEN x, GEN S, GEN T, GEN p) -+ GEN FpXQXQ_matrix_pow(GEN y, long n, long m, GEN S, GEN T, GEN p) -+ GEN FpXQXQ_mul(GEN x, GEN y, GEN S, GEN T, GEN p) -+ GEN FpXQXQ_pow(GEN x, GEN n, GEN S, GEN T, GEN p) -+ GEN FpXQXQ_powers(GEN x, long n, GEN S, GEN T, GEN p) -+ GEN FpXQXQ_sqr(GEN x, GEN S, GEN T, GEN p) -+ GEN FpXQXQV_autpow(GEN aut, long n, GEN S, GEN T, GEN p) -+ GEN FpXQXQV_autsum(GEN aut, long n, GEN S, GEN T, GEN p) -+ GEN FpXQXV_prod(GEN V, GEN Tp, GEN p) -+ GEN FpXX_Fp_mul(GEN x, GEN y, GEN p) -+ GEN FpXX_FpX_mul(GEN x, GEN y, GEN p) -+ GEN FpXX_add(GEN x, GEN y, GEN p) -+ GEN FpXX_mulu(GEN P, ulong u, GEN p) -+ GEN FpXX_neg(GEN x, GEN p) -+ GEN FpXX_red(GEN z, GEN p) -+ GEN FpXX_sub(GEN x, GEN y, GEN p) -+ GEN FpXY_FpXQ_evalx(GEN P, GEN x, GEN T, GEN p) -+ GEN FpXY_eval(GEN Q, GEN y, GEN x, GEN p) -+ GEN FpXY_evalx(GEN Q, GEN x, GEN p) -+ GEN FpXY_evaly(GEN Q, GEN y, GEN p, long vy) -+ GEN FpXYQQ_pow(GEN x, GEN n, GEN S, GEN T, GEN p) -+ GEN Kronecker_to_FpXQX(GEN z, GEN pol, GEN p) -+ GEN Kronecker_to_ZXX(GEN z, long N, long v) -+ GEN ZXX_mul_Kronecker(GEN x, GEN y, long n) -+ -+ # FpV.c -+ -+ GEN F2m_F2c_mul(GEN x, GEN y) -+ GEN F2m_mul(GEN x, GEN y) -+ GEN F2m_powu(GEN x, ulong n) -+ GEN Flc_Fl_div(GEN x, ulong y, ulong p) -+ void Flc_Fl_div_inplace(GEN x, ulong y, ulong p) -+ GEN Flc_Fl_mul(GEN x, ulong y, ulong p) -+ void Flc_Fl_mul_inplace(GEN x, ulong y, ulong p) -+ void Flc_Fl_mul_part_inplace(GEN x, ulong y, ulong p, long l) -+ GEN Flc_to_mod(GEN z, ulong pp) -+ GEN Flm_Fl_add(GEN x, ulong y, ulong p) -+ GEN Flm_Fl_mul(GEN y, ulong x, ulong p) -+ void Flm_Fl_mul_inplace(GEN y, ulong x, ulong p) -+ GEN Flm_Flc_mul(GEN x, GEN y, ulong p) -+ GEN Flm_center(GEN z, ulong p, ulong ps2) -+ GEN Flm_mul(GEN x, GEN y, ulong p) -+ GEN Flm_neg(GEN y, ulong p) -+ GEN Flm_powu(GEN x, ulong n, ulong p) -+ GEN Flm_to_mod(GEN z, ulong pp) -+ GEN Flm_transpose(GEN x) -+ GEN Flv_add(GEN x, GEN y, ulong p) -+ void Flv_add_inplace(GEN x, GEN y, ulong p) -+ ulong Flv_dotproduct(GEN x, GEN y, ulong p) -+ GEN Flv_center(GEN z, ulong p, ulong ps2) -+ GEN Flv_sub(GEN x, GEN y, ulong p) -+ void Flv_sub_inplace(GEN x, GEN y, ulong p) -+ ulong Flv_sum(GEN x, ulong p) -+ GEN Fp_to_mod(GEN z, GEN p) -+ GEN FpC_FpV_mul(GEN x, GEN y, GEN p) -+ GEN FpC_Fp_mul(GEN x, GEN y, GEN p) -+ GEN FpC_center(GEN z, GEN p, GEN pov2) -+ GEN FpC_red(GEN z, GEN p) -+ GEN FpC_to_mod(GEN z, GEN p) -+ GEN FpM_FpC_mul(GEN x, GEN y, GEN p) -+ GEN FpM_FpC_mul_FpX(GEN x, GEN y, GEN p, long v) -+ GEN FpM_center(GEN z, GEN p, GEN pov2) -+ GEN FpM_mul(GEN x, GEN y, GEN p) -+ GEN FpM_powu(GEN x, ulong n, GEN p) -+ GEN FpM_red(GEN z, GEN p) -+ GEN FpM_to_mod(GEN z, GEN p) -+ GEN FpMs_FpC_mul(GEN M, GEN B, GEN p) -+ GEN FpMs_FpCs_solve(GEN M, GEN B, long nbrow, GEN p) -+ GEN FpMs_FpCs_solve_safe(GEN M, GEN A, long nbrow, GEN p) -+ GEN FpMs_leftkernel_elt(GEN M, long nbrow, GEN p) -+ GEN FpC_add(GEN x, GEN y, GEN p) -+ GEN FpC_sub(GEN x, GEN y, GEN p) -+ GEN FpV_FpMs_mul(GEN B, GEN M, GEN p) -+ GEN FpV_add(GEN x, GEN y, GEN p) -+ GEN FpV_sub(GEN x, GEN y, GEN p) -+ GEN FpV_dotproduct(GEN x, GEN y, GEN p) -+ GEN FpV_dotsquare(GEN x, GEN p) -+ GEN FpV_red(GEN z, GEN p) -+ GEN FpV_to_mod(GEN z, GEN p) -+ GEN FpVV_to_mod(GEN z, GEN p) -+ GEN FpX_to_mod(GEN z, GEN p) -+ GEN ZV_zMs_mul(GEN B, GEN M) -+ GEN ZpMs_ZpCs_solve(GEN M, GEN B, long nbrow, GEN p, long e) -+ GEN gen_FpM_Wiedemann(void *E, GEN (*f)(void*, GEN), GEN B, GEN p) -+ GEN gen_ZpM_Dixon(void *E, GEN (*f)(void*, GEN), GEN B, GEN p, long e) -+ GEN gen_matid(long n, void *E, bb_field *S) -+ GEN matid_F2m(long n) -+ GEN matid_Flm(long n) -+ GEN matid_F2xqM(long n, GEN T) -+ GEN matid_FlxqM(long n, GEN T, ulong p) -+ GEN scalar_Flm(long s, long n) -+ GEN zCs_to_ZC(GEN C, long nbrow) -+ GEN zMs_to_ZM(GEN M, long nbrow) -+ GEN zMs_ZC_mul(GEN M, GEN B) -+ -+ # Hensel.c -+ -+ GEN Zp_sqrtlift(GEN b, GEN a, GEN p, long e) -+ GEN Zp_sqrtnlift(GEN b, GEN n, GEN a, GEN p, long e) -+ GEN ZpX_liftfact(GEN pol, GEN Q, GEN T, GEN p, long e, GEN pe) -+ GEN ZpX_liftroot(GEN f, GEN a, GEN p, long e) -+ GEN ZpX_liftroots(GEN f, GEN S, GEN q, long e) -+ GEN ZpXQ_inv(GEN a, GEN T, GEN p, long e) -+ GEN ZpXQ_invlift(GEN b, GEN a, GEN T, GEN p, long e) -+ GEN ZpXQ_log(GEN a, GEN T, GEN p, long N) -+ GEN ZpXQ_sqrtnlift(GEN b, GEN n, GEN a, GEN T, GEN p, long e) -+ GEN ZpXQX_liftroot(GEN f, GEN a, GEN T, GEN p, long e) -+ GEN ZpXQX_liftroot_vald(GEN f, GEN a, long v, GEN T, GEN p, long e) -+ GEN gen_ZpX_Dixon(GEN F, GEN V, GEN q, GEN p, long N, void *E, -+ GEN lin(void *E, GEN F, GEN d, GEN q), -+ GEN invl(void *E, GEN d)) -+ GEN gen_ZpX_Newton(GEN x, GEN p, long n, void *E, -+ GEN eval(void *E, GEN f, GEN q), -+ GEN invd(void *E, GEN V, GEN v, GEN q, long M)) -+ GEN polhensellift(GEN pol, GEN fct, GEN p, long exp) -+ ulong quadratic_prec_mask(long n) -+ -+ # QX_factor.c -+ -+ GEN QX_factor(GEN x) -+ GEN ZX_factor(GEN x) -+ long ZX_is_irred(GEN x) -+ GEN ZX_squff(GEN f, GEN *ex) -+ GEN polcyclofactors(GEN f) -+ long poliscyclo(GEN f) -+ long poliscycloprod(GEN f) -+ -+ # RgV.c -+ -+ GEN RgC_Rg_add(GEN x, GEN y) -+ GEN RgC_Rg_div(GEN x, GEN y) -+ GEN RgC_Rg_mul(GEN x, GEN y) -+ GEN RgC_RgM_mul(GEN x, GEN y) -+ GEN RgC_RgV_mul(GEN x, GEN y) -+ GEN RgC_add(GEN x, GEN y) -+ GEN RgC_neg(GEN x) -+ GEN RgC_sub(GEN x, GEN y) -+ GEN RgM_Rg_add(GEN x, GEN y) -+ GEN RgM_Rg_add_shallow(GEN x, GEN y) -+ GEN RgM_Rg_div(GEN x, GEN y) -+ GEN RgM_Rg_mul(GEN x, GEN y) -+ GEN RgM_Rg_sub(GEN x, GEN y) -+ GEN RgM_Rg_sub_shallow(GEN x, GEN y) -+ GEN RgM_RgC_mul(GEN x, GEN y) -+ GEN RgM_RgV_mul(GEN x, GEN y) -+ GEN RgM_add(GEN x, GEN y) -+ GEN RgM_det_triangular(GEN x) -+ int RgM_is_ZM(GEN x) -+ int RgM_isdiagonal(GEN x) -+ int RgM_isidentity(GEN x) -+ int RgM_isscalar(GEN x, GEN s) -+ GEN RgM_mul(GEN x, GEN y) -+ GEN RgM_multosym(GEN x, GEN y) -+ GEN RgM_neg(GEN x) -+ GEN RgM_powers(GEN x, long l) -+ GEN RgM_sqr(GEN x) -+ GEN RgM_sub(GEN x, GEN y) -+ GEN RgM_transmul(GEN x, GEN y) -+ GEN RgM_transmultosym(GEN x, GEN y) -+ GEN RgM_zc_mul(GEN x, GEN y) -+ GEN RgM_zm_mul(GEN x, GEN y) -+ GEN RgMrow_RgC_mul(GEN x, GEN y, long i) -+ GEN RgV_RgM_mul(GEN x, GEN y) -+ GEN RgV_RgC_mul(GEN x, GEN y) -+ GEN RgV_Rg_mul(GEN x, GEN y) -+ GEN RgV_add(GEN x, GEN y) -+ GEN RgV_dotproduct(GEN x, GEN y) -+ GEN RgV_dotsquare(GEN x) -+ int RgV_is_ZMV(GEN V) -+ long RgV_isin(GEN v, GEN x) -+ GEN RgV_neg(GEN x) -+ GEN RgV_sub(GEN x, GEN y) -+ GEN RgV_sum(GEN v) -+ GEN RgV_sumpart(GEN v, long n) -+ GEN RgV_sumpart2(GEN v, long m, long n) -+ GEN RgV_zc_mul(GEN x, GEN y) -+ GEN RgV_zm_mul(GEN x, GEN y) -+ GEN RgX_RgM_eval(GEN x, GEN y) -+ GEN RgX_RgMV_eval(GEN x, GEN y) -+ int isdiagonal(GEN x) -+ GEN matid(long n) -+ GEN scalarcol(GEN x, long n) -+ GEN scalarcol_shallow(GEN x, long n) -+ GEN scalarmat(GEN x, long n) -+ GEN scalarmat_shallow(GEN x, long n) -+ GEN scalarmat_s(long x, long n) -+ -+ # RgX.c -+ -+ GEN Kronecker_to_mod(GEN z, GEN pol) -+ GEN QX_ZXQV_eval(GEN P, GEN V, GEN dV) -+ GEN QXQ_powers(GEN a, long n, GEN T) -+ GEN QXQX_to_mod_shallow(GEN z, GEN T) -+ GEN QXQV_to_mod(GEN V, GEN T) -+ GEN QXQXV_to_mod(GEN V, GEN T) -+ GEN QXV_QXQ_eval(GEN v, GEN a, GEN T) -+ GEN QXX_QXQ_eval(GEN v, GEN a, GEN T) -+ GEN Rg_to_RgV(GEN x, long N) -+ GEN RgM_to_RgXV(GEN x, long v) -+ GEN RgM_to_RgXX(GEN x, long v, long w) -+ GEN RgV_to_RgX(GEN x, long v) -+ GEN RgV_to_RgX_reverse(GEN x, long v) -+ GEN RgXQC_red(GEN P, GEN T) -+ GEN RgXQV_red(GEN P, GEN T) -+ GEN RgXQX_RgXQ_mul(GEN x, GEN y, GEN T) -+ GEN RgXQX_divrem(GEN x, GEN y, GEN T, GEN *r) -+ GEN RgXQX_mul(GEN x, GEN y, GEN T) -+ GEN RgXQX_pseudodivrem(GEN x, GEN y, GEN T, GEN *ptr) -+ GEN RgXQX_pseudorem(GEN x, GEN y, GEN T) -+ GEN RgXQX_red(GEN P, GEN T) -+ GEN RgXQX_sqr(GEN x, GEN T) -+ GEN RgXQX_translate(GEN P, GEN c, GEN T) -+ GEN RgXQ_matrix_pow(GEN y, long n, long m, GEN P) -+ GEN RgXQ_norm(GEN x, GEN T) -+ GEN RgXQ_pow(GEN x, GEN n, GEN T) -+ GEN RgXQ_powu(GEN x, ulong n, GEN T) -+ GEN RgXQ_powers(GEN x, long l, GEN T) -+ GEN RgXV_to_RgM(GEN v, long n) -+ GEN RgXV_unscale(GEN v, GEN h) -+ GEN RgXX_to_RgM(GEN v, long n) -+ GEN RgXY_swap(GEN x, long n, long w) -+ GEN RgXY_swapspec(GEN x, long n, long w, long nx) -+ GEN RgX_RgXQ_eval(GEN f, GEN x, GEN T) -+ GEN RgX_RgXQV_eval(GEN P, GEN V, GEN T) -+ GEN RgX_Rg_add(GEN y, GEN x) -+ GEN RgX_Rg_add_shallow(GEN y, GEN x) -+ GEN RgX_Rg_div(GEN y, GEN x) -+ GEN RgX_Rg_divexact(GEN x, GEN y) -+ GEN RgX_Rg_mul(GEN y, GEN x) -+ GEN RgX_Rg_sub(GEN y, GEN x) -+ GEN RgX_add(GEN x, GEN y) -+ GEN RgX_blocks(GEN P, long n, long m) -+ GEN RgX_deflate(GEN x0, long d) -+ GEN RgX_deriv(GEN x) -+ GEN RgX_div_by_X_x(GEN a, GEN x, GEN *r) -+ GEN RgX_divrem(GEN x, GEN y, GEN *r) -+ GEN RgX_divs(GEN y, long x) -+ long RgX_equal(GEN x, GEN y) -+ void RgX_even_odd(GEN p, GEN *pe, GEN *po) -+ GEN RgX_get_0(GEN x) -+ GEN RgX_get_1(GEN x) -+ GEN RgX_inflate(GEN x0, long d) -+ GEN RgX_modXn_shallow(GEN a, long n) -+ GEN RgX_modXn_eval(GEN Q, GEN x, long n) -+ GEN RgX_mul(GEN x, GEN y) -+ GEN RgX_mul_normalized(GEN A, long a, GEN B, long b) -+ GEN RgX_mulXn(GEN x, long d) -+ GEN RgX_mullow(GEN f, GEN g, long n) -+ GEN RgX_muls(GEN y, long x) -+ GEN RgX_mulspec(GEN a, GEN b, long na, long nb) -+ GEN RgX_neg(GEN x) -+ GEN RgX_pseudodivrem(GEN x, GEN y, GEN *ptr) -+ GEN RgX_pseudorem(GEN x, GEN y) -+ GEN RgX_recip(GEN x) -+ GEN RgX_recip_shallow(GEN x) -+ GEN RgX_renormalize_lg(GEN x, long lx) -+ GEN RgX_rescale(GEN P, GEN h) -+ GEN RgX_rotate_shallow(GEN P, long k, long p) -+ GEN RgX_shift(GEN a, long n) -+ GEN RgX_shift_shallow(GEN x, long n) -+ GEN RgX_splitting(GEN p, long k) -+ GEN RgX_sqr(GEN x) -+ GEN RgX_sqrlow(GEN f, long n) -+ GEN RgX_sqrspec(GEN a, long na) -+ GEN RgX_sub(GEN x, GEN y) -+ GEN RgX_to_RgV(GEN x, long N) -+ GEN RgX_translate(GEN P, GEN c) -+ GEN RgX_unscale(GEN P, GEN h) -+ GEN Rg_RgX_sub(GEN x, GEN y) -+ GEN ZX_translate(GEN P, GEN c) -+ GEN ZX_unscale(GEN P, GEN h) -+ GEN ZX_unscale_div(GEN P, GEN h) -+ int ZXQX_dvd(GEN x, GEN y, GEN T) -+ long brent_kung_optpow(long d, long n, long m) -+ GEN gen_bkeval(GEN Q, long d, GEN x, int use_sqr, void *E, -+ bb_algebra *ff, GEN cmul(void *E, GEN P, long a, GEN x)) -+ GEN gen_bkeval_powers(GEN P, long d, GEN V, void *E, -+ bb_algebra *ff, GEN cmul(void *E, GEN P, long a, GEN x)) -+ -+ # ZV.c -+ -+ void Flc_lincomb1_inplace(GEN X, GEN Y, ulong v, ulong q) -+ void RgM_check_ZM(GEN A, const char *s) -+ void RgV_check_ZV(GEN A, const char *s) -+ GEN ZC_ZV_mul(GEN x, GEN y) -+ GEN ZC_Z_add(GEN x, GEN y) -+ GEN ZC_Z_divexact(GEN X, GEN c) -+ GEN ZC_Z_mul(GEN X, GEN c) -+ GEN ZC_Z_sub(GEN x, GEN y) -+ GEN ZC_add(GEN x, GEN y) -+ GEN ZC_copy(GEN x) -+ GEN ZC_hnfremdiv(GEN x, GEN y, GEN *Q) -+ GEN ZC_lincomb(GEN u, GEN v, GEN X, GEN Y) -+ void ZC_lincomb1_inplace(GEN X, GEN Y, GEN v) -+ GEN ZC_neg(GEN M) -+ GEN ZC_reducemodlll(GEN x, GEN y) -+ GEN ZC_reducemodmatrix(GEN v, GEN y) -+ GEN ZC_sub(GEN x, GEN y) -+ GEN ZC_z_mul(GEN X, long c) -+ GEN ZM_ZC_mul(GEN x, GEN y) -+ GEN ZM_Z_divexact(GEN X, GEN c) -+ GEN ZM_Z_mul(GEN X, GEN c) -+ GEN ZM_add(GEN x, GEN y) -+ GEN ZM_copy(GEN x) -+ GEN ZM_det_triangular(GEN mat) -+ int ZM_equal(GEN A, GEN B) -+ GEN ZM_hnfdivrem(GEN x, GEN y, GEN *Q) -+ int ZM_ishnf(GEN x) -+ int ZM_isidentity(GEN x) -+ long ZM_max_lg(GEN x) -+ GEN ZM_mul(GEN x, GEN y) -+ GEN ZM_multosym(GEN x, GEN y) -+ GEN ZM_neg(GEN x) -+ GEN ZM_nm_mul(GEN x, GEN y) -+ GEN ZM_pow(GEN x, GEN n) -+ GEN ZM_powu(GEN x, ulong n) -+ GEN ZM_reducemodlll(GEN x, GEN y) -+ GEN ZM_reducemodmatrix(GEN v, GEN y) -+ GEN ZM_sub(GEN x, GEN y) -+ GEN ZM_supnorm(GEN x) -+ GEN ZM_to_Flm(GEN x, ulong p) -+ GEN ZM_to_zm(GEN z) -+ GEN ZM_transmultosym(GEN x, GEN y) -+ GEN ZMV_to_zmV(GEN z) -+ void ZM_togglesign(GEN M) -+ GEN ZM_zc_mul(GEN x, GEN y) -+ GEN ZM_zm_mul(GEN x, GEN y) -+ GEN ZMrow_ZC_mul(GEN x, GEN y, long i) -+ GEN ZV_ZM_mul(GEN x, GEN y) -+ int ZV_abscmp(GEN x, GEN y) -+ int ZV_cmp(GEN x, GEN y) -+ GEN ZV_content(GEN x) -+ GEN ZV_dotproduct(GEN x, GEN y) -+ GEN ZV_dotsquare(GEN x) -+ int ZV_equal(GEN V, GEN W) -+ int ZV_equal0(GEN V) -+ long ZV_max_lg(GEN x) -+ void ZV_neg_inplace(GEN M) -+ GEN ZV_prod(GEN v) -+ GEN ZV_sum(GEN v) -+ GEN ZV_to_Flv(GEN x, ulong p) -+ GEN ZV_to_nv(GEN z) -+ void ZV_togglesign(GEN M) -+ GEN gram_matrix(GEN M) -+ GEN nm_Z_mul(GEN X, GEN c) -+ GEN zm_mul(GEN x, GEN y) -+ GEN zm_to_Flm(GEN z, ulong p) -+ GEN zm_to_ZM(GEN z) -+ GEN zm_zc_mul(GEN x, GEN y) -+ GEN zmV_to_ZMV(GEN z) -+ long zv_content(GEN x) -+ long zv_dotproduct(GEN x, GEN y) -+ int zv_equal(GEN V, GEN W) -+ int zv_equal0(GEN V) -+ GEN zv_neg(GEN x) -+ GEN zv_neg_inplace(GEN M) -+ long zv_prod(GEN v) -+ GEN zv_prod_Z(GEN v) -+ long zv_sum(GEN v) -+ GEN zv_to_Flv(GEN z, ulong p) -+ GEN zv_z_mul(GEN v, long n) -+ int zvV_equal(GEN V, GEN W) -+ -+ # ZX.c -+ -+ void RgX_check_QX(GEN x, const char *s) -+ void RgX_check_ZX(GEN x, const char *s) -+ void RgX_check_ZXX(GEN x, const char *s) -+ GEN Z_ZX_sub(GEN x, GEN y) -+ GEN ZX_Z_add(GEN y, GEN x) -+ GEN ZX_Z_add_shallow(GEN y, GEN x) -+ GEN ZX_Z_divexact(GEN y, GEN x) -+ GEN ZX_Z_mul(GEN y, GEN x) -+ GEN ZX_Z_sub(GEN y, GEN x) -+ GEN ZX_add(GEN x, GEN y) -+ GEN ZX_copy(GEN x) -+ GEN ZX_deriv(GEN x) -+ int ZX_equal(GEN V, GEN W) -+ GEN ZX_eval1(GEN x) -+ long ZX_max_lg(GEN x) -+ GEN ZX_mod_Xnm1(GEN T, ulong n) -+ GEN ZX_mul(GEN x, GEN y) -+ GEN ZX_mulspec(GEN a, GEN b, long na, long nb) -+ GEN ZX_mulu(GEN y, ulong x) -+ GEN ZX_neg(GEN x) -+ GEN ZX_rem(GEN x, GEN y) -+ GEN ZX_remi2n(GEN y, long n) -+ GEN ZX_rescale(GEN P, GEN h) -+ GEN ZX_rescale_lt(GEN P) -+ GEN ZX_shifti(GEN x, long n) -+ GEN ZX_sqr(GEN x) -+ GEN ZX_sqrspec(GEN a, long na) -+ GEN ZX_sub(GEN x, GEN y) -+ long ZX_val(GEN x) -+ long ZX_valrem(GEN x, GEN *Z) -+ GEN ZXT_remi2n(GEN z, long n) -+ GEN ZXV_Z_mul(GEN y, GEN x) -+ GEN ZXV_dotproduct(GEN V, GEN W) -+ int ZXV_equal(GEN V, GEN W) -+ GEN ZXV_remi2n(GEN x, long n) -+ GEN ZXX_Z_divexact(GEN y, GEN x) -+ long ZXX_max_lg(GEN x) -+ GEN ZXX_renormalize(GEN x, long lx) -+ GEN ZXX_to_Kronecker(GEN P, long n) -+ GEN ZXX_to_Kronecker_spec(GEN P, long lP, long n) -+ GEN scalar_ZX(GEN x, long v) -+ GEN scalar_ZX_shallow(GEN x, long v) -+ GEN zx_to_ZX(GEN z) - -- # alglin1.c -+ # alglin1.c - -+ GEN F2m_F2c_gauss(GEN a, GEN b) -+ GEN F2m_F2c_invimage(GEN A, GEN y) -+ GEN F2m_deplin(GEN x) -+ ulong F2m_det(GEN x) -+ ulong F2m_det_sp(GEN x) -+ GEN F2m_gauss(GEN a, GEN b) -+ GEN F2m_image(GEN x) -+ GEN F2m_indexrank(GEN x) -+ GEN F2m_inv(GEN x) -+ GEN F2m_invimage(GEN A, GEN B) -+ GEN F2m_ker(GEN x) -+ GEN F2m_ker_sp(GEN x, long deplin) -+ long F2m_rank(GEN x) -+ GEN F2m_suppl(GEN x) -+ GEN F2xqM_F2xqC_mul(GEN a, GEN b, GEN T) -+ GEN F2xqM_det(GEN a, GEN T) -+ GEN F2xqM_ker(GEN x, GEN T) -+ GEN F2xqM_image(GEN x, GEN T) -+ GEN F2xqM_inv(GEN a, GEN T) -+ GEN F2xqM_mul(GEN a, GEN b, GEN T) -+ long F2xqM_rank(GEN x, GEN T) -+ GEN Flm_Flc_gauss(GEN a, GEN b, ulong p) -+ GEN Flm_Flc_invimage(GEN mat, GEN y, ulong p) - GEN Flm_deplin(GEN x, ulong p) -+ ulong Flm_det(GEN x, ulong p) -+ ulong Flm_det_sp(GEN x, ulong p) -+ GEN Flm_gauss(GEN a, GEN b, ulong p) -+ GEN Flm_image(GEN x, ulong p) -+ GEN Flm_invimage(GEN m, GEN v, ulong p) - GEN Flm_indexrank(GEN x, ulong p) - GEN Flm_inv(GEN x, ulong p) - GEN Flm_ker(GEN x, ulong p) - GEN Flm_ker_sp(GEN x, ulong p, long deplin) -- GEN Flm_mul(GEN x, GEN y, ulong p) -+ long Flm_rank(GEN x, ulong p) -+ GEN Flm_suppl(GEN x, ulong p) -+ GEN FlxqM_FlxqC_gauss(GEN a, GEN b, GEN T, ulong p) -+ GEN FlxqM_FlxqC_mul(GEN a, GEN b, GEN T, ulong p) -+ GEN FlxqM_det(GEN a, GEN T, ulong p) -+ GEN FlxqM_gauss(GEN a, GEN b, GEN T, ulong p) - GEN FlxqM_ker(GEN x, GEN T, ulong p) -- GEN FpC_FpV_mul(GEN x, GEN y, GEN p) -+ GEN FlxqM_image(GEN x, GEN T, ulong p) -+ GEN FlxqM_inv(GEN x, GEN T, ulong p) -+ GEN FlxqM_mul(GEN a, GEN b, GEN T, ulong p) -+ long FlxqM_rank(GEN x, GEN T, ulong p) -+ GEN FpM_FpC_gauss(GEN a, GEN b, GEN p) -+ GEN FpM_FpC_invimage(GEN m, GEN v, GEN p) - GEN FpM_deplin(GEN x, GEN p) -+ GEN FpM_det(GEN x, GEN p) -+ GEN FpM_gauss(GEN a, GEN b, GEN p) - GEN FpM_image(GEN x, GEN p) -+ GEN FpM_indexrank(GEN x, GEN p) - GEN FpM_intersect(GEN x, GEN y, GEN p) - GEN FpM_inv(GEN x, GEN p) - GEN FpM_invimage(GEN m, GEN v, GEN p) - GEN FpM_ker(GEN x, GEN p) -- GEN FpM_mul(GEN x, GEN y, GEN p) - long FpM_rank(GEN x, GEN p) -- GEN FpM_indexrank(GEN x, GEN p) - GEN FpM_suppl(GEN x, GEN p) -+ GEN FqM_FqC_gauss(GEN a, GEN b, GEN T, GEN p) -+ GEN FqM_FqC_mul(GEN a, GEN b, GEN T, GEN p) -+ GEN FqM_deplin(GEN x, GEN T, GEN p) -+ GEN FqM_det(GEN x, GEN T, GEN p) - GEN FqM_gauss(GEN a, GEN b, GEN T, GEN p) - GEN FqM_ker(GEN x, GEN T, GEN p) -+ GEN FqM_image(GEN x, GEN T, GEN p) -+ GEN FqM_inv(GEN x, GEN T, GEN p) -+ GEN FqM_mul(GEN a, GEN b, GEN T, GEN p) -+ long FqM_rank(GEN a, GEN T, GEN p) - GEN FqM_suppl(GEN x, GEN T, GEN p) - GEN QM_inv(GEN M, GEN dM) -+ GEN RgM_Fp_init(GEN a, GEN p, ulong *pp) -+ GEN RgM_RgC_invimage(GEN A, GEN B) -+ GEN RgM_diagonal(GEN m) -+ GEN RgM_diagonal_shallow(GEN m) -+ GEN RgM_Hadamard(GEN a) -+ GEN RgM_inv_upper(GEN a) -+ GEN RgM_invimage(GEN A, GEN B) -+ GEN RgM_solve(GEN a, GEN b) -+ GEN RgM_solve_realimag(GEN x, GEN y) -+ void RgMs_structelim(GEN M, long N, GEN A, GEN *p_col, GEN *p_lin) -+ GEN ZM_det(GEN a) -+ GEN ZM_detmult(GEN A) -+ GEN ZM_gauss(GEN a, GEN b) -+ GEN ZM_imagecompl(GEN x) -+ GEN ZM_indeximage(GEN x) - GEN ZM_inv(GEN M, GEN dM) -- GEN concat(GEN x, GEN y) -+ long ZM_rank(GEN x) -+ GEN ZlM_gauss(GEN a, GEN b, ulong p, long e, GEN C) -+ GEN closemodinvertible(GEN x, GEN y) - GEN deplin(GEN x) - GEN det(GEN a) -- GEN det0(GEN a,long flag) -+ GEN det0(GEN a, long flag) - GEN det2(GEN a) - GEN detint(GEN x) -- GEN diagonal(GEN x) - GEN eigen(GEN x, long prec) -- GEN shallowextract(GEN x, GEN l) -- GEN extract0(GEN x, GEN l1, GEN l2) - GEN gauss(GEN a, GEN b) - GEN gaussmodulo(GEN M, GEN D, GEN Y) - GEN gaussmodulo2(GEN M, GEN D, GEN Y) -- GEN scalarmat_s(long x, long n) -- GEN gtomat(GEN x) -- GEN gtrans(GEN x) -- int hnfdivide(GEN A, GEN B) -- GEN matid(long n) -+ GEN gen_Gauss(GEN a, GEN b, void *E, bb_field *ff) -+ GEN gen_Gauss_pivot(GEN x, long *rr, void *E, bb_field *ff) -+ GEN gen_det(GEN a, void *E, bb_field *ff) -+ GEN gen_ker(GEN x, long deplin, void *E, bb_field *ff) -+ GEN gen_matcolmul(GEN a, GEN b, void *E, bb_field *ff) -+ GEN gen_matmul(GEN a, GEN b, void *E, bb_field *ff) - GEN image(GEN x) - GEN image2(GEN x) - GEN imagecompl(GEN x) - GEN indexrank(GEN x) - GEN inverseimage(GEN mat, GEN y) -- long isdiagonal(GEN x) - GEN ker(GEN x) - GEN keri(GEN x) -- GEN matimage0(GEN x,long flag) -+ GEN mateigen(GEN x, long flag, long prec) -+ GEN matimage0(GEN x, long flag) - GEN matker0(GEN x, long flag) -- GEN matmuldiagonal(GEN x, GEN d) -- GEN matmultodiagonal(GEN x, GEN y) -- GEN matsolvemod0(GEN M, GEN D, GEN Y,long flag) -+ GEN matsolvemod0(GEN M, GEN D, GEN Y, long flag) - long rank(GEN x) -- GEN indexrank(GEN x) -- # we rename sum to pari_sum to avoid conflicts with -- # python's sum function -- GEN pari_sum "sum"(GEN v, long a, long b) -+ GEN reducemodinvertible(GEN x, GEN y) -+ GEN reducemodlll(GEN x, GEN y) -+ GEN split_realimag(GEN x, long r1, long r2) - GEN suppl(GEN x) - GEN vconcat(GEN A, GEN B) - - # alglin2.c - -- GEN ZM_to_zm(GEN z) -+ GEN FpM_charpoly(GEN x, GEN p) -+ GEN FpM_hess(GEN x, GEN p) -+ GEN Flm_charpoly(GEN x, long p) -+ GEN Flm_hess(GEN x, ulong p) -+ GEN QM_minors_coprime(GEN x, GEN pp) -+ GEN QM_ImZ_hnf(GEN x) -+ GEN QM_ImQ_hnf(GEN x) -+ GEN gnorml1_fake(GEN x) -+ GEN ZM_charpoly(GEN x) - GEN adj(GEN x) -- GEN caract(GEN x, int v) -+ GEN adjsafe(GEN x) -+ GEN caract(GEN x, long v) - GEN caradj(GEN x, long v, GEN *py) -+ GEN carberkowitz(GEN x, long v) - GEN carhess(GEN x, long v) -- GEN charpoly0(GEN x, int v,long flag) -- GEN conjvec(GEN x,long prec) -- GEN gconj(GEN x) -+ GEN charpoly(GEN x, long v) -+ GEN charpoly0(GEN x, long v, long flag) - GEN gnorm(GEN x) -- GEN gnorml1(GEN x,long prec) -+ GEN gnorml1(GEN x, long prec) -+ GEN gnormlp(GEN x, GEN p, long prec) - GEN gnorml2(GEN x) -+ GEN gsupnorm(GEN x, long prec) -+ void gsupnorm_aux(GEN x, GEN *m, GEN *msq, long prec) - GEN gtrace(GEN x) - GEN hess(GEN x) -- GEN hnf(GEN x) -- GEN hnfall(GEN x) -- GEN hnflll(GEN x) -- GEN hnfmod(GEN x, GEN detmat) -- GEN hnfmodid(GEN x,GEN p) -- GEN hnfperm(GEN x) - GEN intersect(GEN x, GEN y) - GEN jacobi(GEN a, long prec) -- GEN matfrobenius(GEN M, long flag, long v) -- GEN matrixqz(GEN x, GEN pp) -+ GEN matadjoint0(GEN x, long flag) -+ GEN matcompanion(GEN x) - GEN matrixqz0(GEN x, GEN pp) -- GEN qfsign(GEN a) -- GEN smith(GEN x) -- GEN smithall(GEN x) -- GEN smithclean(GEN z) -+ GEN minpoly(GEN x, long v) - GEN qfgaussred(GEN a) -- GEN zm_to_ZM(GEN z) -- GEN zx_to_ZX(GEN z) -+ GEN qfgaussred_positive(GEN a) -+ GEN qfsign(GEN a) -+ -+ # alglin3.c -+ -+ GEN apply0(GEN f, GEN A) -+ GEN diagonal(GEN x) -+ GEN diagonal_shallow(GEN x) -+ GEN extract0(GEN x, GEN l1, GEN l2) -+ GEN genapply(void *E, GEN (*f)(void *E, GEN x), GEN A) -+ GEN genindexselect(void *E, long (*f)(void *E, GEN x), GEN A) -+ GEN genselect(void *E, long (*f)(void *E, GEN x), GEN A) -+ GEN gtomat(GEN x) -+ GEN gtrans(GEN x) -+ GEN matmuldiagonal(GEN x, GEN d) -+ GEN matmultodiagonal(GEN x, GEN y) -+ GEN matslice0(GEN A, long x1, long x2, long y1, long y2) -+ GEN parapply(GEN V, GEN C) -+ GEN parselect(GEN C, GEN D, long flag) -+ GEN select0(GEN A, GEN f, long flag) -+ GEN shallowextract(GEN x, GEN L) -+ GEN shallowtrans(GEN x) -+ GEN vecapply(void *E, GEN (*f)(void* E, GEN x), GEN x) -+ GEN veccatapply(void *E, GEN (*f)(void* E, GEN x), GEN x) -+ GEN veccatselapply(void *Epred, long (*pred)(void* E, GEN x), void *Efun, -+ GEN (*fun)(void* E, GEN x), GEN A) -+ GEN vecrange(GEN a, GEN b) -+ GEN vecrangess(long a, long b) -+ GEN vecselapply(void *Epred, long (*pred)(void* E, GEN x), void *Efun, -+ GEN (*fun)(void* E, GEN x), GEN A) -+ GEN vecselect(void *E, long (*f)(void* E, GEN x), GEN A) -+ GEN vecslice0(GEN A, long y1, long y2) -+ GEN vecsum(GEN v) - - # anal.c - -- void addhelp(char *e, char *s) -+ void addhelp(const char *e, char *s) -+ void alias0(const char *s, const char *old) -+ GEN compile_str(const char *s) -+ GEN chartoGENstr(char c) - long delete_var() -- long fetch_user_var(char *s) -+ entree* fetch_named_var(const char *s) -+ long fetch_user_var(const char *s) - long fetch_var() -- GEN gp_read_str(char *s) -- void kill0(char *e) -- void name_var(long n, char *s) -+ GEN fetch_var_value(long vx, GEN t) -+ GEN gp_read_str(const char *t) -+ entree* install(void *f, const char *name, const char *code) -+ entree* is_entry(const char *s) -+ void kill0(const char *e) -+ long manage_var(long n, entree *ep) -+ void pari_var_init() -+ long pari_var_next() -+ long pari_var_next_temp() -+ void pari_var_create(entree *ep) -+ void name_var(long n, const char *s) - GEN readseq(char *t) -- GEN strtoGENstr(char *s) -+ GEN* safegel(GEN x, long l) -+ long* safeel(GEN x, long l) -+ GEN* safelistel(GEN x, long l) -+ GEN* safegcoeff(GEN x, long a, long b) -+ GEN strntoGENstr(const char *s, long n0) -+ GEN strtoGENstr(const char *s) -+ GEN strtoi(const char *s) -+ GEN strtor(const char *s, long prec) - GEN type0(GEN x) - -+ # aprcl.c -+ -+ long isprimeAPRCL(GEN N) -+ -+ # Qfb.c -+ -+ GEN Qfb0(GEN x, GEN y, GEN z, GEN d, long prec) -+ void check_quaddisc(GEN x, long *s, long *r, const char *f) -+ void check_quaddisc_imag(GEN x, long *r, const char *f) -+ void check_quaddisc_real(GEN x, long *r, const char *f) -+ long cornacchia(GEN d, GEN p, GEN *px, GEN *py) -+ long cornacchia2(GEN d, GEN p, GEN *px, GEN *py) -+ GEN nucomp(GEN x, GEN y, GEN l) -+ GEN nudupl(GEN x, GEN l) -+ GEN nupow(GEN x, GEN n) -+ GEN primeform(GEN x, GEN p, long prec) -+ GEN primeform_u(GEN x, ulong p) -+ GEN qfbcompraw(GEN x, GEN y) -+ GEN qfbpowraw(GEN x, long n) -+ GEN qfbred0(GEN x, long flag, GEN D, GEN isqrtD, GEN sqrtD) -+ GEN qfbsolve(GEN Q, GEN n) -+ GEN qfi(GEN x, GEN y, GEN z) -+ GEN qfi_1(GEN x) -+ GEN qficomp(GEN x, GEN y) -+ GEN qficompraw(GEN x, GEN y) -+ GEN qfipowraw(GEN x, long n) -+ GEN qfisolvep(GEN Q, GEN p) -+ GEN qfisqr(GEN x) -+ GEN qfisqrraw(GEN x) -+ GEN qfr(GEN x, GEN y, GEN z, GEN d) -+ GEN qfr3_comp(GEN x, GEN y, qfr_data *S) -+ GEN qfr3_pow(GEN x, GEN n, qfr_data *S) -+ GEN qfr3_red(GEN x, qfr_data *S) -+ GEN qfr3_rho(GEN x, qfr_data *S) -+ GEN qfr3_to_qfr(GEN x, GEN z) -+ GEN qfr5_comp(GEN x, GEN y, qfr_data *S) -+ GEN qfr5_dist(GEN e, GEN d, long prec) -+ GEN qfr5_pow(GEN x, GEN n, qfr_data *S) -+ GEN qfr5_red(GEN x, qfr_data *S) -+ GEN qfr5_rho(GEN x, qfr_data *S) -+ GEN qfr5_to_qfr(GEN x, GEN d0) -+ GEN qfr_1(GEN x) -+ void qfr_data_init(GEN D, long prec, qfr_data *S) -+ GEN qfr_to_qfr5(GEN x, long prec) -+ GEN qfrcomp(GEN x, GEN y) -+ GEN qfrcompraw(GEN x, GEN y) -+ GEN qfrpow(GEN x, GEN n) -+ GEN qfrpowraw(GEN x, long n) -+ GEN qfrsolvep(GEN Q, GEN p) -+ GEN qfrsqr(GEN x) -+ GEN qfrsqrraw(GEN x) -+ GEN quadgen(GEN x) -+ GEN quadpoly(GEN x) -+ GEN quadpoly0(GEN x, long v) -+ GEN redimag(GEN x) -+ GEN redreal(GEN x) -+ GEN redrealnod(GEN x, GEN isqrtD) -+ GEN rhoreal(GEN x) -+ GEN rhorealnod(GEN x, GEN isqrtD) -+ - # arith1.c - -- GEN bestappr0(GEN x, GEN a, GEN b) -+ ulong Fl_order(ulong a, ulong o, ulong p) -+ ulong Fl_powu(ulong x, ulong n, ulong p) -+ ulong Fl_sqrt(ulong a, ulong p) -+ GEN Fp_factored_order(GEN a, GEN o, GEN p) -+ int Fp_ispower(GEN x, GEN K, GEN p) -+ GEN Fp_log(GEN a, GEN g, GEN ord, GEN p) -+ GEN Fp_order(GEN a, GEN o, GEN p) -+ GEN Fp_pow(GEN a, GEN n, GEN m) -+ GEN Fp_pows(GEN A, long k, GEN N) -+ GEN Fp_powu(GEN x, ulong k, GEN p) -+ GEN Fp_sqrt(GEN a, GEN p) -+ GEN Fp_sqrtn(GEN a, GEN n, GEN p, GEN *zetan) -+ GEN Z_chinese(GEN a, GEN b, GEN A, GEN B) -+ GEN Z_chinese_all(GEN a, GEN b, GEN A, GEN B, GEN *pC) -+ GEN Z_chinese_coprime(GEN a, GEN b, GEN A, GEN B, GEN C) -+ GEN Z_chinese_post(GEN a, GEN b, GEN C, GEN U, GEN d) -+ void Z_chinese_pre(GEN A, GEN B, GEN *pC, GEN *pU, GEN *pd) -+ GEN Z_factor_listP(GEN N, GEN L) -+ long Z_isanypower(GEN x, GEN *y) -+ long Z_isfundamental(GEN x) -+ long Z_ispow2(GEN x) -+ long Z_ispowerall(GEN x, ulong k, GEN *pt) -+ long Z_issquareall(GEN x, GEN *pt) -+ long Zp_issquare(GEN a, GEN p) - GEN bestappr(GEN x, GEN k) -- long cgcd(long a,long b) -- void check_quaddisc(GEN x, long *s, long *r, char *f) -+ GEN bestapprPade(GEN x, long B) -+ long cgcd(long a, long b) - GEN chinese(GEN x, GEN y) -- GEN classno2(GEN x) -+ GEN chinese1(GEN x) -+ GEN chinese1_coprime_Z(GEN x) - GEN classno(GEN x) -- long clcm(long a,long b) -+ GEN classno2(GEN x) -+ long clcm(long a, long b) - GEN contfrac0(GEN x, GEN b, long flag) -+ GEN contfracpnqn(GEN x, long n) - GEN fibo(long n) - GEN gboundcf(GEN x, long k) -- GEN gissquareall(GEN x, GEN *pt) -- GEN gissquare(GEN x) -- GEN gcf2(GEN b, GEN x) - GEN gcf(GEN x) -- GEN quadunit(GEN x) -+ GEN gcf2(GEN b, GEN x) -+ bb_field *get_Fp_field(void **E, GEN p) -+ ulong pgener_Fl(ulong p) -+ ulong pgener_Fl_local(ulong p, GEN L) -+ GEN pgener_Fp(GEN p) -+ GEN pgener_Fp_local(GEN p, GEN L) -+ ulong pgener_Zl(ulong p) -+ GEN pgener_Zp(GEN p) - long gisanypower(GEN x, GEN *pty) -- GEN gisprime(GEN x, long flag) -- GEN gispseudoprime(GEN x, long flag) -- GEN gkronecker(GEN x, GEN y) -- GEN gnextprime(GEN n) -- GEN gprecprime(GEN n) -- GEN quadregulator(GEN x, long prec) -+ GEN gissquare(GEN x) -+ GEN gissquareall(GEN x, GEN *pt) - GEN hclassno(GEN x) -- long hilbert0 "hilbert"(GEN x, GEN y, GEN p) -- long Z_isfundamental(GEN x) -+ long hilbert(GEN x, GEN y, GEN p) -+ long hilbertii(GEN x, GEN y, GEN p) -+ long isfundamental(GEN x) -+ long ispolygonal(GEN x, GEN S, GEN *N) - long ispower(GEN x, GEN k, GEN *pty) -- long isprimeAPRCL(GEN N) -- long isprime(GEN x) -- long ispseudoprime(GEN x, long flag) -+ long isprimepower(GEN x, GEN *pty) -+ long issquare(GEN x) -+ long issquareall(GEN x, GEN *pt) - long krois(GEN x, long y) -+ long kroiu(GEN x, ulong y) - long kronecker(GEN x, GEN y) - long krosi(long s, GEN x) - long kross(long x, long y) - long krouu(ulong x, ulong y) - GEN lcmii(GEN a, GEN b) -+ long logint(GEN B, GEN y, GEN *ptq) -+ long logint0(GEN B, GEN y, GEN *ptq) - GEN mpfact(long n) -- GEN mpfactr(long n, long prec) -- GEN Fp_pow(GEN a, GEN n, GEN m) -- GEN Fp_sqrt(GEN a, GEN p) -- GEN Fp_sqrtn(GEN a, GEN n, GEN p, GEN *zetan) -- GEN nucomp(GEN x, GEN y, GEN l) -- GEN nudupl(GEN x, GEN l) -- GEN nupow(GEN x, GEN n) - GEN order(GEN x) - GEN pnqn(GEN x) -- GEN primeform(GEN x, GEN p, long prec) -- GEN Qfb0(GEN x, GEN y, GEN z, GEN d, long prec) -- GEN qfbclassno0(GEN x,long flag) -- GEN qfbred0(GEN x, long flag, GEN D, GEN isqrtD, GEN sqrtD) -- GEN qfbsolve(GEN Q, GEN n) -- GEN qfi(GEN x, GEN y, GEN z) -- GEN qfr(GEN x, GEN y, GEN z, GEN d) - GEN quaddisc(GEN x) -- GEN redimag(GEN x) -- GEN redreal(GEN x) -- GEN redrealnod(GEN x, GEN isqrtD) -- GEN rhoreal(GEN x) -- GEN rhorealnod(GEN x, GEN isqrtD) -- ulong Fl_sqrt(ulong a, ulong p) -- GEN znprimroot0(GEN m) -+ GEN quadregulator(GEN x, long prec) -+ GEN quadunit(GEN x) -+ ulong rootsof1_Fl(ulong n, ulong p) -+ GEN rootsof1_Fp(GEN n, GEN p) -+ GEN rootsof1u_Fp(ulong n, GEN p) -+ GEN sqrtint(GEN a) -+ ulong ugcd(ulong a, ulong b) -+ long uisprimepower(ulong n, ulong *p) -+ long uissquare(ulong A) -+ long uissquareall(ulong A, ulong *sqrtA) -+ long unegisfundamental(ulong x) -+ long uposisfundamental(ulong x) -+ GEN znlog(GEN x, GEN g, GEN o) -+ GEN znorder(GEN x, GEN o) -+ GEN znprimroot(GEN m) - GEN znstar(GEN x) - GEN sqrtint(GEN x) - - # arith2.c - -- GEN addprimes(GEN primes) -- long bigomega(GEN n) -- GEN binaire(GEN x) -- long bittest(GEN x, long n) -- GEN boundfact(GEN n, long lim) -- GEN core(GEN n) -+ GEN Z_smoothen(GEN N, GEN L, GEN *pP, GEN *pe) -+ GEN boundfact(GEN n, ulong lim) -+ GEN check_arith_pos(GEN n, char *f) -+ GEN check_arith_non0(GEN n, char *f) -+ GEN check_arith_all(GEN n, char *f) -+ GEN clean_Z_factor(GEN f) - GEN corepartial(GEN n, long l) -- GEN core0(GEN n,long flag) -+ GEN core0(GEN n, long flag) - GEN core2(GEN n) - GEN core2partial(GEN n, long l) - GEN coredisc(GEN n) -- GEN coredisc0(GEN n,long flag) -+ GEN coredisc0(GEN n, long flag) - GEN coredisc2(GEN n) -- GEN Z_factor(GEN n) -+ GEN digits(GEN N, GEN B) - GEN divisors(GEN n) - GEN factorint(GEN n, long flag) -- GEN gbigomega(GEN n) -- GEN gbitand(GEN x, GEN y) -- GEN gbitneg(GEN x, long n) -- GEN gbitnegimply(GEN x, GEN y) -- GEN gbitor(GEN x, GEN y) -- GEN gbittest(GEN x, GEN n) -- GEN gbitxor(GEN x, GEN y) -- GEN gissquarefree(GEN x) -- GEN gmoebius(GEN n) -- GEN gnumbdiv(GEN n) -- GEN gomega(GEN n) -- GEN gsumdiv(GEN n) -- GEN gsumdivk(GEN n,long k) -- char* initprimes(ulong maxnum) -- long issquarefree(GEN x) -+ GEN divisorsu(ulong n) -+ GEN factor_pn_1(GEN p, ulong n) -+ GEN factor_pn_1_limit(GEN p, long n, ulong lim) -+ GEN factoru_pow(ulong n) -+ byteptr initprimes(ulong maxnum, long *lenp, ulong *lastp) -+ void initprimetable(ulong maxnum) -+ ulong init_primepointer_geq(ulong a, byteptr *pd) -+ ulong init_primepointer_gt(ulong a, byteptr *pd) -+ ulong init_primepointer_leq(ulong a, byteptr *pd) -+ ulong init_primepointer_lt(ulong a, byteptr *pd) -+ int is_Z_factor(GEN f) -+ int is_Z_factornon0(GEN f) -+ int is_Z_factorpos(GEN f) - ulong maxprime() - void maxprime_check(ulong c) -- GEN numbdiv(GEN n) -- long omega(GEN n) -- GEN geulerphi(GEN n) -- GEN prime(long n) -- GEN primepi(GEN x) -- GEN primes(long n) -- GEN removeprimes(GEN primes) -- GEN sumdiv(GEN n) -- GEN sumdivk(GEN n,long k) -+ GEN sumdigits(GEN n) -+ ulong sumdigitsu(ulong n) -+ -+ # DedekZeta.c -+ -+ GEN glambdak(GEN nfz, GEN s, long prec) -+ GEN gzetak(GEN nfz, GEN s, long prec) -+ GEN gzetakall(GEN nfz, GEN s, long flag, long prec) -+ GEN initzeta(GEN pol, long prec) -+ GEN dirzetak(GEN nf, GEN b) - - # base1.c - -- GEN bnfnewprec(GEN nf, long prec) -- GEN bnrnewprec(GEN bnr, long prec) -+ GEN FpX_FpC_nfpoleval(GEN nf, GEN pol, GEN a, GEN p) -+ GEN embed_T2(GEN x, long r1) -+ GEN embednorm_T2(GEN x, long r1) -+ GEN embed_norm(GEN x, long r1) -+ void check_ZKmodule(GEN x, char *s) - void checkbid(GEN bid) -+ void checkabgrp(GEN v) -+ void checksqmat(GEN x, long N) - GEN checkbnf(GEN bnf) - void checkbnr(GEN bnr) - void checkbnrgen(GEN bnr) - GEN checknf(GEN nf) - GEN checknfelt_mod(GEN nf, GEN x, char *s) -+ void checkprid(GEN bid) - void checkrnf(GEN rnf) -+ GEN factoredpolred(GEN x, GEN fa) -+ GEN factoredpolred2(GEN x, GEN fa) - GEN galoisapply(GEN nf, GEN aut, GEN x) -- GEN polgalois(GEN x, long prec) - GEN get_bnf(GEN x, long *t) - GEN get_bnfpol(GEN x, GEN *bnf, GEN *nf) - GEN get_nf(GEN x, long *t) - GEN get_nfpol(GEN x, GEN *nf) -- GEN glambdak(GEN nfz, GEN s, long prec) -- GEN gsmith(GEN x) -- GEN gsmithall(GEN x) -- GEN gzetak(GEN nfz, GEN s, long prec) -- GEN gzetakall(GEN nfz, GEN s, long flag, long prec) -- GEN mathnf0(GEN x,long flag) -- GEN matsnf0(GEN x,long flag) -+ GEN get_prid(GEN x) -+ GEN idealfrobenius(GEN nf, GEN gal, GEN pr) -+ GEN idealramgroups(GEN nf, GEN gal, GEN pr) -+ GEN nf_get_allroots(GEN nf) -+ long nf_get_prec(GEN x) -+ GEN nfcertify(GEN x) -+ GEN nfgaloismatrix(GEN nf, GEN s) -+ GEN nfinit(GEN x, long prec) - GEN nfinit0(GEN x, long flag, long prec) -+ GEN nfinitall(GEN x, long flag, long prec) -+ GEN nfinitred(GEN x, long prec) -+ GEN nfinitred2(GEN x, long prec) -+ GEN nfisincl(GEN a, GEN b) -+ GEN nfisisom(GEN a, GEN b) - GEN nfnewprec(GEN nf, long prec) -- GEN rootsof1(GEN x) -+ GEN nfnewprec(GEN nf, long prec) -+ GEN nfnewprec_shallow(GEN nf, long prec) -+ GEN nfpoleval(GEN nf, GEN pol, GEN a) -+ long nftyp(GEN x) -+ GEN polredord(GEN x) -+ GEN polgalois(GEN x, long prec) -+ GEN polred(GEN x) -+ GEN polred0(GEN x, long flag, GEN p) -+ GEN polred2(GEN x) -+ GEN polredabs(GEN x) -+ GEN polredabs0(GEN x, long flag) -+ GEN polredabs2(GEN x) -+ GEN polredabsall(GEN x, long flun) -+ GEN polredbest(GEN x, long flag) -+ GEN rnfpolredabs(GEN nf, GEN pol, long flag) -+ GEN rnfpolredbest(GEN nf, GEN relpol, long flag) -+ GEN smallpolred(GEN x) -+ GEN smallpolred2(GEN x) - GEN tschirnhaus(GEN x) -+ GEN ZX_Q_normalize(GEN pol, GEN *ptlc) -+ GEN ZX_Z_normalize(GEN pol, GEN *ptk) -+ GEN ZX_to_monic(GEN pol, GEN *lead) -+ GEN ZX_primitive_to_monic(GEN pol, GEN *lead) - - # base2.c - -- GEN base(GEN x, GEN *y) -- GEN base2(GEN x, GEN *y) -+ GEN Fq_to_nf(GEN x, GEN modpr) -+ GEN FqM_to_nfM(GEN z, GEN modpr) -+ GEN FqV_to_nfV(GEN z, GEN modpr) -+ GEN FqX_to_nfX(GEN x, GEN modpr) -+ GEN Rg_nffix(const char *f, GEN T, GEN c, int lift) -+ GEN RgV_nffix(const char *f, GEN T, GEN P, int lift) -+ GEN RgX_nffix(const char *s, GEN nf, GEN x, int lift) -+ long ZpX_disc_val(GEN f, GEN p) -+ GEN ZpX_gcd(GEN f1, GEN f2, GEN p, GEN pm) -+ GEN ZpX_reduced_resultant(GEN x, GEN y, GEN p, GEN pm) -+ GEN ZpX_reduced_resultant_fast(GEN f, GEN g, GEN p, long M) -+ long ZpX_resultant_val(GEN f, GEN g, GEN p, long M) - void checkmodpr(GEN modpr) -- GEN compositum(GEN pol1, GEN pol2) -- GEN compositum2(GEN pol1, GEN pol2) -- GEN discf(GEN x) -- long idealval(GEN nf,GEN ix,GEN vp) -- GEN idealprodprime(GEN nf, GEN L) -+ GEN ZX_compositum_disjoint(GEN A, GEN B) -+ GEN compositum(GEN P, GEN Q) -+ GEN compositum2(GEN P, GEN Q) -+ GEN nfdisc(GEN x) - GEN indexpartial(GEN P, GEN DP) -- GEN nfbasis(GEN x, GEN *y,long flag,GEN p) -- GEN nfbasis0(GEN x,long flag,GEN p) -- GEN nfdisc0(GEN x,long flag, GEN p) -+ GEN modpr_genFq(GEN modpr) -+ GEN nf_to_Fq_init(GEN nf, GEN *pr, GEN *T, GEN *p) -+ GEN nf_to_Fq(GEN nf, GEN x, GEN modpr) -+ GEN nfM_to_FqM(GEN z, GEN nf, GEN modpr) -+ GEN nfV_to_FqV(GEN z, GEN nf, GEN modpr) -+ GEN nfX_to_FqX(GEN x, GEN nf, GEN modpr) -+ GEN nfbasis(GEN x, GEN *y, GEN p) -+ GEN nfbasis0(GEN x, long flag, GEN p) -+ GEN nfdisc0(GEN x, long flag, GEN p) -+ void nfmaxord(nfmaxord_t *S, GEN T, long flag) -+ GEN nfmodprinit(GEN nf, GEN pr) - GEN nfreducemodpr(GEN nf, GEN x, GEN modpr) -- GEN polcompositum0(GEN pol1, GEN pol2,long flag) -- GEN idealprimedec(GEN nf,GEN p) -+ GEN polcompositum0(GEN P, GEN Q, long flag) -+ GEN idealprimedec(GEN nf, GEN p) - GEN rnfbasis(GEN bnf, GEN order) -+ GEN rnfdedekind(GEN nf, GEN T, GEN pr, long flag) - GEN rnfdet(GEN nf, GEN order) - GEN rnfdiscf(GEN nf, GEN pol) -- GEN rnfequation(GEN nf, GEN pol2) -- GEN rnfequation0(GEN nf, GEN pol2, long flall) -+ GEN rnfequation(GEN nf, GEN pol) -+ GEN rnfequation0(GEN nf, GEN pol, long flall) - GEN rnfequation2(GEN nf, GEN pol) - GEN rnfhnfbasis(GEN bnf, GEN order) -+ GEN nf_rnfeq(GEN nf, GEN relpol) -+ GEN nf_rnfeqsimple(GEN nf, GEN relpol) -+ GEN rnfequationall(GEN A, GEN B, long *pk, GEN *pLPRS) -+ GEN rnfhnfbasis(GEN bnf, GEN order) - long rnfisfree(GEN bnf, GEN order) -- GEN rnflllgram(GEN nf, GEN pol, GEN order,long prec) -+ GEN rnflllgram(GEN nf, GEN pol, GEN order, long prec) - GEN rnfpolred(GEN nf, GEN pol, long prec) -- GEN rnfpolredabs(GEN nf, GEN pol, long flag) - GEN rnfpseudobasis(GEN nf, GEN pol) - GEN rnfsimplifybasis(GEN bnf, GEN order) -+ GEN rnfsteinitz(GEN nf, GEN order) -+ long factorial_lval(ulong n, ulong p) -+ GEN zk_to_Fq_init(GEN nf, GEN *pr, GEN *T, GEN *p) -+ GEN zk_to_Fq(GEN x, GEN modpr) -+ GEN zkmodprinit(GEN nf, GEN pr) - - # base3.c - -+ GEN Idealstar(GEN nf, GEN x, long flun) -+ GEN RgC_to_nfC(GEN nf, GEN x) -+ GEN RgM_to_nfM(GEN nf, GEN x) -+ GEN RgX_to_nfX(GEN nf, GEN pol) - GEN algtobasis(GEN nf, GEN x) - GEN basistoalg(GEN nf, GEN x) -- long nfval(GEN nf, GEN x, GEN vp) -- GEN ideallist(GEN nf,long bound) -- GEN ideallist0(GEN nf,long bound, long flag) -+ GEN ideallist(GEN nf, long bound) -+ GEN ideallist0(GEN nf, long bound, long flag) - GEN ideallistarch(GEN nf, GEN list, GEN arch) -- GEN idealstar0(GEN nf, GEN x,long flag) -+ GEN idealprincipalunits(GEN nf, GEN pr, long e) -+ GEN idealstar0(GEN nf, GEN x, long flag) -+ GEN indices_to_vec01(GEN archp, long r) -+ GEN matalgtobasis(GEN nf, GEN x) -+ GEN matbasistoalg(GEN nf, GEN x) -+ GEN nf_to_scalar_or_alg(GEN nf, GEN x) -+ GEN nf_to_scalar_or_basis(GEN nf, GEN x) -+ GEN nfadd(GEN nf, GEN x, GEN y) -+ GEN nfarchstar(GEN nf, GEN x, GEN arch) -+ GEN nfdiv(GEN nf, GEN x, GEN y) - GEN nfdiveuc(GEN nf, GEN a, GEN b) - GEN nfdivrem(GEN nf, GEN a, GEN b) -+ GEN nfinv(GEN nf, GEN x) -+ GEN nfinvmodideal(GEN nf, GEN x, GEN ideal) - GEN nfmod(GEN nf, GEN a, GEN b) -- GEN reducemodinvertible(GEN x, GEN y) -+ GEN nfmul(GEN nf, GEN x, GEN y) -+ GEN nfmuli(GEN nf, GEN x, GEN y) -+ GEN nfnorm(GEN nf, GEN x) -+ GEN nfpow(GEN nf, GEN x, GEN k) -+ GEN nfpow_u(GEN nf, GEN z, ulong n) -+ GEN nfpowmodideal(GEN nf, GEN x, GEN k, GEN ideal) -+ GEN nfsign(GEN nf, GEN alpha) -+ GEN nfsign_arch(GEN nf, GEN alpha, GEN arch) -+ GEN nfsign_from_logarch(GEN Larch, GEN invpi, GEN archp) -+ GEN nfsqr(GEN nf, GEN x) -+ GEN nfsqri(GEN nf, GEN x) -+ GEN nftrace(GEN nf, GEN x) -+ long nfval(GEN nf, GEN x, GEN vp) -+ GEN polmod_nffix(const char *f, GEN rnf, GEN x, int lift) -+ GEN polmod_nffix2(const char *f, GEN T, GEN relpol, GEN x, int lift) -+ int pr_equal(GEN nf, GEN P, GEN Q) -+ GEN rnfalgtobasis(GEN rnf, GEN x) -+ GEN rnfbasistoalg(GEN rnf, GEN x) -+ GEN rnfeltnorm(GEN rnf, GEN x) -+ GEN rnfelttrace(GEN rnf, GEN x) -+ GEN set_sign_mod_divisor(GEN nf, GEN x, GEN y, GEN idele, GEN sarch) -+ GEN vec01_to_indices(GEN arch) - GEN vecmodii(GEN a, GEN b) -- GEN ideallog(GEN nf,GEN x,GEN bigideal) -- GEN zidealstar(GEN nf, GEN x) -- GEN znlog(GEN x, GEN g) -+ GEN ideallog(GEN nf, GEN x, GEN bigideal) -+ -+ GEN multable(GEN nf, GEN x) -+ GEN tablemul(GEN TAB, GEN x, GEN y) -+ GEN tablemul_ei(GEN M, GEN x, long i) -+ GEN tablemul_ei_ej(GEN M, long i, long j) -+ GEN tablemulvec(GEN M, GEN x, GEN v) -+ GEN tablesqr(GEN tab, GEN x) -+ GEN ei_multable(GEN nf, long i) -+ long ZC_nfval(GEN nf, GEN x, GEN P) -+ long ZC_nfvalrem(GEN nf, GEN x, GEN P, GEN *t) -+ GEN zk_multable(GEN nf, GEN x) -+ GEN zk_scalar_or_multable(GEN, GEN x) -+ int ZC_prdvd(GEN nf, GEN x, GEN P) - - # base4.c - -- GEN nfreduce(GEN nf, GEN x, GEN ideal) -+ GEN RM_round_maxrank(GEN G) -+ GEN ZM_famat_limit(GEN fa, GEN limit) -+ GEN famat_inv(GEN f) -+ GEN famat_inv_shallow(GEN f) -+ GEN famat_makecoprime(GEN nf, GEN g, GEN e, GEN pr, GEN prk, GEN EX) -+ GEN famat_mul(GEN f, GEN g) -+ GEN famat_pow(GEN f, GEN n) -+ GEN famat_sqr(GEN f) -+ GEN famat_reduce(GEN fa) -+ GEN famat_to_nf(GEN nf, GEN f) -+ GEN famat_to_nf_modideal_coprime(GEN nf, GEN g, GEN e, GEN id, GEN EX) -+ GEN famat_to_nf_moddivisor(GEN nf, GEN g, GEN e, GEN bid) -+ GEN famatsmall_reduce(GEN fa) - GEN idealtwoelt(GEN nf, GEN ix) - GEN idealtwoelt0(GEN nf, GEN ix, GEN a) - GEN idealtwoelt2(GEN nf, GEN x, GEN a) - GEN idealadd(GEN nf, GEN x, GEN y) - GEN idealaddmultoone(GEN nf, GEN list) - GEN idealaddtoone(GEN nf, GEN x, GEN y) -+ GEN idealaddtoone_i(GEN nf, GEN x, GEN y) - GEN idealaddtoone0(GEN nf, GEN x, GEN y) - GEN idealappr(GEN nf, GEN x) - GEN idealappr0(GEN nf, GEN x, long fl) - GEN idealapprfact(GEN nf, GEN x) - GEN idealchinese(GEN nf, GEN x, GEN y) - GEN idealcoprime(GEN nf, GEN x, GEN y) -+ GEN idealcoprimefact(GEN nf, GEN x, GEN fy) - GEN idealdiv(GEN nf, GEN x, GEN y) -- GEN idealdiv0(GEN nf, GEN x, GEN y,long flag) -+ GEN idealdiv0(GEN nf, GEN x, GEN y, long flag) - GEN idealdivexact(GEN nf, GEN x, GEN y) - GEN idealdivpowprime(GEN nf, GEN x, GEN vp, GEN n) - GEN idealmulpowprime(GEN nf, GEN x, GEN vp, GEN n) - GEN idealfactor(GEN nf, GEN x) - GEN idealhnf(GEN nf, GEN x) -+ GEN idealhnf_principal(GEN nf, GEN x) -+ GEN idealhnf_shallow(GEN nf, GEN x) -+ GEN idealhnf_two(GEN nf, GEN vp) - GEN idealhnf0(GEN nf, GEN a, GEN b) - GEN idealintersect(GEN nf, GEN x, GEN y) - GEN idealinv(GEN nf, GEN ix) -- GEN idealred0(GEN nf, GEN ix, GEN vdir) -+ GEN idealred0(GEN nf, GEN I, GEN vdir) - GEN idealmul(GEN nf, GEN ix, GEN iy) -- GEN idealmul0(GEN nf, GEN ix, GEN iy, long flag, long prec) -+ GEN idealmul0(GEN nf, GEN ix, GEN iy, long flag) -+ GEN idealmul_HNF(GEN nf, GEN ix, GEN iy) - GEN idealmulred(GEN nf, GEN ix, GEN iy) - GEN idealnorm(GEN nf, GEN x) -+ GEN idealnumden(GEN nf, GEN x) - GEN idealpow(GEN nf, GEN ix, GEN n) -- GEN idealpow0(GEN nf, GEN ix, GEN n, long flag, long prec) -- GEN idealpowred(GEN nf, GEN ix, GEN n,long prec) -+ GEN idealpow0(GEN nf, GEN ix, GEN n, long flag) -+ GEN idealpowred(GEN nf, GEN ix, GEN n) - GEN idealpows(GEN nf, GEN ideal, long iexp) -+ GEN idealprodprime(GEN nf, GEN L) -+ GEN idealsqr(GEN nf, GEN x) - long idealtyp(GEN *ideal, GEN *arch) -- long isideal(GEN nf,GEN x) -- GEN minideal(GEN nf,GEN ix,GEN vdir,long prec) -- GEN mul_content(GEN cx, GEN cy) -- GEN nfdetint(GEN nf,GEN pseudo) -+ long idealval(GEN nf, GEN ix, GEN vp) -+ long isideal(GEN nf, GEN x) -+ GEN idealmin(GEN nf, GEN ix, GEN vdir) -+ GEN nf_get_Gtwist(GEN nf, GEN vdir) -+ GEN nf_get_Gtwist1(GEN nf, long i) -+ GEN nfC_nf_mul(GEN nf, GEN v, GEN x) -+ GEN nfdetint(GEN nf, GEN pseudo) -+ GEN nfdivmodpr(GEN nf, GEN x, GEN y, GEN modpr) - GEN nfhnf(GEN nf, GEN x) -+ GEN nfhnfmod(GEN nf, GEN x, GEN d) - GEN nfkermodpr(GEN nf, GEN x, GEN modpr) -+ GEN nfmulmodpr(GEN nf, GEN x, GEN y, GEN modpr) -+ GEN nfpowmodpr(GEN nf, GEN x, GEN k, GEN modpr) -+ GEN nfreduce(GEN nf, GEN x, GEN ideal) - GEN nfsnf(GEN nf, GEN x) - GEN nfsolvemodpr(GEN nf, GEN a, GEN b, GEN modpr) -+ GEN to_famat(GEN x, GEN y) -+ GEN to_famat_shallow(GEN x, GEN y) - GEN vecdiv(GEN x, GEN y) - GEN vecinv(GEN x) - GEN vecmul(GEN x, GEN y) -@@ -813,169 +1966,225 @@ cdef extern from 'pari/pari.h': - - # base5.c - -- GEN matalgtobasis(GEN nf, GEN x) -- GEN matbasistoalg(GEN nf, GEN x) -- GEN rnfalgtobasis(GEN rnf, GEN x) -- GEN rnfbasistoalg(GEN rnf, GEN x) -- GEN rnfelementabstorel(GEN rnf, GEN x) -- GEN rnfelementdown(GEN rnf, GEN x) -- GEN rnfelementreltoabs(GEN rnf, GEN x) -- GEN rnfelementup(GEN rnf, GEN x) -+ GEN eltreltoabs(GEN rnfeq, GEN x) -+ GEN eltabstorel(GEN eq, GEN P) -+ GEN eltabstorel_lift(GEN rnfeq, GEN P) -+ void nf_nfzk(GEN nf, GEN rnfeq, GEN *zknf, GEN *czknf) -+ GEN nfeltup(GEN nf, GEN x, GEN zknf, GEN czknf) -+ GEN rnfeltabstorel(GEN rnf, GEN x) -+ GEN rnfeltdown(GEN rnf, GEN x) -+ GEN rnfeltreltoabs(GEN rnf, GEN x) -+ GEN rnfeltup(GEN rnf, GEN x) - GEN rnfidealabstorel(GEN rnf, GEN x) - GEN rnfidealdown(GEN rnf, GEN x) -- GEN rnfidealhermite(GEN rnf, GEN x) -- GEN rnfidealmul(GEN rnf,GEN x,GEN y) -+ GEN rnfidealhnf(GEN rnf, GEN x) -+ GEN rnfidealmul(GEN rnf, GEN x, GEN y) - GEN rnfidealnormabs(GEN rnf, GEN x) - GEN rnfidealnormrel(GEN rnf, GEN x) - GEN rnfidealreltoabs(GEN rnf, GEN x) -- GEN rnfidealtwoelement(GEN rnf,GEN x) -+ GEN rnfidealtwoelement(GEN rnf, GEN x) - GEN rnfidealup(GEN rnf, GEN x) - GEN rnfinit(GEN nf, GEN pol) - -+ # bb_group.c -+ -+ GEN dlog_get_ordfa(GEN o) -+ GEN dlog_get_ord(GEN o) -+ GEN gen_PH_log(GEN a, GEN g, GEN ord, void *E, bb_group *grp) -+ GEN gen_Shanks_sqrtn(GEN a, GEN n, GEN q, GEN *zetan, void *E, bb_group *grp) -+ GEN gen_gener(GEN o, void *E, bb_group *grp) -+ GEN gen_ellgens(GEN d1, GEN d2, GEN m, void *E, bb_group *grp, -+ GEN pairorder(void *E, GEN P, GEN Q, GEN m, GEN F)) -+ GEN gen_ellgroup(GEN N, GEN F, GEN *pt_m, void *E, bb_group *grp, -+ GEN pairorder(void *E, GEN P, GEN Q, GEN m, GEN F)) -+ GEN gen_factored_order(GEN a, GEN o, void *E, bb_group *grp) -+ GEN gen_order(GEN x, GEN o, void *E, bb_group *grp) -+ GEN gen_select_order(GEN o, void *E, bb_group *grp) -+ -+ GEN gen_plog(GEN x, GEN g0, GEN q, void *E, bb_group *grp) -+ GEN gen_pow(GEN x, GEN n, void *E, GEN (*sqr)(void*, GEN), GEN (*mul)(void*, GEN, GEN)) -+ GEN gen_pow_i(GEN x, GEN n, void *E, GEN (*sqr)(void*, GEN), GEN (*mul)(void*, GEN, GEN)) -+ GEN gen_pow_fold(GEN x, GEN n, void *E, GEN (*sqr)(void*, GEN), GEN (*msqr)(void*, GEN)) -+ GEN gen_pow_fold_i(GEN x, GEN n, void *E, GEN (*sqr)(void*, GEN), GEN (*msqr)(void*, GEN)) -+ GEN gen_powers(GEN x, long l, int use_sqr, void *E, GEN (*sqr)(void*, GEN), GEN (*mul)(void*, GEN, GEN), GEN (*one)(void*)) -+ GEN gen_powu(GEN x, ulong n, void *E, GEN (*sqr)(void*, GEN), GEN (*mul)(void*, GEN, GEN)) -+ GEN gen_powu_i(GEN x, ulong n, void *E, GEN (*sqr)(void*, GEN), GEN (*mul)(void*, GEN, GEN)) -+ GEN gen_powu_fold(GEN x, ulong n, void *E, GEN (*sqr)(void*, GEN), GEN (*msqr)(void*, GEN)) -+ GEN gen_powu_fold_i(GEN x, ulong n, void *E, GEN (*sqr)(void*, GEN), GEN (*msqr)(void*, GEN)) -+ - # bibli1.c - -- GEN ZM_zc_mul(GEN x, GEN y) -- GEN ZM_zm_mul(GEN x, GEN y) -- GEN T2_from_embed(GEN x, long r1) -+ int QR_init(GEN x, GEN *pB, GEN *pQ, GEN *pL, long prec) -+ GEN R_from_QR(GEN x, long prec) -+ int RgM_QR_init(GEN x, GEN *pB, GEN *pQ, GEN *pL, long prec) -+ GEN Xadic_lindep(GEN x) - GEN algdep(GEN x, long n) - GEN algdep0(GEN x, long n, long bit) -- GEN factoredpolred(GEN x, GEN p) -- GEN factoredpolred2(GEN x, GEN p) -- GEN kerint(GEN x) -- GEN lindep(GEN x) -+ void forqfvec0(GEN a, GEN BORNE, GEN code) -+ GEN gaussred_from_QR(GEN x, long prec) - GEN lindep0(GEN x, long flag) -+ GEN lindep(GEN x) - GEN lindep2(GEN x, long bit) -- GEN lll(GEN x, long prec) -- GEN lllgen(GEN x) -- GEN lllgram(GEN x, long prec) -- GEN lllgramgen(GEN x) -- GEN lllgramint(GEN x) -- GEN lllgramkerim(GEN x) -- GEN lllgramkerimgen(GEN x) -- GEN lllint(GEN x) -- GEN lllintpartial(GEN mat) -- GEN lllkerim(GEN x) -- GEN lllkerimgen(GEN x) -- GEN matkerint0(GEN x,long flag) -+ GEN mathouseholder(GEN Q, GEN v) -+ GEN matqr(GEN x, long flag, long prec) - GEN minim(GEN a, GEN borne, GEN stockmax) -- GEN qfrep0(GEN a, GEN borne, long flag) -- GEN qfminim0(GEN a, GEN borne, GEN stockmax,long flag, long prec) -+ GEN minim_raw(GEN a, GEN borne, GEN stockmax) - GEN minim2(GEN a, GEN borne, GEN stockmax) -- GEN ordred(GEN x) -+ GEN padic_lindep(GEN x) - GEN perf(GEN a) -- GEN polred(GEN x) -- GEN polred0(GEN x, long flag, GEN p) -- GEN polred2(GEN x) -- GEN polredabs(GEN x) -- GEN polredabs0(GEN x, long flag) -- GEN polredabs2(GEN x) -- GEN polredabsall(GEN x, long flun) -- GEN polredbest(GEN x, long flag) -- GEN qflll0(GEN x, long flag) -- GEN qflllgram0(GEN x, long flag) -- GEN smallpolred(GEN x) -- GEN smallpolred2(GEN x) -- char *stackmalloc(size_t N) -- GEN zncoppersmith(GEN P0, GEN N, GEN X, GEN B) -+ GEN qfrep0(GEN a, GEN borne, long flag) -+ GEN qfminim0(GEN a, GEN borne, GEN stockmax, long flag, long prec) -+ GEN seralgdep(GEN s, long p, long r) -+ GEN zncoppersmith(GEN P0, GEN N, GEN X, GEN B) - - # bibli2.c - -+ GEN QXQ_reverse(GEN a, GEN T) -+ GEN RgV_polint(GEN X, GEN Y, long v) -+ GEN RgXQ_reverse(GEN a, GEN T) -+ GEN ZV_indexsort(GEN L) -+ long ZV_search(GEN x, GEN y) -+ GEN ZV_sort(GEN L) -+ GEN ZV_sort_uniq(GEN L) -+ GEN ZV_union_shallow(GEN x, GEN y) - GEN binomial(GEN x, long k) -+ GEN binomialuu(ulong n, ulong k) -+ int cmp_nodata(void *data, GEN x, GEN y) - int cmp_prime_ideal(GEN x, GEN y) - int cmp_prime_over_p(GEN x, GEN y) -+ int cmp_RgX(GEN x, GEN y) -+ int cmp_universal(GEN x, GEN y) - GEN convol(GEN x, GEN y) -+ int gen_cmp_RgX(void *data, GEN x, GEN y) - GEN polcyclo(long n, long v) -- GEN polcyclo_eval(long n, GEN v) -+ GEN polcyclo_eval(long n, GEN x) - GEN dirdiv(GEN x, GEN y) - GEN dirmul(GEN x, GEN y) -- GEN dirzetak(GEN nf, GEN b) -- long gen_search(GEN x, GEN y, int flag, int (*cmp)(GEN,GEN)) -- GEN gen_setminus(GEN set1, GEN set2, int (*cmp)(GEN,GEN)) -- GEN gen_sort(GEN x, int flag, int (*cmp)(GEN,GEN)) -- GEN genrand(GEN N) -- GEN getheap() -- GEN getrand() -+ GEN gen_indexsort(GEN x, void *E, int (*cmp)(void*, GEN, GEN)) -+ GEN gen_indexsort_uniq(GEN x, void *E, int (*cmp)(void*, GEN, GEN)) -+ long gen_search(GEN x, GEN y, long flag, void *data, int (*cmp)(void*, GEN, GEN)) -+ GEN gen_setminus(GEN set1, GEN set2, int (*cmp)(GEN, GEN)) -+ GEN gen_sort(GEN x, void *E, int (*cmp)(void*, GEN, GEN)) -+ void gen_sort_inplace(GEN x, void *E, int (*cmp)(void*, GEN, GEN), GEN *perm) -+ GEN gen_sort_uniq(GEN x, void *E, int (*cmp)(void*, GEN, GEN)) - long getstack() - long gettime() -+ long getabstime() - GEN gprec(GEN x, long l) -+ GEN gprec_wtrunc(GEN x, long pr) - GEN gprec_w(GEN x, long pr) -- GEN ggrando(GEN x, long n) - GEN gtoset(GEN x) - GEN indexlexsort(GEN x) - GEN indexsort(GEN x) -+ GEN indexvecsort(GEN x, GEN k) - GEN laplace(GEN x) -- GEN pollegendre(long n, long v) - GEN lexsort(GEN x) - GEN mathilbert(long n) - GEN matqpascal(long n, GEN q) -+ GEN merge_factor(GEN fx, GEN fy, void *data, int (*cmp)(void *, GEN, GEN)) -+ GEN merge_sort_uniq(GEN x, GEN y, void *data, int (*cmp)(void *, GEN, GEN)) -+ GEN modreverse(GEN x) - GEN numtoperm(long n, GEN x) - GEN permtonum(GEN x) -+ GEN polhermite(long n, long v) -+ GEN polhermite_eval(long n, GEN x) -+ GEN pollegendre(long n, long v) -+ GEN pollegendre_eval(long n, GEN x) - GEN polint(GEN xa, GEN ya, GEN x, GEN *dy) -+ GEN polchebyshev(long n, long kind, long v) -+ GEN polchebyshev_eval(long n, long kind, GEN x) -+ GEN polchebyshev1(long n, long v) -+ GEN polchebyshev2(long n, long v) - GEN polrecip(GEN x) -- GEN modreverse(GEN x) -- GEN roots_to_pol(GEN a, long v) -+ GEN setbinop(GEN f, GEN x, GEN y) - GEN setintersect(GEN x, GEN y) - long setisset(GEN x) - GEN setminus(GEN x, GEN y) -- void setrand(GEN seed) - long setsearch(GEN x, GEN y, long flag) - GEN setunion(GEN x, GEN y) -- GEN indexlexsort(GEN x) -- GEN indexsort(GEN x) - GEN sort(GEN x) -- long tablesearch(GEN T, GEN x, int (*cmp)(GEN,GEN)) -- GEN tayl(GEN x, long v, long precdl) -- GEN polchebyshev1(long n, long v) -+ GEN sort_factor(GEN y, void *data, int (*cmp)(void*, GEN, GEN)) -+ GEN stirling(long n, long m, long flag) -+ GEN stirling1(ulong n, ulong m) -+ GEN stirling2(ulong n, ulong m) -+ long tablesearch(GEN T, GEN x, int (*cmp)(GEN, GEN)) -+ GEN vecbinome(long n) -+ long vecsearch(GEN v, GEN x, GEN k) - GEN vecsort(GEN x, GEN k) - GEN vecsort0(GEN x, GEN k, long flag) -+ long zv_search(GEN x, long y) -+ -+ # bit.c -+ -+ GEN binaire(GEN x) -+ long bittest(GEN x, long n) -+ GEN gbitand(GEN x, GEN y) -+ GEN gbitneg(GEN x, long n) -+ GEN gbitnegimply(GEN x, GEN y) -+ GEN gbitor(GEN x, GEN y) -+ GEN gbittest(GEN x, long n) -+ GEN gbitxor(GEN x, GEN y) -+ long hammingweight(GEN n) -+ GEN ibitand(GEN x, GEN y) -+ GEN ibitnegimply(GEN x, GEN y) -+ GEN ibitor(GEN x, GEN y) -+ GEN ibitxor(GEN x, GEN y) - - # buch1.c - -- GEN buchimag(GEN D, GEN gcbach, GEN gcbach2, GEN gCO) -- GEN buchreal(GEN D, GEN gsens, GEN gcbach, GEN gcbach2, GEN gRELSUP, long prec) -- GEN cgetalloc(long t, size_t l) -- GEN quadclassunit0(GEN x, long flag,GEN data, long prec) -+ GEN Buchquad(GEN D, double c1, double c2, long prec) -+ GEN quadclassunit0(GEN x, long flag, GEN data, long prec) - GEN quadhilbert(GEN D, long prec) -- GEN quadray(GEN bnf, GEN f, GEN flag, long prec) -+ GEN quadray(GEN bnf, GEN f, long prec) - - # buch2.c - -- GEN bnfinit0(GEN P,long flag,GEN data,long prec) -- GEN check_and_build_obj(GEN S, int tag, GEN (*build)(GEN)) -- GEN isprincipal(GEN bignf, GEN x) -- GEN bnfisprincipal0(GEN bignf, GEN x,long flall) -- GEN isprincipalfact(GEN bnf,GEN P, GEN e, GEN C, long flag) -- GEN isprincipalforce(GEN bignf,GEN x) -- GEN isprincipalgen(GEN bignf, GEN x) -- GEN isprincipalgenforce(GEN bignf,GEN x) -+ GEN bnfcompress(GEN bnf) -+ GEN bnfinit0(GEN P, long flag, GEN data, long prec) -+ GEN bnfnewprec(GEN nf, long prec) -+ GEN bnfnewprec_shallow(GEN nf, long prec) -+ GEN bnrnewprec(GEN bnr, long prec) -+ GEN bnrnewprec_shallow(GEN bnr, long prec) -+ GEN Buchall(GEN P, long flag, long prec) -+ GEN Buchall_param(GEN P, double bach, double bach2, long nbrelpid, long flun, long prec) -+ GEN isprincipal(GEN bnf, GEN x) -+ GEN bnfisprincipal0(GEN bnf, GEN x, long flall) -+ GEN isprincipalfact(GEN bnf, GEN C, GEN L, GEN f, long flag) -+ GEN isprincipalfact_or_fail(GEN bnf, GEN C, GEN P, GEN e) - GEN bnfisunit(GEN bignf, GEN x) -- GEN regulator(GEN P,GEN data,long prec) - GEN signunits(GEN bignf) -+ GEN nfsign_units(GEN bnf, GEN archp, int add_zu) - - # buch3.c - -- GEN bnrconductor(GEN arg0,GEN arg1,GEN arg2,GEN flag) -- GEN bnrconductorofchar(GEN bnr,GEN chi) -- GEN bnrdisc0(GEN arg0, GEN arg1, GEN arg2, long flag) -- GEN bnrdisclist0(GEN bnf,GEN borne, GEN arch, long all) -- long bnrisconductor(GEN arg0,GEN arg1,GEN arg2) -+ GEN ABC_to_bnr(GEN A, GEN B, GEN C, GEN *H, int gen) -+ GEN Buchray(GEN bnf, GEN module, long flag) -+ GEN bnrclassno(GEN bignf, GEN ideal) -+ GEN bnrclassno0(GEN A, GEN B, GEN C) -+ GEN bnrclassnolist(GEN bnf, GEN listes) -+ GEN bnrconductor0(GEN A, GEN B, GEN C, long flag) -+ GEN bnrconductor(GEN bnr, GEN H0, long flag) -+ GEN bnrconductorofchar(GEN bnr, GEN chi) -+ GEN bnrdisc0(GEN A, GEN B, GEN C, long flag) -+ GEN bnrdisc(GEN bnr, GEN H, long flag) -+ GEN bnrdisclist0(GEN bnf, GEN borne, GEN arch) -+ GEN bnrinit0(GEN bignf, GEN ideal, long flag) -+ long bnrisconductor0(GEN A, GEN B, GEN C) -+ long bnrisconductor(GEN bnr, GEN H) -+ GEN bnrisprincipal(GEN bnf, GEN x, long flag) -+ GEN bnrsurjection(GEN bnr1, GEN bnr2) - GEN buchnarrow(GEN bignf) - long bnfcertify(GEN bnf) -- GEN conductor(GEN bnr,GEN subgroup,long all) -+ long bnfcertify0(GEN bnf, long flag) - GEN decodemodule(GEN nf, GEN fa) -- GEN discrayabs(GEN bnr,GEN subgroup) -- GEN discrayabscond(GEN bnr,GEN subgroup) -- GEN discrayabslist(GEN bnf,GEN listes) -- GEN discrayabslistarch(GEN bnf, GEN arch, long bound) -- GEN discrayabslistlong(GEN bnf, long bound) -- GEN discrayrel(GEN bnr,GEN subgroup) -- GEN discrayrelcond(GEN bnr,GEN subgroup) -- GEN isprincipalray(GEN bignf, GEN x) -- GEN bnrisprincipal(GEN bignf, GEN x,long flall) -- GEN isprincipalraygen(GEN bignf, GEN x) -- GEN bnrclassno(GEN bignf,GEN ideal) -- GEN bnrclassnolist(GEN bnf,GEN listes) -- GEN rnfconductor(GEN bnf, GEN polrel, long flag) -+ GEN discrayabslist(GEN bnf, GEN listes) -+ GEN discrayabslistarch(GEN bnf, GEN arch, ulong bound) -+ GEN discrayabslistlong(GEN bnf, ulong bound) -+ GEN idealmoddivisor(GEN bnr, GEN x) -+ GEN isprincipalray(GEN bnf, GEN x) -+ GEN isprincipalraygen(GEN bnf, GEN x) -+ GEN rnfconductor(GEN bnf, GEN polrel) -+ long rnfisabelian(GEN nf, GEN pol) - GEN rnfnormgroup(GEN bnr, GEN polrel) - GEN subgrouplist0(GEN bnr, GEN indexbound, long all) - -@@ -983,146 +2192,312 @@ cdef extern from 'pari/pari.h': - - GEN bnfisnorm(GEN bnf, GEN x, long flag) - GEN rnfisnorm(GEN S, GEN x, long flag) -- GEN rnfisnorminit(GEN T, GEN relpol, int galois) -- GEN bnfissunit(GEN bnf,GEN suni,GEN x) -- GEN bnfsunit(GEN bnf,GEN s,long PREC) -- long nfhilbert(GEN bnf,GEN a,GEN b) -- long nfhilbert0(GEN bnf,GEN a,GEN b,GEN p) -+ GEN rnfisnorminit(GEN bnf, GEN relpol, int galois) -+ GEN bnfissunit(GEN bnf, GEN suni, GEN x) -+ GEN bnfsunit(GEN bnf, GEN s, long PREC) -+ long nfhilbert(GEN bnf, GEN a, GEN b) -+ long nfhilbert0(GEN bnf, GEN a, GEN b, GEN p) -+ long hyperell_locally_soluble(GEN pol, GEN p) -+ long nf_hyperell_locally_soluble(GEN nf, GEN pol, GEN p) - - # compile.c - -+ GEN closure_deriv(GEN G) -+ long localvars_find(GEN pack, entree *ep) -+ GEN localvars_read_str(const char *str, GEN pack) -+ GEN snm_closure(entree *ep, GEN data) -+ GEN strtoclosure(const char *s, long n, ...) - GEN strtofunction(const char *s) - -+ # concat.c -+ -+ GEN concat(GEN x, GEN y) -+ GEN concat1(GEN x) -+ GEN matconcat(GEN v) -+ GEN shallowconcat(GEN x, GEN y) -+ GEN shallowconcat1(GEN x) -+ GEN shallowmatconcat(GEN v) -+ GEN vconcat(GEN A, GEN B) -+ - # default.c - - extern int d_SILENT, d_ACKNOWLEDGE, d_INITRC, d_RETURN -- GEN default0(char *a, char *b) -- long getrealprecision() -- GEN sd_TeXstyle(char *v, long flag) -- GEN sd_breakloop(char *v, long flag) -- GEN sd_colors(char *v, long flag) -- GEN sd_compatible(char *v, long flag) -- GEN sd_datadir(char *v, long flag) -- GEN sd_debug(char *v, long flag) -- GEN sd_debugfiles(char *v, long flag) -- GEN sd_debugmem(char *v, long flag) -- GEN sd_echo(char *v, long flag) -- GEN sd_factor_add_primes(char *v, long flag) -- GEN sd_factor_proven(char *v, long flag) -- GEN sd_format(char *v, long flag) -- GEN sd_graphcolormap(char *v, long flag) -- GEN sd_graphcolors(char *v, long flag) -- GEN sd_help(char *v, long flag) -- GEN sd_histsize(char *v, long flag) -- GEN sd_lines(char *v, long flag) -- GEN sd_log(char *v, long flag) -- GEN sd_logfile(char *v, long flag) -- GEN sd_new_galois_format(char *v, long flag) -- GEN sd_output(char *v, long flag) -- GEN sd_parisize(char *v, long flag) -- GEN sd_path(char *v, long flag) -- GEN sd_prettyprinter(char *v, long flag) -- GEN sd_primelimit(char *v, long flag) -- GEN sd_prompt(char *v, long flag) -- GEN sd_prompt_cont(char *v, long flag) -- GEN sd_psfile(char *v, long flag) -- GEN sd_realprecision(char *v, long flag) -- GEN sd_recover(char *v, long flag) -- GEN sd_rl(char *v, long flag) -- GEN sd_secure(char *v, long flag) -- GEN sd_seriesprecision(char *v, long flag) -- GEN sd_simplify(char *v, long flag) -- GEN sd_strictmatch(char *v, long flag) -- GEN sd_timer(char *v, long flag) -- long setrealprecision(long n, long *prec) -+ -+ GEN default0(const char *a, char *b) -+ long getrealprecision() -+ int pari_is_default(const char *s) -+ GEN sd_TeXstyle(const char *v, long flag) -+ GEN sd_colors(const char *v, long flag) -+ GEN sd_compatible(const char *v, long flag) -+ GEN sd_datadir(const char *v, long flag) -+ GEN sd_debug(const char *v, long flag) -+ GEN sd_debugfiles(const char *v, long flag) -+ GEN sd_debugmem(const char *v, long flag) -+ GEN sd_factor_add_primes(const char *v, long flag) -+ GEN sd_factor_proven(const char *v, long flag) -+ GEN sd_format(const char *v, long flag) -+ GEN sd_histsize(const char *v, long flag) -+ GEN sd_log(const char *v, long flag) -+ GEN sd_logfile(const char *v, long flag) -+ GEN sd_nbthreads(const char *v, long flag) -+ GEN sd_new_galois_format(const char *v, long flag) -+ GEN sd_output(const char *v, long flag) -+ GEN sd_parisize(const char *v, long flag) -+ GEN sd_path(const char *v, long flag) -+ GEN sd_prettyprinter(const char *v, long flag) -+ GEN sd_primelimit(const char *v, long flag) -+ GEN sd_realprecision(const char *v, long flag) -+ GEN sd_secure(const char *v, long flag) -+ GEN sd_seriesprecision(const char *v, long flag) -+ GEN sd_simplify(const char *v, long flag) -+ GEN sd_sopath(char *v, int flag) -+ GEN sd_strictargs(const char *v, long flag) -+ GEN sd_strictmatch(const char *v, long flag) -+ GEN sd_string(const char *v, long flag, char *s, char **f) -+ GEN sd_threadsize(const char *v, long flag) -+ GEN sd_toggle(const char *v, long flag, char *s, int *ptn) -+ GEN sd_ulong(const char *v, long flag, char *s, ulong *ptn, ulong Min, ulong Max, char **msg) -+ GEN setdefault(const char *s, char *v, long flag) -+ long setrealprecision(long n, long *prec) - - # ellanal.c - - GEN ellanalyticrank(GEN e, GEN eps, long prec) - GEN ellL1(GEN e, long r, long prec) - -+ # elldata.c -+ -+ GEN ellconvertname(GEN s) -+ GEN elldatagenerators(GEN E) -+ GEN ellidentify(GEN E) -+ GEN ellsearch(GEN A) -+ GEN ellsearchcurve(GEN name) -+ void forell(void *E, long call(void*, GEN), long a, long b) -+ - # elliptic.c - -- GEN addell(GEN e, GEN z1, GEN z2) -+ extern int t_ELL_Rg, t_ELL_Q, t_ELL_Qp, t_ELL_Fp, t_ELL_Fq - GEN akell(GEN e, GEN n) - GEN anell(GEN e, long n) -- GEN ellap(GEN e, GEN p) -+ GEN anellsmall(GEN e, long n) - GEN bilhell(GEN e, GEN z1, GEN z2, long prec) -+ void checkell(GEN e) -+ void checkell_Fq(GEN e) -+ void checkell_Q(GEN e) -+ void checkell_Qp(GEN e) -+ void checkellpt(GEN z) -+ void checkell5(GEN e) -+ GEN ellanal_globalred(GEN e, GEN *gr) -+ GEN ellQ_get_N(GEN e) -+ void ellQ_get_Nfa(GEN e, GEN *N, GEN *faN) -+ GEN ellQp_Tate_uniformization(GEN E, long prec) -+ GEN ellQp_u(GEN E, long prec) -+ GEN ellQp_u2(GEN E, long prec) -+ GEN ellQp_q(GEN E, long prec) -+ GEN ellQp_ab(GEN E, long prec) -+ GEN ellQp_root(GEN E, long prec) -+ GEN ellR_ab(GEN E, long prec) -+ GEN ellR_eta(GEN E, long prec) -+ GEN ellR_omega(GEN x, long prec) -+ GEN ellR_roots(GEN E, long prec) -+ GEN elladd(GEN e, GEN z1, GEN z2) -+ GEN ellap(GEN e, GEN p) -+ GEN ellcard(GEN E, GEN p) - GEN ellchangecurve(GEN e, GEN ch) -- GEN ellap0(GEN e, GEN p, long flag) -+ GEN elldivpol(GEN e, long n, long v) - GEN elleisnum(GEN om, long k, long flag, long prec) - GEN elleta(GEN om, long prec) -- GEN ellheight0(GEN e, GEN a, long flag,long prec) -- GEN ellinit0(GEN x,long flag,long prec) -+ GEN ellff_get_card(GEN E) -+ GEN ellff_get_gens(GEN E) -+ GEN ellff_get_group(GEN E) -+ GEN ellff_get_o(GEN x) -+ GEN ellff_get_p(GEN E) -+ GEN ellfromj(GEN j) -+ GEN ellgenerators(GEN E) -+ GEN ellglobalred(GEN e1) -+ GEN ellgroup(GEN E, GEN p) -+ GEN ellgroup0(GEN E, GEN p, long flag) -+ GEN ellheight0(GEN e, GEN a, long flag, long prec) -+ GEN ellheegner(GEN e) -+ GEN ellinit(GEN x, GEN p, long prec) -+ GEN ellisoncurve(GEN e, GEN z) -+ GEN elllseries(GEN e, GEN s, GEN A, long prec) -+ GEN elllocalred(GEN e, GEN p1) -+ GEN elllog(GEN e, GEN a, GEN g, GEN o) - GEN ellminimalmodel(GEN E, GEN *ptv) -+ GEN ellmul(GEN e, GEN z, GEN n) -+ GEN ellneg(GEN e, GEN z) -+ GEN ellorder(GEN e, GEN p, GEN o) -+ GEN ellordinate(GEN e, GEN x, long prec) -+ GEN ellperiods(GEN w, long flag, long prec) -+ GEN ellrandom(GEN e) - long ellrootno(GEN e, GEN p) -+ long ellrootno_global(GEN e) - GEN ellsigma(GEN om, GEN z, long flag, long prec) -+ GEN ellsub(GEN e, GEN z1, GEN z2) -+ GEN elltaniyama(GEN e, long prec) -+ GEN elltatepairing(GEN E, GEN t, GEN s, GEN m) - GEN elltors0(GEN e, long flag) -- GEN ellwp0(GEN e, GEN z, long flag, long precdl, long prec) -+ GEN ellweilpairing(GEN E, GEN t, GEN s, GEN m) -+ GEN ellwp(GEN w, GEN z, long prec) -+ GEN ellwp0(GEN w, GEN z, long flag, long prec) -+ GEN ellwpseries(GEN e, long v, long PRECDL) - GEN ellzeta(GEN om, GEN z, long prec) -+ GEN ellchangeinvert(GEN w) -+ GEN ellchangepoint(GEN x, GEN ch) -+ GEN ellchangepointinv(GEN x, GEN ch) -+ GEN elltors(GEN e) -+ GEN expIxy(GEN x, GEN y, long prec) -+ GEN genus2red(GEN Q, GEN P, GEN p) - GEN ghell(GEN e, GEN a, long prec) -- GEN ellglobalred(GEN e1) -- GEN elllocalred(GEN e, GEN p1) -- GEN elllseries(GEN e, GEN s, GEN A, long prec) - GEN mathell(GEN e, GEN x, long prec) - int oncurve(GEN e, GEN z) -- GEN ellordinate(GEN e, GEN x, long prec) - GEN orderell(GEN e, GEN p) -- GEN ellchangepoint(GEN x, GEN ch) - GEN pointell(GEN e, GEN z, long prec) -- GEN powell(GEN e, GEN z, GEN n) -- GEN subell(GEN e, GEN z1, GEN z2) -- GEN taniyama(GEN e) -- GEN weipell(GEN e, long precdl) - GEN zell(GEN e, GEN z, long prec) - -+ # ellsea.c -+ -+ GEN Fp_ellcard_SEA(GEN a4, GEN a6, GEN p, long early_abort) -+ GEN Fq_ellcard_SEA(GEN a4, GEN a6, GEN q, GEN T, GEN p, long early_abort) -+ GEN ellmodulareqn(long l, long vx, long vy) -+ GEN ellsea(GEN E, GEN p, long early_abort) -+ - # es.c - -+ GEN GENtoGENstr_nospace(GEN x) - GEN GENtoGENstr(GEN x) - char* GENtoTeXstr(GEN x) - char* GENtostr(GEN x) -+ char* GENtostr_unquoted(GEN x) - GEN Str(GEN g) - GEN Strchr(GEN g) - GEN Strexpand(GEN g) - GEN Strtex(GEN g) - void brute(GEN g, char format, long dec) - void dbgGEN(GEN x, long nb) -+ void error0(GEN g) -+ void dbg_pari_heap() - int file_is_binary(FILE *f) -- void gpwritebin(char *filename, GEN x) -- GEN gp_read_file(char *filename) -- GEN gp_read_str(char *s) -- void killallfiles(int check) -+ void err_flush() -+ void err_printf(const char* pat, ...) -+ GEN gp_getenv(const char *s) -+ GEN gp_read_file(char *s) - GEN gp_read_stream(FILE *f) -+ GEN gp_readvec_file(char *s) -+ GEN gp_readvec_stream(FILE *f) -+ void gpinstall(const char *s, char *code, -+ char *gpname, char *lib) -+ GEN gsprintf(const char *fmt, ...) -+ GEN gvsprintf(const char *fmt, va_list ap) -+ char* itostr(GEN x) - void matbrute(GEN g, char format, long dec) -- char* os_getenv(char *s) -+ char* os_getenv(const char *s) - void (*os_signal(int sig, void (*f)(int)))(int) - void outmat(GEN x) - void output(GEN x) -- char* pari_strdup(char *s) -- char* pari_strndup(char *s, long n) -- char* pari_unique_filename(char *s) -- void pari_unlink(char *s) -+ char* RgV_to_str(GEN g, long flag) -+ void pari_add_hist(GEN z, long t) -+ void pari_ask_confirm(const char *s) -+ void pari_fclose(pariFILE *f) - void pari_flush() -- void pari_putc(char c) -- void pari_puts(char *s) -+ pariFILE* pari_fopen(const char *s, char *mode) -+ pariFILE* pari_fopen_or_fail(const char *s, char *mode) -+ pariFILE* pari_fopengz(const char *s) -+ void pari_fprintf(FILE *file, char *fmt, ...) -+ void pari_fread_chars(void *b, size_t n, FILE *f) -+ GEN pari_get_hist(long p) -+ long pari_get_histtime(long p) -+ char* pari_get_homedir(const char *user) -+ int pari_is_dir(const char *name) -+ int pari_is_file(const char *name) - int pari_last_was_newline() - void pari_set_last_newline(int last) -- #void print(GEN g) # syntax error -+ ulong pari_nb_hist() -+ void pari_printf(const char *fmt, ...) -+ void pari_putc(char c) -+ void pari_puts(const char *s) -+ pariFILE* pari_safefopen(const char *s, char *mode) -+ char* pari_sprintf(const char *fmt, ...) -+ int pari_stdin_isatty() -+ char* pari_strdup(const char *s) -+ char* pari_strndup(const char *s, long n) -+ char* pari_unique_dir(const char *s) -+ char* pari_unique_filename(const char *s) -+ void pari_unlink(const char *s) -+ void pari_vfprintf(FILE *file, char *fmt, va_list ap) -+ void pari_vprintf(const char *fmt, va_list ap) -+ char* pari_vsprintf(const char *fmt, va_list ap) -+ char* path_expand(const char *s) -+ void out_print0(PariOUT *out, char *sep, GEN g, long flag) -+ void out_printf(PariOUT *out, char *fmt, ...) -+ void out_putc(PariOUT *out, char c) -+ void out_puts(PariOUT *out, char *s) -+ void out_term_color(PariOUT *out, long c) -+ void out_vprintf(PariOUT *out, char *fmt, va_list ap) -+ char* pari_sprint0(const char *msg, GEN g, long flag) -+ #void print(GEN g) -+ extern int f_RAW, f_PRETTYMAT, f_PRETTY, f_TEX -+ void print0(GEN g, long flag) - void print1(GEN g) -+ void printf0(const char *fmt, GEN args) -+ void printsep(const char *s, GEN g, long flag) -+ void printsep1(const char *s, GEN g, long flag) - void printtex(GEN g) -- GEN readbin(char *name, FILE *f) -- void switchin(char *name) -- void switchout(char *name) -+ char* stack_sprintf(const char *fmt, ...) -+ char* stack_strcat(const char *s, char *t) -+ char* stack_strdup(const char *s) -+ void strftime_expand(const char *s, char *buf, long max) -+ GEN Strprintf(const char *fmt, GEN args) -+ FILE* switchin(const char *name) -+ void switchout(const char *name) -+ void term_color(long c) -+ char* term_get_color(char *s, long c) - void texe(GEN g, char format, long dec) -- char* type_name(long t) -- void write0(char *s, GEN g) -- void write1(char *s, GEN g) -- void writetex(char *s, GEN g) -+ char* type_name(long t) -+ void warning0(GEN g) -+ void write0(const char *s, GEN g) -+ void write1(const char *s, GEN g) -+ void writebin(const char *name, GEN x) -+ void writetex(const char *s, GEN g) - - # eval.c - -+ extern int br_NONE, br_BREAK, br_NEXT, br_MULTINEXT, br_RETURN -+ void bincopy_relink(GEN C, GEN vi) -+ GEN break0(long n) - GEN closure_callgen1(GEN C, GEN x) -+ GEN closure_callgen2(GEN C, GEN x, GEN y) -+ GEN closure_callgenall(GEN C, long n, ...) - GEN closure_callgenvec(GEN C, GEN args) -+ void closure_callvoid1(GEN C, GEN x) -+ long closure_context(long start, long level) -+ void closure_disassemble(GEN n) -+ void closure_err(long level) -+ GEN closure_evalbrk(GEN C, long *status) -+ GEN closure_evalgen(GEN C) -+ GEN closure_evalnobrk(GEN C) -+ GEN closure_evalres(GEN C) -+ void closure_evalvoid(GEN C) -+ GEN closure_trapgen(GEN C, long numerr) -+ GEN copybin_unlink(GEN C) -+ GEN get_lex(long vn) -+ GEN gp_call(void *E, GEN x) -+ long gp_callbool(void *E, GEN x) -+ long gp_callvoid(void *E, GEN x) -+ GEN gp_eval(void *E, GEN x) -+ long gp_evalbool(void *E, GEN x) -+ GEN gp_evalupto(void *E, GEN x) -+ long gp_evalvoid(void *E, GEN x) -+ long loop_break() -+ GEN next0(long n) -+ GEN pareval(GEN C) -+ GEN parsum(GEN a, GEN b, GEN code, GEN x) -+ GEN parvector(long n, GEN code) -+ void pop_lex(long n) -+ void push_lex(GEN a, GEN C) -+ GEN return0(GEN x) -+ void set_lex(long vn, GEN x) - - # FF.c - -@@ -1133,12 +2508,22 @@ cdef extern from 'pari/pari.h': - GEN FF_Z_mul(GEN a, GEN b) - GEN FF_add(GEN a, GEN b) - GEN FF_charpoly(GEN x) -- int FF_equal0(GEN x) -- int FF_equal1(GEN x) -- int FF_equalm1(GEN x) - GEN FF_conjvec(GEN x) - GEN FF_div(GEN a, GEN b) -+ GEN FF_ellcard(GEN E) -+ GEN FF_ellgens(GEN E) -+ GEN FF_ellgroup(GEN E) -+ GEN FF_elllog(GEN E, GEN P, GEN Q, GEN o) -+ GEN FF_ellmul(GEN E, GEN P, GEN n) -+ GEN FF_ellorder(GEN E, GEN P, GEN o) -+ GEN FF_ellrandom(GEN E) -+ GEN FF_elltatepairing(GEN E, GEN P, GEN Q, GEN m) -+ GEN FF_ellweilpairing(GEN E, GEN P, GEN Q, GEN m) - int FF_equal(GEN a, GEN b) -+ int FF_equal0(GEN x) -+ int FF_equal1(GEN x) -+ int FF_equalm1(GEN x) -+ long FF_f(GEN x) - GEN FF_inv(GEN a) - long FF_issquare(GEN x) - long FF_issquareall(GEN x, GEN *pt) -@@ -1156,15 +2541,27 @@ cdef extern from 'pari/pari.h': - GEN FF_p_i(GEN x) - GEN FF_pow(GEN x, GEN n) - GEN FF_primroot(GEN x, GEN *o) -+ GEN FF_q(GEN x) - int FF_samefield(GEN x, GEN y) - GEN FF_sqr(GEN a) - GEN FF_sqrt(GEN a) - GEN FF_sqrtn(GEN x, GEN n, GEN *zetan) - GEN FF_sub(GEN x, GEN y) -+ GEN FF_to_F2xq(GEN x) -+ GEN FF_to_F2xq_i(GEN x) -+ GEN FF_to_Flxq(GEN x) -+ GEN FF_to_Flxq_i(GEN x) - GEN FF_to_FpXQ(GEN x) - GEN FF_to_FpXQ_i(GEN x) - GEN FF_trace(GEN x) - GEN FF_zero(GEN a) -+ GEN FFM_FFC_mul(GEN M, GEN C, GEN ff) -+ GEN FFM_det(GEN M, GEN ff) -+ GEN FFM_image(GEN M, GEN ff) -+ GEN FFM_inv(GEN M, GEN ff) -+ GEN FFM_ker(GEN M, GEN ff) -+ GEN FFM_mul(GEN M, GEN N, GEN ff) -+ long FFM_rank(GEN M, GEN ff) - GEN FFX_factor(GEN f, GEN x) - GEN FFX_roots(GEN f, GEN x) - GEN Z_FF_div(GEN a, GEN b) -@@ -1173,11 +2570,19 @@ cdef extern from 'pari/pari.h': - GEN fforder(GEN x, GEN o) - GEN ffprimroot(GEN x, GEN *o) - GEN ffrandom(GEN ff) -- int is_Z_factor(GEN f) -+ int Rg_is_FF(GEN c, GEN *ff) -+ int RgC_is_FFC(GEN x, GEN *ff) -+ int RgM_is_FFM(GEN x, GEN *ff) -+ GEN p_to_FF(GEN p, long v) - - # galconj.c - - GEN checkgal(GEN gal) -+ GEN checkgroup(GEN g, GEN *S) -+ GEN embed_disc(GEN r, long r1, long prec) -+ GEN embed_roots(GEN r, long r1) -+ GEN galois_group(GEN gal) -+ GEN galoisconj(GEN nf, GEN d) - GEN galoisconj0(GEN nf, long flag, GEN d, long prec) - GEN galoisexport(GEN gal, long format) - GEN galoisfixedfield(GEN gal, GEN v, long flag, long y) -@@ -1192,113 +2597,174 @@ cdef extern from 'pari/pari.h': - GEN vandermondeinverse(GEN L, GEN T, GEN den, GEN prep) - - # gen1.c -- -+ GEN conjvec(GEN x, long prec) - GEN gadd(GEN x, GEN y) - GEN gaddsg(long x, GEN y) -+ GEN gconj(GEN x) - GEN gdiv(GEN x, GEN y) -+ GEN gdivgs(GEN x, long s) -+ GEN ginv(GEN x) - GEN gmul(GEN x, GEN y) -+ GEN gmul2n(GEN x, long n) -+ GEN gmulsg(long s, GEN y) - GEN gsqr(GEN x) - GEN gsub(GEN x, GEN y) -+ GEN gsubsg(long x, GEN y) -+ GEN inv_ser(GEN b) -+ GEN mulcxI(GEN x) -+ GEN mulcxmI(GEN x) -+ GEN ser_normalize(GEN x) -+ -+ # galpol.c -+ -+ GEN galoisnbpol(long a) -+ GEN galoisgetpol(long a, long b, long s) - - # gen2.c - -- GEN ZX_mul(GEN x, GEN y) -+ GEN gassoc_proto(GEN f(GEN, GEN), GEN, GEN) -+ GEN map_proto_G(GEN f(GEN), GEN x) -+ GEN map_proto_lG(long f(GEN), GEN x) -+ GEN map_proto_lGL(long f(GEN, long), GEN x, long y) -+ -+ long Q_pval(GEN x, GEN p) -+ long Q_pvalrem(GEN x, GEN p, GEN *y) -+ long RgX_val(GEN x) -+ long RgX_valrem(GEN x, GEN *z) -+ long RgX_valrem_inexact(GEN x, GEN *Z) -+ int ZV_Z_dvd(GEN v, GEN p) -+ long ZV_pval(GEN x, GEN p) -+ long ZV_pvalrem(GEN x, GEN p, GEN *px) -+ long ZV_lval(GEN x, ulong p) -+ long ZV_lvalrem(GEN x, ulong p, GEN *px) -+ long ZX_lvalrem(GEN x, ulong p, GEN *px) -+ long ZX_lval(GEN x, ulong p) -+ long ZX_pval(GEN x, GEN p) -+ long ZX_pvalrem(GEN x, GEN p, GEN *px) -+ long Z_lval(GEN n, ulong p) -+ long Z_lvalrem(GEN n, ulong p, GEN *py) -+ long Z_lvalrem_stop(GEN *n, ulong p, int *stop) -+ long Z_pval(GEN n, GEN p) -+ long Z_pvalrem(GEN x, GEN p, GEN *py) - GEN cgetp(GEN x) -+ GEN cvstop2(long s, GEN y) - GEN cvtop(GEN x, GEN p, long l) - GEN cvtop2(GEN x, GEN y) - GEN gabs(GEN x, long prec) - void gaffect(GEN x, GEN y) - void gaffsg(long s, GEN x) -- GEN gclone(GEN x) - int gcmp(GEN x, GEN y) -- int gcmpsg(long x, GEN y) - int gequal0(GEN x) - int gequal1(GEN x) -+ int gequalX(GEN x) - int gequalm1(GEN x) -+ int gcmpsg(long x, GEN y) - GEN gcvtop(GEN x, GEN p, long r) - int gequal(GEN x, GEN y) - int gequalsg(long s, GEN x) - long gexpo(GEN x) -- long ggval(GEN x, GEN p) -+ long gvaluation(GEN x, GEN p) -+ int gidentical(GEN x, GEN y) - long glength(GEN x) - GEN gmax(GEN x, GEN y) -+ GEN gmaxgs(GEN x, long y) - GEN gmin(GEN x, GEN y) -+ GEN gmings(GEN x, long y) - GEN gneg(GEN x) - GEN gneg_i(GEN x) -- GEN greffe(GEN x, long l, long use_stack) -+ GEN RgX_to_ser(GEN x, long l) -+ GEN RgX_to_ser_inexact(GEN x, long l) - int gsigne(GEN x) -- GEN gtofp(GEN z, long prec) - GEN gtolist(GEN x) - long gtolong(GEN x) - int lexcmp(GEN x, GEN y) -- GEN listcreate() - GEN listinsert(GEN list, GEN object, long index) -- void listkill(GEN list) -+ void listpop(GEN L, long index) - GEN listput(GEN list, GEN object, long index) -- GEN listsort(GEN list, long flag) -+ void listsort(GEN list, long flag) - GEN matsize(GEN x) -+ GEN mklistcopy(GEN x) - GEN normalize(GEN x) - GEN normalizepol(GEN x) -+ GEN normalizepol_approx(GEN x, long lx) -+ GEN normalizepol_lg(GEN x, long lx) -+ ulong padic_to_Fl(GEN x, ulong p) -+ GEN padic_to_Fp(GEN x, GEN Y) -+ GEN quadtofp(GEN x, long l) -+ GEN rfrac_to_ser(GEN x, long l) - long sizedigit(GEN x) - long u_lval(ulong x, ulong p) - long u_lvalrem(ulong x, ulong p, ulong *py) -+ long u_lvalrem_stop(ulong *n, ulong p, int *stop) -+ long u_pval(ulong x, GEN p) - long u_pvalrem(ulong x, GEN p, ulong *py) -+ long vecindexmax(GEN x) -+ long vecindexmin(GEN x) -+ GEN vecmax0(GEN x, GEN *pv) - GEN vecmax(GEN x) -+ GEN vecmin0(GEN x, GEN *pv) - GEN vecmin(GEN x) -- long Z_lval(GEN n, ulong p) -- long Z_lvalrem(GEN n, ulong p, GEN *py) -+ long z_lval(long s, ulong p) -+ long z_lvalrem(long s, ulong p, long *py) - long z_pval(long n, GEN p) -- long Z_pval(GEN n, GEN p) -- long Z_pvalrem(GEN x, GEN p, GEN *py) -+ long z_pvalrem(long n, GEN p, long *py) - - # gen3.c - -+ GEN padic_to_Q(GEN x) -+ GEN padic_to_Q_shallow(GEN x) -+ GEN QpV_to_QV(GEN v) -+ GEN RgM_mulreal(GEN x, GEN y) -+ GEN RgX_RgM_eval_col(GEN x, GEN M, long c) -+ GEN RgX_deflate_max(GEN x0, long *m) -+ GEN RgX_integ(GEN x) - GEN ceil_safe(GEN x) - GEN ceilr(GEN x) - GEN centerlift(GEN x) -- GEN centerlift0(GEN x,long v) -+ GEN centerlift0(GEN x, long v) - GEN compo(GEN x, long n) -- GEN deg1pol(GEN x1, GEN x0,long v) -+ GEN deg1pol(GEN x1, GEN x0, long v) -+ GEN deg1pol_shallow(GEN x1, GEN x0, long v) - long degree(GEN x) - GEN denom(GEN x) - GEN deriv(GEN x, long v) -- GEN RgX_deriv(GEN x) - GEN derivser(GEN x) -+ GEN diffop(GEN x, GEN v, GEN dv) -+ GEN diffop0(GEN x, GEN v, GEN dv, long n) - GEN diviiround(GEN x, GEN y) - GEN divrem(GEN x, GEN y, long v) -- GEN gand(GEN x, GEN y) -+ GEN floor_safe(GEN x) - GEN gceil(GEN x) - GEN gcvtoi(GEN x, long *e) -+ GEN gdeflate(GEN x, long v, long d) - GEN gdivent(GEN x, GEN y) -+ GEN gdiventgs(GEN x, long y) -+ GEN gdiventsg(long x, GEN y) - GEN gdiventres(GEN x, GEN y) -- GEN gdivgs(GEN x, long s) - GEN gdivmod(GEN x, GEN y, GEN *pr) - GEN gdivround(GEN x, GEN y) -+ int gdvd(GEN x, GEN y) - GEN geq(GEN x, GEN y) - GEN geval(GEN x) - GEN gfloor(GEN x) -+ GEN gtrunc2n(GEN x, long s) - GEN gfrac(GEN x) - GEN gge(GEN x, GEN y) - GEN ggrando(GEN x, long n) - GEN ggt(GEN x, GEN y) - GEN gimag(GEN x) -- GEN ginv(GEN x) - GEN gle(GEN x, GEN y) - GEN glt(GEN x, GEN y) - GEN gmod(GEN x, GEN y) -- GEN gmodulo(GEN x,GEN y) - GEN gmodgs(GEN x, long y) -- GEN gmodulo(GEN x,GEN y) -+ GEN gmodsg(long x, GEN y) -+ GEN gmodulo(GEN x, GEN y) - GEN gmodulsg(long x, GEN y) - GEN gmodulss(long x, long y) -- GEN gmul2n(GEN x, long n) -- GEN gmulsg(long s, GEN y) - GEN gne(GEN x, GEN y) - GEN gnot(GEN x) -- GEN gor(GEN x, GEN y) - GEN gpolvar(GEN y) - long gprecision(GEN x) -- GEN gram_matrix(GEN M) - GEN greal(GEN x) - GEN grndtoi(GEN x, long *e) - GEN ground(GEN x) -@@ -1308,6 +2774,8 @@ cdef extern from 'pari/pari.h': - GEN gsubstvec(GEN x, GEN v, GEN y) - GEN gtocol(GEN x) - GEN gtocol0(GEN x, long n) -+ GEN gtocolrev(GEN x) -+ GEN gtocolrev0(GEN x, long n) - GEN gtopoly(GEN x, long v) - GEN gtopolyrev(GEN x, long v) - GEN gtoser(GEN x, long v, long precdl) -@@ -1318,106 +2786,288 @@ cdef extern from 'pari/pari.h': - GEN gtovecsmall(GEN x) - GEN gtovecsmall0(GEN x, long n) - GEN gtrunc(GEN x) -- int gvar(GEN x) -- int gvar2(GEN x) -+ long gvar(GEN x) -+ long gvar2(GEN x) - GEN hqfeval(GEN q, GEN x) - GEN imag_i(GEN x) -- GEN int2n(long n) - GEN integ(GEN x, long v) -+ GEN integser(GEN x) - int iscomplex(GEN x) - int isexactzero(GEN g) -+ int isrationalzeroscalar(GEN g) - int isinexact(GEN x) - int isinexactreal(GEN x) -- long isint(GEN n, long *ptk) -+ int isint(GEN n, GEN *ptk) -+ int isrationalzero(GEN g) - int issmall(GEN n, long *ptk) - GEN lift(GEN x) -- GEN lift0(GEN x,long v) -- GEN lift_intern0(GEN x,long v) -- GEN truncr(GEN x) -+ GEN lift0(GEN x, long v) -+ GEN liftall(GEN x) -+ GEN liftall_shallow(GEN x) -+ GEN liftint(GEN x) -+ GEN liftint_shallow(GEN x) -+ GEN liftpol(GEN x) -+ GEN liftpol_shallow(GEN x) - GEN mkcoln(long n, ...) - GEN mkintn(long n, ...) - GEN mkpoln(long n, ...) - GEN mkvecn(long n, ...) -+ GEN mkvecsmalln(long n, ...) -+ GEN mulreal(GEN x, GEN y) - GEN numer(GEN x) -- GEN padicappr(GEN f, GEN a) - long padicprec(GEN x, GEN p) -- GEN polcoeff0(GEN x,long n,long v) -+ long padicprec_relative(GEN x) -+ GEN polcoeff0(GEN x, long n, long v) - GEN polcoeff_i(GEN x, long n, long v) -- long poldegree(GEN x,long v) -+ long poldegree(GEN x, long v) -+ long RgX_degree(GEN x, long v) - GEN poleval(GEN x, GEN y) -- GEN pollead(GEN x,long v) -+ GEN pollead(GEN x, long v) - long precision(GEN x) -- GEN precision0(GEN x,long n) -+ GEN precision0(GEN x, long n) -+ GEN qf_apply_RgM(GEN q, GEN M) -+ GEN qf_apply_ZM(GEN q, GEN M) -+ GEN qfbil(GEN x, GEN y, GEN q) - GEN qfeval(GEN q, GEN x) -+ GEN qfevalb(GEN q, GEN x, GEN y) -+ GEN qfnorm(GEN x, GEN q) - GEN real_i(GEN x) -- GEN real2n(long n, long prec) -- GEN recip(GEN x) - GEN round0(GEN x, GEN *pte) - GEN roundr(GEN x) -+ GEN roundr_safe(GEN x) - GEN scalarpol(GEN x, long v) -+ GEN scalarpol_shallow(GEN x, long v) - GEN scalarser(GEN x, long v, long prec) -+ GEN ser_unscale(GEN P, GEN h) -+ GEN serreverse(GEN x) - GEN simplify(GEN x) -+ GEN simplify_shallow(GEN x) - GEN tayl(GEN x, long v, long precdl) - GEN toser_i(GEN x) - GEN trunc0(GEN x, GEN *pte) -+ GEN uu32toi(ulong a, ulong b) - - # groupid.c - - long group_ident(GEN G, GEN S) -+ long group_ident_trans(GEN G, GEN S) - - # hash.c - -- ulong hash_GEN(GEN x) -+ hashtable *hash_create(ulong minsize, ulong (*hash)(void*), int (*eq)(void*, void*), int use_stack) -+ void hash_insert(hashtable *h, void *k, void *v) -+ hashentry *hash_search(hashtable *h, void *k) -+ hashentry *hash_remove(hashtable *h, void *k) -+ void hash_destroy(hashtable *h) -+ ulong hash_str(const char *str) -+ ulong hash_str2(const char *s) -+ ulong hash_GEN(GEN x) -+ -+ # hnf_snf.c -+ -+ GEN Frobeniusform(GEN V, long n) -+ GEN RgM_hnfall(GEN A, GEN *pB, long remove) -+ GEN ZM_hnf(GEN x) -+ GEN ZM_hnfall(GEN A, GEN *ptB, long remove) -+ GEN ZM_hnfcenter(GEN M) -+ GEN ZM_hnflll(GEN A, GEN *ptB, int remove) -+ GEN ZV_gcdext(GEN A) -+ GEN ZM_hnfmod(GEN x, GEN d) -+ GEN ZM_hnfmodall(GEN x, GEN dm, long flag) -+ GEN ZM_hnfmodid(GEN x, GEN d) -+ GEN ZM_hnfperm(GEN A, GEN *ptU, GEN *ptperm) -+ void ZM_snfclean(GEN d, GEN u, GEN v) -+ GEN ZM_snf(GEN x) -+ GEN ZM_snf_group(GEN H, GEN *newU, GEN *newUi) -+ GEN ZM_snfall(GEN x, GEN *ptU, GEN *ptV) -+ GEN ZM_snfall_i(GEN x, GEN *ptU, GEN *ptV, int return_vec) -+ GEN zlm_echelon(GEN x, long early_abort, ulong p, ulong pm) -+ GEN ZpM_echelon(GEN x, long early_abort, GEN p, GEN pm) -+ GEN gsmith(GEN x) -+ GEN gsmithall(GEN x) -+ GEN hnf(GEN x) -+ GEN hnf_divscale(GEN A, GEN B, GEN t) -+ GEN hnf_solve(GEN A, GEN B) -+ GEN hnf_invimage(GEN A, GEN b) -+ GEN hnfall(GEN x) -+ int hnfdivide(GEN A, GEN B) -+ GEN hnflll(GEN x) -+ GEN hnfmerge_get_1(GEN A, GEN B) -+ GEN hnfmod(GEN x, GEN d) -+ GEN hnfmodid(GEN x, GEN p) -+ GEN hnfperm(GEN x) -+ GEN matfrobenius(GEN M, long flag, long v) -+ GEN mathnf0(GEN x, long flag) -+ GEN matsnf0(GEN x, long flag) -+ GEN smith(GEN x) -+ GEN smithall(GEN x) -+ GEN smithclean(GEN z) - - # ifactor1.c - -+ GEN Z_factor(GEN n) -+ GEN Z_factor_limit(GEN n, ulong all) -+ GEN Z_factor_until(GEN n, GEN limit) -+ long Z_issmooth(GEN m, ulong lim) -+ GEN Z_issmooth_fact(GEN m, ulong lim) -+ long Z_issquarefree(GEN x) -+ GEN absi_factor(GEN n) -+ GEN absi_factor_limit(GEN n, ulong all) -+ long bigomega(GEN n) -+ GEN core(GEN n) -+ ulong coreu(ulong n) -+ GEN eulerphi(GEN n) -+ ulong eulerphiu(ulong n) -+ ulong eulerphiu_fact(GEN f) -+ GEN factorint(GEN n, long flag) -+ GEN factoru(ulong n) -+ int ifac_isprime(GEN x) -+ int ifac_next(GEN *part, GEN *p, long *e) -+ int ifac_read(GEN part, GEN *p, long *e) -+ void ifac_skip(GEN part) -+ GEN ifac_start(GEN n, int moebius) - int is_357_power(GEN x, GEN *pt, ulong *mask) -- int is_pth_power(GEN x, GEN *pt, ulong *curexp, ulong cutoffbits) -+ int is_pth_power(GEN x, GEN *pt, forprime_t *T, ulong cutoffbits) -+ long ispowerful(GEN n) -+ long issquarefree(GEN x) -+ long istotient(GEN n, GEN *px) -+ long moebius(GEN n) -+ long moebiusu(ulong n) - GEN nextprime(GEN n) -+ GEN numdiv(GEN n) -+ long omega(GEN n) - GEN precprime(GEN n) -+ GEN sumdiv(GEN n) -+ GEN sumdivk(GEN n, long k) -+ ulong tridiv_bound(GEN n) -+ int uis_357_power(ulong x, ulong *pt, ulong *mask) -+ int uis_357_powermod(ulong x, ulong *mask) -+ long uissquarefree(ulong n) -+ long uissquarefree_fact(GEN f) -+ ulong unextprime(ulong n) -+ ulong uprecprime(ulong n) -+ GEN usumdivkvec(ulong n, GEN K) - - # init.c - -- long allocatemoremem(size_t newsize) -- GEN changevar(GEN x, GEN y) -- void pari_err(long numerr, ...) -- long err_catch(long errnum, jmp_buf *penv) -+ void allocatemem(ulong newsize) -+ long timer_delay(pari_timer *T) -+ long timer_get(pari_timer *T) -+ void timer_start(pari_timer *T) -+ int chk_gerepileupto(GEN x) -+ GENbin* copy_bin(GEN x) -+ GENbin* copy_bin_canon(GEN x) -+ void dbg_gerepile(pari_sp av) -+ void dbg_gerepileupto(GEN q) -+ GEN errname(GEN err) -+ GEN gclone(GEN x) -+ GEN gcloneref(GEN x) -+ void gclone_refc(GEN x) - GEN gcopy(GEN x) - GEN gcopy_avma(GEN x, pari_sp *AVMA) -+ GEN gcopy_lg(GEN x, long lx) -+ GEN gerepile(pari_sp ltop, pari_sp lbot, GEN q) -+ void gerepileallsp(pari_sp av, pari_sp tetpil, int n, ...) -+ void gerepilecoeffssp(pari_sp av, pari_sp tetpil, long *g, int n) -+ void gerepilemanysp(pari_sp av, pari_sp tetpil, GEN* g[], int n) -+ GEN getheap() -+ void gp_context_save(gp_context* rec) -+ void gp_context_restore(gp_context* rec) -+ long gsizeword(GEN x) -+ long gsizebyte(GEN x) - void gunclone(GEN x) -- void msgtimer(char *format, ...) -- GEN newblock(long n) -+ void gunclone_deep(GEN x) -+ GEN listcopy(GEN x) -+ void timer_printf(pari_timer *T, char *format, ...) -+ void msgtimer(const char *format, ...) -+ long name_numerr(const char *s) -+ GEN newblock(size_t n) -+ char * numerr_name(long errnum) -+ GEN obj_check(GEN S, long K) -+ GEN obj_checkbuild(GEN S, long tag, GEN (*build)(GEN)) -+ GEN obj_checkbuild_padicprec(GEN S, long tag, GEN (*build)(GEN, long), long prec) -+ GEN obj_checkbuild_prec(GEN S, long tag, GEN (*build)(GEN, long), long prec) -+ void obj_free(GEN S) -+ GEN obj_init(long d, long n) -+ GEN obj_insert(GEN S, long K, GEN O) -+ GEN obj_insert_shallow(GEN S, long K, GEN O) -+ void pari_add_function(entree *ep) -+ void pari_add_module(entree *ep) -+ void pari_add_defaults_module(entree *ep) -+ void pari_add_oldmodule(entree *ep) - void pari_close() -- void pari_init(size_t parisize, ulong maxprime) -+ void pari_close_opts(ulong init_opts) -+ int pari_daemon() -+ void pari_err(int numerr, ...) -+ GEN pari_err_last() -+ char * pari_err2str(GEN err) - void pari_init_opts(size_t parisize, ulong maxprime, ulong init_opts) -- long gsizebyte(GEN x) -- long gsizeword(GEN x) -+ void pari_init(size_t parisize, ulong maxprime) -+ void pari_stackcheck_init(void *pari_stack_base) -+ void pari_sig_init(void (*f)(int)) -+ void pari_thread_alloc(pari_thread *t, size_t s, GEN arg) -+ void pari_thread_close() -+ void pari_thread_free(pari_thread *t) -+ void pari_thread_init() -+ GEN pari_thread_start(pari_thread *t) -+ GEN pari_version() -+ void pari_warn(int numerr, ...) -+ GEN trap0(const char *e, GEN f, GEN r) -+ void shiftaddress(GEN x, long dec) -+ void shiftaddress_canon(GEN x, long dec) - long timer() - long timer2() -+ void traverseheap( void(*f)(GEN, void *), void *data ) - - # intnum.c - -- GEN intcirc(void *E, GEN (*eval) (GEN, void *), GEN a, GEN R, GEN tab, long prec) -- GEN intfouriercos(void *E, GEN (*eval) (GEN, void *), GEN a, GEN b, GEN x, GEN tab, long prec) -- GEN intfourierexp(void *E, GEN (*eval)(GEN, void*), GEN a, GEN b, GEN x, GEN tab, long prec) -- GEN intfouriersin(void *E, GEN (*eval) (GEN, void *), GEN a, GEN b, GEN x, GEN tab, long prec) -- GEN intfuncinit(void *E, GEN (*eval) (GEN, void *), GEN a, GEN b, long m, long flag, long prec) -- GEN intlaplaceinv(void *E, GEN (*eval) (GEN, void *), GEN sig, GEN x, GEN tab, long prec) -- GEN intmellininv(void *E, GEN (*eval) (GEN, void *), GEN sig, GEN x, GEN tab, long prec) -+ GEN intcirc(void *E, GEN (*eval) (void *, GEN), GEN a, GEN R, GEN tab, long prec) -+ GEN intfouriercos(void *E, GEN (*eval) (void *, GEN), GEN a, GEN b, GEN x, GEN tab, long prec) -+ GEN intfourierexp(void *E, GEN (*eval)(void *, GEN), GEN a, GEN b, GEN x, GEN tab, long prec) -+ GEN intfouriersin(void *E, GEN (*eval) (void *, GEN), GEN a, GEN b, GEN x, GEN tab, long prec) -+ GEN intfuncinit(void *E, GEN (*eval) (void *, GEN), GEN a, GEN b, long m, long flag, long prec) -+ GEN intlaplaceinv(void *E, GEN (*eval) (void *, GEN), GEN sig, GEN x, GEN tab, long prec) -+ GEN intmellininv(void *E, GEN (*eval) (void *, GEN), GEN sig, GEN x, GEN tab, long prec) - GEN intmellininvshort(GEN sig, GEN x, GEN tab, long prec) -- GEN intnum(void *E, GEN (*eval) (GEN, void *), GEN a, GEN b, GEN tab, long prec) -+ GEN intnum(void *E, GEN (*eval) (void *, GEN), GEN a, GEN b, GEN tab, long prec) - GEN intnuminit(GEN a, GEN b, long m, long prec) -- GEN intnuminitgen(void *E, GEN (*eval) (GEN, void *), GEN a, GEN b, long m, long flext, long prec) -- GEN intnumromb(void *E, GEN (*eval) (GEN, void *), GEN a, GEN b, long flag, long prec) -+ GEN intnuminitgen(void *E, GEN (*eval) (void *, GEN), GEN a, GEN b, long m, long flext, long prec) -+ GEN intnumromb(void *E, GEN (*eval) (void *, GEN), GEN a, GEN b, long flag, long prec) - long intnumstep(long prec) -- GEN sumnum(void *E, GEN (*f) (GEN, void *), GEN a, GEN sig, GEN tab, long flag, long prec) -- GEN sumnumalt(void *E, GEN (*f) (GEN, void *), GEN a, GEN s, GEN tab, long flag, long prec) -+ GEN sumnum(void *E, GEN (*f) (void *, GEN), GEN a, GEN sig, GEN tab, long flag, long prec) -+ GEN sumnumalt(void *E, GEN (*f) (void *, GEN), GEN a, GEN s, GEN tab, long flag, long prec) - GEN sumnuminit(GEN sig, long m, long sgn, long prec) - -+ # krasner.c -+ -+ GEN padicfields0(GEN p, GEN n, long flag) -+ GEN padicfields(GEN p, long m, long d, long flag) -+ - # kummer.c - - GEN rnfkummer(GEN bnr, GEN subgroup, long all, long prec) - -+ # lll.c -+ -+ GEN ZM_lll_norms(GEN x, double D, long flag, GEN *B) -+ GEN kerint(GEN x) -+ GEN lll(GEN x) -+ GEN lllfp(GEN x, double D, long flag) -+ GEN lllgen(GEN x) -+ GEN lllgram(GEN x) -+ GEN lllgramgen(GEN x) -+ GEN lllgramint(GEN x) -+ GEN lllgramkerim(GEN x) -+ GEN lllgramkerimgen(GEN x) -+ GEN lllint(GEN x) -+ GEN lllintpartial(GEN mat) -+ GEN lllintpartial_inplace(GEN mat) -+ GEN lllkerim(GEN x) -+ GEN lllkerimgen(GEN x) -+ GEN matkerint0(GEN x, long flag) -+ GEN qflll0(GEN x, long flag) -+ GEN qflllgram0(GEN x, long flag) -+ - # members.c - - GEN member_a1(GEN x) -@@ -1430,6 +3080,7 @@ cdef extern from 'pari/pari.h': - GEN member_b4(GEN x) - GEN member_b6(GEN x) - GEN member_b8(GEN x) -+ GEN member_bid(GEN x) - GEN member_bnf(GEN x) - GEN member_c4(GEN x) - GEN member_c6(GEN x) -@@ -1454,19 +3105,26 @@ cdef extern from 'pari/pari.h': - GEN member_orders(GEN x) - GEN member_p(GEN x) - GEN member_pol(GEN x) -+ GEN member_polabs(GEN x) - GEN member_reg(GEN x) -+ GEN member_r1(GEN x) -+ GEN member_r2(GEN x) - GEN member_roots(GEN x) - GEN member_sign(GEN x) - GEN member_t2(GEN x) - GEN member_tate(GEN x) - GEN member_tufu(GEN x) - GEN member_tu(GEN x) -- GEN member_w(GEN x) - GEN member_zk(GEN x) - GEN member_zkst(GEN bid) - - # mp.c - -+ GEN addmulii(GEN x, GEN y, GEN z) -+ GEN addmulii_inplace(GEN x, GEN y, GEN z) -+ ulong Fl_inv(ulong x, ulong p) -+ ulong Fl_invsafe(ulong x, ulong p) -+ int Fp_ratlift(GEN x, GEN m, GEN amax, GEN bmax, GEN *a, GEN *b) - int absi_cmp(GEN x, GEN y) - int absi_equal(GEN x, GEN y) - int absr_cmp(GEN x, GEN y) -@@ -1474,35 +3132,44 @@ cdef extern from 'pari/pari.h': - GEN addir_sign(GEN x, long sx, GEN y, long sy) - GEN addrr_sign(GEN x, long sx, GEN y, long sy) - GEN addsi_sign(long x, GEN y, long sy) -+ GEN addui_sign(ulong x, GEN y, long sy) - GEN addsr(long x, GEN y) -- GEN addss(long x, long y) -+ GEN addumului(ulong a, ulong b, GEN Y) - void affir(GEN x, GEN y) - void affrr(GEN x, GEN y) - GEN bezout(GEN a, GEN b, GEN *u, GEN *v) -- long cbezout(long a,long b,long *uu,long *vv) -+ long cbezout(long a, long b, long *uu, long *vv) - int cmpii(GEN x, GEN y) - int cmprr(GEN x, GEN y) -- int cmpsi(long x, GEN y) -- int cmpui(ulong x, GEN y) -+ long dblexpo(double x) -+ ulong dblmantissa(double x) - GEN dbltor(double x) - GEN diviiexact(GEN x, GEN y) -- GEN diviuexact(GEN x, ulong y) - GEN divir(GEN x, GEN y) - GEN divis(GEN y, long x) - GEN divis_rem(GEN x, long y, long *rem) - GEN diviu_rem(GEN y, ulong x, ulong *rem) -+ GEN diviuuexact(GEN x, ulong y, ulong z) -+ GEN diviuexact(GEN x, ulong y) - GEN divri(GEN x, GEN y) - GEN divrr(GEN x, GEN y) - GEN divrs(GEN x, long y) -+ GEN divru(GEN x, ulong y) - GEN divsi(long x, GEN y) - GEN divsr(long x, GEN y) -+ GEN divur(ulong x, GEN y) - GEN dvmdii(GEN x, GEN y, GEN *z) - int equalii(GEN x, GEN y) -+ int equalrr(GEN x, GEN y) - GEN floorr(GEN x) - GEN gcdii(GEN x, GEN y) -+ GEN int2n(long n) -+ GEN int2u(ulong n) - GEN int_normalize(GEN x, long known_zero_words) - int invmod(GEN a, GEN b, GEN *res) -- ulong Fl_inv(ulong x, ulong p) -+ ulong invmod2BIL(ulong b) -+ GEN invr(GEN b) -+ GEN mantissa_real(GEN x, long *e) - GEN modii(GEN x, GEN y) - void modiiz(GEN x, GEN y, GEN z) - GEN mulii(GEN x, GEN y) -@@ -1514,29 +3181,58 @@ cdef extern from 'pari/pari.h': - GEN mului(ulong x, GEN y) - GEN mulur(ulong x, GEN y) - GEN muluu(ulong x, ulong y) -- GEN randomi(GEN x) -- int ratlift(GEN x, GEN m, GEN *a, GEN *b, GEN amax, GEN bmax) -+ GEN muluui(ulong x, ulong y, GEN z) -+ GEN remi2n(GEN x, long n) - double rtodbl(GEN x) - GEN shifti(GEN x, long n) - GEN sqri(GEN x) -- #define sqrti(x) sqrtremi((x),NULL) -+ GEN sqrr(GEN x) -+ GEN sqrs(long x) -+ GEN sqrtr_abs(GEN x) - GEN sqrtremi(GEN S, GEN *R) -+ GEN sqru(ulong x) - GEN subsr(long x, GEN y) - GEN truedvmdii(GEN x, GEN y, GEN *z) -+ GEN truedvmdis(GEN x, long y, GEN *z) -+ GEN truedvmdsi(long x, GEN y, GEN *z) -+ GEN trunc2nr(GEN x, long n) -+ GEN mantissa2nr(GEN x, long n) -+ GEN truncr(GEN x) - ulong umodiu(GEN y, ulong x) - long vals(ulong x) - - # nffactor.c - -- GEN nffactor(GEN nf,GEN x) -- GEN nffactormod(GEN nf,GEN pol,GEN pr) -- GEN nfroots(GEN nf,GEN pol) -- GEN rnfcharpoly(GEN nf,GEN T,GEN alpha,int n) -- GEN rnfdedekind(GEN nf,GEN T,GEN pr) -+ GEN FpC_ratlift(GEN P, GEN mod, GEN amax, GEN bmax, GEN denom) -+ GEN FpM_ratlift(GEN M, GEN mod, GEN amax, GEN bmax, GEN denom) -+ GEN FpX_ratlift(GEN P, GEN mod, GEN amax, GEN bmax, GEN denom) -+ GEN nffactor(GEN nf, GEN x) -+ GEN nffactormod(GEN nf, GEN pol, GEN pr) -+ GEN nfgcd(GEN P, GEN Q, GEN nf, GEN den) -+ GEN nfgcd_all(GEN P, GEN Q, GEN T, GEN den, GEN *Pnew) -+ GEN nfroots(GEN nf, GEN pol) -+ GEN polfnf(GEN a, GEN t) -+ GEN rootsof1(GEN x) -+ GEN rootsof1_kannan(GEN nf) -+ -+ # paricfg.c -+ -+ extern char *paricfg_datadir -+ extern char *paricfg_version -+ extern char *paricfg_buildinfo -+ extern long paricfg_version_code -+ extern char *paricfg_vcsversion -+ extern char *paricfg_compiledate -+ extern char *paricfg_mt_engine - - # part.c - -+ void forpart(void *E, long call(void*, GEN), long k, GEN nbound, GEN abound) -+ void forpart_init(forpart_t *T, long k, GEN abound, GEN nbound) -+ GEN forpart_next(forpart_t *T) -+ GEN forpart_prev(forpart_t *T) - GEN numbpart(GEN x) -+ GEN partitions(long k, GEN nbound, GEN abound) - - # perm.c - -@@ -1557,234 +3253,293 @@ cdef extern from 'pari/pari.h': - long group_perm_normalize(GEN N, GEN g) - GEN group_quotient(GEN G, GEN H) - GEN group_rightcoset(GEN G, GEN g) -+ GEN group_set(GEN G, long n) -+ long group_subgroup_isnormal(GEN G, GEN H) - GEN group_subgroups(GEN G) -- GEN groupelts_center(GEN S) - GEN groupelts_abelian_group(GEN S) -+ GEN groupelts_center(GEN S) -+ GEN groupelts_set(GEN G, long n) - int perm_commute(GEN p, GEN q) - GEN perm_cycles(GEN v) - long perm_order(GEN perm) - GEN perm_pow(GEN perm, long exp) - GEN quotient_group(GEN C, GEN G) - GEN quotient_perm(GEN C, GEN p) -+ GEN quotient_subgroup_lift(GEN C, GEN H, GEN S) -+ GEN subgroups_tableset(GEN S, long n) -+ long tableset_find_index(GEN tbl, GEN set) -+ GEN trivialgroup() - GEN vecperm_orbits(GEN v, long n) -+ GEN vec_insert(GEN v, long n, GEN x) -+ int vec_is1to1(GEN v) -+ int vec_isconst(GEN v) -+ long vecsmall_duplicate(GEN x) -+ long vecsmall_duplicate_sorted(GEN x) -+ GEN vecsmall_indexsort(GEN V) - void vecsmall_sort(GEN V) - GEN vecsmall_uniq(GEN V) -+ GEN vecsmall_uniq_sorted(GEN V) - GEN vecvecsmall_indexsort(GEN x) -- GEN vecvecsmall_sort(GEN x) - long vecvecsmall_search(GEN x, GEN y, long flag) -+ GEN vecvecsmall_sort(GEN x) -+ GEN vecvecsmall_sort_uniq(GEN x) -+ -+ # mt.c -+ -+ void mt_broadcast(GEN code) -+ void mt_sigint_block() -+ void mt_sigint_unblock() -+ void mt_queue_end(pari_mt *pt) -+ GEN mt_queue_get(pari_mt *pt, long *jobid, long *pending) -+ void mt_queue_start(pari_mt *pt, GEN worker) -+ void mt_queue_submit(pari_mt *pt, long jobid, GEN work) -+ void pari_mt_init() -+ void pari_mt_close() - - # polarit1.c - -- long Flx_nbfact(GEN z, ulong p) -- long Flx_nbroots(GEN f, ulong p) -- GEN FpX_degfact(GEN f, GEN p) -- long FpX_is_irred(GEN f, GEN p) -- long FpX_is_squarefree(GEN f, GEN p) -- long FpX_is_totally_split(GEN f, GEN p) -- GEN FpX_factor(GEN f, GEN p) -- long FpX_nbfact(GEN f, GEN p) -- long FpX_nbroots(GEN f, GEN p) -- GEN FpXQX_gcd(GEN P, GEN Q, GEN T, GEN p) -- GEN FqX_factor(GEN x, GEN T, GEN p) -- GEN FqX_gcd(GEN P, GEN Q, GEN T, GEN p) -- long FqX_is_squarefree(GEN P, GEN T, GEN p) -- long FqX_nbfact(GEN u, GEN T, GEN p) -- long FqX_nbroots(GEN f, GEN T, GEN p) -- GEN random_FpX(long d, long v, GEN p) -- GEN FpX_roots(GEN f, GEN p) -- GEN padicappr(GEN f, GEN a) -- GEN factcantor(GEN x, GEN p) -- GEN factmod(GEN f, GEN p) -- GEN factorff(GEN f, GEN p, GEN a) -- GEN factormod0(GEN f, GEN p, long flag) -- GEN factorpadic0(GEN f,GEN p,long r,long flag) -+ GEN ZX_Zp_root(GEN f, GEN a, GEN p, long prec) -+ GEN Zp_appr(GEN f, GEN a) -+ GEN factorpadic0(GEN f, GEN p, long r, long flag) - GEN factorpadic(GEN x, GEN p, long r) -- int gdvd(GEN x, GEN y) -+ GEN gdeuc(GEN x, GEN y) -+ GEN grem(GEN x, GEN y) -+ GEN padicappr(GEN f, GEN a) - GEN poldivrem(GEN x, GEN y, GEN *pr) -- GEN rootmod(GEN f, GEN p) -- GEN rootmod0(GEN f, GEN p,long flag) -- GEN rootmod2(GEN f, GEN p) - GEN rootpadic(GEN f, GEN p, long r) - GEN rootpadicfast(GEN f, GEN p, long e) -- GEN simplefactmod(GEN f, GEN p) - - # polarit2.c - - GEN Q_content(GEN x) - GEN Q_denom(GEN x) - GEN Q_div_to_int(GEN x, GEN c) -+ GEN Q_gcd(GEN x, GEN y) -+ GEN Q_mul_to_int(GEN x, GEN c) - GEN Q_muli_to_int(GEN x, GEN d) - GEN Q_primitive_part(GEN x, GEN *ptc) - GEN Q_primpart(GEN x) - GEN Q_remove_denom(GEN x, GEN *ptd) -+ GEN RgXQ_charpoly(GEN x, GEN T, long v) -+ GEN RgXQ_inv(GEN x, GEN y) -+ GEN RgX_disc(GEN x) - GEN RgX_extgcd(GEN x, GEN y, GEN *U, GEN *V) -- GEN ZX_squff(GEN f, GEN *ex) -+ GEN RgX_extgcd_simple(GEN a, GEN b, GEN *pu, GEN *pv) -+ GEN RgX_gcd(GEN x, GEN y) -+ GEN RgX_gcd_simple(GEN x, GEN y) -+ int RgXQ_ratlift(GEN y, GEN x, long amax, long bmax, GEN *P, GEN *Q) -+ GEN RgX_resultant_all(GEN P, GEN Q, GEN *sol) -+ long RgX_type(GEN x, GEN *ptp, GEN *ptpol, long *ptpa) -+ void RgX_type_decode(long x, long *t1, long *t2) -+ int RgX_type_is_composite(long t) -+ GEN ZX_content(GEN x) - GEN centermod(GEN x, GEN p) - GEN centermod_i(GEN x, GEN p, GEN ps2) - GEN centermodii(GEN x, GEN p, GEN po2) - GEN content(GEN x) - GEN deg1_from_roots(GEN L, long v) -- GEN discsr(GEN x) -- GEN divide_conquer_prod(GEN x, GEN (*mul)(GEN,GEN)) -+ GEN divide_conquer_assoc(GEN x, void *data, GEN (*mul)(void*, GEN, GEN)) -+ GEN divide_conquer_prod(GEN x, GEN (*mul)(GEN, GEN)) - GEN factor(GEN x) -- GEN factor0(GEN x,long flag) -- GEN factorback(GEN fa,GEN nf) -+ GEN factor0(GEN x, long flag) -+ GEN factorback(GEN fa) -+ GEN factorback2(GEN fa, GEN e) -+ GEN famat_mul_shallow(GEN f, GEN g) - GEN gbezout(GEN x, GEN y, GEN *u, GEN *v) -- GEN ggcd0(GEN x, GEN ) -- GEN gdeflate(GEN x, long v, long d) - GEN gdivexact(GEN x, GEN y) -+ GEN gen_factorback(GEN L, GEN e, GEN (*_mul)(void*, GEN, GEN), GEN (*_pow)(void*, GEN, GEN), void *data) - GEN ggcd(GEN x, GEN y) -+ GEN ggcd0(GEN x, GEN y) - GEN ginvmod(GEN x, GEN y) -- GEN gisirreducible(GEN x) - GEN glcm(GEN x, GEN y) - GEN glcm0(GEN x, GEN y) -- GEN gen_pow(GEN,GEN,void*,GEN (*sqr)(void*,GEN),GEN (*mul)(void*,GEN,GEN)) -- GEN gen_pow_u(GEN x, ulong n, void *data, GEN (*sqr)(void*,GEN), GEN (*mul)(void*,GEN,GEN)) -- long logint(GEN B, GEN y, GEN *ptq) -+ GEN gp_factor0(GEN x, GEN flag) -+ GEN idealfactorback(GEN nf, GEN L, GEN e, int red) -+ long isirreducible(GEN x) - GEN newtonpoly(GEN x, GEN p) -- GEN nfgcd(GEN P, GEN Q, GEN nf, GEN den) -- GEN nfisincl(GEN a, GEN b) -- GEN nfisisom(GEN a, GEN b) -+ GEN nffactorback(GEN nf, GEN L, GEN e) - GEN nfrootsQ(GEN x) - GEN poldisc0(GEN x, long v) -- GEN polfnf(GEN a, GEN t) -- GEN polhensellift(GEN pol, GEN fct, GEN p, long exp) -- GEN polresultant0(GEN x, GEN y,long v,long flag) -+ GEN polresultant0(GEN x, GEN y, long v, long flag) - GEN polsym(GEN x, long n) - GEN primitive_part(GEN x, GEN *c) - GEN primpart(GEN x) -- GEN quadgen(GEN x) -- GEN quadpoly(GEN x) -- GEN quadpoly0(GEN x, long v) - GEN reduceddiscsmith(GEN pol) - GEN resultant2(GEN x, GEN y) -+ GEN resultant_all(GEN u, GEN v, GEN *sol) -+ GEN rnfcharpoly(GEN nf, GEN T, GEN alpha, long v) - GEN roots_from_deg1(GEN x) -- GEN sort_factor(GEN y, int (*cmp)(GEN,GEN)) -- GEN sort_factor_gen(GEN y, int (*cmp)(GEN,GEN)) -- GEN sort_vecpol(GEN a, int (*cmp)(GEN,GEN)) -- GEN srgcd(GEN x, GEN y) -+ GEN roots_to_pol(GEN a, long v) -+ GEN roots_to_pol_r1(GEN a, long v, long r1) - long sturmpart(GEN x, GEN a, GEN b) - GEN subresext(GEN x, GEN y, GEN *U, GEN *V) -- GEN sylvestermatrix(GEN x,GEN y) -- GEN vecbezout(GEN x, GEN y) -- GEN vecbezoutres(GEN x, GEN y) -+ GEN sylvestermatrix(GEN x, GEN y) -+ GEN trivial_fact() -+ GEN gcdext0(GEN x, GEN y) -+ GEN polresultantext0(GEN x, GEN y, long v) -+ GEN polresultantext(GEN x, GEN y) -+ GEN prime_fact(GEN x) - - # polarit3.c - -- GEN Fp_pows(GEN A, long k, GEN N) -- GEN Fp_powu(GEN x, ulong k, GEN p) -- GEN FpM_red(GEN z, GEN p) -- GEN FpM_to_mod(GEN z, GEN p) -- GEN FpV_polint(GEN xa, GEN ya, GEN p) -- GEN FpV_red(GEN z, GEN p) -- GEN FpV_roots_to_pol(GEN V, GEN p, long v) -- GEN FpV_to_mod(GEN z, GEN p) -- GEN FpX_Fp_add(GEN y,GEN x,GEN p) -- GEN FpX_Fp_mul(GEN y,GEN x,GEN p) -- GEN FpX_add(GEN x,GEN y,GEN p) -- GEN FpX_center(GEN T,GEN mod) -- GEN FpX_chinese_coprime(GEN x,GEN y,GEN Tx,GEN Ty,GEN Tz,GEN p) -- GEN FpX_divrem(GEN x, GEN y, GEN p, GEN *pr) -- GEN FpX_eval(GEN x,GEN y,GEN p) -- GEN FpX_extgcd(GEN x, GEN y, GEN p, GEN *ptu, GEN *ptv) -- GEN FpX_factorff_irred(GEN P, GEN Q, GEN l) -- void FpX_ffintersect(GEN P,GEN Q,long n,GEN l,GEN *SP,GEN *SQ,GEN MA,GEN MB) -- GEN FpX_ffisom(GEN P,GEN Q,GEN l) -- GEN FpX_gcd(GEN x, GEN y, GEN p) -- GEN FpX_mul(GEN x,GEN y,GEN p) -- GEN FpX_neg(GEN x,GEN p) -- GEN FpX_normalize(GEN z, GEN p) -- GEN FpX_red(GEN z, GEN p) -- GEN FpX_sqr(GEN x,GEN p) -- GEN FpX_sub(GEN x,GEN y,GEN p) -- GEN FpX_to_mod(GEN z, GEN p) -- GEN FpXQ_charpoly(GEN x, GEN T, GEN p) -- GEN FpXQ_div(GEN x,GEN y,GEN T,GEN p) -- GEN FpXQ_ffisom_inv(GEN S,GEN Tp, GEN p) -- GEN FpXQ_inv(GEN x,GEN T,GEN p) -- GEN FpXQ_invsafe(GEN x, GEN T, GEN p) -- GEN FpXQ_matrix_pow(long n, long m, GEN y, GEN P, GEN l) -- GEN FpXQ_minpoly(GEN x, GEN T, GEN p) -- GEN FpXQ_mul(GEN y,GEN x,GEN T,GEN p) -- GEN FpXQ_pow(GEN x, GEN n, GEN T, GEN p) -- GEN FpXQ_powers(GEN x, long l, GEN T, GEN p) -- GEN FpXQ_sqr(GEN y, GEN T, GEN p) -- GEN FpXQ_sqrtn(GEN a, GEN n, GEN T, GEN p, GEN *zetan) -- GEN FpXQX_mul(GEN x, GEN y, GEN T, GEN p) -- GEN FpXQX_red(GEN z, GEN T, GEN p) -- GEN FpXQX_sqr(GEN x, GEN T, GEN p) -- GEN FpXQX_extgcd(GEN x, GEN y, GEN T, GEN p, GEN *ptu, GEN *ptv) -- GEN FpXQX_divrem(GEN x, GEN y, GEN T, GEN p, GEN *pr) -- GEN FpXQXV_prod(GEN V, GEN Tp, GEN p) -- GEN FpXV_prod(GEN V, GEN p) -- GEN FpXV_red(GEN z, GEN p) -- GEN FpXX_red(GEN z, GEN p) -- GEN FpX_rescale(GEN P, GEN h, GEN p) -+ GEN Flx_FlxY_resultant(GEN a, GEN b, ulong pp) -+ GEN Flx_factorff_irred(GEN P, GEN Q, ulong p) -+ void Flx_ffintersect(GEN P, GEN Q, long n, ulong l, GEN *SP, GEN *SQ, GEN MA, GEN MB) -+ GEN Flx_ffisom(GEN P, GEN Q, ulong l) -+ GEN Flx_roots_naive(GEN f, ulong p) -+ GEN FlxX_resultant(GEN u, GEN v, ulong p, long sx) -+ GEN Flxq_ffisom_inv(GEN S, GEN Tp, ulong p) -+ GEN FpV_polint(GEN xa, GEN ya, GEN p, long v) -+ GEN FpX_FpXY_resultant(GEN a, GEN b0, GEN p) -+ GEN FpX_factorff_irred(GEN P, GEN Q, GEN p) -+ void FpX_ffintersect(GEN P, GEN Q, long n, GEN l, GEN *SP, GEN *SQ, GEN MA, GEN MB) -+ GEN FpX_ffisom(GEN P, GEN Q, GEN l) -+ GEN FpX_translate(GEN P, GEN c, GEN p) -+ GEN FpXQ_ffisom_inv(GEN S, GEN Tp, GEN p) -+ GEN FpXV_FpC_mul(GEN V, GEN W, GEN p) -+ GEN FpXY_Fq_evaly(GEN Q, GEN y, GEN T, GEN p, long vx) -+ GEN Fq_Fp_mul(GEN x, GEN y, GEN T, GEN p) -+ GEN Fq_add(GEN x, GEN y, GEN T, GEN p) -+ GEN Fq_div(GEN x, GEN y, GEN T, GEN p) - GEN Fq_inv(GEN x, GEN T, GEN p) - GEN Fq_invsafe(GEN x, GEN T, GEN p) -- GEN Fq_add(GEN x, GEN y, GEN T, GEN p) - GEN Fq_mul(GEN x, GEN y, GEN T, GEN p) -+ GEN Fq_mulu(GEN x, ulong y, GEN T, GEN p) - GEN Fq_neg(GEN x, GEN T, GEN p) - GEN Fq_neg_inv(GEN x, GEN T, GEN p) - GEN Fq_pow(GEN x, GEN n, GEN T, GEN p) -- GEN Fq_red(GEN x, GEN T, GEN p) -+ GEN Fq_powu(GEN x, ulong n, GEN pol, GEN p) - GEN Fq_sub(GEN x, GEN y, GEN T, GEN p) -+ GEN Fq_sqr(GEN x, GEN T, GEN p) -+ GEN Fq_sqrt(GEN x, GEN T, GEN p) -+ GEN Fq_sqrtn(GEN x, GEN n, GEN T, GEN p, GEN *zeta) -+ GEN FqC_add(GEN x, GEN y, GEN T, GEN p) -+ GEN FqC_sub(GEN x, GEN y, GEN T, GEN p) -+ GEN FqC_Fq_mul(GEN x, GEN y, GEN T, GEN p) -+ GEN FqC_to_FlxC(GEN v, GEN T, GEN pp) - GEN FqM_to_FlxM(GEN x, GEN T, GEN pp) - GEN FqV_roots_to_pol(GEN V, GEN T, GEN p, long v) - GEN FqV_red(GEN z, GEN T, GEN p) -- GEN FqX_Fq_mul(GEN P, GEN U, GEN T, GEN p) -- GEN FqX_div(GEN x, GEN y, GEN T, GEN p) -- GEN FqX_divrem(GEN x, GEN y, GEN T, GEN p, GEN *z) -+ GEN FqV_to_FlxV(GEN v, GEN T, GEN pp) -+ GEN FqX_Fq_add(GEN y, GEN x, GEN T, GEN p) -+ GEN FqX_Fq_mul_to_monic(GEN P, GEN U, GEN T, GEN p) -+ GEN FqX_eval(GEN x, GEN y, GEN T, GEN p) - GEN FqX_normalize(GEN z, GEN T, GEN p) -- GEN FqX_red(GEN z, GEN T, GEN p) -- GEN FqX_rem(GEN x, GEN y, GEN T, GEN p) -- GEN FqX_mul(GEN x, GEN y, GEN T, GEN p) -- GEN FqX_sqr(GEN x, GEN T, GEN p) -+ GEN FqX_translate(GEN P, GEN c, GEN T, GEN p) -+ GEN FqXQ_powers(GEN x, long l, GEN S, GEN T, GEN p) -+ GEN FqXQ_matrix_pow(GEN y, long n, long m, GEN S, GEN T, GEN p) -+ GEN FqXY_eval(GEN Q, GEN y, GEN x, GEN T, GEN p) -+ GEN FqXY_evalx(GEN Q, GEN x, GEN T, GEN p) -+ GEN QX_disc(GEN x) -+ GEN QX_gcd(GEN a, GEN b) -+ GEN QX_resultant(GEN A, GEN B) -+ GEN QXQ_intnorm(GEN A, GEN B) - GEN QXQ_inv(GEN A, GEN B) -+ GEN QXQ_norm(GEN A, GEN B) -+ int Rg_is_Fp(GEN x, GEN *p) -+ int Rg_is_FpXQ(GEN x, GEN *pT, GEN *pp) -+ GEN Rg_to_Fp(GEN x, GEN p) -+ GEN Rg_to_FpXQ(GEN x, GEN T, GEN p) -+ GEN RgC_to_Flc(GEN x, ulong p) -+ GEN RgC_to_FpC(GEN x, GEN p) -+ int RgM_is_FpM(GEN x, GEN *p) -+ GEN RgM_to_Flm(GEN x, ulong p) -+ GEN RgM_to_FpM(GEN x, GEN p) -+ int RgV_is_FpV(GEN x, GEN *p) -+ GEN RgV_to_FpV(GEN x, GEN p) -+ int RgX_is_FpX(GEN x, GEN *p) -+ GEN RgX_to_FpX(GEN x, GEN p) -+ int RgX_is_FpXQX(GEN x, GEN *pT, GEN *pp) -+ GEN RgX_to_FpXQX(GEN x, GEN T, GEN p) -+ GEN RgX_to_FqX(GEN x, GEN T, GEN p) -+ GEN ZX_ZXY_rnfequation(GEN A, GEN B, long *Lambda) -+ GEN ZXQ_charpoly(GEN A, GEN T, long v) - GEN ZX_disc(GEN x) - int ZX_is_squarefree(GEN x) -+ GEN ZX_gcd(GEN A, GEN B) -+ GEN ZX_gcd_all(GEN A, GEN B, GEN *Anew) - GEN ZX_resultant(GEN A, GEN B) -- long brent_kung_optpow(long d, long n) -+ int Z_incremental_CRT(GEN *H, ulong Hp, GEN *q, ulong p) -+ GEN Z_init_CRT(ulong Hp, ulong p) -+ int ZM_incremental_CRT(GEN *H, GEN Hp, GEN *q, ulong p) -+ GEN ZM_init_CRT(GEN Hp, ulong p) -+ int ZX_incremental_CRT(GEN *ptH, GEN Hp, GEN *q, ulong p) -+ GEN ZX_init_CRT(GEN Hp, ulong p, long v) -+ GEN characteristic(GEN x) - GEN ffinit(GEN p, long n, long v) -+ GEN ffnbirred(GEN p, long n) -+ GEN ffnbirred0(GEN p, long n, long flag) -+ GEN ffsumnbirred(GEN p, long n) -+ bb_field *get_Fq_field(void **E, GEN T, GEN p) -+ GEN init_Fq(GEN p, long n, long v) -+ GEN pol_x_powers(long N, long v) -+ GEN residual_characteristic(GEN x) - -- # RgX.c -+ # prime.c - -- int RgX_is_rational(GEN x) -- GEN RgM_to_RgXV(GEN x, long v) -- GEN RgM_to_RgXX(GEN x, long v,long w) -- GEN RgM_zc_mul(GEN x, GEN y) -- GEN RgM_zm_mul(GEN x, GEN y) -- GEN RgV_to_RgX(GEN x, long v) -- GEN RgV_zc_mul(GEN x, GEN y) -- GEN RgV_zm_mul(GEN x, GEN y) -- GEN RgX_divrem(GEN x,GEN y,GEN *r) -- GEN RgX_mul(GEN x,GEN y) -- GEN RgX_mulspec(GEN a, GEN b, long na, long nb) -- GEN RgXQX_divrem(GEN x,GEN y,GEN T,GEN *r) -- GEN RgXQX_mul(GEN x,GEN y,GEN T) -- GEN RgXQX_red(GEN P, GEN T) -- GEN RgXQX_RgXQ_mul(GEN x, GEN y, GEN T) -- GEN RgX_Rg_mul(GEN y, GEN x) -- GEN RgX_shift(GEN x, long n) -- GEN RgX_sqr(GEN x) -- GEN RgX_sqrspec(GEN a, long na) -- GEN RgXV_to_RgM(GEN v, long n) -- GEN RgX_to_RgV(GEN x, long N) -- GEN RgXX_to_RgM(GEN v, long n) -- GEN RgXY_swap(GEN x, long n, long w) -+ long BPSW_isprime(GEN x) -+ long BPSW_psp(GEN N) -+ GEN addprimes(GEN primes) -+ GEN gisprime(GEN x, long flag) -+ GEN gispseudoprime(GEN x, long flag) -+ GEN gprimepi_upper_bound(GEN x) -+ GEN gprimepi_lower_bound(GEN x) -+ long isprime(GEN x) -+ long ispseudoprime(GEN x, long flag) -+ long millerrabin(GEN n, long k) -+ GEN prime(long n) -+ GEN primepi(GEN x) -+ double primepi_upper_bound(double x) -+ double primepi_lower_bound(double x) -+ GEN primes(long n) -+ GEN primes_interval(GEN a, GEN b) -+ GEN primes_interval_zv(ulong a, ulong b) -+ GEN primes_upto_zv(ulong b) -+ GEN primes0(GEN n) -+ GEN primes_zv(long m) -+ GEN randomprime(GEN N) -+ GEN removeprimes(GEN primes) -+ int uislucaspsp(ulong n) -+ int uisprime(ulong n) -+ ulong uprime(long n) -+ ulong uprimepi(ulong n) -+ -+ # qfisom.c -+ -+ GEN qfauto(GEN g, GEN flags) -+ GEN qfauto0(GEN g, GEN flags) -+ GEN qfautoexport(GEN g, long flag) -+ GEN qfisom(GEN g, GEN h, GEN flags) -+ GEN qfisom0(GEN g, GEN h, GEN flags) -+ GEN qfisominit(GEN g, GEN flags) -+ GEN qfisominit0(GEN g, GEN flags) -+ -+ # random.c -+ -+ GEN genrand(GEN N) -+ GEN getrand() -+ ulong pari_rand() -+ GEN randomi(GEN x) -+ GEN randomr(long prec) -+ ulong random_Fl(ulong n) -+ void setrand(GEN seed) - - # rootpol.c - -- GEN cleanroots(GEN x,long l) -+ GEN QX_complex_roots(GEN p, long l) -+ GEN ZX_graeffe(GEN p) -+ GEN cleanroots(GEN x, long l) - int isrealappr(GEN x, long l) -- GEN roots(GEN x,long l) -- GEN roots0(GEN x,long flag,long l) -+ GEN polgraeffe(GEN p) -+ GEN polmod_to_embed(GEN x, long prec) -+ GEN roots(GEN x, long l) - - # subcyclo.c - -+ GEN factor_Aurifeuille(GEN p, long n) -+ GEN factor_Aurifeuille_prime(GEN p, long n) - GEN galoissubcyclo(GEN N, GEN sg, long flag, long v) - GEN polsubcyclo(long n, long d, long v) -- GEN znstar_small(GEN zn) - - # subfield.c - -@@ -1793,7 +3548,7 @@ cdef extern from 'pari/pari.h': - # subgroup.c - - GEN subgrouplist(GEN cyc, GEN bound) -- void traversesubgroups(GEN cyc, GEN B, void fun(GEN,void*), void *E) -+ void forsubgroup(void *E, long fun(void*, GEN), GEN cyc, GEN B) - - # stark.c - -@@ -1803,23 +3558,34 @@ cdef extern from 'pari/pari.h': - - # sumiter.c - -- GEN derivnum(void *E, GEN (*eval)(GEN,void*), GEN x, long prec) -- GEN direuler(void *E, GEN (*eval)(GEN,void*), GEN ga, GEN gb, GEN c) -- GEN forvec_start(GEN x, long flag, GEN *d, GEN (**next)(GEN,GEN)) -+ GEN derivnum(void *E, GEN (*eval)(void *, GEN), GEN x, long prec) -+ GEN derivfun(void *E, GEN (*eval)(void *, GEN), GEN x, long prec) -+ GEN direuler(void *E, GEN (*eval)(void *, GEN), GEN ga, GEN gb, GEN c) -+ int forcomposite_init(forcomposite_t *C, GEN a, GEN b) -+ GEN forcomposite_next(forcomposite_t *C) -+ GEN forprime_next(forprime_t *T) -+ int forprime_init(forprime_t *T, GEN a, GEN b) -+ int forvec_init(forvec_t *T, GEN x, long flag) -+ GEN forvec_next(forvec_t *T) - GEN polzag(long n, long m) -- GEN prodeuler(void *E, GEN (*eval)(GEN,void*), GEN ga, GEN gb, long prec) -- GEN prodinf(void *E, GEN (*eval)(GEN,void*), GEN a, long prec) -- GEN prodinf1(void *E, GEN (*eval)(GEN,void*), GEN a, long prec) -- GEN sumalt(void *E, GEN (*eval)(GEN,void*), GEN a, long prec) -- GEN sumalt2(void *E, GEN (*eval)(GEN,void*), GEN a, long prec) -- GEN sumpos(void *E, GEN (*eval)(GEN,void*), GEN a, long prec) -- GEN sumpos2(void *E, GEN (*eval)(GEN,void*), GEN a, long prec) -- GEN suminf(void *E, GEN (*eval)(GEN,void*), GEN a, long prec) -- GEN zbrent(void *E, GEN (*eval)(GEN,void*), GEN a, GEN b, long prec) -+ GEN prodeuler(void *E, GEN (*eval)(void *, GEN), GEN ga, GEN gb, long prec) -+ GEN prodinf(void *E, GEN (*eval)(void *, GEN), GEN a, long prec) -+ GEN prodinf1(void *E, GEN (*eval)(void *, GEN), GEN a, long prec) -+ GEN sumalt(void *E, GEN (*eval)(void *, GEN), GEN a, long prec) -+ GEN sumalt2(void *E, GEN (*eval)(void *, GEN), GEN a, long prec) -+ GEN sumpos(void *E, GEN (*eval)(void *, GEN), GEN a, long prec) -+ GEN sumpos2(void *E, GEN (*eval)(void *, GEN), GEN a, long prec) -+ GEN suminf(void *E, GEN (*eval)(void *, GEN), GEN a, long prec) -+ ulong u_forprime_next(forprime_t *T) -+ int u_forprime_init(forprime_t *T, ulong a, ulong b) -+ void u_forprime_restrict(forprime_t *T, ulong c) -+ int u_forprime_arith_init(forprime_t *T, ulong a, ulong b, ulong c, ulong q) -+ GEN zbrent(void *E, GEN (*eval)(void *, GEN), GEN a, GEN b, long prec) - - # thue.c - - GEN bnfisintnorm(GEN x, GEN y) -+ GEN bnfisintnormabs(GEN bnf, GEN a) - GEN thue(GEN thueres, GEN rhs, GEN ne) - GEN thueinit(GEN pol, long flag, long prec) - -@@ -1828,14 +3594,26 @@ cdef extern from 'pari/pari.h': - GEN Pi2n(long n, long prec) - GEN PiI2(long prec) - GEN PiI2n(long n, long prec) -+ GEN Qp_exp(GEN x) -+ GEN Qp_log(GEN x) -+ GEN Qp_sqrt(GEN x) -+ GEN Qp_sqrtn(GEN x, GEN n, GEN *zetan) -+ long Zn_ispower(GEN a, GEN q, GEN K, GEN *pt) - long Zn_issquare(GEN x, GEN n) - GEN Zn_sqrt(GEN x, GEN n) -- void consteuler(long prec) -- void constpi(long prec) -- GEN exp_Ir(GEN x) -+ GEN Zp_teichmuller(GEN x, GEN p, long n, GEN q) -+ GEN agm(GEN x, GEN y, long prec) -+ GEN constcatalan(long prec) -+ GEN consteuler(long prec) -+ GEN constlog2(long prec) -+ GEN constpi(long prec) -+ GEN cxexpm1(GEN z, long prec) -+ GEN expIr(GEN x) -+ GEN exp1r_abs(GEN x) - GEN gcos(GEN x, long prec) - GEN gcotan(GEN x, long prec) - GEN gexp(GEN x, long prec) -+ GEN gexpm1(GEN x, long prec) - GEN glog(GEN x, long prec) - GEN gpow(GEN x, GEN n, long prec) - GEN gpowgs(GEN x, long n) -@@ -1844,72 +3622,100 @@ cdef extern from 'pari/pari.h': - GEN gsqrt(GEN x, long prec) - GEN gsqrtn(GEN x, GEN n, GEN *zetan, long prec) - GEN gtan(GEN x, long prec) -+ GEN logr_abs(GEN x) - GEN mpcos(GEN x) - GEN mpeuler(long prec) -+ GEN mpcatalan(long prec) -+ void mpsincosm1(GEN x, GEN *s, GEN *c) - GEN mpexp(GEN x) -- GEN mpexp1(GEN x) -+ GEN mpexpm1(GEN x) - GEN mplog(GEN x) - GEN mplog2(long prec) - GEN mppi(long prec) - GEN mpsin(GEN x) - void mpsincos(GEN x, GEN *s, GEN *c) -+ GEN powis(GEN x, long n) -+ GEN powiu(GEN p, ulong k) -+ GEN powrfrac(GEN x, long n, long d) -+ GEN powrs(GEN x, long n) -+ GEN powrshalf(GEN x, long s) -+ GEN powru(GEN x, ulong n) -+ GEN powruhalf(GEN x, ulong s) -+ GEN powuu(ulong p, ulong k) - GEN powgi(GEN x, GEN n) -+ GEN serchop0(GEN s) -+ GEN sqrtnint(GEN a, long n) - GEN teich(GEN x) -+ GEN trans_eval(const char *fun, GEN (*f) (GEN, long), GEN x, long prec) -+ ulong upowuu(ulong p, ulong k) -+ ulong usqrtn(ulong a, ulong n) -+ ulong usqrt(ulong a) - - # trans2.c - -+ GEN Qp_gamma(GEN x) - GEN bernfrac(long n) -+ GEN bernpol(long k, long v) - GEN bernreal(long n, long prec) -- GEN bernvec(long nomb) -- GEN gach(GEN x, long prec) -+ GEN gacosh(GEN x, long prec) - GEN gacos(GEN x, long prec) - GEN garg(GEN x, long prec) -- GEN gash(GEN x, long prec) -+ GEN gasinh(GEN x, long prec) - GEN gasin(GEN x, long prec) - GEN gatan(GEN x, long prec) -- GEN gath(GEN x, long prec) -- GEN gch(GEN x, long prec) -- GEN ggamd(GEN x, long prec) -+ GEN gatanh(GEN x, long prec) -+ GEN gcosh(GEN x, long prec) -+ GEN ggammah(GEN x, long prec) - GEN ggamma(GEN x, long prec) - GEN glngamma(GEN x, long prec) - GEN gpsi(GEN x, long prec) -- GEN gsh(GEN x, long prec) -- GEN gth(GEN x, long prec) -+ GEN gsinh(GEN x, long prec) -+ GEN gtanh(GEN x, long prec) - void mpbern(long nomb, long prec) -+ GEN mpfactr(long n, long prec) -+ GEN sumformal(GEN T, long v) - - # trans3.c - -- GEN agm(GEN x, GEN y, long prec) - GEN dilog(GEN x, long prec) - GEN eint1(GEN x, long prec) - GEN eta(GEN x, long prec) -- GEN eta0(GEN x, long flag,long prec) -+ GEN eta0(GEN x, long flag, long prec) - GEN gerfc(GEN x, long prec) - GEN gpolylog(long m, GEN x, long prec) - GEN gzeta(GEN x, long prec) - GEN hyperu(GEN a, GEN b, GEN gx, long prec) - GEN incgam(GEN a, GEN x, long prec) -- GEN incgam0(GEN a, GEN x, GEN z,long prec) -+ GEN incgam0(GEN a, GEN x, GEN z, long prec) - GEN incgamc(GEN a, GEN x, long prec) - GEN hbessel1(GEN n, GEN z, long prec) - GEN hbessel2(GEN n, GEN z, long prec) - GEN ibessel(GEN n, GEN z, long prec) - GEN jbessel(GEN n, GEN z, long prec) - GEN jbesselh(GEN n, GEN z, long prec) -+ GEN mpeint1(GEN x, GEN expx) -+ GEN mplambertW(GEN y) -+ GEN mpveceint1(GEN C, GEN eC, long n) -+ GEN powruvec(GEN e, ulong n) - GEN nbessel(GEN n, GEN z, long prec) - GEN jell(GEN x, long prec) - GEN kbessel(GEN nu, GEN gx, long prec) -- GEN polylog(long m, GEN x, long prec) - GEN polylog0(long m, GEN x, long flag, long prec) -+ GEN sumdedekind_coprime(GEN h, GEN k) -+ GEN sumdedekind(GEN h, GEN k) - GEN szeta(long x, long prec) - GEN theta(GEN q, GEN z, long prec) - GEN thetanullk(GEN q, long k, long prec) - GEN trueeta(GEN x, long prec) -- GEN veceint1(GEN C, GEN nmax, long prec) -+ GEN u_sumdedekind_coprime(long h, long k) -+ GEN veceint1(GEN nmax, GEN C, long prec) - GEN vecthetanullk(GEN q, long k, long prec) -- GEN weber0(GEN x, long flag,long prec) -+ GEN vecthetanullk_tau(GEN tau, long k, long prec) -+ GEN weber0(GEN x, long flag, long prec) - GEN weberf(GEN x, long prec) -+ GEN weberf1(GEN x, long prec) - GEN weberf2(GEN x, long prec) -+ GEN glambertW(GEN y, long prec) - - # gmp/int.h - long* int_MSW(GEN x) -@@ -1917,8 +3723,15 @@ cdef extern from 'pari/pari.h': - long* int_precW(long * xp) - long* int_nextW(long * xp) - -- # misc... -- extern char* diffptr -+ # paristio.h -+ -+ struct PariOUT: -+ void (*putch)(char) -+ void (*puts)(char*) -+ void (*flush)() -+ extern PariOUT* pariOut -+ extern PariOUT* pariErr -+ extern byteptr diffptr - - cdef extern from 'stdsage.h': - GEN set_gel(GEN x, long n, GEN z) # gel(x,n) = z -@@ -1930,15 +3743,6 @@ cdef extern from 'stdsage.h': - include 'declinl.pxi' - - --cdef extern from *: # paristio.h -- struct PariOUT: -- void (*putch)(char) -- void (*puts)(char*) -- void (*flush)() -- extern PariOUT* pariOut -- extern PariOUT* pariErr -- -- - cdef extern from 'pari/paripriv.h': - int gpd_QUIET, gpd_TEST, gpd_EMACS, gpd_TEXMACS - -diff -up src/sage/libs/pari/gen_py.py.orig src/sage/libs/pari/gen_py.py ---- src/sage/libs/pari/gen_py.py.orig 2014-08-13 11:16:54.345162303 -0300 -+++ src/sage/libs/pari/gen_py.py 2014-08-13 11:16:57.560162426 -0300 -@@ -73,11 +73,11 @@ def pari(x): - - sage: K. = NumberField(x^3 - 2) - sage: pari(K) -- [y^3 - 2, [1, 1], -108, 1, [[1, 1.25992104989487, 1.58740105196820; 1, -0.629960524947437 - 1.09112363597172*I, -0.793700525984100 + 1.37472963699860*I], [1, 1.25992104989487, 1.58740105196820; 1, -1.72108416091916, 0.581029111014503; 1, 0.461163111024285, -2.16843016298270], [1, 1, 2; 1, -2, 1; 1, 0, -2], [3, 0, 0; 0, 0, 6; 0, 6, 0], [6, 0, 0; 0, 6, 0; 0, 0, 3], [2, 0, 0; 0, 0, 1; 0, 1, 0], [2, [0, 0, 2; 1, 0, 0; 0, 1, 0]]], [1.25992104989487, -0.629960524947437 - 1.09112363597172*I], [1, y, y^2], [1, 0, 0; 0, 1, 0; 0, 0, 1], [1, 0, 0, 0, 0, 2, 0, 2, 0; 0, 1, 0, 1, 0, 0, 0, 0, 2; 0, 0, 1, 0, 1, 0, 1, 0, 0]] -+ [y^3 - 2, [1, 1], -108, 1, [[1, 1.25992104989487, 1.58740105196820; 1, -0.629960524947437 + 1.09112363597172*I, -0.793700525984100 - 1.37472963699860*I], [1, 1.25992104989487, 1.58740105196820; 1, 0.461163111024285, -2.16843016298270; 1, -1.72108416091916, 0.581029111014503], [1, 1, 2; 1, 0, -2; 1, -2, 1], [3, 0, 0; 0, 0, 6; 0, 6, 0], [6, 0, 0; 0, 6, 0; 0, 0, 3], [2, 0, 0; 0, 0, 1; 0, 1, 0], [2, [0, 0, 2; 1, 0, 0; 0, 1, 0]], []], [1.25992104989487, -0.629960524947437 + 1.09112363597172*I], [1, y, y^2], [1, 0, 0; 0, 1, 0; 0, 0, 1], [1, 0, 0, 0, 0, 2, 0, 2, 0; 0, 1, 0, 1, 0, 0, 0, 0, 2; 0, 0, 1, 0, 1, 0, 1, 0, 0]] - - sage: E = EllipticCurve('37a1') - sage: pari(E) -- [0, 0, 1, -1, 0, 0, -2, 1, -1, 48, -216, 37, 110592/37, [0.837565435283323, 0.269594436405445, -1.10715987168877]~, 2.99345864623196, -2.45138938198679*I, 0.942638555913623, 1.32703057887968*I, 7.33813274078958] -+ [0, 0, 1, -1, 0, 0, -2, 1, -1, 48, -216, 37, 110592/37, Vecsmall([1]), [Vecsmall([64, 1])], [0, 0, 0, 0, 0, 0, 0, 0]] - - Conversion from basic Python types:: - -diff -up src/sage/libs/pari/gen.pyx.orig src/sage/libs/pari/gen.pyx ---- src/sage/libs/pari/gen.pyx.orig 2014-08-13 11:16:54.347162303 -0300 -+++ src/sage/libs/pari/gen.pyx 2014-08-13 11:16:57.562162426 -0300 -@@ -23,6 +23,8 @@ AUTHORS: - - Peter Bruin (2013-11-17): move PariInstance to a separate file - (#15185) - -+ - Jeroen Demeyer (2014-02-09): upgrade to PARI 2.7 (#15767) -+ - """ - - #***************************************************************************** -@@ -332,7 +334,7 @@ cdef class gen(sage.structure.element.Ri - sage: K.getattr("reg") - Traceback (most recent call last): - ... -- PariError: _.reg: incorrect type in reg -+ PariError: _.reg: incorrect type in reg (t_VEC) - sage: K.getattr("zzz") - Traceback (most recent call last): - ... -@@ -385,14 +387,15 @@ cdef class gen(sage.structure.element.Ri - sage: bnr.nf_get_pol() - x^4 - 4*x^2 + 1 - -- For relative extensions, this returns the absolute polynomial, -- not the relative one:: -+ For relative number fields, this returns the relative -+ polynomial. However, beware that ``pari(L)`` returns an absolute -+ number field:: - - sage: L. = K.extension(x^2 - 5) -- sage: pari(L).nf_get_pol() # Absolute polynomial -+ sage: pari(L).nf_get_pol() # Absolute - y^8 - 28*y^6 + 208*y^4 - 408*y^2 + 36 -- sage: L.pari_rnf().nf_get_pol() -- x^8 - 28*x^6 + 208*x^4 - 408*x^2 + 36 -+ sage: L.pari_rnf().nf_get_pol() # Relative -+ x^2 - 5 - - TESTS:: - -@@ -408,7 +411,8 @@ cdef class gen(sage.structure.element.Ri - sage: pari("[0]").nf_get_pol() - Traceback (most recent call last): - ... -- PariError: incorrect type in pol -+ PariError: incorrect type in pol (t_VEC) -+ - """ - pari_catch_sig_on() - return P.new_gen(member_pol(self.g)) -@@ -555,7 +559,7 @@ cdef class gen(sage.structure.element.Ri - - sage: K. = QuadraticField(-1) - sage: F = pari(K).idealfactor(K.ideal(5)); F -- [[5, [-2, 1]~, 1, 1, [2, 1]~], 1; [5, [2, 1]~, 1, 1, [-2, 1]~], 1] -+ [[5, [-2, 1]~, 1, 1, [2, -1; 1, 2]], 1; [5, [2, 1]~, 1, 1, [-2, -1; 1, -2]], 1] - sage: F[0,0].pr_get_p() - 5 - """ -@@ -1152,9 +1156,11 @@ cdef class gen(sage.structure.element.Ri - -36bb1e3929d1a8fe2802f083 - """ - cdef GEN x -- cdef long lx, *xp -+ cdef long lx -+ cdef long *xp - cdef long w -- cdef char *s, *sp -+ cdef char *s -+ cdef char *sp - cdef char *hexdigits - hexdigits = "0123456789abcdef" - cdef int i, j -@@ -1379,7 +1385,7 @@ cdef class gen(sage.structure.element.Ri - sage: complex(g) - Traceback (most recent call last): - ... -- PariError: incorrect type in greal/gimag -+ PariError: incorrect type in greal/gimag (t_INTMOD) - """ - cdef double re, im - pari_catch_sig_on() -@@ -1735,7 +1741,9 @@ cdef class gen(sage.structure.element.Ri - moebius(x): Moebius function of x. - """ - pari_catch_sig_on() -- return P.new_gen(gmoebius(x.g)) -+ r = moebius(x.g) -+ pari_catch_sig_off() -+ return r - - def sign(gen x): - """ -@@ -1757,7 +1765,7 @@ cdef class gen(sage.structure.element.Ri - sage: pari(I).sign() - Traceback (most recent call last): - ... -- PariError: incorrect type in gsigne -+ PariError: incorrect type in gsigne (t_COMPLEX) - - """ - pari_catch_sig_on() -@@ -2055,7 +2063,7 @@ cdef class gen(sage.structure.element.Ri - sage: pari('x+y').Pol('y') - Traceback (most recent call last): - ... -- PariError: variable must have higher priority in gtopoly -+ PariError: incorrect priority in gtopoly: variable x < y - - INPUT: - -@@ -2174,7 +2182,7 @@ cdef class gen(sage.structure.element.Ri - sage: pari(3).Qfb(7, 2) # discriminant is 25 - Traceback (most recent call last): - ... -- PariError: square discriminant in Qfb -+ PariError: domain error in Qfb: issquare(disc) = 1 - """ - cdef gen t0 = objtogen(b) - cdef gen t1 = objtogen(c) -@@ -2281,17 +2289,17 @@ cdef class gen(sage.structure.element.Ri - EXAMPLES:: - - sage: pari([1,5,2]).Set() -- ["1", "2", "5"] -+ [1, 2, 5] - sage: pari([]).Set() # the empty set - [] - sage: pari([1,1,-1,-1,3,3]).Set() -- ["-1", "1", "3"] -+ [-1, 1, 3] - sage: pari(1).Set() -- ["1"] -+ [1] - sage: pari('1/(x*y)').Set() -- ["1/(y*x)"] -+ [1/(y*x)] - sage: pari('["bc","ab","bc"]').Set() -- ["\"ab\"", "\"bc\""] -+ ["ab", "bc"] - """ - pari_catch_sig_on() - return P.new_gen(gtoset(x.g)) -@@ -2557,9 +2565,7 @@ cdef class gen(sage.structure.element.Ri - sage: pari(1234).Vecsmall() - Vecsmall([1234]) - sage: pari('x^2 + 2*x + 3').Vecsmall() -- Traceback (most recent call last): -- ... -- PariError: incorrect type in vectosmall -+ Vecsmall([1, 2, 3]) - - We demonstate the `n` argument:: - -@@ -2595,7 +2601,7 @@ cdef class gen(sage.structure.element.Ri - EXAMPLES:: - - sage: pari(0).binary() -- [0] -+ [] - sage: pari(-5).binary() - [1, 0, 1] - sage: pari(5).binary() -@@ -2967,7 +2973,7 @@ cdef class gen(sage.structure.element.Ri - sage: pari('x').component(0) - Traceback (most recent call last): - ... -- PariError: nonexistent component -+ PariError: non-existent component: index < 1 - """ - pari_catch_sig_on() - return P.new_gen(compo(x.g, n)) -@@ -2999,7 +3005,7 @@ cdef class gen(sage.structure.element.Ri - sage: pari('Mod(x,x^3-3)').conj() - Traceback (most recent call last): - ... -- PariError: incorrect type in gconj -+ PariError: incorrect type in gconj (t_POLMOD) - """ - pari_catch_sig_on() - return P.new_gen(gconj(x.g)) -@@ -3023,7 +3029,7 @@ cdef class gen(sage.structure.element.Ri - sage: pari('Mod(1+x,x^2-2)').conjvec() - [-0.414213562373095, 2.41421356237310]~ - sage: pari('Mod(x,x^3-3)').conjvec() -- [1.44224957030741, -0.721124785153704 + 1.24902476648341*I, -0.721124785153704 - 1.24902476648341*I]~ -+ [1.44224957030741, -0.721124785153704 - 1.24902476648341*I, -0.721124785153704 + 1.24902476648341*I]~ - sage: pari('Mod(1+x,x^2-2)').conjvec(precision=192)[0].sage() - -0.414213562373095048801688724209698078569671875376948073177 - """ -@@ -3098,7 +3104,7 @@ cdef class gen(sage.structure.element.Ri - sage: pari('"hello world"').floor() - Traceback (most recent call last): - ... -- PariError: incorrect type in gfloor -+ PariError: incorrect type in gfloor (t_STR) - """ - pari_catch_sig_on() - return P.new_gen(gfloor(x.g)) -@@ -3124,7 +3130,7 @@ cdef class gen(sage.structure.element.Ri - sage: pari('sqrt(-2)').frac() - Traceback (most recent call last): - ... -- PariError: incorrect type in gfloor -+ PariError: incorrect type in gfloor (t_COMPLEX) - """ - pari_catch_sig_on() - return P.new_gen(gfrac(x.g)) -@@ -3281,7 +3287,7 @@ cdef class gen(sage.structure.element.Ri - sage: y.padicprec(17) - Traceback (most recent call last): - ... -- PariError: not the same prime in padicprec -+ PariError: inconsistent moduli in padicprec: 11 != 17 - - This works for polynomials too:: - -@@ -3740,7 +3746,7 @@ cdef class gen(sage.structure.element.Ri - """ - cdef gen t0 = objtogen(p) - pari_catch_sig_on() -- v = ggval(x.g, t0.g) -+ v = gvaluation(x.g, t0.g) - pari_catch_sig_off() - return v - -@@ -3881,7 +3887,7 @@ cdef class gen(sage.structure.element.Ri - 0.881373587019543 + 1.57079632679490*I - """ - pari_catch_sig_on() -- return P.new_gen(gach(x.g, prec_bits_to_words(precision))) -+ return P.new_gen(gacosh(x.g, prec_bits_to_words(precision))) - - def agm(gen x, y, unsigned long precision=0): - r""" -@@ -3972,7 +3978,7 @@ cdef class gen(sage.structure.element.Ri - 1.52857091948100 + 0.427078586392476*I - """ - pari_catch_sig_on() -- return P.new_gen(gash(x.g, prec_bits_to_words(precision))) -+ return P.new_gen(gasinh(x.g, prec_bits_to_words(precision))) - - def atan(gen x, unsigned long precision=0): - r""" -@@ -4015,7 +4021,7 @@ cdef class gen(sage.structure.element.Ri - 0.549306144334055 - 1.57079632679490*I - """ - pari_catch_sig_on() -- return P.new_gen(gath(x.g, prec_bits_to_words(precision))) -+ return P.new_gen(gatanh(x.g, prec_bits_to_words(precision))) - - def bernfrac(gen x): - r""" -@@ -4064,10 +4070,14 @@ cdef class gen(sage.structure.element.Ri - EXAMPLES:: - - sage: pari(8).bernvec() -+ doctest:...: DeprecationWarning: bernvec() is deprecated, use repeated calls to bernfrac() instead -+ See http://trac.sagemath.org/15767 for details. - [1, 1/6, -1/30, 1/42, -1/30, 5/66, -691/2730, 7/6, -3617/510] - sage: [pari(2*n).bernfrac() for n in range(9)] - [1, 1/6, -1/30, 1/42, -1/30, 5/66, -691/2730, 7/6, -3617/510] - """ -+ from sage.misc.superseded import deprecation -+ deprecation(15767, 'bernvec() is deprecated, use repeated calls to bernfrac() instead') - pari_catch_sig_on() - return P.new_gen(bernvec(x)) - -@@ -4152,8 +4162,7 @@ cdef class gen(sage.structure.element.Ri - EXAMPLES:: - - sage: pari(2).besseljh(3) -- 0.4127100324 # 32-bit -- 0.412710032209716 # 64-bit -+ 0.412710032209716 - """ - cdef gen t0 = objtogen(x) - pari_catch_sig_on() -@@ -4291,7 +4300,7 @@ cdef class gen(sage.structure.element.Ri - 1 + 1/2*x^2 + 1/24*x^4 + 1/720*x^6 + O(x^8) - """ - pari_catch_sig_on() -- return P.new_gen(gch(x.g, prec_bits_to_words(precision))) -+ return P.new_gen(gcosh(x.g, prec_bits_to_words(precision))) - - def cotan(gen x, unsigned long precision=0): - """ -@@ -4470,7 +4479,7 @@ cdef class gen(sage.structure.element.Ri - sage: pari(-1).gamma() - Traceback (most recent call last): - ... -- PariError: non-positive integer argument in ggamma -+ PariError: domain error in gamma: argument = non-positive integer - """ - pari_catch_sig_on() - return P.new_gen(ggamma(s.g, prec_bits_to_words(precision))) -@@ -4495,7 +4504,7 @@ cdef class gen(sage.structure.element.Ri - 0.575315188063452 + 0.0882106775440939*I - """ - pari_catch_sig_on() -- return P.new_gen(ggamd(s.g, prec_bits_to_words(precision))) -+ return P.new_gen(ggammah(s.g, prec_bits_to_words(precision))) - - def hyperu(gen a, b, x, unsigned long precision=0): - r""" -@@ -4614,19 +4623,13 @@ cdef class gen(sage.structure.element.Ri - - def lngamma(gen x, unsigned long precision=0): - r""" -- This method is deprecated, please use :meth:`.log_gamma` instead. -- -- See the :meth:`.log_gamma` method for documentation and examples. -+ Alias for :meth:`log_gamma`. - - EXAMPLES:: - - sage: pari(100).lngamma() -- doctest:...: DeprecationWarning: The method lngamma() is deprecated. Use log_gamma() instead. -- See http://trac.sagemath.org/6992 for details. - 359.134205369575 - """ -- from sage.misc.superseded import deprecation -- deprecation(6992, "The method lngamma() is deprecated. Use log_gamma() instead.") - return x.log_gamma(precision) - - def log_gamma(gen x, unsigned long precision=0): -@@ -4741,7 +4744,7 @@ cdef class gen(sage.structure.element.Ri - 0.634963914784736 + 1.29845758141598*I - """ - pari_catch_sig_on() -- return P.new_gen(gsh(x.g, prec_bits_to_words(precision))) -+ return P.new_gen(gsinh(x.g, prec_bits_to_words(precision))) - - def sqr(gen x): - """ -@@ -4849,11 +4852,11 @@ cdef class gen(sage.structure.element.Ri - sage: s^5 - 2.00000000000000 - sage: z^5 -- 1.00000000000000 + 5.42101086 E-19*I # 32-bit -- 1.00000000000000 + 5.96311194867027 E-19*I # 64-bit -+ 1.00000000000000 - 2.710505431 E-20*I # 32-bit -+ 1.00000000000000 - 2.71050543121376 E-20*I # 64-bit - sage: (s*z)^5 -- 2.00000000000000 + 1.409462824 E-18*I # 32-bit -- 2.00000000000000 + 9.21571846612679 E-19*I # 64-bit -+ 2.00000000000000 + 0.E-19*I # 32-bit -+ 2.00000000000000 - 1.08420217248550 E-19*I # 64-bit - """ - # TODO: ??? lots of good examples in the PARI docs ??? - cdef GEN zetan -@@ -4905,7 +4908,7 @@ cdef class gen(sage.structure.element.Ri - 1.55740772465490 - """ - pari_catch_sig_on() -- return P.new_gen(gth(x.g, prec_bits_to_words(precision))) -+ return P.new_gen(gtanh(x.g, prec_bits_to_words(precision))) - - def teichmuller(gen x): - r""" -@@ -4979,8 +4982,7 @@ cdef class gen(sage.structure.element.Ri - - sage: C. = ComplexField() - sage: pari(i).weber() -- 1.18920711500272 + 0.E-19*I # 32-bit -- 1.18920711500272 + 2.71050543121376 E-20*I # 64-bit -+ 1.18920711500272 - sage: pari(i).weber(1) - 1.09050773266526 - sage: pari(i).weber(2) -@@ -5261,17 +5263,19 @@ cdef class gen(sage.structure.element.Ri - 4 - """ - pari_catch_sig_on() -- return P.new_gen(gnumbdiv(n.g)) -+ return P.new_gen(numdiv(n.g)) - - def phi(gen n): - """ -- Return the Euler phi function of n. EXAMPLES:: -+ Return the Euler phi function of n. -+ -+ EXAMPLES:: - - sage: pari(10).phi() - 4 - """ - pari_catch_sig_on() -- return P.new_gen(geulerphi(n.g)) -+ return P.new_gen(eulerphi(n.g)) - - def primepi(gen self): - """ -@@ -5405,11 +5409,9 @@ cdef class gen(sage.structure.element.Ri - INPUT: - - -- - ``self`` - a list of 5 coefficients -+ - ``self`` -- a list of 5 coefficients - -- - ``flag (optional, default: 0)`` - if 0, ask for a PARI ell -- structure with 19 components; if 1, ask for a shorted PARI -- sell structure with only the first 13 components. -+ - ``flag`` -- ignored (for backwards compatibility) - - - ``precision (optional, default: 0)`` - the real - precision to be used in the computation of the components of the -@@ -5427,80 +5429,62 @@ cdef class gen(sage.structure.element.Ri - - OUTPUT: - -+ - ``gen`` - a PARI ell structure. - -- - ``gen`` - either a PARI ell structure with 19 components -- (if flag=0), or a PARI sell structure with 13 components -- (if flag=1). -- -- -- EXAMPLES: An elliptic curve with integer coefficients:: -+ EXAMPLES: -+ -+ An elliptic curve with integer coefficients:: - - sage: e = pari([0,1,0,1,0]).ellinit(); e -- [0, 1, 0, 1, 0, 4, 2, 0, -1, -32, 224, -48, 2048/3, [0.E-28, -0.500000000000000 - 0.866025403784439*I, -0.500000000000000 + 0.866025403784439*I]~, 3.37150070962519, -1.68575035481260 - 2.15651564749964*I, 1.37451455785745 - 1.084202173 E-19*I, -0.687257278928726 + 0.984434956803824*I, 7.27069403586288] # 32-bit -- [0, 1, 0, 1, 0, 4, 2, 0, -1, -32, 224, -48, 2048/3, [0.E-38, -0.500000000000000 - 0.866025403784439*I, -0.500000000000000 + 0.866025403784439*I]~, 3.37150070962519, -1.68575035481260 - 2.15651564749964*I, 1.37451455785745 - 5.42101086242752 E-19*I, -0.687257278928726 + 0.984434956803824*I, 7.27069403586288] # 64-bit -- -- Its inexact components have the default precision of 53 bits:: -- -- sage: RR(e[14]) -- 3.37150070962519 -- -- We can compute this to higher precision:: -- -- sage: R = RealField(150) -- sage: e = pari([0,1,0,1,0]).ellinit(precision=150) -- sage: R(e[14]) -- 3.3715007096251920857424073155981539790016018 -- -- Using flag=1 returns a short elliptic curve PARI object:: -- -- sage: pari([0,1,0,1,0]).ellinit(flag=1) -- [0, 1, 0, 1, 0, 4, 2, 0, -1, -32, 224, -48, 2048/3] -+ [0, 1, 0, 1, 0, 4, 2, 0, -1, -32, 224, -48, 2048/3, Vecsmall([1]), [Vecsmall([64, -1])], [0, 0, 0, 0, 0, 0, 0, 0]] - - The coefficients can be any ring elements that convert to PARI:: - -- sage: pari([0,1/2,0,-3/4,0]).ellinit(flag=1) -- [0, 1/2, 0, -3/4, 0, 2, -3/2, 0, -9/16, 40, -116, 117/4, 256000/117] -- sage: pari([0,0.5,0,-0.75,0]).ellinit(flag=1) -- [0, 0.500000000000000, 0, -0.750000000000000, 0, 2.00000000000000, -1.50000000000000, 0, -0.562500000000000, 40.0000000000000, -116.000000000000, 29.2500000000000, 2188.03418803419] -- sage: pari([0,I,0,1,0]).ellinit(flag=1) -- [0, I, 0, 1, 0, 4*I, 2, 0, -1, -64, 352*I, -80, 16384/5] -- sage: pari([0,x,0,2*x,1]).ellinit(flag=1) -- [0, x, 0, 2*x, 1, 4*x, 4*x, 4, -4*x^2 + 4*x, 16*x^2 - 96*x, -64*x^3 + 576*x^2 - 864, 64*x^4 - 576*x^3 + 576*x^2 - 432, (256*x^6 - 4608*x^5 + 27648*x^4 - 55296*x^3)/(4*x^4 - 36*x^3 + 36*x^2 - 27)] -- """ -+ sage: pari([0,1/2,0,-3/4,0]).ellinit() -+ [0, 1/2, 0, -3/4, 0, 2, -3/2, 0, -9/16, 40, -116, 117/4, 256000/117, Vecsmall([1]), [Vecsmall([64, 1])], [0, 0, 0, 0, 0, 0, 0, 0]] -+ sage: pari([0,0.5,0,-0.75,0]).ellinit() -+ [0, 0.500000000000000, 0, -0.750000000000000, 0, 2.00000000000000, -1.50000000000000, 0, -0.562500000000000, 40.0000000000000, -116.000000000000, 29.2500000000000, 2188.03418803419, Vecsmall([0]), [Vecsmall([64, 1])], [0, 0, 0, 0]] -+ sage: pari([0,I,0,1,0]).ellinit() -+ [0, I, 0, 1, 0, 4*I, 2, 0, -1, -64, 352*I, -80, 16384/5, Vecsmall([0]), [Vecsmall([64, 0])], [0, 0, 0, 0]] -+ sage: pari([0,x,0,2*x,1]).ellinit() -+ [0, x, 0, 2*x, 1, 4*x, 4*x, 4, -4*x^2 + 4*x, 16*x^2 - 96*x, -64*x^3 + 576*x^2 - 864, 64*x^4 - 576*x^3 + 576*x^2 - 432, (256*x^6 - 4608*x^5 + 27648*x^4 - 55296*x^3)/(4*x^4 - 36*x^3 + 36*x^2 - 27), Vecsmall([0]), [Vecsmall([64, 0])], [0, 0, 0, 0]] -+ """ -+ if flag: -+ from sage.misc.superseded import deprecation -+ deprecation(15767, 'The flag argument to ellinit() is deprecated and not used anymore') - pari_catch_sig_on() -- return P.new_gen(ellinit0(self.g, flag, prec_bits_to_words(precision))) -+ return P.new_gen(ellinit(self.g, NULL, prec_bits_to_words(precision))) - - def ellglobalred(self): - """ -- e.ellglobalred(): return information related to the global minimal -- model of the elliptic curve e. -+ Return information related to the global minimal model of the -+ elliptic curve e. - - INPUT: - -+ - ``e`` -- elliptic curve (returned by ellinit) - -- - ``e`` - elliptic curve (returned by ellinit) -+ OUTPUT: A vector [N, [u,r,s,t], c, faN, L] with - -+ - ``N`` - the (arithmetic) conductor of `e` - -- OUTPUT: -- -- -- - ``gen`` - the (arithmetic) conductor of e -- -- - ``gen`` - a vector giving the coordinate change over -+ - ``[u,r,s,t]`` - a vector giving the coordinate change over - Q from e to its minimal integral model (see also ellminimalmodel) - -- - ``gen`` - the product of the local Tamagawa numbers -- of e -+ - ``c`` - the product of the local Tamagawa numbers of `e`. - -+ - ``faN`` is the factorization of `N` -+ -+ - ``L[i]`` is ``elllocalred(E, faN[i,1])`` - - EXAMPLES:: - - sage: e = pari([0, 5, 2, -1, 1]).ellinit() - sage: e.ellglobalred() -- [20144, [1, -2, 0, -1], 1] -+ [20144, [1, -2, 0, -1], 1, [2, 4; 1259, 1], [[4, 2, 0, 1], [1, 5, 0, 1]]] - sage: e = pari(EllipticCurve('17a').a_invariants()).ellinit() - sage: e.ellglobalred() -- [17, [1, 0, 0, 0], 4] -+ [17, [1, 0, 0, 0], 4, Mat([17, 1]), [[1, 8, 0, 4]]] - """ - pari_catch_sig_on() - return P.new_gen(ellglobalred(self.g)) -@@ -5522,11 +5506,11 @@ cdef class gen(sage.structure.element.Ri - - OUTPUT: point on E - -- EXAMPLES: First we create an elliptic curve:: -+ EXAMPLES: -+ -+ First we create an elliptic curve:: - - sage: e = pari([0, 1, 1, -2, 0]).ellinit() -- sage: str(e)[:65] # first part of output -- '[0, 1, 1, -2, 0, 4, -4, 1, -3, 112, -856, 389, 1404928/389, [0.90' - - Next we add two points on the elliptic curve. Notice that the - Python lists are automatically converted to PARI objects so you -@@ -5540,7 +5524,7 @@ cdef class gen(sage.structure.element.Ri - cdef gen t0 = objtogen(z0) - cdef gen t1 = objtogen(z1) - pari_catch_sig_on() -- return P.new_gen(addell(self.g, t0.g, t1.g)) -+ return P.new_gen(elladd(self.g, t0.g, t1.g)) - - def ellak(self, n): - r""" -@@ -5782,18 +5766,16 @@ cdef class gen(sage.structure.element.Ri - - INPUT: - -- - - ``e`` - elliptic curve - - - ``ch`` - change of coordinates vector with 4 - entries - -- - EXAMPLES:: - - sage: e = pari([1,2,3,4,5]).ellinit() - sage: e.ellglobalred() -- [10351, [1, -1, 0, -1], 1] -+ [10351, [1, -1, 0, -1], 1, [11, 1; 941, 1], [[1, 5, 0, 1], [1, 5, 0, 1]]] - sage: f = e.ellchangecurve([1,-1,0,-1]) - sage: f[:5] - [1, -1, 0, 4, 3] -@@ -5819,10 +5801,6 @@ cdef class gen(sage.structure.element.Ri - 6.28318530717959*I - sage: w1*eta2-w2*eta1 == pari(2*pi*I) - True -- sage: pari([0,0,0,-82,0]).ellinit(flag=1).elleta() -- Traceback (most recent call last): -- ... -- PariError: incorrect type in elleta - """ - pari_catch_sig_on() - return P.new_gen(elleta(self.g, prec_bits_to_words(precision))) -@@ -5865,7 +5843,8 @@ cdef class gen(sage.structure.element.Ri - sage: e.ellheight([1,0], flag=1) - 0.476711659343740 - sage: e.ellheight([1,0], precision=128).sage() -- 0.47671165934373953737948605888465305932 -+ 0.47671165934373953737948605888465305945902294217 # 32-bit -+ 0.476711659343739537379486058884653059459022942211150879336 # 64-bit - """ - cdef gen t0 = objtogen(a) - pari_catch_sig_on() -@@ -5894,13 +5873,6 @@ cdef class gen(sage.structure.element.Ri - sage: e = pari([0,1,1,-2,0]).ellinit().ellminimalmodel()[0] - sage: e.ellheightmatrix([[1,0], [-1,1]]) - [0.476711659343740, 0.418188984498861; 0.418188984498861, 0.686667083305587] -- -- It is allowed to call :meth:`ellinit` with ``flag=1``:: -- -- sage: E = pari([0,1,1,-2,0]).ellinit(flag=1) -- sage: E.ellheightmatrix([[1,0], [-1,1]], precision=128).sage() -- [0.47671165934373953737948605888465305932 0.41818898449886058562988945821587638244] -- [0.41818898449886058562988945821587638244 0.68666708330558658572355210295409678904] - """ - cdef gen t0 = objtogen(x) - pari_catch_sig_on() -@@ -6115,9 +6087,9 @@ cdef class gen(sage.structure.element.Ri - sage: e.elllseries(2.1) - 0.402838047956645 - sage: e.elllseries(1, precision=128) -- 2.87490929644255 E-38 -+ 2.98766720445395 E-38 - sage: e.elllseries(1, precision=256) -- 3.00282377034977 E-77 -+ 5.48956813891054 E-77 - sage: e.elllseries(-2) - 0 - sage: e.elllseries(2.1, A=1.1) -@@ -6232,8 +6204,6 @@ cdef class gen(sage.structure.element.Ri - [] - sage: e.ellordinate(5.0) - [11.3427192823270, -12.3427192823270] -- sage: e.ellordinate(RR(-3)) -- [-1/2 + 3.42782730020052*I, -1/2 - 3.42782730020052*I] - """ - cdef gen t0 = objtogen(x) - pari_catch_sig_on() -@@ -6326,26 +6296,19 @@ cdef class gen(sage.structure.element.Ri - cdef gen t0 = objtogen(z) - cdef gen t1 = objtogen(n) - pari_catch_sig_on() -- return P.new_gen(powell(self.g, t0.g, t1.g)) -+ return P.new_gen(ellmul(self.g, t0.g, t1.g)) - -- def ellrootno(self, p=1): -+ def ellrootno(self, p=None): - """ -- e.ellrootno(p): return the (local or global) root number of the -- `L`-series of the elliptic curve e -- -- If p is a prime number, the local root number at p is returned. If -- p is 1, the global root number is returned. Note that the global -- root number is the sign of the functional equation of the -- `L`-series, and therefore conjecturally equal to the parity -- of the rank of e. -+ Return the root number for the L-function of the elliptic curve -+ E/Q at a prime p (including 0, for the infinite place); return -+ the global root number if p is omitted. - - INPUT: - -- - - ``e`` - elliptic curve over `\QQ` - -- - ``p (default = 1)`` - 1 or a prime number -- -+ - ``p`` - a prime number or ``None``. - - OUTPUT: 1 or -1 - -@@ -6359,9 +6322,19 @@ cdef class gen(sage.structure.element.Ri - sage: e.ellrootno(1009) - 1 - """ -- cdef gen t0 = objtogen(p) -+ cdef gen t0 -+ cdef GEN g0 -+ if p is None: -+ g0 = NULL -+ elif p == 1: -+ from sage.misc.superseded import deprecation -+ deprecation(15767, 'The argument p=1 in ellrootno() is deprecated, use p=None instead') -+ g0 = NULL -+ else: -+ t0 = objtogen(p) -+ g0 = t0.g - pari_catch_sig_on() -- rootno = ellrootno(self.g, t0.g) -+ rootno = ellrootno(self.g, g0) - pari_catch_sig_off() - return rootno - -@@ -6407,11 +6380,11 @@ cdef class gen(sage.structure.element.Ri - cdef gen t0 = objtogen(z0) - cdef gen t1 = objtogen(z1) - pari_catch_sig_on() -- return P.new_gen(subell(self.g, t0.g, t1.g)) -+ return P.new_gen(ellsub(self.g, t0.g, t1.g)) - -- def elltaniyama(self): -+ def elltaniyama(self, long n=16): - pari_catch_sig_on() -- return P.new_gen(taniyama(self.g)) -+ return P.new_gen(elltaniyama(self.g, n)) - - def elltors(self, long flag=0): - """ -@@ -6453,7 +6426,7 @@ cdef class gen(sage.structure.element.Ri - - sage: e = pari([1,0,1,-19,26]).ellinit() - sage: e.elltors() -- [12, [6, 2], [[-2, 8], [3, -2]]] -+ [12, [6, 2], [[1, 2], [3, -2]]] - """ - pari_catch_sig_on() - return P.new_gen(elltors0(self.g, flag)) -@@ -6482,8 +6455,7 @@ cdef class gen(sage.structure.element.Ri - - sage: e = pari([0,0,0,1,0]).ellinit() - sage: e.ellzeta(1) -- 1.06479841295883 + 0.E-19*I # 32-bit -- 1.06479841295883 + 5.42101086242752 E-20*I # 64-bit -+ 1.06479841295883 - sage: C. = ComplexField() - sage: e.ellzeta(i-1) - -0.350122658523049 - 0.350122658523049*I -@@ -6513,8 +6485,7 @@ cdef class gen(sage.structure.element.Ri - sage: e = pari([0,0,0,1,0]).ellinit() - sage: C. = ComplexField() - sage: e.ellztopoint(1+i) -- [0.E-19 - 1.02152286795670*I, -0.149072813701096 - 0.149072813701096*I] # 32-bit -- [7.96075508054992 E-21 - 1.02152286795670*I, -0.149072813701096 - 0.149072813701096*I] # 64-bit -+ [0.E-19 - 1.02152286795670*I, -0.149072813701096 - 0.149072813701096*I] - - Complex numbers belonging to the period lattice of e are of course - sent to the point at infinity on e:: -@@ -6526,7 +6497,7 @@ cdef class gen(sage.structure.element.Ri - pari_catch_sig_on() - return P.new_gen(pointell(self.g, t0.g, prec_bits_to_words(precision))) - -- def omega(self): -+ def omega(self, unsigned long precision=0): - """ - e.omega(): return basis for the period lattice of the elliptic - curve e. -@@ -6535,9 +6506,10 @@ cdef class gen(sage.structure.element.Ri - - sage: e = pari([0, -1, 1, -10, -20]).ellinit() - sage: e.omega() -- [1.26920930427955, -0.634604652139777 - 1.45881661693850*I] -+ [1.26920930427955, 0.634604652139777 - 1.45881661693850*I] - """ -- return self[14:16] -+ pari_catch_sig_on() -+ return P.new_gen(ellR_omega(self.g, prec_bits_to_words(precision))) - - def disc(self): - """ -@@ -6551,7 +6523,8 @@ cdef class gen(sage.structure.element.Ri - sage: _.factor() - [-1, 1; 11, 5] - """ -- return self[11] -+ pari_catch_sig_on() -+ return P.new_gen(member_disc(self.g)) - - def j(self): - """ -@@ -6565,7 +6538,8 @@ cdef class gen(sage.structure.element.Ri - sage: _.factor() - [-1, 1; 2, 12; 11, -5; 31, 3] - """ -- return self[12] -+ pari_catch_sig_on() -+ return P.new_gen(member_j(self.g)) - - def ellj(self, unsigned long precision=0): - """ -@@ -6584,7 +6558,7 @@ cdef class gen(sage.structure.element.Ri - sage: pari(-I).ellj() - Traceback (most recent call last): - ... -- PariError: argument '-I' does not belong to upper half-plane -+ PariError: domain error in modular function: Im(argument) <= 0 - """ - pari_catch_sig_on() - return P.new_gen(jell(self.g, prec_bits_to_words(precision))) -@@ -6882,7 +6856,7 @@ cdef class gen(sage.structure.element.Ri - - sage: K. = QuadraticField(-1) - sage: F = pari(K).idealprimedec(5); F -- [[5, [-2, 1]~, 1, 1, [2, 1]~], [5, [2, 1]~, 1, 1, [-2, 1]~]] -+ [[5, [-2, 1]~, 1, 1, [2, -1; 1, 2]], [5, [2, 1]~, 1, 1, [-2, -1; 1, -2]]] - sage: F[0].pr_get_p() - 5 - """ -@@ -6924,7 +6898,7 @@ cdef class gen(sage.structure.element.Ri - sage: nf = F._pari_() - sage: I = pari('[1, -1, 2]~') - sage: nf.idealstar(I) -- [[[43, 9, 5; 0, 1, 0; 0, 0, 1], [0]], [42, [42]], Mat([[43, [9, 1, 0]~, 1, 1, [-5, -9, 1]~], 1]), [[[[42], [[3, 0, 0]~], [[3, 0, 0]~], [Vecsmall([])], 1]], [[], [], []]], Mat(1)] -+ [[[43, 9, 5; 0, 1, 0; 0, 0, 1], [0]], [42, [42]], Mat([[43, [9, 1, 0]~, 1, 1, [-5, 2, -18; -9, -5, 2; 1, -9, -5]], 1]), [[[[42], [3], [3], [Vecsmall([])], 1]], [[], [], []]], Mat(1)] - """ - cdef gen t0 = objtogen(I) - pari_catch_sig_on() -@@ -6968,18 +6942,30 @@ cdef class gen(sage.structure.element.Ri - - def nfbasis(self, long flag=0, fa=None): - """ -- nfbasis(x, flag, fa): integral basis of the field QQ[a], where ``a`` is -- a root of the polynomial x. -+ Integral basis of the field `\QQ[a]`, where ``a`` is a root of -+ the polynomial x. - -- Binary digits of ``flag`` mean: -+ INPUT: - -- - 1: assume that no square of a prime>primelimit divides the -- discriminant of ``x``. -- - 2: use round 2 algorithm instead of round 4. -- -- If present, ``fa`` provides the matrix of a partial factorization of -- the discriminant of ``x``, useful if one wants only an order maximal at -- certain primes only. -+ - ``flag``: if set to 1 and ``fa`` is not given: assume that no -+ square of a prime > 500000 divides the discriminant of ``x``. -+ -+ - ``fa``: If present, encodes a subset of primes at which to -+ check for maximality. This must be one of the three following -+ things: -+ -+ - an integer: check all primes up to ``fa`` using trial -+ division. -+ -+ - a vector: a list of primes to check. -+ -+ - a matrix: a partial factorization of the discriminant -+ of ``x``. -+ -+ .. NOTE:: -+ -+ In earlier versions of Sage, other bits in ``flag`` were -+ defined but these are now simply ignored. - - EXAMPLES:: - -@@ -6996,29 +6982,34 @@ cdef class gen(sage.structure.element.Ri - [1, x] - sage: pari(f).nfbasis() # Correct result - [1, 1/10000000019*x] -- sage: pari(f).nfbasis(fa = "[2,2; %s,2]"%p) # Correct result and faster -+ sage: pari(f).nfbasis(fa=10^6) # Check primes up to 10^6: wrong result -+ [1, x] -+ sage: pari(f).nfbasis(fa="[2,2; %s,2]"%p) # Correct result and faster -+ [1, 1/10000000019*x] -+ sage: pari(f).nfbasis(fa=[2,p]) # Equivalent with the above - [1, 1/10000000019*x] -- -- TESTS: -- -- ``flag`` = 2 should give the same result:: -- -- sage: pari('x^3 - 17').nfbasis(flag = 2) -- [1, x, 1/3*x^2 - 1/3*x + 1/3] - """ -+ if flag < 0 or flag > 1: -+ flag = flag & 1 -+ from sage.misc.superseded import deprecation -+ deprecation(15767, 'In nfbasis(), flag must be 0 or 1, other bits are deprecated and ignored') -+ - cdef gen t0 -- if not fa: -- pari_catch_sig_on() -- return P.new_gen(nfbasis0(self.g, flag, NULL)) -- else: -+ cdef GEN g0 -+ if fa is not None: - t0 = objtogen(fa) -- pari_catch_sig_on() -- return P.new_gen(nfbasis0(self.g, flag, t0.g)) -+ g0 = t0.g -+ elif flag: -+ g0 = utoi(500000) -+ else: -+ g0 = NULL -+ pari_catch_sig_on() -+ return P.new_gen(nfbasis(self.g, NULL, g0)) - - def nfbasis_d(self, long flag=0, fa=None): - """ -- nfbasis_d(x): Return a basis of the number field defined over QQ -- by x and its discriminant. -+ Like :meth:`nfbasis`, but return a tuple ``(B, D)`` where `B` -+ is the integral basis and `D` the discriminant. - - EXAMPLES:: - -@@ -7037,15 +7028,23 @@ cdef class gen(sage.structure.element.Ri - sage: pari([-2,0,0,1]).Polrev().nfbasis_d() - ([1, x, x^2], -108) - """ -+ if flag < 0 or flag > 1: -+ flag = flag & 1 -+ from sage.misc.superseded import deprecation -+ deprecation(15767, 'In nfbasis_d(), flag must be 0 or 1, other bits are deprecated and ignored') -+ - cdef gen t0 -+ cdef GEN g0 - cdef GEN disc -- if not fa: -- pari_catch_sig_on() -- B = P.new_gen_noclear(nfbasis(self.g, &disc, flag, NULL)) -- else: -+ if fa is not None: - t0 = objtogen(fa) -- pari_catch_sig_on() -- B = P.new_gen_noclear(nfbasis(self.g, &disc, flag, t0.g)) -+ g0 = t0.g -+ elif flag & 1: -+ g0 = utoi(500000) -+ else: -+ g0 = NULL -+ pari_catch_sig_on() -+ B = P.new_gen_noclear(nfbasis(self.g, &disc, g0)) - D = P.new_gen(disc) - return B, D - -@@ -7262,18 +7261,13 @@ cdef class gen(sage.structure.element.Ri - sage: A = matrix(F,[[1,2,a,3],[3,0,a+2,0],[0,0,a,2],[3+a,a,0,1]]) - sage: I = [F.ideal(-2*a+1),F.ideal(7), F.ideal(3),F.ideal(1)] - sage: Fp.nfhnf([pari(A),[pari(P) for P in I]]) -- [[1, [-969/5, -1/15]~, [15, -2]~, [-1938, -3]~; 0, 1, 0, 0; 0, 0, 1, 0; -- 0, 0, 0, 1], [[3997, 1911; 0, 7], [15, 6; 0, 3], [1, 0; 0, 1], [1, 0; 0, -- 1]]] -+ [[1, [-969/5, -1/15]~, [15, -2]~, [-1938, -3]~; 0, 1, 0, 0; 0, 0, 1, 0; 0, 0, 0, 1], [[3997, 1911; 0, 7], [15, 6; 0, 3], 1, 1]] - sage: K. = NumberField(x^3-2) - sage: Kp = pari(K) - sage: A = matrix(K,[[1,0,0,5*b],[1,2*b^2,b,57],[0,2,1,b^2-3],[2,0,0,b]]) - sage: I = [K.ideal(2),K.ideal(3+b^2),K.ideal(1),K.ideal(1)] - sage: Kp.nfhnf([pari(A),[pari(P) for P in I]]) -- [[1, -225, 72, -31; 0, 1, [0, -1, 0]~, [0, 0, -1/2]~; 0, 0, 1, [0, 0, -- -1/2]~; 0, 0, 0, 1], [[1116, 756, 612; 0, 18, 0; 0, 0, 18], [2, 0, 0; 0, -- 2, 0; 0, 0, 2], [1, 0, 0; 0, 1, 0; 0, 0, 1], [2, 0, 0; 0, 1, 0; 0, 0, -- 1]]] -+ [[1, -225, 72, -31; 0, 1, [0, -1, 0]~, [0, 0, -1/2]~; 0, 0, 1, [0, 0, -1/2]~; 0, 0, 0, 1], [[1116, 756, 612; 0, 18, 0; 0, 0, 18], 2, 1, [2, 0, 0; 0, 1, 0; 0, 0, 1]]] - - An example where the ring of integers of the number field is not a PID:: - -@@ -7282,15 +7276,11 @@ cdef class gen(sage.structure.element.Ri - sage: A = matrix(K,[[1,0,0,5*b],[1,2*b^2,b,57],[0,2,1,b^2-3],[2,0,0,b]]) - sage: I = [K.ideal(2),K.ideal(3+b^2),K.ideal(1),K.ideal(1)] - sage: Kp.nfhnf([pari(A),[pari(P) for P in I]]) -- [[1, [15, 6]~, [0, -54]~, [113, 72]~; 0, 1, [-4, -1]~, [0, -1]~; 0, 0, -- 1, 0; 0, 0, 0, 1], [[360, 180; 0, 180], [6, 4; 0, 2], [1, 0; 0, 1], [1, -- 0; 0, 1]]] -+ [[1, [15, 6]~, [0, -54]~, [113, 72]~; 0, 1, [-4, -1]~, [0, -1]~; 0, 0, 1, 0; 0, 0, 0, 1], [[360, 180; 0, 180], [6, 4; 0, 2], 1, 1]] - sage: A = matrix(K,[[1,0,0,5*b],[1,2*b,b,57],[0,2,1,b-3],[2,0,b,b]]) - sage: I = [K.ideal(2).factor()[0][0],K.ideal(3+b),K.ideal(1),K.ideal(1)] - sage: Kp.nfhnf([pari(A),[pari(P) for P in I]]) -- [[1, [7605, 4]~, [5610, 5]~, [7913, -6]~; 0, 1, 0, -1; 0, 0, 1, 0; 0, 0, -- 0, 1], [[19320, 13720; 0, 56], [2, 1; 0, 1], [1, 0; 0, 1], [1, 0; 0, -- 1]]] -+ [[1, [7605, 4]~, [5610, 5]~, [7913, -6]~; 0, 1, 0, -1; 0, 0, 1, 0; 0, 0, 0, 1], [[19320, 13720; 0, 56], [2, 1; 0, 1], 1, 1]] - - AUTHORS: - -@@ -7317,41 +7307,19 @@ cdef class gen(sage.structure.element.Ri - EXAMPLES:: - - sage: pari('x^3 - 17').nfinit() -- [x^3 - 17, [1, 1], -867, 3, [[1, 1.68006..., 2.57128...; 1, -0.340034... + 2.65083...*I, -1.28564... - 2.22679...*I], [1, 1.68006..., 2.57128...; 1, 2.31080..., -3.51243...; 1, -2.99087..., 0.941154...], [1, 2, 3; 1, 2, -4; 1, -3, 1], [3, 1, 0; 1, -11, 17; 0, 17, 0], [51, 0, 16; 0, 17, 3; 0, 0, 1], [17, 0, -1; 0, 0, 3; -1, 3, 2], [51, [-17, 6, -1; 0, -18, 3; 1, 0, -16]]], [2.57128..., -1.28564... - 2.22679...*I], [1, 1/3*x^2 - 1/3*x + 1/3, x], [1, 0, -1; 0, 0, 3; 0, 1, 1], [1, 0, 0, 0, -4, 6, 0, 6, -1; 0, 1, 0, 1, 1, -1, 0, -1, 3; 0, 0, 1, 0, 2, 0, 1, 0, 1]] -- -- TESTS: -+ [x^3 - 17, [1, 1], -867, 3, [[1, 1.68006914259990, 2.57128159065824; 1, -0.340034571299952 - 2.65083754153991*I, -1.28564079532912 + 2.22679517779329*I], [1, 1.68006914259990, 2.57128159065824; 1, -2.99087211283986, 0.941154382464174; 1, 2.31080297023995, -3.51243597312241], [1, 2, 3; 1, -3, 1; 1, 2, -4], [3, 1, 0; 1, -11, 17; 0, 17, 0], [51, 0, 16; 0, 17, 3; 0, 0, 1], [17, 0, -1; 0, 0, 3; -1, 3, 2], [51, [-17, 6, -1; 0, -18, 3; 1, 0, -16]], [3, 17]], [2.57128159065824, -1.28564079532912 + 2.22679517779329*I], [1, 1/3*x^2 - 1/3*x + 1/3, x], [1, 0, -1; 0, 0, 3; 0, 1, 1], [1, 0, 0, 0, -4, 6, 0, 6, -1; 0, 1, 0, 1, 1, -1, 0, -1, 3; 0, 0, 1, 0, 2, 0, 1, 0, 1]] - -- This example only works after increasing precision:: -+ TESTS:: - -- sage: pari('x^2 + 10^100 + 1').nfinit(precision=64) -- Traceback (most recent call last): -- ... -- PariError: precision too low in floorr (precision loss in truncation) - sage: pari('x^2 + 10^100 + 1').nfinit() - [...] -- -- Throw a PARI error which is not of type ``precer``:: -- - sage: pari('1.0').nfinit() - Traceback (most recent call last): - ... -- PariError: incorrect type in checknf -+ PariError: incorrect type in checknf [please apply nfinit()] (t_REAL) - """ -- # If explicit precision is given, use only that -- if precision: -- pari_catch_sig_on() -- return P.new_gen(nfinit0(self.g, flag, prec_bits_to_words(precision))) -- -- # Otherwise, start with 64 bits of precision and increase as needed: -- precision = 64 -- while True: -- try: -- return self.nfinit(flag, precision) -- except PariError as err: -- if err.errnum() == precer: -- precision *= 2 -- else: -- raise -+ pari_catch_sig_on() -+ return P.new_gen(nfinit0(self.g, flag, prec_bits_to_words(precision))) - - def nfisisom(self, gen other): - """ -@@ -7404,7 +7372,7 @@ cdef class gen(sage.structure.element.Ri - - sage: nf = pari('x^2 + 1').nfinit() - sage: nf.nfrootsof1() -- [4, -x] -+ [4, x] - """ - pari_catch_sig_on() - return P.new_gen(rootsof1(self.g)) -@@ -7442,12 +7410,12 @@ cdef class gen(sage.structure.element.Ri - def rnfeltabstorel(self, x): - cdef gen t0 = objtogen(x) - pari_catch_sig_on() -- return P.new_gen(rnfelementabstorel(self.g, t0.g)) -+ return P.new_gen(rnfeltabstorel(self.g, t0.g)) - - def rnfeltreltoabs(self, x): - cdef gen t0 = objtogen(x) - pari_catch_sig_on() -- return P.new_gen(rnfelementreltoabs(self.g, t0.g)) -+ return P.new_gen(rnfeltreltoabs(self.g, t0.g)) - - def rnfequation(self, poly, long flag=0): - cdef gen t0 = objtogen(poly) -@@ -7475,10 +7443,10 @@ cdef class gen(sage.structure.element.Ri - - sage: P = pari('[[[1, 0]~, [0, 0]~; [0, 0]~, [1, 0]~], [[2, 0; 0, 2], [2, 0; 0, 1/2]]]') - -- And this is the HNF of the inert ideal (2) in nf: -+ And this is the inert ideal (2) in nf: - - sage: rnf.rnfidealdown(P) -- [2, 0; 0, 2] -+ 2 - """ - cdef gen t0 = objtogen(x) - pari_catch_sig_on() -@@ -7487,7 +7455,7 @@ cdef class gen(sage.structure.element.Ri - def rnfidealhnf(self, x): - cdef gen t0 = objtogen(x) - pari_catch_sig_on() -- return P.new_gen(rnfidealhermite(self.g, t0.g)) -+ return P.new_gen(rnfidealhnf(self.g, t0.g)) - - def rnfidealnormrel(self, x): - cdef gen t0 = objtogen(x) -@@ -7538,11 +7506,11 @@ cdef class gen(sage.structure.element.Ri - sage: pari(-23).quadhilbert() - x^3 - x^2 + 1 - sage: pari(145).quadhilbert() -- x^4 - x^3 - 3*x^2 + x + 1 -+ x^4 - 6*x^2 - 5*x - 1 - sage: pari(-12).quadhilbert() # Not fundamental - Traceback (most recent call last): - ... -- PariError: quadray needs a fundamental discriminant -+ PariError: domain error in quadray: isfundamental(D) = 0 - """ - pari_catch_sig_on() - # Precision argument is only used for real quadratic extensions -@@ -7627,7 +7595,7 @@ cdef class gen(sage.structure.element.Ri - sage: pari('1/x').eval(0) - Traceback (most recent call last): - ... -- PariError: division by zero -+ PariError: impossible inverse in gdiv: 0 - sage: pari('1/x + O(x^2)').eval(0) - Traceback (most recent call last): - ... -@@ -7635,11 +7603,11 @@ cdef class gen(sage.structure.element.Ri - sage: pari('1/x + O(x^2)').eval(pari('O(x^3)')) - Traceback (most recent call last): - ... -- PariError: division by zero -+ PariError: impossible inverse in gdiv: O(x^3) - sage: pari('O(x^0)').eval(0) - Traceback (most recent call last): - ... -- PariError: non existent component in truecoeff -+ PariError: domain error in polcoeff: t_SER = O(x^0) - - Evaluating multivariate polynomials:: - -@@ -7705,9 +7673,9 @@ cdef class gen(sage.structure.element.Ri - sage: K. = NumberField(x^2 + 1) - sage: nf = K._pari_() - sage: nf -- [y^2 + 1, [0, 1], -4, 1, [Mat([1, 0.E-19 - 1.00000000000000*I]), [1, -1.00000000000000; 1, 1.00000000000000], [1, -1; 1, 1], [2, 0; 0, -2], [2, 0; 0, 2], [1, 0; 0, -1], [1, [0, -1; 1, 0]]], [0.E-19 - 1.00000000000000*I], [1, y], [1, 0; 0, 1], [1, 0, 0, -1; 0, 1, 1, 0]] -+ [y^2 + 1, [0, 1], -4, 1, [Mat([1, 0.E-19 + 1.00000000000000*I]), [1, 1.00000000000000; 1, -1.00000000000000], [1, 1; 1, -1], [2, 0; 0, -2], [2, 0; 0, 2], [1, 0; 0, -1], [1, [0, -1; 1, 0]], []], [0.E-19 + 1.00000000000000*I], [1, y], [1, 0; 0, 1], [1, 0, 0, -1; 0, 1, 1, 0]] - sage: nf(y='x') -- [x^2 + 1, [0, 1], -4, 1, [Mat([1, 0.E-19 - 1.00000000000000*I]), [1, -1.00000000000000; 1, 1.00000000000000], [1, -1; 1, 1], [2, 0; 0, -2], [2, 0; 0, 2], [1, 0; 0, -1], [1, [0, -1; 1, 0]]], [0.E-19 - 1.00000000000000*I], [1, x], [1, 0; 0, 1], [1, 0, 0, -1; 0, 1, 1, 0]] -+ [x^2 + 1, [0, 1], -4, 1, [Mat([1, 0.E-19 + 1.00000000000000*I]), [1, 1.00000000000000; 1, -1.00000000000000], [1, 1; 1, -1], [2, 0; 0, -2], [2, 0; 0, 2], [1, 0; 0, -1], [1, [0, -1; 1, 0]], []], [0.E-19 + 1.00000000000000*I], [1, x], [1, 0; 0, 1], [1, 0, 0, -1; 0, 1, 1, 0]] - """ - cdef long t = typ(self.g) - cdef gen t0 -@@ -7801,7 +7769,7 @@ cdef class gen(sage.structure.element.Ri - sage: T(0) - Traceback (most recent call last): - ... -- PariError: _/_: division by zero -+ PariError: _/_: impossible inverse in gdiv: 0 - sage: pari('() -> 42')(1,2,3) - Traceback (most recent call last): - ... -@@ -8027,7 +7995,7 @@ cdef class gen(sage.structure.element.Ri - non-constant polynomial, or False if f is reducible or constant. - """ - pari_catch_sig_on() -- cdef long t = itos(gisirreducible(self.g)) -+ t = isirreducible(self.g) - P.clear_stack() - return t != 0 - -@@ -8070,12 +8038,14 @@ cdef class gen(sage.structure.element.Ri - - def polroots(self, long flag=0, unsigned long precision=0): - """ -- polroots(x,flag=0): complex roots of the polynomial x. flag is -- optional, and can be 0: default, uses Schonhage's method modified -- by Gourdon, or 1: uses a modified Newton method. -+ Complex roots of the given polynomial using Schonhage's method, -+ as modified by Gourdon. - """ -+ if flag: -+ from sage.misc.superseded import deprecation -+ deprecation(15767, 'The flag argument to polroots() is deprecated and not used anymore') - pari_catch_sig_on() -- return P.new_gen(roots0(self.g, flag, prec_bits_to_words(precision))) -+ return P.new_gen(cleanroots(self.g, prec_bits_to_words(precision))) - - def polrootsmod(self, p, long flag=0): - cdef gen t0 = objtogen(p) -@@ -8143,7 +8113,7 @@ cdef class gen(sage.structure.element.Ri - x + O(x^4) - """ - pari_catch_sig_on() -- return P.new_gen(recip(self.g)) -+ return P.new_gen(serreverse(self.g)) - - def thueinit(self, long flag=0, unsigned long precision=0): - pari_catch_sig_on() -@@ -8347,7 +8317,7 @@ cdef class gen(sage.structure.element.Ri - [ - [ -5 -10 -2 -7 3] - [ 1 2 1 2 0] -- 10, 5.00000000023283..., [ 1 2 0 1 -1] -+ 10, 5.00000000000000000, [ 1 2 0 1 -1] - ] - - """ -@@ -8369,14 +8339,31 @@ cdef class gen(sage.structure.element.Ri - - def qfrep(self, B, long flag=0): - """ -- qfrep(x,B,flag=0): vector of (half) the number of vectors of norms -- from 1 to B for the integral and definite quadratic form x. Binary -- digits of flag mean 1: count vectors of even norm from 1 to 2B, 2: -- return a t_VECSMALL instead of a t_VEC. -+ Vector of (half) the number of vectors of norms from 1 to `B` -+ for the integral and definite quadratic form ``self``. -+ Binary digits of flag mean 1: count vectors of even norm from -+ 1 to `2B`, 2: return a ``t_VECSMALL`` instead of a ``t_VEC`` -+ (which is faster). -+ -+ EXAMPLES:: -+ -+ sage: M = pari("[5,1,1;1,3,1;1,1,1]") -+ sage: M.qfrep(20) -+ [1, 1, 2, 2, 2, 4, 4, 3, 3, 4, 2, 4, 6, 0, 4, 6, 4, 5, 6, 4] -+ sage: M.qfrep(20, flag=1) -+ [1, 2, 4, 3, 4, 4, 0, 6, 5, 4, 12, 4, 4, 8, 0, 3, 8, 6, 12, 12] -+ sage: M.qfrep(20, flag=2) -+ Vecsmall([1, 1, 2, 2, 2, 4, 4, 3, 3, 4, 2, 4, 6, 0, 4, 6, 4, 5, 6, 4]) - """ -+ # PARI 2.7 always returns a t_VECSMALL, but for backwards -+ # compatibility, we keep returning a t_VEC (unless flag & 2) - cdef gen t0 = objtogen(B) -+ cdef GEN r - pari_catch_sig_on() -- return P.new_gen(qfrep0(self.g, t0.g, flag)) -+ r = qfrep0(self.g, t0.g, flag & 1) -+ if (flag & 2) == 0: -+ r = vecsmall_to_vec(r) -+ return P.new_gen(r) - - def matsolve(self, B): - """ -@@ -8760,9 +8747,9 @@ cdef class gen(sage.structure.element.Ri - cdef gen t0 = objtogen(y) - cdef gen t1 = objtogen(p) - pari_catch_sig_on() -- ret = hilbert0(x.g, t0.g, t1.g) -- pari_catch_sig_off() -- return ret -+ r = hilbert(x.g, t0.g, t1.g) -+ P.clear_stack() -+ return r - - def chinese(self, y): - cdef gen t0 = objtogen(y) -@@ -8801,7 +8788,7 @@ cdef class gen(sage.structure.element.Ri - Mod(236736367459211723407, 473472734918423446802) - """ - pari_catch_sig_on() -- return P.new_gen(znprimroot0(self.g)) -+ return P.new_gen(znprimroot(self.g)) - - def __abs__(self): - return self.abs() -@@ -8829,8 +8816,8 @@ cdef class gen(sage.structure.element.Ri - """ - pari_catch_sig_on() - if add_one: -- return P.new_gen(gnextprime(gaddsg(1,self.g))) -- return P.new_gen(gnextprime(self.g)) -+ return P.new_gen(nextprime(gaddsg(1, self.g))) -+ return P.new_gen(nextprime(self.g)) - - def change_variable_name(self, var): - """ -@@ -8972,12 +8959,12 @@ cdef class gen(sage.structure.element.Ri - pari_catch_sig_on() - return P.new_gen(charpoly0(self.g, P.get_var(var), flag)) - -- - def kronecker(gen self, y): - cdef gen t0 = objtogen(y) - pari_catch_sig_on() -- return P.new_gen(gkronecker(self.g, t0.g)) -- -+ r = kronecker(self.g, t0.g) -+ P.clear_stack() -+ return r - - def type(gen self): - """ -@@ -9122,7 +9109,7 @@ cdef class gen(sage.structure.element.Ri - sage: om = e.omega() - sage: om - [2.49021256085506, -1.97173770155165*I] -- sage: om.elleisnum(2) # was: -5.28864933965426 -+ sage: om.elleisnum(2) - 10.0672605281120 - sage: om.elleisnum(4) - 112.000000000000 -@@ -9166,7 +9153,7 @@ cdef class gen(sage.structure.element.Ri - Compute P(1):: - - sage: E.ellwp(1) -- 13.9658695257485 + 0.E-18*I -+ 13.9658695257485 - - Compute P(1+i), where i = sqrt(-1):: - -@@ -9195,11 +9182,18 @@ cdef class gen(sage.structure.element.Ri - With flag=1, compute the pair P(z) and P'(z):: - - sage: E.ellwp(1, flag=1) -- [13.9658695257485 + 0.E-18*I, 50.5619300880073 ... E-18*I] -+ [13.9658695257485, 50.5619893875144] - """ - cdef gen t0 = objtogen(z) -+ cdef GEN g0 = t0.g -+ -+ # Emulate toser_i() but with given precision - pari_catch_sig_on() -- return P.new_gen(ellwp0(self.g, t0.g, flag, n+2, prec_bits_to_words(precision))) -+ if typ(g0) == t_POL: -+ g0 = RgX_to_ser(g0, n+4) -+ elif typ(g0) == t_RFRAC: -+ g0 = rfrac_to_ser(g0, n+4) -+ return P.new_gen(ellwp0(self.g, g0, flag, prec_bits_to_words(precision))) - - def ellchangepoint(self, y): - """ -@@ -9383,7 +9377,7 @@ class PariError(RuntimeError): - ....: pari('1/0') - ....: except PariError as err: - ....: print err.errnum() -- 27 -+ 30 - """ - return self.args[0] - -@@ -9429,7 +9423,7 @@ class PariError(RuntimeError): - ....: pari('1/0') - ....: except PariError as err: - ....: print err -- _/_: division by zero -+ _/_: impossible inverse in gdiv: 0 - - A syntax error:: - -@@ -9439,7 +9433,7 @@ class PariError(RuntimeError): - PariError: syntax error, unexpected $undefined: !@#$%^&*() - """ - lines = self.errtext().split('\n') -- if self.errnum() == syntaxer: -+ if self.errnum() == e_SYNTAX: - for line in lines: - if "syntax error" in line: - return line.lstrip(" *").rstrip(" .:") -diff -up src/sage/libs/pari/handle_error.pyx.orig src/sage/libs/pari/handle_error.pyx ---- src/sage/libs/pari/handle_error.pyx.orig 2014-08-13 11:16:54.349162303 -0300 -+++ src/sage/libs/pari/handle_error.pyx 2014-08-13 11:16:57.562162426 -0300 -@@ -27,7 +27,7 @@ cdef void _pari_init_error_handling(): - ....: except PariError as e: - ....: print e.errtext() - ....: -- *** argument must be positive in polcyclo. -+ *** domain error in polcyclo: index <= 0 - - """ - global pari_error_string -@@ -73,17 +73,17 @@ cdef int _pari_handle_exception(long err - sage: pari(1)/pari(0) - Traceback (most recent call last): - ... -- PariError: division by zero -+ PariError: impossible inverse in gdiv: 0 - - """ -- if err == errpile: -+ if err == e_STACK: - # PARI is out of memory. We double the size of the PARI stack - # and retry the computation. - from sage.libs.pari.all import pari - pari.allocatemem(silent=True) - return 0 - -- if err == user: -+ if err == e_USER: - raise RuntimeError("PARI user exception\n%s" % pari_error_string) - else: - from sage.libs.pari.all import PariError -diff -up src/sage/libs/pari/pari_instance.pxd.orig src/sage/libs/pari/pari_instance.pxd ---- src/sage/libs/pari/pari_instance.pxd.orig 2014-08-13 11:16:54.351162303 -0300 -+++ src/sage/libs/pari/pari_instance.pxd 2014-08-13 11:16:57.562162426 -0300 -@@ -13,6 +13,7 @@ cpdef long prec_bits_to_words(unsigned l - - @cython.final - cdef class PariInstance(sage.structure.parent_base.ParentWithBase): -+ cdef long _real_precision - cdef gen PARI_ZERO, PARI_ONE, PARI_TWO - cdef inline gen new_gen(self, GEN x) - cdef inline gen new_gen_noclear(self, GEN x) -diff -up src/sage/libs/pari/pari_instance.pyx.orig src/sage/libs/pari/pari_instance.pyx ---- src/sage/libs/pari/pari_instance.pyx.orig 2014-08-13 11:16:54.353162303 -0300 -+++ src/sage/libs/pari/pari_instance.pyx 2014-08-13 11:16:57.563162426 -0300 -@@ -20,6 +20,8 @@ AUTHORS: - - - Peter Bruin (2013-11-17): split off this file from gen.pyx (#15185) - -+- Jeroen Demeyer (2014-02-09): upgrade to PARI 2.7 (#15767) -+ - - EXAMPLES:: - -@@ -44,7 +46,7 @@ Arithmetic obeys the usual coercion rule - - GUIDE TO REAL PRECISION AND THE PARI LIBRARY - --The default real precision in communicating with the Pari library -+The default real precision in communicating with the PARI library - is the same as the default Sage real precision, which is 53 bits. - Inexact Pari objects are therefore printed by default to 15 decimal - digits (even if they are actually more precise). -@@ -132,14 +134,15 @@ with a precision of 100 bits:: - True - - Elliptic curves and precision: If you are working with elliptic --curves and want to compute with a precision other than the default --53 bits, you should use the precision parameter of ellinit():: -+curves, you should set the precision for each method:: - -- sage: R = RealField(150) -- sage: e = pari([0,0,0,-82,0]).ellinit(precision=150) -- sage: eta1 = e.elleta()[0] -- sage: R(eta1) -- 3.6054636014326520859158205642077267748102690 -+ sage: e = pari([0,0,0,-82,0]).ellinit() -+ sage: eta1 = e.elleta(precision=100)[0] -+ sage: eta1.sage() -+ 3.6054636014326520859158205642077267748 -+ sage: eta1 = e.elleta(precision=180)[0] -+ sage: eta1.sage() -+ 3.60546360143265208591582056420772677481026899659802474544 - - Number fields and precision: TODO - -@@ -157,9 +160,6 @@ include 'pari_err.pxi' - include 'sage/ext/stdsage.pxi' - include 'sage/ext/interrupt.pxi' - --cdef extern from 'c_lib/include/memory.h': -- void init_memory_functions() -- - import sys - - cimport libc.stdlib -@@ -348,8 +348,6 @@ pari_catch_sig_off() - pari = pari_instance - - --cdef unsigned long num_primes -- - # Callbacks from PARI to print stuff using sys.stdout.write() instead - # of C library functions like puts(). - cdef PariOUT sage_pariOut -@@ -432,7 +430,7 @@ cdef class PariInstance(sage.structure.p - if bot: - return # pari already initialized. - -- global num_primes, top, bot -+ global top, bot - - # The size here doesn't really matter, because we will allocate - # our own stack anyway. We ask PARI not to set up signal and -@@ -450,8 +448,6 @@ cdef class PariInstance(sage.structure.p - # so we need to reset them. - init_memory_functions() - -- num_primes = maxprime -- - # Free the PARI stack and allocate our own (using Cython) - pari_free(bot); bot = 0 - init_stack(size) -@@ -470,6 +466,7 @@ cdef class PariInstance(sage.structure.p - pariErr.flush = sage_pariErr_flush - - # Display only 15 digits -+ self._real_precision = 15 - sd_format("g.15", d_SILENT) - - # Init global prec variable (PARI's precision is always a -@@ -590,11 +587,12 @@ cdef class PariInstance(sage.structure.p - sage: pari.set_real_precision(15) - 60 - """ -- prev = self.get_real_precision() -+ prev = self._real_precision - cdef bytes strn = str(n) - pari_catch_sig_on() - sd_realprecision(strn, d_SILENT) - pari_catch_sig_off() -+ self._real_precision = n - return prev - - def get_real_precision(self): -@@ -613,10 +611,7 @@ cdef class PariInstance(sage.structure.p - sage: pari.get_real_precision() - 15 - """ -- pari_catch_sig_on() -- cdef long prev = itos(sd_realprecision(NULL, d_RETURN)) -- pari_catch_sig_off() -- return prev -+ return self._real_precision - - def set_series_precision(self, long n): - global precdl -@@ -1152,7 +1147,7 @@ cdef class PariInstance(sage.structure.p - def pari_version(self): - return str(PARIVERSION) - -- def init_primes(self, _M): -+ def init_primes(self, unsigned long M): - """ - Recompute the primes table including at least all primes up to M - (but possibly more). -@@ -1161,29 +1156,22 @@ cdef class PariInstance(sage.structure.p - - sage: pari.init_primes(200000) - -- We make sure that ticket #11741 has been fixed, and double check to -- make sure that diffptr has not been freed:: -+ We make sure that ticket :trac:`11741` has been fixed:: - -- sage: pari.init_primes(2^62) -+ sage: pari.init_primes(2^30) - Traceback (most recent call last): - ... -- PariError: not enough memory # 64-bit -- OverflowError: long int too large to convert # 32-bit -- sage: pari.init_primes(200000) -+ ValueError: Cannot compute primes beyond 436273290 - """ -- cdef unsigned long M -- cdef char *tmpptr -- M = _M -- global diffptr, num_primes -- if M <= num_primes: -+ # Hardcoded bound in PARI sources -+ if M > 436273290: -+ raise ValueError("Cannot compute primes beyond 436273290") -+ -+ if M <= maxprime(): - return - pari_catch_sig_on() -- tmpptr = initprimes(M) -+ initprimetable(M) - pari_catch_sig_off() -- pari_free( diffptr) -- num_primes = M -- diffptr = tmpptr -- - - ############################################## - ## Support for GP Scripts -@@ -1226,19 +1214,18 @@ cdef class PariInstance(sage.structure.p - - def _primelimit(self): - """ -- Return the number of primes already computed -- in this Pari instance. -+ Return the number of primes already computed by PARI. -+ -+ EXAMPLES:: - -- EXAMPLES: - sage: pari._primelimit() -- 500000 -+ 499979 - sage: pari.init_primes(600000) - sage: pari._primelimit() -- 600000 -+ 599999 - """ -- global num_primes - from sage.rings.all import ZZ -- return ZZ(num_primes) -+ return ZZ(maxprime()) - - def prime_list(self, long n): - """ -@@ -1307,8 +1294,6 @@ cdef class PariInstance(sage.structure.p - """ - nth_prime(n): returns the n-th prime, where n is a C-int - """ -- global num_primes -- - if n <= 0: - raise ValueError, "nth prime meaningless for non-positive n (=%s)"%n - cdef GEN g -@@ -1316,15 +1301,15 @@ cdef class PariInstance(sage.structure.p - g = prime(n) - return self.new_gen(g) - -- - def nth_prime(self, long n): - from sage.libs.pari.all import PariError - try: - return self.__nth_prime(n) - except PariError: -- self.init_primes(max(2*num_primes,20*n)) -+ self.init_primes(max(2*maxprime(), 20*n)) - return self.nth_prime(n) - -+ - def euler(self, unsigned long precision=0): - """ - Return Euler's constant to the requested real precision (in bits). -@@ -1493,16 +1478,16 @@ cdef class PariInstance(sage.structure.p - - TESTS: - -- Check that invalid inputs are handled properly (#11825):: -+ Check that invalid inputs are handled properly (:trac:`11825`):: - - sage: pari.setrand(0) - Traceback (most recent call last): - ... -- PariError: incorrect type in setrand -+ PariError: incorrect type in setrand (t_INT) - sage: pari.setrand("foobar") - Traceback (most recent call last): - ... -- PariError: incorrect type in setrand -+ PariError: incorrect type in setrand (t_POL) - """ - cdef gen t0 = self(seed) - pari_catch_sig_on() -@@ -1584,6 +1569,24 @@ cdef class PariInstance(sage.structure.p - k = k + 1 - return A - -+ def genus2red(self, Q, P): -+ """ -+ Let Q,P be polynomials with integer coefficients. Determine -+ the reduction at p > 2 of the (proper, smooth) hyperelliptic -+ curve C/Q: y^2+Qy = P, of genus 2. (The special fiber X_p of -+ the minimal regular model X of C over Z.) -+ -+ EXAMPLES:: -+ -+ sage: x = polygen(QQ) -+ sage: pari.genus2red(x^3 - 2*x^2 - 2*x + 1, -5*x^5) -+ [1416875, [2, -1; 5, 4; 2267, 1], x^6 - 240*x^4 - 2550*x^3 - 11400*x^2 - 24100*x - 19855, [[2, [2, [Mod(1, 2)]], []], [5, [1, []], ["[V] page 156", [3]]], [2267, [2, [Mod(432, 2267)]], ["[I{1-0-0}] page 170", []]]]] -+ """ -+ cdef gen t0 = objtogen(Q) -+ cdef gen t1 = objtogen(P) -+ pari_catch_sig_on() -+ return self.new_gen(genus2red(t0.g, t1.g, NULL)) -+ - - cdef int init_stack(size_t requested_size) except -1: - r""" -diff -up src/sage/matrix/matrix_rational_dense.pyx.orig src/sage/matrix/matrix_rational_dense.pyx ---- src/sage/matrix/matrix_rational_dense.pyx.orig 2014-08-13 11:16:54.355162303 -0300 -+++ src/sage/matrix/matrix_rational_dense.pyx 2014-08-13 11:16:57.563162426 -0300 -@@ -2617,7 +2617,7 @@ cdef class Matrix_rational_dense(matrix_ - sage: matrix(QQ,2,[1,2,2,4])._invert_pari() - Traceback (most recent call last): - ... -- PariError: non invertible matrix in gauss -+ PariError: impossible inverse in ginv: 0 - """ - if self._nrows != self._ncols: - raise ValueError("self must be a square matrix") -diff -up src/sage/modular/cusps_nf.py.orig src/sage/modular/cusps_nf.py ---- src/sage/modular/cusps_nf.py.orig 2014-08-13 11:16:54.357162304 -0300 -+++ src/sage/modular/cusps_nf.py 2014-08-13 11:16:57.563162426 -0300 -@@ -41,7 +41,7 @@ Different operations with cusps over a n - sage: alpha.ideal() - Fractional ideal (7, a + 3) - sage: alpha.ABmatrix() -- [a + 10, 3*a - 1, 7, 2*a] -+ [a + 10, -3*a + 1, 7, -2*a] - sage: alpha.apply([0, 1, -1,0]) - Cusp [7: -a - 10] of Number Field in a with defining polynomial x^2 + 5 - -@@ -895,7 +895,7 @@ class NFCusp(Element): - Given R a Dedekind domain and A, B ideals of R in inverse classes, an - AB-matrix is a matrix realizing the isomorphism between R+R and A+B. - An AB-matrix associated to a cusp [a1: a2] is an AB-matrix with A the -- ideal associated to the cusp (A=) and first column given by -+ ideal associated to the cusp (A=) and first column given by - the coefficients of the cusp. - - EXAMPLES: -@@ -1295,7 +1295,7 @@ def units_mod_ideal(I): - [1] - sage: I = k.ideal(3) - sage: units_mod_ideal(I) -- [1, -a, -1, a] -+ [1, a, -1, -a] - - :: - -diff -up src/sage/modular/modform/constructor.py.orig src/sage/modular/modform/constructor.py ---- src/sage/modular/modform/constructor.py.orig 2014-08-13 11:16:54.359162304 -0300 -+++ src/sage/modular/modform/constructor.py 2014-08-13 11:16:57.564162426 -0300 -@@ -430,7 +430,7 @@ def Newforms(group, weight=2, base_ring= - base field that is not minimal for that character:: - - sage: K. = QuadraticField(-1) -- sage: chi = DirichletGroup(5, K)[3] -+ sage: chi = DirichletGroup(5, K)[1] - sage: len(Newforms(chi, 7, names='a')) - 1 - sage: x = polygen(K); L. = K.extension(x^2 - 402*i) -diff -up src/sage/quadratic_forms/quadratic_form__automorphisms.py.orig src/sage/quadratic_forms/quadratic_form__automorphisms.py ---- src/sage/quadratic_forms/quadratic_form__automorphisms.py.orig 2014-08-13 11:16:54.361162304 -0300 -+++ src/sage/quadratic_forms/quadratic_form__automorphisms.py 2014-08-13 11:16:57.564162426 -0300 -@@ -220,18 +220,16 @@ def short_vector_list_up_to_length(self, - ... - ValueError: Quadratic form must be positive definite in order to enumerate short vectors - -- Sometimes, PARI does not compute short vectors correctly. It returns too long vectors. -- -- :: -+ Check that PARI doesn't return vectors which are too long:: - - sage: Q = QuadraticForm(matrix(2, [72, 12, 12, 120])) - sage: len_bound_pari = 2*22953421 - 2; len_bound_pari - 45906840 - sage: vs = list(Q._pari_().qfminim(len_bound_pari)[2]) # long time (18s on sage.math, 2014) - sage: v = vs[0]; v # long time -- [-65, 623]~ -+ [-66, 623]~ - sage: v.Vec() * Q._pari_() * v # long time -- 45907800 -+ 45902280 - """ - if not self.is_positive_definite() : - raise ValueError( "Quadratic form must be positive definite in order to enumerate short vectors" ) -@@ -256,11 +254,9 @@ def short_vector_list_up_to_length(self, - # Sort the vectors into lists by their length - vec_sorted_list = [list() for i in range(len_bound)] - for i in range(len(parilist)): -- length = ZZ(parilens[i]) -- # PARI can sometimes return longer vectors than requested. -- # E.g. : self.matrix() == matrix(2, [72, 12, 12, 120]) -- # len_bound = 22953421 -- # gives maximal length 22955664 -+ length = int(parilens[i]) -+ # In certain trivial cases, PARI can sometimes return longer -+ # vectors than requested. - if length < len_bound: - v = parilist[i] - sagevec = V(list(parilist[i])) -diff -up src/sage/rings/arith.py.orig src/sage/rings/arith.py ---- src/sage/rings/arith.py.orig 2014-08-13 11:16:54.363162304 -0300 -+++ src/sage/rings/arith.py 2014-08-13 11:16:57.565162426 -0300 -@@ -2443,7 +2443,7 @@ def factor(n, proof=None, int_=False, al - - sage: K. = QuadraticField(-1) - sage: factor(122 - 454*i) -- (-1) * (-i - 4) * (-3*i - 2) * (-i - 2)^3 * (i + 1)^3 -+ (-3*i - 2) * (-i - 2)^3 * (i + 1)^3 * (i + 4) - - To access the data in a factorization:: - -@@ -4530,6 +4530,8 @@ def hilbert_symbol(a, b, p, algorithm="p - b = QQ(b).numerator() * QQ(b).denominator() - - if algorithm == "pari": -+ if p == -1: -+ p = 0 - return ZZ(pari(a).hilbert(b,p)) - - elif algorithm == 'direct': -@@ -5655,7 +5657,7 @@ def dedekind_sum(p, q, algorithm='defaul - sage: dedekind_sum(3^54 - 1, 2^93 + 1, algorithm='pari') - 459340694971839990630374299870/29710560942849126597578981379 - -- Pari uses a different definition if the inputs are not coprime:: -+ We check consistency of the results:: - - sage: dedekind_sum(5, 7, algorithm='default') - -1/14 -@@ -5668,7 +5670,7 @@ def dedekind_sum(p, q, algorithm='defaul - sage: dedekind_sum(6, 8, algorithm='flint') - -1/8 - sage: dedekind_sum(6, 8, algorithm='pari') -- -1/24 -+ -1/8 - - REFERENCES: - -diff -up src/sage/rings/complex_double.pyx.orig src/sage/rings/complex_double.pyx ---- src/sage/rings/complex_double.pyx.orig 2014-08-13 11:16:54.365162304 -0300 -+++ src/sage/rings/complex_double.pyx 2014-08-13 11:16:57.565162426 -0300 -@@ -2103,8 +2103,8 @@ cdef class ComplexDoubleElement(FieldEle - - The optional argument allows us to omit the fractional part:: - -- sage: z.eta(omit_frac=True) # abs tol 1e-12 -- 0.998129069926 - 8.12769318782e-22*I -+ sage: z.eta(omit_frac=True) -+ 0.998129069926 - sage: pi = CDF(pi) - sage: prod([1-exp(2*pi*i*n*z) for n in range(1,10)]) # abs tol 1e-12 - 0.998129069926 + 4.59084695545e-19*I -@@ -2182,7 +2182,7 @@ cdef class ComplexDoubleElement(FieldEle - sage: a.agm(b, algorithm='principal') - 0.338175462986 - 0.0135326969565*I - sage: a.agm(b, algorithm='pari') -- 0.080689185076 + 0.239036532686*I -+ -0.371591652352 + 0.319894660207*I - - Some degenerate cases:: - -diff -up src/sage/rings/complex_number.pyx.orig src/sage/rings/complex_number.pyx ---- src/sage/rings/complex_number.pyx.orig 2014-08-13 11:16:54.368162304 -0300 -+++ src/sage/rings/complex_number.pyx 2014-08-13 11:16:57.566162426 -0300 -@@ -1508,7 +1508,7 @@ cdef class ComplexNumber(sage.structure. - - sage: z = 1 + i - sage: z.eta(omit_frac=True) -- 0.998129069925959 - 8.12769318...e-22*I -+ 0.998129069925959 - sage: prod([1-exp(2*pi*i*n*z) for n in range(1,10)]) - 0.998129069925958 + 4.59099857829247e-19*I - -@@ -1721,13 +1721,13 @@ cdef class ComplexNumber(sage.structure. - sage: a.agm(b, algorithm="principal") - 0.338175462986180 - 0.0135326969565405*I - sage: a.agm(b, algorithm="pari") -- 0.0806891850759812 + 0.239036532685557*I -+ -0.371591652351761 + 0.319894660206830*I - sage: a.agm(b, algorithm="optimal").abs() - 0.490319232466314 - sage: a.agm(b, algorithm="principal").abs() - 0.338446122230459 - sage: a.agm(b, algorithm="pari").abs() -- 0.252287947683910 -+ 0.490319232466314 - - TESTS: - -@@ -2021,7 +2021,7 @@ cdef class ComplexNumber(sage.structure. - - sage: C, i = ComplexField(30).objgen() - sage: (1+i).gamma_inc(2 + 3*i) -- 0.0020969149 - 0.059981914*I -+ 0.002096914... - 0.059981914*I - sage: (1+i).gamma_inc(5) - -0.0013781309 + 0.0065198200*I - sage: C(2).gamma_inc(1 + i) -diff -up src/sage/rings/fast_arith.pyx.orig src/sage/rings/fast_arith.pyx ---- src/sage/rings/fast_arith.pyx.orig 2014-08-13 11:16:54.370162304 -0300 -+++ src/sage/rings/fast_arith.pyx 2014-08-13 11:16:57.566162426 -0300 -@@ -46,7 +46,7 @@ include "sage/ext/stdsage.pxi" - include "sage/libs/pari/decl.pxi" - - cdef extern from "pari/pari.h": -- cdef long NEXT_PRIME_VIADIFF(long, unsigned char*) -+ cdef long NEXT_PRIME_VIADIFF(long, byteptr) - - from sage.rings.integer_ring import ZZ - from sage.libs.pari.gen cimport gen as pari_gen -@@ -84,7 +84,8 @@ cpdef prime_range(start, stop=None, algo - - ``py_ints`` -- boolean (default False), return Python ints rather than Sage Integers (faster) - - -- EXAMPLES: -+ EXAMPLES:: -+ - sage: prime_range(10) - [2, 3, 5, 7] - sage: prime_range(7) -@@ -110,21 +111,31 @@ cpdef prime_range(start, stop=None, algo - sage: type(prime_range(8,algorithm="pari_isprime")[0]) - - -- TESTS: -- sage: len(prime_range(25000,2500000)) -+ TESTS:: -+ -+ sage: prime_range(-1) -+ [] -+ sage: L = prime_range(25000,2500000) -+ sage: len(L) - 180310 -- sage: prime_range(2500000)[-1].is_prime() -- True -+ sage: L[-10:] -+ [2499923, 2499941, 2499943, 2499947, 2499949, 2499953, 2499967, 2499983, 2499989, 2499997] -+ -+ A non-trivial range without primes:: -+ -+ sage: prime_range(4652360, 4652400) -+ [] - - AUTHORS: -- - William Stein (original version) -- - Craig Citro (rewrote for massive speedup) -- - Kevin Stueve (added primes iterator option) 2010-10-16 -- - Robert Bradshaw (speedup using Pari prime table, py_ints option) -+ -+ - William Stein (original version) -+ - Craig Citro (rewrote for massive speedup) -+ - Kevin Stueve (added primes iterator option) 2010-10-16 -+ - Robert Bradshaw (speedup using Pari prime table, py_ints option) - """ - cdef Integer z -- cdef long c_start, c_stop, p -- cdef unsigned char* pari_prime_ptr -+ cdef long c_start, c_stop, p, maxpr -+ cdef byteptr pari_prime_ptr - if algorithm == "pari_primes": - if stop is None: - # In this case, "start" is really stop -@@ -133,13 +144,18 @@ cpdef prime_range(start, stop=None, algo - else: - c_start = start - c_stop = stop -- if c_stop <= c_start: -- return [] - if c_start < 1: - c_start = 1 -+ if c_stop <= c_start: -+ return [] -+ - if maxprime() < c_stop: -- pari.init_primes(c_stop) -- pari_prime_ptr = diffptr -+ # Adding 1500 should be sufficient to guarantee an -+ # additional prime, given that c_stop < 2^63. -+ pari.init_primes(c_stop + 1500) -+ assert maxprime() >= c_stop -+ -+ pari_prime_ptr = diffptr - p = 0 - res = [] - while p < c_start: -diff -up src/sage/rings/finite_rings/element_ext_pari.py.orig src/sage/rings/finite_rings/element_ext_pari.py ---- src/sage/rings/finite_rings/element_ext_pari.py.orig 2014-08-13 11:16:54.372162304 -0300 -+++ src/sage/rings/finite_rings/element_ext_pari.py 2014-08-13 11:16:57.566162426 -0300 -@@ -284,20 +284,20 @@ class FiniteField_ext_pariElement(Finite - if not value: - value = [0] - try: -- # First, try the conversion directly in PARI. This -- # should cover the most common cases, like converting -- # from integers or intmods. - # Convert the list to PARI, then mod out the -- # characteristic (PARI can do this directly for lists), -- # convert to a polynomial with variable "a" and finally -- # mod out the field modulus. -- self.__value = pari(value).Mod(parent.characteristic()).Polrev("a").Mod(parent._pari_modulus()) -+ # characteristic (PARI can do this directly for lists). -+ # If we get only INTMODs, we can do the conversion -+ # directly. -+ parilist = pari(value).Mod(parent.characteristic()) -+ if not all(c.type() == "t_INTMOD" for c in parilist): -+ raise RuntimeError - except RuntimeError: - # That didn't work, do it in a more general but also - # slower way: first convert all list elements to the - # prime field. - GFp = parent.prime_subfield() -- self.__value = pari([GFp(c) for c in value]).Polrev("a").Mod(parent._pari_modulus()) -+ parilist = pari([GFp(c) for c in value]) -+ self.__value = parilist.Polrev("a").Mod(parent._pari_modulus()) - elif isinstance(value, str): - raise TypeError("value must not be a string") - else: -diff -up src/sage/rings/finite_rings/finite_field_prime_modn.py.orig src/sage/rings/finite_rings/finite_field_prime_modn.py ---- src/sage/rings/finite_rings/finite_field_prime_modn.py.orig 2014-08-13 11:16:54.374162304 -0300 -+++ src/sage/rings/finite_rings/finite_field_prime_modn.py 2014-08-13 11:16:57.566162426 -0300 -@@ -161,7 +161,7 @@ class FiniteField_prime_modn(FiniteField - sage: RF13 = K.residue_field(pp) - sage: RF13.hom([GF(13)(1)]) - Ring morphism: -- From: Residue field of Fractional ideal (w - 18) -+ From: Residue field of Fractional ideal (-w + 18) - To: Finite Field of size 13 - Defn: 1 |--> 1 - """ -diff -up src/sage/rings/integer.pyx.orig src/sage/rings/integer.pyx ---- src/sage/rings/integer.pyx.orig 2014-08-13 11:16:54.376162304 -0300 -+++ src/sage/rings/integer.pyx 2014-08-13 11:16:57.567162426 -0300 -@@ -4769,8 +4769,7 @@ cdef class Integer(sage.structure.elemen - sage: 3._bnfisnorm(QuadraticField(-1, 'i')) - (1, 3) - sage: 7._bnfisnorm(CyclotomicField(7)) -- (-zeta7 + 1, 1) # 64-bit -- (-zeta7^5 + zeta7^4, 1) # 32-bit -+ (zeta7^5 - zeta7, 1) - """ - from sage.rings.rational_field import QQ - return QQ(self)._bnfisnorm(K, proof=proof, extra_primes=extra_primes) -diff -up src/sage/rings/number_field/class_group.py.orig src/sage/rings/number_field/class_group.py ---- src/sage/rings/number_field/class_group.py.orig 2014-08-13 11:16:54.378162304 -0300 -+++ src/sage/rings/number_field/class_group.py 2014-08-13 11:16:57.568162426 -0300 -@@ -223,7 +223,7 @@ class FractionalIdealClass(AbelianGroupW - sage: k. = NumberField(x^2 + 20072); G = k.class_group(); G - Class group of order 76 with structure C38 x C2 - of Number Field in a with defining polynomial x^2 + 20072 -- sage: I = (G.0)^35; I -+ sage: I = (G.0)^11; I - Fractional ideal class (41, 1/2*a + 5) - sage: J = G(I.ideal()^5); J - Fractional ideal class (115856201, 1/2*a + 40407883) -@@ -471,7 +471,7 @@ class ClassGroup(AbelianGroupWithValues_ - Class group of order 68 with structure C34 x C2 of Number Field - in a with defining polynomial x^2 + x + 23899 - sage: C.gens() -- (Fractional ideal class (23, a + 14), Fractional ideal class (5, a + 3)) -+ (Fractional ideal class (7, a + 5), Fractional ideal class (5, a + 3)) - sage: C.ngens() - 2 - """ -diff -up src/sage/rings/number_field/galois_group.py.orig src/sage/rings/number_field/galois_group.py ---- src/sage/rings/number_field/galois_group.py.orig 2014-08-13 11:16:54.380162304 -0300 -+++ src/sage/rings/number_field/galois_group.py 2014-08-13 11:16:57.568162426 -0300 -@@ -404,10 +404,12 @@ class GaloisGroup_v2(PermutationGroup_ge - - EXAMPLE:: - -- sage: L = CyclotomicField(7) -+ sage: L. = CyclotomicField(7) - sage: G = L.galois_group() -- sage: G.complex_conjugation() -- (1,6)(2,3)(4,5) -+ sage: conj = G.complex_conjugation(); conj -+ (1,4)(2,5)(3,6) -+ sage: conj(z) -+ -z^5 - z^4 - z^3 - z^2 - z - 1 - - An example where the field is not CM, so complex conjugation really - depends on the choice of embedding:: -diff -up src/sage/rings/number_field/maps.py.orig src/sage/rings/number_field/maps.py ---- src/sage/rings/number_field/maps.py.orig 2014-08-13 11:16:54.383162304 -0300 -+++ src/sage/rings/number_field/maps.py 2014-08-13 11:16:57.568162426 -0300 -@@ -302,12 +302,12 @@ class MapRelativeVectorSpaceToRelativeNu - # Apply to_B, so now each coefficient is in an absolute field, - # and is expressed in terms of a polynomial in y, then make - # the PARI poly in x. -- w = [pari(to_B(a).polynomial('y')) for a in w] -+ w = [to_B(a)._pari_('y') for a in w] - h = pari(w).Polrev() - - # Next we write the poly in x over a poly in y in terms - # of an absolute polynomial for the rnf. -- g = self.__R(self.__rnf.rnfeltreltoabs(h)) -+ g = self.__rnf.rnfeltreltoabs(h) - return self.__K._element_class(self.__K, g) - - class MapRelativeNumberFieldToRelativeVectorSpace(NumberFieldIsomorphism): -diff -up src/sage/rings/number_field/number_field_element.pyx.orig src/sage/rings/number_field/number_field_element.pyx ---- src/sage/rings/number_field/number_field_element.pyx.orig 2014-08-13 11:16:54.385162305 -0300 -+++ src/sage/rings/number_field/number_field_element.pyx 2014-08-13 11:16:57.569162426 -0300 -@@ -329,9 +329,11 @@ cdef class NumberFieldElement(FieldEleme - fmod = f.mod() - for i from 0 <= i <= fmod.poldegree(): - if fmod.polcoeff(i).type() in ["t_POL", "t_POLMOD"]: -- # Convert relative element to absolute -- # This returns a polynomial, not a polmod -- f = parent.pari_rnf().rnfeltreltoabs(f) -+ # Convert relative element to absolute. -+ # Sometimes the result is a polynomial, -+ # sometimed a polmod. Lift to convert to a -+ # polynomial in all cases. -+ f = parent.pari_rnf().rnfeltreltoabs(f).lift() - break - # Check that the modulus is actually the defining polynomial - # of the number field. -@@ -1207,7 +1209,7 @@ cdef class NumberFieldElement(FieldEleme - sage: Q. = K[] - sage: L. = NumberField(X^4 + a) - sage: t = (-a).is_norm(L, element=True); t -- (True, -b^3 + 1) -+ (True, b^3 + 1) - sage: t[1].norm(K) - -a - -@@ -1308,11 +1310,11 @@ cdef class NumberFieldElement(FieldEleme - sage: Q. = K[] - sage: L. = NumberField(X^4 + a) - sage: t = (-a)._rnfisnorm(L); t -- (-b^3 + 1, 1) -+ (b^3 + 1, 1) - sage: t[0].norm(K) - -a - sage: t = K(3)._rnfisnorm(L); t -- ((a^2 + 1)*b^3 + b^2 - a*b + a^2 + 1, -3*a) -+ ((a^2 + 1)*b^3 - b^2 - a*b - a^2, -3*a^2 + 3*a - 3) - sage: t[0].norm(K)*t[1] - 3 - -@@ -1342,6 +1344,9 @@ cdef class NumberFieldElement(FieldEleme - - rnf_data = K.pari_rnfnorm_data(L, proof=proof) - x, q = self._pari_().rnfisnorm(rnf_data) -+ -+ # Convert x to an absolute element -+ x = L.pari_rnf().rnfeltreltoabs(x) - return L(x), K(q) - - def _mpfr_(self, R): -@@ -1358,7 +1363,7 @@ cdef class NumberFieldElement(FieldEleme - sage: (a^2)._mpfr_(RR) - -1.00000000000000 - -- Verify that :trac:`#13005` has been fixed:: -+ Verify that :trac:`13005` has been fixed:: - - sage: K. = NumberField(x^2-5) - sage: RR(K(1)) -@@ -3905,12 +3910,12 @@ cdef class NumberFieldElement_relative(N - sage: K. = NumberField(y^2 + y + 1) - sage: x = polygen(K) - sage: L. = NumberField(x^4 + a*x + 2) -- sage: e = pari(a*b); e -- Mod(-y^4 - 2, y^8 - y^5 + 4*y^4 + y^2 - 2*y + 4) -+ sage: e = (a*b)._pari_('x'); e -+ Mod(-x^4 - 2, x^8 - x^5 + 4*x^4 + x^2 - 2*x + 4) - sage: L(e) # Conversion from PARI absolute number field element - a*b - sage: e = L.pari_rnf().rnfeltabstorel(e); e -- Mod(Mod(y, y^2 + y + 1)*x, x^4 + y*x + 2) -+ Mod(Mod(y, y^2 + y + 1)*x, x^4 + Mod(y, y^2 + y + 1)*x + 2) - sage: L(e) # Conversion from PARI relative number field element - a*b - sage: e = pari('Mod(0, x^8 + 1)'); L(e) # Wrong modulus -@@ -3924,10 +3929,12 @@ cdef class NumberFieldElement_relative(N - sage: L(e) - a*b^2 + 1 - -- Currently, conversions of PARI relative number fields are not checked:: -+ This wrong modulus yields a PARI error:: - -- sage: e = pari('Mod(y*x, x^4 + y^2*x + 2)'); L(e) # Wrong modulus, but succeeds anyway -- a*b -+ sage: e = pari('Mod(y*x, x^4 + y^2*x + 2)'); L(e) -+ Traceback (most recent call last): -+ ... -+ PariError: inconsistent moduli in rnfeltreltoabs: x^4 + y^2*x + 2 != y^2 + y + 1 - """ - NumberFieldElement.__init__(self, parent, f) - -diff -up src/sage/rings/number_field/number_field_ideal.py.orig src/sage/rings/number_field/number_field_ideal.py ---- src/sage/rings/number_field/number_field_ideal.py.orig 2014-08-13 11:16:54.387162305 -0300 -+++ src/sage/rings/number_field/number_field_ideal.py 2014-08-13 11:16:57.569162426 -0300 -@@ -83,14 +83,17 @@ def convert_from_idealprimedec_form(fiel - sage: K_bnf = gp(K.pari_bnf()) - sage: ideal = K_bnf.idealprimedec(3)[1] - sage: convert_from_idealprimedec_form(K, ideal) -+ doctest:...: DeprecationWarning: convert_from_idealprimedec_form() is deprecated -+ See http://trac.sagemath.org/15767 for details. - Fractional ideal (-a) - sage: K.factor(3) - (Fractional ideal (-a))^2 -- - """ -- # This indexation is very ugly and should be dealt with in #10002 -+ from sage.misc.superseded import deprecation -+ deprecation(15767, "convert_from_idealprimedec_form() is deprecated") -+ - p = ZZ(ideal[1]) -- alpha = field(field.pari_nf().getattr('zk') * ideal[2]) -+ alpha = field(field.pari_zk() * ideal[2]) - return field.ideal(p, alpha) - - def convert_to_idealprimedec_form(field, ideal): -@@ -116,16 +119,13 @@ def convert_to_idealprimedec_form(field, - sage: K. = NumberField(x^2 + 3) - sage: P = K.ideal(a/2-3/2) - sage: convert_to_idealprimedec_form(K, P) -- [3, [1, 2]~, 2, 1, [1, -1]~] -- -+ doctest:...: DeprecationWarning: convert_to_idealprimedec_form() is deprecated, use ideal.pari_prime() instead -+ See http://trac.sagemath.org/15767 for details. -+ [3, [1, 2]~, 2, 1, [1, 1; -1, 2]] - """ -- p = ideal.residue_field().characteristic() -- from sage.interfaces.gp import gp -- K_bnf = gp(field.pari_bnf()) -- for primedecform in K_bnf.idealprimedec(p): -- if convert_from_idealprimedec_form(field, primedecform) == ideal: -- return primedecform -- raise RuntimeError -+ from sage.misc.superseded import deprecation -+ deprecation(15767, "convert_to_idealprimedec_form() is deprecated, use ideal.pari_prime() instead") -+ return field.ideal(ideal).pari_prime() - - class NumberFieldIdeal(Ideal_generic): - """ -@@ -157,7 +157,7 @@ class NumberFieldIdeal(Ideal_generic): - Fractional ideal (3) - sage: F = pari(K).idealprimedec(5) - sage: K.ideal(F[0]) -- Fractional ideal (i - 2) -+ Fractional ideal (2*i + 1) - - TESTS: - -@@ -165,7 +165,7 @@ class NumberFieldIdeal(Ideal_generic): - prime ideal:: - - sage: K.ideal(pari(K).idealprimedec(5)[0])._pari_prime -- [5, [-2, 1]~, 1, 1, [2, 1]~] -+ [5, [-2, 1]~, 1, 1, [2, -1; 1, 2]] - """ - if not isinstance(field, number_field.NumberField_generic): - raise TypeError("field (=%s) must be a number field."%field) -@@ -195,8 +195,8 @@ class NumberFieldIdeal(Ideal_generic): - EXAMPLES:: - - sage: NumberField(x^2 + 1, 'a').ideal(7).__hash__() -- -9223372036854775779 # 64-bit -- -2147483619 # 32-bit -+ 848642427 # 32-bit -+ 3643975048496365947 # 64-bit - """ - try: - return self._hash -@@ -313,7 +313,7 @@ class NumberFieldIdeal(Ideal_generic): - sage: A = K.ideal([5, 2 + I]) - sage: B = K.ideal([13, 5 + 12*I]) - sage: A*B -- Fractional ideal (-4*I + 7) -+ Fractional ideal (4*I - 7) - sage: (K.ideal(3 + I) * K.ideal(7 + I)).gens() - (10*I + 20,) - -@@ -1060,7 +1060,7 @@ class NumberFieldIdeal(Ideal_generic): - sage: K.ideal(3).pari_prime() - [3, [3, 0]~, 1, 2, 1] - sage: K.ideal(2+i).pari_prime() -- [5, [2, 1]~, 1, 1, [-2, 1]~] -+ [5, [2, 1]~, 1, 1, [-2, -1; 1, -2]] - sage: K.ideal(2).pari_prime() - Traceback (most recent call last): - ... -@@ -2238,7 +2238,7 @@ class NumberFieldFractionalIdeal(NumberF - sage: I = K.ideal((3+4*i)/5); I - Fractional ideal (4/5*i + 3/5) - sage: I.denominator() -- Fractional ideal (i - 2) -+ Fractional ideal (2*i + 1) - sage: I.numerator() - Fractional ideal (-i - 2) - sage: I.numerator().is_integral() and I.denominator().is_integral() -@@ -2268,7 +2268,7 @@ class NumberFieldFractionalIdeal(NumberF - sage: I = K.ideal((3+4*i)/5); I - Fractional ideal (4/5*i + 3/5) - sage: I.denominator() -- Fractional ideal (i - 2) -+ Fractional ideal (2*i + 1) - sage: I.numerator() - Fractional ideal (-i - 2) - sage: I.numerator().is_integral() and I.denominator().is_integral() -@@ -2999,15 +2999,15 @@ class NumberFieldFractionalIdeal(NumberF - An example of reduction maps to the residue field: these are - defined on the whole valuation ring, i.e. the subring of the - number field consisting of elements with non-negative -- valuation. This shows that the issue raised in trac \#1951 -+ valuation. This shows that the issue raised in :trac:`1951` - has been fixed:: - - sage: K. = NumberField(x^2 + 1) - sage: P1, P2 = [g[0] for g in K.factor(5)]; (P1,P2) -- (Fractional ideal (-i - 2), Fractional ideal (i - 2)) -+ (Fractional ideal (-i - 2), Fractional ideal (2*i + 1)) - sage: a = 1/(1+2*i) - sage: F1, F2 = [g.residue_field() for g in [P1,P2]]; (F1,F2) -- (Residue field of Fractional ideal (-i - 2), Residue field of Fractional ideal (i - 2)) -+ (Residue field of Fractional ideal (-i - 2), Residue field of Fractional ideal (2*i + 1)) - sage: a.valuation(P1) - 0 - sage: F1(i/7) -@@ -3018,7 +3018,7 @@ class NumberFieldFractionalIdeal(NumberF - -1 - sage: F2(a) - Traceback (most recent call last): -- ZeroDivisionError: Cannot reduce field element -2/5*i + 1/5 modulo Fractional ideal (i - 2): it has negative valuation -+ ZeroDivisionError: Cannot reduce field element -2/5*i + 1/5 modulo Fractional ideal (2*i + 1): it has negative valuation - - An example with a relative number field:: - -@@ -3058,7 +3058,7 @@ class NumberFieldFractionalIdeal(NumberF - sage: K. = NumberField(x^5 + 2); K - Number Field in a with defining polynomial x^5 + 2 - sage: f = K.factor(19); f -- (Fractional ideal (a^2 + a - 3)) * (Fractional ideal (-2*a^4 - a^2 + 2*a - 1)) * (Fractional ideal (-a^2 - a + 1)) -+ (Fractional ideal (a^2 + a - 3)) * (Fractional ideal (-2*a^4 - a^2 + 2*a - 1)) * (Fractional ideal (a^2 + a - 1)) - sage: [i.residue_class_degree() for i, _ in f] - [2, 2, 1] - """ -diff -up src/sage/rings/number_field/number_field_ideal_rel.py.orig src/sage/rings/number_field/number_field_ideal_rel.py ---- src/sage/rings/number_field/number_field_ideal_rel.py.orig 2014-08-13 11:16:54.390162305 -0300 -+++ src/sage/rings/number_field/number_field_ideal_rel.py 2014-08-13 11:16:57.570162427 -0300 -@@ -114,12 +114,12 @@ class NumberFieldFractionalIdeal_rel(Num - sage: K. = NumberField([x^2 + 23, x^2 - 7]) - sage: I = K.ideal(2, (a + 2*b + 3)/2) - sage: I.pari_rhnf() -- [[1, -2; 0, 1], [[2, 1; 0, 1], [1/2, 0; 0, 1/2]]] -+ [[1, -2; 0, 1], [[2, 1; 0, 1], 1/2]] - """ - try: - return self.__pari_rhnf - except AttributeError: -- nfzk = self.number_field().absolute_field('a').pari_zk() -+ nfzk = self.number_field().pari_nf().nf_subst('x').nf_get_zk() - rnf = self.number_field().pari_rnf() - L_hnf = self.absolute_ideal().pari_hnf() - self.__pari_rhnf = rnf.rnfidealabstorel(nfzk * L_hnf) -@@ -485,7 +485,7 @@ class NumberFieldFractionalIdeal_rel(Num - sage: K. = F.extension(Y^2 - (1 + a)*(a + b)*a*b) - sage: I = K.ideal(3, c) - sage: J = I.ideal_below(); J -- Fractional ideal (-b) -+ Fractional ideal (b) - sage: J.number_field() == F - True - """ -diff -up src/sage/rings/number_field/number_field.py.orig src/sage/rings/number_field/number_field.py ---- src/sage/rings/number_field/number_field.py.orig 2014-08-13 11:16:54.392162305 -0300 -+++ src/sage/rings/number_field/number_field.py 2014-08-13 11:16:57.571162427 -0300 -@@ -2808,9 +2808,9 @@ class NumberField_generic(number_field_b - sage: K. = NumberField(x^2 + 23) - sage: d = K.ideals_of_bdd_norm(10) - sage: for n in d: -- ... print n -- ... for I in d[n]: -- ... print I -+ ....: print n -+ ....: for I in d[n]: -+ ....: print I - 1 - Fractional ideal (1) - 2 -@@ -2825,13 +2825,13 @@ class NumberField_generic(number_field_b - Fractional ideal (4, 1/2*a + 5/2) - 5 - 6 -- Fractional ideal (-1/2*a + 1/2) -+ Fractional ideal (1/2*a - 1/2) - Fractional ideal (6, 1/2*a + 5/2) - Fractional ideal (6, 1/2*a + 7/2) - Fractional ideal (1/2*a + 1/2) - 7 - 8 -- Fractional ideal (-1/2*a - 3/2) -+ Fractional ideal (1/2*a + 3/2) - Fractional ideal (4, a - 1) - Fractional ideal (4, a + 1) - Fractional ideal (1/2*a - 3/2) -@@ -3065,13 +3065,13 @@ class NumberField_generic(number_field_b - - EXAMPLES:: - -- sage: K.=QuadraticField(-1) -- sage: it=K.primes_of_bounded_norm_iter(10) -+ sage: K. = QuadraticField(-1) -+ sage: it = K.primes_of_bounded_norm_iter(10) - sage: list(it) - [Fractional ideal (i + 1), - Fractional ideal (3), - Fractional ideal (-i - 2), -- Fractional ideal (i - 2)] -+ Fractional ideal (2*i + 1)] - sage: list(K.primes_of_bounded_norm_iter(1)) - [] - """ -@@ -3327,7 +3327,9 @@ class NumberField_generic(number_field_b - return self.__pari_nf - except AttributeError: - f = self.pari_polynomial("y") -- self.__pari_nf = pari([f, self._pari_integral_basis(important=important)]).nfinit() -+ if f.poldegree() > 1: -+ f = pari([f, self._pari_integral_basis(important=important)]) -+ self.__pari_nf = f.nfinit() - return self.__pari_nf - - def pari_zk(self): -@@ -3410,7 +3412,7 @@ class NumberField_generic(number_field_b - sage: len(k.pari_bnf()) - 10 - sage: k.pari_bnf()[:4] -- [[;], matrix(0,7), [;], ...] -+ [[;], matrix(0,3), [;], ...] - sage: len(k.pari_nf()) - 9 - sage: k. = NumberField(x^7 + 7); k -@@ -3771,8 +3773,8 @@ class NumberField_generic(number_field_b - 14/13*a^2 + 267/13*a - 85/13, - 7/13*a^2 + 127/13*a - 49/13, - -1, -- 1/13*a^2 + 20/13*a - 7/13, -- 1/13*a^2 - 19/13*a + 6/13], -+ 1/13*a^2 - 19/13*a + 6/13, -+ 1/13*a^2 - 19/13*a - 7/13], - [(Fractional ideal (11, a - 2), 2), - (Fractional ideal (19, 1/13*a^2 - 45/13*a - 332/13), 2)]) - """ -@@ -3920,7 +3922,7 @@ class NumberField_generic(number_field_b - - sage: K. = NumberField(x^3 - 381 * x + 127) - sage: K.selmer_group(K.primes_above(13), 2) -- [-7/13*a^2 - 140/13*a + 36/13, 14/13*a^2 + 267/13*a - 85/13, 7/13*a^2 + 127/13*a - 49/13, -1, 1/13*a^2 + 20/13*a - 7/13, 1/13*a^2 - 19/13*a + 6/13, -2/13*a^2 - 53/13*a + 92/13, 10/13*a^2 + 44/13*a - 4555/13] -+ [-7/13*a^2 - 140/13*a + 36/13, 14/13*a^2 + 267/13*a - 85/13, 7/13*a^2 + 127/13*a - 49/13, -1, 1/13*a^2 - 19/13*a + 6/13, 1/13*a^2 - 19/13*a - 7/13, 2/13*a^2 + 53/13*a - 92/13, 10/13*a^2 + 44/13*a - 4555/13] - - Verify that :trac:`16708` is fixed:: - -@@ -4537,19 +4539,19 @@ class NumberField_generic(number_field_b - Here are the factors:: - - sage: fi, fj = K.factor(17); fi,fj -- ((Fractional ideal (4*I + 1), 1), (Fractional ideal (-I - 4), 1)) -+ ((Fractional ideal (I - 4), 1), (Fractional ideal (I + 4), 1)) - - Now we extract the reduced form of the generators:: - - sage: zi = fi[0].gens_reduced()[0]; zi -- 4*I + 1 -+ I - 4 - sage: zj = fj[0].gens_reduced()[0]; zj -- -I - 4 -+ I + 4 - - We recover the integer that was factored in `\ZZ[i]` (up to a unit):: - - sage: zi*zj -- -17*I -+ -17 - - One can also factor elements or ideals of the number field:: - -@@ -4559,15 +4561,14 @@ class NumberField_generic(number_field_b - sage: K.factor(1+a) - Fractional ideal (a + 1) - sage: K.factor(1+a/5) -- (Fractional ideal (-3*a - 2)) * (Fractional ideal (a + 1)) * (Fractional ideal (-a - 2))^-1 * (Fractional ideal (a - 2))^-1 -+ (Fractional ideal (-3*a - 2)) * (Fractional ideal (a + 1)) * (Fractional ideal (-a - 2))^-1 * (Fractional ideal (2*a + 1))^-1 - - An example over a relative number field:: - - sage: pari('setrand(2)') - sage: L. = K.extension(x^2 - 7) - sage: f = L.factor(a + 1); f -- (Fractional ideal (-1/2*a*b - a - 1/2)) * (Fractional ideal (1/2*b + 1/2*a - 1)) # 32-bit -- (Fractional ideal (1/2*a*b + a + 1/2)) * (Fractional ideal (-1/2*b - 1/2*a + 1)) # 64-bit -+ (Fractional ideal (1/2*a*b - a + 1/2)) * (Fractional ideal (-1/2*a*b - a + 1/2)) - sage: f.value() == a+1 - True - -@@ -4893,8 +4894,7 @@ class NumberField_generic(number_field_b - except (AttributeError, KeyError): - f = self.pari_polynomial("y") - if len(v) > 0: -- m = self._pari_disc_factorization_matrix(v) -- B = f.nfbasis(fa = m) -+ B = f.nfbasis(fa=v) - elif self._assume_disc_small: - B = f.nfbasis(1) - elif not important: -@@ -4915,34 +4915,6 @@ class NumberField_generic(number_field_b - self._integral_basis_dict[v] = B - return B - -- def _pari_disc_factorization_matrix(self, v): -- """ -- Returns a PARI matrix representation for the partial -- factorization of the discriminant of the defining polynomial -- of self, defined by the list of primes in the Python list v. -- This function is used internally by the number fields code. -- -- EXAMPLES:: -- -- sage: x = polygen(QQ,'x') -- sage: f = x^3 + 17*x + 393; f.discriminant().factor() -- -1 * 5^2 * 29 * 5779 -- sage: K. = NumberField(f) -- sage: fa = K._pari_disc_factorization_matrix([5,29]); fa -- [5, 2; 29, 1] -- sage: fa.type() -- 't_MAT' -- """ -- f = self.pari_polynomial() -- m = pari.matrix(len(v), 2) -- d = f.poldisc() -- for i in range(len(v)): -- p = pari(ZZ(v[i])) -- m[i,0] = p -- m[i,1] = d.valuation(p) -- return m -- -- - def reduced_basis(self, prec=None): - r""" - This function returns an LLL-reduced basis for the -@@ -5639,7 +5611,14 @@ class NumberField_generic(number_field_b - sage: K.units(proof=True) # takes forever, not tested - ... - sage: K.units(proof=False) # result not independently verified -- (a^9 + a - 1, a^16 - a^15 + a^14 - a^12 + a^11 - a^10 - a^8 + a^7 - 2*a^6 + a^4 - 3*a^3 + 2*a^2 - 2*a + 1, 2*a^16 - a^14 - a^13 + 3*a^12 - 2*a^10 + a^9 + 3*a^8 - 3*a^6 + 3*a^5 + 3*a^4 - 2*a^3 - 2*a^2 + 3*a + 4, a^15 + a^14 + 2*a^11 + a^10 - a^9 + a^8 + 2*a^7 - a^5 + 2*a^3 - a^2 - 3*a + 1, a^16 + a^15 + a^14 + a^13 + a^12 + a^11 + a^10 + a^9 + a^8 + a^7 + a^6 + a^5 + a^4 + a^3 + a^2 - 2, 2*a^16 - 3*a^15 + 3*a^14 - 3*a^13 + 3*a^12 - a^11 + a^9 - 3*a^8 + 4*a^7 - 5*a^6 + 6*a^5 - 4*a^4 + 3*a^3 - 2*a^2 - 2*a + 4, a^15 - a^12 + a^10 - a^9 - 2*a^8 + 3*a^7 + a^6 - 3*a^5 + a^4 + 4*a^3 - 3*a^2 - 2*a + 2, 2*a^16 + a^15 - a^11 - 3*a^10 - 4*a^9 - 4*a^8 - 4*a^7 - 5*a^6 - 7*a^5 - 8*a^4 - 6*a^3 - 5*a^2 - 6*a - 7) -+ (a^9 + a - 1, -+ a^15 - a^12 + a^10 - a^9 - 2*a^8 + 3*a^7 + a^6 - 3*a^5 + a^4 + 4*a^3 - 3*a^2 - 2*a + 2, -+ a^16 - a^15 + a^14 - a^12 + a^11 - a^10 - a^8 + a^7 - 2*a^6 + a^4 - 3*a^3 + 2*a^2 - 2*a + 1, -+ 2*a^16 - a^14 - a^13 + 3*a^12 - 2*a^10 + a^9 + 3*a^8 - 3*a^6 + 3*a^5 + 3*a^4 - 2*a^3 - 2*a^2 + 3*a + 4, -+ 2*a^16 - 3*a^15 + 3*a^14 - 3*a^13 + 3*a^12 - a^11 + a^9 - 3*a^8 + 4*a^7 - 5*a^6 + 6*a^5 - 4*a^4 + 3*a^3 - 2*a^2 - 2*a + 4, -+ a^16 - a^15 - 3*a^14 - 4*a^13 - 4*a^12 - 3*a^11 - a^10 + 2*a^9 + 4*a^8 + 5*a^7 + 4*a^6 + 2*a^5 - 2*a^4 - 6*a^3 - 9*a^2 - 9*a - 7, -+ a^15 + a^14 + 2*a^11 + a^10 - a^9 + a^8 + 2*a^7 - a^5 + 2*a^3 - a^2 - 3*a + 1, -+ 5*a^16 - 6*a^14 + a^13 + 7*a^12 - 2*a^11 - 7*a^10 + 4*a^9 + 7*a^8 - 6*a^7 - 7*a^6 + 8*a^5 + 6*a^4 - 11*a^3 - 5*a^2 + 13*a + 4) - """ - proof = proof_flag(proof) - -@@ -5711,7 +5690,7 @@ class NumberField_generic(number_field_b - sage: U.gens() - (u0, u1, u2, u3, u4, u5, u6, u7, u8) - sage: U.gens_values() # result not independently verified -- [-1, a^9 + a - 1, a^16 - a^15 + a^14 - a^12 + a^11 - a^10 - a^8 + a^7 - 2*a^6 + a^4 - 3*a^3 + 2*a^2 - 2*a + 1, 2*a^16 - a^14 - a^13 + 3*a^12 - 2*a^10 + a^9 + 3*a^8 - 3*a^6 + 3*a^5 + 3*a^4 - 2*a^3 - 2*a^2 + 3*a + 4, a^15 + a^14 + 2*a^11 + a^10 - a^9 + a^8 + 2*a^7 - a^5 + 2*a^3 - a^2 - 3*a + 1, a^16 + a^15 + a^14 + a^13 + a^12 + a^11 + a^10 + a^9 + a^8 + a^7 + a^6 + a^5 + a^4 + a^3 + a^2 - 2, 2*a^16 - 3*a^15 + 3*a^14 - 3*a^13 + 3*a^12 - a^11 + a^9 - 3*a^8 + 4*a^7 - 5*a^6 + 6*a^5 - 4*a^4 + 3*a^3 - 2*a^2 - 2*a + 4, a^15 - a^12 + a^10 - a^9 - 2*a^8 + 3*a^7 + a^6 - 3*a^5 + a^4 + 4*a^3 - 3*a^2 - 2*a + 2, 2*a^16 + a^15 - a^11 - 3*a^10 - 4*a^9 - 4*a^8 - 4*a^7 - 5*a^6 - 7*a^5 - 8*a^4 - 6*a^3 - 5*a^2 - 6*a - 7] -+ [-1, a^9 + a - 1, a^15 - a^12 + a^10 - a^9 - 2*a^8 + 3*a^7 + a^6 - 3*a^5 + a^4 + 4*a^3 - 3*a^2 - 2*a + 2, a^16 - a^15 + a^14 - a^12 + a^11 - a^10 - a^8 + a^7 - 2*a^6 + a^4 - 3*a^3 + 2*a^2 - 2*a + 1, 2*a^16 - a^14 - a^13 + 3*a^12 - 2*a^10 + a^9 + 3*a^8 - 3*a^6 + 3*a^5 + 3*a^4 - 2*a^3 - 2*a^2 + 3*a + 4, 2*a^16 - 3*a^15 + 3*a^14 - 3*a^13 + 3*a^12 - a^11 + a^9 - 3*a^8 + 4*a^7 - 5*a^6 + 6*a^5 - 4*a^4 + 3*a^3 - 2*a^2 - 2*a + 4, a^16 - a^15 - 3*a^14 - 4*a^13 - 4*a^12 - 3*a^11 - a^10 + 2*a^9 + 4*a^8 + 5*a^7 + 4*a^6 + 2*a^5 - 2*a^4 - 6*a^3 - 9*a^2 - 9*a - 7, a^15 + a^14 + 2*a^11 + a^10 - a^9 + a^8 + 2*a^7 - a^5 + 2*a^3 - a^2 - 3*a + 1, 5*a^16 - 6*a^14 + a^13 + 7*a^12 - 2*a^11 - 7*a^10 + 4*a^9 + 7*a^8 - 6*a^7 - 7*a^6 + 8*a^5 + 6*a^4 - 11*a^3 - 5*a^2 + 13*a + 4] - """ - proof = proof_flag(proof) - -@@ -5761,8 +5740,7 @@ class NumberField_generic(number_field_b - sage: U.gens() - (u0, u1, u2, u3) - sage: U.gens_values() -- [-7/275*a^3 + 1/11*a^2 - 9/11*a - 1, 6/275*a^3 - 9/55*a^2 + 14/11*a - 2, 14/275*a^3 - 21/55*a^2 + 29/11*a - 6, 1/275*a^3 + 4/55*a^2 - 5/11*a + 5] # 32-bit -- [-7/275*a^3 + 1/11*a^2 - 9/11*a - 1, 6/275*a^3 - 9/55*a^2 + 14/11*a - 2, -14/275*a^3 + 21/55*a^2 - 29/11*a + 6, 1/275*a^3 + 4/55*a^2 - 5/11*a + 5] # 64-bit -+ [-7/275*a^3 + 1/11*a^2 - 9/11*a - 1, 6/275*a^3 - 9/55*a^2 + 14/11*a - 2, -14/275*a^3 + 21/55*a^2 - 29/11*a + 6, 1/275*a^3 + 4/55*a^2 - 5/11*a + 5] - sage: U.invariants() - (10, 0, 0, 0) - sage: [u.multiplicative_order() for u in U.gens()] -@@ -5906,9 +5884,9 @@ class NumberField_generic(number_field_b - sage: r. = QQ[] - sage: K. = NumberField(x^2+1) - sage: K.zeta(4) -- -b -+ b - sage: K.zeta(4,all=True) -- [-b, b] -+ [b, -b] - sage: K.zeta(3) - Traceback (most recent call last): - ... -@@ -6006,7 +5984,7 @@ class NumberField_generic(number_field_b - - sage: K. = NumberField(x^2+1) - sage: z = K.primitive_root_of_unity(); z -- -i -+ i - sage: z.multiplicative_order() - 4 - -@@ -6032,11 +6010,11 @@ class NumberField_generic(number_field_b - sage: z.multiplicative_order() - 6 - -- sage: K = CyclotomicField(7) -+ sage: K = CyclotomicField(3) - sage: z = K.primitive_root_of_unity(); z -- zeta7^5 + zeta7^4 + zeta7^3 + zeta7^2 + zeta7 + 1 -+ zeta3 + 1 - sage: z.multiplicative_order() -- 14 -+ 6 - - TESTS: - -@@ -6070,7 +6048,7 @@ class NumberField_generic(number_field_b - - sage: K. = NumberField(x^2+1) - sage: zs = K.roots_of_unity(); zs -- [-b, -1, b, 1] -+ [b, -1, -b, 1] - sage: [ z**K.number_of_roots_of_unity() for z in zs ] - [1, 1, 1, 1] - """ -@@ -8163,8 +8141,7 @@ class NumberField_absolute(NumberField_g - sage: K.hilbert_conductor(K(2),K(-2)) - Fractional ideal (1) - sage: K.hilbert_conductor(K(2*b),K(-2)) -- Fractional ideal (-b^2 - b + 2) -- -+ Fractional ideal (b^2 + b - 2) - - AUTHOR: - -diff -up src/sage/rings/number_field/number_field_rel.py.orig src/sage/rings/number_field/number_field_rel.py ---- src/sage/rings/number_field/number_field_rel.py.orig 2014-08-13 11:16:54.394162305 -0300 -+++ src/sage/rings/number_field/number_field_rel.py 2014-08-13 11:16:57.572162427 -0300 -@@ -214,7 +214,7 @@ class NumberField_relative(NumberField_g - sage: b - Traceback (most recent call last): - ... -- PariError: incorrect type in core2partial -+ PariError: incorrect type in core2partial (t_FRAC) - - However, if the polynomial is linear, rational coefficients should work:: - -@@ -1082,7 +1082,7 @@ class NumberField_relative(NumberField_g - pol = element.polynomial('y') - t2 = pol(a).lift() - if check: -- t1 = self.pari_rnf().rnfeltreltoabs(pol._pari_()) -+ t1 = self.pari_rnf().rnfeltreltoabs(pol).lift() - assert t1 == t2 - return t2 - -@@ -1167,7 +1167,7 @@ class NumberField_relative(NumberField_g - - sage: k. = NumberField([x^3 + 2, x^2 + 2]) - sage: k._pari_base_bnf() -- [[;], matrix(0,9), [;], ... 0] -+ [[;], matrix(0,3), [;], ...] - """ - abs_base, from_abs_base, to_abs_base = self.absolute_base_field() - return abs_base.pari_bnf(proof, units) -@@ -1305,10 +1305,10 @@ class NumberField_relative(NumberField_g - Galois conjugate:: - - sage: for g in G: -- ... if L1.is_isomorphic_relative(L2, g.as_hom()): -- ... print g.as_hom() -+ ....: if L1.is_isomorphic_relative(L2, g.as_hom()): -+ ....: print g.as_hom() - Ring endomorphism of Number Field in z9 with defining polynomial x^6 + x^3 + 1 -- Defn: z9 |--> -z9^4 - z9 -+ Defn: z9 |--> z9^4 - """ - if is_RelativeNumberField(other): - s_base_field = self.base_field() -@@ -1597,7 +1597,7 @@ class NumberField_relative(NumberField_g - - sage: k. = NumberField([x^4 + 3, x^2 + 2]) - sage: k.pari_rnf() -- [x^4 + 3, [], [[108, 0; 0, 108], 3], [8, 0; 0, 8], [], [], [[1, x - 1, x^2 - 1, x^3 - x^2 - x - 3], ..., 0] -+ [x^4 + 3, [[364, -10*x^7 - 87*x^5 - 370*x^3 - 41*x], 1/364], [[108, 0; 0, 108], 3], ...] - """ - return self._pari_base_nf().rnfinit(self.pari_relative_polynomial()) - -@@ -2329,7 +2329,7 @@ class NumberField_relative(NumberField_g - ... - ValueError: The element b is not in the base field - """ -- polmodmod_xy = self.pari_rnf().rnfeltabstorel( self(element)._pari_() ) -+ polmodmod_xy = self.pari_rnf().rnfeltabstorel( self(element)._pari_('x') ) - # polmodmod_xy is a POLMOD with POLMOD coefficients in general. - # These POLMOD coefficients represent elements of the base field K. - # We do two lifts so we get a polynomial. We need the simplify() to -diff -up src/sage/rings/number_field/order.py.orig src/sage/rings/number_field/order.py ---- src/sage/rings/number_field/order.py.orig 2014-08-13 11:16:54.396162305 -0300 -+++ src/sage/rings/number_field/order.py 2014-08-13 11:16:57.572162427 -0300 -@@ -245,7 +245,7 @@ class Order(IntegralDomain): - - sage: k. = NumberField(x^2 + 5077); G = k.class_group(); G - Class group of order 22 with structure C22 of Number Field in a with defining polynomial x^2 + 5077 -- sage: G.0 -+ sage: G.0 ^ -9 - Fractional ideal class (11, a + 7) - sage: Ok = k.maximal_order(); Ok - Maximal Order in Number Field in a with defining polynomial x^2 + 5077 -diff -up src/sage/rings/number_field/unit_group.py.orig src/sage/rings/number_field/unit_group.py ---- src/sage/rings/number_field/unit_group.py.orig 2014-08-13 11:16:54.398162305 -0300 -+++ src/sage/rings/number_field/unit_group.py 2014-08-13 11:16:57.573162427 -0300 -@@ -173,18 +173,10 @@ class UnitGroup(AbelianGroupWithValues_c - sage: UK = K.unit_group() - sage: UK.ngens() - 6 -- sage: UK.gen(0) # random -- -z^11 -- sage: UK.gen(1) # random -- z^5 + z^3 -- sage: UK.gen(2) # random -- z^6 + z^5 -- sage: UK.gen(3) # random -- z^9 + z^7 + z^5 -- sage: UK.gen(4) # random -- z^9 + z^5 + z^4 + 1 -- sage: UK.gen(5) # random -- z^5 + z -+ sage: UK.gen(5) -+ u5 -+ sage: UK.gen(5).value() -+ z^6 + z^4 - - An S-unit group:: - -@@ -195,7 +187,7 @@ class UnitGroup(AbelianGroupWithValues_c - sage: SUK.zeta_order() - 26 - sage: SUK.log(21*z) -- (6, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1) -+ (13, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1) - """ - # This structure is not a parent in the usual sense. The - # "elements" are NumberFieldElement_absolute. Instead, they should -@@ -427,7 +419,7 @@ class UnitGroup(AbelianGroupWithValues_c - sage: K. = NumberField(x^2+1) - sage: U = UnitGroup(K) - sage: zs = U.roots_of_unity(); zs -- [-b, -1, b, 1] -+ [b, -1, -b, 1] - sage: [ z**U.zeta_order() for z in zs ] - [1, 1, 1, 1] - """ -@@ -493,9 +485,9 @@ class UnitGroup(AbelianGroupWithValues_c - sage: K. = NumberField(x^2+1) - sage: U = UnitGroup(K) - sage: U.zeta(4) -- -b -+ b - sage: U.zeta(4,all=True) -- [-b, b] -+ [b, -b] - sage: U.zeta(3) - Traceback (most recent call last): - ... -@@ -599,7 +591,7 @@ class UnitGroup(AbelianGroupWithValues_c - sage: SUK = UnitGroup(K,S=2) - sage: v = (3,1,4,1,5,9,2) - sage: u = SUK.exp(v); u -- -997204*z^11 - 2419728*z^10 - 413812*z^9 - 413812*z^8 - 2419728*z^7 - 997204*z^6 - 2129888*z^4 - 1616524*z^3 + 149364*z^2 - 1616524*z - 2129888 -+ 180*z^10 - 280*z^9 + 580*z^8 - 720*z^7 + 948*z^6 - 924*z^5 + 948*z^4 - 720*z^3 + 580*z^2 - 280*z + 180 - sage: SUK.log(u) - (3, 1, 4, 1, 5, 9, 2) - sage: SUK.log(u) == v -@@ -645,7 +637,7 @@ class UnitGroup(AbelianGroupWithValues_c - sage: SUK = UnitGroup(K,S=2) - sage: v = (3,1,4,1,5,9,2) - sage: u = SUK.exp(v); u -- -997204*z^11 - 2419728*z^10 - 413812*z^9 - 413812*z^8 - 2419728*z^7 - 997204*z^6 - 2129888*z^4 - 1616524*z^3 + 149364*z^2 - 1616524*z - 2129888 -+ 180*z^10 - 280*z^9 + 580*z^8 - 720*z^7 + 948*z^6 - 924*z^5 + 948*z^4 - 720*z^3 + 580*z^2 - 280*z + 180 - sage: SUK.log(u) - (3, 1, 4, 1, 5, 9, 2) - sage: SUK.log(u) == v -diff -up src/sage/rings/polynomial/cyclotomic.pyx.orig src/sage/rings/polynomial/cyclotomic.pyx ---- src/sage/rings/polynomial/cyclotomic.pyx.orig 2014-08-13 11:16:54.401162305 -0300 -+++ src/sage/rings/polynomial/cyclotomic.pyx 2014-08-13 11:16:57.573162427 -0300 -@@ -247,13 +247,16 @@ def cyclotomic_value(n, x): - - TESTS:: - -- sage: K. = NumberField(polygen(QQ)^2 + 1) - sage: R. = QQ[] -- sage: for y in [-1, 0, 1, 2, 1/2, mod(3, 8), GF(9,'a').gen(), Zp(3)(54), i, x^2+2]: -- ... for n in range(1, 61): -- ... val1 = cyclotomic_value(n, y) -- ... val2 = cyclotomic_polynomial(n)(y) -- ... assert val1 == val2 and val1.parent() is val2.parent() -+ sage: K. = NumberField(x^2 + 1) -+ sage: for y in [-1, 0, 1, 2, 1/2, Mod(3, 8), Mod(3,11), GF(9,'a').gen(), Zp(3)(54), i, x^2+2]: -+ ....: for n in [1..60]: -+ ....: val1 = cyclotomic_value(n, y) -+ ....: val2 = cyclotomic_polynomial(n)(y) -+ ....: if val1 != val2: -+ ....: print "Wrong value for cyclotomic_value(%s, %s) in %s"%(n,y,parent(y)) -+ ....: if val1.parent() is not val2.parent(): -+ ....: print "Wrong parent for cyclotomic_value(%s, %s) in %s"%(n,y,parent(y)) - - sage: cyclotomic_value(20, I) - 5 -@@ -275,15 +278,25 @@ def cyclotomic_value(n, x): - 1 - """ - n = int(n) -- if n == 1: -- return x - 1 -- if n <= 0: -- raise ValueError, "n must be positive" -+ if n < 3: -+ if n == 1: -+ return x - 1 -+ if n == 2: -+ return x + 1 -+ raise ValueError("n must be positive") -+ - try: -- return x.parent()(pari.polcyclo_eval(n, x._pari_())) -+ return x.parent()(pari.polcyclo_eval(n, x)) - except Exception: - pass -- # The following is modeled on the implementation in Pari -+ -+ # The following is modeled on the implementation in PARI and is -+ # used for cases for which PARI doesn't work. These are in -+ # particular: -+ # - n does not fit in a C long; -+ # - x is some Sage type which cannot be converted to PARI; -+ # - PARI's algorithm encounters a zero-divisor which is not zero. -+ - factors = factor(n) - cdef Py_ssize_t i, j, ti, L, root_of_unity = -1 - primes = [p for p, e in factors] -diff -up src/sage/rings/polynomial/padics/polynomial_padic.py.orig src/sage/rings/polynomial/padics/polynomial_padic.py ---- src/sage/rings/polynomial/padics/polynomial_padic.py.orig 2014-08-13 11:16:54.403162305 -0300 -+++ src/sage/rings/polynomial/padics/polynomial_padic.py 2014-08-13 11:16:57.573162427 -0300 -@@ -86,7 +86,7 @@ class Polynomial_padic(Polynomial): - 1 (1 + O(3^3))*t + (-1 + O(3^3)) - 1 (1 + O(3^3))*t^2 + (5 + O(3^3))*t + (-1 + O(3^3)) - 1 (1 + O(3^3))*t^2 + (-5 + O(3^3))*t + (-1 + O(3^3)) -- 1 (1 + O(3^3))*t^2 + (1 + O(3^3)) -+ 1 (1 + O(3^3))*t^2 + (0 + O(3^3))*t + (1 + O(3^3)) - sage: R. = PolynomialRing(Qp(5,6,print_mode='terse',print_pos=False)) - sage: pol = 100 * (5*t - 1) * (t - 5) - sage: pol -diff -up src/sage/rings/polynomial/polynomial_element.pyx.orig src/sage/rings/polynomial/polynomial_element.pyx ---- src/sage/rings/polynomial/polynomial_element.pyx.orig 2014-08-13 11:16:54.405162305 -0300 -+++ src/sage/rings/polynomial/polynomial_element.pyx 2014-08-13 11:16:57.574162427 -0300 -@@ -3248,9 +3248,7 @@ cdef class Polynomial(CommutativeAlgebra - sage: K. = QuadraticField(p*q) - sage: R. = PolynomialRing(K) - sage: K.pari_polynomial('a').nffactor("x^2+1") -- Traceback (most recent call last): -- ... -- PariError: precision too low in floorr (precision loss in truncation) -+ Mat([x^2 + 1, 1]) - sage: factor(x^2 + 1) - x^2 + 1 - sage: factor( (x - a) * (x + 2*a) ) -@@ -4648,7 +4646,7 @@ cdef class Polynomial(CommutativeAlgebra - sage: pari(f) - Traceback (most recent call last): - ... -- PariError: variable must have higher priority in gtopoly -+ PariError: incorrect priority in gtopoly: variable x <= a - - Stacked polynomial rings, first with a univariate ring on the - bottom:: -diff -up src/sage/rings/polynomial/polynomial_quotient_ring.py.orig src/sage/rings/polynomial/polynomial_quotient_ring.py ---- src/sage/rings/polynomial/polynomial_quotient_ring.py.orig 2014-08-13 11:16:54.407162305 -0300 -+++ src/sage/rings/polynomial/polynomial_quotient_ring.py 2014-08-13 11:16:57.574162427 -0300 -@@ -1234,11 +1234,11 @@ class PolynomialQuotientRing_generic(sag - sage: L. = K['y'].quotient(y^3 + 5); L - Univariate Quotient Polynomial Ring in b over Number Field in a with defining polynomial x^2 + 3 with modulus y^3 + 5 - sage: L.S_units([]) -- [(-1/2*a + 1/2, 6), ((-1/3*a + 1)*b^2 - 4/3*a*b - 4/3*a - 3, +Infinity), (2/3*a*b^2 + (2/3*a + 2)*b - 4/3*a + 3, +Infinity)] -+ [(-1/2*a + 1/2, 6), ((1/3*a - 1)*b^2 + 4/3*a*b + 5/6*a + 7/2, +Infinity), ((-1/3*a + 1)*b^2 + (2/3*a - 2)*b - 5/6*a + 7/2, +Infinity)] - sage: L.S_units([K.ideal(1/2*a - 3/2)]) -- [((-1/6*a - 1/2)*b^2 + (1/3*a + 1)*b - 2/3*a - 2, +Infinity), (-1/2*a + 1/2, 6), ((-1/3*a + 1)*b^2 - 4/3*a*b - 4/3*a - 3, +Infinity), (2/3*a*b^2 + (2/3*a + 2)*b - 4/3*a + 3, +Infinity)] -+ [((-1/6*a - 1/2)*b^2 + (1/3*a - 1)*b + 4/3*a, +Infinity), (-1/2*a + 1/2, 6), ((1/3*a - 1)*b^2 + 4/3*a*b + 5/6*a + 7/2, +Infinity), ((-1/3*a + 1)*b^2 + (2/3*a - 2)*b - 5/6*a + 7/2, +Infinity)] - sage: L.S_units([K.ideal(2)]) -- [((1/6*a + 1/2)*b^2 + (-1/3*a - 1)*b + 2/3*a + 1, +Infinity), ((-1/6*a - 1/2)*b^2 + (1/3*a + 1)*b - 1/6*a - 3/2, +Infinity), ((-1/2*a + 1/2)*b^2 + (a - 1)*b - 3/2*a + 3/2, +Infinity), (-1/2*a + 1/2, 6), ((-1/3*a + 1)*b^2 - 4/3*a*b - 4/3*a - 3, +Infinity), (2/3*a*b^2 + (2/3*a + 2)*b - 4/3*a + 3, +Infinity)] -+ [((-1/2*a + 1/2)*b^2 + (-a - 1)*b - 3, +Infinity), ((-1/6*a - 1/2)*b^2 + (1/3*a - 1)*b + 5/6*a - 1/2, +Infinity), ((1/6*a + 1/2)*b^2 + (-1/3*a + 1)*b - 5/6*a - 1/2, +Infinity), (-1/2*a + 1/2, 6), ((1/3*a - 1)*b^2 + 4/3*a*b + 5/6*a + 7/2, +Infinity), ((-1/3*a + 1)*b^2 + (2/3*a - 2)*b - 5/6*a + 7/2, +Infinity)] - - Note that all the returned values live where we expect them to:: - -@@ -1314,14 +1314,14 @@ class PolynomialQuotientRing_generic(sag - sage: L. = K['y'].quotient(y^3 + 5); L - Univariate Quotient Polynomial Ring in b over Number Field in a with defining polynomial x^2 + 3 with modulus y^3 + 5 - sage: L.units() -- [(-1/2*a + 1/2, 6), ((-1/3*a + 1)*b^2 - 4/3*a*b - 4/3*a - 3, +Infinity), (2/3*a*b^2 + (2/3*a + 2)*b - 4/3*a + 3, +Infinity)] -+ [(-1/2*a + 1/2, 6), ((1/3*a - 1)*b^2 + 4/3*a*b + 5/6*a + 7/2, +Infinity), ((-1/3*a + 1)*b^2 + (2/3*a - 2)*b - 5/6*a + 7/2, +Infinity)] - sage: L. = K.extension(y^3 + 5) - sage: L.unit_group() - Unit group with structure C6 x Z x Z of Number Field in b with defining polynomial x^3 + 5 over its base field - sage: L.unit_group().gens() # abstract generators - (u0, u1, u2) - sage: L.unit_group().gens_values() -- [-1/2*a + 1/2, (-1/3*a + 1)*b^2 - 4/3*a*b - 4/3*a - 3, 2/3*a*b^2 + (2/3*a + 2)*b - 4/3*a + 3] -+ [-1/2*a + 1/2, (1/3*a - 1)*b^2 + 4/3*a*b + 5/6*a + 7/2, (-1/3*a + 1)*b^2 + (2/3*a - 2)*b - 5/6*a + 7/2] - - Note that all the returned values live where we expect them to:: - -diff -up src/sage/rings/polynomial/polynomial_rational_flint.pyx.orig src/sage/rings/polynomial/polynomial_rational_flint.pyx ---- src/sage/rings/polynomial/polynomial_rational_flint.pyx.orig 2014-08-13 11:16:54.410162306 -0300 -+++ src/sage/rings/polynomial/polynomial_rational_flint.pyx 2014-08-13 11:16:57.575162427 -0300 -@@ -1604,9 +1604,9 @@ cdef class Polynomial_rational_flint(Pol - sage: R. = QQ[] - sage: f = x^3 - 2 - sage: f.factor_padic(2) -- (1 + O(2^10))*x^3 + (2 + 2^2 + 2^3 + 2^4 + 2^5 + 2^6 + 2^7 + 2^8 + 2^9 + O(2^10)) -+ (1 + O(2^10))*x^3 + (O(2^10))*x^2 + (O(2^10))*x + (2 + 2^2 + 2^3 + 2^4 + 2^5 + 2^6 + 2^7 + 2^8 + 2^9 + O(2^10)) - sage: f.factor_padic(3) -- (1 + O(3^10))*x^3 + (1 + 2*3 + 2*3^2 + 2*3^3 + 2*3^4 + 2*3^5 + 2*3^6 + 2*3^7 + 2*3^8 + 2*3^9 + O(3^10)) -+ (1 + O(3^10))*x^3 + (O(3^10))*x^2 + (O(3^10))*x + (1 + 2*3 + 2*3^2 + 2*3^3 + 2*3^4 + 2*3^5 + 2*3^6 + 2*3^7 + 2*3^8 + 2*3^9 + O(3^10)) - sage: f.factor_padic(5) - ((1 + O(5^10))*x + (2 + 4*5 + 2*5^2 + 2*5^3 + 5^4 + 3*5^5 + 4*5^7 + 2*5^8 + 5^9 + O(5^10))) * ((1 + O(5^10))*x^2 + (3 + 2*5^2 + 2*5^3 + 3*5^4 + 5^5 + 4*5^6 + 2*5^8 + 3*5^9 + O(5^10))*x + (4 + 5 + 2*5^2 + 4*5^3 + 4*5^4 + 3*5^5 + 3*5^6 + 4*5^7 + 4*5^9 + O(5^10))) - -diff -up src/sage/rings/qqbar.py.orig src/sage/rings/qqbar.py ---- src/sage/rings/qqbar.py.orig 2014-08-13 11:16:54.412162306 -0300 -+++ src/sage/rings/qqbar.py 2014-08-13 11:16:57.576162427 -0300 -@@ -1637,7 +1637,7 @@ def do_polred(poly): - sage: do_polred(x^2 - x - 11) - (1/3*x + 1/3, 3*x - 1, x^2 - x - 1) - sage: do_polred(x^3 + 123456) -- (-1/4*x, -4*x, x^3 - 1929) -+ (1/4*x, 4*x, x^3 + 1929) - - This shows that :trac:`13054` has been fixed:: - -@@ -1889,11 +1889,11 @@ def number_field_elements_from_algebraic - elements, and then mapping them back into ``QQbar``:: - - sage: (fld,nums,hom) = number_field_elements_from_algebraics((rt2, rt3, qqI, z3)) -- sage: fld,nums,hom -- (Number Field in a with defining polynomial y^8 - y^4 + 1, [-a^5 + a^3 + a, a^6 - 2*a^2, -a^6, a^4 - 1], Ring morphism: -- From: Number Field in a with defining polynomial y^8 - y^4 + 1 -- To: Algebraic Field -- Defn: a |--> -0.2588190451025208? + 0.9659258262890683?*I) -+ sage: fld,nums,hom # random -+ (Number Field in a with defining polynomial y^8 - y^4 + 1, [-a^5 + a^3 + a, a^6 - 2*a^2, a^6, -a^4], Ring morphism: -+ From: Number Field in a with defining polynomial y^8 - y^4 + 1 -+ To: Algebraic Field -+ Defn: a |--> -0.2588190451025208? - 0.9659258262890683?*I) - sage: (nfrt2, nfrt3, nfI, nfz3) = nums - sage: hom(nfrt2) - 1.414213562373095? + 0.?e-18*I -@@ -1906,7 +1906,8 @@ def number_field_elements_from_algebraic - sage: nfI^2 - -1 - sage: sum = nfrt2 + nfrt3 + nfI + nfz3; sum -- -a^5 + a^4 + a^3 - 2*a^2 + a - 1 -+ -a^5 + a^4 + a^3 - 2*a^2 + a - 1 # 32-bit -+ 2*a^6 - a^5 - a^4 + a^3 - 2*a^2 + a # 64-bit - sage: hom(sum) - 2.646264369941973? + 1.866025403784439?*I - sage: hom(sum) == rt2 + rt3 + qqI + z3 -diff -up src/sage/rings/rational.pyx.orig src/sage/rings/rational.pyx ---- src/sage/rings/rational.pyx.orig 2014-08-13 11:16:54.415162306 -0300 -+++ src/sage/rings/rational.pyx 2014-08-13 11:16:57.577162427 -0300 -@@ -1193,7 +1193,7 @@ cdef class Rational(sage.structure.eleme - sage: 0.is_norm(K) - True - sage: (1/7).is_norm(K, element=True) -- (True, -1/7*beta - 3/7) -+ (True, 1/7*beta + 3/7) - sage: (1/10).is_norm(K, element=True) - (False, None) - sage: (1/691).is_norm(QQ, element=True) -diff -up src/sage/rings/residue_field.pyx.orig src/sage/rings/residue_field.pyx ---- src/sage/rings/residue_field.pyx.orig 2014-08-13 11:16:54.417162306 -0300 -+++ src/sage/rings/residue_field.pyx 2014-08-13 11:16:57.577162427 -0300 -@@ -19,13 +19,13 @@ monogenic (i.e., 2 is an essential discr - - sage: K. = NumberField(x^3 + x^2 - 2*x + 8) - sage: F = K.factor(2); F -- (Fractional ideal (-1/2*a^2 + 1/2*a - 1)) * (Fractional ideal (-a^2 + 2*a - 3)) * (Fractional ideal (3/2*a^2 - 5/2*a + 4)) -+ (Fractional ideal (1/2*a^2 - 1/2*a + 1)) * (Fractional ideal (-a^2 + 2*a - 3)) * (Fractional ideal (-3/2*a^2 + 5/2*a - 4)) - sage: F[0][0].residue_field() -- Residue field of Fractional ideal (-1/2*a^2 + 1/2*a - 1) -+ Residue field of Fractional ideal (1/2*a^2 - 1/2*a + 1) - sage: F[1][0].residue_field() - Residue field of Fractional ideal (-a^2 + 2*a - 3) - sage: F[2][0].residue_field() -- Residue field of Fractional ideal (3/2*a^2 - 5/2*a + 4) -+ Residue field of Fractional ideal (-3/2*a^2 + 5/2*a - 4) - - We can also form residue fields from `\ZZ`:: - -@@ -254,9 +254,9 @@ class ResidueFieldFactory(UniqueFactory) - the index of ``ZZ[a]`` in the maximal order for all ``a``:: - - sage: K. = NumberField(x^3 + x^2 - 2*x + 8); P = K.ideal(2).factor()[0][0]; P -- Fractional ideal (-1/2*a^2 + 1/2*a - 1) -+ Fractional ideal (1/2*a^2 - 1/2*a + 1) - sage: F = K.residue_field(P); F -- Residue field of Fractional ideal (-1/2*a^2 + 1/2*a - 1) -+ Residue field of Fractional ideal (1/2*a^2 - 1/2*a + 1) - sage: F(a) - 0 - sage: B = K.maximal_order().basis(); B -@@ -266,7 +266,7 @@ class ResidueFieldFactory(UniqueFactory) - sage: F(B[2]) - 0 - sage: F -- Residue field of Fractional ideal (-1/2*a^2 + 1/2*a - 1) -+ Residue field of Fractional ideal (1/2*a^2 - 1/2*a + 1) - sage: F.degree() - 1 - -@@ -692,15 +692,15 @@ class ResidueField_generic(Field): - EXAMPLES:: - - sage: I = QQ[3^(1/3)].factor(5)[1][0]; I -- Fractional ideal (a - 2) -+ Fractional ideal (-a + 2) - sage: k = I.residue_field(); k -- Residue field of Fractional ideal (a - 2) -+ Residue field of Fractional ideal (-a + 2) - sage: f = k.lift_map(); f - Lifting map: -- From: Residue field of Fractional ideal (a - 2) -+ From: Residue field of Fractional ideal (-a + 2) - To: Maximal Order in Number Field in a with defining polynomial x^3 - 3 - sage: f.domain() -- Residue field of Fractional ideal (a - 2) -+ Residue field of Fractional ideal (-a + 2) - sage: f.codomain() - Maximal Order in Number Field in a with defining polynomial x^3 - 3 - sage: f(k.0) -@@ -728,7 +728,7 @@ class ResidueField_generic(Field): - - sage: K. = NumberField(x^3-11) - sage: F = K.ideal(37).factor(); F -- (Fractional ideal (37, a + 12)) * (Fractional ideal (-2*a + 5)) * (Fractional ideal (37, a + 9)) -+ (Fractional ideal (37, a + 12)) * (Fractional ideal (2*a - 5)) * (Fractional ideal (37, a + 9)) - sage: k = K.residue_field(F[0][0]) - sage: l = K.residue_field(F[1][0]) - sage: k == l -@@ -805,7 +805,7 @@ cdef class ReductionMap(Map): - sage: F.reduction_map() - Partially defined reduction map: - From: Number Field in a with defining polynomial x^3 + x^2 - 2*x + 8 -- To: Residue field of Fractional ideal (-1/2*a^2 + 1/2*a - 1) -+ To: Residue field of Fractional ideal (1/2*a^2 - 1/2*a + 1) - - sage: K. = CyclotomicField(5) - sage: F = K.factor(7)[0][0].residue_field() -@@ -933,10 +933,10 @@ cdef class ReductionMap(Map): - - sage: K. = NumberField(x^2 + 1) - sage: P1, P2 = [g[0] for g in K.factor(5)]; (P1,P2) -- (Fractional ideal (-i - 2), Fractional ideal (i - 2)) -+ (Fractional ideal (-i - 2), Fractional ideal (2*i + 1)) - sage: a = 1/(1+2*i) - sage: F1, F2 = [g.residue_field() for g in [P1,P2]]; (F1,F2) -- (Residue field of Fractional ideal (-i - 2), Residue field of Fractional ideal (i - 2)) -+ (Residue field of Fractional ideal (-i - 2), Residue field of Fractional ideal (2*i + 1)) - sage: a.valuation(P1) - 0 - sage: F1(i/7) -@@ -948,7 +948,7 @@ cdef class ReductionMap(Map): - sage: F2(a) - Traceback (most recent call last): - ... -- ZeroDivisionError: Cannot reduce field element -2/5*i + 1/5 modulo Fractional ideal (i - 2): it has negative valuation -+ ZeroDivisionError: Cannot reduce field element -2/5*i + 1/5 modulo Fractional ideal (2*i + 1): it has negative valuation - """ - # The reduction map is just x |--> F(to_vs(x) * (PB**(-1))) if - # either x is integral or the denominator of x is coprime to -@@ -1012,7 +1012,7 @@ cdef class ReductionMap(Map): - sage: f = k.convert_map_from(K) - sage: s = f.section(); s - Lifting map: -- From: Residue field in abar of Fractional ideal (-14*a^4 + 24*a^3 + 26*a^2 - 58*a + 15) -+ From: Residue field in abar of Fractional ideal (14*a^4 - 24*a^3 - 26*a^2 + 58*a - 15) - To: Number Field in a with defining polynomial x^5 - 5*x + 2 - sage: s(k.gen()) - a -@@ -1223,7 +1223,7 @@ cdef class ResidueFieldHomomorphism_glob - sage: f = k.coerce_map_from(K.ring_of_integers()) - sage: s = f.section(); s - Lifting map: -- From: Residue field in abar of Fractional ideal (-14*a^4 + 24*a^3 + 26*a^2 - 58*a + 15) -+ From: Residue field in abar of Fractional ideal (14*a^4 - 24*a^3 - 26*a^2 + 58*a - 15) - To: Maximal Order in Number Field in a with defining polynomial x^5 - 5*x + 2 - sage: s(k.gen()) - a -diff -up src/sage/schemes/elliptic_curves/ell_generic.py.orig src/sage/schemes/elliptic_curves/ell_generic.py ---- src/sage/schemes/elliptic_curves/ell_generic.py.orig 2014-08-13 11:16:54.419162306 -0300 -+++ src/sage/schemes/elliptic_curves/ell_generic.py 2014-08-13 11:16:57.578162427 -0300 -@@ -527,7 +527,7 @@ class EllipticCurve_generic(WithEquality - sage: E = EllipticCurve([0,0,0,-49,0]) - sage: T = E.torsion_subgroup() - sage: [E(t) for t in T] -- [(0 : 1 : 0), (7 : 0 : 1), (0 : 0 : 1), (-7 : 0 : 1)] -+ [(0 : 1 : 0), (-7 : 0 : 1), (0 : 0 : 1), (7 : 0 : 1)] - - :: - -@@ -2866,26 +2866,24 @@ class EllipticCurve_generic(WithEquality - Over a finite field:: - - sage: EllipticCurve(GF(41),[2,5]).pari_curve() -- [Mod(0, 41), Mod(0, 41), Mod(0, 41), Mod(2, 41), Mod(5, 41), Mod(0, 41), Mod(4, 41), Mod(20, 41), Mod(37, 41), Mod(27, 41), Mod(26, 41), Mod(4, 41), Mod(11, 41), 0, 0, 0, 0, 0, 0] -+ [Mod(0, 41), Mod(0, 41), Mod(0, 41), Mod(2, 41), Mod(5, 41), Mod(0, 41), Mod(4, 41), Mod(20, 41), Mod(37, 41), Mod(27, 41), Mod(26, 41), Mod(4, 41), Mod(11, 41), Vecsmall([3]), [41, [9, 31, [6, 0, 0, 0]]], [0, 0, 0, 0]] - - Over a `p`-adic field:: - - sage: Qp = pAdicField(5, prec=3) - sage: E = EllipticCurve(Qp,[3, 4]) - sage: E.pari_curve() -- [O(5^3), O(5^3), O(5^3), 3 + O(5^3), 4 + O(5^3), O(5^3), 1 + 5 + O(5^3), 1 + 3*5 + O(5^3), 1 + 3*5 + 4*5^2 + O(5^3), 1 + 5 + 4*5^2 + O(5^3), 4 + 3*5 + 5^2 + O(5^3), 2*5 + 4*5^2 + O(5^3), 3*5^-1 + O(5), [4 + 4*5 + 4*5^2 + O(5^3)], 1 + 2*5 + 4*5^2 + O(5^3), 1 + 5 + 4*5^2 + O(5^3), 2*5 + 4*5^2 + O(5^3), 3 + 3*5 + 3*5^2 + O(5^3), 0] -+ [0, 0, 0, 3, 4, 0, 6, 16, -9, -144, -3456, -8640, 1728/5, Vecsmall([2]), [O(5^3)], [0, 0]] - sage: E.j_invariant() - 3*5^-1 + O(5) - -- The `j`-invariant must have negative `p`-adic valuation:: -+ PARI no longer requires that the `j`-invariant has negative `p`-adic valuation:: - - sage: E = EllipticCurve(Qp,[1, 1]) - sage: E.j_invariant() # the j-invariant is a p-adic integer - 2 + 4*5^2 + O(5^3) - sage: E.pari_curve() -- Traceback (most recent call last): -- ... -- PariError: valuation of j must be negative in p-adic ellinit -+ [0, 0, 0, 1, 1, 0, 2, 4, -1, -48, -864, -496, 6912/31, Vecsmall([2]), [O(5^3)], [0, 0]] - """ - try: - return self._pari_curve -@@ -2908,13 +2906,11 @@ class EllipticCurve_generic(WithEquality - - sage: E = EllipticCurve('11a1') - sage: pari(E) -- [0, -1, 1, -10, -20, -4, -20, -79, -21, 496, 20008, -161051, -122023936/161051, [4.34630815820539, -1.67315407910270 + 1.32084892226908*I, -1.67315407910270 - 1.32084892226908*I]~, ...] -- sage: E.pari_curve(prec=64) -- [0, -1, 1, -10, -20, -4, -20, -79, -21, 496, 20008, -161051, -122023936/161051, [4.34630815820539, -1.67315407910270 + 1.32084892226908*I, -1.67315407910270 - 1.32084892226908*I]~, ...] -+ [0, -1, 1, -10, -20, -4, -20, -79, -21, 496, 20008, -161051, -122023936/161051, Vecsmall([1]), [Vecsmall([64, -1])], [0, 0, 0, 0, 0, 0, 0, 0]] - - Over a finite field:: - - sage: EllipticCurve(GF(2), [0,0,1,1,1])._pari_() -- [Mod(0, 2), Mod(0, 2), Mod(1, 2), Mod(1, 2), Mod(1, 2), Mod(0, 2), Mod(0, 2), Mod(1, 2), Mod(1, 2), Mod(0, 2), Mod(0, 2), Mod(1, 2), Mod(0, 2), 0, 0, 0, 0, 0, 0] -+ [0, 0, 1, 1, 1, 0, 0, 1, 1, 0, 0, 1, 0, Vecsmall([4]), [1, [[Vecsmall([0, 1]), Vecsmall([0, 1]), Vecsmall([0, 1])], Vecsmall([0, 1]), [Vecsmall([0, 1]), Vecsmall([0]), Vecsmall([0]), Vecsmall([0])]]], [0, 0, 0, 0]] - """ - return self.pari_curve() -diff -up src/sage/schemes/elliptic_curves/ell_number_field.py.orig src/sage/schemes/elliptic_curves/ell_number_field.py ---- src/sage/schemes/elliptic_curves/ell_number_field.py.orig 2014-08-13 11:16:54.422162306 -0300 -+++ src/sage/schemes/elliptic_curves/ell_number_field.py 2014-08-13 11:16:57.578162427 -0300 -@@ -259,8 +259,10 @@ class EllipticCurve_number_field(Ellipti - A = 0 - B = Mod(1, y^2 + 7) - C = Mod(y, y^2 + 7) -+ - Computing L(S,2) -- L(S,2) = [Mod(Mod(-1, y^2 + 7)*x^2 + Mod(-1/2*y + 1/2, y^2 + 7)*x + 1, x^3 + Mod(1, y^2 + 7)*x + Mod(y, y^2 + 7)), Mod(Mod(-1, y^2 + 7)*x^2 + Mod(-1/2*y - 1/2, y^2 + 7)*x + 1, x^3 + Mod(1, y^2 + 7)*x + Mod(y, y^2 + 7)), Mod(-1, x^3 + Mod(1, y^2 + 7)*x + Mod(y, y^2 + 7)), Mod(Mod(1/2*y - 1/2, y^2 + 7)*x + Mod(1/2*y - 3/2, y^2 + 7), x^3 + Mod(1, y^2 + 7)*x + Mod(y, y^2 + 7)), Mod(Mod(1, y^2 + 7)*x + Mod(1/2*y + 3/2, y^2 + 7), x^3 + Mod(1, y^2 + 7)*x + Mod(y, y^2 + 7)), Mod(Mod(-1, y^2 + 7)*x + Mod(-1/2*y + 3/2, y^2 + 7), x^3 + Mod(1, y^2 + 7)*x + Mod(y, y^2 + 7))] -+ L(S,2) = [Mod(Mod(-1, y^2 + 7)*x^2 + Mod(-1/2*y + 1/2, y^2 + 7)*x + 1, x^3 + Mod(1, y^2 + 7)*x + Mod(y, y^2 + 7)), Mod(Mod(-1, y^2 + 7)*x^2 + Mod(-1/2*y - 1/2, y^2 + 7)*x + 1, x^3 + Mod(1, y^2 + 7)*x + Mod(y, y^2 + 7)), Mod(-1, x^3 + Mod(1, y^2 + 7)*x + Mod(y, y^2 + 7)), Mod(x^2 + 2, x^3 + Mod(1, y^2 + 7)*x + Mod(y, y^2 + 7)), Mod(Mod(1, y^2 + 7)*x + Mod(1/2*y + 3/2, y^2 + 7), x^3 + Mod(1, y^2 + 7)*x + Mod(y, y^2 + 7)), Mod(Mod(1, y^2 + 7)*x + Mod(1/2*y - 3/2, y^2 + 7), x^3 + Mod(1, y^2 + 7)*x + Mod(y, y^2 + 7))] -+ - Computing the Selmer group - #LS2gen = 2 - LS2gen = [Mod(Mod(-5, y^2 + 7)*x^2 + Mod(-3*y, y^2 + 7)*x + Mod(8, y^2 + 7), x^3 + Mod(1, y^2 + 7)*x + Mod(y, y^2 + 7)), Mod(Mod(1, y^2 + 7)*x^2 + Mod(1/2*y - 1/2, y^2 + 7)*x - 1, x^3 + Mod(1, y^2 + 7)*x + Mod(y, y^2 + 7))] -@@ -274,7 +276,7 @@ class EllipticCurve_number_field(Ellipti - zc*z1^2 = Mod(Mod(2*y - 2, y^2 + 7)*x + Mod(2*y + 10, y^2 + 7), x^3 + Mod(1, y^2 + 7)*x + Mod(y, y^2 + 7)) - quartic: (-1/2*y + 1/2)*Y^2 = x^4 + (-3*y - 15)*x^2 + (-8*y - 16)*x + (-11/2*y - 15/2) - reduced: Y^2 = (-1/2*y + 1/2)*x^4 - 4*x^3 + (-3*y + 3)*x^2 + (2*y - 2)*x + (1/2*y + 3/2) -- not ELS at [2, [0, 1]~, 1, 1, [1, 1]~] -+ not ELS at [2, [0, 1]~, 1, 1, [1, -2; 1, 0]] - zc = Mod(Mod(1, y^2 + 7)*x^2 + Mod(1/2*y + 1/2, y^2 + 7)*x + Mod(-1, y^2 + 7), x^3 + Mod(1, y^2 + 7)*x + Mod(y, y^2 + 7)) - comes from the trivial point [Mod(1/2*y + 3/2, y^2 + 7), Mod(-y - 2, y^2 + 7)] - m1 = 1 -@@ -314,8 +316,7 @@ class EllipticCurve_number_field(Ellipti - sage: K = CyclotomicField(43).subfields(3)[0][0] - sage: E = EllipticCurve(K, '37') - sage: E.simon_two_descent() # long time (4s on sage.math, 2013) -- (3, 3, [(0 : 0 : 1), (1/2*zeta43_0^2 + 3/2*zeta43_0 - 2 : -zeta43_0^2 - 4*zeta43_0 + 3 : 1)]) -- -+ (3, 3, [(0 : 0 : 1), (-1/4*zeta43_0^2 - 1/2*zeta43_0 + 3 : -3/8*zeta43_0^2 - 3/4*zeta43_0 + 4 : 1)]) - """ - verbose = int(verbose) - if known_points is None: -@@ -358,7 +359,7 @@ class EllipticCurve_number_field(Ellipti - - ``map`` -- (default: ``False``) also return an embedding of - the :meth:`base_field` into the resulting field. - -- - ``kwds`` -- additional keywords passed to -+ - ``kwds`` -- additional keywords passed to - :func:`sage.rings.number_field.splitting_field.splitting_field`. - - OUTPUT: -@@ -818,7 +819,7 @@ class EllipticCurve_number_field(Ellipti - sage: K. = NumberField(x^2 + 161*x - 150) - sage: E = EllipticCurve([25105/216*v - 3839/36, 634768555/7776*v - 98002625/1296, 634768555/7776*v - 98002625/1296, 0, 0]) - sage: E.global_integral_model() -- Elliptic Curve defined by y^2 + (-502639783*v+465618899)*x*y + (-6603604211463489399460860*v+6117229527723443603191500)*y = x^3 + (1526887622075335620*v-1414427901517840500)*x^2 over Number Field in v with defining polynomial x^2 + 161*x - 150 -+ Elliptic Curve defined by y^2 + (2094779518028859*v-1940492905300351)*x*y + (477997268472544193101178234454165304071127500*v-442791377441346852919930773849502871958097500)*y = x^3 + (26519784690047674853185542622500*v-24566525306469707225840460652500)*x^2 over Number Field in v with defining polynomial x^2 + 161*x - 150 - - :trac:`14476`:: - -@@ -948,7 +949,7 @@ class EllipticCurve_number_field(Ellipti - sage: K. = NumberField(x^2+1) - sage: E = EllipticCurve([1 + i, 0, 1, 0, 0]) - sage: E.local_data() -- [Local data at Fractional ideal (i - 2): -+ [Local data at Fractional ideal (2*i + 1): - Reduction type: bad non-split multiplicative - Local minimal model: Elliptic Curve defined by y^2 + (i+1)*x*y + y = x^3 over Number Field in i with defining polynomial x^2 + 1 - Minimal discriminant valuation: 1 -@@ -1508,7 +1509,7 @@ class EllipticCurve_number_field(Ellipti - Fractional ideal (21*i - 3) - sage: K.=NumberField(x^2-x+3) - sage: EllipticCurve([1 + a , -1 + a , 1 + a , -11 + a , 5 -9*a ]).conductor() -- Fractional ideal (6*a) -+ Fractional ideal (-6*a) - - A not so well known curve with everywhere good reduction:: - -@@ -2117,7 +2118,7 @@ class EllipticCurve_number_field(Ellipti - sage: E.gens(lim1=1, lim3=1) - [] - sage: E.rank(), E.gens() # long time (about 3 s) -- (1, [(-369/25*y^3 + 539/25*y^2 - 1178/25*y + 1718/25 : -27193/125*y^3 + 39683/125*y^2 - 86816/125*y + 126696/125 : 1)]) -+ (1, [(9/25*y^2 + 26/25 : -229/125*y^3 - 67/25*y^2 - 731/125*y - 213/25 : 1)]) - - Here is a curve of rank 2, yet the list contains many points:: - -@@ -2310,10 +2311,10 @@ class EllipticCurve_number_field(Ellipti - sage: K. = QuadraticField(-1) - sage: E1 = EllipticCurve([i + 1, 0, 1, -240*i - 400, -2869*i - 2627]) - sage: E1.conductor() -- Fractional ideal (4*i + 7) -+ Fractional ideal (-4*i - 7) - sage: E2 = EllipticCurve([1+i,0,1,0,0]) - sage: E2.conductor() -- Fractional ideal (4*i + 7) -+ Fractional ideal (-4*i - 7) - sage: E1.is_isogenous(E2) # long time (2s on sage.math, 2014) - Traceback (most recent call last): - ... -diff -up src/sage/schemes/elliptic_curves/ell_point.py.orig src/sage/schemes/elliptic_curves/ell_point.py ---- src/sage/schemes/elliptic_curves/ell_point.py.orig 2014-08-13 11:16:54.424162306 -0300 -+++ src/sage/schemes/elliptic_curves/ell_point.py 2014-08-13 11:16:57.579162427 -0300 -@@ -2266,7 +2266,7 @@ class EllipticCurvePoint_number_field(El - sage: E.discriminant().support() - [Fractional ideal (i + 1), - Fractional ideal (-i - 2), -- Fractional ideal (i - 2), -+ Fractional ideal (2*i + 1), - Fractional ideal (3)] - sage: [E.tamagawa_exponent(p) for p in E.discriminant().support()] - [1, 4, 4, 4] -@@ -2651,7 +2651,7 @@ class EllipticCurvePoint_number_field(El - Emin = E.minimal_model() - iso = E.isomorphism_to(Emin) - P = iso(self) -- h = Emin.pari_curve(prec=precision).ellheight(P, precision=precision) -+ h = Emin.pari_curve().ellheight(P, precision=precision) - height = rings.RealField(precision)(h) - else: - height = (self.non_archimedean_local_height(prec=precision) -@@ -3192,7 +3192,7 @@ class EllipticCurvePoint_number_field(El - E_work = EllipticCurve(ai) # defined over RR - pt_pari = pari([emb(x), emb(y)]) - working_prec = precision -- E_pari = E_work.pari_curve(prec=working_prec) -+ E_pari = E_work.pari_curve() - log_pari = E_pari.ellpointtoz(pt_pari, precision=working_prec) - - while prec_words_to_bits(log_pari.precision()) < precision: -@@ -3206,7 +3206,7 @@ class EllipticCurvePoint_number_field(El - ai = [emb(a) for a in E.a_invariants()] - E_work = EllipticCurve(ai) # defined over RR - pt_pari = pari([emb(x), emb(y)]) -- E_pari = E_work.pari_curve(prec=working_prec) -+ E_pari = E_work.pari_curve() - log_pari = E_pari.ellpointtoz(pt_pari, precision=working_prec) - - # normalization step -diff -up src/sage/schemes/elliptic_curves/ell_rational_field.py.orig src/sage/schemes/elliptic_curves/ell_rational_field.py ---- src/sage/schemes/elliptic_curves/ell_rational_field.py.orig 2014-08-13 11:16:54.426162306 -0300 -+++ src/sage/schemes/elliptic_curves/ell_rational_field.py 2014-08-13 11:16:57.580162427 -0300 -@@ -562,17 +562,9 @@ class EllipticCurve_rational_field(Ellip - - INPUT: - -+ - ``prec`` -- Deprecated - -- - ``prec`` - The precision of quantities calculated for the -- returned curve, in bits. If None, defaults to factor -- multiplied by the precision of the largest cached curve (or -- a small default precision depending on the curve if none yet -- computed). -- -- - ``factor`` - The factor by which to increase the -- precision over the maximum previously computed precision. Only used -- if prec (which gives an explicit precision) is None. -- -+ - ``factor`` -- Deprecated - - EXAMPLES:: - -@@ -588,85 +580,55 @@ class EllipticCurve_rational_field(Ellip - :: - - sage: E = EllipticCurve(RationalField(), ['1/3', '2/3']) -- sage: e = E.pari_curve(prec=100) -- sage: 100 in E._pari_curve -- True -- sage: e.type() -- 't_VEC' -+ sage: e = E.pari_curve() - sage: e[:5] - [0, 0, 0, 1/3, 2/3] - -- This shows that the bug uncovered by trac:`3954` is fixed:: -- -- sage: 100 in E._pari_curve -- True -- -- :: -+ When doing certain computations, PARI caches the results:: - - sage: E = EllipticCurve('37a1') - sage: _ = E.__dict__.pop('_pari_curve') # clear cached data -- sage: Epari = E.pari_curve() -- sage: Epari[14].python().prec() -- 64 -- sage: [a.precision() for a in Epari] -- [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 4, 4, 4, 4] # 32-bit -- [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 3, 3, 3, 3] # 64-bit -- sage: Epari = E.pari_curve(factor=2) -- sage: Epari[14].python().prec() -- 128 -+ sage: Epari -+ [0, 0, 1, -1, 0, 0, -2, 1, -1, 48, -216, 37, 110592/37, Vecsmall([1]), [Vecsmall([64, 1])], [0, 0, 0, 0, 0, 0, 0, 0]] -+ sage: Epari.omega() -+ [2.99345864623196, -2.45138938198679*I] -+ sage: Epari -+ [0, 0, 1, -1, 0, 0, -2, 1, -1, 48, -216, 37, 110592/37, Vecsmall([1]), [Vecsmall([64, 1])], [[2.99345864623196, -2.45138938198679*I], 0, [0.837565435283323, 0.269594436405445, -1.10715987168877]~, 0, 0, 0, 0, 0]] - -- This shows that the bug uncovered by trac`4715` is fixed:: -+ This shows that the bug uncovered by :trac:`4715` is fixed:: - - sage: Ep = EllipticCurve('903b3').pari_curve() - -- When the curve coefficients are large, a larger precision is -- required (see :trac:`13163`):: -+ This still works, even When the curve coefficients are large -+ (see :trac:`13163`):: - - sage: E = EllipticCurve([4382696457564794691603442338788106497, 28, 3992, 16777216, 298]) -- sage: E.pari_curve(prec=64) -- Traceback (most recent call last): -- ... -- PariError: precision too low in ellinit -- sage: E.pari_curve() # automatically choose the right precision -- [4382696457564794691603442338788106497, 28, 3992, 16777216, 298, ...] -- sage: E.minimal_model() -+ sage: E.pari_curve() - Elliptic Curve defined by y^2 + x*y + y = x^3 + x^2 - 7686423934083797390675981169229171907674183588326184511391146727143672423167091484392497987721106542488224058921302964259990799229848935835464702*x + 8202280443553761483773108648734271851215988504820214784899752662100459663011709992446860978259617135893103951840830254045837355547141096270521198994389833928471736723050112419004202643591202131091441454709193394358885 over Rational Field -- """ -- try: -- # if the PARI curve has already been computed to this -- # precision, returned the cached copy -- return self._pari_curve[prec] -- except AttributeError: -- self._pari_curve = {} -- except KeyError: -- pass - -- # Double the precision if needed? -- retry_prec = False -+ The arguments ``prec`` and ``factor`` are deprecated:: - -- if prec is None: -- if len(self._pari_curve) == 0: -- # No curves computed yet -- prec = 64 -- retry_prec = True -- else: -- # Take largest cached precision -- prec = max(self._pari_curve.keys()) -- if factor == 1: -- return self._pari_curve[prec] -- prec = int(prec * factor) -+ sage: E.pari_curve(prec=128) -+ doctest:...: DeprecationWarning: The prec argument to pari_curve() is deprecated and no longer used -+ See http://trac.sagemath.org/15767 for details. -+ [4382696457564794691603442338788106497, 28, 3992, 16777216, 298, ...] -+ sage: E.pari_curve(factor=2) -+ doctest:...: DeprecationWarning: The factor argument to pari_curve() is deprecated and no longer used -+ See http://trac.sagemath.org/15767 for details. -+ [4382696457564794691603442338788106497, 28, 3992, 16777216, 298, ...] -+ """ -+ if prec is not None: -+ from sage.misc.superseded import deprecation -+ deprecation(15767, 'The prec argument to pari_curve() is deprecated and no longer used') -+ if factor != 1: -+ from sage.misc.superseded import deprecation -+ deprecation(15767, 'The factor argument to pari_curve() is deprecated and no longer used') - -- pari_invariants = pari(self.a_invariants()) -- while True: -- try: -- self._pari_curve[prec] = pari_invariants.ellinit(precision=prec) -- return self._pari_curve[prec] -- except PariError as e: -- if retry_prec and 'precision too low' in str(e): -- # Retry with double precision -- prec *= 2 -- else: -- raise -+ try: -+ return self._pari_curve -+ except AttributeError: -+ self._pari_curve = pari(self.a_invariants()).ellinit() -+ return self._pari_curve - - def pari_mincurve(self, prec=None, factor=1): - """ -@@ -675,16 +637,9 @@ class EllipticCurve_rational_field(Ellip - - INPUT: - -+ - ``prec`` -- Deprecated - -- - ``prec`` - The precision of quantities calculated for the -- returned curve, in bits. If None, defaults to factor -- multiplied by the precision of the largest cached curve (or -- the default real precision if none yet computed). -- -- - ``factor`` - The factor by which to increase the -- precision over the maximum previously computed precision. Only used -- if prec (which gives an explicit precision) is None. -- -+ - ``factor`` -- Deprecated - - EXAMPLES:: - -@@ -695,29 +650,21 @@ class EllipticCurve_rational_field(Ellip - sage: E.conductor() - 47232 - sage: e.ellglobalred() -- [47232, [1, 0, 0, 0], 2] -+ [47232, [1, 0, 0, 0], 2, [2, 7; 3, 2; 41, 1], [[7, 2, 0, 1], [2, -3, 0, 2], [1, 5, 0, 1]]] - """ -+ if prec is not None: -+ from sage.misc.superseded import deprecation -+ deprecation(15767, 'The prec argument to pari_mincurve() is deprecated and no longer used') -+ if factor != 1: -+ from sage.misc.superseded import deprecation -+ deprecation(15767, 'The factor argument to pari_mincurve() is deprecated and no longer used') -+ - try: -- # if the PARI curve has already been computed to this -- # precision, returned the cached copy -- return self._pari_mincurve[prec] -+ return self._pari_mincurve - except AttributeError: -- # no PARI curves have been computed for this elliptic curve -- self._pari_mincurve = {} -- except KeyError: -- # PARI curves are cached for this elliptic curve, but they -- # are not of the requested precision (or prec = None) -- if prec is None: -- L = sorted(self._pari_mincurve.keys()) -- if factor == 1: -- return self._pari_mincurve[L[-1]] -- else: -- prec = int(factor * L[-1]) -- e = self.pari_curve(prec) -- mc, change = e.ellminimalmodel() -- self._pari_mincurve[prec] = mc -- # self.__min_transform = change -- return mc -+ mc, change = self.pari_curve().ellminimalmodel() -+ self._pari_mincurve = mc -+ return self._pari_mincurve - - @cached_method - def database_attributes(self): -@@ -3716,12 +3663,12 @@ class EllipticCurve_rational_field(Ellip - Torsion Subgroup isomorphic to Z/2 + Z/8 associated to the Elliptic - Curve defined by y^2 = x^3 - 1386747*x + 368636886 over - Rational Field -- sage: G.0 -+ sage: G.0*3 + G.1 - (1227 : 22680 : 1) - sage: G.1 - (282 : 0 : 1) - sage: list(G) -- [(0 : 1 : 0), (1227 : 22680 : 1), (2307 : -97200 : 1), (8787 : 816480 : 1), (1011 : 0 : 1), (8787 : -816480 : 1), (2307 : 97200 : 1), (1227 : -22680 : 1), (282 : 0 : 1), (-933 : 29160 : 1), (-285 : -27216 : 1), (147 : 12960 : 1), (-1293 : 0 : 1), (147 : -12960 : 1), (-285 : 27216 : 1), (-933 : -29160 : 1)] -+ [(0 : 1 : 0), (147 : 12960 : 1), (2307 : 97200 : 1), (-933 : 29160 : 1), (1011 : 0 : 1), (-933 : -29160 : 1), (2307 : -97200 : 1), (147 : -12960 : 1), (282 : 0 : 1), (8787 : 816480 : 1), (-285 : 27216 : 1), (1227 : 22680 : 1), (-1293 : 0 : 1), (1227 : -22680 : 1), (-285 : -27216 : 1), (8787 : -816480 : 1)] - """ - try: - return self.__torsion_subgroup -@@ -3756,10 +3703,10 @@ class EllipticCurve_rational_field(Ellip - sage: EllipticCurve('37b').torsion_points() - [(0 : 1 : 0), (8 : -19 : 1), (8 : 18 : 1)] - -- :: -+ Some curves with large torsion groups:: - -- sage: E=EllipticCurve([-1386747,368636886]) -- sage: T=E.torsion_subgroup(); T -+ sage: E = EllipticCurve([-1386747,368636886]) -+ sage: T = E.torsion_subgroup(); T - Torsion Subgroup isomorphic to Z/2 + Z/8 associated to the Elliptic Curve defined by y^2 = x^3 - 1386747*x + 368636886 over Rational Field - sage: T == E.torsion_subgroup(algorithm="doud") - True -@@ -3767,33 +3714,54 @@ class EllipticCurve_rational_field(Ellip - True - sage: E.torsion_points() - [(-1293 : 0 : 1), -- (-933 : -29160 : 1), -- (-933 : 29160 : 1), -- (-285 : -27216 : 1), -- (-285 : 27216 : 1), -- (0 : 1 : 0), -- (147 : -12960 : 1), -- (147 : 12960 : 1), -- (282 : 0 : 1), -- (1011 : 0 : 1), -- (1227 : -22680 : 1), -- (1227 : 22680 : 1), -- (2307 : -97200 : 1), -- (2307 : 97200 : 1), -- (8787 : -816480 : 1), -- (8787 : 816480 : 1)] -+ (-933 : -29160 : 1), -+ (-933 : 29160 : 1), -+ (-285 : -27216 : 1), -+ (-285 : 27216 : 1), -+ (0 : 1 : 0), -+ (147 : -12960 : 1), -+ (147 : 12960 : 1), -+ (282 : 0 : 1), -+ (1011 : 0 : 1), -+ (1227 : -22680 : 1), -+ (1227 : 22680 : 1), -+ (2307 : -97200 : 1), -+ (2307 : 97200 : 1), -+ (8787 : -816480 : 1), -+ (8787 : 816480 : 1)] -+ sage: EllipticCurve('210b5').torsion_points() -+ [(-41/4 : 37/8 : 1), -+ (-5 : -103 : 1), -+ (-5 : 107 : 1), -+ (0 : 1 : 0), -+ (10 : -208 : 1), -+ (10 : 197 : 1), -+ (37 : -397 : 1), -+ (37 : 359 : 1), -+ (100 : -1153 : 1), -+ (100 : 1052 : 1), -+ (415 : -8713 : 1), -+ (415 : 8297 : 1)] -+ sage: EllipticCurve('210e2').torsion_points() -+ [(-36 : 18 : 1), -+ (-26 : -122 : 1), -+ (-26 : 148 : 1), -+ (-8 : -122 : 1), -+ (-8 : 130 : 1), -+ (0 : 1 : 0), -+ (4 : -62 : 1), -+ (4 : 58 : 1), -+ (31/4 : -31/8 : 1), -+ (28 : -14 : 1), -+ (34 : -122 : 1), -+ (34 : 88 : 1), -+ (64 : -482 : 1), -+ (64 : 418 : 1), -+ (244 : -3902 : 1), -+ (244 : 3658 : 1)] - """ - return sorted(self.torsion_subgroup(algorithm).points()) - -- ## def newform_eval(self, z, prec): --## """ --## The value of the newform attached to this elliptic curve at --## the point z in the complex upper half plane, computed using --## prec terms of the power series expansion. Note that the power --## series need not converge well near the real axis. --## """ --## raise NotImplementedError -- - @cached_method - def root_number(self, p=None): - """ -diff -up src/sage/schemes/elliptic_curves/ell_torsion.py.orig src/sage/schemes/elliptic_curves/ell_torsion.py ---- src/sage/schemes/elliptic_curves/ell_torsion.py.orig 2014-08-13 11:16:54.429162306 -0300 -+++ src/sage/schemes/elliptic_curves/ell_torsion.py 2014-08-13 11:16:57.580162427 -0300 -@@ -44,7 +44,7 @@ class EllipticCurveTorsionSubgroup(group - sage: G.order() - 4 - sage: G.gen(0) -- (2 : 0 : 1) -+ (-2 : 0 : 1) - sage: G.gen(1) - (0 : 0 : 1) - sage: G.ngens() -@@ -81,7 +81,7 @@ class EllipticCurveTorsionSubgroup(group - sage: E = EllipticCurve([0,0,0,-49,0]) - sage: T = E.torsion_subgroup() - sage: [E(t) for t in T] -- [(0 : 1 : 0), (7 : 0 : 1), (0 : 0 : 1), (-7 : 0 : 1)] -+ [(0 : 1 : 0), (-7 : 0 : 1), (0 : 0 : 1), (7 : 0 : 1)] - - An example where the torsion subgroup is trivial:: - -@@ -166,23 +166,15 @@ class EllipticCurveTorsionSubgroup(group - if self.__K is RationalField() and algorithm in pari_torsion_algorithms: - flag = pari_torsion_algorithms.index(algorithm) - -- G = None -- loop = 0 -- while G is None and loop < 3: -- loop += 1 -- try: -- G = self.__E.pari_curve(prec = 400).elltors(flag) # pari_curve will return the curve of maximum known precision -- except RuntimeError: -- self.__E.pari_curve(factor = 2) # caches a curve of twice the precision -- if G is not None: -- order = G[0].python() -- structure = G[1].python() -- gens = G[2].python() -- -- self.__torsion_gens = [ self.__E(P) for P in gens ] -- from sage.groups.additive_abelian.additive_abelian_group import cover_and_relations_from_invariants -- groups.AdditiveAbelianGroupWrapper.__init__(self, self.__E(0).parent(), self.__torsion_gens, structure) -- return -+ G = self.__E.pari_curve().elltors(flag) -+ order = G[0].python() -+ structure = G[1].python() -+ gens = G[2].python() -+ -+ self.__torsion_gens = [ self.__E(P) for P in gens ] -+ from sage.groups.additive_abelian.additive_abelian_group import cover_and_relations_from_invariants -+ groups.AdditiveAbelianGroupWrapper.__init__(self, self.__E(0).parent(), self.__torsion_gens, structure) -+ return - - T1 = E(0) # these will be the two generators - T2 = E(0) -diff -up src/sage/schemes/elliptic_curves/heegner.py.orig src/sage/schemes/elliptic_curves/heegner.py ---- src/sage/schemes/elliptic_curves/heegner.py.orig 2014-08-13 11:16:54.431162306 -0300 -+++ src/sage/schemes/elliptic_curves/heegner.py 2014-08-13 11:16:57.581162427 -0300 -@@ -22,7 +22,7 @@ EXAMPLES:: - 1 - sage: K. = QuadraticField(-8) - sage: K.factor(3) -- (Fractional ideal (1/2*a + 1)) * (Fractional ideal (1/2*a - 1)) -+ (Fractional ideal (1/2*a + 1)) * (Fractional ideal (-1/2*a + 1)) - - Next try an inert prime:: - -diff -up src/sage/schemes/elliptic_curves/lseries_ell.py.orig src/sage/schemes/elliptic_curves/lseries_ell.py ---- src/sage/schemes/elliptic_curves/lseries_ell.py.orig 2014-08-13 11:16:54.433162306 -0300 -+++ src/sage/schemes/elliptic_curves/lseries_ell.py 2014-08-13 11:16:57.581162427 -0300 -@@ -67,8 +67,8 @@ class Lseries_ell(SageObject): - sage: E = EllipticCurve('389a') - sage: L = E.lseries() - sage: L.taylor_series(series_prec=3) -- -1.28158145675273e-23 + (7.26268290541182e-24)*z + 0.759316500288427*z^2 + O(z^3) # 32-bit -- -2.69129566562797e-23 + (1.52514901968783e-23)*z + 0.759316500288427*z^2 + O(z^3) # 64-bit -+ -1.27685190980159e-23 + (7.23588070754027e-24)*z + 0.759316500288427*z^2 + O(z^3) # 32-bit -+ -2.72911738151096e-23 + (1.54658247036311e-23)*z + 0.759316500288427*z^2 + O(z^3) # 64-bit - sage: L.taylor_series(series_prec=3)[2:] - 0.000000000000000 + 0.000000000000000*z + 0.759316500288427*z^2 + O(z^3) - """ -@@ -602,7 +602,7 @@ class Lseries_ell(SageObject): - sage: E.lseries().deriv_at1() - (-0.00010911444, 0.142428) - sage: E.lseries().deriv_at1(4000) -- (6.9902290...e-50, 1.31318e-43) -+ (6.990...e-50, 1.31318e-43) - """ - sqrtN = sqrt(self.__E.conductor()) - if k: -diff -up src/sage/schemes/elliptic_curves/modular_parametrization.py.orig src/sage/schemes/elliptic_curves/modular_parametrization.py ---- src/sage/schemes/elliptic_curves/modular_parametrization.py.orig 2014-08-13 11:16:54.435162306 -0300 -+++ src/sage/schemes/elliptic_curves/modular_parametrization.py 2014-08-13 11:16:57.582162427 -0300 -@@ -245,9 +245,9 @@ class ModularParameterization: - - EXAMPLES:: - -- sage: E=EllipticCurve('389a1') -+ sage: E = EllipticCurve('389a1') - sage: phi = E.modular_parametrization() -- sage: X,Y = phi.power_series(prec = 10) -+ sage: X,Y = phi.power_series(prec=10) - sage: X - q^-2 + 2*q^-1 + 4 + 7*q + 13*q^2 + 18*q^3 + 31*q^4 + 49*q^5 + 74*q^6 + 111*q^7 + O(q^8) - sage: Y -@@ -264,21 +264,16 @@ class ModularParameterization: - sage: E.defining_polynomial()(X,Y,1) + O(q^11) == 0 - True - -- Note that below we have to change variable from x to q:: -+ Note that below we have to change variable from `x` to `q`:: - -- sage: a1,_,a3,_,_=E.a_invariants() -- sage: f=E.q_expansion(17) -- sage: q=f.parent().gen() -+ sage: a1,_,a3,_,_ = E.a_invariants() -+ sage: f = E.q_expansion(17) -+ sage: q = f.parent().gen() - sage: f/q == (X.derivative()/(2*Y+a1*X+a3)) - True - """ - R = LaurentSeriesRing(RationalField(),'q') - if not self._E.is_minimal(): -- raise NotImplementedError("Only implemented for minimal curves.") -- from sage.libs.all import pari -- old_prec = pari.get_series_precision() -- pari.set_series_precision(prec-1) -- XY = self._E.pari_mincurve().elltaniyama() -- pari.set_series_precision(old_prec) -+ raise NotImplementedError("only implemented for minimal curves") -+ XY = self._E.pari_mincurve().elltaniyama(prec-1) - return R(XY[0]),R(XY[1]) -- -diff -up src/sage/schemes/elliptic_curves/period_lattice.py.orig src/sage/schemes/elliptic_curves/period_lattice.py ---- src/sage/schemes/elliptic_curves/period_lattice.py.orig 2014-08-13 11:16:54.438162307 -0300 -+++ src/sage/schemes/elliptic_curves/period_lattice.py 2014-08-13 11:16:57.582162427 -0300 -@@ -591,12 +591,12 @@ class PeriodLattice_ell(PeriodLattice): - - if algorithm=='pari': - if self.E.base_field() is QQ: -- periods = self.E.pari_curve(prec).omega().python() -+ periods = self.E.pari_curve().omega(prec).python() - return (R(periods[0]), C(periods[1])) - - from sage.libs.pari.all import pari -- E_pari = pari([R(self.embedding(ai).real()) for ai in self.E.a_invariants()]).ellinit(precision=prec) -- periods = E_pari.omega().python() -+ E_pari = pari([R(self.embedding(ai).real()) for ai in self.E.a_invariants()]).ellinit() -+ periods = E_pari.omega(prec).python() - return (R(periods[0]), C(periods[1])) - - if algorithm!='sage': -@@ -998,9 +998,9 @@ class PeriodLattice_ell(PeriodLattice): - if prec is None: - prec = RealField().precision() - try: -- return self.E.pari_curve(prec).ellsigma(z, flag) -+ return self.E.pari_curve().ellsigma(z, flag, precision=prec) - except AttributeError: -- raise NotImplementedError("sigma function not yet implemented for period lattices of curves not defined over Q.") -+ raise NotImplementedError("sigma function not yet implemented for period lattices of curves not defined over Q") - - def curve(self): - r""" -diff -up src/sage/schemes/plane_conics/con_number_field.py.orig src/sage/schemes/plane_conics/con_number_field.py ---- src/sage/schemes/plane_conics/con_number_field.py.orig 2014-08-13 11:16:54.440162307 -0300 -+++ src/sage/schemes/plane_conics/con_number_field.py 2014-08-13 11:16:57.582162427 -0300 -@@ -124,7 +124,7 @@ class ProjectiveConic_number_field(Proje - sage: C.has_rational_point(algorithm = 'local', read_cache = False) - True - -- Examples over number fields :: -+ Examples over number fields:: - - sage: K. = QuadraticField(-1) - sage: C = Conic(K, [1, 3, -5]) -diff -up src/sage/symbolic/constants.py.orig src/sage/symbolic/constants.py ---- src/sage/symbolic/constants.py.orig 2014-08-13 11:16:54.442162307 -0300 -+++ src/sage/symbolic/constants.py 2014-08-13 11:16:57.583162427 -0300 -@@ -851,7 +851,7 @@ class Log2(Constant): - 0.6931471805599453 - sage: gp(log2) - 0.6931471805599453094172321215 # 32-bit -- 0.69314718055994530941723212145817656808 # 64-bit -+ 0.69314718055994530941723212145817656807 # 64-bit - sage: RealField(150)(2).log() - 0.69314718055994530941723212145817656807550013 - """ -diff -up src/sage/symbolic/integration/integral.py.orig src/sage/symbolic/integration/integral.py ---- src/sage/symbolic/integration/integral.py.orig 2014-08-13 11:16:54.444162307 -0300 -+++ src/sage/symbolic/integration/integral.py 2014-08-13 11:16:57.583162427 -0300 -@@ -678,7 +678,7 @@ def integrate(expression, v=None, a=None - Check that :trac:`11737` is fixed:: - - sage: N(integrate(sin(x^2)/(x^2), x, 1, infinity)) -- 0.285736646322858 -+ 0.285736646322853 - - Check that :trac:`14209` is fixed:: - -diff -up src/sage/tests/parigp.py.orig src/sage/tests/parigp.py ---- src/sage/tests/parigp.py.orig 2014-08-13 11:16:54.446162307 -0300 -+++ src/sage/tests/parigp.py 2014-08-13 11:16:57.583162427 -0300 -@@ -6,7 +6,7 @@ Check that :trac:`9876` has been fixed, - self-test "rnfkummer":: - - sage: pari('setrand(1); lift(rnfkummer(bnrinit(bnfinit(y^4-52*y^2+26,1),3,1),Mat(5)))') # long time (4s on sage.math, 2011) -- x^5 + (-12490585381661544359255403301035053110061910*y^3 + 8875378520404561472503422910872004290197460*y^2 + 643203912732761873050292808675549433737179610*y - 457038484130159980782436350930533714409061170)*x^3 + (-134027514281645340620300162483056350640850689292892267066826165512*y^3 + 95235243030030469814112992330493778292557062830362488860799262053*y^2 + 6901759924725033375901003506523314713919218011682438894990413482822*y - 4904148131739972327284545793455166015180538153351582525198684659988)*x^2 + (-47397957557570888155708856849994683849365520972511563824369572802678417823703951003630*y^3 + 33679323468496441220407209890566679520252152888549909181980050360738580514765560899830*y^2 + 2440762448949326006691055037485233408803108189791110990339027554592708168372793653934980*y - 1734320048033240933678067521047553381449799255523887315704756124974424249211251806055445)*x + (88847913213212543643724914281374137431466584547137800780754135469698376356168903046151157223082894732483818/5*y^3 - 63132205749445286461822170095386361952302057584137825393349862937480952856334509099209369622841067534904427/5*y^2 - 4575231959624371057665356018310756876851369587901000773265750996233180145132238920504044583057371848969400608/5*y + 3250999094748458040342075570309205473235256099747294466325048378505864671503910959921397017511503388596960342/5) -+ x^5 + (677308732982301944730030845266716201702837696162187325328/5*y^3 + 481271319660811460139352501916644558975058261230836596652/5*y^2 - 34878079733048511269299413306183851642254427026365686673888/5*y - 24783137893632185532697291886880720222932490781434136563942/5)*x^3 + (3121825424585613564828729670704559492032765858876683224121119983801219547643890505070*y^3 + 2218259473949490736667831079912338956828105689590705243343986337391928943383709808005*y^2 - 160758704836112475349193472119432636971334139776148581364333958289434482806877560648970*y - 114229487928172801039731551289054638597376141715926648946031483976252167029243247022480)*x^2 + (-166692999053535356002572927874917139211874871730209960830468398970597547702137238176414705764356470658863661934844/5*y^3 - 118446188915971905087412803032726595730394344242831753676734791550346393669679117451359918013807557809143042588696/5*y^2 + 8583872250159852857479162156889677342550132950704205078118190632176525884150800135006242479797595396229858998666474/5*y + 6099398054781102460046012340322433264871600802691098946100231203424708988718659688581036467351459717869466864403491/5)*x + (-3761942859516698460017771578887550299728643548425212623644925442305118051299870709569967640457662697840860989973276516003636843449764721490044/5*y^3 - 2673104432455463952284352656647109245231103663592899118247897745294025980581570350460813923435311458682114748384710825808171997155877533243621/5*y^2 + 193721614595917576607166927238849546114076202473503220710707213556396586084964322202670927424345172110316287310450443586757567876756951302594424/5*y + 137651773558650909762864388498297831958827163349141150095186154867116600261791580542516653158613689676015829782898702530873665348851222173825666/5) - - Check that :trac:`10195` (PARI bug 1153) has been fixed:: - -@@ -48,7 +48,7 @@ Check that the optional PARI databases w - [x^212 + (-y^7 + 5207*y^6 - 10241606*y^5 + 9430560101*y^4 - 4074860204015*y^3 + 718868274900397*y^2 - 34897101275826114*y + 104096378056356968)*x^211... - - The following requires the modular polynomials up to degree 223, while --only those up to degree 199 come standard in Sage: -+only those up to degree 199 come standard in Sage:: - - sage: p = next_prime(2^328) - sage: E = EllipticCurve(GF(p), [6,1]) -@@ -56,7 +56,7 @@ only those up to degree 199 come standar - 546812681195752981093125556779405341338292357723293496548601032930284335897180749997402596957976244 - - Create a number field with Galois group `A4`. Group `A4` corresponds to --transitive group `(12,3)` in GAP. -+transitive group `(12,3)` in GAP:: - - sage: R. = PolynomialRing(ZZ) - sage: pol = pari("galoisgetpol(12,3)[1]") # optional -- database_pari diff --git a/sagemath-png.patch b/sagemath-png.patch index d7cc39a..2288e21 100644 --- a/sagemath-png.patch +++ b/sagemath-png.patch @@ -1,7 +1,7 @@ diff -up src/module_list.py.orig src/module_list.py ---- src/module_list.py.orig 2014-08-12 14:10:45.498956328 -0300 -+++ src/module_list.py 2014-08-12 14:10:53.082956619 -0300 -@@ -1065,7 +1065,7 @@ ext_modules = [ +--- src/module_list.py.orig 2014-11-18 15:23:33.184126598 -0200 ++++ src/module_list.py 2014-11-18 15:23:42.856126725 -0200 +@@ -1081,7 +1081,7 @@ ext_modules = [ Extension('sage.matrix.matrix_mod2_dense', sources = ['sage/matrix/matrix_mod2_dense.pyx'], @@ -10,7 +10,7 @@ diff -up src/module_list.py.orig src/module_list.py extra_compile_args = m4ri_extra_compile_args, depends = [SAGE_INC + "/png.h", SAGE_INC + "/m4ri/m4ri.h"]), -@@ -1360,7 +1360,7 @@ ext_modules = [ +@@ -1379,7 +1379,7 @@ ext_modules = [ Extension('sage.modules.vector_mod2_dense', sources = ['sage/modules/vector_mod2_dense.pyx'], @@ -19,7 +19,7 @@ diff -up src/module_list.py.orig src/module_list.py extra_compile_args = m4ri_extra_compile_args, depends = [SAGE_INC + "/png.h", SAGE_INC + "/m4ri/m4ri.h"]), -@@ -1876,7 +1876,7 @@ ext_modules = [ +@@ -1893,7 +1893,7 @@ ext_modules = [ Extension('sage.rings.polynomial.pbori', sources = ['sage/rings/polynomial/pbori.pyx'], libraries=['polybori-' + polybori_major_version, diff --git a/sagemath-readonly.patch b/sagemath-readonly.patch index aac8360..cf6f0e0 100644 --- a/sagemath-readonly.patch +++ b/sagemath-readonly.patch @@ -1,7 +1,7 @@ diff -up src/sage/all.py.orig src/sage/all.py ---- src/sage/all.py.orig 2014-08-12 14:10:06.778954845 -0300 -+++ src/sage/all.py 2014-08-12 14:10:14.402955137 -0300 -@@ -316,11 +316,11 @@ def _write_started_file(): +--- src/sage/all.py.orig 2014-11-18 15:20:50.327124447 -0200 ++++ src/sage/all.py 2014-11-18 15:20:58.279124552 -0200 +@@ -307,11 +307,11 @@ def _write_started_file(): Check that the file exists when Sage is running:: diff --git a/sagemath-rpmbuild.patch b/sagemath-rpmbuild.patch index 3a602b3..f3992e4 100644 --- a/sagemath-rpmbuild.patch +++ b/sagemath-rpmbuild.patch @@ -1,16 +1,16 @@ diff -up src/module_list.py.orig src/module_list.py ---- src/module_list.py.orig 2014-08-13 11:34:14.739202143 -0300 -+++ src/module_list.py 2014-08-13 11:34:18.828202300 -0300 -@@ -5,7 +5,7 @@ from distutils.core import setup +--- src/module_list.py.orig 2014-11-18 13:25:41.898033239 -0200 ++++ src/module_list.py 2014-11-18 13:27:10.616034410 -0200 +@@ -4,7 +4,7 @@ import os from distutils.extension import Extension - from sage.env import * + from sage.env import SAGE_LOCAL -SAGE_INC = os.path.join(SAGE_LOCAL, 'include') +SAGE_INC = '/usr/include' ######################################################### ### BLAS setup -@@ -36,10 +36,11 @@ else: +@@ -35,10 +35,11 @@ else: ### Commonly used definitions ######################################################### @@ -24,7 +24,7 @@ diff -up src/module_list.py.orig src/module_list.py flint_depends = [SAGE_INC + '/flint/flint.h'] singular_depends = [SAGE_INC + '/libsingular.h'] -@@ -70,7 +71,7 @@ givaro_extra_compile_args =['-D__STDC_LI +@@ -71,7 +72,7 @@ givaro_extra_compile_args =['-D__STDC_LI ### PolyBoRi settings ######################################################### @@ -33,7 +33,7 @@ diff -up src/module_list.py.orig src/module_list.py polybori_major_version = '0.8' -@@ -710,7 +711,7 @@ ext_modules = [ +@@ -730,7 +731,7 @@ ext_modules = [ sources = ['sage/libs/lcalc/lcalc_Lfunction.pyx'], libraries = ['m', 'ntl', 'mpfr', 'gmp', 'gmpxx', 'Lfunction'], @@ -43,13 +43,13 @@ diff -up src/module_list.py.orig src/module_list.py language = 'c++'), diff -up src/setup.py.orig src/setup.py ---- src/setup.py.orig 2014-08-13 11:34:14.742202143 -0300 -+++ src/setup.py 2014-08-13 11:34:55.082203688 -0300 +--- src/setup.py.orig 2014-11-18 13:25:47.434033312 -0200 ++++ src/setup.py 2014-11-18 13:28:52.152035751 -0200 @@ -36,11 +36,11 @@ except KeyError: compile_result_dir = None keep_going = False --SAGE_INC = os.path.join(SAGE_LOCAL,'include') +-SAGE_INC = os.path.join(SAGE_LOCAL, 'include') +SAGE_INC = '/usr/include' # search for dependencies and add to gcc -I @@ -70,10 +70,10 @@ diff -up src/setup.py.orig src/setup.py m.extra_link_args = m.extra_link_args + extra_link_args - m.library_dirs = m.library_dirs + [os.path.join(SAGE_LOCAL, "lib")] + m.library_dirs += ['c_lib', '%s/lib' % SAGE_LOCAL] + m.include_dirs = m.include_dirs + include_dirs - ############################################# -@@ -556,20 +558,6 @@ print "Discovered Python source, time: % +@@ -579,20 +581,6 @@ print "Discovered Python source, time: % ######################################################### diff --git a/sagemath-sagedoc.patch b/sagemath-sagedoc.patch index db6ec03..ed775af 100644 --- a/sagemath-sagedoc.patch +++ b/sagemath-sagedoc.patch @@ -1,18 +1,18 @@ diff -up src/doc/common/builder.py.orig src/doc/common/builder.py ---- src/doc/common/builder.py.orig 2014-08-12 14:06:23.374946290 -0300 -+++ src/doc/common/builder.py 2014-08-12 14:06:47.943947231 -0300 +--- src/doc/common/builder.py.orig 2014-11-18 13:30:43.238037217 -0200 ++++ src/doc/common/builder.py 2014-11-18 13:32:05.097038298 -0200 @@ -32,7 +32,7 @@ from sage.env import SAGE_DOC, SAGE_SRC # SAGE_DOC, LANGUAGES, SPHINXOPTS, PAPER, OMIT, # PAPEROPTS, ALLSPHINXOPTS, NUM_THREADS, WEBSITESPHINXOPTS # from build_options.py. --execfile(os.path.join(SAGE_DOC, 'common' , 'build_options.py')) -+execfile(os.path.join(os.getenv('SAGE_ROOT'), 'src', 'doc', 'common' , 'build_options.py')) +-fpath = os.path.join(SAGE_DOC, 'common', 'build_options.py') ++fpath = os.path.join(os.getenv('SAGE_ROOT'), 'src', 'doc', 'common', 'build_options.py') + exec(compile(open(fpath).read(), fpath, 'exec')) - def delete_empty_directories(root_dir, verbose=True): diff -up src/doc/common/conf.py.orig src/doc/common/conf.py ---- src/doc/common/conf.py.orig 2014-08-12 14:06:23.376946291 -0300 -+++ src/doc/common/conf.py 2014-08-12 14:07:26.095948692 -0300 +--- src/doc/common/conf.py.orig 2014-11-18 13:30:43.248037218 -0200 ++++ src/doc/common/conf.py 2014-11-18 13:32:40.336038763 -0200 @@ -1,5 +1,5 @@ import sys, os, sphinx -from sage.env import SAGE_DOC @@ -31,8 +31,8 @@ diff -up src/doc/common/conf.py.orig src/doc/common/conf.py # It would be really nice if sphinx would copy the entire mathjax directory, diff -up src/sage/doctest/control.py.orig src/sage/doctest/control.py ---- src/sage/doctest/control.py.orig 2014-08-12 14:06:23.382946291 -0300 -+++ src/sage/doctest/control.py 2014-08-12 14:08:08.384950312 -0300 +--- src/sage/doctest/control.py.orig 2014-11-18 13:30:43.259037218 -0200 ++++ src/sage/doctest/control.py 2014-11-18 13:33:27.185039382 -0200 @@ -89,7 +89,6 @@ class DocTestDefaults(SageObject): self.valgrind = False self.massif = False @@ -50,7 +50,7 @@ diff -up src/sage/doctest/control.py.orig src/sage/doctest/control.py # Non-interactive debuggers: 48 hours options.timeout = int(os.getenv('SAGE_TIMEOUT_VALGRIND', 48 * 60 * 60)) elif options.long: -@@ -822,13 +821,8 @@ class DocTestController(SageObject): +@@ -889,13 +888,8 @@ class DocTestController(SageObject): elif opt.cachegrind: toolname = "cachegrind" flags = os.getenv("SAGE_CACHEGRIND_FLAGS", "") @@ -64,7 +64,7 @@ diff -up src/sage/doctest/control.py.orig src/sage/doctest/control.py if "%s" in flags: flags %= toolname + ".%p" # replace %s with toolname cmd += flags + sage_cmd -@@ -888,10 +882,10 @@ class DocTestController(SageObject): +@@ -955,10 +949,10 @@ class DocTestController(SageObject): 0 """ opt = self.options @@ -78,8 +78,8 @@ diff -up src/sage/doctest/control.py.orig src/sage/doctest/control.py return self.run_val_gdb() else: diff -up src/sage/interfaces/singular.py.orig src/sage/interfaces/singular.py ---- src/sage/interfaces/singular.py.orig 2014-08-12 14:06:23.391946291 -0300 -+++ src/sage/interfaces/singular.py 2014-08-12 14:08:26.055950988 -0300 +--- src/sage/interfaces/singular.py.orig 2014-11-18 13:30:43.265037218 -0200 ++++ src/sage/interfaces/singular.py 2014-11-18 13:33:49.257039673 -0200 @@ -2147,7 +2147,7 @@ def generate_docstring_dictionary(): nodes.clear() node_names.clear() @@ -89,15 +89,3 @@ diff -up src/sage/interfaces/singular.py.orig src/sage/interfaces/singular.py new_node = re.compile("File: singular\.hlp, Node: ([^,]*),.*") new_lookup = re.compile("\* ([^:]*):*([^.]*)\..*") -diff -up src/sage/misc/latex_macros.py.orig src/sage/misc/latex_macros.py ---- src/sage/misc/latex_macros.py.orig 2014-08-12 14:06:23.402946292 -0300 -+++ src/sage/misc/latex_macros.py 2014-08-12 14:08:46.103951756 -0300 -@@ -142,7 +142,7 @@ def convert_latex_macro_to_mathjax(macro - return name + ': ["' + defn + '",' + str(num_args) + ']' - - from superseded import deprecated_function_alias --convert_latex_macro_to_jsmath = deprecated_function_alias(13508, convert_latex_macro_to_mathjax) -+convert_latex_macro_to_jsmath = convert_latex_macro_to_mathjax - - # To add a new macro for use in the Sage documentation, add a list or - # tuple to the following list. Each list (or tuple) should have the diff --git a/sagemath-sagenb.patch b/sagemath-sagenb.patch index 7785686..57d289b 100644 --- a/sagemath-sagenb.patch +++ b/sagemath-sagenb.patch @@ -1,6 +1,6 @@ -diff -up build/pkgs/sagenb/src/sagenb-0.10.8.2/flask_version/base.py.orig build/pkgs/sagenb/src/sagenb-0.10.8.2/flask_version/base.py ---- build/pkgs/sagenb/src/sagenb-0.10.8.2/flask_version/base.py.orig 2014-02-11 18:13:34.453086409 -0200 -+++ build/pkgs/sagenb/src/sagenb-0.10.8.2/flask_version/base.py 2014-02-11 18:14:30.976088573 -0200 +diff -up build/pkgs/sagenb/src/sagenb-0.11.1/sagenb/flask_version/base.py.orig build/pkgs/sagenb/src/sagenb-0.11.1/sagenb/flask_version/base.py +--- build/pkgs/sagenb/src/sagenb-0.11.1/sagenb/flask_version/base.py.orig 2014-12-06 17:45:36.063723826 -0200 ++++ build/pkgs/sagenb/src/sagenb-0.11.1/sagenb/flask_version/base.py 2014-12-06 17:49:09.074731983 -0200 @@ -4,8 +4,6 @@ from functools import partial from flask import Flask, Module, url_for, render_template, request, session, redirect, g, make_response, current_app from decorators import login_required, guest_or_login_required, with_lock @@ -18,84 +18,55 @@ diff -up build/pkgs/sagenb/src/sagenb-0.10.8.2/flask_version/base.py.orig build/ self.config['SESSION_COOKIE_HTTPONLY'] = False -@@ -36,7 +33,7 @@ class SageNBFlask(Flask): +@@ -36,12 +33,12 @@ class SageNBFlask(Flask): self.add_static_path('/javascript', DATA) self.add_static_path('/static', DATA) self.add_static_path('/java', DATA) - self.add_static_path('/java/jmol', os.path.join(os.environ["SAGE_ROOT"],"local","share","jmol")) -+ self.add_static_path('/java/jmol', os.path.join(DATA, "jmol")) +- self.add_static_path('/jsmol', os.path.join(os.environ["SAGE_ROOT"],"local","share","jsmol")) +- self.add_static_path('/jsmol/js', os.path.join(os.environ["SAGE_ROOT"],"local","share","jsmol","js")) +- self.add_static_path('/j2s', os.path.join(os.environ["SAGE_ROOT"],"local","share","jsmol","j2s")) +- self.add_static_path('/jsmol/j2s', os.path.join(os.environ["SAGE_ROOT"],"local","share","jsmol","j2s")) +- self.add_static_path('/j2s/core', os.path.join(os.environ["SAGE_ROOT"],"local","share","jsmol","j2s","core")) ++ self.add_static_path('/java/jmol', os.path.join(os.environ["SAGE_ROOT"],"share","jmol")) ++ self.add_static_path('/jsmol', os.path.join(os.environ["SAGE_ROOT"],"share","jsmol")) ++ self.add_static_path('/jsmol/js', os.path.join(os.environ["SAGE_ROOT"],"share","jsmol","js")) ++ self.add_static_path('/j2s', os.path.join(os.environ["SAGE_ROOT"],"jsmol","j2s")) ++ self.add_static_path('/jsmol/j2s', os.path.join(os.environ["SAGE_ROOT"],"share","jsmol","j2s")) ++ self.add_static_path('/j2s/core', os.path.join(os.environ["SAGE_ROOT"],"share","jsmol","j2s","core")) import mimetypes mimetypes.add_type('text/plain','.jmol') -diff -up build/pkgs/sagenb/src/sagenb-0.10.8.2/sagenb/data/sage/html/notebook/base.html.orig build/pkgs/sagenb/src/sagenb-0.10.8.2/sagenb/data/sage/html/notebook/base.html ---- build/pkgs/sagenb/src/sagenb-0.10.8.2/sagenb/data/sage/html/notebook/base.html.orig 2014-02-11 18:13:34.468086409 -0200 -+++ build/pkgs/sagenb/src/sagenb-0.10.8.2/sagenb/data/sage/html/notebook/base.html 2014-02-11 18:13:51.591087065 -0200 -@@ -46,7 +46,7 @@ INPUT: - - - -- -+ +diff -up build/pkgs/sagenb/src/sagenb-0.11.1/sagenb/misc/misc.py.orig build/pkgs/sagenb/src/sagenb-0.11.1/sagenb/misc/misc.py +--- build/pkgs/sagenb/src/sagenb-0.11.1/sagenb/misc/misc.py.orig 2014-12-06 17:45:36.066723826 -0200 ++++ build/pkgs/sagenb/src/sagenb-0.11.1/sagenb/misc/misc.py 2014-12-06 17:45:38.853723933 -0200 +@@ -174,7 +174,8 @@ def pad_zeros(s, size=3): - {% if JEDITABLE_TINYMCE and not worksheet.docbrowser() and not worksheet.is_published() %} - -diff -up build/pkgs/sagenb/src/sagenb-0.10.8.2/sagenb/data/sage/js/jmol_lib.js.orig build/pkgs/sagenb/src/sagenb-0.10.8.2/sagenb/data/sage/js/jmol_lib.js ---- build/pkgs/sagenb/src/sagenb-0.10.8.2/sagenb/data/sage/js/jmol_lib.js.orig 2014-02-11 18:13:34.422086407 -0200 -+++ build/pkgs/sagenb/src/sagenb-0.10.8.2/sagenb/data/sage/js/jmol_lib.js 2014-02-11 18:13:51.576087064 -0200 -@@ -256,9 +256,6 @@ function makeCntrlPanels(url, n, functio - panelHTML +=' arbitrarily resizable.
'; - //static image to save - panelHTML +=' Right-click or Cmd-click on image to get download options.
'; -- //save file to local disk -- panelHTML += ' will require loading signed applet if not already done.'; -- panelHTML +='
'; - //spin on - panelHTML +='Spin on'; - //antialaisdisplay (smoothing of objects) -diff -up build/pkgs/sagenb/src/sagenb-0.10.8.2/sagenb/flask_version/base.py.orig build/pkgs/sagenb/src/sagenb-0.10.8.2/sagenb/flask_version/base.py ---- build/pkgs/sagenb/src/sagenb-0.10.8.2/sagenb/flask_version/base.py.orig 2014-02-11 18:13:34.459086409 -0200 -+++ build/pkgs/sagenb/src/sagenb-0.10.8.2/sagenb/flask_version/base.py 2014-02-11 18:13:51.590087065 -0200 -@@ -4,8 +4,6 @@ from functools import partial - from flask import Flask, Module, url_for, render_template, request, session, redirect, g, make_response, current_app - from decorators import login_required, guest_or_login_required, with_lock - from decorators import global_lock --# Make flask use the old session foo from <=flask-0.9 --from flask_oldsessions import OldSecureCookieSessionInterface + SAGENB_ROOT = os.path.split(resource_filename(__name__, ''))[0] - from flask.ext.autoindex import AutoIndex - try: -@@ -25,7 +23,6 @@ class SageNBFlask(Flask): - def __init__(self, *args, **kwds): - self.startup_token = kwds.pop('startup_token', None) - Flask.__init__(self, *args, **kwds) -- self.session_interface = OldSecureCookieSessionInterface() +-DATA = os.path.join(SAGENB_ROOT, 'data') ++from sage.misc.misc import SAGE_SRC ++DATA = os.path.join(SAGE_SRC, 'sagenb', 'data') - self.config['SESSION_COOKIE_HTTPONLY'] = False - -@@ -36,7 +33,7 @@ class SageNBFlask(Flask): - self.add_static_path('/javascript', DATA) - self.add_static_path('/static', DATA) - self.add_static_path('/java', DATA) -- self.add_static_path('/java/jmol', os.path.join(os.environ["SAGE_ROOT"],"local","share","jmol")) -+ self.add_static_path('/java/jmol', os.path.join(DATA, "jmol")) - import mimetypes - mimetypes.add_type('text/plain','.jmol') - -diff -up build/pkgs/sagenb/src/sagenb-0.10.8.2/sagenb/notebook/cell.py.orig build/pkgs/sagenb/src/sagenb-0.10.8.2/sagenb/notebook/cell.py ---- build/pkgs/sagenb/src/sagenb-0.10.8.2/sagenb/notebook/cell.py.orig 2014-02-11 18:13:34.441086408 -0200 -+++ build/pkgs/sagenb/src/sagenb-0.10.8.2/sagenb/notebook/cell.py 2014-02-11 18:13:51.583087065 -0200 -@@ -2369,7 +2369,7 @@ class Cell(Cell_generic): - jmol_script = jmol_file.read() - jmol_file.close() - -- jmol_script = jmol_script.replace('defaultdirectory "', 'defaultdirectory "' + self.url_to_self() + '/') -+ jmol_script = jmol_script.replace('defaultdirectory "', 'defaultdirectory "/home/' + self.worksheet_filename() + '/') - - jmol_file = open(jmol_name, 'w') - jmol_file.write(jmol_script) -diff -up build/pkgs/sagenb/src/sagenb-0.10.8.2/sagenb/notebook/run_notebook.py.orig build/pkgs/sagenb/src/sagenb-0.10.8.2/sagenb/notebook/run_notebook.py ---- build/pkgs/sagenb/src/sagenb-0.10.8.2/sagenb/notebook/run_notebook.py.orig 2014-02-11 18:13:34.447086408 -0200 -+++ build/pkgs/sagenb/src/sagenb-0.10.8.2/sagenb/notebook/run_notebook.py 2014-02-11 18:13:51.586087065 -0200 + if os.environ.has_key('DOT_SAGENB'): + DOT_SAGENB = os.environ['DOT_SAGENB'] +diff -up build/pkgs/sagenb/src/sagenb-0.11.1/sagenb/notebook/cell.py.orig build/pkgs/sagenb/src/sagenb-0.11.1/sagenb/notebook/cell.py +--- build/pkgs/sagenb/src/sagenb-0.11.1/sagenb/notebook/cell.py.orig 2014-12-06 17:45:36.067723826 -0200 ++++ build/pkgs/sagenb/src/sagenb-0.11.1/sagenb/notebook/cell.py 2014-12-06 17:45:38.854723933 -0200 +@@ -2338,8 +2338,8 @@ class Cell(Cell_generic): + with open(jmol_name, 'r') as f: + jmol_script = f.read() + jmol_script = jmol_script.replace( +- 'defaultdirectory "', +- 'defaultdirectory "{0}/'.format(self.url_to_worksheet())) ++ 'defaultdirectory "', ++ 'defaultdirectory "/home/' + self.worksheet_filename() + '/') + with open(jmol_name, 'w') as f: + f.write(jmol_script) + +diff -up build/pkgs/sagenb/src/sagenb-0.11.1/sagenb/notebook/run_notebook.py.orig build/pkgs/sagenb/src/sagenb-0.11.1/sagenb/notebook/run_notebook.py +--- build/pkgs/sagenb/src/sagenb-0.11.1/sagenb/notebook/run_notebook.py.orig 2014-12-06 17:45:36.069723826 -0200 ++++ build/pkgs/sagenb/src/sagenb-0.11.1/sagenb/notebook/run_notebook.py 2014-12-06 17:45:38.854723933 -0200 @@ -46,12 +46,14 @@ sagenb.notebook.misc.DIR = %(cwd)r #We s # Flask # ######### @@ -113,15 +84,3 @@ diff -up build/pkgs/sagenb/src/sagenb-0.10.8.2/sagenb/notebook/run_notebook.py.o def save_notebook(notebook): print "Quitting all running worksheets..." ---- build/pkgs/sagenb/src/sagenb-0.10.8.2/sagenb/misc/misc.py.orig 2014-02-19 12:22:25.360997774 -0300 -+++ build/pkgs/sagenb/src/sagenb-0.10.8.2/sagenb/misc/misc.py 2014-02-19 12:26:01.260011849 -0300 -@@ -174,7 +174,8 @@ def pad_zeros(s, size=3): - - SAGENB_ROOT = os.path.split(resource_filename(__name__, ''))[0] - --DATA = os.path.join(SAGENB_ROOT, 'data') -+from sage.misc.misc import SAGE_SRC -+DATA = os.path.join(SAGE_SRC, 'sagenb', 'data') - - if os.environ.has_key('DOT_SAGENB'): - DOT_SAGENB = os.environ['DOT_SAGENB'] diff --git a/sagemath-scons.patch b/sagemath-scons.patch index 6e254fa..01558fa 100644 --- a/sagemath-scons.patch +++ b/sagemath-scons.patch @@ -1,6 +1,6 @@ diff -up src/c_lib/SConstruct.orig src/c_lib/SConstruct ---- src/c_lib/SConstruct.orig 2014-05-26 13:24:15.242761223 -0300 -+++ src/c_lib/SConstruct 2014-05-26 13:25:26.593763955 -0300 +--- src/c_lib/SConstruct.orig 2014-11-17 17:41:32.525922611 -0200 ++++ src/c_lib/SConstruct 2014-11-17 17:41:41.486922954 -0200 @@ -126,8 +126,8 @@ env['PYV']=platform.python_version().rsp # The SCons convenience function Split is the only strange thing # to python programmers. It just makes a list by splitting on @@ -14,7 +14,7 @@ diff -up src/c_lib/SConstruct.orig src/c_lib/SConstruct cppFiles = Split( "ZZ_pylong.cpp ntl_wrap.cpp" ) @@ -136,9 +136,22 @@ incFiles = Split( "ccobject.h convert.h Split( "interrupt.h memory.h mpn_pylong.h mpz_longlong.h" ) + \ - Split( "mpz_pylong.h ntl_wrap.h stdsage.h ZZ_pylong.h" ) + Split( "mpz_pylong.h ntl_wrap.h parisage.h stdsage.h ZZ_pylong.h" ) +env.Append(CFLAGS='@@optflags@@') +env.Append(CXXFLAGS='@@optflags@@') diff --git a/sagemath-scripts.patch b/sagemath-scripts.patch index 0f8778f..78d0cb0 100644 --- a/sagemath-scripts.patch +++ b/sagemath-scripts.patch @@ -1,8 +1,8 @@ diff -up src/bin/sage.orig src/bin/sage ---- src/bin/sage.orig 2014-08-12 13:51:14.714911495 -0300 -+++ src/bin/sage 2014-08-12 13:59:39.911930840 -0300 -@@ -13,17 +13,14 @@ usage() { - echo " file. -- run given .sage, .py or .spyx files" +--- src/bin/sage.orig 2014-11-17 17:42:48.321925514 -0200 ++++ src/bin/sage 2014-11-17 17:55:52.524955544 -0200 +@@ -13,11 +13,9 @@ usage() { + echo " file.[sage|py|spyx] -- run given .sage, .py or .spyx file" echo " -advanced -- list all command line options" echo " -c -- Evaluates cmd as sage code" - echo " -experimental -- list all experimental packages that can be installed" @@ -10,16 +10,18 @@ diff -up src/bin/sage.orig src/bin/sage echo " -gp [...] -- run Sage's PARI/GP calculator with given arguments" echo " -h, -? -- print this help message" - echo " -i [packages] -- install the given Sage packages" - echo " -inotebook [...] -- start the *insecure* Sage notebook" + echo " -pip [...] -- invoke pip, the Python package manager" + echo " -inotebook [...] -- start the *insecure* Sage notebook (deprecated)" echo " -maxima [...] -- run Sage's Maxima with given arguments" - echo " -mwrank [...] -- run Sage's mwrank with given arguments" - echo " -n, -notebook [...] -- start the Sage notebook (options are the same" - echo " as for the notebook command in Sage)" +@@ -25,7 +23,6 @@ usage() { + echo " --notebook=[...] -- start the Sage notebook (valid options are" + echo " 'default', 'sagenb', and 'ipython')" + echo " -n, --notebook -- shortcut for --notebook=default" - echo " -optional -- list all optional packages that can be installed" echo " -python [...] -- run the Python interpreter" echo " -R [...] -- run Sage's R with given arguments" echo " -singular [...] -- run Sage's singular with given arguments" -@@ -39,10 +36,6 @@ usage() { +@@ -41,10 +38,6 @@ usage() { echo " --optional - controls which optional tests are run" echo " --sagenb - test all sagenb files" echo " --help - show all testing options" @@ -30,32 +32,31 @@ diff -up src/bin/sage.orig src/bin/sage echo " -v, -version -- print the Sage version" exit 0 } -@@ -61,16 +54,14 @@ usage_advanced() { +@@ -63,8 +56,6 @@ usage_advanced() { echo " -preparse -- preparse file.sage and produce corresponding file.sage.py" echo " -q -- quiet; start with no banner" echo " -root -- print the Sage root directory" - echo " -gthread, -qthread, -q4thread, -wthread, -pylab" - echo " -- pass the option through to ipython" -+ echo " -testall [options] -- test all source files, docs, and examples. options" -+ echo " like -t" echo " -v, -version -- print the Sage version" echo - #### 1.......................26..................................................78 - #### |.....................--.|...................................................| - echo "Running the notebook:" +@@ -75,8 +66,6 @@ usage_advanced() { + echo " 'default', 'sagenb', and 'ipython'). See the output" + echo " of sage --notebook --help for more details and" + echo " examples of how to pass optional arguments" - echo " -bn, -build-and-notebook [...] -- build the Sage library then start" - echo " the Sage notebook" - echo " -inotebook [...] -- start the *insecure* Sage notebook" - echo " -n, -notebook [...] -- start the Sage notebook (options are the same" - echo " as for the notebook command in Sage)" -@@ -87,13 +78,8 @@ usage_advanced() { + echo " -inotebook [...] -- start the *insecure* Sage notebook (deprecated)" + echo " -n, -notebook [...] -- start the default Sage notebook (options are the" + echo " same as for the notebook command in Sage). See the" +@@ -94,13 +83,9 @@ usage_advanced() { echo " -gp [...] -- run Sage's PARI/GP calculator with given arguments" echo " -ipython [...] -- run Sage's IPython using the default environment (not" echo " Sage), passing additional options to IPython" - echo " -kash [...] -- run Sage's Kash with given arguments" - command -v kash &>/dev/null || \ -- echo " (not installed currently, run sage -i kash)" + echo " (not installed currently, run sage -i kash)" echo " -lisp [...] -- run Lisp interpreter included with Sage" echo " -M2 [...] -- run Sage's Macaulay2 with given arguments" - command -v M2 &>/dev/null || \ @@ -63,7 +64,7 @@ diff -up src/bin/sage.orig src/bin/sage echo " -maxima [...] -- run Sage's Maxima with given arguments" echo " -mwrank [...] -- run Sage's mwrank with given arguments" echo " -python [...] -- run the Python interpreter" -@@ -107,75 +93,10 @@ usage_advanced() { +@@ -114,74 +99,10 @@ usage_advanced() { echo #### 1.......................26..................................................78 #### |.....................--.|...................................................| @@ -82,6 +83,7 @@ diff -up src/bin/sage.orig src/bin/sage - echo " -info [packages] -- print the SPKG.txt of the given packages" - echo " -optional -- list all optional packages that can be installed" - echo " -standard -- list all standard packages that can be installed" +- echo " -installed -- list all installed packages" - #echo " -update -- download latest non-optional Sage packages (do not build them)" - #echo " -update-build -- build and install all downloaded non-optional Sage packages" - echo " -upgrade [version] -- download, build and install the given version. Here," @@ -93,20 +95,17 @@ diff -up src/bin/sage.orig src/bin/sage - #### 1.......................26..................................................78 - #### |.....................--.|...................................................| - echo "Building and testing the Sage library:" -- echo " -b [branch] -- build Sage library. If branch is given, switch to" -- echo " branch in devel/sage-branch and build that branch" -- echo " -ba [branch] -- same as -b and rebuild all Cython code" -- echo " -ba-force [branch] -- same as -ba, but don't query before rebuilding" -- echo " -br [branch] -- switch to, build, and run Sage given branch" +- echo " -b -- build Sage library." +- echo " -ba -- same as -b and rebuild all Cython code" +- echo " -ba-force -- same as -ba, but don't query before rebuilding" +- echo " -br -- build and run Sage" - echo " -bt [...] -- build and test, options like -t below" - echo " -btp [...] -- build and test parallel, options like -tp below" - echo " -btnew [...] -- build and test modified files, options like -tnew" - echo " -fixdoctests [output_file] [--long]" -- echo " -- writes a new version of file.py to output_file" -- echo " (defaults: to file.py.out) that will pass the doctests." -- echo " With the optional --long argument the long time tests" -- echo " are also checked." -- echo " A patch for the new file is printed to stdout." +- echo " -- replace failing doctests with the actual output. With" +- echo " optional output_file: redirect there. With the --long" +- echo " option: include #long time tests." - echo " -startuptime [module] -- display how long each component of Sage takes to" - echo " start up; optionally specify a module to get more" - echo " details about that particular module" @@ -123,6 +122,7 @@ diff -up src/bin/sage.orig src/bin/sage - echo " --failed - only test files that failed last test" - echo " --sagenb - test all sagenb files" - echo " --help - show all testing options" +- echo " --warn-long [timeout] - warning if doctest is slow" - echo " -tp [...] -- like -t above, but tests in parallel using N threads" - echo " with 0 interpreted as a sensible default" - echo " -testall [options] -- test all source files, docs, and examples. options" @@ -139,7 +139,7 @@ diff -up src/bin/sage.orig src/bin/sage echo " -search_src -- search through all the Sage library code for string" echo " -search_doc -- search through the Sage documentation for string" echo " -grep -- same as -search_src" -@@ -195,16 +116,6 @@ usage_advanced() { +@@ -201,16 +122,6 @@ usage_advanced() { echo #### 1.......................26..................................................78 #### |.....................--.|...................................................| @@ -156,7 +156,7 @@ diff -up src/bin/sage.orig src/bin/sage echo "Valgrind memory debugging:" echo " -cachegrind -- run Sage using Valgrind's cachegrind tool. The log" echo " files are named sage-cachegrind.PID can be found in" -@@ -218,9 +129,6 @@ usage_advanced() { +@@ -224,9 +135,6 @@ usage_advanced() { echo " -memcheck -- run Sage using Valgrind's memcheck tool. The log" echo " files are named sage-memcheck.PID can be found in" echo " $DOT_SAGE" @@ -166,7 +166,7 @@ diff -up src/bin/sage.orig src/bin/sage echo " -valgrind -- this is an alias for -memcheck" echo echo "You can also use -- before a long option, e.g., 'sage --optional'." -@@ -240,34 +148,6 @@ if [ "$1" = '--nodotsage' ]; then +@@ -246,65 +154,14 @@ if [ "$1" = '--nodotsage' ]; then exit $status fi @@ -198,14 +198,16 @@ diff -up src/bin/sage.orig src/bin/sage -fi - - - if [ $# -gt 0 ]; then - if [ "$1" = '-h' -o "$1" = '-?' -o "$1" = '-help' -o "$1" = '--help' ]; then - usage -@@ -277,28 +157,13 @@ if [ $# -gt 0 ]; then - fi - fi - +-if [ $# -gt 0 ]; then +- if [ "$1" = '-h' -o "$1" = '-?' -o "$1" = '-help' -o "$1" = '--help' ]; then +- usage +- fi +- if [ "$1" = "-advanced" -o "$1" = "--advanced" ]; then +- usage_advanced +- fi +-fi - + # Prepare for running Sage, either interactively or non-interactively. sage_setup() { - # Check that we're not in a source tarball which hasn't been built yet (#13561). @@ -230,11 +232,10 @@ diff -up src/bin/sage.orig src/bin/sage if [ ! -d "$IPYTHONDIR" ]; then # make sure that $DOT_SAGE exists so that ipython will happily # create its config directories there. If DOT_SAGE doesn't -@@ -308,21 +173,6 @@ sage_setup() { - sage-cleaner &>/dev/null & +@@ -315,20 +172,6 @@ sage_setup() { } -- + -# Check to see if the whole Sage install tree has moved. If so, -# change various hardcoded paths. Skip this if we don't have write -# access to $SAGE_LOCAL (e.g. when running as a different user) or @@ -252,7 +253,7 @@ diff -up src/bin/sage.orig src/bin/sage # Start an interactive Sage session, this function never returns. interactive_sage() { sage_setup -@@ -384,7 +234,7 @@ fi +@@ -390,7 +233,7 @@ fi if [ "$1" = '-singular' -o "$1" = '--singular' ]; then shift @@ -261,15 +262,10 @@ diff -up src/bin/sage.orig src/bin/sage fi if [ "$1" = '-sqlite3' -o "$1" = '--sqlite3' ]; then -@@ -412,16 +262,6 @@ if [ "$1" = '-lisp' -o "$1" = '--lisp' ] - exec ecl "$@" +@@ -423,11 +266,6 @@ if [ "$1" = '-kash' -o "$1" = '--kash' ] + exec kash "$@" fi --if [ "$1" = '-kash' -o "$1" = '--kash' ]; then -- shift -- exec kash "$@" --fi -- -if [ "$1" = '-fixdoctests' -o "$1" = '--fixdoctests' ]; then - shift - exec sage-fixdoctests "$@" @@ -278,7 +274,23 @@ diff -up src/bin/sage.orig src/bin/sage if [ "$1" = '-maxima' -o "$1" = '--maxima' ]; then shift exec maxima "$@" -@@ -581,20 +421,6 @@ EOF +@@ -448,15 +286,6 @@ if [ "$1" = '-scons' -o "$1" = '--scons' + exec scons "$@" + fi + +-if [ "$1" = '-pip' -o "$1" = '--pip' ]; then +- if [ ! -x "$SAGE_LOCAL/bin/pip" ]; then +- echo "Pip is not installed. Run \"sage -i pip\" to install it." +- exit 1 +- fi +- shift +- exec pip "$@" +-fi +- + if [ "$1" = '-python' -o "$1" = '--python' ]; then + shift + exec python "$@" +@@ -596,20 +425,6 @@ EOF fi ##################################################################### @@ -299,7 +311,7 @@ diff -up src/bin/sage.orig src/bin/sage # File conversion ##################################################################### -@@ -609,36 +435,15 @@ if [ "$1" = '-rst2sws' -o "$1" = '--rst2 +@@ -624,23 +439,9 @@ if [ "$1" = '-rst2sws' -o "$1" = '--rst2 fi ##################################################################### @@ -320,23 +332,24 @@ diff -up src/bin/sage.orig src/bin/sage - sage-build "$@" || exit $? -} - - if [ "$1" = "-notebook" -o "$1" = '--notebook' -o "$1" = '-n' ]; then - shift + if [[ "$1" =~ "--notebook="* || "$1" =~ "-n="* || "$1" =~ "-notebook="* ]]; then sage-cleaner &>/dev/null & exec sage-notebook "$@" +@@ -652,13 +453,6 @@ if [ "$1" = "-notebook" -o "$1" = '--not + exec sage-notebook --notebook=default "$@" fi -if [ "$1" = "-bn" -o "$1" = "--build-and-notebook" ]; then - shift - build_sage - sage-cleaner &>/dev/null & -- exec sage-notebook "$@" +- exec sage-notebook --notebook=default "$@" -fi - if [ "$1" = "-inotebook" -o "$1" = '--inotebook' ]; then shift sage-cleaner &>/dev/null & -@@ -657,40 +462,19 @@ if [ "$1" = '-grepdoc' -o "$1" = "--grep +@@ -677,40 +471,19 @@ if [ "$1" = '-grepdoc' -o "$1" = "--grep exit 0 fi @@ -379,7 +392,7 @@ diff -up src/bin/sage.orig src/bin/sage shift exec sage-runtests -p "$@" else -@@ -699,10 +483,7 @@ if [ "$1" = '-t' -o "$1" = '-bt' -o "$1" +@@ -719,10 +492,7 @@ if [ "$1" = '-t' -o "$1" = '-bt' -o "$1" fi fi @@ -391,7 +404,7 @@ diff -up src/bin/sage.orig src/bin/sage shift SAGE_BANNER="no" sage_setup -@@ -724,132 +505,6 @@ if [ "$1" = '-c' ]; then +@@ -744,136 +514,6 @@ if [ "$1" = '-c' ]; then exec sage-eval "$@" fi @@ -445,15 +458,19 @@ diff -up src/bin/sage.orig src/bin/sage -} - -if [ "$1" = '-optional' -o "$1" = "--optional" ]; then -- exec sage-list-optional +- exec sage-list-packages optional -fi - -if [ "$1" = '-experimental' -o "$1" = "--experimental" ]; then -- exec sage-list-experimental +- exec sage-list-packages experimental -fi - -if [ "$1" = '-standard' -o "$1" = "--standard" ]; then -- exec sage-list-standard +- exec sage-list-packages standard +-fi +- +-if [ "$1" = '-installed' -o "$1" = "--installed" ]; then +- exec sage-list-packages installed -fi - -if [ "$1" = '-i' ]; then @@ -524,7 +541,7 @@ diff -up src/bin/sage.orig src/bin/sage if [ "$1" = '-gdb' -o "$1" = "--gdb" ]; then shift sage_setup -@@ -898,21 +553,10 @@ if [ "$1" = '-callgrind' -o "$1" = "--ca +@@ -922,26 +562,10 @@ if [ "$1" = '-callgrind' -o "$1" = "--ca exec sage-callgrind "$@" fi @@ -543,12 +560,17 @@ diff -up src/bin/sage.orig src/bin/sage - interactive_sage "$@" -fi - - if [ "$1" = '-dev' -o "$1" = "--dev" ]; then - shift - exec sage-dev "$@" +-if [ "$1" = '-dev' -o "$1" = "--dev" ]; then +- shift +- exec sage-dev "$@" +-fi +- + if [ $# -ge 1 ]; then + T=`echo "$1" | sed -e "s/.*\.//"` + if [ "$T" = "spkg" ]; then diff -up src/bin/sage-runtests.orig src/bin/sage-runtests ---- src/bin/sage-runtests.orig 2014-08-12 14:00:18.705932326 -0300 -+++ src/bin/sage-runtests 2014-08-12 14:00:31.543932818 -0300 +--- src/bin/sage-runtests.orig 2014-11-17 17:43:03.195926083 -0200 ++++ src/bin/sage-runtests 2014-11-17 17:48:39.236938952 -0200 @@ -54,10 +54,6 @@ if __name__ == "__main__": help="run doctests using Valgrind's cachegrind tool. The log " "files are named sage-cachegrind.PID and can be found in " + @@ -561,14 +583,23 @@ diff -up src/bin/sage-runtests.orig src/bin/sage-runtests parser.add_option("-f", "--failed", action="store_true", default=False, help="doctest only those files that failed in the previous run") diff -up src/bin/sage-valgrind.orig src/bin/sage-valgrind ---- src/bin/sage-valgrind.orig 2014-08-12 14:00:41.666933205 -0300 -+++ src/bin/sage-valgrind 2014-08-12 14:01:14.983934481 -0300 -@@ -11,7 +11,7 @@ fi - LOG="$DOT_SAGE"/valgrind/sage-memcheck.%p - echo "Log file is $LOG" +--- src/bin/sage-valgrind.orig 2014-11-17 17:43:14.588926520 -0200 ++++ src/bin/sage-valgrind 2014-11-17 17:48:18.884938172 -0200 +@@ -1,16 +1,6 @@ + #!/usr/bin/env bash + +-SUPP="" +-if [ -f "$SAGE_EXTCODE/valgrind/python.supp" ]; then +- SUPP+=" --suppressions=$SAGE_EXTCODE/valgrind/python.supp" +-else +- echo "Python suppressions not found (not installed?), skipping" +-fi +-SUPP+=" --suppressions=$SAGE_EXTCODE/valgrind/pyalloc.supp" +-SUPP+=" --suppressions=$SAGE_EXTCODE/valgrind/sage.supp" +-SUPP+=" --suppressions=$SAGE_EXTCODE/valgrind/sage-additional.supp" +- +-MEMCHECK_FLAGS="--leak-resolution=high --leak-check=full --num-callers=25 $SUPP" ++MEMCHECK_FLAGS="--leak-resolution=high --leak-check=full --num-callers=25" --MEMCHECK_FLAGS="--leak-resolution=high --log-file=$LOG --leak-check=full --num-callers=25 --suppressions=$SAGE_LOCAL/lib/valgrind/sage.supp "; export MEMCHECK_FLAGS -+MEMCHECK_FLAGS="--leak-resolution=high --log-file=$LOG --leak-check=full --num-callers=25 "; export MEMCHECK_FLAGS if [ "$SAGE_MEMCHECK_FLAGS" ]; then - echo "Overwriting memcheck flags with:" - echo $SAGE_MEMCHECK_FLAGS + echo "Overwriting memcheck flags with: $SAGE_MEMCHECK_FLAGS" diff --git a/sagemath-sphinx.patch b/sagemath-sphinx.patch deleted file mode 100644 index bdca66d..0000000 --- a/sagemath-sphinx.patch +++ /dev/null @@ -1,139 +0,0 @@ -diff -up src/sage/graphs/generic_graph.py.orig src/sage/graphs/generic_graph.py ---- src/sage/graphs/generic_graph.py.orig 2014-08-12 14:58:26.408065882 -0300 -+++ src/sage/graphs/generic_graph.py 2014-08-12 14:58:29.914066017 -0300 -@@ -9275,7 +9275,7 @@ class GenericGraph(GenericGraph_pyx): - - .. SEEALSO:: - -- - :meth:`subdivide_edge` -- subdivides one edge -+ - :meth:`subdivide_edge` -- subdivides one edge - """ - for e in edges: - self.subdivide_edge(e, k) -@@ -11557,10 +11557,10 @@ class GenericGraph(GenericGraph_pyx): - - .. SEEALSO:: - -- - :mod:`Interval Graph Recognition `. -+ - :mod:`Interval Graph Recognition `. - -- - :meth:`PQ ` -- -- Implementation of PQ-Trees. -+ - :meth:`PQ ` -+ -- Implementation of PQ-Trees. - - """ - self._scream_if_not_simple() -@@ -13429,13 +13429,13 @@ class GenericGraph(GenericGraph_pyx): - - .. SEEALSO:: - -- - :meth:`breadth_first_search ` -- -- breadth-first search for fast compiled graphs. -+ - :meth:`breadth_first_search ` -+ -- breadth-first search for fast compiled graphs. - -- - :meth:`depth_first_search ` -- -- depth-first search for fast compiled graphs. -+ - :meth:`depth_first_search ` -+ -- depth-first search for fast compiled graphs. - -- - :meth:`depth_first_search` -- depth-first search for generic graphs. -+ - :meth:`depth_first_search` -- depth-first search for generic graphs. - - EXAMPLES:: - -@@ -13554,13 +13554,13 @@ class GenericGraph(GenericGraph_pyx): - - .. SEEALSO:: - -- - :meth:`breadth_first_search` -+ - :meth:`breadth_first_search` - -- - :meth:`breadth_first_search ` -- -- breadth-first search for fast compiled graphs. -+ - :meth:`breadth_first_search ` -+ -- breadth-first search for fast compiled graphs. - -- - :meth:`depth_first_search ` -- -- depth-first search for fast compiled graphs. -+ - :meth:`depth_first_search ` -+ -- depth-first search for fast compiled graphs. - - EXAMPLES:: - -diff -up src/sage/graphs/graph.py.orig src/sage/graphs/graph.py ---- src/sage/graphs/graph.py.orig 2014-08-12 14:58:26.410065882 -0300 -+++ src/sage/graphs/graph.py 2014-08-12 14:58:29.917066017 -0300 -@@ -3023,9 +3023,9 @@ class Graph(GenericGraph): - - .. SEEALSO:: - -- - :meth:`~Graph.is_arc_transitive` -- - :meth:`~Graph.is_half_transitive` -- - :meth:`~Graph.is_semi_symmetric` -+ - :meth:`~Graph.is_arc_transitive` -+ - :meth:`~Graph.is_half_transitive` -+ - :meth:`~Graph.is_semi_symmetric` - - EXAMPLES:: - -@@ -3070,9 +3070,9 @@ class Graph(GenericGraph): - - .. SEEALSO:: - -- - :meth:`~Graph.is_edge_transitive` -- - :meth:`~Graph.is_half_transitive` -- - :meth:`~Graph.is_semi_symmetric` -+ - :meth:`~Graph.is_edge_transitive` -+ - :meth:`~Graph.is_half_transitive` -+ - :meth:`~Graph.is_semi_symmetric` - - EXAMPLES:: - -@@ -3107,9 +3107,9 @@ class Graph(GenericGraph): - - .. SEEALSO:: - -- - :meth:`~Graph.is_edge_transitive` -- - :meth:`~Graph.is_arc_transitive` -- - :meth:`~Graph.is_semi_symmetric` -+ - :meth:`~Graph.is_edge_transitive` -+ - :meth:`~Graph.is_arc_transitive` -+ - :meth:`~Graph.is_semi_symmetric` - - EXAMPLES: - -@@ -3146,9 +3146,9 @@ class Graph(GenericGraph): - - .. SEEALSO:: - -- - :meth:`~Graph.is_edge_transitive` -- - :meth:`~Graph.is_arc_transitive` -- - :meth:`~Graph.is_half_transitive` -+ - :meth:`~Graph.is_edge_transitive` -+ - :meth:`~Graph.is_arc_transitive` -+ - :meth:`~Graph.is_half_transitive` - - EXAMPLES: - -@@ -6114,8 +6114,8 @@ class Graph(GenericGraph): - - .. SEEALSO:: - -- * Graph cores is also a notion related to graph homomorphisms. For -- this second meaning, see :meth:`Graph.has_homomorphism_to`. -+ * Graph cores is also a notion related to graph homomorphisms. For -+ this second meaning, see :meth:`Graph.has_homomorphism_to`. - - REFERENCE: - -@@ -6300,7 +6300,7 @@ class Graph(GenericGraph): - - .. SEEALSO:: - -- - :meth:`is_prime` -- Tests whether a graph is prime. -+ - :meth:`is_prime` -- Tests whether a graph is prime. - - REFERENCE: - diff --git a/sagemath.spec b/sagemath.spec index 2555a02..a360633 100644 --- a/sagemath.spec +++ b/sagemath.spec @@ -24,7 +24,7 @@ %global pexpect_pkg pexpect-2.0 %global polytopes_db_pkg polytopes_db-20120220 %global rubiks_pkg rubiks-20070912 -%global sagenb_pkg sagenb-0.10.8.2 +%global sagenb_pkg sagenb-0.11.1 %global sagetex_pkg sagetex-2.3.4 %global SAGE_ROOT %{_libdir}/sagemath @@ -38,8 +38,8 @@ Name: sagemath Group: Applications/Engineering Summary: A free open-source mathematics software system -Version: 6.3 -Release: 4%{?dist} +Version: 6.4.1 +Release: 1%{?dist} # The file ${SAGE_ROOT}/COPYING.txt is the upstream license breakdown file # Additionally, every $files section has a comment with the license name # before files with that license @@ -48,9 +48,6 @@ URL: http://www.sagemath.org Source0: http://boxen.math.washington.edu/home/%{name}/sage-mirror/src/sage-%{version}.tar.gz Source1: gprc.expect Source2: makecmds.sty -# not installed by jmol package, use one in sagemath jmol spkg -Source3: Jmol.js -Source4: JmolHelp.html # 1. scons ignores most environment variables # 2. scons 2.2* does not have soname support (expected for scons 2.3*) @@ -67,13 +64,10 @@ Patch1: %{name}-gmp.patch # Set of patches to work with system wide packages Patch2: %{name}-scripts.patch -# Adapt to ntl 6.0.0. -Patch3: %{name}-ntl6.patch - # remove call to not implemented sagemath "is_package_installed" interfaces # need to package coin-or solver in fedora # remove check for non free solvers -Patch4: %{name}-extensions.patch +Patch3: %{name}-extensions.patch # helper to: # o respect a DESTDIR environment variable @@ -81,81 +75,69 @@ Patch4: %{name}-extensions.patch # o minor change to help in incremental builds by avoiding rebuilding # files # o do not assume there is an installed sagemath -Patch5: %{name}-rpmbuild.patch +Patch4: %{name}-rpmbuild.patch # build documentation in buildroot environment -Patch6: %{name}-sagedoc.patch +Patch5: %{name}-sagedoc.patch # sage notebook rpm and system environment adjustments -Patch7: %{name}-sagenb.patch +Patch6: %{name}-sagenb.patch # do not attempt to create state files in system directories -Patch8: %{name}-readonly.patch - -# force coercion of ecl t_string to ecl t_base_string -# this is hackish and only required if ecl is built with unicode support -Patch9: %{name}-ecl-unicode.patch +Patch7: %{name}-readonly.patch # do not link explicitly to png12 -Patch10: %{name}-png.patch +Patch8: %{name}-png.patch # work with all maxima-runtime lisp backend packages -Patch11: %{name}-maxima.patch +Patch9: %{name}-maxima.patch # execute 4ti2 programs in $PATH not in $SAGE_ROOT/local/bin -Patch12: %{name}-4ti2.patch +Patch10: %{name}-4ti2.patch # http://trac.sagemath.org/sage_trac/ticket/12992 # http://pari.math.u-bordeaux.fr/cgi-bin/bugreport.cgi?bug=1317 -Patch13: %{name}-pari.patch +Patch11: %{name}-pari.patch # use jmol itself to export preview images # FIXME besides not using X and told so, fails if DISPLAY is not set -Patch14: %{name}-jmol.patch +Patch12: %{name}-jmol.patch # only cremona mini database built and installed # FIXME add a package with the full cremona database # FIXME actually it should be already available in pari-elldata -Patch15: %{name}-cremona.patch +Patch13: %{name}-cremona.patch # lrslib is a requires -Patch16: %{name}-lrslib.patch +Patch14: %{name}-lrslib.patch # nauty cannot be packaged due to license restrictions # http://cs.anu.edu.au/~bdm/nauty/ # http://pallini.di.uniroma1.it/ -Patch17: %{name}-nauty.patch +Patch15: %{name}-nauty.patch # gap hap package not (yet) available # http://www-gap.mcs.st-and.ac.uk/Packages/hap.html -Patch18: %{name}-gap-hap.patch +Patch16: %{name}-gap-hap.patch # enable lrcalc -Patch19: %{name}-lrcalc.patch +Patch17: %{name}-lrcalc.patch # enable cbc -Patch20: %{name}-cbc.patch +Patch18: %{name}-cbc.patch # Use system gap directories -Patch21: %{name}-libgap.patch +Patch19: %{name}-libgap.patch # enable fes -Patch22: %{name}-fes.patch +Patch20: %{name}-fes.patch # enable cryptominisat -Patch23: %{name}-cryptominisat.patch +Patch21: %{name}-cryptominisat.patch # Side effect of using distro packages # https://bugzilla.redhat.com/show_bug.cgi?id=974769 -Patch24: %{name}-sympy.patch - -# Correct some warnings of newer sphinx that are treatead as errors -# by default as of sagemath 6.2; other problems were fixed using -# -k (keep-going) -Patch25: %{name}-sphinx.patch - -# Rediffed latest version from http://trac.sagemath.org/ticket/15767 -Patch26: %{name}-pari2.7.patch +Patch22: %{name}-sympy.patch BuildRequires: 4ti2 BuildRequires: atlas-devel @@ -163,7 +145,7 @@ BuildRequires: cddlib-tools BuildRequires: cliquer-devel BuildRequires: coin-or-Cbc-devel BuildRequires: cryptominisat-devel -BuildRequires: Cython +BuildRequires: Cython >= 0.21.1 BuildRequires: desktop-file-utils BuildRequires: dos2unix BuildRequires: dvipng @@ -611,18 +593,13 @@ popd %patch17 %patch18 %patch19 -%patch20 -%patch21 %if %{have_fes} -%patch22 +%patch20 %endif -%patch23 -%patch24 -%patch25 - -%patch26 +%patch21 +%patch22 sed -e 's|@@SAGE_ROOT@@|%{SAGE_ROOT}|' \ -e 's|@@SAGE_DOC@@|%{SAGE_DOC}|' \ @@ -687,7 +664,9 @@ pushd src/c_lib -e 's|@@optflags@@|%{optflags}|g' \ -e "s|@@__global_ldflags@@|$ldflags|g" \ -i SConstruct - CXX=g++ UNAME=Linux SAGE64=auto scons + # force building ntl_wrap.cpp with gcc otherwise other + # modules will not find mangled symbols. + CXX=gcc UNAME=Linux SAGE64=auto scons ln -s libcsage.so.0 libcsage.so popd pushd src/sage/libs/mpmath @@ -757,19 +736,22 @@ popd pushd build/pkgs/sagenb/src/%{sagenb_pkg} rm -f %{buildroot}%{python_sitearch}/sagenb/data/sage3d/sage3d python setup.py install --root=%{buildroot} --install-purelib=%{python_sitearch} + # jmol - rm -fr %{buildroot}%{python_sitearch}/sagenb/data/jmol - mkdir -p %{buildroot}%{python_sitearch}/sagenb/data/jmol/appletweb - pushd %{buildroot}%{python_sitearch}/sagenb/data/jmol - cp -fa %{SOURCE3} %{SOURCE4} appletweb - popd + ### FIXME waiting on https://bugzilla.redhat.com/show_bug.cgi?id=1108060 + # To get it to work you need to get the sagemath jmol spkg or an + # upstream sagemath install, example: + # cp -fr ~/sage-6.4.1-x86_64-Linux/local/share/jmol /usr/share/sagemath + # cp -fr ~/sage-6.4.1-x86_64-Linux/local/share/jsmol /usr/share/sagemath + + mkdir -p $SAGE_SHARE/jmol + mkdir -p $SAGE_SHARE/jsmol/ + # sage3d rm -f %{buildroot}%{_bindir}/sage3d %if %{with_sage3d} ln -sf %{SAGE_LOCAL}/bin/sage3d %{buildroot}%{python_sitearch}/sagenb/data/sage3d/sage3d %endif - # flask stuff not installed - cp -ar flask_version %{buildroot}%{python_sitearch}/sagenb ln -sf %{python_sitearch}/sagenb %{buildroot}%{SAGE_SRC}/sagenb popd @@ -1081,9 +1063,6 @@ rm %{buildroot}%{python_sitearch}/sagenb/translations/*/LC_MESSAGES/*.po rm -r %{buildroot}%{python_sitearch}/sagenb/data/sage3d %endif -# remove cache files -rm -r %{buildroot}%{python_sitearch}/sagenb/data/.webassets-cache - # remove sage_setup rm -r %{buildroot}%{python_sitearch}/sage_setup @@ -1099,23 +1078,6 @@ exit 0 /sbin/ldconfig exit 0 -# Use symlinks and a minor patch to the notebook to not bundle jmol -%post notebook -ln -sf %{_javadir}/JmolApplet.jar %{python_sitearch}/sagenb/data/jmol/ -ln -sf %{_javadir}/Jmol.jar %{python_sitearch}/sagenb/data/jmol/ -ln -sf %{_javadir}/vecmath.jar %{python_sitearch}/sagenb/data/jmol/ -exit 0 - -%postun notebook -if [ $1 -eq 0 ] ; then - rm -f %{python_sitearch}/sagenb/data/jmol/JmolApplet.jar - rm -f %{python_sitearch}/sagenb/data/jmol/vecmath.jar - rmdir %{python_sitearch}/sagenb/data/jmol && - rmdir %{python_sitearch}/sagenb/data && - rmdir %{python_sitearch}/sagenb -fi -exit 0 - %post sagetex %{_bindir}/mktexlsr exit 0 @@ -1188,7 +1150,6 @@ exit 0 %{SAGE_ETC}/maxima %{SAGE_ETC}/mwrank %{SAGE_ETC}/pari -%{SAGE_ETC}/singular #------------------------------------------------------------------------ %files data-graphs @@ -1270,7 +1231,8 @@ exit 0 # ASL 2.0 %{python_sitearch}/sagenb/data/highlight # LGPLv2+ -%{python_sitearch}/sagenb/data/jmol +%{SAGE_SHARE}/jmol/ +%{SAGE_SHARE}/jsmol/ # (MIT or GPLv2) and (MIT and BSD and GPL) %{python_sitearch}/sagenb/data/jquery # (MIT or GPLv2) and (MIT and BSD and GPL) @@ -1291,8 +1253,6 @@ exit 0 %endif # LGPLv2+ %{python_sitearch}/sagenb/data/tiny_mce -# Auto generated files -%{python_sitearch}/sagenb/data/webassets_generated # LGPLv2+ %{python_sitearch}/sagenb/data/zorn # GPLv2+ @@ -1317,6 +1277,9 @@ exit 0 %dir %{python_sitearch}/sagenb/translations %lang(cs_CZ) %{python_sitearch}/sagenb/translations/cs_CZ %lang(de_AT) %{python_sitearch}/sagenb/translations/de_AT +%lang(de_AT) %{python_sitearch}/sagenb/translations/en_US +%lang(de_AT) %{python_sitearch}/sagenb/translations/es_ES +%lang(de_AT) %{python_sitearch}/sagenb/translations/fr_FR %lang(pt_BR) %{python_sitearch}/sagenb/translations/pt_BR %lang(ru_RU) %{python_sitearch}/sagenb/translations/ru_RU @@ -1341,6 +1304,9 @@ exit 0 ######################################################################## %changelog +* Wed Nov 26 2014 pcpa - 6.4.1-1 +- Update to sagemath 6.4.1 (#1095282) + * Sat Nov 1 2014 pcpa - 6.3-4 - Install 128x128 icon (#1157575) diff --git a/sources b/sources index 9f2f5a2..cd5f6e4 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -668f080be70ffea8d67592ca00d161eb sage-6.3.tar.gz +9e64f198f791577555344b9aaa6768a9 sage-6.4.1.tar.gz