From 0a3a4a0193ef03921995cac67f8c91c6e352d059 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Mon, 18 May 2009 23:33:08 +0000 Subject: asymptote 1.73 git-svn-id: svn://tug.org/texlive/trunk@13217 c570f23f-e606-0410-a88d-b1316a301751 --- Build/source/utils/asymptote/ChangeLog | 184 + Build/source/utils/asymptote/ReleaseNotes | 12 + Build/source/utils/asymptote/asy-keywords.el | 4 +- Build/source/utils/asymptote/asymptote.spec | 2 +- Build/source/utils/asymptote/base/geometry.asy | 115 +- Build/source/utils/asymptote/base/graph.asy | 33 +- Build/source/utils/asymptote/base/graph3.asy | 52 +- Build/source/utils/asymptote/base/plain_Label.asy | 4 +- Build/source/utils/asymptote/base/plain_boxes.asy | 2 +- Build/source/utils/asymptote/base/three.asy | 105 +- Build/source/utils/asymptote/base/three_light.asy | 17 +- Build/source/utils/asymptote/base/trembling.asy | 20 +- Build/source/utils/asymptote/base/version.asy | 2 +- Build/source/utils/asymptote/builtin.cc | 8 +- Build/source/utils/asymptote/builtin.h | 2 +- Build/source/utils/asymptote/camperror.cc | 6 +- Build/source/utils/asymptote/configure | 18 +- Build/source/utils/asymptote/configure.ac | 2 +- Build/source/utils/asymptote/doc/FAQ/asy-faq.bfnn | 11 +- Build/source/utils/asymptote/doc/asymptote.texi | 90 +- Build/source/utils/asymptote/doc/flowchartdemo.asy | 4 +- Build/source/utils/asymptote/examples/teapot.asy | 2 +- Build/source/utils/asymptote/examples/textpath.asy | 10 + .../utils/asymptote/examples/vectorfield3.asy | 12 +- .../utils/asymptote/examples/vectorfieldsphere.asy | 17 + Build/source/utils/asymptote/fileio.h | 12 +- Build/source/utils/asymptote/glrender.cc | 11 +- Build/source/utils/asymptote/glrender.h | 6 +- Build/source/utils/asymptote/install-sh | 240 +- Build/source/utils/asymptote/pen.h | 8 +- Build/source/utils/asymptote/picture.cc | 14 +- Build/source/utils/asymptote/picture.h | 7 +- Build/source/utils/asymptote/psfile.cc | 3 +- Build/source/utils/asymptote/runtime.cc | 4678 ++++++++++---------- Build/source/utils/asymptote/runtime.in | 152 +- Build/source/utils/asymptote/settings.cc | 18 +- 36 files changed, 3197 insertions(+), 2686 deletions(-) create mode 100644 Build/source/utils/asymptote/examples/textpath.asy create mode 100644 Build/source/utils/asymptote/examples/vectorfieldsphere.asy (limited to 'Build/source/utils/asymptote') diff --git a/Build/source/utils/asymptote/ChangeLog b/Build/source/utils/asymptote/ChangeLog index f0a3fe80346..d684018c4f3 100644 --- a/Build/source/utils/asymptote/ChangeLog +++ b/Build/source/utils/asymptote/ChangeLog @@ -1,4 +1,188 @@ ------------------------------------------------------------------------ +r4285 | jcbowman | 2009-05-18 02:02:35 -0600 (Mon, 18 May 2009) | 2 lines +Changed paths: + M /trunk/asymptote/settings.cc + +Allow sysdir to be overridden on the command line. + +------------------------------------------------------------------------ +r4284 | jcbowman | 2009-05-18 00:52:28 -0600 (Mon, 18 May 2009) | 1 line +Changed paths: + M /trunk/asymptote/settings.cc + +Fix texlive build under MSWindows +------------------------------------------------------------------------ +r4283 | jcbowman | 2009-05-17 23:10:36 -0600 (Sun, 17 May 2009) | 3 lines +Changed paths: + M /trunk/asymptote/base/plain_boxes.asy + M /trunk/asymptote/base/three.asy + M /trunk/asymptote/base/three_light.asy + M /trunk/asymptote/builtin.cc + M /trunk/asymptote/builtin.h + M /trunk/asymptote/glrender.cc + M /trunk/asymptote/glrender.h + M /trunk/asymptote/picture.cc + M /trunk/asymptote/picture.h + M /trunk/asymptote/runtime.in + M /trunk/asymptote/settings.cc + +Support user-specified background color in OpenGL renderer via light +constructor. + +------------------------------------------------------------------------ +r4282 | jcbowman | 2009-05-17 21:18:17 -0600 (Sun, 17 May 2009) | 2 lines +Changed paths: + M /trunk/asymptote/pen.h + M /trunk/asymptote/settings.cc + +Add textinitialfont environment variable. + +------------------------------------------------------------------------ +r4281 | jcbowman | 2009-05-17 11:41:49 -0600 (Sun, 17 May 2009) | 2 lines +Changed paths: + M /trunk/asymptote/camperror.cc + M /trunk/asymptote/psfile.cc + +Call reportFatal in psfile.close(). + +------------------------------------------------------------------------ +r4280 | jcbowman | 2009-05-17 11:22:56 -0600 (Sun, 17 May 2009) | 2 lines +Changed paths: + M /trunk/asymptote/camperror.cc + M /trunk/asymptote/psfile.cc + +Don't return after reportError. + +------------------------------------------------------------------------ +r4279 | jcbowman | 2009-05-17 11:08:10 -0600 (Sun, 17 May 2009) | 2 lines +Changed paths: + M /trunk/asymptote/doc/asymptote.texi + M /trunk/asymptote/runtime.in + +Add warn=true arguments to polar, azimuth, colatitude, and latitude. + +------------------------------------------------------------------------ +r4278 | jcbowman | 2009-05-17 01:18:07 -0600 (Sun, 17 May 2009) | 2 lines +Changed paths: + M /trunk/asymptote/pen.h + +Set default font to groff 12pt Times Roman when settings.tex="none". + +------------------------------------------------------------------------ +r4277 | jcbowman | 2009-05-17 00:52:19 -0600 (Sun, 17 May 2009) | 2 lines +Changed paths: + M /trunk/asymptote/base/plain_Label.asy + A /trunk/asymptote/examples/textpath.asy + M /trunk/asymptote/runtime.in + M /trunk/asymptote/settings.cc + +Add pen support to textpath and example. + +------------------------------------------------------------------------ +r4276 | jcbowman | 2009-05-17 00:49:39 -0600 (Sun, 17 May 2009) | 2 lines +Changed paths: + M /trunk/asymptote/fileio.h + +Fix segmentation fault after mode error. + +------------------------------------------------------------------------ +r4275 | jcbowman | 2009-05-16 23:10:29 -0600 (Sat, 16 May 2009) | 2 lines +Changed paths: + M /trunk/asymptote/asymptote.spec + M /trunk/asymptote/base/plain_Label.asy + M /trunk/asymptote/runtime.in + M /trunk/asymptote/settings.cc + +Add textpath command, contributed by Michail Vidiassov. + +------------------------------------------------------------------------ +r4274 | jcbowman | 2009-05-16 15:21:49 -0600 (Sat, 16 May 2009) | 2 lines +Changed paths: + M /trunk/asymptote/doc/asymptote.texi + M /trunk/asymptote/examples/condor.asy + +Update links. + +------------------------------------------------------------------------ +r4273 | jcbowman | 2009-05-16 10:16:47 -0600 (Sat, 16 May 2009) | 2 lines +Changed paths: + M /trunk/asymptote/doc/flowchartdemo.asy + +Restore example. + +------------------------------------------------------------------------ +r4272 | pivaldi | 2009-05-16 08:04:32 -0600 (Sat, 16 May 2009) | 1 line +Changed paths: + M /trunk/asymptote/base/trembling.asy + +trembling.asy: change licence GPL to LGPL. +------------------------------------------------------------------------ +r4271 | pivaldi | 2009-05-16 05:07:49 -0600 (Sat, 16 May 2009) | 1 line +Changed paths: + M /trunk/asymptote/base/geometry.asy + +geometry.asy: put the compatibility routines +------------------------------------------------------------------------ +r4270 | pivaldi | 2009-05-16 04:52:59 -0600 (Sat, 16 May 2009) | 1 line +Changed paths: + M /trunk/asymptote/base/geometry.asy + +Fix minor bugs in geometry.asy. Change licence GPL to LGPL. +------------------------------------------------------------------------ +r4269 | jcbowman | 2009-05-16 01:23:23 -0600 (Sat, 16 May 2009) | 6 lines +Changed paths: + M /trunk/asymptote/base/graph.asy + M /trunk/asymptote/base/graph3.asy + M /trunk/asymptote/base/three.asy + M /trunk/asymptote/doc/FAQ/asy-faq.bfnn + M /trunk/asymptote/doc/asymptote.texi + M /trunk/asymptote/doc/cube.asy + M /trunk/asymptote/doc/flowchartdemo.asy + M /trunk/asymptote/examples/vectorfield3.asy + A /trunk/asymptote/examples/vectorfieldsphere.asy + +Use center=false by default again for orthographic projections. + +Improve vectorfield routines. + +Update documentation and FAQ. + +------------------------------------------------------------------------ +r4268 | jcbowman | 2009-05-15 14:32:28 -0600 (Fri, 15 May 2009) | 6 lines +Changed paths: + M /trunk/asymptote/base/three.asy + M /trunk/asymptote/doc/asymptote.texi + M /trunk/asymptote/doc/cube.asy + M /trunk/asymptote/examples/condor.asy + M /trunk/asymptote/examples/teapot.asy + +Respect autoadjust=false. + +Remove autoadjust parameter from orthographic projections. + +Center target by default, unless autoadjust=false. + +------------------------------------------------------------------------ +r4267 | jcbowman | 2009-05-15 08:55:36 -0600 (Fri, 15 May 2009) | 2 lines +Changed paths: + M /trunk/asymptote/doc/asymptote.texi + +Update documentation of shipout. + +------------------------------------------------------------------------ +r4266 | jcbowman | 2009-05-15 08:31:21 -0600 (Fri, 15 May 2009) | 2 lines +Changed paths: + M /trunk/asymptote/configure.ac + +Increment version to 1.73svn. + +------------------------------------------------------------------------ +r4265 | jcbowman | 2009-05-14 17:26:51 -0600 (Thu, 14 May 2009) | 1 line +Changed paths: + M /trunk/asymptote/asymptote.spec + +Increment version to 1.73svn. +------------------------------------------------------------------------ r4264 | jcbowman | 2009-05-14 16:03:48 -0600 (Thu, 14 May 2009) | 2 lines Changed paths: M /trunk/asymptote/configure.ac diff --git a/Build/source/utils/asymptote/ReleaseNotes b/Build/source/utils/asymptote/ReleaseNotes index a4cf39ffa94..6a1d8e590df 100644 --- a/Build/source/utils/asymptote/ReleaseNotes +++ b/Build/source/utils/asymptote/ReleaseNotes @@ -1,3 +1,15 @@ +Release Notes for Version 1.73 + +An alternative OpenGL background color can now be specified with the pen +currentlight.background. A new textpath command allows 3D labels to be +drawn with settings.texengine="none". Minor bugs in the geometry package were +fixed. The interface to the vectorfield routines was improved. +The autoadjust parameter was removed from orthographic projections; +autoadjust=false is now always respected for perspective projections. +Optional warn=true arguments were added to the polar, azimuth, colatitude, +and latitude functions. A call to reportError interrupts execution again. +A segmentation fault that can occur after file mode errors was fixed. + Release Notes for Version 1.72 PostScript calculator function shading was implemented. Interactive camera diff --git a/Build/source/utils/asymptote/asy-keywords.el b/Build/source/utils/asymptote/asy-keywords.el index 0b848035b6e..f699de8de8a 100644 --- a/Build/source/utils/asymptote/asy-keywords.el +++ b/Build/source/utils/asymptote/asy-keywords.el @@ -2,7 +2,7 @@ ;; This file is automatically generated by asy-list.pl. ;; Changes will be overwritten. ;; -(defvar asy-keywords-version "1.72") +(defvar asy-keywords-version "1.73") (defvar asy-keyword-name '( and controls tension atleast curl if else while for do return break continue struct typedef new access import unravel from include quote static public private restricted this explicit true false null cycle newframe operator )) @@ -11,7 +11,7 @@ and controls tension atleast curl if else while for do return break continue str Braid Label Legend Rmf TreeNode abscissa arc arrowhead binarytree binarytreeNode block bool bool3 bounds bqe circle conic coord coordsys cputime ellipse file filltype frame grid3 guide horner hsv hyperbola indexedTransform int inversion key line linefit marginT marker mass object pair parabola path path3 pen picture point position projection real revolution scaleT scientific segment side slice splitface string surface tensionSpecifier ticklocate ticksgridT tickvalues transform transformation tree triangle trilinear triple vector vertex void )) (defvar asy-function-name '( -AND Arc ArcArrow ArcArrows Arrow Arrows Automatic AvantGarde BBox BWRainbow BWRainbow2 Bar Bars BeginArcArrow BeginArrow BeginBar BeginDotMargin BeginMargin BeginPenMargin Blank Bookman Bottom BottomTop Bounds Break Broken BrokenLog Ceil Circle CircleBarIntervalMarker Cos Courier CrossIntervalMarker DefaultFormat DefaultLogFormat Degrees Dir DotMargin DotMargins Dotted Draw Drawline Embed EndArcArrow EndArrow EndBar EndDotMargin EndMargin EndPenMargin Fill FillDraw Floor Format Full Gaussian Gaussrand Gaussrandpair Gradient Grayscale Helvetica Hermite HookHead InOutTicks InTicks J Label Landscape Left LeftRight LeftTicks Legend Linear Link Log LogFormat Margin Margins Mark MidArcArrow MidArrow NOT NewCenturySchoolBook NoBox NoMargin NoModifier NoTicks NoTicks3 NoZero NoZeroFormat None OR OmitFormat OmitTick OutTicks Ox Oy Palatino PaletteTicks Pen PenMargin PenMargins Pentype Portrait RadialShade Rainbow Range Relative Right RightTicks Rotate Round Scale ScaleX ScaleY ScaleZ Seascape Shift Sin Slant Spline StickIntervalMarker Straight Symbol Tan TeXify Ticks Ticks3 TildeIntervalMarker TimesRoman Top TrueMargin UnFill UpsideDown Wheel X XEquals XOR XY XYEquals XYZero XYgrid XZEquals XZZero XZero XZgrid Y YEquals YXgrid YZ YZEquals YZZero YZero YZgrid Z ZX ZXgrid ZYgrid ZapfChancery ZapfDingbats _cputime _draw _eval _image _labelpath _strokepath _texpath aCos aSin aTan abort abs accel acos acosh acot acsc add addArrow addMargins addSaveFunction addnode addnodes addpenarc addpenline addseg adjust alias align all altitude angabscissa angle angpoint animate annotate anticomplementary antipedal apply approximate arc arcarrowsize arccircle arcdir arcfromcenter arcfromfocus arclength arcnodesnumber arcpoint arcsubtended arcsubtendedcenter arctime arctopath array arrow arrow2 arrowbase arrowbasepoints arrowsize asec asin asinh ask assert asy asycode asydir asyfigure asyfilecode asyinclude asywrite atan atan2 atanh atbreakpoint atexit atime attach attract atupdate autoformat autoscale autoscale3 axes axes3 axialshade axis axiscoverage azimuth babel background bangles bar barmarksize barsize basealign baseline bbox beep beginclip begingroup beginpoint between bevel bezier bezierP bezierPP bezierPPP bezulate bibliography bibliographystyle binarytree binarytreeNode binomial binput bins bisector bisectorpoint bispline blend boutput box bqe breakpoint breakpoints brick buildRestoreDefaults buildRestoreThunk buildcycle bulletcolor canonical canonicalcartesiansystem cartesiansystem case1 case2 case3 cbrt cd ceil center centerToFocus centroid cevian change2 changecoordsys checkSegment checkconditionlength checker checklengths checkposition checktriangle choose circle circlebarframe circlemarkradius circlenodesnumber circumcenter circumcircle clamped clear clip clipdraw close cmyk code colatitude collect collinear color colorless colors colorspace comma compassmark complement complementary concat concurrent cone conic conicnodesnumber conictype conj connect containmentTree contains contour contour3 controlSpecifier convert coordinates coordsys copy cos cosh cot countIntersections cputime crop cropcode cross crossframe crosshatch crossmarksize csc csv cubicroots curabscissa curlSpecifier curpoint currentarrow currentexitfunction currentmomarrow currentpolarconicroutine curve cut cutafter cutbefore cyclic cylinder debugger deconstruct defaultdir defaultformat defaultpen defaultspline defined degenerate degrees delete deletepreamble determinant diagonal diamond diffdiv dimension dir dirSpecifier dirtime display distance divisors do_overpaint dot dotframe dotsize downcase draw drawAll drawDoubleLine drawFermion drawGhost drawGluon drawMomArrow drawPhoton drawScalar drawVertex drawVertexBox drawVertexBoxO drawVertexBoxX drawVertexO drawVertexOX drawVertexTriangle drawVertexTriangleO drawVertexX drawarrow drawarrow2 drawline drawtick duplicate elle ellipse ellipsenodesnumber embed embed3 empty enclose endScript endclip endgroup endl endpoint endpoints eof eol equation equations erase erf erfc error errorbar errorbars euler eval excenter excircle exit exitXasyMode exitfunction exp expi expm1 exradius extend extension extouch fabs factorial fermat fft fhorner figure file filecode fill filldraw filloutside fillrule filltype find finite firstcut firstframe fit fixedscaling floor flush fmdefaults fmod focusToCenter font fontcommand fontsize foot format frac frequency fromCenter fromFocus fspline functionshade gamma generate_random_backtrace generateticks gergonne getc getint getpair getreal getstring gettriple gluon gouraudshade graph graphic gray grestore grid grid3 gsave halfbox hatch hdiffdiv hermite hex histogram history hline hprojection hsv hyperbola hyperbolanodesnumber hyperlink hypot identity image incenter incentral incircle increasing incrementposition indexedTransform initXasyMode initdefaults input inradius insert inside interactive interior interp interpolate intersect intersection intersectionpoint intersectionpoints intersections intouch inverse inversion invisible is3D isDuplicate isogonal isogonalconjugate isotomic isotomicconjugate isparabola italic item key kurtosis kurtosisexcess label labelaxis labelmargin labelpath labels labeltick labelx labelx3 labely labely3 labelz labelz3 lastcut latex latitude latticeshade layer layout ldexp leastsquares legend legenditem length lift limits line linear linecap linejoin linemargin lineskip linetype linewidth link list locale locate locatefile location log log10 log1p logaxiscoverage longitude lookup magnetize makeNode makedraw makepen map margin markangle markangleradius markanglespace markarc marker markinterval marknodes markrightangle markuniform mass masscenter massformat math max max3 maxbound maxcoords maxratio maxtimes mean medial median midpoint min min3 minbound minipage minratio mintimes miterlimit momArrowPath momarrowsize monotonic nativeformat natural needshipout newl newpage newslide newton newtree nextframe nextnormal nextpage nib nodabscissa none normalvideo notaknot numberpage nurb object offset onpath opacity opposite orientation orig_circlenodesnumber orig_circlenodesnumber1 orig_draw orig_ellipsenodesnumber orig_ellipsenodesnumber1 orig_hyperbolanodesnumber orig_parabolanodesnumber origin orthic orthocentercenter outformat outline outprefix output overwrite pack pairs palette parabola parabolanodesnumber parallel partialsum path path3 pattern pause pdf pedal periodic perp perpendicular perpendicularmark phantom photon piecewisestraight point polar polarconicroutine polargraph polygon postcontrol postscript pow10 ppoint prc prc0 precision precontrol prepend print_random_addresses project projection purge pwhermite quadrant quadraticroots quantize quarticroots quotient radialshade radians radicalcenter radicalline radius rand randompath rd read1 read2 read3 readline realmult realquarticroots rectangle rectangular rectify reflect relabscissa relative relativedistance reldir relpoint reltime remainder remark removeDuplicates rename replace report rescale rescale2 resetdefaultpen restore restoredefaults reverse reversevideo rf rfind rgb rgba rgbint rmf rms rotate rotateO rotation round roundbox roundedpath roundrectangle samecoordsys sameside sample save savedefaults saveline scale scale3 scaleO scaleT scaleless scientific search searchtree sec secondaryX secondaryY seconds section sector seek seekeof segment sequence setpens sgn sgnd sharpangle sharpdegrees shift shiftless shipout shipout3 show side simeq simpson sin single sinh size size3 skewness skip slant sleep slope slopefield solve sort sourceline sphere split sqrt square srand standardizecoordsys startScript startTrembling stdev step stickframe stickmarksize stickmarkspace stop straight straightness string stripdirectory stripextension stripfile strokepath subdivide subitem subpath substr sum surface symmedial symmedian system tab tableau tan tangent tangential tangents tanh tell tensionSpecifier tensorshade tex texcolor texify texpath texpreamble texreset texshipout thick thin tick tickMax tickMax3 tickMin tickMin3 ticklabelshift ticklocate tildeframe tildemarksize tile tiling time times title titlepage topbox transform transformation transpose tremble trembleFuzz tremble_circlenodesnumber tremble_circlenodesnumber1 tremble_draw tremble_ellipsenodesnumber tremble_ellipsenodesnumber1 tremble_hyperbolanodesnumber tremble_marknodes tremble_markuniform tremble_parabolanodesnumber triangle triangleAbc triangleabc triangulate tricoef tridiagonal trilinear trim trueMagnetize truepoint tube uncycle unfill uniform unit unitrand unitsize unityroot unstraighten upcase updatefunction upscale uptodate usepackage usersetting usleep value variance variancebiased vbox vector vectorfield verbatim view vline vprojection windingnumber word write xaxis xaxis3 xaxis3At xaxisAt xequals xinput xlimits xoutput xpart xscale xscaleO xtick xtick3 xtrans yaxis yaxis3 yaxis3At yaxisAt yequals ylimits ypart yscale yscaleO ytick ytick3 ytrans zaxis3 zaxis3At zero zero3 zlimits zpart ztick ztick3 ztrans )) +AND Arc ArcArrow ArcArrows Arrow Arrows Automatic AvantGarde BBox BWRainbow BWRainbow2 Bar Bars BeginArcArrow BeginArrow BeginBar BeginDotMargin BeginMargin BeginPenMargin Blank Bookman Bottom BottomTop Bounds Break Broken BrokenLog Ceil Circle CircleBarIntervalMarker Cos Courier CrossIntervalMarker DefaultFormat DefaultLogFormat Degrees Dir DotMargin DotMargins Dotted Draw Drawline Embed EndArcArrow EndArrow EndBar EndDotMargin EndMargin EndPenMargin Fill FillDraw Floor Format Full Gaussian Gaussrand Gaussrandpair Gradient Grayscale Helvetica Hermite HookHead InOutTicks InTicks J Label Landscape Left LeftRight LeftTicks Legend Linear Link Log LogFormat Margin Margins Mark MidArcArrow MidArrow NOT NewCenturySchoolBook NoBox NoMargin NoModifier NoTicks NoTicks3 NoZero NoZeroFormat None OR OmitFormat OmitTick OutTicks Ox Oy Palatino PaletteTicks Pen PenMargin PenMargins Pentype Portrait RadialShade Rainbow Range Relative Right RightTicks Rotate Round Scale ScaleX ScaleY ScaleZ Seascape Shift Sin Slant Spline StickIntervalMarker Straight Symbol Tan TeXify Ticks Ticks3 TildeIntervalMarker TimesRoman Top TrueMargin UnFill UpsideDown Wheel X XEquals XOR XY XYEquals XYZero XYgrid XZEquals XZZero XZero XZgrid Y YEquals YXgrid YZ YZEquals YZZero YZero YZgrid Z ZX ZXgrid ZYgrid ZapfChancery ZapfDingbats _cputime _draw _eval _image _labelpath _strokepath _texpath aCos aSin aTan abort abs accel acos acosh acot acsc add addArrow addMargins addSaveFunction addnode addnodes addpenarc addpenline addseg adjust alias align all altitude angabscissa angle angpoint animate annotate anticomplementary antipedal apply approximate arc arcarrowsize arccircle arcdir arcfromcenter arcfromfocus arclength arcnodesnumber arcpoint arcsubtended arcsubtendedcenter arctime arctopath array arrow arrow2 arrowbase arrowbasepoints arrowsize asec asin asinh ask assert asy asycode asydir asyfigure asyfilecode asyinclude asywrite atan atan2 atanh atbreakpoint atexit atime attach attract atupdate autoformat autoscale autoscale3 axes axes3 axialshade axis axiscoverage azimuth babel background bangles bar barmarksize barsize basealign baseline bbox beep beginclip begingroup beginpoint between bevel bezier bezierP bezierPP bezierPPP bezulate bibliography bibliographystyle binarytree binarytreeNode binomial binput bins bisector bisectorpoint bispline blend boutput box bqe breakpoint breakpoints brick buildRestoreDefaults buildRestoreThunk buildcycle bulletcolor canonical canonicalcartesiansystem cartesiansystem case1 case2 case3 cbrt cd ceil center centerToFocus centroid cevian change2 changecoordsys checkSegment checkconditionlength checker checklengths checkposition checktriangle choose circle circlebarframe circlemarkradius circlenodesnumber circumcenter circumcircle clamped clear clip clipdraw close cmyk code colatitude collect collinear color colorless colors colorspace comma compassmark complement complementary concat concurrent cone conic conicnodesnumber conictype conj connect containmentTree contains contour contour3 controlSpecifier convert coordinates coordsys copy cos cosh cot countIntersections cputime crop cropcode cross crossframe crosshatch crossmarksize csc csv cubicroots curabscissa curlSpecifier curpoint currentarrow currentexitfunction currentmomarrow currentpolarconicroutine curve cut cutafter cutbefore cyclic cylinder debugger deconstruct defaultdir defaultformat defaultpen defaultspline defined degenerate degrees delete deletepreamble determinant diagonal diamond diffdiv dimension dir dirSpecifier dirtime display distance divisors do_overpaint dot dotframe dotsize downcase draw drawAll drawDoubleLine drawFermion drawGhost drawGluon drawMomArrow drawPhoton drawScalar drawVertex drawVertexBox drawVertexBoxO drawVertexBoxX drawVertexO drawVertexOX drawVertexTriangle drawVertexTriangleO drawVertexX drawarrow drawarrow2 drawline drawtick duplicate elle ellipse ellipsenodesnumber embed embed3 empty enclose endScript endclip endgroup endl endpoint endpoints eof eol equation equations erase erf erfc error errorbar errorbars euler eval excenter excircle exit exitXasyMode exitfunction exp expi expm1 exradius extend extension extouch fabs factorial fermat fft fhorner figure file filecode fill filldraw filloutside fillrule filltype find finite firstcut firstframe fit fixedscaling floor flush fmdefaults fmod focusToCenter font fontcommand fontsize foot format frac frequency fromCenter fromFocus fspline functionshade gamma generate_random_backtrace generateticks gergonne getc getint getpair getreal getstring gettriple gluon gouraudshade graph graphic gray grestore grid grid3 gsave halfbox hatch hdiffdiv hermite hex histogram history hline hprojection hsv hyperbola hyperbolanodesnumber hyperlink hypot identity image incenter incentral incircle increasing incrementposition indexedTransform initXasyMode initdefaults input inradius insert inside interactive interior interp interpolate intersect intersection intersectionpoint intersectionpoints intersections intouch inverse inversion invisible is3D isDuplicate isogonal isogonalconjugate isotomic isotomicconjugate isparabola italic item key kurtosis kurtosisexcess label labelaxis labelmargin labelpath labels labeltick labelx labelx3 labely labely3 labelz labelz3 lastcut latex latitude latticeshade layer layout ldexp leastsquares legend legenditem length lift limits line linear linecap linejoin linemargin lineskip linetype linewidth link list locale locate locatefile location log log10 log1p logaxiscoverage longitude lookup magnetize makeNode makedraw makepen map margin markangle markangleradius markanglespace markarc marker markinterval marknodes markrightangle markuniform mass masscenter massformat math max max3 maxbound maxcoords maxlength maxratio maxtimes mean medial median midpoint min min3 minbound minipage minratio mintimes miterlimit momArrowPath momarrowsize monotonic nativeformat natural needshipout newl newpage newslide newton newtree nextframe nextnormal nextpage nib nodabscissa none normalvideo notaknot numberpage nurb object offset onpath opacity opposite orientation orig_circlenodesnumber orig_circlenodesnumber1 orig_draw orig_ellipsenodesnumber orig_ellipsenodesnumber1 orig_hyperbolanodesnumber orig_parabolanodesnumber origin orthic orthocentercenter outformat outline outprefix output overwrite pack pairs palette parabola parabolanodesnumber parallel partialsum path path3 pattern pause pdf pedal periodic perp perpendicular perpendicularmark phantom photon piecewisestraight point polar polarconicroutine polargraph polygon postcontrol postscript pow10 ppoint prc prc0 precision precontrol prepend print_random_addresses project projection purge pwhermite quadrant quadraticroots quantize quarticroots quotient radialshade radians radicalcenter radicalline radius rand randompath rd read1 read2 read3 readline realmult realquarticroots rectangle rectangular rectify reflect relabscissa relative relativedistance reldir relpoint reltime remainder remark removeDuplicates rename replace report rescale rescale2 resetdefaultpen restore restoredefaults reverse reversevideo rf rfind rgb rgba rgbint rmf rms rotate rotateO rotation round roundbox roundedpath roundrectangle samecoordsys sameside sample save savedefaults saveline scale scale3 scaleO scaleT scaleless scientific search searchtree sec secondaryX secondaryY seconds section sector seek seekeof segment sequence setpens sgn sgnd sharpangle sharpdegrees shift shiftless shipout shipout3 show side simeq simpson sin single sinh size size3 skewness skip slant sleep slope slopefield solve sort sourceline sphere split sqrt square srand standardizecoordsys startScript startTrembling stdev step stickframe stickmarksize stickmarkspace stop straight straightness string stripdirectory stripextension stripfile strokepath subdivide subitem subpath substr sum surface symmedial symmedian system tab tableau tan tangent tangential tangents tanh tell tensionSpecifier tensorshade tex texcolor texify texpath texpreamble texreset texshipout textpath thick thin tick tickMax tickMax3 tickMin tickMin3 ticklabelshift ticklocate tildeframe tildemarksize tile tiling time times title titlepage topbox transform transformation transpose tremble trembleFuzz tremble_circlenodesnumber tremble_circlenodesnumber1 tremble_draw tremble_ellipsenodesnumber tremble_ellipsenodesnumber1 tremble_hyperbolanodesnumber tremble_marknodes tremble_markuniform tremble_parabolanodesnumber triangle triangleAbc triangleabc triangulate tricoef tridiagonal trilinear trim trueMagnetize truepoint tube uncycle unfill uniform unit unitrand unitsize unityroot unstraighten upcase updatefunction upscale uptodate usepackage usersetting usleep value variance variancebiased vbox vector vectorfield verbatim view vline vprojection windingnumber word write xaxis xaxis3 xaxis3At xaxisAt xequals xinput xlimits xoutput xpart xscale xscaleO xtick xtick3 xtrans yaxis yaxis3 yaxis3At yaxisAt yequals ylimits ypart yscale yscaleO ytick ytick3 ytrans zaxis3 zaxis3At zero zero3 zlimits zpart ztick ztick3 ztrans )) (defvar asy-variable-name '( AliceBlue Align Allow AntiqueWhite Apricot Aqua Aquamarine Aspect Azure BeginPoint Beige Bisque Bittersweet Black BlanchedAlmond Blue BlueGreen BlueViolet Both Break BrickRed Brown BurlyWood BurntOrange CCW CW CadetBlue CarnationPink Center Centered Cerulean Chartreuse Chocolate Coral CornflowerBlue Cornsilk Crimson Crop Cyan Dandelion DarkBlue DarkCyan DarkGoldenrod DarkGray DarkGreen DarkKhaki DarkMagenta DarkOliveGreen DarkOrange DarkOrchid DarkRed DarkSalmon DarkSeaGreen DarkSlateBlue DarkSlateGray DarkTurquoise DarkViolet DeepPink DeepSkyBlue DefaultHead DimGray DodgerBlue Dotted Draw E ENE EPS ESE Emerald EndPoint Fill FillDraw FireBrick FloralWhite ForestGreen Fuchsia Gainsboro GhostWhite Gold Goldenrod Gray Green GreenYellow Honeydew HookHead Horizontal HotPink I IgnoreAspect IndianRed Indigo Ivory JOIN_IN JOIN_OUT JungleGreen Khaki Label Lavender LavenderBlush LawnGreen LeftJustified LeftSide LemonChiffon LightBlue LightCoral LightCyan LightGoldenrodYellow LightGreen LightGrey LightPink LightSalmon LightSeaGreen LightSkyBlue LightSlateGray LightSteelBlue LightYellow Lime LimeGreen Linear Linen Log Logarithmic Magenta Mahogany Mark MarkFill Maroon Max MediumAquamarine MediumBlue MediumOrchid MediumPurple MediumSeaGreen MediumSlateBlue MediumSpringGreen MediumTurquoise MediumVioletRed Melon MidPoint MidnightBlue Min MintCream MistyRose Moccasin Move MoveQuiet Mulberry N NE NNE NNW NW NavajoWhite Navy NavyBlue NoAlign NoCrop NoFill NoSide OldLace Olive OliveDrab OliveGreen Orange OrangeRed Orchid Ox Oy PaleGoldenrod PaleGreen PaleTurquoise PaleVioletRed PapayaWhip Peach PeachPuff Periwinkle Peru PineGreen Pink Plum PowderBlue ProcessBlue Purple RawSienna Red RedOrange RedViolet Rhodamine RightJustified RightSide RosyBrown RoyalBlue RoyalPurple RubineRed S SE SSE SSW SW SaddleBrown Salmon SandyBrown SeaGreen Seashell Sepia Sienna Silver SimpleHead SkyBlue SlateBlue SlateGray Snow SpringGreen SteelBlue Suppress SuppressQuiet Tan TeXHead Teal TealBlue Thistle Ticksize Tomato Turquoise UnFill VERSION Value Vertical Violet VioletRed W WNW WSW Wheat White WhiteSmoke WildStrawberry XYAlign YAlign Yellow YellowGreen YellowOrange addpenarc addpenline align allowstepping angularsystem animationdelay appendsuffix arcarrowangle arcarrowfactor arrow2sizelimit arrowangle arrowbarb arrowdir arrowfactor arrowhookfactor arrowlength arrowsizelimit arrowtexfactor authorpen axis axiscoverage axislabelfactor background backgroundcolor backgroundpen barfactor barmarksizefactor basealign baselinetemplate beveljoin bigvertexpen bigvertexsize black blue bm bottom bp brown bullet byfoci byvertices camerafactor chartreuse circlemarkradiusfactor circlenodesnumberfactor circleprecision circlescale cm codefile codepen codeskip colorPen coloredNodes coloredSegments conditionlength conicnodesfactor count cputimeformat crossmarksizefactor currentcoordsys currentpatterns currentpen currentpicture currentposition currentprojection curvilinearsystem cuttings cyan darkblue darkbrown darkcyan darkgray darkgreen darkgrey darkmagenta darkolive darkred dashdotted dashed datepen dateskip debuggerlines debugging deepblue deepcyan deepgray deepgreen deepgrey deepmagenta deepred default defaultS defaultbackpen defaultcoordsys defaultfilename defaultformat defaultmassformat defaultpen diagnostics differentlengths dot dotfactor dotframe dotted doublelinepen doublelinespacing down ellipsenodesnumberfactor eps epsgeo epsilon evenodd extendcap fermionpen figureborder figuremattpen firstnode firststep foregroundcolor fuchsia fuzz gapfactor ghostpen gluonamplitude gluonpen gluonratio gray green grey hatchepsilon havepagenumber heavyblue heavycyan heavygray heavygreen heavygrey heavymagenta heavyred hline hwratio hyperbolanodesnumberfactor identity4 ignore inXasyMode inch inches includegraphicscommand incommensurate inf infinity institutionpen intMax intMin invert invisible itempen itemskip itemstep labelmargin landscape lastnode left legendhskip legendlinelength legendmargin legendmarkersize legendmaxrelativewidth legendvskip lightblue lightcyan lightgray lightgreen lightgrey lightmagenta lightolive lightred lightyellow linemargin longdashdotted longdashed magenta magneticPoints magneticRadius mantissaBits markangleradius markangleradiusfactor markanglespace markanglespacefactor mediumblue mediumcyan mediumgray mediumgreen mediumgrey mediummagenta mediumred mediumyellow middle minDistDefault minblockheight minblockwidth mincirclediameter minipagemargin minipagewidth minvertexangle miterjoin mm momarrowfactor momarrowlength momarrowmargin momarrowoffset momarrowpen monoPen morepoints nCircle newbulletcolor ngraph nil nmesh nobasealign nodeMarginDefault nodesystem nomarker nopoint noprimary nullpath nullpen numarray oldbulletcolor olive orange origin overpaint page pageheight pagemargin pagenumberalign pagenumberpen pagenumberposition pagewidth paleblue palecyan palegray palegreen palegrey palemagenta palered paleyellow parabolanodesnumberfactor perpfactor phi photonamplitude photonpen photonratio pi pink plain plus preamblenodes pt purple r3 r4a r4b randMax realDigits realEpsilon realMax realMin red relativesystem reverse right roundcap roundjoin royalblue salmon saveFunctions scalarpen sequencereal settings shipped signedtrailingzero solid springgreen sqrtEpsilon squarecap squarepen startposition stdin stdout stepfraction steppagenumberpen stepping stickframe stickmarksizefactor stickmarkspacefactor textpen ticksize tildeframe tildemarksizefactor tinv titlealign titlepagepen titlepageposition titlepen titleskip top trailingzero treeLevelStep treeMinNodeWidth treeNodeStep trembleAngle trembleFrequency trembleRandom tremblingMode undefined unitcircle unitsquare up urlpen urlskip version vertexpen vertexsize viewportsize vline white wye xformStack yellow ylabelwidth zerotickfuzz zerowinding )) diff --git a/Build/source/utils/asymptote/asymptote.spec b/Build/source/utils/asymptote/asymptote.spec index c8138f9e553..460404a4054 100644 --- a/Build/source/utils/asymptote/asymptote.spec +++ b/Build/source/utils/asymptote/asymptote.spec @@ -1,7 +1,7 @@ %{!?_texmf: %define _texmf %(eval "echo `kpsewhich -expand-var '$TEXMFLOCAL'`")} Name: asymptote -Version: 1.72 +Version: 1.73 Release: 1%{?dist} Summary: Descriptive vector graphics language diff --git a/Build/source/utils/asymptote/base/geometry.asy b/Build/source/utils/asymptote/base/geometry.asy index a4860557e1f..12e35339dcc 100644 --- a/Build/source/utils/asymptote/base/geometry.asy +++ b/Build/source/utils/asymptote/base/geometry.asy @@ -1,20 +1,21 @@ -// Copyright (c) 2007, Philippe Ivaldi. -// Version: : geometry.asy,v 0.1 2007/09/01 Philippe Ivaldi Exp $ +// geometry.asy -// This program is free software; you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation; either version 3 of the License, or (at -// your option) any later version. +// Copyright (C) 2007 +// Author: Philippe IVALDI 2007/09/01 + +// This program 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 3 of the License, or +// (at your option) any later version. // This program is distributed in the hope that it will be useful, but -// WITHOUT ANY WARRANTY; without even the implied warranty of +// WITHOUT ANY WARRANTY ; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// General Public License for more details. +// Lesser General Public License for more details. -// You should have received a copy of the GNU General Public License -// along with this program; if not, write to the Free Software -// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA -// 02110-1301, USA. +// You should have received a copy of the GNU Lesser General Public License +// along with this program ; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // COMMENTARY: // An Asymptote geometry module. @@ -54,10 +55,10 @@ void addMargins(picture pic=currentpicture, real approximate(real t) { - real ot=t; - if(abs(t-ceil(t)) < epsgeo) ot=ceil(t); - else if(abs(t-floor(t)) < epsgeo) ot=floor(t); - return ot; + real ot=t; + if(abs(t-ceil(t)) < epsgeo) ot=ceil(t); + else if(abs(t-floor(t)) < epsgeo) ot=floor(t); + return ot; } real[] approximate(real[] T) @@ -151,7 +152,7 @@ real rd(real x, real y, real z) ed=ea-6*eb; ee=ed+ec+ec; return 3*sum+fac*(1.0+ed*(-C1+C5*ed-C6*delz*ee) - +delz*(C2*ee+delz*(-C3*ec+delz*C4*ea)))/(ave*sqrt(ave)); + +delz*(C2*ee+delz*(-C3*ec+delz*C4*ea)))/(ave*sqrt(ave)); } /**/ @@ -166,7 +167,7 @@ real elle(real phi, real k) cc=cos(phi)^2; q=(1-s*k)*(1+s*k); result=s*(rf(cc,q,1)-(s*k)^2*rd(cc,q,1)/3); - } else + } else if (phi <= pi && phi >= 0) { result=2*elle(pi/2,k)-elle(pi-phi,k); } else @@ -218,9 +219,9 @@ pair[] intersectionpoints(pair A, pair B, real[] equation) {/*Return the intersection points of the line AB with the conic whose an equation is equation[0]*x^2+equation[1]*x*y+equation[2]*y^2+equation[3]*x+equation[4]*y+equation[5]=0*/ - if(equation.length != 6) abort("intersectionpoints: bad length of array for a conic equation."); - return intersectionpoints(A, B, equation[0], equation[1], equation[2], - equation[3], equation[4], equation[5]); + if(equation.length != 6) abort("intersectionpoints: bad length of array for a conic equation."); + return intersectionpoints(A, B, equation[0], equation[1], equation[2], + equation[3], equation[4], equation[5]); } // *........................HEADER.........................* // *=======================================================* @@ -314,13 +315,13 @@ coordsys cartesiansystem(pair O=(0,0), pair i, pair j) { return O+(P[0][0]*m.x+P[0][1]*m.y,P[1][0]*m.x+P[1][1]*m.y); } - + pair dtr(pair m) { m-=O; return (iP[0][0]*m.x+iP[0][1]*m.y,iP[1][0]*m.x+iP[1][1]*m.y); } - + pair polar(real r, real a) { real ca=sin(ij-a)/(ni*sin(ij)); @@ -382,7 +383,7 @@ pair operator *(coordsys R, pair p) /**/ path operator *(coordsys R, path g) {/*Return the reconstructed path applying R*pair to each node, pre and post control point of 'g'.*/ - guide og=point(g,0); + guide og=R*point(g,0); real l=length(g); for(int i=1; i <= l; ++i) { @@ -498,7 +499,7 @@ The operation will be done relatively to the default coordinate system."); /**/ point[] standardizecoordsys(coordsys R=currentcoordsys, - bool warn=true ... point[] M) + bool warn=true ... point[] M) {/*Return the points with the same coordinate system 'R'. If 'warn' is true and the coordinate systems are different, a warning is sent.*/ point[] op=new point[]; @@ -1078,9 +1079,9 @@ vector conj(explicit vector u) /**/ transform rotate(explicit vector dir) {/*A rotation in the direction 'dir' limited to [-90,90] -This is useful for rotating text along a line in the direction dir. -rotate(explicit point dir) is also defined. -*/ + This is useful for rotating text along a line in the direction dir. + rotate(explicit point dir) is also defined. + */ return rotate(locate(dir)); } transform rotate(explicit point dir){return rotate(locate(vector(dir)));} @@ -1312,7 +1313,7 @@ void perpendicularmark(picture pic=currentpicture, point z, g=margin(g,p).g; draw(apic,g,p); if(filltype != NoFill) filltype.fill(apic,(relpoint(g,0)-relpoint(g,0.5)+ - relpoint(g,1))--g--cycle,p+solid); + relpoint(g,1))--g--cycle,p+solid); add(pic,apic,locate(z)); } @@ -2304,8 +2305,8 @@ void markangle(picture pic=currentpicture, /**/ void perpendicularmark(picture pic=currentpicture, line l1, line l2, - real size=0, pen p=currentpen, int quarter=1, - margin margin=NoMargin, filltype filltype=NoFill) + real size=0, pen p=currentpen, int quarter=1, + margin margin=NoMargin, filltype filltype=NoFill) {/*Draw a right angle at the intersection point of lines and aligned in the 'quarter' nth quarter of circle formed by 'l1.u' and 'l2.u'.*/ @@ -2956,16 +2957,16 @@ ellipse ellipse(point C, real a, real b, real angle=0) angle+=degrees(R.i); if(a < b) {angle += 90; real tmp=a; a=b; b=tmp;} if(finite(a) && finite(b)) { - real c=sqrt(abs(a^2-b^2)); - point f1, f2; - if(abs(a-b) < epsgeo) { - f1=C; f2=C; - } else { - f1=point(R,(locate(C)+rotate(angle)*(-c,0))/R); - f2=point(R,(locate(C)+rotate(angle)*(c,0))/R); - } - oe.init(f1,f2,a); + real c=sqrt(abs(a^2-b^2)); + point f1, f2; + if(abs(a-b) < epsgeo) { + f1=C; f2=C; } else { + f1=point(R,(locate(C)+rotate(angle)*(-c,0))/R); + f2=point(R,(locate(C)+rotate(angle)*(c,0))/R); + } + oe.init(f1,f2,a); + } else { if(finite(b) || !finite(a)) oe.init(C,C+R.polar(1,angle),infinity); else oe.init(C,C+R.polar(1,90+angle),infinity); } @@ -5000,9 +5001,9 @@ arc operator *(real x, explicit arc a) {/*Provide real*arc. Return the arc subtracting and adding '(x-1)*degrees(a)/2' to 'a.angle1' and 'a.angle2' respectively.*/ real a1, a2, gle; - gle=(x-1)*degrees(a)/2; - a1=a.angle1-gle; - a2=a.angle2+gle; + gle=(x-1)*degrees(a)/2; + a1=a.angle1-gle; + a2=a.angle2+gle; arc oa; oa.init(a.el,a.angle0,a1,a2,a.polarconicroutine,a.direction); return oa; @@ -6232,11 +6233,11 @@ point[] intersectionpoints(triangle t, line l, bool extended=false) } } if(extended) { - for (int i=0; i < 3; ++i) { + for (int i=1; i <= 3; ++i) { addpoint(intersectionpoint(t.line(i),l)); } } else { - for (int i=0; i < 3; ++i) { + for (int i=1; i <= 3; ++i) { addpoint(intersectionpoint((segment)t.line(i),l)); } } @@ -6486,6 +6487,8 @@ circle operator *(inversion i, circle c) // *.......................INVERSIONS......................* // *=======================================================* +// *=======================================================* +// *........................FOOTER.........................* /**/ point[] intersectionpoints(line l, circle c) {/*Note that the line 'l' may be a segment by casting. @@ -6534,7 +6537,7 @@ point[] intersectionpoints(line l, ellipse el) (perpendicular(ll,line(ell.F1,Ip[0])) || perpendicular(ll,line(ell.F2,Ip[0])))) { // http://www.mathcurve.com/courbes2d/ellipse/ellipse.shtml - // Définition tangentielle par antipodaire de cercle. + // Définition tangentielle par antipodaire de cercle. // 'l' is a tangent of 'el' transform t=scale(el.a/el.b,el.F1,el.F2,el.C,rotate(90,el.C)*el.F1); point inter=inverse(t)*intersectionpoints(C,t*ll)[0]; @@ -6664,11 +6667,11 @@ point[] intersectionpoints(triangle t, conic co, bool extended=false) if(!exist) OP.push(P[i]); }}} if(extended) { - for (int i=0; i < 3; ++i) { + for (int i=1; i <= 3; ++i) { addpoint(intersectionpoints(t.line(i),co)); } } else { - for (int i=0; i < 3; ++i) { + for (int i=1; i <= 3; ++i) { addpoint(intersectionpoints((segment)t.line(i),co)); } } @@ -6919,14 +6922,14 @@ line[] tangents(hyperbola h, point M) point Mp=changecoordsys(cano,M); real x0=Mp.x, y0=Mp.y; if(abs(x0) > epsgeo) { - real c0=a*y0^2/(b*x0)^2-1/b, - c1=2*a*y0/(b*x0^2), c2=a/x0^2-1; - real[] sol=quadraticroots(c0,c1,c2); - for (real y:sol) { - point tmp=changecoordsys(coordsys(h), point(cano,(a*(1+y*y0/b)/x0,y))); - ol.push(line(M,tmp)); - } - } else if(abs(y0) > epsgeo) { + real c0=a*y0^2/(b*x0)^2-1/b, + c1=2*a*y0/(b*x0^2), c2=a/x0^2-1; + real[] sol=quadraticroots(c0,c1,c2); + for (real y:sol) { + point tmp=changecoordsys(coordsys(h), point(cano,(a*(1+y*y0/b)/x0,y))); + ol.push(line(M,tmp)); + } + } else if(abs(y0) > epsgeo) { real y=-b/y0, x=sqrt(a*(1+b/y0^2)); ol.push(line(M,changecoordsys(coordsys(h),point(cano,(x,y))))); ol.push(line(M,changecoordsys(coordsys(h),point(cano,(-x,y))))); diff --git a/Build/source/utils/asymptote/base/graph.asy b/Build/source/utils/asymptote/base/graph.asy index a778dd89261..805cf15f612 100644 --- a/Build/source/utils/asymptote/base/graph.asy +++ b/Build/source/utils/asymptote/base/graph.asy @@ -2135,17 +2135,25 @@ picture vectorfield(path vector(real), path g, int n, bool truesize=false, return pic; } +real maxlength(pair a, pair b, int nx, int ny) +{ + return min((b.x-a.x)/nx,(b.y-a.y)/ny); +} + +// return a vector field over box(a,b). picture vectorfield(path vector(pair), pair a, pair b, - int nx=nmesh, int ny=nx, - bool autoscale=true, bool truesize=false, - pen p=currentpen, arrowbar arrow=Arrow, - margin margin=PenMargin) + int nx=nmesh, int ny=nx, bool truesize=false, + real maxlength=truesize ? 0 : maxlength(a,b,nx,ny), + bool cond(pair z)=null, pen p=currentpen, + arrowbar arrow=Arrow, margin margin=PenMargin) { picture pic; real dx=1/nx; real dy=1/ny; + bool all=cond == null; real scale; - if(autoscale) { + + if(maxlength > 0) { real size(pair z) { path g=vector(z); return abs(point(g,size(g)-1)-point(g,0)); @@ -2156,18 +2164,21 @@ picture vectorfield(path vector(pair), pair a, pair b, for(int j=0; j <= ny; ++j) max=max(max,size((x,interp(a.y,b.y,j*dy)))); } - pair lambda=b-a; - scale=min(lambda.x/nx,lambda.y/ny)/max; + scale=max > 0 ? maxlength/max : 1; } else scale=1; + for(int i=0; i <= nx; ++i) { real x=interp(a.x,b.x,i*dx); for(int j=0; j <= ny; ++j) { real y=interp(a.y,b.y,j*dy); pair z=(x,y); - if(truesize) - draw(z,pic,vector(z),p,arrow); - else - draw(pic,shift(z)*scale(scale)*vector(z),p,arrow,margin); + if(all || cond(z)) { + path g=scale(scale)*vector(z); + if(truesize) + draw(z,pic,g,p,arrow); + else + draw(pic,shift(z)*g,p,arrow,margin); + } } } return pic; diff --git a/Build/source/utils/asymptote/base/graph3.asy b/Build/source/utils/asymptote/base/graph3.asy index 43bf62d26ca..a1c8258638f 100644 --- a/Build/source/utils/asymptote/base/graph3.asy +++ b/Build/source/utils/asymptote/base/graph3.asy @@ -1823,35 +1823,51 @@ void draw(picture pic=currentpicture, Label[] L=new Label[], draw(pic,L,g,sequence(new pen(int) {return p;},g.length)); } -picture vectorfield(path3 vector(pair z), triple f(pair z), - pair a, pair b, int nx=nmesh, int ny=nx, - bool autoscale=true, pen p=currentpen, +real maxlength(triple f(pair z), pair a, pair b, int nu, int nv) +{ + return min(abs(f((b.x,a.y))-f(a))/nu,abs(f((a.x,b.y))-f(a))/nv); +} + +// return a vector field on a parametric surface f over box(a,b). +picture vectorfield(path3 vector(pair v), triple f(pair z), pair a, pair b, + int nu=nmesh, int nv=nu, bool truesize=false, + real maxlength=truesize ? 0 : maxlength(f,a,b,nu,nv), + bool cond(pair z)=null, pen p=currentpen, arrowbar3 arrow=Arrow3, margin3 margin=PenMargin3) { picture pic; - real dx=1/nx; - real dy=1/ny; + real du=1/nu; + real dv=1/nv; + bool all=cond == null; real scale; - if(autoscale) { + + if(maxlength > 0) { real size(pair z) { path3 g=vector(z); return abs(point(g,size(g)-1)-point(g,0)); } real max=size((0,0)); - for(int i=0; i <= nx; ++i) { - real x=interp(a.x,b.x,i*dx); - for(int j=0; j <= ny; ++j) - max=max(max,size((x,interp(a.y,b.y,j*dy)))); + for(int i=0; i <= nu; ++i) { + real x=interp(a.x,b.x,i*du); + for(int j=0; j <= nv; ++j) + max=max(max,size((x,interp(a.y,b.y,j*dv)))); } - pair lambda=(abs(f((b.x,a.y))-f(a)),abs(f((a.x,b.y))-f(a))); - scale=min(lambda.x/nx,lambda.y/ny)/max; + scale=max > 0 ? maxlength/max : 1; } else scale=1; - for(int i=0; i <= nx; ++i) { - real x=interp(a.x,b.x,i*dx); - for(int j=0; j <= ny; ++j) { - real y=interp(a.y,b.y,j*dy); - pair z=(x,y); - draw(pic,shift(f(z))*scale3(scale)*vector(z),p,arrow,margin); + + for(int i=0; i <= nu; ++i) { + real x=interp(a.x,b.x,i*du); + for(int j=0; j <= nv; ++j) { + pair z=(x,interp(a.y,b.y,j*dv)); + if(all || cond(z)) { + path3 g=scale3(scale)*vector(z); + if(truesize) { + picture opic; + draw(opic,g,p,arrow,margin); + add(pic,opic,f(z)); + } else + draw(pic,shift(f(z))*g,p,arrow,margin); + } } } return pic; diff --git a/Build/source/utils/asymptote/base/plain_Label.asy b/Build/source/utils/asymptote/base/plain_Label.asy index 72f924224d4..77a04deb007 100644 --- a/Build/source/utils/asymptote/base/plain_Label.asy +++ b/Build/source/utils/asymptote/base/plain_Label.asy @@ -563,7 +563,7 @@ frame pack(pair align=2S ... object inset[]) return F; } -path[] texpath(Label L) +path[] texpath(Label L, bool tex=settings.tex != "none") { static string[] stringcache; static pen[] pencache; @@ -582,7 +582,7 @@ path[] texpath(Label L) } if(i == -1) { - g=_texpath(s,p); + g=tex ? _texpath(s,p) : textpath(s,p); stringcache.push(s); pencache.push(p); pathcache.push(g); diff --git a/Build/source/utils/asymptote/base/plain_boxes.asy b/Build/source/utils/asymptote/base/plain_boxes.asy index 6ec7f23c985..7fb82c37c1f 100644 --- a/Build/source/utils/asymptote/base/plain_boxes.asy +++ b/Build/source/utils/asymptote/base/plain_boxes.asy @@ -131,6 +131,6 @@ frame bbox(string prefix="", picture pic=currentpicture, pen p=currentpen, filltype filltype=NoFill) { frame f=pic.fit(prefix,max(pic.xsize-2*xmargin,0),max(pic.ysize-2*ymargin,0)); - box(f,xmargin,ymargin,p,filltype,false); + box(f,xmargin,ymargin,p,filltype,above=false); return f; } diff --git a/Build/source/utils/asymptote/base/three.asy b/Build/source/utils/asymptote/base/three.asy index 2ba6b73abe1..7c76714518a 100644 --- a/Build/source/utils/asymptote/base/three.asy +++ b/Build/source/utils/asymptote/base/three.asy @@ -216,7 +216,7 @@ pair dir(triple v, triple dir, projection P) // perpendicular to the vector camera-target. projection perspective(triple camera, triple up=Z, triple target=O, bool showtarget=true, bool autoadjust=true, - bool center=false) + bool center=autoadjust) { if(camera == target) abort("camera cannot be at target"); @@ -228,16 +228,15 @@ projection perspective(triple camera, triple up=Z, triple target=O, projection perspective(real x, real y, real z, triple up=Z, triple target=O, bool showtarget=true, bool autoadjust=true, - bool center=false) + bool center=autoadjust) { return perspective((x,y,z),up,target,showtarget,autoadjust,center); } projection orthographic(triple camera, triple up=Z, triple target=O, - bool showtarget=true, bool autoadjust=true, - bool center=false) + bool showtarget=true, bool center=false) { - return projection(camera,up,target,showtarget,autoadjust,center, + return projection(camera,up,target,showtarget,center=center, new transformation(triple camera, triple up, triple target) { return transformation(look(camera,up,target));}); @@ -245,9 +244,9 @@ projection orthographic(triple camera, triple up=Z, triple target=O, projection orthographic(real x, real y, real z, triple up=Z, triple target=O, bool showtarget=true, - bool autoadjust=true, bool center=false) + bool center=false) { - return orthographic((x,y,z),up,target,showtarget,autoadjust,center); + return orthographic((x,y,z),up,target,showtarget,center=center); } projection oblique(real angle=45) @@ -2176,9 +2175,8 @@ private string format(triple v, string sep=" ") return format(v.x)+sep+format(v.y)+sep+format(v.z); } -private string format(pen p) +private string format(real[] c) { - real[] c=colors(rgb(p)); return format((c[0],c[1],c[2])); } @@ -2256,8 +2254,7 @@ string embed3D(string label="", string text=label, string prefix, frame f, string format="", real width=0, real height=0, real angle=30, string options="", string script="", - pen background=white, light light=currentlight, - projection P=currentprojection) + light light=currentlight, projection P=currentprojection) { if(!prc(format) || Embed == null) return ""; @@ -2302,7 +2299,7 @@ string embed3D(string label="", string text=label, string prefix, ",3Dcoo="+format(P.target/cm)+ ",3Droll="+format(roll)+ ",3Droo="+format(abs(v))+ - ",3Dbg="+format(background); + ",3Dbg="+format(light.background()); if(options != "") options3 += ","+options; if(name != "") options3 += ",3Djscript="+stripdirectory(name); @@ -2315,14 +2312,13 @@ object embed(string label="", string text=label, frame f, string format="", real width=0, real height=0, real angle=30, string options="", string script="", - pen background=white, light light=currentlight, - projection P=currentprojection) + light light=currentlight, projection P=currentprojection) { object F; if(is3D(format)) F.L=embed3D(label,text,prefix,f,format,width,height,angle,options,script, - background,light,P); + light,P); else F.f=f; return F; @@ -2333,7 +2329,7 @@ object embed(string label="", string text=label, picture pic, string format="", real xsize=pic.xsize, real ysize=pic.ysize, bool keepAspect=pic.keepAspect, bool view=true, string options="", - string script="", real angle=0, pen background=white, + string script="", real angle=0, light light=currentlight, projection P=currentprojection) { object F; @@ -2348,7 +2344,7 @@ object embed(string label="", string text=label, projection P=P.copy(); - if(!P.autoadjust && !P.absolute && P.showtarget) + if(!P.absolute && P.showtarget) draw(pic,P.target,nullpen); transform3 t=pic.scaling(xsize3,ysize3,zsize3,keepAspect,warn); @@ -2359,18 +2355,11 @@ object embed(string label="", string text=label, if(!P.absolute) { P=t*P; - if(P.autoadjust || P.center) { + if(P.center) { bool recalculate=false; - if(P.center || P.target.x < m.x || - P.target.y < m.y || - P.target.z < m.z || - P.target.x > M.x || - P.target.y > M.y || - P.target.z > M.z) { - P.target=0.5*(m+M); - recalculate=true; - if(!P.center) write("adjusting target to ",tinv*P.target); - } + triple target=0.5*(m+M); + P.target=target; + recalculate=true; if(recalculate) P.calculate(); } if(P.autoadjust || P.infinity) @@ -2421,9 +2410,7 @@ object embed(string label="", string text=label, if(P.autoadjust || P.infinity) adjusted=adjusted | P.adjust(min3(f),max3(f)); - if(adjusted && !P.infinity) - write("adjusting camera to ",tinv*P.camera); - + triple target=P.target; modelview=P.modelview(); f=modelview*f; P=modelview*P; @@ -2436,9 +2423,11 @@ object embed(string label="", string text=label, triple s=(-0.5(m.x+M.x),-0.5*(m.y+M.y),0); f=shift(s)*f; // Eye will be at (0,0,0). } else { + transform3 T=identity4; // Choose the angle to be just large enough to view the entire image: + if(angle == 0) angle=P.angle; int maxiterations=100; - if(is3D && angle == 0 && !P.infinity) { + if(is3D && angle == 0) { real h=-0.5*P.target.z; pair r,R; real diff=realMax; @@ -2448,20 +2437,45 @@ object embed(string label="", string text=label, r=minratio(f); R=maxratio(f); pair lasts=s; - s=r+R; - transform3 t=shift(h*s.x,h*s.y,0); - f=t*f; - P=t*P; + if(P.autoadjust) { + s=r+R; + transform3 t=shift(h*s.x,h*s.y,0); + f=t*f; + T=t*T; + adjusted=true; + } diff=abs(s-lasts); ++i; } while (diff > angleprecision && i < maxiterations); - real aspect=width > 0 ? height/width : 1; - angle=anglefactor*max(aTan(-r.x*aspect)+aTan(R.x*aspect), - aTan(-r.y)+aTan(R.y)); + real rx=-r.x*aspect; + real Rx=R.x*aspect; + real ry=-r.y; + real Ry=R.y; + if(!P.autoadjust) { + if(rx > Rx) Rx=rx; + else rx=Rx; + if(ry > Ry) Ry=ry; + else ry=Ry; + } + + angle=anglefactor*max(aTan(rx)+aTan(Rx),aTan(ry)+aTan(Ry)); if(viewportmargin.y != 0) angle=2*aTan(Tan(0.5*angle)-viewportmargin.y/P.target.z); + + modelview=T*modelview; } + if(settings.verbose > 0) { + transform3 inv=inverse(modelview); + if(adjusted) + write("adjusting camera to ",tinv*inv*P.camera); + target=inv*P.target; + } + P=T*P; + } + if(settings.verbose > 0) { + if(P.center || (!P.infinity && P.autoadjust)) + write("adjusting target to ",tinv*target); } } @@ -2483,7 +2497,6 @@ object embed(string label="", string text=label, modelview=P.modelview(); f=modelview*f; P=modelview*P; - angle=P.angle; m=min3(f); M=max3(f); real r=0.5*abs(M-m); @@ -2510,7 +2523,7 @@ object embed(string label="", string text=label, shipout3(prefix,f,preview ? nativeformat() : format, width+2*viewportmargin.x,height+2*viewportmargin.y, P.infinity ? 0 : angle,m,M, - tinv*inverse(modelview)*shift(0,0,zcenter), + tinv*inverse(modelview)*shift(0,0,zcenter),light.background(), P.absolute ? (modelview*light).position : light.position, light.diffuse,light.ambient,light.specular, light.viewport,view && !preview); @@ -2526,7 +2539,7 @@ object embed(string label="", string text=label, image=graphic(image); } if(prc) F.L=embed3D(label,text=image,prefix,f,format, - width,height,angle,options,script,background,light, + width,height,angle,options,script,light, P.absolute ? P : Q); } @@ -2562,13 +2575,15 @@ currentpicture.fitter=new frame(string prefix, picture pic, string format, if(!keep) file3.push(prefix+"."+format); } object F=embed(prefix=prefix,pic,format,xsize,ysize,keepAspect,view, - options,script,P); + options,script,currentlight,P); if(prc) label(f,F.L); else { - if(settings.render == 0) + if(settings.render == 0) { add(f,F.f); - else if(!view) + if(currentlight.background != nullpen) + box(f,currentlight.background,Fill,above=false); + } else if(!view) label(f,graphic(prefix)); } } diff --git a/Build/source/utils/asymptote/base/three_light.asy b/Build/source/utils/asymptote/base/three_light.asy index 388c344895a..54ca7a47151 100644 --- a/Build/source/utils/asymptote/base/three_light.asy +++ b/Build/source/utils/asymptote/base/three_light.asy @@ -79,6 +79,7 @@ struct light { real[][] diffuse; real[][] ambient; real[][] specular; + pen background; // Background color of the 3D canvas. real specularfactor; bool viewport; // Are the lights specified (and fixed) in the viewport frame? triple[] position; // Only directional lights are implemented. @@ -89,12 +90,14 @@ struct light { void operator init(pen[] diffuse=array(position.length,white), pen[] ambient=array(position.length,black), - pen[] specular=diffuse, real specularfactor=1, + pen[] specular=diffuse, pen background=nullpen, + real specularfactor=1, bool viewport=true, triple[] position) { this.position=new triple[position.length]; this.diffuse=new real[position.length][]; this.ambient=new real[position.length][]; this.specular=new real[position.length][]; + this.background=background; for(int i=0; i < position.length; ++i) { this.position[i]=unit(position[i]); this.diffuse[i]=rgba(diffuse[i]); @@ -106,22 +109,24 @@ struct light { } void operator init(pen diffuse=white, pen ambient=black, pen specular=diffuse, - real specularfactor=1, + pen background=nullpen, real specularfactor=1, bool viewport=true...triple[] position) { int n=position.length; operator init(array(n,diffuse),array(n,ambient),array(n,specular), - specularfactor,viewport,position); + background,specularfactor,viewport,position); } void operator init(pen diffuse=white, pen ambient=black, pen specular=diffuse, - bool viewport=true, real x, real y, real z) { - operator init(diffuse,ambient,specular,viewport,(x,y,z)); + pen background=nullpen, bool viewport=true, + real x, real y, real z) { + operator init(diffuse,ambient,specular,background,viewport,(x,y,z)); } void operator init(explicit light light) { diffuse=copy(light.diffuse); ambient=copy(light.ambient); specular=copy(light.specular); + background=light.background; specularfactor=light.specularfactor; viewport=light.viewport; position=copy(light.position); @@ -147,6 +152,8 @@ struct light { } return rgb(p[0],p[1],p[2])+opacity(opacity(m.diffuse())); } + + real[] background() {return rgba(background == nullpen ? white : background);} } light operator * (transform3 t, light light) diff --git a/Build/source/utils/asymptote/base/trembling.asy b/Build/source/utils/asymptote/base/trembling.asy index 6b94317b1c4..fc50ce9b7f5 100644 --- a/Build/source/utils/asymptote/base/trembling.asy +++ b/Build/source/utils/asymptote/base/trembling.asy @@ -1,21 +1,19 @@ // Copyright (c) 2008, Philippe Ivaldi. // trembling.asy: handwriting package for the software Asymptote. -// Last modified: Mon Jul 7 23:35:36 CEST 2008 -// This program is free software; you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation; either version 2 of the License, or (at -// your option) any later version. +// This program 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 3 of the License, or +// (at your option) any later version. // This program is distributed in the hope that it will be useful, but -// WITHOUT ANY WARRANTY; without even the implied warranty of +// WITHOUT ANY WARRANTY ; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// General Public License for more details. +// Lesser General Public License for more details. -// You should have received a copy of the GNU General Public License -// along with this program; if not, write to the Free Software -// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA -// 02110-1301, USA. +// You should have received a copy of the GNU Lesser General Public License +// along with this program ; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // COMMENTARY: diff --git a/Build/source/utils/asymptote/base/version.asy b/Build/source/utils/asymptote/base/version.asy index e8dcc965de5..6f560eb187d 100644 --- a/Build/source/utils/asymptote/base/version.asy +++ b/Build/source/utils/asymptote/base/version.asy @@ -1 +1 @@ -string VERSION="1.72"; +string VERSION="1.73"; diff --git a/Build/source/utils/asymptote/builtin.cc b/Build/source/utils/asymptote/builtin.cc index 5b4ed77b38d..81aa3d15b32 100644 --- a/Build/source/utils/asymptote/builtin.cc +++ b/Build/source/utils/asymptote/builtin.cc @@ -67,7 +67,8 @@ void addFunc(venv &ve, access *a, ty *result, symbol *id, formal f4=noformal, formal f5=noformal, formal f6=noformal, formal f7=noformal, formal f8=noformal, formal f9=noformal, formal fA=noformal, formal fB=noformal, formal fC=noformal, - formal fD=noformal, formal fE=noformal, formal fF=noformal) + formal fD=noformal, formal fE=noformal, formal fF=noformal, + formal fG=noformal) { function *fun = new function(result); @@ -86,6 +87,7 @@ void addFunc(venv &ve, access *a, ty *result, symbol *id, if (fD.t) fun->add(fD); if (fE.t) fun->add(fE); if (fF.t) fun->add(fF); + if (fG.t) fun->add(fG); // NOTE: If the function is a field, we should encode the defining record in // the entry @@ -98,11 +100,11 @@ void addFunc(venv &ve, access *a, ty *result, symbol *id, void addFunc(venv &ve, bltin f, ty *result, const char *name, formal f1, formal f2, formal f3, formal f4, formal f5, formal f6, formal f7, formal f8, formal f9, formal fA, formal fB, - formal fC, formal fD, formal fE, formal fF) + formal fC, formal fD, formal fE, formal fF, formal fG) { access *a = new bltinAccess(f); addFunc(ve,a,result,symbol::trans(name),f1,f2,f3,f4,f5,f6,f7,f8,f9, - fA,fB,fC,fD,fE,fF); + fA,fB,fC,fD,fE,fF,fG); } void addFunc(venv &ve, access *a, ty *result, const char *name, formal f1) diff --git a/Build/source/utils/asymptote/builtin.h b/Build/source/utils/asymptote/builtin.h index 0e54a5fb473..92b415906c3 100644 --- a/Build/source/utils/asymptote/builtin.h +++ b/Build/source/utils/asymptote/builtin.h @@ -32,7 +32,7 @@ void addFunc(venv &ve, vm::bltin f, types::ty *result, const char *name, types::formal f9=noformal, types::formal fA=noformal, types::formal fB=noformal, types::formal fC=noformal, types::formal fD=noformal, types::formal fE=noformal, - types::formal fF=noformal); + types::formal fF=noformal, types::formal fG=noformal); // Adds standard functions for a newly added types. void addArrayOps(venv &ve, types::array *t); diff --git a/Build/source/utils/asymptote/camperror.cc b/Build/source/utils/asymptote/camperror.cc index d92ed7d20fd..8fb782b4154 100644 --- a/Build/source/utils/asymptote/camperror.cc +++ b/Build/source/utils/asymptote/camperror.cc @@ -23,10 +23,7 @@ void reportError(const string& desc) em.runtime(vm::getPos()); em << desc; em.sync(); - try { - throw handled_error(); - } catch(handled_error) { - } + throw handled_error(); } // Used internally to report a warning in an operation. @@ -42,6 +39,7 @@ void reportFatal(const string& desc) em.fatal(vm::getPos()); em << desc; em.sync(); + em.statusError(); try { throw quit(); } catch(handled_error) { diff --git a/Build/source/utils/asymptote/configure b/Build/source/utils/asymptote/configure index bc5b3a38df7..a650b3dbc0d 100755 --- a/Build/source/utils/asymptote/configure +++ b/Build/source/utils/asymptote/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.63 for Asymptote 1.72. +# Generated by GNU Autoconf 2.63 for Asymptote 1.73. # # Report bugs to . # @@ -596,8 +596,8 @@ SHELL=${CONFIG_SHELL-/bin/sh} # Identity of this package. PACKAGE_NAME='Asymptote' PACKAGE_TARNAME='asymptote' -PACKAGE_VERSION='1.72' -PACKAGE_STRING='Asymptote 1.72' +PACKAGE_VERSION='1.73' +PACKAGE_STRING='Asymptote 1.73' PACKAGE_BUGREPORT='http://sourceforge.net/projects/asymptote' # Factoring default headers for most tests. @@ -1288,7 +1288,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures Asymptote 1.72 to adapt to many kinds of systems. +\`configure' configures Asymptote 1.73 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1349,7 +1349,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of Asymptote 1.72:";; + short | recursive ) echo "Configuration of Asymptote 1.73:";; esac cat <<\_ACEOF @@ -1454,7 +1454,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -Asymptote configure 1.72 +Asymptote configure 1.73 generated by GNU Autoconf 2.63 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, @@ -1468,7 +1468,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by Asymptote $as_me 1.72, which was +It was created by Asymptote $as_me 1.73, which was generated by GNU Autoconf 2.63. Invocation command line was $ $0 $@ @@ -11319,7 +11319,7 @@ exec 6>&1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by Asymptote $as_me 1.72, which was +This file was extended by Asymptote $as_me 1.73, which was generated by GNU Autoconf 2.63. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -11378,7 +11378,7 @@ Report bugs to ." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_version="\\ -Asymptote config.status 1.72 +Asymptote config.status 1.73 configured by $0, generated by GNU Autoconf 2.63, with options \\"`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" diff --git a/Build/source/utils/asymptote/configure.ac b/Build/source/utils/asymptote/configure.ac index b2974bd984f..0e84c226bb4 100644 --- a/Build/source/utils/asymptote/configure.ac +++ b/Build/source/utils/asymptote/configure.ac @@ -3,7 +3,7 @@ # this file. AC_PREREQ(2) -AC_INIT([Asymptote],[1.72],[http://sourceforge.net/projects/asymptote]) +AC_INIT([Asymptote],[1.73],[http://sourceforge.net/projects/asymptote]) VERSION=$PACKAGE_VERSION AC_SUBST(VERSION) diff --git a/Build/source/utils/asymptote/doc/FAQ/asy-faq.bfnn b/Build/source/utils/asymptote/doc/FAQ/asy-faq.bfnn index a3095732cfd..ce582954dda 100644 --- a/Build/source/utils/asymptote/doc/FAQ/asy-faq.bfnn +++ b/Build/source/utils/asymptote/doc/FAQ/asy-faq.bfnn @@ -829,12 +829,13 @@ yaxis("$y$",RightTicks); \question 27jun:functioncolor How can I fill a path with a function that defines the color of each location? -General function shading is only supported by PDF, not PostScript, so this -will have to wait until we produce PDF code directly. +Use \courier{functionshade\} with a PDF tex engine, as illustrated +by the example {functionshading.asy}. -An approximate solution for now would be to superimpose a fine grid and -specify colors to latticeshade depending on position as a single pen[][] -lattice. Or use Gouraud shading. +If you want to produce PostScript output, an approximate solution for now +would be to superimpose a fine grid and specify colors to +\courier{latticeshade\} that depend on position as a single pen[][] +lattice. Alternatively, it may be more efficient to use \courier{tensorshade}. \question 27jun:nonexplicitfun Is there a way to draw a function that is not explicitly given, such as (y - 2)^2 = x - 1 ? diff --git a/Build/source/utils/asymptote/doc/asymptote.texi b/Build/source/utils/asymptote/doc/asymptote.texi index 46043c85867..2c4872fd8e7 100644 --- a/Build/source/utils/asymptote/doc/asymptote.texi +++ b/Build/source/utils/asymptote/doc/asymptote.texi @@ -1772,15 +1772,16 @@ length(z); @end example returns the result 5. A synonym for @code{length(pair)} is @code{abs(pair)}; -@item real angle(pair z) +@item real angle(pair z, bool warn=true) @cindex @code{angle} returns the angle of @code{z} in radians in the interval -[-@code{pi},@code{pi}]; +[-@code{pi},@code{pi}] or @code{0} if @code{warn} is @code{false} and +@code{z=(0,0)} (rather than producing an error); @item real degrees(pair z, bool warn=true) @cindex @code{degrees} returns the angle of @code{z} in degrees in the interval [0,360) -or @code{0} if @code{warn} is @code{false} and @code{z.x=z.y=0} (rather than +or @code{0} if @code{warn} is @code{false} and @code{z=(0,0)} (rather than producing an error); @item pair unit(pair z) @@ -1835,25 +1836,33 @@ Here are the built-in functions for triples: returns the length @code{|v|} of the vector @code{v}. A synonym for @code{length(triple)} is @code{abs(triple)}; -@item real polar(triple v) +@item real polar(triple v, bool warn=true) @cindex @code{polar} -returns the colatitude of @code{v} measured from the @math{z} axis in radians; +returns the colatitude of @code{v} measured from the @math{z} axis in radians +or @code{0} if @code{warn} is @code{false} and @code{v=O} (rather than +producing an error); -@item real azimuth(triple v) +@item real azimuth(triple v, bool warn=true) @cindex @code{azimuth} -returns the longitude of @code{v} measured from the @math{x} axis in radians; +returns the longitude of @code{v} measured from the @math{x} axis in radians +or @code{0} if @code{warn} is @code{false} and @code{v.x=v.y=0} (rather than +producing an error); -@item real colatitude(triple v) +@item real colatitude(triple v, bool warn=true) @cindex @code{colatitude} -returns the colatitude of @code{v} measured from the @math{z} axis in degrees; +returns the colatitude of @code{v} measured from the @math{z} axis in degrees +or @code{0} if @code{warn} is @code{false} and @code{v=O} (rather than +producing an error); -@item real latitude(triple v) +@item real latitude(triple v, bool warn=true) @cindex @code{latitude} -returns the latitude of @code{v} measured from the @math{xy} plane in degrees; +returns the latitude of @code{v} measured from the @math{xy} plane in degrees +or @code{0} if @code{warn} is @code{false} and @code{v=O} (rather than +producing an error); @item real longitude(triple v, bool warn=true) @cindex @code{longitude} -returns the longitude of @code{v} measured from the @math{x} axis in degrees; +returns the longitude of @code{v} measured from the @math{x} axis in degrees or @code{0} if @code{warn} is @code{false} and @code{v.x=v.y=0} (rather than producing an error); @@ -3213,16 +3222,18 @@ by calling the @code{shipout} function: @anchor{shipout} @cindex @code{shipout} @verbatim -void shipout(string prefix=defaultfilename, picture pic, - orientation orientation=orientation, - string format="", bool wait=false, bool view=true); -void shipout(string prefix=defaultfilename, +void shipout(string prefix=defaultfilename, picture pic=currentpicture, orientation orientation=orientation, - string format="", bool wait=false, bool view=true); + string format="", bool wait=false, bool view=true, + string options="", string script="", + projection P=currentprojection); @end verbatim @noindent The default output format, @code{PostScript}, may be changed with the @code{-f} or @code{-tex} command-line options. +The @code{options}, @code{script}, and @code{projection} parameters +are only relevant for 3D pictures. + A @code{shipout()} command is added implicitly at file exit if no previous @code{shipout} commands have been executed. @cindex @code{orientation} @@ -5988,11 +5999,11 @@ interpolation in @code{Asymptote}, as illustrated in the example This module, written by Philippe Ivaldi, provides an extensive set of geometry routines, including @code{perpendicular} symbols and a @code{triangle} structure. It is documented here: -@url{http://piprim.tuxfamily.org/asymptote/geometry_en.pdf}, +@url{http://asymptote.sourceforge.net/geometry_en.pdf}, including an extensive set of examples, -@url{http://piprim.tuxfamily.org/asymptote/travaux/}, and an index: +@url{http://piprim.tuxfamily.org/asymptote/geometry/index.html}, and an index: @quotation -@url{http://piprim.tuxfamily.org/asymptote/travaux/modules/geometry_dev.asy.index.type.html} +@url{http://piprim.tuxfamily.org/asymptote/geometry/modules/geometry.asy.index.type.html} @end quotation @node trembling @@ -6001,7 +6012,7 @@ including an extensive set of examples, This module, written by Philippe Ivaldi and illustrated in the example @code{floatingdisk.asy}, allows one to draw wavy lines, as if drawn by hand. Further examples are posted at -@url{http://piprim.tuxfamily.org/asymptote/modules} +@url{http://piprim.tuxfamily.org/asymptote/trembling/index.html} @node stats @section @code{stats} @@ -7103,9 +7114,10 @@ as illustrated in this simple example of a flow field: @cindex @code{vectorfield} @verbatim picture vectorfield(path vector(pair), pair a, pair b, - int nx=nmesh, int ny=nx, - bool autoscale=true, bool truesize=false, - pen p=currentpen, arrowbar arrow=Arrow); + int nx=nmesh, int ny=nx, bool truesize=false, + real maxlength=truesize ? 0 : maxlength(a,b,nx,ny), + bool cond(pair z)=null, pen p=currentpen, + arrowbar arrow=Arrow, margin margin=PenMargin) @end verbatim as illustrated in this example: @verbatiminclude vectorfield.asy @@ -7652,25 +7664,22 @@ positive @math{y} axis is drawn at this angle in degrees. @cindex @code{up} @cindex @code{target} @cindex @code{showtarget} -@cindex @code{autoadjust} @cindex @code{center} -@item orthographic(triple camera, triple up=Z, triple target=O, @*@ @ @ @ @ @ @ @ @ @ @ @ @ bool showtarget=true, bool autoadjust=true, bool center=false) +@item orthographic(triple camera, triple up=Z, triple target=O, @*@ @ @ @ @ @ @ @ @ @ @ @ @ bool showtarget=true, bool center=false) This projects from three to two dimensions using the view as seen at a point infinitely far away in the direction @code{unit(camera)}, orienting the camera so that, if possible, the vector @code{up} points upwards. Parallel lines are projected to parallel lines. The bounding volume is expanded -to include @code{target} if @code{showtarget=true}. If @code{autoadjust=true}, -the camera will automatically be adjusted to lie outside the bounding volume -for all possible interactive rotations about @code{target}. +to include @code{target} if @code{showtarget=true}. If @code{center=true}, the target will be adjusted to the center of the bounding volume. -@item orthographic(real x, real y, real z, triple up=Z, triple target=O, @*@ @ @ @ @ @ @ @ @ @ @ @ @ bool showtarget=true, bool autoadjust=true, bool center=false) +@item orthographic(real x, real y, real z, triple up=Z, triple target=O, @*@ @ @ @ @ @ @ @ @ @ @ @ @ bool showtarget=true, bool center=false) This is equivalent to -@code{orthographic((x,y,z),up,target,showtarget,autoadjust, -center)}. +@code{orthographic((x,y,z),up,target,showtarget,center)}. -@item perspective(triple camera, triple up=Z, triple target=O, @*@ @ @ @ @ @ @ @ @ @ @ @ bool showtarget=true, bool autoadjust=true, bool center=false) +@cindex @code{autoadjust} +@item perspective(triple camera, triple up=Z, triple target=O, @*@ @ @ @ @ @ @ @ @ @ @ @ bool showtarget=true, bool autoadjust=true, @*@ @ @ @ @ @ @ @ @ @ @ @ bool center=autoadjust) @cindex @code{perspective} @cindex @code{NURBS} This projects from three to two dimensions, taking account of @@ -7685,7 +7694,7 @@ for all possible interactive rotations about @code{target}. If @code{center=true}, the target will be adjusted to the center of the bounding volume. -@item perspective(real x, real y, real z, triple up=Z, triple target=O, @*@ @ @ @ @ @ @ @ @ @ @ @ bool showtarget=true, bool autoadjust=true, bool center=false) +@item perspective(real x, real y, real z, triple up=Z, triple target=O, @*@ @ @ @ @ @ @ @ @ @ @ @ bool showtarget=true, bool autoadjust=true, @*@ @ @ @ @ @ @ @ @ @ @ @ bool center=autoadjust) This is equivalent to @code{perspective((x,y,z),up,target,showtarget, autoadjust,center)}. @end table @@ -8055,6 +8064,19 @@ of a Gaussian surface: A mesh can be drawn without surface filling by specifying @code{nullpen} for the surfacepen. +A vector field of @code{nu}@math{\times}@code{nv} arrows on a +parametric surface @code{f} over @code{box(a,b)} can be drawn with the routine +@cindex @code{vectorfield3} +@verbatim +picture vectorfield(path3 vector(pair v), triple f(pair z), pair a, pair b, + int nu=nmesh, int nv=nu, bool truesize=false, + real maxlength=truesize ? 0 : maxlength(f,a,b,nu,nv), + bool cond(pair z)=null, pen p=currentpen, + arrowbar3 arrow=Arrow3, margin3 margin=PenMargin3) +@end verbatim +as illustrated in the examples @code{vectorfield3.asy} and +@code{vectorfieldsphere.asy}. + @node grid3 @section @code{grid3} @cindex @code{grid3} diff --git a/Build/source/utils/asymptote/doc/flowchartdemo.asy b/Build/source/utils/asymptote/doc/flowchartdemo.asy index 74940d92f34..def70d0dd0f 100644 --- a/Build/source/utils/asymptote/doc/flowchartdemo.asy +++ b/Build/source/utils/asymptote/doc/flowchartdemo.asy @@ -19,9 +19,9 @@ draw(block5); add(new void(picture pic, transform t) { draw(pic,path(new pair[]{block1.right(t),block2.top(t)},Horizontal), Arrow,PenMargin); - draw(pic,Label("Yes",0.5),path(new pair[]{block2.left(t),block3.top(t)}, + draw(pic,Label("Yes",0.5,NW),path(new pair[]{block2.left(t),block3.top(t)}, Horizontal),Arrow,PenMargin); - draw(pic,Label("No",0.5,N),path(new pair[]{block2.right(t),block4.top(t)}, + draw(pic,Label("No",0.5,NE),path(new pair[]{block2.right(t),block4.top(t)}, Horizontal),Arrow,PenMargin); draw(pic,path(new pair[]{block3.bottom(t),block5.left(t)},Vertical), Arrow,PenMargin); diff --git a/Build/source/utils/asymptote/examples/teapot.asy b/Build/source/utils/asymptote/examples/teapot.asy index 4b23aecb3b9..e0ef51eb552 100644 --- a/Build/source/utils/asymptote/examples/teapot.asy +++ b/Build/source/utils/asymptote/examples/teapot.asy @@ -2,7 +2,7 @@ import three; size(20cm); -currentprojection=perspective(250,-250,250,center=true); +currentprojection=perspective(250,-250,250); triple[][][] Q={ { diff --git a/Build/source/utils/asymptote/examples/textpath.asy b/Build/source/utils/asymptote/examples/textpath.asy new file mode 100644 index 00000000000..1fc105364be --- /dev/null +++ b/Build/source/utils/asymptote/examples/textpath.asy @@ -0,0 +1,10 @@ +size(300); + +fill(texpath(Label("test",TimesRoman())),pink); +fill(texpath(Label("test",fontcommand('.fam T\n.ps 12')),tex=false),red); + +pair z=10S; + +fill(texpath(Label("$ \sqrt{x^2} $",z,TimesRoman())),pink); +fill(texpath(Label("$ sqrt {x sup 2} $",z,fontcommand('.fam T\n.ps 12')), + tex=false),red); diff --git a/Build/source/utils/asymptote/examples/vectorfield3.asy b/Build/source/utils/asymptote/examples/vectorfield3.asy index b8583c3b8d6..a7bdbdb36c9 100644 --- a/Build/source/utils/asymptote/examples/vectorfield3.asy +++ b/Build/source/utils/asymptote/examples/vectorfield3.asy @@ -8,19 +8,19 @@ currentlight=(1,-1,0.5); real f(pair z) {return abs(z)^2;} path3 gradient(pair z) { - static real dx=sqrt(realEpsilon), dy=dx; + static real dx=sqrtEpsilon, dy=dx; return O--((f(z+dx)-f(z-dx))/2dx,(f(z+I*dy)-f(z-I*dy))/2dy,0); } -pair A=(-1,-1); -pair B=(1,1); +pair a=(-1,-1); +pair b=(1,1); triple F(pair z) {return (z.x,z.y,0);} -add(vectorfield(gradient,F,A,B,red)); +add(vectorfield(gradient,F,a,b,red)); -draw(surface(f,A,B,50),gray+opacity(0.5)); +draw(surface(f,a,b,Spline),gray+opacity(0.5)); xaxis3(XY()*"$x$",OutTicks(XY()*Label)); yaxis3(XY()*"$y$",InTicks(YX()*Label)); -zaxis3("$z$",OutTicks()); +zaxis3("$z$",OutTicks); diff --git a/Build/source/utils/asymptote/examples/vectorfieldsphere.asy b/Build/source/utils/asymptote/examples/vectorfieldsphere.asy new file mode 100644 index 00000000000..2348e09f855 --- /dev/null +++ b/Build/source/utils/asymptote/examples/vectorfieldsphere.asy @@ -0,0 +1,17 @@ +import graph3; + +size(12cm); + +currentprojection=orthographic(1,-2,1); +currentlight=(1,-1,0.5); + +triple f(pair z) {return expi(z.x,z.y);} + +path3 vector(pair z) { + triple v=f(z); + return O--(v.y,v.z,v.x); +} + +add(vectorfield(vector,f,(0,0),(pi,2pi),10,0.25,red)); + +draw(unitsphere,gray+opacity(0.5)); diff --git a/Build/source/utils/asymptote/fileio.h b/Build/source/utils/asymptote/fileio.h index 18ac10207ef..e67d7e96b74 100644 --- a/Build/source/utils/asymptote/fileio.h +++ b/Build/source/utils/asymptote/fileio.h @@ -227,9 +227,8 @@ protected: public: ifile(const string& name, char comment, bool check=true, std::ios::openmode mode=std::ios::in) : - file(name,check), stream(NULL), fstream(NULL), comment(comment), mode(mode), + file(name,check), stream(&cin), fstream(NULL), comment(comment), mode(mode), comma(false) { - stream=&cin; } // Binary file @@ -344,8 +343,7 @@ protected: std::ios::openmode mode; public: ofile(const string& name, std::ios::openmode mode=std::ios::trunc) : - file(name), stream(NULL), fstream(NULL), mode(mode) { - stream=&cout; + file(name), stream(&cout), fstream(NULL), mode(mode) { } ~ofile() {close();} @@ -419,7 +417,7 @@ public: template void iread(T& val) { val=T(); - fstream->read((char *) &val,sizeof(T)); + if(fstream) fstream->read((char *) &val,sizeof(T)); } void Read(bool& val) {iread(val);} @@ -445,7 +443,7 @@ public: template void iwrite(T val) { - fstream->write((char *) &val,sizeof(T)); + if(fstream) fstream->write((char *) &val,sizeof(T)); } void write(bool val) {iwrite(val);} @@ -479,7 +477,7 @@ public: template void iwrite(T val) { - fstream->write((char *) &val,sizeof(T)); + if(fstream) fstream->write((char *) &val,sizeof(T)); } void write(bool val) {iwrite(val);} diff --git a/Build/source/utils/asymptote/glrender.cc b/Build/source/utils/asymptote/glrender.cc index 29136c36358..5979aa708ba 100644 --- a/Build/source/utils/asymptote/glrender.cc +++ b/Build/source/utils/asymptote/glrender.cc @@ -100,6 +100,7 @@ int minimumsize=50; // Minimum initial rendering window width and height const double degrees=180.0/M_PI; const double radians=1.0/degrees; +double *Background; size_t Nlights; triple *Lights; double *Diffuse; @@ -180,6 +181,7 @@ void lighting() void initlighting() { + glClearColor(Background[0],Background[1],Background[2],Background[3]); glEnable(GL_LIGHTING); glLightModeli(GL_LIGHT_MODEL_TWO_SIDE,getSetting("twosided")); @@ -1062,9 +1064,9 @@ void init() void glrender(const string& prefix, const picture *pic, const string& format, double width, double height, double angle, const triple& m, const triple& M, double *t, - size_t nlights, triple *lights, double *diffuse, - double *ambient, double *specular, bool Viewportlighting, - bool view, int oldpid) + double *background, size_t nlights, triple *lights, + double *diffuse, double *ambient, double *specular, + bool Viewportlighting, bool view, int oldpid) { #ifndef __CYGWIN__ Iconify=getSetting("iconify"); @@ -1081,6 +1083,7 @@ void glrender(const string& prefix, const picture *pic, const string& format, Picture=pic; Format=format; T=t; + Background=background; Nlights=min(nlights,(size_t) GL_MAX_LIGHTS); Lights=lights; Diffuse=diffuse; @@ -1230,8 +1233,6 @@ void glrender(const string& prefix, const picture *pic, const string& format, initialized=true; - glClearColor(1.0,1.0,1.0,1.0); - glMatrixMode(GL_MODELVIEW); home(); diff --git a/Build/source/utils/asymptote/glrender.h b/Build/source/utils/asymptote/glrender.h index de906795ff9..e1e6541bc0b 100644 --- a/Build/source/utils/asymptote/glrender.h +++ b/Build/source/utils/asymptote/glrender.h @@ -51,9 +51,9 @@ namespace gl { void glrender(const string& prefix, const camp::picture* pic, const string& format, double width, double height, double angle, const camp::triple& m, const camp::triple& M, - double *t, size_t nlights, camp::triple *lights, double *diffuse, - double *ambient, double *specular, bool viewportlighting, - bool view, int oldpid=0); + double *t, double *background, size_t nlights, + camp::triple *lights, double *diffuse, double *ambient, + double *specular, bool viewportlighting, bool view, int oldpid=0); } #else diff --git a/Build/source/utils/asymptote/install-sh b/Build/source/utils/asymptote/install-sh index 6781b987bdb..08572bfd3c9 100755 --- a/Build/source/utils/asymptote/install-sh +++ b/Build/source/utils/asymptote/install-sh @@ -1,7 +1,7 @@ #!/bin/sh # install - install a program, script, or datafile -scriptversion=2009-04-28.21; # UTC +scriptversion=2006-10-14.15J # This originates from X11R5 (mit/util/scripts/install.sh), which was # later released in X11R6 (xc/config/util/install.sh) with the @@ -48,7 +48,7 @@ IFS=" "" $nl" # set DOITPROG to echo to test this script # Don't use :- since 4.3BSD and earlier shells don't like it. -doit=${DOITPROG-} +doit="${DOITPROG-}" if test -z "$doit"; then doit_exec=exec else @@ -58,49 +58,34 @@ fi # Put in absolute file names if you don't have them in your path; # or use environment vars. -chgrpprog=${CHGRPPROG-chgrp} -chmodprog=${CHMODPROG-chmod} -chownprog=${CHOWNPROG-chown} -cmpprog=${CMPPROG-cmp} -cpprog=${CPPROG-cp} -mkdirprog=${MKDIRPROG-mkdir} -mvprog=${MVPROG-mv} -rmprog=${RMPROG-rm} -stripprog=${STRIPPROG-strip} - -posix_glob='?' -initialize_posix_glob=' - test "$posix_glob" != "?" || { - if (set -f) 2>/dev/null; then - posix_glob= - else - posix_glob=: - fi - } -' +mvprog="${MVPROG-mv}" +cpprog="${CPPROG-cp}" +chmodprog="${CHMODPROG-chmod}" +chownprog="${CHOWNPROG-chown}" +chgrpprog="${CHGRPPROG-chgrp}" +stripprog="${STRIPPROG-strip}" +rmprog="${RMPROG-rm}" +mkdirprog="${MKDIRPROG-mkdir}" +posix_glob= posix_mkdir= # Desired mode of installed file. mode=0755 -chgrpcmd= chmodcmd=$chmodprog chowncmd= -mvcmd=$mvprog -rmcmd="$rmprog -f" +chgrpcmd= stripcmd= - +rmcmd="$rmprog -f" +mvcmd="$mvprog" src= dst= dir_arg= -dst_arg= - -copy_on_change=false +dstarg= no_target_directory= -usage="\ -Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE +usage="Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE or: $0 [OPTION]... SRCFILES... DIRECTORY or: $0 [OPTION]... -t DIRECTORY SRCFILES... or: $0 [OPTION]... -d DIRECTORIES... @@ -110,55 +95,68 @@ In the 2nd and 3rd, copy all SRCFILES to DIRECTORY. In the 4th, create DIRECTORIES. Options: - --help display this help and exit. - --version display version info and exit. - - -c (ignored) - -C install only if different (preserve the last data modification time) - -d create directories instead of installing files. - -g GROUP $chgrpprog installed files to GROUP. - -m MODE $chmodprog installed files to MODE. - -o USER $chownprog installed files to USER. - -s $stripprog installed files. - -t DIRECTORY install into DIRECTORY. - -T report an error if DSTFILE is a directory. +-c (ignored) +-d create directories instead of installing files. +-g GROUP $chgrpprog installed files to GROUP. +-m MODE $chmodprog installed files to MODE. +-o USER $chownprog installed files to USER. +-s $stripprog installed files. +-t DIRECTORY install into DIRECTORY. +-T report an error if DSTFILE is a directory. +--help display this help and exit. +--version display version info and exit. Environment variables override the default commands: - CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG - RMPROG STRIPPROG + CHGRPPROG CHMODPROG CHOWNPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG " while test $# -ne 0; do case $1 in - -c) ;; - - -C) copy_on_change=true;; + -c) shift + continue;; - -d) dir_arg=true;; + -d) dir_arg=true + shift + continue;; -g) chgrpcmd="$chgrpprog $2" - shift;; + shift + shift + continue;; --help) echo "$usage"; exit $?;; -m) mode=$2 + shift + shift case $mode in *' '* | *' '* | *' '* | *'*'* | *'?'* | *'['*) echo "$0: invalid mode: $mode" >&2 exit 1;; esac - shift;; + continue;; -o) chowncmd="$chownprog $2" - shift;; - - -s) stripcmd=$stripprog;; - - -t) dst_arg=$2 - shift;; - - -T) no_target_directory=true;; + shift + shift + continue;; + + -p) shift + continue;; + + -s) stripcmd=$stripprog + shift + continue;; + + -t) dstarg=$2 + shift + shift + continue;; + + -T) no_target_directory=true + shift + continue;; --version) echo "$0 $scriptversion"; exit $?;; @@ -170,22 +168,21 @@ while test $# -ne 0; do *) break;; esac - shift done -if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then +if test $# -ne 0 && test -z "$dir_arg$dstarg"; then # When -d is used, all remaining arguments are directories to create. # When -t is used, the destination is already specified. # Otherwise, the last argument is the destination. Remove it from $@. for arg do - if test -n "$dst_arg"; then + if test -n "$dstarg"; then # $@ is not empty: it contains at least $arg. - set fnord "$@" "$dst_arg" + set fnord "$@" "$dstarg" shift # fnord fi shift # arg - dst_arg=$arg + dstarg=$arg done fi @@ -230,7 +227,7 @@ for src do # Protect names starting with `-'. case $src in - -*) src=./$src;; + -*) src=./$src ;; esac if test -n "$dir_arg"; then @@ -248,22 +245,22 @@ do exit 1 fi - if test -z "$dst_arg"; then + if test -z "$dstarg"; then echo "$0: no destination specified." >&2 exit 1 fi - dst=$dst_arg + dst=$dstarg # Protect names starting with `-'. case $dst in - -*) dst=./$dst;; + -*) dst=./$dst ;; esac # If destination is a directory, append the input filename; won't work # if double slashes aren't ignored. if test -d "$dst"; then if test -n "$no_target_directory"; then - echo "$0: $dst_arg: Is a directory" >&2 + echo "$0: $dstarg: Is a directory" >&2 exit 1 fi dstdir=$dst @@ -384,19 +381,26 @@ do # directory the slow way, step by step, checking for races as we go. case $dstdir in - /*) prefix='/';; - -*) prefix='./';; - *) prefix='';; + /*) prefix=/ ;; + -*) prefix=./ ;; + *) prefix= ;; esac - eval "$initialize_posix_glob" + case $posix_glob in + '') + if (set -f) 2>/dev/null; then + posix_glob=true + else + posix_glob=false + fi ;; + esac oIFS=$IFS IFS=/ - $posix_glob set -f + $posix_glob && set -f set fnord $dstdir shift - $posix_glob set +f + $posix_glob && set +f IFS=$oIFS prefixes= @@ -458,54 +462,41 @@ do # ignore errors from any of these, just make sure not to ignore # errors from the above "$doit $cpprog $src $dsttmp" command. # - { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } && - { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } && - { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } && - { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } && - - # If -C, don't bother to copy if it wouldn't change the file. - if $copy_on_change && - old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` && - new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` && - - eval "$initialize_posix_glob" && - $posix_glob set -f && - set X $old && old=:$2:$4:$5:$6 && - set X $new && new=:$2:$4:$5:$6 && - $posix_glob set +f && - - test "$old" = "$new" && - $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1 - then - rm -f "$dsttmp" - else - # Rename the file to the real destination. - $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null || - - # The rename failed, perhaps because mv can't rename something else - # to itself, or perhaps because mv is so ancient that it does not - # support -f. - { - # Now remove or move aside any old file at destination location. - # We try this two ways since rm can't unlink itself on some - # systems and the destination file might be busy for other - # reasons. In this case, the final cleanup might fail but the new - # file should still install successfully. - { - test ! -f "$dst" || - $doit $rmcmd -f "$dst" 2>/dev/null || - { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null && - { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; } - } || - { echo "$0: cannot unlink or rename $dst" >&2 - (exit 1); exit 1 - } - } && - - # Now rename the file to the real destination. - $doit $mvcmd "$dsttmp" "$dst" - } - fi || exit 1 + { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } \ + && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } \ + && { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } \ + && { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } && + + # Now rename the file to the real destination. + { $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null \ + || { + # The rename failed, perhaps because mv can't rename something else + # to itself, or perhaps because mv is so ancient that it does not + # support -f. + + # Now remove or move aside any old file at destination location. + # We try this two ways since rm can't unlink itself on some + # systems and the destination file might be busy for other + # reasons. In this case, the final cleanup might fail but the new + # file should still install successfully. + { + if test -f "$dst"; then + $doit $rmcmd -f "$dst" 2>/dev/null \ + || { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null \ + && { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; }; }\ + || { + echo "$0: cannot unlink or rename $dst" >&2 + (exit 1); exit 1 + } + else + : + fi + } && + + # Now rename the file to the real destination. + $doit $mvcmd "$dsttmp" "$dst" + } + } || exit 1 trap '' 0 fi @@ -515,6 +506,5 @@ done # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" -# time-stamp-time-zone: "UTC" -# time-stamp-end: "; # UTC" +# time-stamp-end: "$" # End: diff --git a/Build/source/utils/asymptote/pen.h b/Build/source/utils/asymptote/pen.h index e2a8002e7c5..623a57f09ba 100644 --- a/Build/source/utils/asymptote/pen.h +++ b/Build/source/utils/asymptote/pen.h @@ -387,15 +387,19 @@ public: string Font() const { if(font.empty()) { - if(defaultpen().font.empty()) - if(settings::latex(settings::getSetting("tex"))) + if(defaultpen().font.empty()) { + string texengine=settings::getSetting("tex"); + if(settings::latex(texengine)) return DEFLATEXFONT; + else if(texengine == "none") + return settings::getSetting("textinitialfont"); else { ostringstream buf; buf << "\\font\\ASYfont=" << DEFTEXFONT << " at " << size() << "pt\\ASYfont"; return buf.str(); } + } else return defaultpen().font; } return font; diff --git a/Build/source/utils/asymptote/picture.cc b/Build/source/utils/asymptote/picture.cc index cade08cceca..26023157229 100644 --- a/Build/source/utils/asymptote/picture.cc +++ b/Build/source/utils/asymptote/picture.cc @@ -708,6 +708,7 @@ struct Communicate : public gc { triple m; triple M; double *t; + double *background; size_t nlights; triple *lights; double *diffuse; @@ -723,8 +724,8 @@ void glrenderWrapper() { #ifdef HAVE_LIBGL glrender(com.prefix,com.pic,com.format,com.width,com.height,com.angle, - com.m,com.M,com.t,com.nlights,com.lights,com.diffuse,com.ambient, - com.specular,com.viewportlighting,com.view); + com.m,com.M,com.t,com.background,com.nlights,com.lights,com.diffuse, + com.ambient,com.specular,com.viewportlighting,com.view); #endif } @@ -733,9 +734,9 @@ extern bool glinitialize; bool picture::shipout3(const string& prefix, const string& format, double width, double height, double angle, const triple& m, const triple& M, - double *t, size_t nlights, triple *lights, - double *diffuse, double *ambient, double *specular, - bool viewportlighting, bool view) + double *t, double *background, size_t nlights, + triple *lights, double *diffuse, double *ambient, + double *specular, bool viewportlighting, bool view) { #ifdef HAVE_LIBGL bounds3(); @@ -763,6 +764,7 @@ bool picture::shipout3(const string& prefix, const string& format, com.m=m; com.M=M; com.t=t; + com.background=background; com.nlights=nlights; com.lights=lights; com.diffuse=diffuse; @@ -796,7 +798,7 @@ bool picture::shipout3(const string& prefix, const string& format, if(glthread && !interact::interactive) pthread_mutex_lock(&quitLock); #endif - glrender(prefix,this,outputformat,width,height,angle,m,M,t, + glrender(prefix,this,outputformat,width,height,angle,m,M,t,background, nlights,lights,diffuse,ambient,specular,viewportlighting,View, oldpid); #ifdef HAVE_LIBPTHREAD diff --git a/Build/source/utils/asymptote/picture.h b/Build/source/utils/asymptote/picture.h index 59ce0369c34..561f0488bcd 100644 --- a/Build/source/utils/asymptote/picture.h +++ b/Build/source/utils/asymptote/picture.h @@ -93,9 +93,10 @@ public: bool transparent) const; bool shipout3(const string& prefix, const string& format, double width, double height, double angle, const triple& m, - const triple& M, double *t, size_t nlights, triple *lights, - double *diffuse, double *ambient, double *specular, - bool viewportlighting, bool view); + const triple& M, double *t, double *background, + size_t nlights, triple *lights, double *diffuse, + double *ambient, double *specular, bool viewportlighting, + bool view); bool shipout3(const string& prefix); // Embedded PRC diff --git a/Build/source/utils/asymptote/psfile.cc b/Build/source/utils/asymptote/psfile.cc index feb91b34dea..a6543a38861 100644 --- a/Build/source/utils/asymptote/psfile.cc +++ b/Build/source/utils/asymptote/psfile.cc @@ -118,7 +118,8 @@ void psfile::close() out->flush(); if(!filename.empty()) { if(!out->good()) - reportError("Cannot write to "+filename); + // Don't call reportError since this may be called on handled_error. + reportFatal("Cannot write to "+filename); delete out; out=NULL; } diff --git a/Build/source/utils/asymptote/runtime.cc b/Build/source/utils/asymptote/runtime.cc index 90b78b7302c..4881fd8368e 100644 --- a/Build/source/utils/asymptote/runtime.cc +++ b/Build/source/utils/asymptote/runtime.cc @@ -22,6 +22,8 @@ #line 63 "runtime.in" #include +#include +#include #include #include #include @@ -826,13 +828,15 @@ void unused(void *) { } -pair readpair(stringstream& s, bool tex) +static const double twelvepercent=0.12; +static const double tenpercent=0.1; + +pair readpair(stringstream& s, double hscale=1.0, double vscale=1.0) { - static const double f=12.0/100.0; double x,y; s >> y; s >> x; - return tex ? pair(f*x,-f*y) : pair(x,y); + return pair(hscale*x,vscale*y); } // Ignore unclosed begingroups but not spurious endgroups. @@ -848,7 +852,8 @@ string ASYo="/ASYo {( ) print 12 string cvs print} bind def"; string pathforall="{(M) print ASYo ASYo} {(L) print ASYo ASYo} {(C) print ASYo ASYo ASYo ASYo ASYo ASYo} {(c) print} pathforall"; string currentpoint="print currentpoint ASYo ASYo "; -array *readpath(const string& psname, bool tex, bool keep) +array *readpath(const string& psname, bool keep, + double hscale=1.0, double vscale=1.0) { array *P=new array(0); ostringstream pipe; @@ -856,9 +861,9 @@ array *readpath(const string& psname, bool tex, bool keep) << "' -q -dNOPAUSE -dBATCH"; if(safe) pipe << " -dSAFER"; #ifdef __CYGWIN__ - string null="NUL"; + const string null="NUL"; #else - string null="/dev/null"; + const string null="/dev/null"; #endif pipe << " -sDEVICE=epswrite -sOutputFile="+null+" '" << psname << "'"; iopipestream gs(pipe.str().c_str(),"gs","Ghostscript"); @@ -905,13 +910,13 @@ array *readpath(const string& psname, bool tex, bool keep) } active=false; cyclic=false; - node.pre=node.point=readpair(buf,tex)-offset; + node.pre=node.point=readpair(buf,hscale,vscale)-offset; node.straight=false; break; } case 'L': { - pair point=readpair(buf,tex)-offset; + pair point=readpair(buf,hscale,vscale)-offset; pair delta=(point-node.point)*third; node.post=node.point+delta; node.straight=true; @@ -923,9 +928,9 @@ array *readpath(const string& psname, bool tex, bool keep) } case 'C': { - pair point=readpair(buf,tex)-offset; - pair pre=readpair(buf,tex)-offset; - node.post=readpair(buf,tex)-offset; + pair point=readpair(buf,hscale,vscale)-offset; + pair pre=readpair(buf,hscale,vscale)-offset; + node.post=readpair(buf,hscale,vscale)-offset; node.straight=false; nodes.push_back(node); active=true; @@ -940,7 +945,7 @@ array *readpath(const string& psname, bool tex, bool keep) } case 'Z': { - offset=readpair(buf,tex); + offset=readpair(buf,hscale,vscale); break; } } @@ -979,6 +984,20 @@ pair gamma(pair z) return root2pi*pow(t,z+0.5)*exp(-t)*x; } +void cannotread(const string& s) +{ + ostringstream buf; + buf << "Cannot read from " << s << endl; + error(buf); +} + +void cannotwrite(const string& s) +{ + ostringstream buf; + buf << "Cannot write to " << s << endl; + error(buf); +} + // Autogenerated routines: @@ -986,45 +1005,45 @@ pair gamma(pair z) namespace run { // Initializers -#line 1026 "runtime.in" +#line 1045 "runtime.in" void IntZero(stack *Stack) { -#line 1027 "runtime.in" +#line 1046 "runtime.in" {Stack->push(0); return;} } -#line 1032 "runtime.in" +#line 1051 "runtime.in" void realZero(stack *Stack) { -#line 1033 "runtime.in" +#line 1052 "runtime.in" {Stack->push(0.0); return;} } -#line 1037 "runtime.in" +#line 1056 "runtime.in" void boolFalse(stack *Stack) { -#line 1038 "runtime.in" +#line 1057 "runtime.in" {Stack->push(false); return;} } -#line 1042 "runtime.in" +#line 1061 "runtime.in" void pushNullArray(stack *Stack) { -#line 1043 "runtime.in" +#line 1062 "runtime.in" {Stack->push(0); return;} } -#line 1047 "runtime.in" +#line 1066 "runtime.in" void pushNullRecord(stack *Stack) { -#line 1048 "runtime.in" +#line 1067 "runtime.in" {Stack->push(0); return;} } -#line 1052 "runtime.in" +#line 1071 "runtime.in" void pushNullFunction(stack *Stack) { -#line 1053 "runtime.in" +#line 1072 "runtime.in" {Stack->push(nullfunc::instance()); return;} } @@ -1033,183 +1052,183 @@ void pushNullFunction(stack *Stack) // Put the default value token on the stack (in place of an argument when // making a function call). -#line 1062 "runtime.in" +#line 1081 "runtime.in" void pushDefault(stack *Stack) { -#line 1063 "runtime.in" +#line 1082 "runtime.in" {Stack->push(def); return;} } // Test if the value on the stack is the default value token. -#line 1069 "runtime.in" +#line 1088 "runtime.in" void isDefault(stack *Stack) { item i=vm::pop(Stack); -#line 1070 "runtime.in" +#line 1089 "runtime.in" {Stack->push(isdefault(i)); return;} } // Logical operations -#line 1076 "runtime.in" +#line 1095 "runtime.in" // bool !(bool b); void gen8(stack *Stack) { bool b=vm::pop(Stack); -#line 1077 "runtime.in" +#line 1096 "runtime.in" {Stack->push(!b); return;} } -#line 1082 "runtime.in" +#line 1101 "runtime.in" void boolMemEq(stack *Stack) { frame * b=vm::pop(Stack); frame * a=vm::pop(Stack); -#line 1083 "runtime.in" +#line 1102 "runtime.in" {Stack->push(a == b); return;} } -#line 1087 "runtime.in" +#line 1106 "runtime.in" void boolMemNeq(stack *Stack) { frame * b=vm::pop(Stack); frame * a=vm::pop(Stack); -#line 1088 "runtime.in" +#line 1107 "runtime.in" {Stack->push(a != b); return;} } -#line 1092 "runtime.in" +#line 1111 "runtime.in" void boolFuncEq(stack *Stack) { callable * b=vm::pop(Stack); callable * a=vm::pop(Stack); -#line 1093 "runtime.in" +#line 1112 "runtime.in" {Stack->push(a->compare(b)); return;} } -#line 1097 "runtime.in" +#line 1116 "runtime.in" void boolFuncNeq(stack *Stack) { callable * b=vm::pop(Stack); callable * a=vm::pop(Stack); -#line 1098 "runtime.in" +#line 1117 "runtime.in" {Stack->push(!(a->compare(b))); return;} } // Bit operations -#line 1104 "runtime.in" +#line 1123 "runtime.in" // Int AND(Int a, Int b); void gen13(stack *Stack) { Int b=vm::pop(Stack); Int a=vm::pop(Stack); -#line 1105 "runtime.in" +#line 1124 "runtime.in" {Stack->push(a & b); return;} } -#line 1110 "runtime.in" +#line 1129 "runtime.in" // Int OR(Int a, Int b); void gen14(stack *Stack) { Int b=vm::pop(Stack); Int a=vm::pop(Stack); -#line 1111 "runtime.in" +#line 1130 "runtime.in" {Stack->push(a | b); return;} } -#line 1115 "runtime.in" +#line 1134 "runtime.in" // Int XOR(Int a, Int b); void gen15(stack *Stack) { Int b=vm::pop(Stack); Int a=vm::pop(Stack); -#line 1116 "runtime.in" +#line 1135 "runtime.in" {Stack->push(a ^ b); return;} } -#line 1120 "runtime.in" +#line 1139 "runtime.in" // Int NOT(Int a); void gen16(stack *Stack) { Int a=vm::pop(Stack); -#line 1121 "runtime.in" +#line 1140 "runtime.in" {Stack->push(~a); return;} } // Casts -#line 1127 "runtime.in" +#line 1146 "runtime.in" void pairToGuide(stack *Stack) { pair z=vm::pop(Stack); -#line 1128 "runtime.in" +#line 1147 "runtime.in" {Stack->push(new pairguide(z)); return;} } -#line 1133 "runtime.in" +#line 1152 "runtime.in" void pathToGuide(stack *Stack) { path p=vm::pop(Stack); -#line 1134 "runtime.in" +#line 1153 "runtime.in" {Stack->push(new pathguide(p)); return;} } -#line 1138 "runtime.in" +#line 1157 "runtime.in" void guideToPath(stack *Stack) { guide * g=vm::pop(Stack); -#line 1139 "runtime.in" +#line 1158 "runtime.in" {Stack->push(g->solve()); return;} } // Picture operations -#line 1145 "runtime.in" +#line 1164 "runtime.in" void newPicture(stack *Stack) { -#line 1146 "runtime.in" +#line 1165 "runtime.in" {Stack->push(new picture()); return;} } -#line 1151 "runtime.in" +#line 1170 "runtime.in" // bool empty(picture *f); void gen21(stack *Stack) { picture * f=vm::pop(Stack); -#line 1152 "runtime.in" +#line 1171 "runtime.in" {Stack->push(f->null()); return;} } -#line 1156 "runtime.in" +#line 1175 "runtime.in" // void erase(picture *f); void gen22(stack *Stack) { picture * f=vm::pop(Stack); -#line 1157 "runtime.in" +#line 1176 "runtime.in" f->nodes.clear(); } -#line 1161 "runtime.in" +#line 1180 "runtime.in" // pair min(picture *f); void gen23(stack *Stack) { picture * f=vm::pop(Stack); -#line 1162 "runtime.in" +#line 1181 "runtime.in" {Stack->push(f->bounds().Min()); return;} } -#line 1166 "runtime.in" +#line 1185 "runtime.in" // pair max(picture *f); void gen24(stack *Stack) { picture * f=vm::pop(Stack); -#line 1167 "runtime.in" +#line 1186 "runtime.in" {Stack->push(f->bounds().Max()); return;} } -#line 1171 "runtime.in" +#line 1190 "runtime.in" // void label(picture *f, string *s, string *size, transform t, pair position, pair align, pen p); void gen25(stack *Stack) { @@ -1220,26 +1239,26 @@ void gen25(stack *Stack) string * size=vm::pop(Stack); string * s=vm::pop(Stack); picture * f=vm::pop(Stack); -#line 1173 "runtime.in" +#line 1192 "runtime.in" f->append(new drawLabel(*s,*size,t,position,align,p)); } -#line 1177 "runtime.in" +#line 1196 "runtime.in" // bool labels(picture *f); void gen26(stack *Stack) { picture * f=vm::pop(Stack); -#line 1178 "runtime.in" +#line 1197 "runtime.in" {Stack->push(f->havelabels()); return;} } -#line 1182 "runtime.in" +#line 1201 "runtime.in" // patharray* _texpath(string *s, pen p=CURRENTPEN); void gen27(stack *Stack) { pen p=vm::pop(Stack,CURRENTPEN); string * s=vm::pop(Stack); -#line 1183 "runtime.in" +#line 1202 "runtime.in" array *P=new array(0); if(s->empty()) {Stack->push(P); return;} @@ -1302,16 +1321,96 @@ void gen27(stack *Stack) unlink(auxname(prefix,"log").c_str()); unlink(dviname.c_str()); } - {Stack->push(readpath(psname,true,keep)); return;} + {Stack->push(readpath(psname,keep,twelvepercent,-twelvepercent)); return;} } -#line 1249 "runtime.in" -// patharray* _strokepath(path g, pen p=CURRENTPEN); +#line 1268 "runtime.in" +// patharray* textpath(string *s, pen p=CURRENTPEN); void gen28(stack *Stack) +{ + pen p=vm::pop(Stack,CURRENTPEN); + string * s=vm::pop(Stack); +#line 1269 "runtime.in" + array *P=new array(0); + if(s->empty()) {Stack->push(P); return;} + + int status=0; + string prefix=outname(); + spaceToUnderscore(prefix); + string outputname=auxname(prefix,getSetting("textoutputtype")); + + string textname=auxname(prefix,getSetting("textextension")); + std::ofstream text(textname.c_str()); + + if(!text) cannotwrite(textname); + + text << getSetting("textprologue"); + text << p.Font() << endl; + text << *s; + text << getSetting("textepilogue"); + text.close(); + + ostringstream cmd; + string textcommand=getSetting("textcommand"); + cmd << textcommand << " '" << textname << "' '" + << outputname << "'"; + bool quiet=verbose <= 2; + status=System(cmd,quiet ? 1 : 0); + + string epsname=auxname(prefix,"eps"); + + if(status == 0) { + ostringstream cmd; + cmd << "'" << getSetting("gs") + << "' -q -dNOCACHE -dNOPAUSE -dBATCH"; + if(safe) cmd << " -dSAFER"; + cmd << " -sDEVICE=epswrite -sOutputFile='" << epsname << "' '" + << outputname << "'"; + status=System(cmd,0,true,"gs"); + } + + if(status != 0) + error("textpath failed"); + + string psname=auxname(prefix+"_","ps"); + std::ifstream eps(epsname.c_str()); + std::ofstream ps(psname.c_str()); + + if(!eps) cannotread(epsname); + if(!ps) cannotwrite(psname); + + ps << ASYo << endl + << "/ASY1 true def" << endl + << "/fill {ASY1 {(Z) " << currentpoint << "/ASY1 false def} if " + << pathforall << " (M) " << currentpoint + << "currentpoint newpath moveto } bind def" << endl + << "/stroke {ASY1 {(Z) " << currentpoint + << "/ASY1 false def} if strokepath " + << pathforall << " (M) " << currentpoint + << "currentpoint newpath moveto } bind def" << endl; + string line; + while(getline(eps,line)) + ps << line << endl; + ps << "(E) print" << endl; + eps.close(); + ps.close(); + + bool keep=getSetting("keep"); + if(!keep) { // Delete temporary files. + unlink(textname.c_str()); + unlink(outputname.c_str()); + unlink(epsname.c_str()); + } + {Stack->push(readpath(psname,keep,tenpercent,tenpercent)); return;} +} + +#line 1343 "runtime.in" +// patharray* _strokepath(path g, pen p=CURRENTPEN); +void gen29(stack *Stack) { pen p=vm::pop(Stack,CURRENTPEN); path g=vm::pop(Stack); -#line 1250 "runtime.in" +#line 1344 "runtime.in" array *P=new array(0); if(g.size() == 0) {Stack->push(P); return;} @@ -1319,7 +1418,7 @@ void gen28(stack *Stack) spaceToUnderscore(prefix); string psname=auxname(prefix,"ps"); bbox b; - psfile ps(psname, false); + psfile ps(psname,false); ps.prologue(b); ps.verbatimline(ASYo); ps.verbatimline("/stroke {(Z) "+currentpoint+pathforall+"} bind def"); @@ -1331,36 +1430,36 @@ void gen28(stack *Stack) ps.verbatimline("(M) "+currentpoint+"(E) print"); ps.epilogue(); ps.close(); - {Stack->push(readpath(psname,false,getSetting("keep"))); return;} + {Stack->push(readpath(psname,getSetting("keep"))); return;} } -#line 1273 "runtime.in" +#line 1367 "runtime.in" // void _draw(picture *f, path g, pen p); -void gen29(stack *Stack) +void gen30(stack *Stack) { pen p=vm::pop(Stack); path g=vm::pop(Stack); picture * f=vm::pop(Stack); -#line 1274 "runtime.in" +#line 1368 "runtime.in" f->append(new drawPath(g,p)); } -#line 1278 "runtime.in" +#line 1372 "runtime.in" // void fill(picture *f, patharray *g, pen p=CURRENTPEN, bool copy=true); -void gen30(stack *Stack) +void gen31(stack *Stack) { bool copy=vm::pop(Stack,true); pen p=vm::pop(Stack,CURRENTPEN); patharray * g=vm::pop(Stack); picture * f=vm::pop(Stack); -#line 1279 "runtime.in" +#line 1373 "runtime.in" array *(*copyarray)(array *a)=copy ? copyArray: nop; f->append(new drawFill(*copyarray(g),false,p)); } -#line 1284 "runtime.in" +#line 1378 "runtime.in" // void latticeshade(picture *f, patharray *g, bool stroke=false, pen fillrule=CURRENTPEN, penarray2 *p, bool copy=true); -void gen31(stack *Stack) +void gen32(stack *Stack) { bool copy=vm::pop(Stack,true); penarray2 * p=vm::pop(Stack); @@ -1368,14 +1467,14 @@ void gen31(stack *Stack) bool stroke=vm::pop(Stack,false); patharray * g=vm::pop(Stack); picture * f=vm::pop(Stack); -#line 1286 "runtime.in" +#line 1380 "runtime.in" array *(*copyarray)(array *a)=copy ? copyArray: nop; f->append(new drawLatticeShade(*copyarray(g),stroke,fillrule,*copyarray(p))); } -#line 1291 "runtime.in" +#line 1385 "runtime.in" // void axialshade(picture *f, patharray *g, bool stroke=false, pen pena, pair a, pen penb, pair b, bool copy=true); -void gen32(stack *Stack) +void gen33(stack *Stack) { bool copy=vm::pop(Stack,true); pair b=vm::pop(Stack); @@ -1385,14 +1484,14 @@ void gen32(stack *Stack) bool stroke=vm::pop(Stack,false); patharray * g=vm::pop(Stack); picture * f=vm::pop(Stack); -#line 1293 "runtime.in" +#line 1387 "runtime.in" array *(*copyarray)(array *a)=copy ? copyArray: nop; f->append(new drawAxialShade(*copyarray(g),stroke,pena,a,penb,b)); } -#line 1298 "runtime.in" +#line 1392 "runtime.in" // void radialshade(picture *f, patharray *g, bool stroke=false, pen pena, pair a, real ra, pen penb, pair b, real rb, bool copy=true); -void gen33(stack *Stack) +void gen34(stack *Stack) { bool copy=vm::pop(Stack,true); real rb=vm::pop(Stack); @@ -1404,14 +1503,14 @@ void gen33(stack *Stack) bool stroke=vm::pop(Stack,false); patharray * g=vm::pop(Stack); picture * f=vm::pop(Stack); -#line 1300 "runtime.in" +#line 1394 "runtime.in" array *(*copyarray)(array *a)=copy ? copyArray: nop; f->append(new drawRadialShade(*copyarray(g),stroke,pena,a,ra,penb,b,rb)); } -#line 1305 "runtime.in" +#line 1399 "runtime.in" // void gouraudshade(picture *f, patharray *g, bool stroke=false, pen fillrule=CURRENTPEN, penarray *p, pairarray *z, Intarray *edges, bool copy=true); -void gen34(stack *Stack) +void gen35(stack *Stack) { bool copy=vm::pop(Stack,true); Intarray * edges=vm::pop(Stack); @@ -1421,7 +1520,7 @@ void gen34(stack *Stack) bool stroke=vm::pop(Stack,false); patharray * g=vm::pop(Stack); picture * f=vm::pop(Stack); -#line 1308 "runtime.in" +#line 1402 "runtime.in" array *(*copyarray)(array *a)=copy ? copyArray: nop; checkArrays(p,z); checkArrays(z,edges); @@ -1429,9 +1528,9 @@ void gen34(stack *Stack) *copyarray(z),*copyarray(edges))); } -#line 1316 "runtime.in" +#line 1410 "runtime.in" // void gouraudshade(picture *f, patharray *g, bool stroke=false, pen fillrule=CURRENTPEN, penarray *p, Intarray *edges, bool copy=true); -void gen35(stack *Stack) +void gen36(stack *Stack) { bool copy=vm::pop(Stack,true); Intarray * edges=vm::pop(Stack); @@ -1440,7 +1539,7 @@ void gen35(stack *Stack) bool stroke=vm::pop(Stack,false); patharray * g=vm::pop(Stack); picture * f=vm::pop(Stack); -#line 1319 "runtime.in" +#line 1413 "runtime.in" array *(*copyarray)(array *a)=copy ? copyArray: nop; size_t n=checkArrays(p,edges); size_t m=checkArray(g); @@ -1461,9 +1560,9 @@ void gen35(stack *Stack) *z,*copyarray(edges))); } -#line 1340 "runtime.in" +#line 1434 "runtime.in" // void tensorshade(picture *f, patharray *g, bool stroke=false, pen fillrule=CURRENTPEN, penarray2 *p, patharray *b=NULL, pairarray2 *z=emptyarray, bool copy=true); -void gen36(stack *Stack) +void gen37(stack *Stack) { bool copy=vm::pop(Stack,true); pairarray2 * z=vm::pop(Stack,emptyarray); @@ -1473,7 +1572,7 @@ void gen36(stack *Stack) bool stroke=vm::pop(Stack,false); patharray * g=vm::pop(Stack); picture * f=vm::pop(Stack); -#line 1343 "runtime.in" +#line 1437 "runtime.in" array *(*copyarray)(array *a)=copy ? copyArray: nop; array *(*copyarray2)(array *a)=copy ? copyArray2: nop; if(b == NULL) b=g; @@ -1485,9 +1584,9 @@ void gen36(stack *Stack) *copyarray(b),*copyarray2(z))); } -#line 1355 "runtime.in" +#line 1449 "runtime.in" // void functionshade(picture *f, patharray *g, bool stroke=false, pen fillrule=CURRENTPEN, string shader=emptystring, bool copy=true); -void gen37(stack *Stack) +void gen38(stack *Stack) { bool copy=vm::pop(Stack,true); string shader=vm::pop(Stack,emptystring); @@ -1495,176 +1594,176 @@ void gen37(stack *Stack) bool stroke=vm::pop(Stack,false); patharray * g=vm::pop(Stack); picture * f=vm::pop(Stack); -#line 1358 "runtime.in" +#line 1452 "runtime.in" array *(*copyarray)(array *a)=copy ? copyArray: nop; f->append(new drawFunctionShade(*copyarray(g),stroke,fillrule,shader)); } // Clip a picture to a superpath using the given fill rule. // Subsequent additions to the picture will not be affected by the clipping. -#line 1365 "runtime.in" +#line 1459 "runtime.in" // void clip(picture *f, patharray *g, bool stroke=false, pen fillrule=CURRENTPEN, bool copy=true); -void gen38(stack *Stack) +void gen39(stack *Stack) { bool copy=vm::pop(Stack,true); pen fillrule=vm::pop(Stack,CURRENTPEN); bool stroke=vm::pop(Stack,false); patharray * g=vm::pop(Stack); picture * f=vm::pop(Stack); -#line 1367 "runtime.in" +#line 1461 "runtime.in" array *(*copyarray)(array *a)=copy ? copyArray: nop; drawClipBegin *begin=new drawClipBegin(*copyarray(g),stroke,fillrule,true); f->enclose(begin,new drawClipEnd(true,begin)); } -#line 1373 "runtime.in" +#line 1467 "runtime.in" // void beginclip(picture *f, patharray *g, bool stroke=false, pen fillrule=CURRENTPEN, bool copy=true); -void gen39(stack *Stack) +void gen40(stack *Stack) { bool copy=vm::pop(Stack,true); pen fillrule=vm::pop(Stack,CURRENTPEN); bool stroke=vm::pop(Stack,false); patharray * g=vm::pop(Stack); picture * f=vm::pop(Stack); -#line 1375 "runtime.in" +#line 1469 "runtime.in" array *(*copyarray)(array *a)=copy ? copyArray: nop; f->append(new drawClipBegin(*copyarray(g),stroke,fillrule,false)); } -#line 1380 "runtime.in" +#line 1474 "runtime.in" // void endclip(picture *f); -void gen40(stack *Stack) +void gen41(stack *Stack) { picture * f=vm::pop(Stack); -#line 1381 "runtime.in" +#line 1475 "runtime.in" f->append(new drawClipEnd(false)); } -#line 1385 "runtime.in" +#line 1479 "runtime.in" // void gsave(picture *f); -void gen41(stack *Stack) +void gen42(stack *Stack) { picture * f=vm::pop(Stack); -#line 1386 "runtime.in" +#line 1480 "runtime.in" f->append(new drawGsave()); } -#line 1390 "runtime.in" +#line 1484 "runtime.in" // void grestore(picture *f); -void gen42(stack *Stack) +void gen43(stack *Stack) { picture * f=vm::pop(Stack); -#line 1391 "runtime.in" +#line 1485 "runtime.in" f->append(new drawGrestore()); } -#line 1395 "runtime.in" +#line 1489 "runtime.in" // void begingroup(picture *f); -void gen43(stack *Stack) +void gen44(stack *Stack) { picture * f=vm::pop(Stack); -#line 1396 "runtime.in" +#line 1490 "runtime.in" f->append(new drawBegin()); } -#line 1400 "runtime.in" +#line 1494 "runtime.in" // void endgroup(picture *f); -void gen44(stack *Stack) +void gen45(stack *Stack) { picture * f=vm::pop(Stack); -#line 1401 "runtime.in" +#line 1495 "runtime.in" f->append(new drawEnd()); } -#line 1405 "runtime.in" +#line 1499 "runtime.in" // void add(picture *dest, picture *src); -void gen45(stack *Stack) +void gen46(stack *Stack) { picture * src=vm::pop(Stack); picture * dest=vm::pop(Stack); -#line 1406 "runtime.in" +#line 1500 "runtime.in" dest->add(*src); } -#line 1410 "runtime.in" +#line 1504 "runtime.in" // void prepend(picture *dest, picture *src); -void gen46(stack *Stack) +void gen47(stack *Stack) { picture * src=vm::pop(Stack); picture * dest=vm::pop(Stack); -#line 1411 "runtime.in" +#line 1505 "runtime.in" dest->prepend(*src); } -#line 1415 "runtime.in" +#line 1509 "runtime.in" // void postscript(picture *f, string s); -void gen47(stack *Stack) +void gen48(stack *Stack) { string s=vm::pop(Stack); picture * f=vm::pop(Stack); -#line 1416 "runtime.in" +#line 1510 "runtime.in" f->append(new drawVerbatim(PostScript,s)); } -#line 1420 "runtime.in" +#line 1514 "runtime.in" // void tex(picture *f, string s); -void gen48(stack *Stack) +void gen49(stack *Stack) { string s=vm::pop(Stack); picture * f=vm::pop(Stack); -#line 1421 "runtime.in" +#line 1515 "runtime.in" f->append(new drawVerbatim(TeX,s)); } -#line 1425 "runtime.in" +#line 1519 "runtime.in" // void postscript(picture *f, string s, pair min, pair max); -void gen49(stack *Stack) +void gen50(stack *Stack) { pair max=vm::pop(Stack); pair min=vm::pop(Stack); string s=vm::pop(Stack); picture * f=vm::pop(Stack); -#line 1426 "runtime.in" +#line 1520 "runtime.in" f->append(new drawVerbatim(PostScript,s,min,max)); } -#line 1430 "runtime.in" +#line 1524 "runtime.in" // void tex(picture *f, string s, pair min, pair max); -void gen50(stack *Stack) +void gen51(stack *Stack) { pair max=vm::pop(Stack); pair min=vm::pop(Stack); string s=vm::pop(Stack); picture * f=vm::pop(Stack); -#line 1431 "runtime.in" +#line 1525 "runtime.in" f->append(new drawVerbatim(TeX,s,min,max)); } -#line 1435 "runtime.in" +#line 1529 "runtime.in" // void texpreamble(string s); -void gen51(stack *Stack) +void gen52(stack *Stack) { string s=vm::pop(Stack); -#line 1436 "runtime.in" +#line 1530 "runtime.in" string t=s+"\n"; processDataStruct &pd=processData(); pd.TeXpipepreamble.push_back(t); pd.TeXpreamble.push_back(t); } -#line 1443 "runtime.in" +#line 1537 "runtime.in" // void deletepreamble(); -void gen52(stack *) +void gen53(stack *) { -#line 1444 "runtime.in" +#line 1538 "runtime.in" if(getSetting("inlinetex")) { unlink(auxname(outname(),"pre").c_str()); } } -#line 1450 "runtime.in" +#line 1544 "runtime.in" // void _labelpath(picture *f, string s, string size, path g, string justify, pair offset, pen p); -void gen53(stack *Stack) +void gen54(stack *Stack) { pen p=vm::pop(Stack); pair offset=vm::pop(Stack); @@ -1673,42 +1772,42 @@ void gen53(stack *Stack) string size=vm::pop(Stack); string s=vm::pop(Stack); picture * f=vm::pop(Stack); -#line 1452 "runtime.in" +#line 1546 "runtime.in" f->append(new drawLabelPath(s,size,g,justify,offset,p)); } -#line 1456 "runtime.in" +#line 1550 "runtime.in" // void texreset(); -void gen54(stack *) +void gen55(stack *) { -#line 1457 "runtime.in" +#line 1551 "runtime.in" processDataStruct &pd=processData(); pd.TeXpipepreamble.clear(); pd.TeXpreamble.clear(); pd.tex.pipeclose(); } -#line 1464 "runtime.in" +#line 1558 "runtime.in" // void layer(picture *f); -void gen55(stack *Stack) +void gen56(stack *Stack) { picture * f=vm::pop(Stack); -#line 1465 "runtime.in" +#line 1559 "runtime.in" f->append(new drawLayer()); } -#line 1469 "runtime.in" +#line 1563 "runtime.in" // void newpage(picture *f); -void gen56(stack *Stack) +void gen57(stack *Stack) { picture * f=vm::pop(Stack); -#line 1470 "runtime.in" +#line 1564 "runtime.in" f->append(new drawNewPage()); } -#line 1474 "runtime.in" +#line 1568 "runtime.in" // void _image(picture *f, realarray2 *data, pair initial, pair final, penarray *palette=NULL, transform t=identity, bool copy=true, bool antialias=false); -void gen57(stack *Stack) +void gen58(stack *Stack) { bool antialias=vm::pop(Stack,false); bool copy=vm::pop(Stack,true); @@ -1718,16 +1817,16 @@ void gen57(stack *Stack) pair initial=vm::pop(Stack); realarray2 * data=vm::pop(Stack); picture * f=vm::pop(Stack); -#line 1477 "runtime.in" +#line 1571 "runtime.in" array *(*copyarray)(array *a)=copy ? copyArray: nop; array *(*copyarray2)(array *a)=copy ? copyArray2: nop; f->append(new drawImage(*copyarray2(data),*copyarray(palette), t*matrix(initial,final),antialias)); } -#line 1484 "runtime.in" +#line 1578 "runtime.in" // void _image(picture *f, penarray2 *data, pair initial, pair final, transform t=identity, bool copy=true, bool antialias=false); -void gen58(stack *Stack) +void gen59(stack *Stack) { bool antialias=vm::pop(Stack,false); bool copy=vm::pop(Stack,true); @@ -1736,38 +1835,38 @@ void gen58(stack *Stack) pair initial=vm::pop(Stack); penarray2 * data=vm::pop(Stack); picture * f=vm::pop(Stack); -#line 1486 "runtime.in" +#line 1580 "runtime.in" array *(*copyarray2)(array *a)=copy ? copyArray2: nop; f->append(new drawImage(*copyarray2(data),t*matrix(initial,final),antialias)); } -#line 1491 "runtime.in" +#line 1585 "runtime.in" // string nativeformat(); -void gen59(stack *Stack) +void gen60(stack *Stack) { -#line 1492 "runtime.in" +#line 1586 "runtime.in" {Stack->push(nativeformat()); return;} } -#line 1496 "runtime.in" +#line 1590 "runtime.in" // bool latex(); -void gen60(stack *Stack) +void gen61(stack *Stack) { -#line 1497 "runtime.in" +#line 1591 "runtime.in" {Stack->push(latex(getSetting("tex"))); return;} } -#line 1501 "runtime.in" +#line 1595 "runtime.in" // bool pdf(); -void gen61(stack *Stack) +void gen62(stack *Stack) { -#line 1502 "runtime.in" +#line 1596 "runtime.in" {Stack->push(pdf(getSetting("tex"))); return;} } -#line 1506 "runtime.in" +#line 1600 "runtime.in" // void shipout(string prefix=emptystring, picture *f, picture *preamble=NULL, string format=emptystring, bool wait=false, bool view=true, callableTransform *xform); -void gen62(stack *Stack) +void gen63(stack *Stack) { callableTransform * xform=vm::pop(Stack); bool view=vm::pop(Stack,true); @@ -1776,7 +1875,7 @@ void gen62(stack *Stack) picture * preamble=vm::pop(Stack,NULL); picture * f=vm::pop(Stack); string prefix=vm::pop(Stack,emptystring); -#line 1509 "runtime.in" +#line 1603 "runtime.in" if(prefix.empty()) prefix=outname(); picture *result=new picture; @@ -1819,9 +1918,9 @@ void gen62(stack *Stack) result->shipout(preamble,prefix,format,0.0,wait,view); } -#line 1552 "runtime.in" -// void shipout3(string prefix, picture *f, string format=emptystring, real width, real height, real angle, triple m, triple M, realarray2 *t, triplearray *lights, realarray2 *diffuse, realarray2 *ambient, realarray2 *specular, bool viewportlighting, bool view=true); -void gen63(stack *Stack) +#line 1646 "runtime.in" +// void shipout3(string prefix, picture *f, string format=emptystring, real width, real height, real angle, triple m, triple M, realarray2 *t, realarray *background, triplearray *lights, realarray2 *diffuse, realarray2 *ambient, realarray2 *specular, bool viewportlighting, bool view=true); +void gen64(stack *Stack) { bool view=vm::pop(Stack,true); bool viewportlighting=vm::pop(Stack); @@ -1829,6 +1928,7 @@ void gen63(stack *Stack) realarray2 * ambient=vm::pop(Stack); realarray2 * diffuse=vm::pop(Stack); triplearray * lights=vm::pop(Stack); + realarray * background=vm::pop(Stack); realarray2 * t=vm::pop(Stack); triple M=vm::pop(Stack); triple m=vm::pop(Stack); @@ -1838,36 +1938,36 @@ void gen63(stack *Stack) string format=vm::pop(Stack,emptystring); picture * f=vm::pop(Stack); string prefix=vm::pop(Stack); -#line 1557 "runtime.in" +#line 1651 "runtime.in" size_t n=checkArrays(lights,diffuse); checkEqual(n,checkArray(ambient)); checkEqual(n,checkArray(specular)); - f->shipout3(prefix,format,width,height,angle,m,M,copyArray2C(t,true,4),n, - copyTripleArrayC(lights),copyArray2C(diffuse,false,4), - copyArray2C(ambient,false,4),copyArray2C(specular,false,4), - viewportlighting,view); + f->shipout3(prefix,format,width,height,angle,m,M,copyArray2C(t,true,4), + copyArrayC(background),n,copyTripleArrayC(lights), + copyArray2C(diffuse,false,4),copyArray2C(ambient,false,4), + copyArray2C(specular,false,4),viewportlighting,view); } -#line 1568 "runtime.in" +#line 1662 "runtime.in" // void shipout3(string prefix, picture *f); -void gen64(stack *Stack) +void gen65(stack *Stack) { picture * f=vm::pop(Stack); string prefix=vm::pop(Stack); -#line 1569 "runtime.in" +#line 1663 "runtime.in" f->shipout3(prefix); } -#line 1573 "runtime.in" +#line 1667 "runtime.in" // void deconstruct(picture *f, picture *preamble=NULL, real magnification=1, callableTransform *xform); -void gen65(stack *Stack) +void gen66(stack *Stack) { callableTransform * xform=vm::pop(Stack); real magnification=vm::pop(Stack,1); picture * preamble=vm::pop(Stack,NULL); picture * f=vm::pop(Stack); -#line 1575 "runtime.in" +#line 1669 "runtime.in" unsigned level=0; unsigned n=0; @@ -1998,214 +2098,214 @@ void gen65(stack *Stack) } } -#line 1706 "runtime.in" +#line 1800 "runtime.in" // void purge(Int divisor=0); -void gen66(stack *Stack) +void gen67(stack *Stack) { Int divisor=vm::pop(Stack,0); -#line 1707 "runtime.in" +#line 1801 "runtime.in" purge(divisor); } // Pen operations -#line 1713 "runtime.in" +#line 1807 "runtime.in" void newPen(stack *Stack) { -#line 1714 "runtime.in" +#line 1808 "runtime.in" {Stack->push(pen()); return;} } -#line 1719 "runtime.in" +#line 1813 "runtime.in" // bool ==(pen a, pen b); -void gen68(stack *Stack) +void gen69(stack *Stack) { pen b=vm::pop(Stack); pen a=vm::pop(Stack); -#line 1720 "runtime.in" +#line 1814 "runtime.in" {Stack->push(a == b); return;} } -#line 1724 "runtime.in" +#line 1818 "runtime.in" // bool !=(pen a, pen b); -void gen69(stack *Stack) +void gen70(stack *Stack) { pen b=vm::pop(Stack); pen a=vm::pop(Stack); -#line 1725 "runtime.in" +#line 1819 "runtime.in" {Stack->push(a != b); return;} } -#line 1729 "runtime.in" +#line 1823 "runtime.in" // pen +(pen a, pen b); -void gen70(stack *Stack) +void gen71(stack *Stack) { pen b=vm::pop(Stack); pen a=vm::pop(Stack); -#line 1730 "runtime.in" +#line 1824 "runtime.in" {Stack->push(a+b); return;} } -#line 1734 "runtime.in" +#line 1828 "runtime.in" // pen *(real a, pen b); -void gen71(stack *Stack) +void gen72(stack *Stack) { pen b=vm::pop(Stack); real a=vm::pop(Stack); -#line 1735 "runtime.in" +#line 1829 "runtime.in" {Stack->push(a*b); return;} } -#line 1739 "runtime.in" +#line 1833 "runtime.in" // pen *(pen a, real b); -void gen72(stack *Stack) +void gen73(stack *Stack) { real b=vm::pop(Stack); pen a=vm::pop(Stack); -#line 1740 "runtime.in" +#line 1834 "runtime.in" {Stack->push(b*a); return;} } -#line 1744 "runtime.in" +#line 1838 "runtime.in" // pair max(pen p); -void gen73(stack *Stack) +void gen74(stack *Stack) { pen p=vm::pop(Stack); -#line 1745 "runtime.in" +#line 1839 "runtime.in" {Stack->push(p.bounds().Max()); return;} } -#line 1749 "runtime.in" +#line 1843 "runtime.in" // pair min(pen p); -void gen74(stack *Stack) +void gen75(stack *Stack) { pen p=vm::pop(Stack); -#line 1750 "runtime.in" +#line 1844 "runtime.in" {Stack->push(p.bounds().Min()); return;} } // Reset the meaning of pen default attributes. -#line 1755 "runtime.in" +#line 1849 "runtime.in" // void resetdefaultpen(); -void gen75(stack *) +void gen76(stack *) { -#line 1756 "runtime.in" +#line 1850 "runtime.in" processData().defaultpen=camp::pen::initialpen(); } -#line 1760 "runtime.in" +#line 1854 "runtime.in" // void defaultpen(pen p); -void gen76(stack *Stack) +void gen77(stack *Stack) { pen p=vm::pop(Stack); -#line 1761 "runtime.in" +#line 1855 "runtime.in" processData().defaultpen=pen(resolvepen,p); } -#line 1765 "runtime.in" +#line 1859 "runtime.in" // pen defaultpen(); -void gen77(stack *Stack) +void gen78(stack *Stack) { -#line 1766 "runtime.in" +#line 1860 "runtime.in" {Stack->push(processData().defaultpen); return;} } -#line 1770 "runtime.in" +#line 1864 "runtime.in" // bool invisible(pen p); -void gen78(stack *Stack) +void gen79(stack *Stack) { pen p=vm::pop(Stack); -#line 1771 "runtime.in" +#line 1865 "runtime.in" {Stack->push(p.invisible()); return;} } -#line 1775 "runtime.in" +#line 1869 "runtime.in" // pen invisible(); -void gen79(stack *Stack) +void gen80(stack *Stack) { -#line 1776 "runtime.in" +#line 1870 "runtime.in" {Stack->push(pen(invisiblepen)); return;} } -#line 1780 "runtime.in" +#line 1874 "runtime.in" // pen gray(pen p); -void gen80(stack *Stack) +void gen81(stack *Stack) { pen p=vm::pop(Stack); -#line 1781 "runtime.in" +#line 1875 "runtime.in" p.togrey(); {Stack->push(p); return;} } -#line 1786 "runtime.in" +#line 1880 "runtime.in" // pen rgb(pen p); -void gen81(stack *Stack) +void gen82(stack *Stack) { pen p=vm::pop(Stack); -#line 1787 "runtime.in" +#line 1881 "runtime.in" p.torgb(); {Stack->push(p); return;} } -#line 1792 "runtime.in" +#line 1886 "runtime.in" // pen cmyk(pen p); -void gen82(stack *Stack) +void gen83(stack *Stack) { pen p=vm::pop(Stack); -#line 1793 "runtime.in" +#line 1887 "runtime.in" p.tocmyk(); {Stack->push(p); return;} } -#line 1798 "runtime.in" +#line 1892 "runtime.in" // pen interp(pen a, pen b, real t); -void gen83(stack *Stack) +void gen84(stack *Stack) { real t=vm::pop(Stack); pen b=vm::pop(Stack); pen a=vm::pop(Stack); -#line 1799 "runtime.in" +#line 1893 "runtime.in" {Stack->push(interpolate(a,b,t)); return;} } -#line 1803 "runtime.in" +#line 1897 "runtime.in" // pen rgb(real r, real g, real b); -void gen84(stack *Stack) +void gen85(stack *Stack) { real b=vm::pop(Stack); real g=vm::pop(Stack); real r=vm::pop(Stack); -#line 1804 "runtime.in" +#line 1898 "runtime.in" {Stack->push(pen(r,g,b)); return;} } -#line 1808 "runtime.in" +#line 1902 "runtime.in" // pen cmyk(real c, real m, real y, real k); -void gen85(stack *Stack) +void gen86(stack *Stack) { real k=vm::pop(Stack); real y=vm::pop(Stack); real m=vm::pop(Stack); real c=vm::pop(Stack); -#line 1809 "runtime.in" +#line 1903 "runtime.in" {Stack->push(pen(c,m,y,k)); return;} } -#line 1813 "runtime.in" +#line 1907 "runtime.in" // pen gray(real gray); -void gen86(stack *Stack) +void gen87(stack *Stack) { real gray=vm::pop(Stack); -#line 1814 "runtime.in" +#line 1908 "runtime.in" {Stack->push(pen(gray)); return;} } -#line 1818 "runtime.in" +#line 1912 "runtime.in" // realarray* colors(pen p); -void gen87(stack *Stack) +void gen88(stack *Stack) { pen p=vm::pop(Stack); -#line 1819 "runtime.in" +#line 1913 "runtime.in" size_t n=ColorComponents[p.colorspace()]; array *a=new array(n); @@ -2232,60 +2332,60 @@ void gen87(stack *Stack) {Stack->push(a); return;} } -#line 1846 "runtime.in" +#line 1940 "runtime.in" // string colorspace(pen p); -void gen88(stack *Stack) +void gen89(stack *Stack) { pen p=vm::pop(Stack); -#line 1847 "runtime.in" +#line 1941 "runtime.in" string s=ColorDeviceSuffix[p.colorspace()]; std::transform(s.begin(),s.end(),s.begin(),tolower); {Stack->push(s); return;} } -#line 1853 "runtime.in" +#line 1947 "runtime.in" // pen pattern(string *s); -void gen89(stack *Stack) +void gen90(stack *Stack) { string * s=vm::pop(Stack); -#line 1854 "runtime.in" +#line 1948 "runtime.in" {Stack->push(pen(setpattern,*s)); return;} } -#line 1858 "runtime.in" +#line 1952 "runtime.in" // string pattern(pen p); -void gen90(stack *Stack) +void gen91(stack *Stack) { pen p=vm::pop(Stack); -#line 1859 "runtime.in" +#line 1953 "runtime.in" {Stack->push(p.fillpattern()); return;} } -#line 1863 "runtime.in" +#line 1957 "runtime.in" // pen fillrule(Int n); -void gen91(stack *Stack) +void gen92(stack *Stack) { Int n=vm::pop(Stack); -#line 1864 "runtime.in" +#line 1958 "runtime.in" {Stack->push(pen(n >= 0 && n < nFill ? (FillRule) n : DEFFILL)); return;} } -#line 1868 "runtime.in" +#line 1962 "runtime.in" // Int fillrule(pen p); -void gen92(stack *Stack) +void gen93(stack *Stack) { pen p=vm::pop(Stack); -#line 1869 "runtime.in" +#line 1963 "runtime.in" {Stack->push(p.Fillrule()); return;} } -#line 1873 "runtime.in" +#line 1967 "runtime.in" // pen opacity(real opacity=1.0, string blend=defaulttransparency); -void gen93(stack *Stack) +void gen94(stack *Stack) { string blend=vm::pop(Stack,defaulttransparency); real opacity=vm::pop(Stack,1.0); -#line 1874 "runtime.in" +#line 1968 "runtime.in" for(Int i=0; i < nBlendMode; ++i) if(blend == BlendMode[i]) {Stack->push(pen(Transparency(blend,opacity))); return;} @@ -2294,357 +2394,357 @@ void gen93(stack *Stack) error(buf); } -#line 1883 "runtime.in" +#line 1977 "runtime.in" // real opacity(pen p); -void gen94(stack *Stack) +void gen95(stack *Stack) { pen p=vm::pop(Stack); -#line 1884 "runtime.in" +#line 1978 "runtime.in" {Stack->push(p.opacity()); return;} } -#line 1888 "runtime.in" +#line 1982 "runtime.in" // string blend(pen p); -void gen95(stack *Stack) +void gen96(stack *Stack) { pen p=vm::pop(Stack); -#line 1889 "runtime.in" +#line 1983 "runtime.in" {Stack->push(p.blend()); return;} } -#line 1893 "runtime.in" +#line 1987 "runtime.in" // pen linetype(string *s, real offset=0, bool scale=true, bool adjust=true); -void gen96(stack *Stack) +void gen97(stack *Stack) { bool adjust=vm::pop(Stack,true); bool scale=vm::pop(Stack,true); real offset=vm::pop(Stack,0); string * s=vm::pop(Stack); -#line 1894 "runtime.in" +#line 1988 "runtime.in" {Stack->push(pen(LineType(*s,offset,scale,adjust))); return;} } -#line 1898 "runtime.in" +#line 1992 "runtime.in" // string linetype(pen p=CURRENTPEN); -void gen97(stack *Stack) +void gen98(stack *Stack) { pen p=vm::pop(Stack,CURRENTPEN); -#line 1899 "runtime.in" +#line 1993 "runtime.in" {Stack->push(p.stroke()); return;} } -#line 1903 "runtime.in" +#line 1997 "runtime.in" // real offset(pen p); -void gen98(stack *Stack) +void gen99(stack *Stack) { pen p=vm::pop(Stack); -#line 1904 "runtime.in" +#line 1998 "runtime.in" {Stack->push(p.linetype().offset); return;} } -#line 1908 "runtime.in" +#line 2002 "runtime.in" // bool scale(pen p); -void gen99(stack *Stack) +void gen100(stack *Stack) { pen p=vm::pop(Stack); -#line 1909 "runtime.in" +#line 2003 "runtime.in" {Stack->push(p.linetype().scale); return;} } -#line 1913 "runtime.in" +#line 2007 "runtime.in" // bool adjust(pen p); -void gen100(stack *Stack) +void gen101(stack *Stack) { pen p=vm::pop(Stack); -#line 1914 "runtime.in" +#line 2008 "runtime.in" {Stack->push(p.linetype().adjust); return;} } -#line 1918 "runtime.in" +#line 2012 "runtime.in" // pen adjust(pen p, real arclength, bool cyclic); -void gen101(stack *Stack) +void gen102(stack *Stack) { bool cyclic=vm::pop(Stack); real arclength=vm::pop(Stack); pen p=vm::pop(Stack); -#line 1919 "runtime.in" +#line 2013 "runtime.in" {Stack->push(adjustdash(p,arclength,cyclic)); return;} } -#line 1923 "runtime.in" +#line 2017 "runtime.in" // pen linecap(Int n); -void gen102(stack *Stack) +void gen103(stack *Stack) { Int n=vm::pop(Stack); -#line 1924 "runtime.in" +#line 2018 "runtime.in" {Stack->push(pen(setlinecap,n >= 0 && n < nCap ? n : DEFCAP)); return;} } -#line 1928 "runtime.in" +#line 2022 "runtime.in" // Int linecap(pen p=CURRENTPEN); -void gen103(stack *Stack) +void gen104(stack *Stack) { pen p=vm::pop(Stack,CURRENTPEN); -#line 1929 "runtime.in" +#line 2023 "runtime.in" {Stack->push(p.cap()); return;} } -#line 1933 "runtime.in" +#line 2027 "runtime.in" // pen linejoin(Int n); -void gen104(stack *Stack) +void gen105(stack *Stack) { Int n=vm::pop(Stack); -#line 1934 "runtime.in" +#line 2028 "runtime.in" {Stack->push(pen(setlinejoin,n >= 0 && n < nJoin ? n : DEFJOIN)); return;} } -#line 1938 "runtime.in" +#line 2032 "runtime.in" // Int linejoin(pen p=CURRENTPEN); -void gen105(stack *Stack) +void gen106(stack *Stack) { pen p=vm::pop(Stack,CURRENTPEN); -#line 1939 "runtime.in" +#line 2033 "runtime.in" {Stack->push(p.join()); return;} } -#line 1943 "runtime.in" +#line 2037 "runtime.in" // pen miterlimit(real x); -void gen106(stack *Stack) +void gen107(stack *Stack) { real x=vm::pop(Stack); -#line 1944 "runtime.in" +#line 2038 "runtime.in" {Stack->push(pen(setmiterlimit,x >= 1.0 ? x : DEFJOIN)); return;} } -#line 1948 "runtime.in" +#line 2042 "runtime.in" // real miterlimit(pen p=CURRENTPEN); -void gen107(stack *Stack) +void gen108(stack *Stack) { pen p=vm::pop(Stack,CURRENTPEN); -#line 1949 "runtime.in" +#line 2043 "runtime.in" {Stack->push(p.miter()); return;} } -#line 1953 "runtime.in" +#line 2047 "runtime.in" // pen linewidth(real x); -void gen108(stack *Stack) +void gen109(stack *Stack) { real x=vm::pop(Stack); -#line 1954 "runtime.in" +#line 2048 "runtime.in" {Stack->push(pen(setlinewidth,x >= 0.0 ? x : DEFWIDTH)); return;} } -#line 1958 "runtime.in" +#line 2052 "runtime.in" // real linewidth(pen p=CURRENTPEN); -void gen109(stack *Stack) +void gen110(stack *Stack) { pen p=vm::pop(Stack,CURRENTPEN); -#line 1959 "runtime.in" +#line 2053 "runtime.in" {Stack->push(p.width()); return;} } -#line 1963 "runtime.in" +#line 2057 "runtime.in" // pen fontcommand(string *s); -void gen110(stack *Stack) +void gen111(stack *Stack) { string * s=vm::pop(Stack); -#line 1964 "runtime.in" +#line 2058 "runtime.in" {Stack->push(pen(setfont,*s)); return;} } -#line 1968 "runtime.in" +#line 2062 "runtime.in" // string font(pen p=CURRENTPEN); -void gen111(stack *Stack) +void gen112(stack *Stack) { pen p=vm::pop(Stack,CURRENTPEN); -#line 1969 "runtime.in" +#line 2063 "runtime.in" {Stack->push(p.Font()); return;} } -#line 1973 "runtime.in" +#line 2067 "runtime.in" // pen fontsize(real size, real lineskip); -void gen112(stack *Stack) +void gen113(stack *Stack) { real lineskip=vm::pop(Stack); real size=vm::pop(Stack); -#line 1974 "runtime.in" +#line 2068 "runtime.in" {Stack->push(pen(setfontsize,size > 0.0 ? size : 0.0, lineskip > 0.0 ? lineskip : 0.0)); return;} } -#line 1979 "runtime.in" +#line 2073 "runtime.in" // real fontsize(pen p=CURRENTPEN); -void gen113(stack *Stack) +void gen114(stack *Stack) { pen p=vm::pop(Stack,CURRENTPEN); -#line 1980 "runtime.in" +#line 2074 "runtime.in" {Stack->push(p.size()); return;} } -#line 1984 "runtime.in" +#line 2078 "runtime.in" // real lineskip(pen p=CURRENTPEN); -void gen114(stack *Stack) +void gen115(stack *Stack) { pen p=vm::pop(Stack,CURRENTPEN); -#line 1985 "runtime.in" +#line 2079 "runtime.in" {Stack->push(p.Lineskip()); return;} } -#line 1989 "runtime.in" +#line 2083 "runtime.in" // pen overwrite(Int n); -void gen115(stack *Stack) +void gen116(stack *Stack) { Int n=vm::pop(Stack); -#line 1990 "runtime.in" +#line 2084 "runtime.in" {Stack->push(pen(setoverwrite,n >= 0 && n < nOverwrite ? (overwrite_t) n : DEFWRITE)); return;} } -#line 1995 "runtime.in" +#line 2089 "runtime.in" // Int overwrite(pen p=CURRENTPEN); -void gen116(stack *Stack) +void gen117(stack *Stack) { pen p=vm::pop(Stack,CURRENTPEN); -#line 1996 "runtime.in" +#line 2090 "runtime.in" {Stack->push(p.Overwrite()); return;} } -#line 2000 "runtime.in" +#line 2094 "runtime.in" // pen basealign(Int n); -void gen117(stack *Stack) +void gen118(stack *Stack) { Int n=vm::pop(Stack); -#line 2001 "runtime.in" +#line 2095 "runtime.in" {Stack->push(pen(n >= 0 && n < nBaseLine ? (BaseLine) n : DEFBASE)); return;} } -#line 2005 "runtime.in" +#line 2099 "runtime.in" // Int basealign(pen p=CURRENTPEN); -void gen118(stack *Stack) +void gen119(stack *Stack) { pen p=vm::pop(Stack,CURRENTPEN); -#line 2006 "runtime.in" +#line 2100 "runtime.in" {Stack->push(p.Baseline()); return;} } -#line 2010 "runtime.in" +#line 2104 "runtime.in" // transform transform(pen p); -void gen119(stack *Stack) +void gen120(stack *Stack) { pen p=vm::pop(Stack); -#line 2011 "runtime.in" +#line 2105 "runtime.in" {Stack->push(p.getTransform()); return;} } -#line 2015 "runtime.in" +#line 2109 "runtime.in" // path nib(pen p); -void gen120(stack *Stack) +void gen121(stack *Stack) { pen p=vm::pop(Stack); -#line 2016 "runtime.in" +#line 2110 "runtime.in" {Stack->push(p.Path()); return;} } -#line 2020 "runtime.in" +#line 2114 "runtime.in" // pen makepen(path p); -void gen121(stack *Stack) +void gen122(stack *Stack) { path p=vm::pop(Stack); -#line 2021 "runtime.in" +#line 2115 "runtime.in" {Stack->push(pen(p)); return;} } -#line 2025 "runtime.in" +#line 2119 "runtime.in" // pen colorless(pen p); -void gen122(stack *Stack) +void gen123(stack *Stack) { pen p=vm::pop(Stack); -#line 2026 "runtime.in" +#line 2120 "runtime.in" p.colorless(); {Stack->push(p); return;} } // Interactive mode -#line 2032 "runtime.in" +#line 2126 "runtime.in" // bool interactive(); -void gen123(stack *Stack) +void gen124(stack *Stack) { -#line 2033 "runtime.in" +#line 2127 "runtime.in" {Stack->push(interact::interactive); return;} } -#line 2038 "runtime.in" +#line 2132 "runtime.in" // bool uptodate(); -void gen124(stack *Stack) +void gen125(stack *Stack) { -#line 2039 "runtime.in" +#line 2133 "runtime.in" {Stack->push(interact::uptodate); return;} } // System commands -#line 2045 "runtime.in" +#line 2139 "runtime.in" // Int system(string s); -void gen125(stack *Stack) +void gen126(stack *Stack) { string s=vm::pop(Stack); -#line 2046 "runtime.in" +#line 2140 "runtime.in" if(safe) error("system() call disabled; override with option -nosafe"); if(s.empty()) {Stack->push(0); return;} else {Stack->push(System(s.c_str())); return;} } -#line 2053 "runtime.in" +#line 2147 "runtime.in" // bool view(); -void gen126(stack *Stack) +void gen127(stack *Stack) { -#line 2054 "runtime.in" +#line 2148 "runtime.in" {Stack->push(view()); return;} } -#line 2058 "runtime.in" +#line 2152 "runtime.in" // string asydir(); -void gen127(stack *Stack) +void gen128(stack *Stack) { -#line 2059 "runtime.in" +#line 2153 "runtime.in" {Stack->push(systemDir); return;} } -#line 2063 "runtime.in" +#line 2157 "runtime.in" // string locale(string s=emptystring); -void gen128(stack *Stack) +void gen129(stack *Stack) { string s=vm::pop(Stack,emptystring); -#line 2064 "runtime.in" +#line 2158 "runtime.in" char *L=setlocale(LC_ALL,s.empty() ? NULL : s.c_str()); {Stack->push(L != NULL ? string(L) : ""); return;} } -#line 2069 "runtime.in" +#line 2163 "runtime.in" // void abort(string s=emptystring); -void gen129(stack *Stack) +void gen130(stack *Stack) { string s=vm::pop(Stack,emptystring); -#line 2070 "runtime.in" +#line 2164 "runtime.in" if(s.empty()) throw handled_error(); error(s.c_str()); } -#line 2075 "runtime.in" +#line 2169 "runtime.in" // void exit(); -void gen130(stack *) +void gen131(stack *) { -#line 2076 "runtime.in" +#line 2170 "runtime.in" throw quit(); } -#line 2080 "runtime.in" +#line 2174 "runtime.in" // void assert(bool b, string s=emptystring); -void gen131(stack *Stack) +void gen132(stack *Stack) { string s=vm::pop(Stack,emptystring); bool b=vm::pop(Stack); -#line 2081 "runtime.in" +#line 2175 "runtime.in" flush(cout); if(!b) { ostringstream buf; @@ -2654,34 +2754,34 @@ void gen131(stack *Stack) } } -#line 2091 "runtime.in" +#line 2185 "runtime.in" // void sleep(Int seconds); -void gen132(stack *Stack) +void gen133(stack *Stack) { Int seconds=vm::pop(Stack); -#line 2092 "runtime.in" +#line 2186 "runtime.in" if(seconds <= 0) return; sleep(seconds); } -#line 2097 "runtime.in" +#line 2191 "runtime.in" // void usleep(Int microseconds); -void gen133(stack *Stack) +void gen134(stack *Stack) { Int microseconds=vm::pop(Stack); -#line 2098 "runtime.in" +#line 2192 "runtime.in" if(microseconds <= 0) return; usleep((unsigned long) microseconds); } -#line 2103 "runtime.in" +#line 2197 "runtime.in" // void _eval(string *s, bool embedded, bool interactiveWrite=false); -void gen134(stack *Stack) +void gen135(stack *Stack) { bool interactiveWrite=vm::pop(Stack,false); bool embedded=vm::pop(Stack); string * s=vm::pop(Stack); -#line 2104 "runtime.in" +#line 2198 "runtime.in" if (embedded) { trans::coenv *e=Stack->getEnvironment(); vm::interactiveStack *is=dynamic_cast(Stack); @@ -2695,13 +2795,13 @@ void gen134(stack *Stack) } } -#line 2118 "runtime.in" +#line 2212 "runtime.in" // void _eval(runnable *s, bool embedded); -void gen135(stack *Stack) +void gen136(stack *Stack) { bool embedded=vm::pop(Stack); runnable * s=vm::pop(Stack); -#line 2119 "runtime.in" +#line 2213 "runtime.in" absyntax::block *ast=new absyntax::block(s->getPos(), false); ast->add(s); @@ -2718,42 +2818,42 @@ void gen135(stack *Stack) } } -#line 2136 "runtime.in" +#line 2230 "runtime.in" // string location(); -void gen136(stack *Stack) +void gen137(stack *Stack) { -#line 2137 "runtime.in" +#line 2231 "runtime.in" ostringstream buf; buf << getPos(); {Stack->push(buf.str()); return;} } // Wrapper for the stack::load() method. -#line 2143 "runtime.in" +#line 2237 "runtime.in" void loadModule(stack *Stack) { string * index=vm::pop(Stack); -#line 2144 "runtime.in" +#line 2238 "runtime.in" Stack->load(*index); } -#line 2148 "runtime.in" +#line 2242 "runtime.in" // string cd(string s=emptystring); -void gen138(stack *Stack) +void gen139(stack *Stack) { string s=vm::pop(Stack,emptystring); -#line 2149 "runtime.in" +#line 2243 "runtime.in" if(!s.empty() && !globalwrite()) writeDisabled(); {Stack->push(setPath(s.c_str())); return;} } -#line 2154 "runtime.in" +#line 2248 "runtime.in" // void list(string *s, bool imports=false); -void gen139(stack *Stack) +void gen140(stack *Stack) { bool imports=vm::pop(Stack,false); string * s=vm::pop(Stack); -#line 2155 "runtime.in" +#line 2249 "runtime.in" if(*s == "-") return; trans::genv ge; symbol *name=symbol::trans(*s); @@ -2763,144 +2863,144 @@ void gen139(stack *Stack) // Path operations -#line 2165 "runtime.in" +#line 2259 "runtime.in" void nullPath(stack *Stack) { -#line 2166 "runtime.in" +#line 2260 "runtime.in" {Stack->push(nullpath); return;} } -#line 2171 "runtime.in" +#line 2265 "runtime.in" // bool ==(path a, path b); -void gen141(stack *Stack) +void gen142(stack *Stack) { path b=vm::pop(Stack); path a=vm::pop(Stack); -#line 2172 "runtime.in" +#line 2266 "runtime.in" {Stack->push(a == b); return;} } -#line 2176 "runtime.in" +#line 2270 "runtime.in" // bool !=(path a, path b); -void gen142(stack *Stack) +void gen143(stack *Stack) { path b=vm::pop(Stack); path a=vm::pop(Stack); -#line 2177 "runtime.in" +#line 2271 "runtime.in" {Stack->push(!(a == b)); return;} } -#line 2181 "runtime.in" +#line 2275 "runtime.in" // pair point(path p, Int t); -void gen143(stack *Stack) +void gen144(stack *Stack) { Int t=vm::pop(Stack); path p=vm::pop(Stack); -#line 2182 "runtime.in" +#line 2276 "runtime.in" {Stack->push(p.point((Int) t)); return;} } -#line 2186 "runtime.in" +#line 2280 "runtime.in" // pair point(path p, real t); -void gen144(stack *Stack) +void gen145(stack *Stack) { real t=vm::pop(Stack); path p=vm::pop(Stack); -#line 2187 "runtime.in" +#line 2281 "runtime.in" {Stack->push(p.point(t)); return;} } -#line 2191 "runtime.in" +#line 2285 "runtime.in" // pair precontrol(path p, Int t); -void gen145(stack *Stack) +void gen146(stack *Stack) { Int t=vm::pop(Stack); path p=vm::pop(Stack); -#line 2192 "runtime.in" +#line 2286 "runtime.in" {Stack->push(p.precontrol((Int) t)); return;} } -#line 2196 "runtime.in" +#line 2290 "runtime.in" // pair precontrol(path p, real t); -void gen146(stack *Stack) +void gen147(stack *Stack) { real t=vm::pop(Stack); path p=vm::pop(Stack); -#line 2197 "runtime.in" +#line 2291 "runtime.in" {Stack->push(p.precontrol(t)); return;} } -#line 2201 "runtime.in" +#line 2295 "runtime.in" // pair postcontrol(path p, Int t); -void gen147(stack *Stack) +void gen148(stack *Stack) { Int t=vm::pop(Stack); path p=vm::pop(Stack); -#line 2202 "runtime.in" +#line 2296 "runtime.in" {Stack->push(p.postcontrol((Int) t)); return;} } -#line 2206 "runtime.in" +#line 2300 "runtime.in" // pair postcontrol(path p, real t); -void gen148(stack *Stack) +void gen149(stack *Stack) { real t=vm::pop(Stack); path p=vm::pop(Stack); -#line 2207 "runtime.in" +#line 2301 "runtime.in" {Stack->push(p.postcontrol(t)); return;} } -#line 2211 "runtime.in" +#line 2305 "runtime.in" // pair dir(path p, Int t, Int sign=0, bool normalize=true); -void gen149(stack *Stack) +void gen150(stack *Stack) { bool normalize=vm::pop(Stack,true); Int sign=vm::pop(Stack,0); Int t=vm::pop(Stack); path p=vm::pop(Stack); -#line 2212 "runtime.in" +#line 2306 "runtime.in" {Stack->push(p.dir(t,sign,normalize)); return;} } -#line 2216 "runtime.in" +#line 2310 "runtime.in" // pair dir(path p, real t, bool normalize=true); -void gen150(stack *Stack) +void gen151(stack *Stack) { bool normalize=vm::pop(Stack,true); real t=vm::pop(Stack); path p=vm::pop(Stack); -#line 2217 "runtime.in" +#line 2311 "runtime.in" {Stack->push(p.dir(t,normalize)); return;} } -#line 2221 "runtime.in" +#line 2315 "runtime.in" // pair accel(path p, Int t, Int sign=0); -void gen151(stack *Stack) +void gen152(stack *Stack) { Int sign=vm::pop(Stack,0); Int t=vm::pop(Stack); path p=vm::pop(Stack); -#line 2222 "runtime.in" +#line 2316 "runtime.in" {Stack->push(p.accel(t,sign)); return;} } -#line 2226 "runtime.in" +#line 2320 "runtime.in" // pair accel(path p, real t); -void gen152(stack *Stack) +void gen153(stack *Stack) { real t=vm::pop(Stack); path p=vm::pop(Stack); -#line 2227 "runtime.in" +#line 2321 "runtime.in" {Stack->push(p.accel(t)); return;} } -#line 2231 "runtime.in" +#line 2325 "runtime.in" // real radius(path p, real t); -void gen153(stack *Stack) +void gen154(stack *Stack) { real t=vm::pop(Stack); path p=vm::pop(Stack); -#line 2232 "runtime.in" +#line 2326 "runtime.in" pair v=p.dir(t,false); pair a=p.accel(t); real d=dot(a,v); @@ -2911,40 +3011,40 @@ void gen153(stack *Stack) {Stack->push(denom > 0 ? r/sqrt(denom) : 0.0); return;} } -#line 2243 "runtime.in" +#line 2337 "runtime.in" // path reverse(path p); -void gen154(stack *Stack) +void gen155(stack *Stack) { path p=vm::pop(Stack); -#line 2244 "runtime.in" +#line 2338 "runtime.in" {Stack->push(p.reverse()); return;} } -#line 2248 "runtime.in" +#line 2342 "runtime.in" // path subpath(path p, Int a, Int b); -void gen155(stack *Stack) +void gen156(stack *Stack) { Int b=vm::pop(Stack); Int a=vm::pop(Stack); path p=vm::pop(Stack); -#line 2249 "runtime.in" +#line 2343 "runtime.in" {Stack->push(p.subpath((Int) a, (Int) b)); return;} } -#line 2253 "runtime.in" +#line 2347 "runtime.in" // path subpath(path p, real a, real b); -void gen156(stack *Stack) +void gen157(stack *Stack) { real b=vm::pop(Stack); real a=vm::pop(Stack); path p=vm::pop(Stack); -#line 2254 "runtime.in" +#line 2348 "runtime.in" {Stack->push(p.subpath(a,b)); return;} } -#line 2258 "runtime.in" +#line 2352 "runtime.in" // path nurb(pair z0, pair z1, pair z2, pair z3, real w0, real w1, real w2, real w3, Int m); -void gen157(stack *Stack) +void gen158(stack *Stack) { Int m=vm::pop(Stack); real w3=vm::pop(Stack); @@ -2955,93 +3055,93 @@ void gen157(stack *Stack) pair z2=vm::pop(Stack); pair z1=vm::pop(Stack); pair z0=vm::pop(Stack); -#line 2260 "runtime.in" +#line 2354 "runtime.in" {Stack->push(nurb(z0,z1,z2,z3,w0,w1,w2,w3,m)); return;} } -#line 2264 "runtime.in" +#line 2358 "runtime.in" // Int length(path p); -void gen158(stack *Stack) +void gen159(stack *Stack) { path p=vm::pop(Stack); -#line 2265 "runtime.in" +#line 2359 "runtime.in" {Stack->push(p.length()); return;} } -#line 2269 "runtime.in" +#line 2363 "runtime.in" // bool cyclic(path p); -void gen159(stack *Stack) +void gen160(stack *Stack) { path p=vm::pop(Stack); -#line 2270 "runtime.in" +#line 2364 "runtime.in" {Stack->push(p.cyclic()); return;} } -#line 2274 "runtime.in" +#line 2368 "runtime.in" // bool straight(path p, Int t); -void gen160(stack *Stack) +void gen161(stack *Stack) { Int t=vm::pop(Stack); path p=vm::pop(Stack); -#line 2275 "runtime.in" +#line 2369 "runtime.in" {Stack->push(p.straight(t)); return;} } -#line 2279 "runtime.in" +#line 2373 "runtime.in" // path unstraighten(path p); -void gen161(stack *Stack) +void gen162(stack *Stack) { path p=vm::pop(Stack); -#line 2280 "runtime.in" +#line 2374 "runtime.in" {Stack->push(p.unstraighten()); return;} } -#line 2284 "runtime.in" +#line 2378 "runtime.in" // bool piecewisestraight(path p); -void gen162(stack *Stack) +void gen163(stack *Stack) { path p=vm::pop(Stack); -#line 2285 "runtime.in" +#line 2379 "runtime.in" {Stack->push(p.piecewisestraight()); return;} } -#line 2289 "runtime.in" +#line 2383 "runtime.in" // real arclength(path p); -void gen163(stack *Stack) +void gen164(stack *Stack) { path p=vm::pop(Stack); -#line 2290 "runtime.in" +#line 2384 "runtime.in" {Stack->push(p.arclength()); return;} } -#line 2294 "runtime.in" +#line 2388 "runtime.in" // real arctime(path p, real dval); -void gen164(stack *Stack) +void gen165(stack *Stack) { real dval=vm::pop(Stack); path p=vm::pop(Stack); -#line 2295 "runtime.in" +#line 2389 "runtime.in" {Stack->push(p.arctime(dval)); return;} } -#line 2299 "runtime.in" +#line 2393 "runtime.in" // real dirtime(path p, pair z); -void gen165(stack *Stack) +void gen166(stack *Stack) { pair z=vm::pop(Stack); path p=vm::pop(Stack); -#line 2300 "runtime.in" +#line 2394 "runtime.in" {Stack->push(p.directiontime(z)); return;} } -#line 2304 "runtime.in" +#line 2398 "runtime.in" // realarray* intersect(path p, path q, real fuzz=-1); -void gen166(stack *Stack) +void gen167(stack *Stack) { real fuzz=vm::pop(Stack,-1); path q=vm::pop(Stack); path p=vm::pop(Stack); -#line 2305 "runtime.in" +#line 2399 "runtime.in" bool exact=fuzz <= 0.0; if(fuzz < 0) fuzz=BigFuzz*::max(::max(length(p.max()),length(p.min())), @@ -3057,14 +3157,14 @@ void gen166(stack *Stack) {Stack->push(new array(0)); return;} } -#line 2321 "runtime.in" +#line 2415 "runtime.in" // realarray2* intersections(path p, path q, real fuzz=-1); -void gen167(stack *Stack) +void gen168(stack *Stack) { real fuzz=vm::pop(Stack,-1); path q=vm::pop(Stack); path p=vm::pop(Stack); -#line 2322 "runtime.in" +#line 2416 "runtime.in" bool exact=fuzz <= 0.0; if(fuzz < 0.0) fuzz=BigFuzz*::max(::max(length(p.max()),length(p.min())), @@ -3094,15 +3194,15 @@ void gen167(stack *Stack) {Stack->push(V); return;} } -#line 2352 "runtime.in" +#line 2446 "runtime.in" // realarray* intersections(path p, explicit pair a, explicit pair b, real fuzz=-1); -void gen168(stack *Stack) +void gen169(stack *Stack) { real fuzz=vm::pop(Stack,-1); pair b=vm::pop(Stack); pair a=vm::pop(Stack); path p=vm::pop(Stack); -#line 2353 "runtime.in" +#line 2447 "runtime.in" if(fuzz < 0) fuzz=BigFuzz*::max(::max(length(p.max()),length(p.min())), ::max(length(a),length(b))); @@ -3118,15 +3218,15 @@ void gen168(stack *Stack) // Return the intersection point of the extensions of the line segments // PQ and pq. -#line 2369 "runtime.in" +#line 2463 "runtime.in" // pair extension(pair P, pair Q, pair p, pair q); -void gen169(stack *Stack) +void gen170(stack *Stack) { pair q=vm::pop(Stack); pair p=vm::pop(Stack); pair Q=vm::pop(Stack); pair P=vm::pop(Stack); -#line 2370 "runtime.in" +#line 2464 "runtime.in" pair ac=P-Q; pair bd=q-p; real det=ac.getx()*bd.gety()-ac.gety()*bd.getx(); @@ -3134,49 +3234,49 @@ void gen169(stack *Stack) {Stack->push(P+((p.getx()-P.getx())*bd.gety()-(p.gety()-P.gety())*bd.getx())*ac/det); return;} } -#line 2378 "runtime.in" +#line 2472 "runtime.in" // Int size(path p); -void gen170(stack *Stack) +void gen171(stack *Stack) { path p=vm::pop(Stack); -#line 2379 "runtime.in" +#line 2473 "runtime.in" {Stack->push(p.size()); return;} } -#line 2383 "runtime.in" +#line 2477 "runtime.in" // path &(path p, path q); -void gen171(stack *Stack) +void gen172(stack *Stack) { path q=vm::pop(Stack); path p=vm::pop(Stack); -#line 2384 "runtime.in" +#line 2478 "runtime.in" {Stack->push(camp::concat(p,q)); return;} } -#line 2388 "runtime.in" +#line 2482 "runtime.in" // pair min(path p); -void gen172(stack *Stack) +void gen173(stack *Stack) { path p=vm::pop(Stack); -#line 2389 "runtime.in" +#line 2483 "runtime.in" {Stack->push(p.min()); return;} } -#line 2393 "runtime.in" +#line 2487 "runtime.in" // pair max(path p); -void gen173(stack *Stack) +void gen174(stack *Stack) { path p=vm::pop(Stack); -#line 2394 "runtime.in" +#line 2488 "runtime.in" {Stack->push(p.max()); return;} } -#line 2398 "runtime.in" +#line 2492 "runtime.in" // realarray* mintimes(path p); -void gen174(stack *Stack) +void gen175(stack *Stack) { path p=vm::pop(Stack); -#line 2399 "runtime.in" +#line 2493 "runtime.in" array *V=new array(2); pair z=p.mintimes(); (*V)[0]=z.getx(); @@ -3184,12 +3284,12 @@ void gen174(stack *Stack) {Stack->push(V); return;} } -#line 2407 "runtime.in" +#line 2501 "runtime.in" // realarray* maxtimes(path p); -void gen175(stack *Stack) +void gen176(stack *Stack) { path p=vm::pop(Stack); -#line 2408 "runtime.in" +#line 2502 "runtime.in" array *V=new array(2); pair z=p.maxtimes(); (*V)[0]=z.getx(); @@ -3197,90 +3297,90 @@ void gen175(stack *Stack) {Stack->push(V); return;} } -#line 2416 "runtime.in" +#line 2510 "runtime.in" // real relativedistance(real theta, real phi, real t, bool atleast); -void gen176(stack *Stack) +void gen177(stack *Stack) { bool atleast=vm::pop(Stack); real t=vm::pop(Stack); real phi=vm::pop(Stack); real theta=vm::pop(Stack); -#line 2417 "runtime.in" +#line 2511 "runtime.in" {Stack->push(camp::velocity(theta,phi,tension(t,atleast))); return;} } -#line 2421 "runtime.in" +#line 2515 "runtime.in" // Int windingnumber(patharray *p, pair z); -void gen177(stack *Stack) +void gen178(stack *Stack) { pair z=vm::pop(Stack); patharray * p=vm::pop(Stack); -#line 2422 "runtime.in" +#line 2516 "runtime.in" {Stack->push(windingnumber(p,z)); return;} } -#line 2426 "runtime.in" +#line 2520 "runtime.in" // bool inside(explicit patharray *g, pair z, pen fillrule=CURRENTPEN); -void gen178(stack *Stack) +void gen179(stack *Stack) { pen fillrule=vm::pop(Stack,CURRENTPEN); pair z=vm::pop(Stack); patharray * g=vm::pop(Stack); -#line 2427 "runtime.in" +#line 2521 "runtime.in" {Stack->push(fillrule.inside(windingnumber(g,z))); return;} } -#line 2431 "runtime.in" +#line 2525 "runtime.in" // bool inside(path g, pair z, pen fillrule=CURRENTPEN); -void gen179(stack *Stack) +void gen180(stack *Stack) { pen fillrule=vm::pop(Stack,CURRENTPEN); pair z=vm::pop(Stack); path g=vm::pop(Stack); -#line 2432 "runtime.in" +#line 2526 "runtime.in" {Stack->push(fillrule.inside(g.windingnumber(z))); return;} } // Determine the side of a--b that c lies on // (negative=left, zero=on line, positive=right). -#line 2438 "runtime.in" +#line 2532 "runtime.in" // real side(pair a, pair b, pair c); -void gen180(stack *Stack) +void gen181(stack *Stack) { pair c=vm::pop(Stack); pair b=vm::pop(Stack); pair a=vm::pop(Stack); -#line 2439 "runtime.in" +#line 2533 "runtime.in" {Stack->push(orient2d(a,b,c)); return;} } // Determine the side of the counterclockwise circle through a,b,c that d // lies on (negative=inside, 0=on circle, positive=right). -#line 2445 "runtime.in" +#line 2539 "runtime.in" // real incircle(pair a, pair b, pair c, pair d); -void gen181(stack *Stack) +void gen182(stack *Stack) { pair d=vm::pop(Stack); pair c=vm::pop(Stack); pair b=vm::pop(Stack); pair a=vm::pop(Stack); -#line 2446 "runtime.in" +#line 2540 "runtime.in" {Stack->push(incircle(a.getx(),a.gety(),b.getx(),b.gety(),c.getx(),c.gety(), d.getx(),d.gety())); return;} } // Path3 operations -#line 2453 "runtime.in" +#line 2547 "runtime.in" // path3 path3(triplearray *pre, triplearray *point, triplearray *post, boolarray *straight, bool cyclic); -void gen182(stack *Stack) +void gen183(stack *Stack) { bool cyclic=vm::pop(Stack); boolarray * straight=vm::pop(Stack); triplearray * post=vm::pop(Stack); triplearray * point=vm::pop(Stack); triplearray * pre=vm::pop(Stack); -#line 2455 "runtime.in" +#line 2549 "runtime.in" size_t n=checkArrays(pre,point); checkEqual(n,checkArray(post)); checkEqual(n,checkArray(straight)); @@ -3295,144 +3395,144 @@ void gen182(stack *Stack) {Stack->push(path3(nodes,(Int) n,cyclic)); return;} } -#line 2471 "runtime.in" +#line 2565 "runtime.in" void nullPath3(stack *Stack) { -#line 2472 "runtime.in" +#line 2566 "runtime.in" {Stack->push(nullpath3); return;} } -#line 2476 "runtime.in" +#line 2570 "runtime.in" // bool ==(path3 a, path3 b); -void gen184(stack *Stack) +void gen185(stack *Stack) { path3 b=vm::pop(Stack); path3 a=vm::pop(Stack); -#line 2477 "runtime.in" +#line 2571 "runtime.in" {Stack->push(a == b); return;} } -#line 2481 "runtime.in" +#line 2575 "runtime.in" // bool !=(path3 a, path3 b); -void gen185(stack *Stack) +void gen186(stack *Stack) { path3 b=vm::pop(Stack); path3 a=vm::pop(Stack); -#line 2482 "runtime.in" +#line 2576 "runtime.in" {Stack->push(!(a == b)); return;} } -#line 2486 "runtime.in" +#line 2580 "runtime.in" // triple point(path3 p, Int t); -void gen186(stack *Stack) +void gen187(stack *Stack) { Int t=vm::pop(Stack); path3 p=vm::pop(Stack); -#line 2487 "runtime.in" +#line 2581 "runtime.in" {Stack->push(p.point((Int) t)); return;} } -#line 2491 "runtime.in" +#line 2585 "runtime.in" // triple point(path3 p, real t); -void gen187(stack *Stack) +void gen188(stack *Stack) { real t=vm::pop(Stack); path3 p=vm::pop(Stack); -#line 2492 "runtime.in" +#line 2586 "runtime.in" {Stack->push(p.point(t)); return;} } -#line 2496 "runtime.in" +#line 2590 "runtime.in" // triple precontrol(path3 p, Int t); -void gen188(stack *Stack) +void gen189(stack *Stack) { Int t=vm::pop(Stack); path3 p=vm::pop(Stack); -#line 2497 "runtime.in" +#line 2591 "runtime.in" {Stack->push(p.precontrol((Int) t)); return;} } -#line 2501 "runtime.in" +#line 2595 "runtime.in" // triple precontrol(path3 p, real t); -void gen189(stack *Stack) +void gen190(stack *Stack) { real t=vm::pop(Stack); path3 p=vm::pop(Stack); -#line 2502 "runtime.in" +#line 2596 "runtime.in" {Stack->push(p.precontrol(t)); return;} } -#line 2506 "runtime.in" +#line 2600 "runtime.in" // triple postcontrol(path3 p, Int t); -void gen190(stack *Stack) +void gen191(stack *Stack) { Int t=vm::pop(Stack); path3 p=vm::pop(Stack); -#line 2507 "runtime.in" +#line 2601 "runtime.in" {Stack->push(p.postcontrol((Int) t)); return;} } -#line 2511 "runtime.in" +#line 2605 "runtime.in" // triple postcontrol(path3 p, real t); -void gen191(stack *Stack) +void gen192(stack *Stack) { real t=vm::pop(Stack); path3 p=vm::pop(Stack); -#line 2512 "runtime.in" +#line 2606 "runtime.in" {Stack->push(p.postcontrol(t)); return;} } -#line 2516 "runtime.in" +#line 2610 "runtime.in" // triple dir(path3 p, Int t, Int sign=0, bool normalize=true); -void gen192(stack *Stack) +void gen193(stack *Stack) { bool normalize=vm::pop(Stack,true); Int sign=vm::pop(Stack,0); Int t=vm::pop(Stack); path3 p=vm::pop(Stack); -#line 2517 "runtime.in" +#line 2611 "runtime.in" {Stack->push(p.dir(t,sign,normalize)); return;} } -#line 2521 "runtime.in" +#line 2615 "runtime.in" // triple dir(path3 p, real t, bool normalize=true); -void gen193(stack *Stack) +void gen194(stack *Stack) { bool normalize=vm::pop(Stack,true); real t=vm::pop(Stack); path3 p=vm::pop(Stack); -#line 2522 "runtime.in" +#line 2616 "runtime.in" {Stack->push(p.dir(t,normalize)); return;} } -#line 2526 "runtime.in" +#line 2620 "runtime.in" // triple accel(path3 p, Int t, Int sign=0); -void gen194(stack *Stack) +void gen195(stack *Stack) { Int sign=vm::pop(Stack,0); Int t=vm::pop(Stack); path3 p=vm::pop(Stack); -#line 2527 "runtime.in" +#line 2621 "runtime.in" {Stack->push(p.accel(t,sign)); return;} } -#line 2531 "runtime.in" +#line 2625 "runtime.in" // triple accel(path3 p, real t); -void gen195(stack *Stack) +void gen196(stack *Stack) { real t=vm::pop(Stack); path3 p=vm::pop(Stack); -#line 2532 "runtime.in" +#line 2626 "runtime.in" {Stack->push(p.accel(t)); return;} } -#line 2536 "runtime.in" +#line 2630 "runtime.in" // real radius(path3 p, real t); -void gen196(stack *Stack) +void gen197(stack *Stack) { real t=vm::pop(Stack); path3 p=vm::pop(Stack); -#line 2537 "runtime.in" +#line 2631 "runtime.in" triple v=p.dir(t,false); triple a=p.accel(t); real d=dot(a,v); @@ -3443,16 +3543,16 @@ void gen196(stack *Stack) {Stack->push(denom > 0 ? r/sqrt(denom) : 0.0); return;} } -#line 2548 "runtime.in" +#line 2642 "runtime.in" // real radius(triple z0, triple c0, triple c1, triple z1, real t); -void gen197(stack *Stack) +void gen198(stack *Stack) { real t=vm::pop(Stack); triple z1=vm::pop(Stack); triple c1=vm::pop(Stack); triple c0=vm::pop(Stack); triple z0=vm::pop(Stack); -#line 2549 "runtime.in" +#line 2643 "runtime.in" triple v=(3.0*(z1-z0)+9.0*(c0-c1))*t*t+(6.0*(z0+c1)-12.0*c0)*t+3.0*(c0-z0); triple a=6.0*(z1-z0+3.0*(c0-c1))*t+6.0*(z0+c1)-12.0*c0; real d=dot(a,v); @@ -3463,85 +3563,85 @@ void gen197(stack *Stack) {Stack->push(denom > 0 ? r/sqrt(denom) : 0.0); return;} } -#line 2560 "runtime.in" +#line 2654 "runtime.in" // path3 reverse(path3 p); -void gen198(stack *Stack) +void gen199(stack *Stack) { path3 p=vm::pop(Stack); -#line 2561 "runtime.in" +#line 2655 "runtime.in" {Stack->push(p.reverse()); return;} } -#line 2565 "runtime.in" +#line 2659 "runtime.in" // path3 subpath(path3 p, Int a, Int b); -void gen199(stack *Stack) +void gen200(stack *Stack) { Int b=vm::pop(Stack); Int a=vm::pop(Stack); path3 p=vm::pop(Stack); -#line 2566 "runtime.in" +#line 2660 "runtime.in" {Stack->push(p.subpath((Int) a, (Int) b)); return;} } -#line 2570 "runtime.in" +#line 2664 "runtime.in" // path3 subpath(path3 p, real a, real b); -void gen200(stack *Stack) +void gen201(stack *Stack) { real b=vm::pop(Stack); real a=vm::pop(Stack); path3 p=vm::pop(Stack); -#line 2571 "runtime.in" +#line 2665 "runtime.in" {Stack->push(p.subpath(a,b)); return;} } -#line 2575 "runtime.in" +#line 2669 "runtime.in" // Int length(path3 p); -void gen201(stack *Stack) +void gen202(stack *Stack) { path3 p=vm::pop(Stack); -#line 2576 "runtime.in" +#line 2670 "runtime.in" {Stack->push(p.length()); return;} } -#line 2580 "runtime.in" +#line 2674 "runtime.in" // bool cyclic(path3 p); -void gen202(stack *Stack) +void gen203(stack *Stack) { path3 p=vm::pop(Stack); -#line 2581 "runtime.in" +#line 2675 "runtime.in" {Stack->push(p.cyclic()); return;} } -#line 2585 "runtime.in" +#line 2679 "runtime.in" // bool straight(path3 p, Int t); -void gen203(stack *Stack) +void gen204(stack *Stack) { Int t=vm::pop(Stack); path3 p=vm::pop(Stack); -#line 2586 "runtime.in" +#line 2680 "runtime.in" {Stack->push(p.straight(t)); return;} } // Return the component of vector v perpendicular to a unit vector u. -#line 2591 "runtime.in" +#line 2685 "runtime.in" // triple perp(triple v, triple u); -void gen204(stack *Stack) +void gen205(stack *Stack) { triple u=vm::pop(Stack); triple v=vm::pop(Stack); -#line 2592 "runtime.in" +#line 2686 "runtime.in" {Stack->push(v-dot(v,u)*u); return;} } // Return the maximum perpendicular deviation of segment i of path3 g // from a straight line. -#line 2598 "runtime.in" +#line 2692 "runtime.in" // real straightness(path3 p, Int t); -void gen205(stack *Stack) +void gen206(stack *Stack) { Int t=vm::pop(Stack); path3 p=vm::pop(Stack); -#line 2599 "runtime.in" +#line 2693 "runtime.in" if(p.straight(t)) {Stack->push(0); return;} triple z0=p.point(t); triple u=unit(p.point(t+1)-z0); @@ -3551,55 +3651,55 @@ void gen205(stack *Stack) // Return the maximum perpendicular deviation of z0..controls c0 and c1..z1 // from a straight line. -#line 2609 "runtime.in" +#line 2703 "runtime.in" // real straightness(triple z0, triple c0, triple c1, triple z1); -void gen206(stack *Stack) +void gen207(stack *Stack) { triple z1=vm::pop(Stack); triple c1=vm::pop(Stack); triple c0=vm::pop(Stack); triple z0=vm::pop(Stack); -#line 2610 "runtime.in" +#line 2704 "runtime.in" triple u=unit(z1-z0); {Stack->push(::max(length(perp(c0-z0,u)),length(perp(c1-z0,u)))); return;} } -#line 2615 "runtime.in" +#line 2709 "runtime.in" // bool piecewisestraight(path3 p); -void gen207(stack *Stack) +void gen208(stack *Stack) { path3 p=vm::pop(Stack); -#line 2616 "runtime.in" +#line 2710 "runtime.in" {Stack->push(p.piecewisestraight()); return;} } -#line 2620 "runtime.in" +#line 2714 "runtime.in" // real arclength(path3 p); -void gen208(stack *Stack) +void gen209(stack *Stack) { path3 p=vm::pop(Stack); -#line 2621 "runtime.in" +#line 2715 "runtime.in" {Stack->push(p.arclength()); return;} } -#line 2625 "runtime.in" +#line 2719 "runtime.in" // real arctime(path3 p, real dval); -void gen209(stack *Stack) +void gen210(stack *Stack) { real dval=vm::pop(Stack); path3 p=vm::pop(Stack); -#line 2626 "runtime.in" +#line 2720 "runtime.in" {Stack->push(p.arctime(dval)); return;} } -#line 2630 "runtime.in" +#line 2724 "runtime.in" // realarray* intersect(path3 p, path3 q, real fuzz=-1); -void gen210(stack *Stack) +void gen211(stack *Stack) { real fuzz=vm::pop(Stack,-1); path3 q=vm::pop(Stack); path3 p=vm::pop(Stack); -#line 2631 "runtime.in" +#line 2725 "runtime.in" bool exact=fuzz <= 0.0; if(fuzz < 0) fuzz=BigFuzz*::max(::max(length(p.max()),length(p.min())), @@ -3616,14 +3716,14 @@ void gen210(stack *Stack) {Stack->push(new array(0)); return;} } -#line 2648 "runtime.in" +#line 2742 "runtime.in" // realarray2* intersections(path3 p, path3 q, real fuzz=-1); -void gen211(stack *Stack) +void gen212(stack *Stack) { real fuzz=vm::pop(Stack,-1); path3 q=vm::pop(Stack); path3 p=vm::pop(Stack); -#line 2649 "runtime.in" +#line 2743 "runtime.in" bool exact=fuzz <= 0.0; if(fuzz < 0) fuzz=BigFuzz*::max(::max(length(p.max()),length(p.min())), @@ -3655,49 +3755,49 @@ void gen211(stack *Stack) {Stack->push(V); return;} } -#line 2681 "runtime.in" +#line 2775 "runtime.in" // Int size(path3 p); -void gen212(stack *Stack) +void gen213(stack *Stack) { path3 p=vm::pop(Stack); -#line 2682 "runtime.in" +#line 2776 "runtime.in" {Stack->push(p.size()); return;} } -#line 2686 "runtime.in" +#line 2780 "runtime.in" // path3 &(path3 p, path3 q); -void gen213(stack *Stack) +void gen214(stack *Stack) { path3 q=vm::pop(Stack); path3 p=vm::pop(Stack); -#line 2687 "runtime.in" +#line 2781 "runtime.in" {Stack->push(camp::concat(p,q)); return;} } -#line 2691 "runtime.in" +#line 2785 "runtime.in" // triple min(path3 p); -void gen214(stack *Stack) +void gen215(stack *Stack) { path3 p=vm::pop(Stack); -#line 2692 "runtime.in" +#line 2786 "runtime.in" {Stack->push(p.min()); return;} } -#line 2696 "runtime.in" +#line 2790 "runtime.in" // triple max(path3 p); -void gen215(stack *Stack) +void gen216(stack *Stack) { path3 p=vm::pop(Stack); -#line 2697 "runtime.in" +#line 2791 "runtime.in" {Stack->push(p.max()); return;} } -#line 2701 "runtime.in" +#line 2795 "runtime.in" // realarray* mintimes(path3 p); -void gen216(stack *Stack) +void gen217(stack *Stack) { path3 p=vm::pop(Stack); -#line 2702 "runtime.in" +#line 2796 "runtime.in" array *V=new array(3); triple v=p.mintimes(); (*V)[0]=v.getx(); @@ -3706,12 +3806,12 @@ void gen216(stack *Stack) {Stack->push(V); return;} } -#line 2711 "runtime.in" +#line 2805 "runtime.in" // realarray* maxtimes(path3 p); -void gen217(stack *Stack) +void gen218(stack *Stack) { path3 p=vm::pop(Stack); -#line 2712 "runtime.in" +#line 2806 "runtime.in" array *V=new array(3); triple v=p.maxtimes(); (*V)[0]=v.getx(); @@ -3720,30 +3820,30 @@ void gen217(stack *Stack) {Stack->push(V); return;} } -#line 2721 "runtime.in" +#line 2815 "runtime.in" // path3 *(realarray2 *t, path3 g); -void gen218(stack *Stack) +void gen219(stack *Stack) { path3 g=vm::pop(Stack); realarray2 * t=vm::pop(Stack); -#line 2722 "runtime.in" +#line 2816 "runtime.in" {Stack->push(transformed(*t,g)); return;} } // Guide operations -#line 2728 "runtime.in" +#line 2822 "runtime.in" void nullGuide(stack *Stack) { -#line 2729 "runtime.in" +#line 2823 "runtime.in" {Stack->push(new pathguide(path())); return;} } -#line 2734 "runtime.in" +#line 2828 "runtime.in" void dotsGuide(stack *Stack) { guidearray * a=vm::pop(Stack); -#line 2735 "runtime.in" +#line 2829 "runtime.in" guidevector v; size_t size=checkArray(a); for (size_t i=0; i < size; ++i) @@ -3752,11 +3852,11 @@ void dotsGuide(stack *Stack) {Stack->push(new multiguide(v)); return;} } -#line 2744 "runtime.in" +#line 2838 "runtime.in" void dashesGuide(stack *Stack) { guidearray * a=vm::pop(Stack); -#line 2745 "runtime.in" +#line 2839 "runtime.in" static camp::curlSpec curly; static specguide curlout(&curly, camp::OUT); static specguide curlin(&curly, camp::IN); @@ -3782,179 +3882,179 @@ void dashesGuide(stack *Stack) {Stack->push(new multiguide(v)); return;} } -#line 2771 "runtime.in" +#line 2865 "runtime.in" void newCycleToken(stack *Stack) { -#line 2772 "runtime.in" +#line 2866 "runtime.in" {Stack->push(cycleToken()); return;} } -#line 2776 "runtime.in" +#line 2870 "runtime.in" // guide* operator cast(cycleToken tok); -void gen223(stack *Stack) +void gen224(stack *Stack) { cycleToken tok=vm::pop(Stack); -#line 2777 "runtime.in" +#line 2871 "runtime.in" // Avoid unused variable warning messages. unused(&tok); {Stack->push(new cycletokguide()); return;} } -#line 2783 "runtime.in" +#line 2877 "runtime.in" // guide* operator spec(pair z, Int p); -void gen224(stack *Stack) +void gen225(stack *Stack) { Int p=vm::pop(Stack); pair z=vm::pop(Stack); -#line 2784 "runtime.in" +#line 2878 "runtime.in" camp::side d=(camp::side) p; camp::dirSpec *sp=new camp::dirSpec(z); {Stack->push(new specguide(sp,d)); return;} } -#line 2791 "runtime.in" +#line 2885 "runtime.in" // curlSpecifier operator curl(real gamma, Int p); -void gen225(stack *Stack) +void gen226(stack *Stack) { Int p=vm::pop(Stack); real gamma=vm::pop(Stack); -#line 2792 "runtime.in" +#line 2886 "runtime.in" camp::side s=(camp::side) p; {Stack->push(curlSpecifier(gamma,s)); return;} } -#line 2797 "runtime.in" +#line 2891 "runtime.in" void curlSpecifierValuePart(stack *Stack) { curlSpecifier spec=vm::pop(Stack); -#line 2798 "runtime.in" +#line 2892 "runtime.in" {Stack->push(spec.getValue()); return;} } -#line 2802 "runtime.in" +#line 2896 "runtime.in" void curlSpecifierSidePart(stack *Stack) { curlSpecifier spec=vm::pop(Stack); -#line 2803 "runtime.in" +#line 2897 "runtime.in" {Stack->push(spec.getSide()); return;} } -#line 2807 "runtime.in" +#line 2901 "runtime.in" // guide* operator cast(curlSpecifier spec); -void gen228(stack *Stack) +void gen229(stack *Stack) { curlSpecifier spec=vm::pop(Stack); -#line 2808 "runtime.in" +#line 2902 "runtime.in" {Stack->push(new specguide(spec)); return;} } -#line 2812 "runtime.in" +#line 2906 "runtime.in" // tensionSpecifier operator tension(real tout, real tin, bool atleast); -void gen229(stack *Stack) +void gen230(stack *Stack) { bool atleast=vm::pop(Stack); real tin=vm::pop(Stack); real tout=vm::pop(Stack); -#line 2813 "runtime.in" +#line 2907 "runtime.in" {Stack->push(tensionSpecifier(tout, tin, atleast)); return;} } -#line 2817 "runtime.in" +#line 2911 "runtime.in" void tensionSpecifierOutPart(stack *Stack) { tensionSpecifier t=vm::pop(Stack); -#line 2818 "runtime.in" +#line 2912 "runtime.in" {Stack->push(t.getOut()); return;} } -#line 2822 "runtime.in" +#line 2916 "runtime.in" void tensionSpecifierInPart(stack *Stack) { tensionSpecifier t=vm::pop(Stack); -#line 2823 "runtime.in" +#line 2917 "runtime.in" {Stack->push(t.getIn()); return;} } -#line 2827 "runtime.in" +#line 2921 "runtime.in" void tensionSpecifierAtleastPart(stack *Stack) { tensionSpecifier t=vm::pop(Stack); -#line 2828 "runtime.in" +#line 2922 "runtime.in" {Stack->push(t.getAtleast()); return;} } -#line 2832 "runtime.in" +#line 2926 "runtime.in" // guide* operator cast(tensionSpecifier t); -void gen233(stack *Stack) +void gen234(stack *Stack) { tensionSpecifier t=vm::pop(Stack); -#line 2833 "runtime.in" +#line 2927 "runtime.in" {Stack->push(new tensionguide(t)); return;} } -#line 2837 "runtime.in" +#line 2931 "runtime.in" // guide* operator controls(pair zout, pair zin); -void gen234(stack *Stack) +void gen235(stack *Stack) { pair zin=vm::pop(Stack); pair zout=vm::pop(Stack); -#line 2838 "runtime.in" +#line 2932 "runtime.in" {Stack->push(new controlguide(zout, zin)); return;} } -#line 2842 "runtime.in" +#line 2936 "runtime.in" // Int size(guide *g); -void gen235(stack *Stack) +void gen236(stack *Stack) { guide * g=vm::pop(Stack); -#line 2843 "runtime.in" +#line 2937 "runtime.in" flatguide f; g->flatten(f,false); {Stack->push(f.size()); return;} } -#line 2849 "runtime.in" +#line 2943 "runtime.in" // Int length(guide *g); -void gen236(stack *Stack) +void gen237(stack *Stack) { guide * g=vm::pop(Stack); -#line 2850 "runtime.in" +#line 2944 "runtime.in" flatguide f; g->flatten(f,false); {Stack->push(g->cyclic() ? f.size() : f.size()-1); return;} } -#line 2856 "runtime.in" +#line 2950 "runtime.in" // bool cyclic(guide *g); -void gen237(stack *Stack) +void gen238(stack *Stack) { guide * g=vm::pop(Stack); -#line 2857 "runtime.in" +#line 2951 "runtime.in" flatguide f; g->flatten(f,false); {Stack->push(g->cyclic()); return;} } -#line 2863 "runtime.in" +#line 2957 "runtime.in" // pair point(guide *g, Int t); -void gen238(stack *Stack) +void gen239(stack *Stack) { Int t=vm::pop(Stack); guide * g=vm::pop(Stack); -#line 2864 "runtime.in" +#line 2958 "runtime.in" flatguide f; g->flatten(f,false); {Stack->push(f.Nodes(adjustedIndex(t,f.size(),g->cyclic())).z); return;} } -#line 2870 "runtime.in" +#line 2964 "runtime.in" // pairarray* dirSpecifier(guide *g, Int t); -void gen239(stack *Stack) +void gen240(stack *Stack) { Int t=vm::pop(Stack); guide * g=vm::pop(Stack); -#line 2871 "runtime.in" +#line 2965 "runtime.in" flatguide f; g->flatten(f,false); Int n=f.size(); @@ -3965,13 +4065,13 @@ void gen239(stack *Stack) {Stack->push(c); return;} } -#line 2882 "runtime.in" +#line 2976 "runtime.in" // pairarray* controlSpecifier(guide *g, Int t); -void gen240(stack *Stack) +void gen241(stack *Stack) { Int t=vm::pop(Stack); guide * g=vm::pop(Stack); -#line 2883 "runtime.in" +#line 2977 "runtime.in" flatguide f; g->flatten(f,false); Int n=f.size(); @@ -3987,13 +4087,13 @@ void gen240(stack *Stack) } else {Stack->push(new array(0)); return;} } -#line 2899 "runtime.in" +#line 2993 "runtime.in" // tensionSpecifier tensionSpecifier(guide *g, Int t); -void gen241(stack *Stack) +void gen242(stack *Stack) { Int t=vm::pop(Stack); guide * g=vm::pop(Stack); -#line 2900 "runtime.in" +#line 2994 "runtime.in" flatguide f; g->flatten(f,false); Int n=f.size(); @@ -4002,13 +4102,13 @@ void gen241(stack *Stack) {Stack->push(tensionSpecifier(curr.tout.val,f.Nodes(t+1).tin.val,curr.tout.atleast)); return;} } -#line 2909 "runtime.in" +#line 3003 "runtime.in" // realarray* curlSpecifier(guide *g, Int t); -void gen242(stack *Stack) +void gen243(stack *Stack) { Int t=vm::pop(Stack); guide * g=vm::pop(Stack); -#line 2910 "runtime.in" +#line 3004 "runtime.in" flatguide f; g->flatten(f,false); Int n=f.size(); @@ -4021,12 +4121,12 @@ void gen242(stack *Stack) {Stack->push(c); return;} } -#line 2923 "runtime.in" +#line 3017 "runtime.in" // guide* reverse(guide *g); -void gen243(stack *Stack) +void gen244(stack *Stack) { guide * g=vm::pop(Stack); -#line 2924 "runtime.in" +#line 3018 "runtime.in" flatguide f; g->flatten(f,false); if(f.precyclic()) @@ -4081,20 +4181,20 @@ void gen243(stack *Stack) // Three-dimensional picture and surface operations -#line 2979 "runtime.in" +#line 3073 "runtime.in" // void _draw(picture *f, path3 g, pen p); -void gen244(stack *Stack) +void gen245(stack *Stack) { pen p=vm::pop(Stack); path3 g=vm::pop(Stack); picture * f=vm::pop(Stack); -#line 2980 "runtime.in" +#line 3074 "runtime.in" f->append(new drawPath3(g,p)); } -#line 2985 "runtime.in" +#line 3079 "runtime.in" // void draw(picture *f, triplearray2 *g, bool straight, penarray *p, real opacity, real shininess, real granularity, triple normal, bool lighton, penarray *colors); -void gen245(stack *Stack) +void gen246(stack *Stack) { penarray * colors=vm::pop(Stack); bool lighton=vm::pop(Stack); @@ -4106,107 +4206,107 @@ void gen245(stack *Stack) bool straight=vm::pop(Stack); triplearray2 * g=vm::pop(Stack); picture * f=vm::pop(Stack); -#line 2988 "runtime.in" +#line 3082 "runtime.in" f->append(new drawSurface(*g,straight,*p,opacity,shininess,granularity, normal,lighton,*colors)); } -#line 2993 "runtime.in" +#line 3087 "runtime.in" // triple min3(picture *f); -void gen246(stack *Stack) +void gen247(stack *Stack) { picture * f=vm::pop(Stack); -#line 2994 "runtime.in" +#line 3088 "runtime.in" {Stack->push(f->bounds3().Min()); return;} } -#line 2998 "runtime.in" +#line 3092 "runtime.in" // triple max3(picture *f); -void gen247(stack *Stack) +void gen248(stack *Stack) { picture * f=vm::pop(Stack); -#line 2999 "runtime.in" +#line 3093 "runtime.in" {Stack->push(f->bounds3().Max()); return;} } -#line 3003 "runtime.in" +#line 3097 "runtime.in" // pair min(picture *f, realarray2 *t); -void gen248(stack *Stack) +void gen249(stack *Stack) { realarray2 * t=vm::pop(Stack); picture * f=vm::pop(Stack); -#line 3004 "runtime.in" +#line 3098 "runtime.in" real *T=copyArray2C(t,4); pair m=f->bounds(::min,xproject,yproject,T); delete[] T; {Stack->push(m); return;} } -#line 3011 "runtime.in" +#line 3105 "runtime.in" // pair max(picture *f, realarray2 *t); -void gen249(stack *Stack) +void gen250(stack *Stack) { realarray2 * t=vm::pop(Stack); picture * f=vm::pop(Stack); -#line 3012 "runtime.in" +#line 3106 "runtime.in" real *T=copyArray2C(t,4); pair M=f->bounds(::max,xproject,yproject,T); delete[] T; {Stack->push(M); return;} } -#line 3019 "runtime.in" +#line 3113 "runtime.in" // pair minratio(picture *f); -void gen250(stack *Stack) +void gen251(stack *Stack) { picture * f=vm::pop(Stack); -#line 3020 "runtime.in" +#line 3114 "runtime.in" {Stack->push(f->bounds(::min,xratio,yratio)); return;} } -#line 3024 "runtime.in" +#line 3118 "runtime.in" // pair maxratio(picture *f); -void gen251(stack *Stack) +void gen252(stack *Stack) { picture * f=vm::pop(Stack); -#line 3025 "runtime.in" +#line 3119 "runtime.in" {Stack->push(f->bounds(::max,xratio,yratio)); return;} } -#line 3029 "runtime.in" +#line 3123 "runtime.in" // real minbound(realarray *a, real b); -void gen252(stack *Stack) +void gen253(stack *Stack) { real b=vm::pop(Stack); realarray * a=vm::pop(Stack); -#line 3030 "runtime.in" +#line 3124 "runtime.in" real *A=copyArrayC(a,16); b=bound(A,::min,b); delete[] A; {Stack->push(b); return;} } -#line 3037 "runtime.in" +#line 3131 "runtime.in" // real maxbound(realarray *a, real b); -void gen253(stack *Stack) +void gen254(stack *Stack) { real b=vm::pop(Stack); realarray * a=vm::pop(Stack); -#line 3038 "runtime.in" +#line 3132 "runtime.in" real *A=copyArrayC(a,16); b=bound(A,::max,b); delete[] A; {Stack->push(b); return;} } -#line 3045 "runtime.in" +#line 3139 "runtime.in" // pair minbound(triplearray *a, realarray2 *t, pair b); -void gen254(stack *Stack) +void gen255(stack *Stack) { pair b=vm::pop(Stack); realarray2 * t=vm::pop(Stack); triplearray * a=vm::pop(Stack); -#line 3046 "runtime.in" +#line 3140 "runtime.in" triple *A=copyTripleArrayC(a,16); real *T=copyArray2C(t,4); b=pair(bound(A,::min,xproject,T,b.getx()), @@ -4216,14 +4316,14 @@ void gen254(stack *Stack) {Stack->push(b); return;} } -#line 3056 "runtime.in" +#line 3150 "runtime.in" // pair maxbound(triplearray *a, realarray2 *t, pair b); -void gen255(stack *Stack) +void gen256(stack *Stack) { pair b=vm::pop(Stack); realarray2 * t=vm::pop(Stack); triplearray * a=vm::pop(Stack); -#line 3057 "runtime.in" +#line 3151 "runtime.in" triple *A=copyTripleArrayC(a,16); real *T=copyArray2C(t,4); b=pair(bound(A,::max,xproject,T,b.getx()), @@ -4233,38 +4333,38 @@ void gen255(stack *Stack) {Stack->push(b); return;} } -#line 3067 "runtime.in" +#line 3161 "runtime.in" // pair max(path3 g, realarray2 *t); -void gen256(stack *Stack) +void gen257(stack *Stack) { realarray2 * t=vm::pop(Stack); path3 g=vm::pop(Stack); -#line 3068 "runtime.in" +#line 3162 "runtime.in" real *T=copyArray2C(t,4); pair b=g.bounds(::max,xproject,yproject,T); delete[] T; {Stack->push(b); return;} } -#line 3075 "runtime.in" +#line 3169 "runtime.in" // pair min(path3 g, realarray2 *t); -void gen257(stack *Stack) +void gen258(stack *Stack) { realarray2 * t=vm::pop(Stack); path3 g=vm::pop(Stack); -#line 3076 "runtime.in" +#line 3170 "runtime.in" real *T=copyArray2C(t,4); pair b=g.bounds(::min,xproject,yproject,T); delete[] T; {Stack->push(b); return;} } -#line 3083 "runtime.in" +#line 3177 "runtime.in" // real change2(triplearray2 *a); -void gen258(stack *Stack) +void gen259(stack *Stack) { triplearray2 * a=vm::pop(Stack); -#line 3084 "runtime.in" +#line 3178 "runtime.in" size_t n=checkArray(a); if(n == 0) {Stack->push(0.0); return;} @@ -4285,241 +4385,241 @@ void gen258(stack *Stack) {Stack->push(M); return;} } -#line 3105 "runtime.in" +#line 3199 "runtime.in" // bool is3D(picture *f); -void gen259(stack *Stack) +void gen260(stack *Stack) { picture * f=vm::pop(Stack); -#line 3106 "runtime.in" +#line 3200 "runtime.in" {Stack->push(f->have3D()); return;} } -#line 3110 "runtime.in" +#line 3204 "runtime.in" // pair bezier(pair a, pair b, pair c, pair d, real t); -void gen260(stack *Stack) +void gen261(stack *Stack) { real t=vm::pop(Stack); pair d=vm::pop(Stack); pair c=vm::pop(Stack); pair b=vm::pop(Stack); pair a=vm::pop(Stack); -#line 3111 "runtime.in" +#line 3205 "runtime.in" real onemt=1-t; real onemt2=onemt*onemt; {Stack->push(onemt2*onemt*a+t*(3.0*(onemt2*b+t*onemt*c)+t*t*d)); return;} } -#line 3117 "runtime.in" +#line 3211 "runtime.in" // pair bezierP(pair a, pair b, pair c, pair d, real t); -void gen261(stack *Stack) +void gen262(stack *Stack) { real t=vm::pop(Stack); pair d=vm::pop(Stack); pair c=vm::pop(Stack); pair b=vm::pop(Stack); pair a=vm::pop(Stack); -#line 3118 "runtime.in" +#line 3212 "runtime.in" {Stack->push(3.0*(t*t*(d-a+3.0*(b-c))+t*(2.0*(a+c)-4.0*b)+b-a)); return;} } -#line 3122 "runtime.in" +#line 3216 "runtime.in" // pair bezierPP(pair a, pair b, pair c, pair d, real t); -void gen262(stack *Stack) +void gen263(stack *Stack) { real t=vm::pop(Stack); pair d=vm::pop(Stack); pair c=vm::pop(Stack); pair b=vm::pop(Stack); pair a=vm::pop(Stack); -#line 3123 "runtime.in" +#line 3217 "runtime.in" {Stack->push(6.0*(t*(d-a+3.0*(b-c))+a+c-2.0*b)); return;} } -#line 3127 "runtime.in" +#line 3221 "runtime.in" // pair bezierPPP(pair a, pair b, pair c, pair d); -void gen263(stack *Stack) +void gen264(stack *Stack) { pair d=vm::pop(Stack); pair c=vm::pop(Stack); pair b=vm::pop(Stack); pair a=vm::pop(Stack); -#line 3128 "runtime.in" +#line 3222 "runtime.in" {Stack->push(6.0*(d-a+3.0*(b-c))); return;} } -#line 3132 "runtime.in" +#line 3226 "runtime.in" // triple bezier(triple a, triple b, triple c, triple d, real t); -void gen264(stack *Stack) +void gen265(stack *Stack) { real t=vm::pop(Stack); triple d=vm::pop(Stack); triple c=vm::pop(Stack); triple b=vm::pop(Stack); triple a=vm::pop(Stack); -#line 3133 "runtime.in" +#line 3227 "runtime.in" real onemt=1-t; real onemt2=onemt*onemt; {Stack->push(onemt2*onemt*a+t*(3.0*(onemt2*b+t*onemt*c)+t*t*d)); return;} } -#line 3139 "runtime.in" +#line 3233 "runtime.in" // triple bezierP(triple a, triple b, triple c, triple d, real t); -void gen265(stack *Stack) +void gen266(stack *Stack) { real t=vm::pop(Stack); triple d=vm::pop(Stack); triple c=vm::pop(Stack); triple b=vm::pop(Stack); triple a=vm::pop(Stack); -#line 3140 "runtime.in" +#line 3234 "runtime.in" {Stack->push(3.0*(t*t*(d-a+3.0*(b-c))+t*(2.0*(a+c)-4.0*b)+b-a)); return;} } -#line 3144 "runtime.in" +#line 3238 "runtime.in" // triple bezierPP(triple a, triple b, triple c, triple d, real t); -void gen266(stack *Stack) +void gen267(stack *Stack) { real t=vm::pop(Stack); triple d=vm::pop(Stack); triple c=vm::pop(Stack); triple b=vm::pop(Stack); triple a=vm::pop(Stack); -#line 3145 "runtime.in" +#line 3239 "runtime.in" {Stack->push(6.0*(t*(d-a+3.0*(b-c))+a+c-2.0*b)); return;} } -#line 3149 "runtime.in" +#line 3243 "runtime.in" // triple bezierPPP(triple a, triple b, triple c, triple d); -void gen267(stack *Stack) +void gen268(stack *Stack) { triple d=vm::pop(Stack); triple c=vm::pop(Stack); triple b=vm::pop(Stack); triple a=vm::pop(Stack); -#line 3150 "runtime.in" +#line 3244 "runtime.in" {Stack->push(6.0*(d-a+3.0*(b-c))); return;} } // String operations -#line 3156 "runtime.in" +#line 3250 "runtime.in" void emptyString(stack *Stack) { -#line 3157 "runtime.in" +#line 3251 "runtime.in" {Stack->push(emptystring); return;} } -#line 3162 "runtime.in" +#line 3256 "runtime.in" // Int length(string *s); -void gen269(stack *Stack) +void gen270(stack *Stack) { string * s=vm::pop(Stack); -#line 3163 "runtime.in" +#line 3257 "runtime.in" {Stack->push((Int) s->length()); return;} } -#line 3167 "runtime.in" +#line 3261 "runtime.in" // Int find(string *s, string t, Int pos=0); -void gen270(stack *Stack) +void gen271(stack *Stack) { Int pos=vm::pop(Stack,0); string t=vm::pop(Stack); string * s=vm::pop(Stack); -#line 3168 "runtime.in" +#line 3262 "runtime.in" size_t n=s->find(t,pos); {Stack->push(n == string::npos ? (Int) -1 : (Int) n); return;} } -#line 3173 "runtime.in" +#line 3267 "runtime.in" // Int rfind(string *s, string t, Int pos=-1); -void gen271(stack *Stack) +void gen272(stack *Stack) { Int pos=vm::pop(Stack,-1); string t=vm::pop(Stack); string * s=vm::pop(Stack); -#line 3174 "runtime.in" +#line 3268 "runtime.in" size_t n=s->rfind(t,pos); {Stack->push(n == string::npos ? (Int) -1 : (Int) n); return;} } -#line 3179 "runtime.in" +#line 3273 "runtime.in" // string reverse(string s); -void gen272(stack *Stack) +void gen273(stack *Stack) { string s=vm::pop(Stack); -#line 3180 "runtime.in" +#line 3274 "runtime.in" reverse(s.begin(),s.end()); {Stack->push(s); return;} } -#line 3185 "runtime.in" +#line 3279 "runtime.in" // string insert(string s, Int pos, string t); -void gen273(stack *Stack) +void gen274(stack *Stack) { string t=vm::pop(Stack); Int pos=vm::pop(Stack); string s=vm::pop(Stack); -#line 3186 "runtime.in" +#line 3280 "runtime.in" if ((size_t) pos < s.length()) {Stack->push(s.insert(pos,t)); return;} {Stack->push(s); return;} } -#line 3192 "runtime.in" +#line 3286 "runtime.in" // string substr(string* s, Int pos, Int n=-1); -void gen274(stack *Stack) +void gen275(stack *Stack) { Int n=vm::pop(Stack,-1); Int pos=vm::pop(Stack); string* s=vm::pop(Stack); -#line 3193 "runtime.in" +#line 3287 "runtime.in" if ((size_t) pos < s->length()) {Stack->push(s->substr(pos,n)); return;} {Stack->push(emptystring); return;} } -#line 3199 "runtime.in" +#line 3293 "runtime.in" // string erase(string s, Int pos, Int n); -void gen275(stack *Stack) +void gen276(stack *Stack) { Int n=vm::pop(Stack); Int pos=vm::pop(Stack); string s=vm::pop(Stack); -#line 3200 "runtime.in" +#line 3294 "runtime.in" if ((size_t) pos < s.length()) {Stack->push(s.erase(pos,n)); return;} {Stack->push(s); return;} } -#line 3206 "runtime.in" +#line 3300 "runtime.in" // string downcase(string s); -void gen276(stack *Stack) +void gen277(stack *Stack) { string s=vm::pop(Stack); -#line 3207 "runtime.in" +#line 3301 "runtime.in" std::transform(s.begin(),s.end(),s.begin(),tolower); {Stack->push(s); return;} } -#line 3212 "runtime.in" +#line 3306 "runtime.in" // string upcase(string s); -void gen277(stack *Stack) +void gen278(stack *Stack) { string s=vm::pop(Stack); -#line 3213 "runtime.in" +#line 3307 "runtime.in" std::transform(s.begin(),s.end(),s.begin(),toupper); {Stack->push(s); return;} } // returns a string constructed by translating all occurrences of the string // from in an array of string pairs {from,to} to the string to in string s. -#line 3220 "runtime.in" +#line 3314 "runtime.in" // string replace(string *S, stringarray2 *translate); -void gen278(stack *Stack) +void gen279(stack *Stack) { stringarray2 * translate=vm::pop(Stack); string * S=vm::pop(Stack); -#line 3221 "runtime.in" +#line 3315 "runtime.in" size_t size=checkArray(translate); for(size_t i=0; i < size; i++) { array *a=read(translate,i); @@ -4543,13 +4643,13 @@ void gen278(stack *Stack) {Stack->push(buf.str()); return;} } -#line 3245 "runtime.in" +#line 3339 "runtime.in" // string format(string *format, Int x); -void gen279(stack *Stack) +void gen280(stack *Stack) { Int x=vm::pop(Stack); string * format=vm::pop(Stack); -#line 3246 "runtime.in" +#line 3340 "runtime.in" const char *f=format->c_str(); checkformat(f,true); @@ -4563,14 +4663,14 @@ void gen279(stack *Stack) {Stack->push(s); return;} } -#line 3260 "runtime.in" +#line 3354 "runtime.in" // string format(string *format, real x, string locale=emptystring); -void gen280(stack *Stack) +void gen281(stack *Stack) { string locale=vm::pop(Stack,emptystring); real x=vm::pop(Stack); string * format=vm::pop(Stack); -#line 3261 "runtime.in" +#line 3355 "runtime.in" ostringstream out; checkformat(format->c_str(),false); @@ -4687,12 +4787,12 @@ void gen280(stack *Stack) {Stack->push(out.str()); return;} } -#line 3378 "runtime.in" +#line 3472 "runtime.in" // Int hex(string s); -void gen281(stack *Stack) +void gen282(stack *Stack) { string s=vm::pop(Stack); -#line 3379 "runtime.in" +#line 3473 "runtime.in" istringstream is(s); is.setf(std::ios::hex,std::ios::basefield); Int value; @@ -4702,36 +4802,36 @@ void gen281(stack *Stack) error(buf); } -#line 3389 "runtime.in" +#line 3483 "runtime.in" // string string(Int x); -void gen282(stack *Stack) +void gen283(stack *Stack) { Int x=vm::pop(Stack); -#line 3390 "runtime.in" +#line 3484 "runtime.in" ostringstream buf; buf << x; {Stack->push(buf.str()); return;} } -#line 3396 "runtime.in" +#line 3490 "runtime.in" // string string(real x, Int digits=DBL_DIG); -void gen283(stack *Stack) +void gen284(stack *Stack) { Int digits=vm::pop(Stack,DBL_DIG); real x=vm::pop(Stack); -#line 3397 "runtime.in" +#line 3491 "runtime.in" ostringstream buf; buf.precision(digits); buf << x; {Stack->push(buf.str()); return;} } -#line 3404 "runtime.in" +#line 3498 "runtime.in" // string time(string format=defaulttimeformat); -void gen284(stack *Stack) +void gen285(stack *Stack) { string format=vm::pop(Stack,defaulttimeformat); -#line 3405 "runtime.in" +#line 3499 "runtime.in" #ifdef HAVE_STRFTIME const time_t bintime=time(NULL); if(!strftime(Time,nTime,format.c_str(),localtime(&bintime))) {Stack->push(""); return;} @@ -4741,13 +4841,13 @@ void gen284(stack *Stack) #endif } -#line 3415 "runtime.in" +#line 3509 "runtime.in" // string time(Int seconds, string format=defaulttimeformat); -void gen285(stack *Stack) +void gen286(stack *Stack) { string format=vm::pop(Stack,defaulttimeformat); Int seconds=vm::pop(Stack); -#line 3416 "runtime.in" +#line 3510 "runtime.in" #ifdef HAVE_STRFTIME const time_t bintime=seconds; if(!strftime(Time,nTime,format.c_str(),localtime(&bintime))) {Stack->push(""); return;} @@ -4759,13 +4859,13 @@ void gen285(stack *Stack) #endif } -#line 3428 "runtime.in" +#line 3522 "runtime.in" // Int seconds(string t=emptystring, string format=emptystring); -void gen286(stack *Stack) +void gen287(stack *Stack) { string format=vm::pop(Stack,emptystring); string t=vm::pop(Stack,emptystring); -#line 3429 "runtime.in" +#line 3523 "runtime.in" #if defined(HAVE_STRPTIME) const time_t bintime=time(NULL); tm tm=*localtime(&bintime); @@ -4776,11 +4876,11 @@ void gen286(stack *Stack) #endif } -#line 3440 "runtime.in" +#line 3534 "runtime.in" // realarray* _cputime(); -void gen287(stack *Stack) +void gen288(stack *Stack) { -#line 3441 "runtime.in" +#line 3535 "runtime.in" static const real ticktime=1.0/sysconf(_SC_CLK_TCK); struct tms buf; @@ -4795,234 +4895,234 @@ void gen287(stack *Stack) // Math -#line 3456 "runtime.in" +#line 3550 "runtime.in" // real ^(real x, Int y); -void gen288(stack *Stack) +void gen289(stack *Stack) { Int y=vm::pop(Stack); real x=vm::pop(Stack); -#line 3457 "runtime.in" +#line 3551 "runtime.in" {Stack->push(pow(x,y)); return;} } -#line 3462 "runtime.in" +#line 3556 "runtime.in" // pair ^(pair z, Int y); -void gen289(stack *Stack) +void gen290(stack *Stack) { Int y=vm::pop(Stack); pair z=vm::pop(Stack); -#line 3463 "runtime.in" +#line 3557 "runtime.in" {Stack->push(pow(z,y)); return;} } -#line 3467 "runtime.in" +#line 3561 "runtime.in" // Int quotient(Int x, Int y); -void gen290(stack *Stack) +void gen291(stack *Stack) { Int y=vm::pop(Stack); Int x=vm::pop(Stack); -#line 3468 "runtime.in" +#line 3562 "runtime.in" if(y == 0) dividebyzero(); if(y == -1) {Stack->push(Negate(x)); return;} // Implementation-independent definition of integer division: round down {Stack->push((x-portableMod(x,y))/y); return;} } -#line 3475 "runtime.in" +#line 3569 "runtime.in" // Int abs(Int x); -void gen291(stack *Stack) +void gen292(stack *Stack) { Int x=vm::pop(Stack); -#line 3476 "runtime.in" +#line 3570 "runtime.in" {Stack->push(Abs(x)); return;} } -#line 3480 "runtime.in" +#line 3574 "runtime.in" // Int sgn(real x); -void gen292(stack *Stack) +void gen293(stack *Stack) { real x=vm::pop(Stack); -#line 3481 "runtime.in" +#line 3575 "runtime.in" {Stack->push(sgn(x)); return;} } -#line 3485 "runtime.in" +#line 3579 "runtime.in" // Int rand(); -void gen293(stack *Stack) +void gen294(stack *Stack) { -#line 3486 "runtime.in" +#line 3580 "runtime.in" {Stack->push(rand()); return;} } -#line 3490 "runtime.in" +#line 3584 "runtime.in" // void srand(Int seed); -void gen294(stack *Stack) +void gen295(stack *Stack) { Int seed=vm::pop(Stack); -#line 3491 "runtime.in" +#line 3585 "runtime.in" srand(intcast(seed)); } // a random number uniformly distributed in the interval [0,1] -#line 3496 "runtime.in" +#line 3590 "runtime.in" // real unitrand(); -void gen295(stack *Stack) +void gen296(stack *Stack) { -#line 3497 "runtime.in" +#line 3591 "runtime.in" {Stack->push(((real) rand())/RAND_MAX); return;} } -#line 3501 "runtime.in" +#line 3595 "runtime.in" // Int ceil(real x); -void gen296(stack *Stack) +void gen297(stack *Stack) { real x=vm::pop(Stack); -#line 3502 "runtime.in" +#line 3596 "runtime.in" {Stack->push(Intcast(ceil(x))); return;} } -#line 3506 "runtime.in" +#line 3600 "runtime.in" // Int floor(real x); -void gen297(stack *Stack) +void gen298(stack *Stack) { real x=vm::pop(Stack); -#line 3507 "runtime.in" +#line 3601 "runtime.in" {Stack->push(Intcast(floor(x))); return;} } -#line 3511 "runtime.in" +#line 3605 "runtime.in" // Int round(real x); -void gen298(stack *Stack) +void gen299(stack *Stack) { real x=vm::pop(Stack); -#line 3512 "runtime.in" +#line 3606 "runtime.in" if(validInt(x)) {Stack->push(Round(x)); return;} integeroverflow(0); } -#line 3517 "runtime.in" +#line 3611 "runtime.in" // Int Ceil(real x); -void gen299(stack *Stack) +void gen300(stack *Stack) { real x=vm::pop(Stack); -#line 3518 "runtime.in" +#line 3612 "runtime.in" {Stack->push(Ceil(x)); return;} } -#line 3522 "runtime.in" +#line 3616 "runtime.in" // Int Floor(real x); -void gen300(stack *Stack) +void gen301(stack *Stack) { real x=vm::pop(Stack); -#line 3523 "runtime.in" +#line 3617 "runtime.in" {Stack->push(Floor(x)); return;} } -#line 3527 "runtime.in" +#line 3621 "runtime.in" // Int Round(real x); -void gen301(stack *Stack) +void gen302(stack *Stack) { real x=vm::pop(Stack); -#line 3528 "runtime.in" +#line 3622 "runtime.in" {Stack->push(Round(Intcap(x))); return;} } -#line 3532 "runtime.in" +#line 3626 "runtime.in" // real fmod(real x, real y); -void gen302(stack *Stack) +void gen303(stack *Stack) { real y=vm::pop(Stack); real x=vm::pop(Stack); -#line 3533 "runtime.in" +#line 3627 "runtime.in" if (y == 0.0) dividebyzero(); {Stack->push(fmod(x,y)); return;} } -#line 3538 "runtime.in" +#line 3632 "runtime.in" // real atan2(real y, real x); -void gen303(stack *Stack) +void gen304(stack *Stack) { real x=vm::pop(Stack); real y=vm::pop(Stack); -#line 3539 "runtime.in" +#line 3633 "runtime.in" {Stack->push(atan2(y,x)); return;} } -#line 3543 "runtime.in" +#line 3637 "runtime.in" // real hypot(real x, real y); -void gen304(stack *Stack) +void gen305(stack *Stack) { real y=vm::pop(Stack); real x=vm::pop(Stack); -#line 3544 "runtime.in" +#line 3638 "runtime.in" {Stack->push(hypot(x,y)); return;} } -#line 3548 "runtime.in" +#line 3642 "runtime.in" // real remainder(real x, real y); -void gen305(stack *Stack) +void gen306(stack *Stack) { real y=vm::pop(Stack); real x=vm::pop(Stack); -#line 3549 "runtime.in" +#line 3643 "runtime.in" {Stack->push(remainder(x,y)); return;} } -#line 3553 "runtime.in" +#line 3647 "runtime.in" // real J(Int n, real x); -void gen306(stack *Stack) +void gen307(stack *Stack) { real x=vm::pop(Stack); Int n=vm::pop(Stack); -#line 3554 "runtime.in" +#line 3648 "runtime.in" {Stack->push(jn(n,x)); return;} } -#line 3558 "runtime.in" +#line 3652 "runtime.in" // real Y(Int n, real x); -void gen307(stack *Stack) +void gen308(stack *Stack) { real x=vm::pop(Stack); Int n=vm::pop(Stack); -#line 3559 "runtime.in" +#line 3653 "runtime.in" {Stack->push(yn(n,x)); return;} } -#line 3563 "runtime.in" +#line 3657 "runtime.in" // real erf(real x); -void gen308(stack *Stack) +void gen309(stack *Stack) { real x=vm::pop(Stack); -#line 3564 "runtime.in" +#line 3658 "runtime.in" {Stack->push(erf(x)); return;} } -#line 3568 "runtime.in" +#line 3662 "runtime.in" // real erfc(real x); -void gen309(stack *Stack) +void gen310(stack *Stack) { real x=vm::pop(Stack); -#line 3569 "runtime.in" +#line 3663 "runtime.in" {Stack->push(erfc(x)); return;} } -#line 3573 "runtime.in" +#line 3667 "runtime.in" // Int factorial(Int n); -void gen310(stack *Stack) +void gen311(stack *Stack) { Int n=vm::pop(Stack); -#line 3574 "runtime.in" +#line 3668 "runtime.in" if(n < 0) error(invalidargument); {Stack->push(factorial(n)); return;} } -#line 3578 "runtime.in" +#line 3672 "runtime.in" // Int choose(Int n, Int k); -void gen311(stack *Stack) +void gen312(stack *Stack) { Int k=vm::pop(Stack); Int n=vm::pop(Stack); -#line 3579 "runtime.in" +#line 3673 "runtime.in" if(n < 0 || k < 0 || k > n) error(invalidargument); Int f=1; Int r=n-k; @@ -5033,12 +5133,12 @@ void gen311(stack *Stack) {Stack->push(f); return;} } -#line 3589 "runtime.in" +#line 3683 "runtime.in" // real gamma(real x); -void gen312(stack *Stack) +void gen313(stack *Stack) { real x=vm::pop(Stack); -#line 3590 "runtime.in" +#line 3684 "runtime.in" #ifdef HAVE_TGAMMA {Stack->push(tgamma(x)); return;} #else @@ -5048,23 +5148,23 @@ void gen312(stack *Stack) } // Complex Gamma function -#line 3600 "runtime.in" +#line 3694 "runtime.in" // pair gamma(explicit pair z); -void gen313(stack *Stack) +void gen314(stack *Stack) { pair z=vm::pop(Stack); -#line 3601 "runtime.in" +#line 3695 "runtime.in" {Stack->push(gamma(z)); return;} } -#line 3605 "runtime.in" +#line 3699 "runtime.in" // realarray* quadraticroots(real a, real b, real c); -void gen314(stack *Stack) +void gen315(stack *Stack) { real c=vm::pop(Stack); real b=vm::pop(Stack); real a=vm::pop(Stack); -#line 3606 "runtime.in" +#line 3700 "runtime.in" quadraticroots q(a,b,c); array *roots=new array(q.roots); if(q.roots >= 1) (*roots)[0]=q.t1; @@ -5072,14 +5172,14 @@ void gen314(stack *Stack) {Stack->push(roots); return;} } -#line 3614 "runtime.in" +#line 3708 "runtime.in" // pairarray* quadraticroots(explicit pair a, explicit pair b, explicit pair c); -void gen315(stack *Stack) +void gen316(stack *Stack) { pair c=vm::pop(Stack); pair b=vm::pop(Stack); pair a=vm::pop(Stack); -#line 3615 "runtime.in" +#line 3709 "runtime.in" Quadraticroots q(a,b,c); array *roots=new array(q.roots); if(q.roots >= 1) (*roots)[0]=q.z1; @@ -5087,15 +5187,15 @@ void gen315(stack *Stack) {Stack->push(roots); return;} } -#line 3623 "runtime.in" +#line 3717 "runtime.in" // realarray* cubicroots(real a, real b, real c, real d); -void gen316(stack *Stack) +void gen317(stack *Stack) { real d=vm::pop(Stack); real c=vm::pop(Stack); real b=vm::pop(Stack); real a=vm::pop(Stack); -#line 3624 "runtime.in" +#line 3718 "runtime.in" cubicroots q(a,b,c,d); array *roots=new array(q.roots); if(q.roots >= 1) (*roots)[0]=q.t1; @@ -5106,103 +5206,103 @@ void gen316(stack *Stack) // Transforms -#line 3635 "runtime.in" +#line 3729 "runtime.in" // bool ==(transform a, transform b); -void gen317(stack *Stack) +void gen318(stack *Stack) { transform b=vm::pop(Stack); transform a=vm::pop(Stack); -#line 3636 "runtime.in" +#line 3730 "runtime.in" {Stack->push(a == b); return;} } -#line 3641 "runtime.in" +#line 3735 "runtime.in" // bool !=(transform a, transform b); -void gen318(stack *Stack) +void gen319(stack *Stack) { transform b=vm::pop(Stack); transform a=vm::pop(Stack); -#line 3642 "runtime.in" +#line 3736 "runtime.in" {Stack->push(a != b); return;} } -#line 3646 "runtime.in" +#line 3740 "runtime.in" // transform +(transform a, transform b); -void gen319(stack *Stack) +void gen320(stack *Stack) { transform b=vm::pop(Stack); transform a=vm::pop(Stack); -#line 3647 "runtime.in" +#line 3741 "runtime.in" {Stack->push(a+b); return;} } -#line 3651 "runtime.in" +#line 3745 "runtime.in" // transform *(transform a, transform b); -void gen320(stack *Stack) +void gen321(stack *Stack) { transform b=vm::pop(Stack); transform a=vm::pop(Stack); -#line 3652 "runtime.in" +#line 3746 "runtime.in" {Stack->push(a*b); return;} } -#line 3656 "runtime.in" +#line 3750 "runtime.in" // pair *(transform t, pair z); -void gen321(stack *Stack) +void gen322(stack *Stack) { pair z=vm::pop(Stack); transform t=vm::pop(Stack); -#line 3657 "runtime.in" +#line 3751 "runtime.in" {Stack->push(t*z); return;} } -#line 3661 "runtime.in" +#line 3755 "runtime.in" // path *(transform t, path g); -void gen322(stack *Stack) +void gen323(stack *Stack) { path g=vm::pop(Stack); transform t=vm::pop(Stack); -#line 3662 "runtime.in" +#line 3756 "runtime.in" {Stack->push(transformed(t,g)); return;} } -#line 3666 "runtime.in" +#line 3760 "runtime.in" // pen *(transform t, pen p); -void gen323(stack *Stack) +void gen324(stack *Stack) { pen p=vm::pop(Stack); transform t=vm::pop(Stack); -#line 3667 "runtime.in" +#line 3761 "runtime.in" {Stack->push(transformed(t,p)); return;} } -#line 3671 "runtime.in" +#line 3765 "runtime.in" // picture* *(transform t, picture *f); -void gen324(stack *Stack) +void gen325(stack *Stack) { picture * f=vm::pop(Stack); transform t=vm::pop(Stack); -#line 3672 "runtime.in" +#line 3766 "runtime.in" {Stack->push(transformed(t,f)); return;} } -#line 3676 "runtime.in" +#line 3770 "runtime.in" // picture* *(realarray2 *t, picture *f); -void gen325(stack *Stack) +void gen326(stack *Stack) { picture * f=vm::pop(Stack); realarray2 * t=vm::pop(Stack); -#line 3677 "runtime.in" +#line 3771 "runtime.in" {Stack->push(transformed(*t,f)); return;} } -#line 3681 "runtime.in" +#line 3775 "runtime.in" // transform ^(transform t, Int n); -void gen326(stack *Stack) +void gen327(stack *Stack) { Int n=vm::pop(Stack); transform t=vm::pop(Stack); -#line 3682 "runtime.in" +#line 3776 "runtime.in" transform T; if(n < 0) { n=-n; @@ -5212,55 +5312,55 @@ void gen326(stack *Stack) {Stack->push(T); return;} } -#line 3692 "runtime.in" +#line 3786 "runtime.in" void transformXPart(stack *Stack) { transform t=vm::pop(Stack); -#line 3693 "runtime.in" +#line 3787 "runtime.in" {Stack->push(t.getx()); return;} } -#line 3697 "runtime.in" +#line 3791 "runtime.in" void transformYPart(stack *Stack) { transform t=vm::pop(Stack); -#line 3698 "runtime.in" +#line 3792 "runtime.in" {Stack->push(t.gety()); return;} } -#line 3702 "runtime.in" +#line 3796 "runtime.in" void transformXXPart(stack *Stack) { transform t=vm::pop(Stack); -#line 3703 "runtime.in" +#line 3797 "runtime.in" {Stack->push(t.getxx()); return;} } -#line 3707 "runtime.in" +#line 3801 "runtime.in" void transformXYPart(stack *Stack) { transform t=vm::pop(Stack); -#line 3708 "runtime.in" +#line 3802 "runtime.in" {Stack->push(t.getxy()); return;} } -#line 3712 "runtime.in" +#line 3806 "runtime.in" void transformYXPart(stack *Stack) { transform t=vm::pop(Stack); -#line 3713 "runtime.in" +#line 3807 "runtime.in" {Stack->push(t.getyx()); return;} } -#line 3717 "runtime.in" +#line 3811 "runtime.in" void transformYYPart(stack *Stack) { transform t=vm::pop(Stack); -#line 3718 "runtime.in" +#line 3812 "runtime.in" {Stack->push(t.getyy()); return;} } -#line 3722 "runtime.in" +#line 3816 "runtime.in" void real6ToTransform(stack *Stack) { real yy=vm::pop(Stack); @@ -5269,757 +5369,765 @@ void real6ToTransform(stack *Stack) real xx=vm::pop(Stack); real y=vm::pop(Stack); real x=vm::pop(Stack); -#line 3724 "runtime.in" +#line 3818 "runtime.in" {Stack->push(transform(x,y,xx,xy,yx,yy)); return;} } -#line 3728 "runtime.in" +#line 3822 "runtime.in" // transform shift(transform t); -void gen334(stack *Stack) +void gen335(stack *Stack) { transform t=vm::pop(Stack); -#line 3729 "runtime.in" +#line 3823 "runtime.in" {Stack->push(transform(t.getx(),t.gety(),0,0,0,0)); return;} } -#line 3733 "runtime.in" +#line 3827 "runtime.in" // transform shiftless(transform t); -void gen335(stack *Stack) +void gen336(stack *Stack) { transform t=vm::pop(Stack); -#line 3734 "runtime.in" +#line 3828 "runtime.in" {Stack->push(transform(0,0,t.getxx(),t.getxy(),t.getyx(),t.getyy())); return;} } -#line 3738 "runtime.in" +#line 3832 "runtime.in" // transform identity(); void transformIdentity(stack *Stack) { -#line 3739 "runtime.in" +#line 3833 "runtime.in" {Stack->push(identity); return;} } -#line 3743 "runtime.in" +#line 3837 "runtime.in" // transform inverse(transform t); -void gen337(stack *Stack) +void gen338(stack *Stack) { transform t=vm::pop(Stack); -#line 3744 "runtime.in" +#line 3838 "runtime.in" {Stack->push(inverse(t)); return;} } -#line 3748 "runtime.in" +#line 3842 "runtime.in" // transform shift(pair z); -void gen338(stack *Stack) +void gen339(stack *Stack) { pair z=vm::pop(Stack); -#line 3749 "runtime.in" +#line 3843 "runtime.in" {Stack->push(shift(z)); return;} } -#line 3753 "runtime.in" +#line 3847 "runtime.in" // transform shift(real x, real y); -void gen339(stack *Stack) +void gen340(stack *Stack) { real y=vm::pop(Stack); real x=vm::pop(Stack); -#line 3754 "runtime.in" +#line 3848 "runtime.in" {Stack->push(shift(pair(x,y))); return;} } -#line 3758 "runtime.in" +#line 3852 "runtime.in" // transform xscale(real x); -void gen340(stack *Stack) +void gen341(stack *Stack) { real x=vm::pop(Stack); -#line 3759 "runtime.in" +#line 3853 "runtime.in" {Stack->push(xscale(x)); return;} } -#line 3763 "runtime.in" +#line 3857 "runtime.in" // transform yscale(real y); -void gen341(stack *Stack) +void gen342(stack *Stack) { real y=vm::pop(Stack); -#line 3764 "runtime.in" +#line 3858 "runtime.in" {Stack->push(yscale(y)); return;} } -#line 3768 "runtime.in" +#line 3862 "runtime.in" // transform scale(real x); -void gen342(stack *Stack) +void gen343(stack *Stack) { real x=vm::pop(Stack); -#line 3769 "runtime.in" +#line 3863 "runtime.in" {Stack->push(scale(x)); return;} } -#line 3773 "runtime.in" +#line 3867 "runtime.in" // transform scale(real x, real y); -void gen343(stack *Stack) +void gen344(stack *Stack) { real y=vm::pop(Stack); real x=vm::pop(Stack); -#line 3774 "runtime.in" +#line 3868 "runtime.in" {Stack->push(xscale(x)*yscale(y)); return;} } -#line 3778 "runtime.in" +#line 3872 "runtime.in" // transform slant(real s); -void gen344(stack *Stack) +void gen345(stack *Stack) { real s=vm::pop(Stack); -#line 3779 "runtime.in" +#line 3873 "runtime.in" {Stack->push(slant(s)); return;} } -#line 3783 "runtime.in" +#line 3877 "runtime.in" // transform rotate(real angle, pair z=0); -void gen345(stack *Stack) +void gen346(stack *Stack) { pair z=vm::pop(Stack,0); real angle=vm::pop(Stack); -#line 3784 "runtime.in" +#line 3878 "runtime.in" {Stack->push(rotatearound(z,radians(angle))); return;} } -#line 3788 "runtime.in" +#line 3882 "runtime.in" // transform reflect(pair a, pair b); -void gen346(stack *Stack) +void gen347(stack *Stack) { pair b=vm::pop(Stack); pair a=vm::pop(Stack); -#line 3789 "runtime.in" +#line 3883 "runtime.in" {Stack->push(reflectabout(a,b)); return;} } // Pair operations -#line 3795 "runtime.in" +#line 3889 "runtime.in" void pairZero(stack *Stack) { -#line 3796 "runtime.in" +#line 3890 "runtime.in" {Stack->push(zero); return;} } -#line 3801 "runtime.in" +#line 3895 "runtime.in" void realRealToPair(stack *Stack) { real y=vm::pop(Stack); real x=vm::pop(Stack); -#line 3802 "runtime.in" +#line 3896 "runtime.in" {Stack->push(pair(x,y)); return;} } -#line 3806 "runtime.in" +#line 3900 "runtime.in" void pairNegate(stack *Stack) { pair z=vm::pop(Stack); -#line 3807 "runtime.in" +#line 3901 "runtime.in" {Stack->push(-z); return;} } -#line 3811 "runtime.in" +#line 3905 "runtime.in" // real xpart(pair z); void pairXPart(stack *Stack) { pair z=vm::pop(Stack); -#line 3812 "runtime.in" +#line 3906 "runtime.in" {Stack->push(z.getx()); return;} } -#line 3816 "runtime.in" +#line 3910 "runtime.in" // real ypart(pair z); void pairYPart(stack *Stack) { pair z=vm::pop(Stack); -#line 3817 "runtime.in" +#line 3911 "runtime.in" {Stack->push(z.gety()); return;} } -#line 3821 "runtime.in" +#line 3915 "runtime.in" // real length(pair z); -void gen352(stack *Stack) +void gen353(stack *Stack) { pair z=vm::pop(Stack); -#line 3822 "runtime.in" +#line 3916 "runtime.in" {Stack->push(z.length()); return;} } -#line 3826 "runtime.in" +#line 3920 "runtime.in" // real abs(pair z); -void gen353(stack *Stack) +void gen354(stack *Stack) { pair z=vm::pop(Stack); -#line 3827 "runtime.in" +#line 3921 "runtime.in" {Stack->push(z.length()); return;} } -#line 3831 "runtime.in" +#line 3925 "runtime.in" // pair sqrt(explicit pair z); -void gen354(stack *Stack) +void gen355(stack *Stack) { pair z=vm::pop(Stack); -#line 3832 "runtime.in" +#line 3926 "runtime.in" {Stack->push(Sqrt(z)); return;} } // Return the angle of z in radians. -#line 3837 "runtime.in" +#line 3931 "runtime.in" // real angle(pair z, bool warn=true); -void gen355(stack *Stack) +void gen356(stack *Stack) { bool warn=vm::pop(Stack,true); pair z=vm::pop(Stack); -#line 3838 "runtime.in" +#line 3932 "runtime.in" if(!warn && z.getx() == 0.0 && z.gety() == 0.0) {Stack->push(0.0); return;} {Stack->push(z.angle()); return;} } // Return the angle of z in degrees in the interval [0,360). -#line 3844 "runtime.in" +#line 3938 "runtime.in" // real degrees(pair z, bool warn=true); -void gen356(stack *Stack) +void gen357(stack *Stack) { bool warn=vm::pop(Stack,true); pair z=vm::pop(Stack); -#line 3845 "runtime.in" +#line 3939 "runtime.in" if(!warn && z.getx() == 0.0 && z.gety() == 0.0) {Stack->push(0.0); return;} {Stack->push(principalBranch(degrees(z.angle()))); return;} } // Convert degrees to radians. -#line 3851 "runtime.in" +#line 3945 "runtime.in" // real radians(real degrees); -void gen357(stack *Stack) +void gen358(stack *Stack) { real degrees=vm::pop(Stack); -#line 3852 "runtime.in" +#line 3946 "runtime.in" {Stack->push(radians(degrees)); return;} } // Convert radians to degrees. -#line 3857 "runtime.in" +#line 3951 "runtime.in" // real degrees(real radians); -void gen358(stack *Stack) +void gen359(stack *Stack) { real radians=vm::pop(Stack); -#line 3858 "runtime.in" +#line 3952 "runtime.in" {Stack->push(degrees(radians)); return;} } // Convert radians to degrees in [0,360). -#line 3863 "runtime.in" +#line 3957 "runtime.in" // real Degrees(real radians); -void gen359(stack *Stack) +void gen360(stack *Stack) { real radians=vm::pop(Stack); -#line 3864 "runtime.in" +#line 3958 "runtime.in" {Stack->push(principalBranch(degrees(radians))); return;} } -#line 3868 "runtime.in" +#line 3962 "runtime.in" // real Sin(real deg); -void gen360(stack *Stack) +void gen361(stack *Stack) { real deg=vm::pop(Stack); -#line 3869 "runtime.in" +#line 3963 "runtime.in" {Stack->push(sin(radians(deg))); return;} } -#line 3873 "runtime.in" +#line 3967 "runtime.in" // real Cos(real deg); -void gen361(stack *Stack) +void gen362(stack *Stack) { real deg=vm::pop(Stack); -#line 3874 "runtime.in" +#line 3968 "runtime.in" {Stack->push(cos(radians(deg))); return;} } -#line 3878 "runtime.in" +#line 3972 "runtime.in" // real Tan(real deg); -void gen362(stack *Stack) +void gen363(stack *Stack) { real deg=vm::pop(Stack); -#line 3879 "runtime.in" +#line 3973 "runtime.in" {Stack->push(tan(radians(deg))); return;} } -#line 3883 "runtime.in" +#line 3977 "runtime.in" // real aSin(real x); -void gen363(stack *Stack) +void gen364(stack *Stack) { real x=vm::pop(Stack); -#line 3884 "runtime.in" +#line 3978 "runtime.in" {Stack->push(degrees(asin(x))); return;} } -#line 3888 "runtime.in" +#line 3982 "runtime.in" // real aCos(real x); -void gen364(stack *Stack) +void gen365(stack *Stack) { real x=vm::pop(Stack); -#line 3889 "runtime.in" +#line 3983 "runtime.in" {Stack->push(degrees(acos(x))); return;} } -#line 3893 "runtime.in" +#line 3987 "runtime.in" // real aTan(real x); -void gen365(stack *Stack) +void gen366(stack *Stack) { real x=vm::pop(Stack); -#line 3894 "runtime.in" +#line 3988 "runtime.in" {Stack->push(degrees(atan(x))); return;} } -#line 3898 "runtime.in" +#line 3992 "runtime.in" // pair unit(pair z); -void gen366(stack *Stack) +void gen367(stack *Stack) { pair z=vm::pop(Stack); -#line 3899 "runtime.in" +#line 3993 "runtime.in" {Stack->push(unit(z)); return;} } -#line 3903 "runtime.in" +#line 3997 "runtime.in" // pair dir(real degrees); -void gen367(stack *Stack) +void gen368(stack *Stack) { real degrees=vm::pop(Stack); -#line 3904 "runtime.in" +#line 3998 "runtime.in" {Stack->push(expi(radians(degrees))); return;} } -#line 3908 "runtime.in" +#line 4002 "runtime.in" // pair dir(explicit pair z); -void gen368(stack *Stack) +void gen369(stack *Stack) { pair z=vm::pop(Stack); -#line 3909 "runtime.in" +#line 4003 "runtime.in" {Stack->push(unit(z)); return;} } -#line 3913 "runtime.in" +#line 4007 "runtime.in" // pair expi(real angle); -void gen369(stack *Stack) +void gen370(stack *Stack) { real angle=vm::pop(Stack); -#line 3914 "runtime.in" +#line 4008 "runtime.in" {Stack->push(expi(angle)); return;} } -#line 3918 "runtime.in" +#line 4012 "runtime.in" // pair exp(explicit pair z); -void gen370(stack *Stack) +void gen371(stack *Stack) { pair z=vm::pop(Stack); -#line 3919 "runtime.in" +#line 4013 "runtime.in" {Stack->push(exp(z)); return;} } -#line 3923 "runtime.in" +#line 4017 "runtime.in" // pair log(explicit pair z); -void gen371(stack *Stack) +void gen372(stack *Stack) { pair z=vm::pop(Stack); -#line 3924 "runtime.in" +#line 4018 "runtime.in" {Stack->push(pair(log(z.length()),z.angle())); return;} } -#line 3928 "runtime.in" +#line 4022 "runtime.in" // pair sin(explicit pair z); -void gen372(stack *Stack) +void gen373(stack *Stack) { pair z=vm::pop(Stack); -#line 3929 "runtime.in" +#line 4023 "runtime.in" {Stack->push(sin(z)); return;} } -#line 3933 "runtime.in" +#line 4027 "runtime.in" // pair cos(explicit pair z); -void gen373(stack *Stack) +void gen374(stack *Stack) { pair z=vm::pop(Stack); -#line 3934 "runtime.in" +#line 4028 "runtime.in" {Stack->push(pair(cos(z.getx())*cosh(z.gety()),-sin(z.getx())*sinh(z.gety()))); return;} } -#line 3938 "runtime.in" +#line 4032 "runtime.in" // pair conj(pair z); -void gen374(stack *Stack) +void gen375(stack *Stack) { pair z=vm::pop(Stack); -#line 3939 "runtime.in" +#line 4033 "runtime.in" {Stack->push(conj(z)); return;} } -#line 3943 "runtime.in" +#line 4037 "runtime.in" // pair realmult(pair z, pair w); -void gen375(stack *Stack) +void gen376(stack *Stack) { pair w=vm::pop(Stack); pair z=vm::pop(Stack); -#line 3944 "runtime.in" +#line 4038 "runtime.in" {Stack->push(pair (z.getx()*w.getx(),z.gety()*w.gety())); return;} } -#line 3948 "runtime.in" +#line 4042 "runtime.in" // triple realmult(triple u, triple v); -void gen376(stack *Stack) +void gen377(stack *Stack) { triple v=vm::pop(Stack); triple u=vm::pop(Stack); -#line 3949 "runtime.in" +#line 4043 "runtime.in" {Stack->push(triple (u.getx()*v.getx(),u.gety()*v.gety(),u.getz()*v.getz())); return;} } // To avoid confusion, a dot product requires explicit pair arguments. -#line 3954 "runtime.in" +#line 4048 "runtime.in" // real dot(explicit pair z, explicit pair w); -void gen377(stack *Stack) +void gen378(stack *Stack) { pair w=vm::pop(Stack); pair z=vm::pop(Stack); -#line 3955 "runtime.in" +#line 4049 "runtime.in" {Stack->push(dot(z,w)); return;} } // Triple operations -#line 3961 "runtime.in" +#line 4055 "runtime.in" void tripleZero(stack *Stack) { -#line 3962 "runtime.in" +#line 4056 "runtime.in" static triple zero; {Stack->push(zero); return;} } -#line 3968 "runtime.in" +#line 4062 "runtime.in" void realRealRealToTriple(stack *Stack) { real z=vm::pop(Stack); real y=vm::pop(Stack); real x=vm::pop(Stack); -#line 3969 "runtime.in" +#line 4063 "runtime.in" {Stack->push(triple(x,y,z)); return;} } -#line 3973 "runtime.in" +#line 4067 "runtime.in" // real xpart(triple v); void tripleXPart(stack *Stack) { triple v=vm::pop(Stack); -#line 3974 "runtime.in" +#line 4068 "runtime.in" {Stack->push(v.getx()); return;} } -#line 3978 "runtime.in" +#line 4072 "runtime.in" // real ypart(triple v); void tripleYPart(stack *Stack) { triple v=vm::pop(Stack); -#line 3979 "runtime.in" +#line 4073 "runtime.in" {Stack->push(v.gety()); return;} } -#line 3983 "runtime.in" +#line 4077 "runtime.in" // real zpart(triple v); void tripleZPart(stack *Stack) { triple v=vm::pop(Stack); -#line 3984 "runtime.in" +#line 4078 "runtime.in" {Stack->push(v.getz()); return;} } -#line 3988 "runtime.in" +#line 4082 "runtime.in" // triple *(real x, triple v); -void gen383(stack *Stack) +void gen384(stack *Stack) { triple v=vm::pop(Stack); real x=vm::pop(Stack); -#line 3989 "runtime.in" +#line 4083 "runtime.in" {Stack->push(x*v); return;} } -#line 3993 "runtime.in" +#line 4087 "runtime.in" // triple *(triple v, real x); -void gen384(stack *Stack) +void gen385(stack *Stack) { real x=vm::pop(Stack); triple v=vm::pop(Stack); -#line 3994 "runtime.in" +#line 4088 "runtime.in" {Stack->push(v*x); return;} } -#line 3998 "runtime.in" +#line 4092 "runtime.in" // triple /(triple v, real x); -void gen385(stack *Stack) +void gen386(stack *Stack) { real x=vm::pop(Stack); triple v=vm::pop(Stack); -#line 3999 "runtime.in" +#line 4093 "runtime.in" {Stack->push(v/x); return;} } -#line 4003 "runtime.in" +#line 4097 "runtime.in" // real length(triple v); -void gen386(stack *Stack) +void gen387(stack *Stack) { triple v=vm::pop(Stack); -#line 4004 "runtime.in" +#line 4098 "runtime.in" {Stack->push(v.length()); return;} } -#line 4008 "runtime.in" +#line 4102 "runtime.in" // real abs(triple v); -void gen387(stack *Stack) +void gen388(stack *Stack) { triple v=vm::pop(Stack); -#line 4009 "runtime.in" +#line 4103 "runtime.in" {Stack->push(v.length()); return;} } -#line 4013 "runtime.in" -// real polar(triple v); -void gen388(stack *Stack) +#line 4107 "runtime.in" +// real polar(triple v, bool warn=true); +void gen389(stack *Stack) { + bool warn=vm::pop(Stack,true); triple v=vm::pop(Stack); -#line 4014 "runtime.in" +#line 4108 "runtime.in" + if(!warn && v.getx() == 0.0 && v.gety() == 0.0 && v.getz() == 0.0) {Stack->push(0.0); return;} {Stack->push(v.polar()); return;} } -#line 4018 "runtime.in" -// real azimuth(triple v); -void gen389(stack *Stack) +#line 4113 "runtime.in" +// real azimuth(triple v, bool warn=true); +void gen390(stack *Stack) { + bool warn=vm::pop(Stack,true); triple v=vm::pop(Stack); -#line 4019 "runtime.in" +#line 4114 "runtime.in" + if(!warn && v.getx() == 0.0 && v.gety() == 0.0) {Stack->push(0.0); return;} {Stack->push(v.azimuth()); return;} } -#line 4023 "runtime.in" -// real colatitude(triple v); -void gen390(stack *Stack) +#line 4119 "runtime.in" +// real colatitude(triple v, bool warn=true); +void gen391(stack *Stack) { + bool warn=vm::pop(Stack,true); triple v=vm::pop(Stack); -#line 4024 "runtime.in" +#line 4120 "runtime.in" + if(!warn && v.getx() == 0.0 && v.gety() == 0.0 && v.getz() == 0.0) {Stack->push(0.0); return;} {Stack->push(degrees(v.polar())); return;} } -#line 4028 "runtime.in" -// real latitude(triple v); -void gen391(stack *Stack) +#line 4125 "runtime.in" +// real latitude(triple v, bool warn=true); +void gen392(stack *Stack) { + bool warn=vm::pop(Stack,true); triple v=vm::pop(Stack); -#line 4029 "runtime.in" +#line 4126 "runtime.in" + if(!warn && v.getx() == 0.0 && v.gety() == 0.0 && v.getz() == 0.0) {Stack->push(0.0); return;} {Stack->push(90.0-degrees(v.polar())); return;} } // Return the longitude of v in [0,360). -#line 4034 "runtime.in" +#line 4132 "runtime.in" // real longitude(triple v, bool warn=true); -void gen392(stack *Stack) +void gen393(stack *Stack) { bool warn=vm::pop(Stack,true); triple v=vm::pop(Stack); -#line 4035 "runtime.in" +#line 4133 "runtime.in" if(!warn && v.getx() == 0.0 && v.gety() == 0.0) {Stack->push(0.0); return;} {Stack->push(principalBranch(degrees(v.azimuth()))); return;} } -#line 4040 "runtime.in" +#line 4138 "runtime.in" // triple unit(triple v); -void gen393(stack *Stack) +void gen394(stack *Stack) { triple v=vm::pop(Stack); -#line 4041 "runtime.in" +#line 4139 "runtime.in" {Stack->push(unit(v)); return;} } -#line 4045 "runtime.in" +#line 4143 "runtime.in" // real dot(triple u, triple v); -void gen394(stack *Stack) +void gen395(stack *Stack) { triple v=vm::pop(Stack); triple u=vm::pop(Stack); -#line 4046 "runtime.in" +#line 4144 "runtime.in" {Stack->push(dot(u,v)); return;} } -#line 4050 "runtime.in" +#line 4148 "runtime.in" // triple cross(triple u, triple v); -void gen395(stack *Stack) +void gen396(stack *Stack) { triple v=vm::pop(Stack); triple u=vm::pop(Stack); -#line 4051 "runtime.in" +#line 4149 "runtime.in" {Stack->push(cross(u,v)); return;} } -#line 4055 "runtime.in" +#line 4153 "runtime.in" // triple expi(real polar, real azimuth); -void gen396(stack *Stack) +void gen397(stack *Stack) { real azimuth=vm::pop(Stack); real polar=vm::pop(Stack); -#line 4056 "runtime.in" +#line 4154 "runtime.in" {Stack->push(expi(polar,azimuth)); return;} } -#line 4060 "runtime.in" +#line 4158 "runtime.in" // triple dir(real colatitude, real longitude); -void gen397(stack *Stack) +void gen398(stack *Stack) { real longitude=vm::pop(Stack); real colatitude=vm::pop(Stack); -#line 4061 "runtime.in" +#line 4159 "runtime.in" {Stack->push(expi(radians(colatitude),radians(longitude))); return;} } // System routines -#line 4067 "runtime.in" +#line 4165 "runtime.in" // void atupdate(callable *f); -void gen398(stack *Stack) +void gen399(stack *Stack) { callable * f=vm::pop(Stack); -#line 4068 "runtime.in" +#line 4166 "runtime.in" processData().atUpdateFunction=f; } -#line 4073 "runtime.in" +#line 4171 "runtime.in" // callable* atupdate(); -void gen399(stack *Stack) +void gen400(stack *Stack) { -#line 4074 "runtime.in" +#line 4172 "runtime.in" {Stack->push(processData().atUpdateFunction); return;} } -#line 4078 "runtime.in" +#line 4176 "runtime.in" // void atexit(callable *f); -void gen400(stack *Stack) +void gen401(stack *Stack) { callable * f=vm::pop(Stack); -#line 4079 "runtime.in" +#line 4177 "runtime.in" processData().atExitFunction=f; } -#line 4083 "runtime.in" +#line 4181 "runtime.in" // callable* atexit(); -void gen401(stack *Stack) +void gen402(stack *Stack) { -#line 4084 "runtime.in" +#line 4182 "runtime.in" {Stack->push(processData().atExitFunction); return;} } -#line 4088 "runtime.in" +#line 4186 "runtime.in" // void atbreakpoint(callableBp *f); -void gen402(stack *Stack) +void gen403(stack *Stack) { callableBp * f=vm::pop(Stack); -#line 4089 "runtime.in" +#line 4187 "runtime.in" processData().atBreakpointFunction=f; } -#line 4093 "runtime.in" +#line 4191 "runtime.in" // void breakpoint(runnable *s=NULL); -void gen403(stack *Stack) +void gen404(stack *Stack) { runnable * s=vm::pop(Stack,NULL); -#line 4094 "runtime.in" +#line 4192 "runtime.in" breakpoint(Stack,s); } -#line 4098 "runtime.in" +#line 4196 "runtime.in" // string locatefile(string file); -void gen404(stack *Stack) +void gen405(stack *Stack) { string file=vm::pop(Stack); -#line 4099 "runtime.in" +#line 4197 "runtime.in" {Stack->push(locateFile(file)); return;} } -#line 4103 "runtime.in" +#line 4201 "runtime.in" // void stop(string file, Int line, runnable *s=NULL); -void gen405(stack *Stack) +void gen406(stack *Stack) { runnable * s=vm::pop(Stack,NULL); Int line=vm::pop(Stack); string file=vm::pop(Stack); -#line 4104 "runtime.in" +#line 4202 "runtime.in" file=locateFile(file); clear(file,line); cout << "setting breakpoint at " << file << ": " << line << endl; bplist.push_back(bpinfo(file,line,s)); } -#line 4111 "runtime.in" +#line 4209 "runtime.in" // void breakpoints(); -void gen406(stack *) +void gen407(stack *) { -#line 4112 "runtime.in" +#line 4210 "runtime.in" for(mem::list::iterator p=bplist.begin(); p != bplist.end(); ++p) cout << p->f.name() << ": " << p->f.line() << endl; } -#line 4117 "runtime.in" +#line 4215 "runtime.in" // void clear(string file, Int line); -void gen407(stack *Stack) +void gen408(stack *Stack) { Int line=vm::pop(Stack); string file=vm::pop(Stack); -#line 4118 "runtime.in" +#line 4216 "runtime.in" file=locateFile(file); clear(file,line,true); } -#line 4123 "runtime.in" +#line 4221 "runtime.in" // void clear(); -void gen408(stack *) +void gen409(stack *) { -#line 4124 "runtime.in" +#line 4222 "runtime.in" bplist.clear(); } // Strip directory from string -#line 4129 "runtime.in" +#line 4227 "runtime.in" // string stripdirectory(string *s); -void gen409(stack *Stack) +void gen410(stack *Stack) { string * s=vm::pop(Stack); -#line 4130 "runtime.in" +#line 4228 "runtime.in" {Stack->push(stripDir(*s)); return;} } // Strip directory from string -#line 4135 "runtime.in" +#line 4233 "runtime.in" // string stripfile(string *s); -void gen410(stack *Stack) +void gen411(stack *Stack) { string * s=vm::pop(Stack); -#line 4136 "runtime.in" +#line 4234 "runtime.in" {Stack->push(stripFile(*s)); return;} } // Strip file extension from string -#line 4141 "runtime.in" +#line 4239 "runtime.in" // string stripextension(string *s); -void gen411(stack *Stack) +void gen412(stack *Stack) { string * s=vm::pop(Stack); -#line 4142 "runtime.in" +#line 4240 "runtime.in" {Stack->push(stripExt(*s)); return;} } // Call ImageMagick convert. -#line 4147 "runtime.in" +#line 4245 "runtime.in" // Int convert(string args=emptystring, string file=emptystring, string format=emptystring); -void gen412(stack *Stack) +void gen413(stack *Stack) { string format=vm::pop(Stack,emptystring); string file=vm::pop(Stack,emptystring); string args=vm::pop(Stack,emptystring); -#line 4149 "runtime.in" +#line 4247 "runtime.in" ostringstream cmd; string name=convertname(file,format); @@ -6035,14 +6143,14 @@ void gen412(stack *Stack) } // Call ImageMagick animate. -#line 4165 "runtime.in" +#line 4263 "runtime.in" // Int animate(string args=emptystring, string file=emptystring, string format=emptystring); -void gen413(stack *Stack) +void gen414(stack *Stack) { string format=vm::pop(Stack,emptystring); string file=vm::pop(Stack,emptystring); string args=vm::pop(Stack,emptystring); -#line 4167 "runtime.in" +#line 4265 "runtime.in" #ifndef __CYGWIN__ string name=convertname(file,format,false); if(view()) { @@ -6056,12 +6164,12 @@ void gen413(stack *Stack) } // Delete file named s. -#line 4181 "runtime.in" +#line 4279 "runtime.in" // Int delete(string *s); -void gen414(stack *Stack) +void gen415(stack *Stack) { string * s=vm::pop(Stack); -#line 4182 "runtime.in" +#line 4280 "runtime.in" checkLocal(*s); Int rc=unlink(s->c_str()); if(rc == 0 && verbose > 0) @@ -6070,13 +6178,13 @@ void gen414(stack *Stack) } // Rename file "from" to file "to". -#line 4191 "runtime.in" +#line 4289 "runtime.in" // Int rename(string *from, string *to); -void gen415(stack *Stack) +void gen416(stack *Stack) { string * to=vm::pop(Stack); string * from=vm::pop(Stack); -#line 4192 "runtime.in" +#line 4290 "runtime.in" checkLocal(*from); checkLocal(*to); Int rc=rename(from->c_str(),to->c_str()); @@ -6089,10 +6197,10 @@ void gen415(stack *Stack) // Array operations // Create an empty array. -#line 4205 "runtime.in" +#line 4303 "runtime.in" void emptyArray(stack *Stack) { -#line 4206 "runtime.in" +#line 4304 "runtime.in" {Stack->push(new array(0)); return;} } @@ -6101,11 +6209,11 @@ void emptyArray(stack *Stack) // is popped off the stack, followed by each dimension in reverse order. // The array itself is technically a one dimensional array of one // dimension arrays and so on. -#line 4215 "runtime.in" +#line 4313 "runtime.in" void newDeepArray(stack *Stack) { Int depth=vm::pop(Stack); -#line 4216 "runtime.in" +#line 4314 "runtime.in" assert(depth > 0); Int *dims = new Int[depth]; @@ -6124,11 +6232,11 @@ void newDeepArray(stack *Stack) // Creates an array with elements already specified. First, the number // of elements is popped off the stack, followed by each element in // reverse order. -#line 4235 "runtime.in" +#line 4333 "runtime.in" void newInitializedArray(stack *Stack) { Int n=vm::pop(Stack); -#line 4236 "runtime.in" +#line 4334 "runtime.in" assert(n >= 0); array *a = new array(n); @@ -6141,12 +6249,12 @@ void newInitializedArray(stack *Stack) // Similar to newInitializedArray, but after the n elements, append another // array to it. -#line 4249 "runtime.in" +#line 4347 "runtime.in" void newAppendedArray(stack *Stack) { Int n=vm::pop(Stack); array* tail=vm::pop(Stack); -#line 4250 "runtime.in" +#line 4348 "runtime.in" assert(n >= 0); array *a = new array(n); @@ -6161,13 +6269,13 @@ void newAppendedArray(stack *Stack) // The function T[] array(int n, T value, int depth=0) produces a array of n // copies of x, where each copy is copied up to depth. -#line 4265 "runtime.in" +#line 4363 "runtime.in" void newDuplicateArray(stack *Stack) { Int depth=vm::pop(Stack,Int_MAX); item value=vm::pop(Stack); Int n=vm::pop(Stack); -#line 4266 "runtime.in" +#line 4364 "runtime.in" if(n < 0) error("cannot create a negative length array"); if(depth < 0) error("cannot copy to a negative depth"); @@ -6175,12 +6283,12 @@ void newDuplicateArray(stack *Stack) } // Read an element from an array. Checks for initialization & bounds. -#line 4274 "runtime.in" +#line 4372 "runtime.in" void arrayRead(stack *Stack) { Int n=vm::pop(Stack); array * a=vm::pop(Stack); -#line 4275 "runtime.in" +#line 4373 "runtime.in" item& i=arrayRead(a,n); if (i.empty()) { ostringstream buf; @@ -6191,50 +6299,50 @@ void arrayRead(stack *Stack) } // Slice a substring from an array. -#line 4286 "runtime.in" +#line 4384 "runtime.in" void arraySliceRead(stack *Stack) { Int right=vm::pop(Stack); Int left=vm::pop(Stack); array * a=vm::pop(Stack); -#line 4287 "runtime.in" +#line 4385 "runtime.in" checkArray(a); {Stack->push(a->slice(left, right)); return;} } // Slice a substring from an array. This implements the cases a[i:] and a[:] // where the endpoint is not given, and assumed to be the length of the array. -#line 4294 "runtime.in" +#line 4392 "runtime.in" void arraySliceReadToEnd(stack *Stack) { Int left=vm::pop(Stack); array * a=vm::pop(Stack); -#line 4295 "runtime.in" +#line 4393 "runtime.in" size_t len=checkArray(a); {Stack->push(a->slice(left, (Int)len)); return;} } // Read an element from an array of arrays. Check bounds and initialize // as necessary. -#line 4302 "runtime.in" +#line 4400 "runtime.in" void arrayArrayRead(stack *Stack) { Int n=vm::pop(Stack); array * a=vm::pop(Stack); -#line 4303 "runtime.in" +#line 4401 "runtime.in" item& i=arrayRead(a,n); if (i.empty()) i=new array(0); {Stack->push(i); return;} } // Write an element to an array. Increase size if necessary. -#line 4310 "runtime.in" +#line 4408 "runtime.in" void arrayWrite(stack *Stack) { Int n=vm::pop(Stack); array * a=vm::pop(Stack); item value=vm::pop(Stack); -#line 4311 "runtime.in" +#line 4409 "runtime.in" size_t len=checkArray(a); bool cyclic=a->cyclic(); if(cyclic && len > 0) n=imod(n,len); @@ -6248,27 +6356,27 @@ void arrayWrite(stack *Stack) {Stack->push(value); return;} } -#line 4325 "runtime.in" +#line 4423 "runtime.in" void arraySliceWrite(stack *Stack) { Int right=vm::pop(Stack); Int left=vm::pop(Stack); array * dest=vm::pop(Stack); array * src=vm::pop(Stack); -#line 4326 "runtime.in" +#line 4424 "runtime.in" checkArray(src); checkArray(dest); dest->setSlice(left, right, src); {Stack->push(src); return;} } -#line 4333 "runtime.in" +#line 4431 "runtime.in" void arraySliceWriteToEnd(stack *Stack) { Int left=vm::pop(Stack); array * dest=vm::pop(Stack); array * src=vm::pop(Stack); -#line 4334 "runtime.in" +#line 4432 "runtime.in" checkArray(src); size_t len=checkArray(dest); dest->setSlice(left, (Int) len, src); @@ -6276,20 +6384,20 @@ void arraySliceWriteToEnd(stack *Stack) } // Returns the length of an array. -#line 4342 "runtime.in" +#line 4440 "runtime.in" void arrayLength(stack *Stack) { array * a=vm::pop(Stack); -#line 4343 "runtime.in" +#line 4441 "runtime.in" {Stack->push((Int) checkArray(a)); return;} } // Returns an array of integers representing the keys of the array. -#line 4348 "runtime.in" +#line 4446 "runtime.in" void arrayKeys(stack *Stack) { array * a=vm::pop(Stack); -#line 4349 "runtime.in" +#line 4447 "runtime.in" size_t size=checkArray(a); array *keys=new array(); @@ -6303,22 +6411,22 @@ void arrayKeys(stack *Stack) } // Return the cyclic flag for an array. -#line 4363 "runtime.in" +#line 4461 "runtime.in" void arrayCyclicFlag(stack *Stack) { array * a=vm::pop(Stack); -#line 4364 "runtime.in" +#line 4462 "runtime.in" checkArray(a); {Stack->push(a->cyclic()); return;} } // Check to see if an array element is initialized. -#line 4370 "runtime.in" +#line 4468 "runtime.in" void arrayInitializedHelper(stack *Stack) { array * a=vm::pop(Stack); Int n=vm::pop(Stack); -#line 4371 "runtime.in" +#line 4469 "runtime.in" size_t len=checkArray(a); bool cyclic=a->cyclic(); if(cyclic && len > 0) n=imod(n,len); @@ -6328,62 +6436,62 @@ void arrayInitializedHelper(stack *Stack) } // Returns the initialize method for an array. -#line 4381 "runtime.in" +#line 4479 "runtime.in" void arrayInitialized(stack *Stack) { array * a=vm::pop(Stack); -#line 4382 "runtime.in" +#line 4480 "runtime.in" {Stack->push(new thunk(new bfunc(arrayInitializedHelper),a)); return;} } // The helper function for the cyclic method that sets the cyclic flag. -#line 4387 "runtime.in" +#line 4485 "runtime.in" void arrayCyclicHelper(stack *Stack) { array * a=vm::pop(Stack); bool b=vm::pop(Stack); -#line 4388 "runtime.in" +#line 4486 "runtime.in" checkArray(a); a->cyclic(b); } // Set the cyclic flag for an array. -#line 4394 "runtime.in" +#line 4492 "runtime.in" void arrayCyclic(stack *Stack) { array * a=vm::pop(Stack); -#line 4395 "runtime.in" +#line 4493 "runtime.in" {Stack->push(new thunk(new bfunc(arrayCyclicHelper),a)); return;} } // The helper function for the push method that does the actual operation. -#line 4400 "runtime.in" +#line 4498 "runtime.in" void arrayPushHelper(stack *Stack) { array * a=vm::pop(Stack); item x=vm::pop(Stack); -#line 4401 "runtime.in" +#line 4499 "runtime.in" checkArray(a); a->push(x); {Stack->push(x); return;} } // Returns the push method for an array. -#line 4408 "runtime.in" +#line 4506 "runtime.in" void arrayPush(stack *Stack) { array * a=vm::pop(Stack); -#line 4409 "runtime.in" +#line 4507 "runtime.in" {Stack->push(new thunk(new bfunc(arrayPushHelper),a)); return;} } // The helper function for the append method that appends b to a. -#line 4414 "runtime.in" +#line 4512 "runtime.in" void arrayAppendHelper(stack *Stack) { array * a=vm::pop(Stack); array * b=vm::pop(Stack); -#line 4415 "runtime.in" +#line 4513 "runtime.in" checkArray(a); size_t size=checkArray(b); for(size_t i=0; i < size; i++) @@ -6391,20 +6499,20 @@ void arrayAppendHelper(stack *Stack) } // Returns the append method for an array. -#line 4423 "runtime.in" +#line 4521 "runtime.in" void arrayAppend(stack *Stack) { array * a=vm::pop(Stack); -#line 4424 "runtime.in" +#line 4522 "runtime.in" {Stack->push(new thunk(new bfunc(arrayAppendHelper),a)); return;} } // The helper function for the pop method. -#line 4429 "runtime.in" +#line 4527 "runtime.in" void arrayPopHelper(stack *Stack) { array * a=vm::pop(Stack); -#line 4430 "runtime.in" +#line 4528 "runtime.in" size_t asize=checkArray(a); if(asize == 0) error("cannot pop element from empty array"); @@ -6412,22 +6520,22 @@ void arrayPopHelper(stack *Stack) } // Returns the pop method for an array. -#line 4438 "runtime.in" +#line 4536 "runtime.in" void arrayPop(stack *Stack) { array * a=vm::pop(Stack); -#line 4439 "runtime.in" +#line 4537 "runtime.in" {Stack->push(new thunk(new bfunc(arrayPopHelper),a)); return;} } // The helper function for the insert method. -#line 4444 "runtime.in" +#line 4542 "runtime.in" void arrayInsertHelper(stack *Stack) { array * a=vm::pop(Stack); array * x=vm::pop(Stack); Int i=vm::pop(Stack); -#line 4445 "runtime.in" +#line 4543 "runtime.in" size_t asize=checkArray(a); checkArray(x); if(a->cyclic() && asize > 0) i=imod(i,asize); @@ -6437,39 +6545,39 @@ void arrayInsertHelper(stack *Stack) } // Returns the insert method for an array. -#line 4455 "runtime.in" +#line 4553 "runtime.in" void arrayInsert(stack *Stack) { array * a=vm::pop(Stack); -#line 4456 "runtime.in" +#line 4554 "runtime.in" {Stack->push(new thunk(new bfunc(arrayInsertHelper),a)); return;} } // Returns the delete method for an array. -#line 4461 "runtime.in" +#line 4559 "runtime.in" void arrayDelete(stack *Stack) { array * a=vm::pop(Stack); -#line 4462 "runtime.in" +#line 4560 "runtime.in" {Stack->push(new thunk(new bfunc(arrayDeleteHelper),a)); return;} } -#line 4466 "runtime.in" +#line 4564 "runtime.in" void arrayAlias(stack *Stack) { array * b=vm::pop(Stack); array * a=vm::pop(Stack); -#line 4467 "runtime.in" +#line 4565 "runtime.in" {Stack->push(a==b); return;} } // Return array formed by indexing array a with elements of integer array b -#line 4472 "runtime.in" +#line 4570 "runtime.in" void arrayIntArray(stack *Stack) { array * b=vm::pop(Stack); array * a=vm::pop(Stack); -#line 4473 "runtime.in" +#line 4571 "runtime.in" size_t asize=checkArray(a); size_t bsize=checkArray(b); array *r=new array(bsize); @@ -6487,13 +6595,13 @@ void arrayIntArray(stack *Stack) // returns the complement of the integer array a in {0,2,...,n-1}, // so that b[complement(a,b.length)] yields the complement of b[a]. -#line 4491 "runtime.in" +#line 4589 "runtime.in" // Intarray* complement(Intarray *a, Int n); -void gen446(stack *Stack) +void gen447(stack *Stack) { Int n=vm::pop(Stack); Intarray * a=vm::pop(Stack); -#line 4492 "runtime.in" +#line 4590 "runtime.in" size_t asize=checkArray(a); array *r=new array(0); bool *keep=new bool[n]; @@ -6510,12 +6618,12 @@ void gen446(stack *Stack) } // Generate the sequence {f(i) : i=0,1,...n-1} given a function f and integer n -#line 4509 "runtime.in" +#line 4607 "runtime.in" void arraySequence(stack *Stack) { Int n=vm::pop(Stack); callable * f=vm::pop(Stack); -#line 4510 "runtime.in" +#line 4608 "runtime.in" if(n < 0) n=0; array *a=new array(n); for(Int i=0; i < n; ++i) { @@ -6527,12 +6635,12 @@ void arraySequence(stack *Stack) } // Return the array {0,1,...n-1} -#line 4522 "runtime.in" +#line 4620 "runtime.in" // Intarray* sequence(Int n); -void gen448(stack *Stack) +void gen449(stack *Stack) { Int n=vm::pop(Stack); -#line 4523 "runtime.in" +#line 4621 "runtime.in" if(n < 0) n=0; array *a=new array(n); for(Int i=0; i < n; ++i) { @@ -6542,12 +6650,12 @@ void gen448(stack *Stack) } // Apply a function to each element of an array -#line 4533 "runtime.in" +#line 4631 "runtime.in" void arrayFunction(stack *Stack) { array * a=vm::pop(Stack); callable * f=vm::pop(Stack); -#line 4534 "runtime.in" +#line 4632 "runtime.in" size_t size=checkArray(a); array *b=new array(size); for(size_t i=0; i < size; ++i) { @@ -6558,12 +6666,12 @@ void arrayFunction(stack *Stack) {Stack->push(b); return;} } -#line 4545 "runtime.in" +#line 4643 "runtime.in" void arraySort(stack *Stack) { callable * f=vm::pop(Stack); array * a=vm::pop(Stack); -#line 4546 "runtime.in" +#line 4644 "runtime.in" array *c=copyArray(a); compareFunc=f; FuncStack=Stack; @@ -6571,12 +6679,12 @@ void arraySort(stack *Stack) {Stack->push(c); return;} } -#line 4554 "runtime.in" +#line 4652 "runtime.in" // bool all(boolarray *a); -void gen451(stack *Stack) +void gen452(stack *Stack) { boolarray * a=vm::pop(Stack); -#line 4555 "runtime.in" +#line 4653 "runtime.in" size_t size=checkArray(a); bool c=true; for(size_t i=0; i < size; i++) @@ -6584,12 +6692,12 @@ void gen451(stack *Stack) {Stack->push(c); return;} } -#line 4563 "runtime.in" +#line 4661 "runtime.in" // boolarray* !(boolarray* a); -void gen452(stack *Stack) +void gen453(stack *Stack) { boolarray* a=vm::pop(Stack); -#line 4564 "runtime.in" +#line 4662 "runtime.in" size_t size=checkArray(a); array *c=new array(size); for(size_t i=0; i < size; i++) @@ -6597,12 +6705,12 @@ void gen452(stack *Stack) {Stack->push(c); return;} } -#line 4572 "runtime.in" +#line 4670 "runtime.in" // Int sum(boolarray *a); -void gen453(stack *Stack) +void gen454(stack *Stack) { boolarray * a=vm::pop(Stack); -#line 4573 "runtime.in" +#line 4671 "runtime.in" size_t size=checkArray(a); Int sum=0; for(size_t i=0; i < size; i++) @@ -6610,19 +6718,19 @@ void gen453(stack *Stack) {Stack->push(sum); return;} } -#line 4581 "runtime.in" +#line 4679 "runtime.in" void arrayCopy(stack *Stack) { array * a=vm::pop(Stack); -#line 4582 "runtime.in" +#line 4680 "runtime.in" {Stack->push(copyArray(a)); return;} } -#line 4586 "runtime.in" +#line 4684 "runtime.in" void arrayConcat(stack *Stack) { array * a=vm::pop(Stack); -#line 4587 "runtime.in" +#line 4685 "runtime.in" // a is an array of arrays to be concatenated together. // The signature is // T[] concat(... T[][] a); @@ -6649,27 +6757,27 @@ void arrayConcat(stack *Stack) {Stack->push(result); return;} } -#line 4614 "runtime.in" +#line 4712 "runtime.in" void array2Copy(stack *Stack) { array * a=vm::pop(Stack); -#line 4615 "runtime.in" +#line 4713 "runtime.in" {Stack->push(copyArray2(a)); return;} } -#line 4619 "runtime.in" +#line 4717 "runtime.in" void array3Copy(stack *Stack) { array * a=vm::pop(Stack); -#line 4620 "runtime.in" +#line 4718 "runtime.in" {Stack->push(copyArray3(a)); return;} } -#line 4624 "runtime.in" +#line 4722 "runtime.in" void array2Transpose(stack *Stack) { array * a=vm::pop(Stack); -#line 4625 "runtime.in" +#line 4723 "runtime.in" size_t asize=checkArray(a); array *c=new array(0); for(size_t i=0; i < asize; i++) { @@ -6696,12 +6804,12 @@ void array2Transpose(stack *Stack) // permutation (021 or 120, etc; original is 012). // Transpose by sending respective members to the permutated locations: // return the array obtained by putting a[i][j][k] into position perm{ijk}. -#line 4652 "runtime.in" +#line 4750 "runtime.in" void array3Transpose(stack *Stack) { array * perm=vm::pop(Stack); array * a=vm::pop(Stack); -#line 4653 "runtime.in" +#line 4751 "runtime.in" const size_t DIM=3; if(checkArray(perm) != DIM) { @@ -6785,13 +6893,13 @@ void array3Transpose(stack *Stack) // In a boolean array, find the index of the nth true value or -1 if not found // If n is negative, search backwards. -#line 4737 "runtime.in" +#line 4835 "runtime.in" // Int find(boolarray *a, Int n=1); -void gen460(stack *Stack) +void gen461(stack *Stack) { Int n=vm::pop(Stack,1); boolarray * a=vm::pop(Stack); -#line 4738 "runtime.in" +#line 4836 "runtime.in" size_t size=checkArray(a); Int j=-1; @@ -6808,13 +6916,13 @@ void gen460(stack *Stack) {Stack->push(j); return;} } -#line 4755 "runtime.in" +#line 4853 "runtime.in" // bool ==(realarray2 *a, realarray2 *b); -void gen461(stack *Stack) +void gen462(stack *Stack) { realarray2 * b=vm::pop(Stack); realarray2 * a=vm::pop(Stack); -#line 4756 "runtime.in" +#line 4854 "runtime.in" size_t n=checkArray(a); if(n != checkArray(b)) {Stack->push(false); return;} @@ -6834,13 +6942,13 @@ void gen461(stack *Stack) // construct vector obtained by replacing those elements of b for which the // corresponding elements of a are false by the corresponding element of c. -#line 4776 "runtime.in" +#line 4874 "runtime.in" void arrayConditional(stack *Stack) { array * c=vm::pop(Stack); array * b=vm::pop(Stack); array * a=vm::pop(Stack); -#line 4777 "runtime.in" +#line 4875 "runtime.in" size_t size=checkArray(a); array *r=new array(size); if(b && c) { @@ -6864,21 +6972,21 @@ void arrayConditional(stack *Stack) } // Return an n x n identity matrix. -#line 4801 "runtime.in" +#line 4899 "runtime.in" // realarray2* identity(Int n); -void gen463(stack *Stack) +void gen464(stack *Stack) { Int n=vm::pop(Stack); -#line 4802 "runtime.in" +#line 4900 "runtime.in" {Stack->push(Identity(n)); return;} } // Return the diagonal matrix with diagonal entries given by a. -#line 4807 "runtime.in" +#line 4905 "runtime.in" void diagonal(stack *Stack) { realarray * a=vm::pop(Stack); -#line 4808 "runtime.in" +#line 4906 "runtime.in" size_t n=checkArray(a); array *c=new array(n); for(size_t i=0; i < n; ++i) { @@ -6894,12 +7002,12 @@ void diagonal(stack *Stack) } // Return the inverse of an n x n matrix a using Gauss-Jordan elimination. -#line 4824 "runtime.in" +#line 4922 "runtime.in" // realarray2* inverse(realarray2 *a); -void gen465(stack *Stack) +void gen466(stack *Stack) { realarray2 * a=vm::pop(Stack); -#line 4825 "runtime.in" +#line 4923 "runtime.in" a=copyArray2(a); size_t n=checkArray(a); checkSquare(a); @@ -6992,14 +7100,14 @@ void gen465(stack *Stack) // Solve the linear equation ax=b by LU decomposition, returning the // solution x, where a is an n x n matrix and b is an array of length n. // If no solution exists, return an empty array. -#line 4918 "runtime.in" +#line 5016 "runtime.in" // realarray* solve(realarray2 *a, realarray *b, bool warn=true); -void gen466(stack *Stack) +void gen467(stack *Stack) { bool warn=vm::pop(Stack,true); realarray * b=vm::pop(Stack); realarray2 * a=vm::pop(Stack); -#line 4919 "runtime.in" +#line 5017 "runtime.in" size_t n=checkArray(a); if(n == 0) {Stack->push(new array(0)); return;} @@ -7049,14 +7157,14 @@ void gen466(stack *Stack) // Solve the linear equation ax=b by LU decomposition, returning the // solution x, where a is an n x n matrix and b is an n x m matrix. // If no solution exists, return an empty array. -#line 4969 "runtime.in" +#line 5067 "runtime.in" // realarray2* solve(realarray2 *a, realarray2 *b, bool warn=true); -void gen467(stack *Stack) +void gen468(stack *Stack) { bool warn=vm::pop(Stack,true); realarray2 * b=vm::pop(Stack); realarray2 * a=vm::pop(Stack); -#line 4970 "runtime.in" +#line 5068 "runtime.in" size_t n=checkArray(a); if(n == 0) {Stack->push(new array(0)); return;} @@ -7117,12 +7225,12 @@ void gen467(stack *Stack) } // Compute the determinant of an n x n matrix. -#line 5031 "runtime.in" +#line 5129 "runtime.in" // real determinant(realarray2 *a); -void gen468(stack *Stack) +void gen469(stack *Stack) { realarray2 * a=vm::pop(Stack); -#line 5032 "runtime.in" +#line 5130 "runtime.in" real *A=copyArray2C(a); size_t n=checkArray(a); @@ -7136,13 +7244,13 @@ void gen468(stack *Stack) {Stack->push(det); return;} } -#line 5046 "runtime.in" +#line 5144 "runtime.in" // realarray* *(realarray2 *a, realarray *b); -void gen469(stack *Stack) +void gen470(stack *Stack) { realarray * b=vm::pop(Stack); realarray2 * a=vm::pop(Stack); -#line 5047 "runtime.in" +#line 5145 "runtime.in" size_t n=checkArray(a); size_t m=checkArray(b); array *c=new array(n); @@ -7159,13 +7267,13 @@ void gen469(stack *Stack) {Stack->push(c); return;} } -#line 5064 "runtime.in" +#line 5162 "runtime.in" // realarray2* *(realarray2 *a, realarray2 *b); -void gen470(stack *Stack) +void gen471(stack *Stack) { realarray2 * b=vm::pop(Stack); realarray2 * a=vm::pop(Stack); -#line 5065 "runtime.in" +#line 5163 "runtime.in" size_t n=checkArray(a); size_t nb=checkArray(b); @@ -7199,23 +7307,23 @@ void gen470(stack *Stack) {Stack->push(c); return;} } -#line 5099 "runtime.in" +#line 5197 "runtime.in" // triple *(realarray2 *t, triple v); -void gen471(stack *Stack) +void gen472(stack *Stack) { triple v=vm::pop(Stack); realarray2 * t=vm::pop(Stack); -#line 5100 "runtime.in" +#line 5198 "runtime.in" {Stack->push(*t*v); return;} } -#line 5104 "runtime.in" +#line 5202 "runtime.in" // pair project(triple v, realarray2 *t); -void gen472(stack *Stack) +void gen473(stack *Stack) { realarray2 * t=vm::pop(Stack); triple v=vm::pop(Stack); -#line 5105 "runtime.in" +#line 5203 "runtime.in" size_t n=checkArray(t); if(n != 4) error(incommensurate); array *t0=read(t,0); @@ -7240,13 +7348,13 @@ void gen472(stack *Stack) } // Compute the dot product of vectors a and b. -#line 5130 "runtime.in" +#line 5228 "runtime.in" // real dot(realarray *a, realarray *b); -void gen473(stack *Stack) +void gen474(stack *Stack) { realarray * b=vm::pop(Stack); realarray * a=vm::pop(Stack); -#line 5131 "runtime.in" +#line 5229 "runtime.in" size_t n=checkArrays(a,b); real sum=0.0; for(size_t i=0; i < n; ++i) @@ -7261,15 +7369,15 @@ void gen473(stack *Stack) // [ a[2] b[2] c[2] ] // [ ... ] // [ c[n-1] a[n-1] b[n-1] ] -#line 5146 "runtime.in" +#line 5244 "runtime.in" // realarray* tridiagonal(realarray *a, realarray *b, realarray *c, realarray *f); -void gen474(stack *Stack) +void gen475(stack *Stack) { realarray * f=vm::pop(Stack); realarray * c=vm::pop(Stack); realarray * b=vm::pop(Stack); realarray * a=vm::pop(Stack); -#line 5147 "runtime.in" +#line 5245 "runtime.in" size_t n=checkArrays(a,b); checkEqual(n,checkArray(c)); checkEqual(n,checkArray(f)); @@ -7366,16 +7474,16 @@ void gen474(stack *Stack) } // Root solve by Newton-Raphson -#line 5244 "runtime.in" +#line 5342 "runtime.in" // real newton(Int iterations=100, callableReal *f, callableReal *fprime, real x, bool verbose=false); -void gen475(stack *Stack) +void gen476(stack *Stack) { bool verbose=vm::pop(Stack,false); real x=vm::pop(Stack); callableReal * fprime=vm::pop(Stack); callableReal * f=vm::pop(Stack); Int iterations=vm::pop(Stack,100); -#line 5246 "runtime.in" +#line 5344 "runtime.in" static const real fuzz=1000.0*DBL_EPSILON; Int i=0; size_t oldPrec=0; @@ -7421,9 +7529,9 @@ void gen475(stack *Stack) // Root solve by Newton-Raphson bisection // cf. routine rtsafe (Press et al., Numerical Recipes, 1991). -#line 5292 "runtime.in" +#line 5390 "runtime.in" // real newton(Int iterations=100, callableReal *f, callableReal *fprime, real x1, real x2, bool verbose=false); -void gen476(stack *Stack) +void gen477(stack *Stack) { bool verbose=vm::pop(Stack,false); real x2=vm::pop(Stack); @@ -7431,7 +7539,7 @@ void gen476(stack *Stack) callableReal * fprime=vm::pop(Stack); callableReal * f=vm::pop(Stack); Int iterations=vm::pop(Stack,100); -#line 5294 "runtime.in" +#line 5392 "runtime.in" static const real fuzz=1000.0*DBL_EPSILON; size_t oldPrec=0; if(verbose) @@ -7509,16 +7617,16 @@ void gen476(stack *Stack) {Stack->push((j == iterations) ? DBL_MAX : x); return;} } -#line 5372 "runtime.in" +#line 5470 "runtime.in" // real simpson(callableReal *f, real a, real b, real acc=DBL_EPSILON, real dxmax=0); -void gen477(stack *Stack) +void gen478(stack *Stack) { real dxmax=vm::pop(Stack,0); real acc=vm::pop(Stack,DBL_EPSILON); real b=vm::pop(Stack); real a=vm::pop(Stack); callableReal * f=vm::pop(Stack); -#line 5374 "runtime.in" +#line 5472 "runtime.in" real integral; if(dxmax == 0) dxmax=b-a; Func=f; @@ -7529,12 +7637,12 @@ void gen477(stack *Stack) } // Compute the fast Fourier transform of a pair array -#line 5385 "runtime.in" +#line 5483 "runtime.in" void pairArrayFFT(stack *Stack) { Int sign=vm::pop(Stack,1); pairarray * a=vm::pop(Stack); -#line 5386 "runtime.in" +#line 5484 "runtime.in" unsigned n=(unsigned) checkArray(a); #ifdef HAVE_LIBFFTW3 array *c=new array(n); @@ -7562,12 +7670,12 @@ void pairArrayFFT(stack *Stack) {Stack->push(c); return;} } -#line 5414 "runtime.in" +#line 5512 "runtime.in" // Intarray2* triangulate(pairarray *z); -void gen479(stack *Stack) +void gen480(stack *Stack) { pairarray * z=vm::pop(Stack); -#line 5415 "runtime.in" +#line 5513 "runtime.in" size_t nv=checkArray(z); // Call robust version of Gilles Dumoulin's port of Paul Bourke's // triangulation code. @@ -7603,55 +7711,55 @@ void gen479(stack *Stack) // File operations -#line 5451 "runtime.in" +#line 5549 "runtime.in" // bool ==(file *a, file *b); -void gen480(stack *Stack) +void gen481(stack *Stack) { file * b=vm::pop(Stack); file * a=vm::pop(Stack); -#line 5452 "runtime.in" +#line 5550 "runtime.in" {Stack->push(a == b); return;} } -#line 5457 "runtime.in" +#line 5555 "runtime.in" // bool !=(file *a, file *b); -void gen481(stack *Stack) +void gen482(stack *Stack) { file * b=vm::pop(Stack); file * a=vm::pop(Stack); -#line 5458 "runtime.in" +#line 5556 "runtime.in" {Stack->push(a != b); return;} } -#line 5462 "runtime.in" +#line 5560 "runtime.in" void nullFile(stack *Stack) { -#line 5463 "runtime.in" +#line 5561 "runtime.in" {Stack->push(&camp::nullfile); return;} } -#line 5467 "runtime.in" +#line 5565 "runtime.in" // file* input(string name, bool check=true, string comment=commentchar); -void gen483(stack *Stack) +void gen484(stack *Stack) { string comment=vm::pop(Stack,commentchar); bool check=vm::pop(Stack,true); string name=vm::pop(Stack); -#line 5468 "runtime.in" +#line 5566 "runtime.in" char c=comment.empty() ? (char) 0 : comment[0]; file *f=new ifile(name,c,check); f->open(); {Stack->push(f); return;} } -#line 5475 "runtime.in" +#line 5573 "runtime.in" // file* output(string name, bool update=false, string comment=commentchar); -void gen484(stack *Stack) +void gen485(stack *Stack) { string comment=vm::pop(Stack,commentchar); bool update=vm::pop(Stack,false); string name=vm::pop(Stack); -#line 5476 "runtime.in" +#line 5574 "runtime.in" file *f; if(update) { char c=comment.empty() ? (char) 0 : comment[0]; @@ -7662,13 +7770,13 @@ void gen484(stack *Stack) {Stack->push(f); return;} } -#line 5487 "runtime.in" +#line 5585 "runtime.in" // file* xinput(string name, bool check=true); -void gen485(stack *Stack) +void gen486(stack *Stack) { bool check=vm::pop(Stack,true); string name=vm::pop(Stack); -#line 5488 "runtime.in" +#line 5586 "runtime.in" #ifdef HAVE_RPC_RPC_H file *f=new ixfile(name,check); f->open(); @@ -7681,13 +7789,13 @@ void gen485(stack *Stack) #endif } -#line 5501 "runtime.in" +#line 5599 "runtime.in" // file* xoutput(string name, bool update=false); -void gen486(stack *Stack) +void gen487(stack *Stack) { bool update=vm::pop(Stack,false); string name=vm::pop(Stack); -#line 5502 "runtime.in" +#line 5600 "runtime.in" #ifdef HAVE_RPC_RPC_H file *f; if(update) @@ -7704,25 +7812,25 @@ void gen486(stack *Stack) #endif } -#line 5519 "runtime.in" +#line 5617 "runtime.in" // file* binput(string name, bool check=true); -void gen487(stack *Stack) +void gen488(stack *Stack) { bool check=vm::pop(Stack,true); string name=vm::pop(Stack); -#line 5520 "runtime.in" +#line 5618 "runtime.in" file *f=new ibfile(name,check); f->open(); {Stack->push(f); return;} } -#line 5526 "runtime.in" +#line 5624 "runtime.in" // file* boutput(string name, bool update=false); -void gen488(stack *Stack) +void gen489(stack *Stack) { bool update=vm::pop(Stack,false); string name=vm::pop(Stack); -#line 5527 "runtime.in" +#line 5625 "runtime.in" file *f; if(update) f=new iobfile(name); else f=new obfile(name); @@ -7731,77 +7839,77 @@ void gen488(stack *Stack) {Stack->push(f); return;} } -#line 5536 "runtime.in" +#line 5634 "runtime.in" // bool eof(file *File); -void gen489(stack *Stack) +void gen490(stack *Stack) { file * File=vm::pop(Stack); -#line 5537 "runtime.in" +#line 5635 "runtime.in" {Stack->push(File->eof()); return;} } -#line 5541 "runtime.in" +#line 5639 "runtime.in" // bool eol(file *File); -void gen490(stack *Stack) +void gen491(stack *Stack) { file * File=vm::pop(Stack); -#line 5542 "runtime.in" +#line 5640 "runtime.in" {Stack->push(File->eol()); return;} } -#line 5546 "runtime.in" +#line 5644 "runtime.in" // bool error(file *File); -void gen491(stack *Stack) +void gen492(stack *Stack) { file * File=vm::pop(Stack); -#line 5547 "runtime.in" +#line 5645 "runtime.in" {Stack->push(File->error()); return;} } -#line 5551 "runtime.in" +#line 5649 "runtime.in" // void clear(file *File); -void gen492(stack *Stack) +void gen493(stack *Stack) { file * File=vm::pop(Stack); -#line 5552 "runtime.in" +#line 5650 "runtime.in" File->clear(); } -#line 5556 "runtime.in" +#line 5654 "runtime.in" // void close(file *File); -void gen493(stack *Stack) +void gen494(stack *Stack) { file * File=vm::pop(Stack); -#line 5557 "runtime.in" +#line 5655 "runtime.in" File->close(); } -#line 5561 "runtime.in" +#line 5659 "runtime.in" // Int precision(file *File=NULL, Int digits=0); -void gen494(stack *Stack) +void gen495(stack *Stack) { Int digits=vm::pop(Stack,0); file * File=vm::pop(Stack,NULL); -#line 5562 "runtime.in" +#line 5660 "runtime.in" if(File == 0) File=&camp::Stdout; {Stack->push(File->precision(digits)); return;} } -#line 5567 "runtime.in" +#line 5665 "runtime.in" // void flush(file *File); -void gen495(stack *Stack) +void gen496(stack *Stack) { file * File=vm::pop(Stack); -#line 5568 "runtime.in" +#line 5666 "runtime.in" File->flush(); } -#line 5572 "runtime.in" +#line 5670 "runtime.in" // string getc(file *File); -void gen496(stack *Stack) +void gen497(stack *Stack) { file * File=vm::pop(Stack); -#line 5573 "runtime.in" +#line 5671 "runtime.in" char c=0; if(File->isOpen()) File->read(c); static char str[1]; @@ -7809,189 +7917,189 @@ void gen496(stack *Stack) {Stack->push(string(str)); return;} } -#line 5581 "runtime.in" +#line 5679 "runtime.in" // Int tell(file *File); -void gen497(stack *Stack) +void gen498(stack *Stack) { file * File=vm::pop(Stack); -#line 5582 "runtime.in" +#line 5680 "runtime.in" {Stack->push(File->tell()); return;} } -#line 5586 "runtime.in" +#line 5684 "runtime.in" // void seek(file *File, Int pos); -void gen498(stack *Stack) +void gen499(stack *Stack) { Int pos=vm::pop(Stack); file * File=vm::pop(Stack); -#line 5587 "runtime.in" +#line 5685 "runtime.in" File->seek(pos,pos >= 0); } -#line 5591 "runtime.in" +#line 5689 "runtime.in" // void seekeof(file *File); -void gen499(stack *Stack) +void gen500(stack *Stack) { file * File=vm::pop(Stack); -#line 5592 "runtime.in" +#line 5690 "runtime.in" File->seek(0,false); } // Set file dimensions -#line 5597 "runtime.in" +#line 5695 "runtime.in" // file* dimension(file *File, Int nx); -void gen500(stack *Stack) +void gen501(stack *Stack) { Int nx=vm::pop(Stack); file * File=vm::pop(Stack); -#line 5598 "runtime.in" +#line 5696 "runtime.in" File->dimension(nx); {Stack->push(File); return;} } -#line 5603 "runtime.in" +#line 5701 "runtime.in" // file* dimension(file *File, Int nx, Int ny); -void gen501(stack *Stack) +void gen502(stack *Stack) { Int ny=vm::pop(Stack); Int nx=vm::pop(Stack); file * File=vm::pop(Stack); -#line 5604 "runtime.in" +#line 5702 "runtime.in" File->dimension(nx,ny); {Stack->push(File); return;} } -#line 5609 "runtime.in" +#line 5707 "runtime.in" // file* dimension(file *File, Int nx, Int ny, Int nz); -void gen502(stack *Stack) +void gen503(stack *Stack) { Int nz=vm::pop(Stack); Int ny=vm::pop(Stack); Int nx=vm::pop(Stack); file * File=vm::pop(Stack); -#line 5610 "runtime.in" +#line 5708 "runtime.in" File->dimension(nx,ny,nz); {Stack->push(File); return;} } // Set file to read comma-separated values -#line 5616 "runtime.in" +#line 5714 "runtime.in" // file* csv(file *File, bool b=true); -void gen503(stack *Stack) +void gen504(stack *Stack) { bool b=vm::pop(Stack,true); file * File=vm::pop(Stack); -#line 5617 "runtime.in" +#line 5715 "runtime.in" File->CSVMode(b); {Stack->push(File); return;} } // Set file to read whitespace-separated values -#line 5623 "runtime.in" +#line 5721 "runtime.in" // file* word(file *File, bool b=true); -void gen504(stack *Stack) +void gen505(stack *Stack) { bool b=vm::pop(Stack,true); file * File=vm::pop(Stack); -#line 5624 "runtime.in" +#line 5722 "runtime.in" File->WordMode(b); {Stack->push(File); return;} } // Set file to read arrays in line-at-a-time mode -#line 5630 "runtime.in" +#line 5728 "runtime.in" // file* line(file *File, bool b=true); -void gen505(stack *Stack) +void gen506(stack *Stack) { bool b=vm::pop(Stack,true); file * File=vm::pop(Stack); -#line 5631 "runtime.in" +#line 5729 "runtime.in" File->LineMode(b); {Stack->push(File); return;} } // Set file to read/write single-precision XDR values. -#line 5637 "runtime.in" +#line 5735 "runtime.in" // file* single(file *File, bool b=true); -void gen506(stack *Stack) +void gen507(stack *Stack) { bool b=vm::pop(Stack,true); file * File=vm::pop(Stack); -#line 5638 "runtime.in" +#line 5736 "runtime.in" File->SingleReal(b); File->SingleInt(b); {Stack->push(File); return;} } // Set file to read/write single-precision real XDR values. -#line 5645 "runtime.in" +#line 5743 "runtime.in" // file* single(file *File, real x, bool b=true); -void gen507(stack *Stack) +void gen508(stack *Stack) { bool b=vm::pop(Stack,true); real x=vm::pop(Stack); file * File=vm::pop(Stack); -#line 5646 "runtime.in" +#line 5744 "runtime.in" File->SingleReal(b); unused(&x); {Stack->push(File); return;} } // Set file to read/write single-precision int XDR values. -#line 5653 "runtime.in" +#line 5751 "runtime.in" // file* single(file *File, Int x, bool b=true); -void gen508(stack *Stack) +void gen509(stack *Stack) { bool b=vm::pop(Stack,true); Int x=vm::pop(Stack); file * File=vm::pop(Stack); -#line 5654 "runtime.in" +#line 5752 "runtime.in" File->SingleInt(b); unused(&x); {Stack->push(File); return;} } // Set file to read an array1 (1 Int size followed by a 1d array) -#line 5661 "runtime.in" +#line 5759 "runtime.in" // file* read1(file *File); -void gen509(stack *Stack) +void gen510(stack *Stack) { file * File=vm::pop(Stack); -#line 5662 "runtime.in" +#line 5760 "runtime.in" File->dimension(-2); {Stack->push(File); return;} } // Set file to read an array2 (2 Int sizes followed by a 2d array) -#line 5668 "runtime.in" +#line 5766 "runtime.in" // file* read2(file *File); -void gen510(stack *Stack) +void gen511(stack *Stack) { file * File=vm::pop(Stack); -#line 5669 "runtime.in" +#line 5767 "runtime.in" File->dimension(-2,-2); {Stack->push(File); return;} } // Set file to read an array3 (3 Int sizes followed by a 3d array) -#line 5675 "runtime.in" +#line 5773 "runtime.in" // file* read3(file *File); -void gen511(stack *Stack) +void gen512(stack *Stack) { file * File=vm::pop(Stack); -#line 5676 "runtime.in" +#line 5774 "runtime.in" File->dimension(-2,-2,-2); {Stack->push(File); return;} } // Return the last n lines of the history named name. -#line 5682 "runtime.in" +#line 5780 "runtime.in" // stringarray* history(string name, Int n=1); -void gen512(stack *Stack) +void gen513(stack *Stack) { Int n=vm::pop(Stack,1); string name=vm::pop(Stack); -#line 5683 "runtime.in" +#line 5781 "runtime.in" #if defined(HAVE_LIBREADLINE) && defined(HAVE_LIBCURSES) bool newhistory=historyMap.find(name) == historyMap.end(); @@ -8023,12 +8131,12 @@ void gen512(stack *Stack) } // Return the last n lines of the interactive history. -#line 5715 "runtime.in" +#line 5813 "runtime.in" // stringarray* history(Int n=0); -void gen513(stack *Stack) +void gen514(stack *Stack) { Int n=vm::pop(Stack,0); -#line 5716 "runtime.in" +#line 5814 "runtime.in" #if defined(HAVE_LIBREADLINE) && defined(HAVE_LIBCURSES) {Stack->push(get_history(n)); return;} #else @@ -8039,14 +8147,14 @@ void gen513(stack *Stack) // Prompt for a string using prompt, the GNU readline library, and a // local history named name. -#line 5727 "runtime.in" +#line 5825 "runtime.in" // string readline(string prompt=emptystring, string name=emptystring, bool tabcompletion=false); -void gen514(stack *Stack) +void gen515(stack *Stack) { bool tabcompletion=vm::pop(Stack,false); string name=vm::pop(Stack,emptystring); string prompt=vm::pop(Stack,emptystring); -#line 5729 "runtime.in" +#line 5827 "runtime.in" if(!isatty(STDIN_FILENO)) {Stack->push(emptystring); return;} #if defined(HAVE_LIBREADLINE) && defined(HAVE_LIBCURSES) @@ -8088,14 +8196,14 @@ void gen514(stack *Stack) // Save a string in a local history named name. // If store=true, store the local history in the file historyfilename(name). -#line 5771 "runtime.in" +#line 5869 "runtime.in" // void saveline(string name, string value, bool store=true); -void gen515(stack *Stack) +void gen516(stack *Stack) { bool store=vm::pop(Stack,true); string value=vm::pop(Stack); string name=vm::pop(Stack); -#line 5772 "runtime.in" +#line 5870 "runtime.in" #if defined(HAVE_LIBREADLINE) && defined(HAVE_LIBCURSES) store_history(&history_save); bool newhistory=historyMap.find(name) == historyMap.end(); @@ -8122,11 +8230,11 @@ void gen515(stack *Stack) #endif } -#line 5799 "runtime.in" +#line 5897 "runtime.in" // void generate_random_backtrace(); -void gen516(stack *) +void gen517(stack *) { -#line 5800 "runtime.in" +#line 5898 "runtime.in" #if defined(USEGC) && defined(GC_DEBUG) && defined(GC_BACKTRACE) GC_generate_random_backtrace(); #else @@ -8134,12 +8242,12 @@ void gen516(stack *) #endif } -#line 5808 "runtime.in" +#line 5906 "runtime.in" // void print_random_addresses(Int n=1); -void gen517(stack *Stack) +void gen518(stack *Stack) { Int n=vm::pop(Stack,1); -#line 5809 "runtime.in" +#line 5907 "runtime.in" #if defined(USEGC) && defined(GC_DEBUG) && defined(GC_BACKTRACE) GC_gcollect(); for (Int i=0; i < n; ++i) @@ -8156,872 +8264,874 @@ namespace trans { void gen_base_venv(venv &ve) { -#line 1074 "runtime.in" +#line 1093 "runtime.in" addFunc(ve, run::gen8, primBoolean(), "!", formal(primBoolean(), "b", false, false)); -#line 1102 "runtime.in" +#line 1121 "runtime.in" addFunc(ve, run::gen13, primInt(), "AND", formal(primInt(), "a", false, false), formal(primInt(), "b", false, false)); -#line 1110 "runtime.in" +#line 1129 "runtime.in" addFunc(ve, run::gen14, primInt(), "OR", formal(primInt(), "a", false, false), formal(primInt(), "b", false, false)); -#line 1115 "runtime.in" +#line 1134 "runtime.in" addFunc(ve, run::gen15, primInt(), "XOR", formal(primInt(), "a", false, false), formal(primInt(), "b", false, false)); -#line 1120 "runtime.in" +#line 1139 "runtime.in" addFunc(ve, run::gen16, primInt(), "NOT", formal(primInt(), "a", false, false)); -#line 1151 "runtime.in" +#line 1170 "runtime.in" addFunc(ve, run::gen21, primBoolean(), "empty", formal(primPicture(), "f", false, false)); -#line 1156 "runtime.in" +#line 1175 "runtime.in" addFunc(ve, run::gen22, primVoid(), "erase", formal(primPicture(), "f", false, false)); -#line 1161 "runtime.in" +#line 1180 "runtime.in" addFunc(ve, run::gen23, primPair(), "min", formal(primPicture(), "f", false, false)); -#line 1166 "runtime.in" +#line 1185 "runtime.in" addFunc(ve, run::gen24, primPair(), "max", formal(primPicture(), "f", false, false)); -#line 1171 "runtime.in" +#line 1190 "runtime.in" addFunc(ve, run::gen25, primVoid(), "label", formal(primPicture(), "f", false, false), formal(primString(), "s", false, false), formal(primString(), "size", false, false), formal(primTransform(), "t", false, false), formal(primPair(), "position", false, false), formal(primPair(), "align", false, false), formal(primPen(), "p", false, false)); -#line 1177 "runtime.in" +#line 1196 "runtime.in" addFunc(ve, run::gen26, primBoolean(), "labels", formal(primPicture(), "f", false, false)); -#line 1182 "runtime.in" +#line 1201 "runtime.in" addFunc(ve, run::gen27, pathArray() , "_texpath", formal(primString(), "s", false, false), formal(primPen(), "p", true, false)); -#line 1249 "runtime.in" - addFunc(ve, run::gen28, pathArray() , "_strokepath", formal(primPath(), "g", false, false), formal(primPen(), "p", true, false)); -#line 1273 "runtime.in" - addFunc(ve, run::gen29, primVoid(), "_draw", formal(primPicture(), "f", false, false), formal(primPath(), "g", false, false), formal(primPen(), "p", false, false)); -#line 1278 "runtime.in" - addFunc(ve, run::gen30, primVoid(), "fill", formal(primPicture(), "f", false, false), formal(pathArray() , "g", false, false), formal(primPen(), "p", true, false), formal(primBoolean(), "copy", true, false)); -#line 1284 "runtime.in" - addFunc(ve, run::gen31, primVoid(), "latticeshade", formal(primPicture(), "f", false, false), formal(pathArray() , "g", false, false), formal(primBoolean(), "stroke", true, false), formal(primPen(), "fillrule", true, false), formal(penArray2() , "p", false, false), formal(primBoolean(), "copy", true, false)); -#line 1291 "runtime.in" - addFunc(ve, run::gen32, primVoid(), "axialshade", formal(primPicture(), "f", false, false), formal(pathArray() , "g", false, false), formal(primBoolean(), "stroke", true, false), formal(primPen(), "pena", false, false), formal(primPair(), "a", false, false), formal(primPen(), "penb", false, false), formal(primPair(), "b", false, false), formal(primBoolean(), "copy", true, false)); -#line 1298 "runtime.in" - addFunc(ve, run::gen33, primVoid(), "radialshade", formal(primPicture(), "f", false, false), formal(pathArray() , "g", false, false), formal(primBoolean(), "stroke", true, false), formal(primPen(), "pena", false, false), formal(primPair(), "a", false, false), formal(primReal(), "ra", false, false), formal(primPen(), "penb", false, false), formal(primPair(), "b", false, false), formal(primReal(), "rb", false, false), formal(primBoolean(), "copy", true, false)); -#line 1305 "runtime.in" - addFunc(ve, run::gen34, primVoid(), "gouraudshade", formal(primPicture(), "f", false, false), formal(pathArray() , "g", false, false), formal(primBoolean(), "stroke", true, false), formal(primPen(), "fillrule", true, false), formal(penArray() , "p", false, false), formal(pairArray(), "z", false, false), formal(IntArray(), "edges", false, false), formal(primBoolean(), "copy", true, false)); -#line 1316 "runtime.in" - addFunc(ve, run::gen35, primVoid(), "gouraudshade", formal(primPicture(), "f", false, false), formal(pathArray() , "g", false, false), formal(primBoolean(), "stroke", true, false), formal(primPen(), "fillrule", true, false), formal(penArray() , "p", false, false), formal(IntArray(), "edges", false, false), formal(primBoolean(), "copy", true, false)); -#line 1340 "runtime.in" - addFunc(ve, run::gen36, primVoid(), "tensorshade", formal(primPicture(), "f", false, false), formal(pathArray() , "g", false, false), formal(primBoolean(), "stroke", true, false), formal(primPen(), "fillrule", true, false), formal(penArray2() , "p", false, false), formal(pathArray() , "b", true, false), formal(pairArray2(), "z", true, false), formal(primBoolean(), "copy", true, false)); -#line 1355 "runtime.in" - addFunc(ve, run::gen37, primVoid(), "functionshade", formal(primPicture(), "f", false, false), formal(pathArray() , "g", false, false), formal(primBoolean(), "stroke", true, false), formal(primPen(), "fillrule", true, false), formal(primString() , "shader", true, false), formal(primBoolean(), "copy", true, false)); -#line 1363 "runtime.in" - addFunc(ve, run::gen38, primVoid(), "clip", formal(primPicture(), "f", false, false), formal(pathArray() , "g", false, false), formal(primBoolean(), "stroke", true, false), formal(primPen(), "fillrule", true, false), formal(primBoolean(), "copy", true, false)); -#line 1373 "runtime.in" - addFunc(ve, run::gen39, primVoid(), "beginclip", formal(primPicture(), "f", false, false), formal(pathArray() , "g", false, false), formal(primBoolean(), "stroke", true, false), formal(primPen(), "fillrule", true, false), formal(primBoolean(), "copy", true, false)); -#line 1380 "runtime.in" - addFunc(ve, run::gen40, primVoid(), "endclip", formal(primPicture(), "f", false, false)); +#line 1268 "runtime.in" + addFunc(ve, run::gen28, pathArray() , "textpath", formal(primString(), "s", false, false), formal(primPen(), "p", true, false)); +#line 1343 "runtime.in" + addFunc(ve, run::gen29, pathArray() , "_strokepath", formal(primPath(), "g", false, false), formal(primPen(), "p", true, false)); +#line 1367 "runtime.in" + addFunc(ve, run::gen30, primVoid(), "_draw", formal(primPicture(), "f", false, false), formal(primPath(), "g", false, false), formal(primPen(), "p", false, false)); +#line 1372 "runtime.in" + addFunc(ve, run::gen31, primVoid(), "fill", formal(primPicture(), "f", false, false), formal(pathArray() , "g", false, false), formal(primPen(), "p", true, false), formal(primBoolean(), "copy", true, false)); +#line 1378 "runtime.in" + addFunc(ve, run::gen32, primVoid(), "latticeshade", formal(primPicture(), "f", false, false), formal(pathArray() , "g", false, false), formal(primBoolean(), "stroke", true, false), formal(primPen(), "fillrule", true, false), formal(penArray2() , "p", false, false), formal(primBoolean(), "copy", true, false)); #line 1385 "runtime.in" - addFunc(ve, run::gen41, primVoid(), "gsave", formal(primPicture(), "f", false, false)); -#line 1390 "runtime.in" - addFunc(ve, run::gen42, primVoid(), "grestore", formal(primPicture(), "f", false, false)); -#line 1395 "runtime.in" - addFunc(ve, run::gen43, primVoid(), "begingroup", formal(primPicture(), "f", false, false)); -#line 1400 "runtime.in" - addFunc(ve, run::gen44, primVoid(), "endgroup", formal(primPicture(), "f", false, false)); -#line 1405 "runtime.in" - addFunc(ve, run::gen45, primVoid(), "add", formal(primPicture(), "dest", false, false), formal(primPicture(), "src", false, false)); + addFunc(ve, run::gen33, primVoid(), "axialshade", formal(primPicture(), "f", false, false), formal(pathArray() , "g", false, false), formal(primBoolean(), "stroke", true, false), formal(primPen(), "pena", false, false), formal(primPair(), "a", false, false), formal(primPen(), "penb", false, false), formal(primPair(), "b", false, false), formal(primBoolean(), "copy", true, false)); +#line 1392 "runtime.in" + addFunc(ve, run::gen34, primVoid(), "radialshade", formal(primPicture(), "f", false, false), formal(pathArray() , "g", false, false), formal(primBoolean(), "stroke", true, false), formal(primPen(), "pena", false, false), formal(primPair(), "a", false, false), formal(primReal(), "ra", false, false), formal(primPen(), "penb", false, false), formal(primPair(), "b", false, false), formal(primReal(), "rb", false, false), formal(primBoolean(), "copy", true, false)); +#line 1399 "runtime.in" + addFunc(ve, run::gen35, primVoid(), "gouraudshade", formal(primPicture(), "f", false, false), formal(pathArray() , "g", false, false), formal(primBoolean(), "stroke", true, false), formal(primPen(), "fillrule", true, false), formal(penArray() , "p", false, false), formal(pairArray(), "z", false, false), formal(IntArray(), "edges", false, false), formal(primBoolean(), "copy", true, false)); #line 1410 "runtime.in" - addFunc(ve, run::gen46, primVoid(), "prepend", formal(primPicture(), "dest", false, false), formal(primPicture(), "src", false, false)); -#line 1415 "runtime.in" - addFunc(ve, run::gen47, primVoid(), "postscript", formal(primPicture(), "f", false, false), formal(primString() , "s", false, false)); -#line 1420 "runtime.in" - addFunc(ve, run::gen48, primVoid(), "tex", formal(primPicture(), "f", false, false), formal(primString() , "s", false, false)); -#line 1425 "runtime.in" - addFunc(ve, run::gen49, primVoid(), "postscript", formal(primPicture(), "f", false, false), formal(primString() , "s", false, false), formal(primPair(), "min", false, false), formal(primPair(), "max", false, false)); -#line 1430 "runtime.in" - addFunc(ve, run::gen50, primVoid(), "tex", formal(primPicture(), "f", false, false), formal(primString() , "s", false, false), formal(primPair(), "min", false, false), formal(primPair(), "max", false, false)); -#line 1435 "runtime.in" - addFunc(ve, run::gen51, primVoid(), "texpreamble", formal(primString() , "s", false, false)); -#line 1443 "runtime.in" - addFunc(ve, run::gen52, primVoid(), "deletepreamble"); -#line 1450 "runtime.in" - addFunc(ve, run::gen53, primVoid(), "_labelpath", formal(primPicture(), "f", false, false), formal(primString() , "s", false, false), formal(primString() , "size", false, false), formal(primPath(), "g", false, false), formal(primString() , "justify", false, false), formal(primPair(), "offset", false, false), formal(primPen(), "p", false, false)); -#line 1456 "runtime.in" - addFunc(ve, run::gen54, primVoid(), "texreset"); -#line 1464 "runtime.in" - addFunc(ve, run::gen55, primVoid(), "layer", formal(primPicture(), "f", false, false)); -#line 1469 "runtime.in" - addFunc(ve, run::gen56, primVoid(), "newpage", formal(primPicture(), "f", false, false)); + addFunc(ve, run::gen36, primVoid(), "gouraudshade", formal(primPicture(), "f", false, false), formal(pathArray() , "g", false, false), formal(primBoolean(), "stroke", true, false), formal(primPen(), "fillrule", true, false), formal(penArray() , "p", false, false), formal(IntArray(), "edges", false, false), formal(primBoolean(), "copy", true, false)); +#line 1434 "runtime.in" + addFunc(ve, run::gen37, primVoid(), "tensorshade", formal(primPicture(), "f", false, false), formal(pathArray() , "g", false, false), formal(primBoolean(), "stroke", true, false), formal(primPen(), "fillrule", true, false), formal(penArray2() , "p", false, false), formal(pathArray() , "b", true, false), formal(pairArray2(), "z", true, false), formal(primBoolean(), "copy", true, false)); +#line 1449 "runtime.in" + addFunc(ve, run::gen38, primVoid(), "functionshade", formal(primPicture(), "f", false, false), formal(pathArray() , "g", false, false), formal(primBoolean(), "stroke", true, false), formal(primPen(), "fillrule", true, false), formal(primString() , "shader", true, false), formal(primBoolean(), "copy", true, false)); +#line 1457 "runtime.in" + addFunc(ve, run::gen39, primVoid(), "clip", formal(primPicture(), "f", false, false), formal(pathArray() , "g", false, false), formal(primBoolean(), "stroke", true, false), formal(primPen(), "fillrule", true, false), formal(primBoolean(), "copy", true, false)); +#line 1467 "runtime.in" + addFunc(ve, run::gen40, primVoid(), "beginclip", formal(primPicture(), "f", false, false), formal(pathArray() , "g", false, false), formal(primBoolean(), "stroke", true, false), formal(primPen(), "fillrule", true, false), formal(primBoolean(), "copy", true, false)); #line 1474 "runtime.in" - addFunc(ve, run::gen57, primVoid(), "_image", formal(primPicture(), "f", false, false), formal(realArray2(), "data", false, false), formal(primPair(), "initial", false, false), formal(primPair(), "final", false, false), formal(penArray() , "palette", true, false), formal(primTransform(), "t", true, false), formal(primBoolean(), "copy", true, false), formal(primBoolean(), "antialias", true, false)); + addFunc(ve, run::gen41, primVoid(), "endclip", formal(primPicture(), "f", false, false)); +#line 1479 "runtime.in" + addFunc(ve, run::gen42, primVoid(), "gsave", formal(primPicture(), "f", false, false)); #line 1484 "runtime.in" - addFunc(ve, run::gen58, primVoid(), "_image", formal(primPicture(), "f", false, false), formal(penArray2() , "data", false, false), formal(primPair(), "initial", false, false), formal(primPair(), "final", false, false), formal(primTransform(), "t", true, false), formal(primBoolean(), "copy", true, false), formal(primBoolean(), "antialias", true, false)); -#line 1491 "runtime.in" - addFunc(ve, run::gen59, primString() , "nativeformat"); -#line 1496 "runtime.in" - addFunc(ve, run::gen60, primBoolean(), "latex"); -#line 1501 "runtime.in" - addFunc(ve, run::gen61, primBoolean(), "pdf"); -#line 1506 "runtime.in" - addFunc(ve, run::gen62, primVoid(), "shipout", formal(primString() , "prefix", true, false), formal(primPicture(), "f", false, false), formal(primPicture(), "preamble", true, false), formal(primString() , "format", true, false), formal(primBoolean(), "wait", true, false), formal(primBoolean(), "view", true, false), formal(transformFunction(), "xform", false, false)); -#line 1552 "runtime.in" - addFunc(ve, run::gen63, primVoid(), "shipout3", formal(primString() , "prefix", false, false), formal(primPicture(), "f", false, false), formal(primString() , "format", true, false), formal(primReal(), "width", false, false), formal(primReal(), "height", false, false), formal(primReal(), "angle", false, false), formal(primTriple(), "m", false, false), formal(primTriple(), "m", false, false), formal(realArray2(), "t", false, false), formal(tripleArray(), "lights", false, false), formal(realArray2(), "diffuse", false, false), formal(realArray2(), "ambient", false, false), formal(realArray2(), "specular", false, false), formal(primBoolean(), "viewportlighting", false, false), formal(primBoolean(), "view", true, false)); + addFunc(ve, run::gen43, primVoid(), "grestore", formal(primPicture(), "f", false, false)); +#line 1489 "runtime.in" + addFunc(ve, run::gen44, primVoid(), "begingroup", formal(primPicture(), "f", false, false)); +#line 1494 "runtime.in" + addFunc(ve, run::gen45, primVoid(), "endgroup", formal(primPicture(), "f", false, false)); +#line 1499 "runtime.in" + addFunc(ve, run::gen46, primVoid(), "add", formal(primPicture(), "dest", false, false), formal(primPicture(), "src", false, false)); +#line 1504 "runtime.in" + addFunc(ve, run::gen47, primVoid(), "prepend", formal(primPicture(), "dest", false, false), formal(primPicture(), "src", false, false)); +#line 1509 "runtime.in" + addFunc(ve, run::gen48, primVoid(), "postscript", formal(primPicture(), "f", false, false), formal(primString() , "s", false, false)); +#line 1514 "runtime.in" + addFunc(ve, run::gen49, primVoid(), "tex", formal(primPicture(), "f", false, false), formal(primString() , "s", false, false)); +#line 1519 "runtime.in" + addFunc(ve, run::gen50, primVoid(), "postscript", formal(primPicture(), "f", false, false), formal(primString() , "s", false, false), formal(primPair(), "min", false, false), formal(primPair(), "max", false, false)); +#line 1524 "runtime.in" + addFunc(ve, run::gen51, primVoid(), "tex", formal(primPicture(), "f", false, false), formal(primString() , "s", false, false), formal(primPair(), "min", false, false), formal(primPair(), "max", false, false)); +#line 1529 "runtime.in" + addFunc(ve, run::gen52, primVoid(), "texpreamble", formal(primString() , "s", false, false)); +#line 1537 "runtime.in" + addFunc(ve, run::gen53, primVoid(), "deletepreamble"); +#line 1544 "runtime.in" + addFunc(ve, run::gen54, primVoid(), "_labelpath", formal(primPicture(), "f", false, false), formal(primString() , "s", false, false), formal(primString() , "size", false, false), formal(primPath(), "g", false, false), formal(primString() , "justify", false, false), formal(primPair(), "offset", false, false), formal(primPen(), "p", false, false)); +#line 1550 "runtime.in" + addFunc(ve, run::gen55, primVoid(), "texreset"); +#line 1558 "runtime.in" + addFunc(ve, run::gen56, primVoid(), "layer", formal(primPicture(), "f", false, false)); +#line 1563 "runtime.in" + addFunc(ve, run::gen57, primVoid(), "newpage", formal(primPicture(), "f", false, false)); #line 1568 "runtime.in" - addFunc(ve, run::gen64, primVoid(), "shipout3", formal(primString() , "prefix", false, false), formal(primPicture(), "f", false, false)); -#line 1573 "runtime.in" - addFunc(ve, run::gen65, primVoid(), "deconstruct", formal(primPicture(), "f", false, false), formal(primPicture(), "preamble", true, false), formal(primReal(), "magnification", true, false), formal(transformFunction(), "xform", false, false)); -#line 1706 "runtime.in" - addFunc(ve, run::gen66, primVoid(), "purge", formal(primInt(), "divisor", true, false)); -#line 1719 "runtime.in" - addFunc(ve, run::gen68, primBoolean(), "==", formal(primPen(), "a", false, false), formal(primPen(), "b", false, false)); -#line 1724 "runtime.in" - addFunc(ve, run::gen69, primBoolean(), "!=", formal(primPen(), "a", false, false), formal(primPen(), "b", false, false)); -#line 1729 "runtime.in" - addFunc(ve, run::gen70, primPen(), "+", formal(primPen(), "a", false, false), formal(primPen(), "b", false, false)); -#line 1734 "runtime.in" - addFunc(ve, run::gen71, primPen(), "*", formal(primReal(), "a", false, false), formal(primPen(), "b", false, false)); -#line 1739 "runtime.in" - addFunc(ve, run::gen72, primPen(), "*", formal(primPen(), "a", false, false), formal(primReal(), "b", false, false)); -#line 1744 "runtime.in" - addFunc(ve, run::gen73, primPair(), "max", formal(primPen(), "p", false, false)); -#line 1749 "runtime.in" - addFunc(ve, run::gen74, primPair(), "min", formal(primPen(), "p", false, false)); -#line 1754 "runtime.in" - addFunc(ve, run::gen75, primVoid(), "resetdefaultpen"); -#line 1760 "runtime.in" - addFunc(ve, run::gen76, primVoid(), "defaultpen", formal(primPen(), "p", false, false)); -#line 1765 "runtime.in" - addFunc(ve, run::gen77, primPen(), "defaultpen"); -#line 1770 "runtime.in" - addFunc(ve, run::gen78, primBoolean(), "invisible", formal(primPen(), "p", false, false)); -#line 1775 "runtime.in" - addFunc(ve, run::gen79, primPen(), "invisible"); -#line 1780 "runtime.in" - addFunc(ve, run::gen80, primPen(), "gray", formal(primPen(), "p", false, false)); -#line 1786 "runtime.in" - addFunc(ve, run::gen81, primPen(), "rgb", formal(primPen(), "p", false, false)); -#line 1792 "runtime.in" - addFunc(ve, run::gen82, primPen(), "cmyk", formal(primPen(), "p", false, false)); -#line 1798 "runtime.in" - addFunc(ve, run::gen83, primPen(), "interp", formal(primPen(), "a", false, false), formal(primPen(), "b", false, false), formal(primReal(), "t", false, false)); -#line 1803 "runtime.in" - addFunc(ve, run::gen84, primPen(), "rgb", formal(primReal(), "r", false, false), formal(primReal(), "g", false, false), formal(primReal(), "b", false, false)); -#line 1808 "runtime.in" - addFunc(ve, run::gen85, primPen(), "cmyk", formal(primReal(), "c", false, false), formal(primReal(), "m", false, false), formal(primReal(), "y", false, false), formal(primReal(), "k", false, false)); + addFunc(ve, run::gen58, primVoid(), "_image", formal(primPicture(), "f", false, false), formal(realArray2(), "data", false, false), formal(primPair(), "initial", false, false), formal(primPair(), "final", false, false), formal(penArray() , "palette", true, false), formal(primTransform(), "t", true, false), formal(primBoolean(), "copy", true, false), formal(primBoolean(), "antialias", true, false)); +#line 1578 "runtime.in" + addFunc(ve, run::gen59, primVoid(), "_image", formal(primPicture(), "f", false, false), formal(penArray2() , "data", false, false), formal(primPair(), "initial", false, false), formal(primPair(), "final", false, false), formal(primTransform(), "t", true, false), formal(primBoolean(), "copy", true, false), formal(primBoolean(), "antialias", true, false)); +#line 1585 "runtime.in" + addFunc(ve, run::gen60, primString() , "nativeformat"); +#line 1590 "runtime.in" + addFunc(ve, run::gen61, primBoolean(), "latex"); +#line 1595 "runtime.in" + addFunc(ve, run::gen62, primBoolean(), "pdf"); +#line 1600 "runtime.in" + addFunc(ve, run::gen63, primVoid(), "shipout", formal(primString() , "prefix", true, false), formal(primPicture(), "f", false, false), formal(primPicture(), "preamble", true, false), formal(primString() , "format", true, false), formal(primBoolean(), "wait", true, false), formal(primBoolean(), "view", true, false), formal(transformFunction(), "xform", false, false)); +#line 1646 "runtime.in" + addFunc(ve, run::gen64, primVoid(), "shipout3", formal(primString() , "prefix", false, false), formal(primPicture(), "f", false, false), formal(primString() , "format", true, false), formal(primReal(), "width", false, false), formal(primReal(), "height", false, false), formal(primReal(), "angle", false, false), formal(primTriple(), "m", false, false), formal(primTriple(), "m", false, false), formal(realArray2(), "t", false, false), formal(realArray(), "background", false, false), formal(tripleArray(), "lights", false, false), formal(realArray2(), "diffuse", false, false), formal(realArray2(), "ambient", false, false), formal(realArray2(), "specular", false, false), formal(primBoolean(), "viewportlighting", false, false), formal(primBoolean(), "view", true, false)); +#line 1662 "runtime.in" + addFunc(ve, run::gen65, primVoid(), "shipout3", formal(primString() , "prefix", false, false), formal(primPicture(), "f", false, false)); +#line 1667 "runtime.in" + addFunc(ve, run::gen66, primVoid(), "deconstruct", formal(primPicture(), "f", false, false), formal(primPicture(), "preamble", true, false), formal(primReal(), "magnification", true, false), formal(transformFunction(), "xform", false, false)); +#line 1800 "runtime.in" + addFunc(ve, run::gen67, primVoid(), "purge", formal(primInt(), "divisor", true, false)); #line 1813 "runtime.in" - addFunc(ve, run::gen86, primPen(), "gray", formal(primReal(), "gray", false, false)); + addFunc(ve, run::gen69, primBoolean(), "==", formal(primPen(), "a", false, false), formal(primPen(), "b", false, false)); #line 1818 "runtime.in" - addFunc(ve, run::gen87, realArray(), "colors", formal(primPen(), "p", false, false)); -#line 1846 "runtime.in" - addFunc(ve, run::gen88, primString() , "colorspace", formal(primPen(), "p", false, false)); -#line 1853 "runtime.in" - addFunc(ve, run::gen89, primPen(), "pattern", formal(primString(), "s", false, false)); -#line 1858 "runtime.in" - addFunc(ve, run::gen90, primString() , "pattern", formal(primPen(), "p", false, false)); -#line 1863 "runtime.in" - addFunc(ve, run::gen91, primPen(), "fillrule", formal(primInt(), "n", false, false)); -#line 1868 "runtime.in" - addFunc(ve, run::gen92, primInt(), "fillrule", formal(primPen(), "p", false, false)); -#line 1873 "runtime.in" - addFunc(ve, run::gen93, primPen(), "opacity", formal(primReal(), "opacity", true, false), formal(primString() , "blend", true, false)); -#line 1883 "runtime.in" - addFunc(ve, run::gen94, primReal(), "opacity", formal(primPen(), "p", false, false)); -#line 1888 "runtime.in" - addFunc(ve, run::gen95, primString() , "blend", formal(primPen(), "p", false, false)); -#line 1893 "runtime.in" - addFunc(ve, run::gen96, primPen(), "linetype", formal(primString(), "s", false, false), formal(primReal(), "offset", true, false), formal(primBoolean(), "scale", true, false), formal(primBoolean(), "adjust", true, false)); -#line 1898 "runtime.in" - addFunc(ve, run::gen97, primString() , "linetype", formal(primPen(), "p", true, false)); -#line 1903 "runtime.in" - addFunc(ve, run::gen98, primReal(), "offset", formal(primPen(), "p", false, false)); -#line 1908 "runtime.in" - addFunc(ve, run::gen99, primBoolean(), "scale", formal(primPen(), "p", false, false)); -#line 1913 "runtime.in" - addFunc(ve, run::gen100, primBoolean(), "adjust", formal(primPen(), "p", false, false)); -#line 1918 "runtime.in" - addFunc(ve, run::gen101, primPen(), "adjust", formal(primPen(), "p", false, false), formal(primReal(), "arclength", false, false), formal(primBoolean(), "cyclic", false, false)); -#line 1923 "runtime.in" - addFunc(ve, run::gen102, primPen(), "linecap", formal(primInt(), "n", false, false)); -#line 1928 "runtime.in" - addFunc(ve, run::gen103, primInt(), "linecap", formal(primPen(), "p", true, false)); -#line 1933 "runtime.in" - addFunc(ve, run::gen104, primPen(), "linejoin", formal(primInt(), "n", false, false)); -#line 1938 "runtime.in" - addFunc(ve, run::gen105, primInt(), "linejoin", formal(primPen(), "p", true, false)); -#line 1943 "runtime.in" - addFunc(ve, run::gen106, primPen(), "miterlimit", formal(primReal(), "x", false, false)); -#line 1948 "runtime.in" - addFunc(ve, run::gen107, primReal(), "miterlimit", formal(primPen(), "p", true, false)); -#line 1953 "runtime.in" - addFunc(ve, run::gen108, primPen(), "linewidth", formal(primReal(), "x", false, false)); -#line 1958 "runtime.in" - addFunc(ve, run::gen109, primReal(), "linewidth", formal(primPen(), "p", true, false)); -#line 1963 "runtime.in" - addFunc(ve, run::gen110, primPen(), "fontcommand", formal(primString(), "s", false, false)); -#line 1968 "runtime.in" - addFunc(ve, run::gen111, primString() , "font", formal(primPen(), "p", true, false)); -#line 1973 "runtime.in" - addFunc(ve, run::gen112, primPen(), "fontsize", formal(primReal(), "size", false, false), formal(primReal(), "lineskip", false, false)); -#line 1979 "runtime.in" - addFunc(ve, run::gen113, primReal(), "fontsize", formal(primPen(), "p", true, false)); -#line 1984 "runtime.in" - addFunc(ve, run::gen114, primReal(), "lineskip", formal(primPen(), "p", true, false)); -#line 1989 "runtime.in" - addFunc(ve, run::gen115, primPen(), "overwrite", formal(primInt(), "n", false, false)); -#line 1995 "runtime.in" - addFunc(ve, run::gen116, primInt(), "overwrite", formal(primPen(), "p", true, false)); -#line 2000 "runtime.in" - addFunc(ve, run::gen117, primPen(), "basealign", formal(primInt(), "n", false, false)); -#line 2005 "runtime.in" - addFunc(ve, run::gen118, primInt(), "basealign", formal(primPen(), "p", true, false)); -#line 2010 "runtime.in" - addFunc(ve, run::gen119, primTransform(), "transform", formal(primPen(), "p", false, false)); -#line 2015 "runtime.in" - addFunc(ve, run::gen120, primPath(), "nib", formal(primPen(), "p", false, false)); -#line 2020 "runtime.in" - addFunc(ve, run::gen121, primPen(), "makepen", formal(primPath(), "p", false, false)); -#line 2025 "runtime.in" - addFunc(ve, run::gen122, primPen(), "colorless", formal(primPen(), "p", false, false)); -#line 2031 "runtime.in" - addFunc(ve, run::gen123, primBoolean(), "interactive"); -#line 2038 "runtime.in" - addFunc(ve, run::gen124, primBoolean(), "uptodate"); -#line 2043 "runtime.in" - addFunc(ve, run::gen125, primInt(), "system", formal(primString() , "s", false, false)); -#line 2053 "runtime.in" - addFunc(ve, run::gen126, primBoolean(), "view"); -#line 2058 "runtime.in" - addFunc(ve, run::gen127, primString() , "asydir"); -#line 2063 "runtime.in" - addFunc(ve, run::gen128, primString() , "locale", formal(primString() , "s", true, false)); -#line 2069 "runtime.in" - addFunc(ve, run::gen129, primVoid(), "abort", formal(primString() , "s", true, false)); -#line 2075 "runtime.in" - addFunc(ve, run::gen130, primVoid(), "exit"); -#line 2080 "runtime.in" - addFunc(ve, run::gen131, primVoid(), "assert", formal(primBoolean(), "b", false, false), formal(primString() , "s", true, false)); -#line 2091 "runtime.in" - addFunc(ve, run::gen132, primVoid(), "sleep", formal(primInt(), "seconds", false, false)); -#line 2097 "runtime.in" - addFunc(ve, run::gen133, primVoid(), "usleep", formal(primInt(), "microseconds", false, false)); -#line 2103 "runtime.in" - addFunc(ve, run::gen134, primVoid(), "_eval", formal(primString(), "s", false, false), formal(primBoolean(), "embedded", false, false), formal(primBoolean(), "interactivewrite", true, false)); -#line 2118 "runtime.in" - addFunc(ve, run::gen135, primVoid(), "_eval", formal(primCode(), "s", false, false), formal(primBoolean(), "embedded", false, false)); -#line 2136 "runtime.in" - addFunc(ve, run::gen136, primString() , "location"); -#line 2148 "runtime.in" - addFunc(ve, run::gen138, primString() , "cd", formal(primString() , "s", true, false)); -#line 2154 "runtime.in" - addFunc(ve, run::gen139, primVoid(), "list", formal(primString(), "s", false, false), formal(primBoolean(), "imports", true, false)); -#line 2171 "runtime.in" - addFunc(ve, run::gen141, primBoolean(), "==", formal(primPath(), "a", false, false), formal(primPath(), "b", false, false)); -#line 2176 "runtime.in" - addFunc(ve, run::gen142, primBoolean(), "!=", formal(primPath(), "a", false, false), formal(primPath(), "b", false, false)); -#line 2181 "runtime.in" - addFunc(ve, run::gen143, primPair(), "point", formal(primPath(), "p", false, false), formal(primInt(), "t", false, false)); -#line 2186 "runtime.in" - addFunc(ve, run::gen144, primPair(), "point", formal(primPath(), "p", false, false), formal(primReal(), "t", false, false)); + addFunc(ve, run::gen70, primBoolean(), "!=", formal(primPen(), "a", false, false), formal(primPen(), "b", false, false)); +#line 1823 "runtime.in" + addFunc(ve, run::gen71, primPen(), "+", formal(primPen(), "a", false, false), formal(primPen(), "b", false, false)); +#line 1828 "runtime.in" + addFunc(ve, run::gen72, primPen(), "*", formal(primReal(), "a", false, false), formal(primPen(), "b", false, false)); +#line 1833 "runtime.in" + addFunc(ve, run::gen73, primPen(), "*", formal(primPen(), "a", false, false), formal(primReal(), "b", false, false)); +#line 1838 "runtime.in" + addFunc(ve, run::gen74, primPair(), "max", formal(primPen(), "p", false, false)); +#line 1843 "runtime.in" + addFunc(ve, run::gen75, primPair(), "min", formal(primPen(), "p", false, false)); +#line 1848 "runtime.in" + addFunc(ve, run::gen76, primVoid(), "resetdefaultpen"); +#line 1854 "runtime.in" + addFunc(ve, run::gen77, primVoid(), "defaultpen", formal(primPen(), "p", false, false)); +#line 1859 "runtime.in" + addFunc(ve, run::gen78, primPen(), "defaultpen"); +#line 1864 "runtime.in" + addFunc(ve, run::gen79, primBoolean(), "invisible", formal(primPen(), "p", false, false)); +#line 1869 "runtime.in" + addFunc(ve, run::gen80, primPen(), "invisible"); +#line 1874 "runtime.in" + addFunc(ve, run::gen81, primPen(), "gray", formal(primPen(), "p", false, false)); +#line 1880 "runtime.in" + addFunc(ve, run::gen82, primPen(), "rgb", formal(primPen(), "p", false, false)); +#line 1886 "runtime.in" + addFunc(ve, run::gen83, primPen(), "cmyk", formal(primPen(), "p", false, false)); +#line 1892 "runtime.in" + addFunc(ve, run::gen84, primPen(), "interp", formal(primPen(), "a", false, false), formal(primPen(), "b", false, false), formal(primReal(), "t", false, false)); +#line 1897 "runtime.in" + addFunc(ve, run::gen85, primPen(), "rgb", formal(primReal(), "r", false, false), formal(primReal(), "g", false, false), formal(primReal(), "b", false, false)); +#line 1902 "runtime.in" + addFunc(ve, run::gen86, primPen(), "cmyk", formal(primReal(), "c", false, false), formal(primReal(), "m", false, false), formal(primReal(), "y", false, false), formal(primReal(), "k", false, false)); +#line 1907 "runtime.in" + addFunc(ve, run::gen87, primPen(), "gray", formal(primReal(), "gray", false, false)); +#line 1912 "runtime.in" + addFunc(ve, run::gen88, realArray(), "colors", formal(primPen(), "p", false, false)); +#line 1940 "runtime.in" + addFunc(ve, run::gen89, primString() , "colorspace", formal(primPen(), "p", false, false)); +#line 1947 "runtime.in" + addFunc(ve, run::gen90, primPen(), "pattern", formal(primString(), "s", false, false)); +#line 1952 "runtime.in" + addFunc(ve, run::gen91, primString() , "pattern", formal(primPen(), "p", false, false)); +#line 1957 "runtime.in" + addFunc(ve, run::gen92, primPen(), "fillrule", formal(primInt(), "n", false, false)); +#line 1962 "runtime.in" + addFunc(ve, run::gen93, primInt(), "fillrule", formal(primPen(), "p", false, false)); +#line 1967 "runtime.in" + addFunc(ve, run::gen94, primPen(), "opacity", formal(primReal(), "opacity", true, false), formal(primString() , "blend", true, false)); +#line 1977 "runtime.in" + addFunc(ve, run::gen95, primReal(), "opacity", formal(primPen(), "p", false, false)); +#line 1982 "runtime.in" + addFunc(ve, run::gen96, primString() , "blend", formal(primPen(), "p", false, false)); +#line 1987 "runtime.in" + addFunc(ve, run::gen97, primPen(), "linetype", formal(primString(), "s", false, false), formal(primReal(), "offset", true, false), formal(primBoolean(), "scale", true, false), formal(primBoolean(), "adjust", true, false)); +#line 1992 "runtime.in" + addFunc(ve, run::gen98, primString() , "linetype", formal(primPen(), "p", true, false)); +#line 1997 "runtime.in" + addFunc(ve, run::gen99, primReal(), "offset", formal(primPen(), "p", false, false)); +#line 2002 "runtime.in" + addFunc(ve, run::gen100, primBoolean(), "scale", formal(primPen(), "p", false, false)); +#line 2007 "runtime.in" + addFunc(ve, run::gen101, primBoolean(), "adjust", formal(primPen(), "p", false, false)); +#line 2012 "runtime.in" + addFunc(ve, run::gen102, primPen(), "adjust", formal(primPen(), "p", false, false), formal(primReal(), "arclength", false, false), formal(primBoolean(), "cyclic", false, false)); +#line 2017 "runtime.in" + addFunc(ve, run::gen103, primPen(), "linecap", formal(primInt(), "n", false, false)); +#line 2022 "runtime.in" + addFunc(ve, run::gen104, primInt(), "linecap", formal(primPen(), "p", true, false)); +#line 2027 "runtime.in" + addFunc(ve, run::gen105, primPen(), "linejoin", formal(primInt(), "n", false, false)); +#line 2032 "runtime.in" + addFunc(ve, run::gen106, primInt(), "linejoin", formal(primPen(), "p", true, false)); +#line 2037 "runtime.in" + addFunc(ve, run::gen107, primPen(), "miterlimit", formal(primReal(), "x", false, false)); +#line 2042 "runtime.in" + addFunc(ve, run::gen108, primReal(), "miterlimit", formal(primPen(), "p", true, false)); +#line 2047 "runtime.in" + addFunc(ve, run::gen109, primPen(), "linewidth", formal(primReal(), "x", false, false)); +#line 2052 "runtime.in" + addFunc(ve, run::gen110, primReal(), "linewidth", formal(primPen(), "p", true, false)); +#line 2057 "runtime.in" + addFunc(ve, run::gen111, primPen(), "fontcommand", formal(primString(), "s", false, false)); +#line 2062 "runtime.in" + addFunc(ve, run::gen112, primString() , "font", formal(primPen(), "p", true, false)); +#line 2067 "runtime.in" + addFunc(ve, run::gen113, primPen(), "fontsize", formal(primReal(), "size", false, false), formal(primReal(), "lineskip", false, false)); +#line 2073 "runtime.in" + addFunc(ve, run::gen114, primReal(), "fontsize", formal(primPen(), "p", true, false)); +#line 2078 "runtime.in" + addFunc(ve, run::gen115, primReal(), "lineskip", formal(primPen(), "p", true, false)); +#line 2083 "runtime.in" + addFunc(ve, run::gen116, primPen(), "overwrite", formal(primInt(), "n", false, false)); +#line 2089 "runtime.in" + addFunc(ve, run::gen117, primInt(), "overwrite", formal(primPen(), "p", true, false)); +#line 2094 "runtime.in" + addFunc(ve, run::gen118, primPen(), "basealign", formal(primInt(), "n", false, false)); +#line 2099 "runtime.in" + addFunc(ve, run::gen119, primInt(), "basealign", formal(primPen(), "p", true, false)); +#line 2104 "runtime.in" + addFunc(ve, run::gen120, primTransform(), "transform", formal(primPen(), "p", false, false)); +#line 2109 "runtime.in" + addFunc(ve, run::gen121, primPath(), "nib", formal(primPen(), "p", false, false)); +#line 2114 "runtime.in" + addFunc(ve, run::gen122, primPen(), "makepen", formal(primPath(), "p", false, false)); +#line 2119 "runtime.in" + addFunc(ve, run::gen123, primPen(), "colorless", formal(primPen(), "p", false, false)); +#line 2125 "runtime.in" + addFunc(ve, run::gen124, primBoolean(), "interactive"); +#line 2132 "runtime.in" + addFunc(ve, run::gen125, primBoolean(), "uptodate"); +#line 2137 "runtime.in" + addFunc(ve, run::gen126, primInt(), "system", formal(primString() , "s", false, false)); +#line 2147 "runtime.in" + addFunc(ve, run::gen127, primBoolean(), "view"); +#line 2152 "runtime.in" + addFunc(ve, run::gen128, primString() , "asydir"); +#line 2157 "runtime.in" + addFunc(ve, run::gen129, primString() , "locale", formal(primString() , "s", true, false)); +#line 2163 "runtime.in" + addFunc(ve, run::gen130, primVoid(), "abort", formal(primString() , "s", true, false)); +#line 2169 "runtime.in" + addFunc(ve, run::gen131, primVoid(), "exit"); +#line 2174 "runtime.in" + addFunc(ve, run::gen132, primVoid(), "assert", formal(primBoolean(), "b", false, false), formal(primString() , "s", true, false)); +#line 2185 "runtime.in" + addFunc(ve, run::gen133, primVoid(), "sleep", formal(primInt(), "seconds", false, false)); #line 2191 "runtime.in" - addFunc(ve, run::gen145, primPair(), "precontrol", formal(primPath(), "p", false, false), formal(primInt(), "t", false, false)); -#line 2196 "runtime.in" - addFunc(ve, run::gen146, primPair(), "precontrol", formal(primPath(), "p", false, false), formal(primReal(), "t", false, false)); -#line 2201 "runtime.in" - addFunc(ve, run::gen147, primPair(), "postcontrol", formal(primPath(), "p", false, false), formal(primInt(), "t", false, false)); -#line 2206 "runtime.in" - addFunc(ve, run::gen148, primPair(), "postcontrol", formal(primPath(), "p", false, false), formal(primReal(), "t", false, false)); -#line 2211 "runtime.in" - addFunc(ve, run::gen149, primPair(), "dir", formal(primPath(), "p", false, false), formal(primInt(), "t", false, false), formal(primInt(), "sign", true, false), formal(primBoolean(), "normalize", true, false)); -#line 2216 "runtime.in" - addFunc(ve, run::gen150, primPair(), "dir", formal(primPath(), "p", false, false), formal(primReal(), "t", false, false), formal(primBoolean(), "normalize", true, false)); -#line 2221 "runtime.in" - addFunc(ve, run::gen151, primPair(), "accel", formal(primPath(), "p", false, false), formal(primInt(), "t", false, false), formal(primInt(), "sign", true, false)); -#line 2226 "runtime.in" - addFunc(ve, run::gen152, primPair(), "accel", formal(primPath(), "p", false, false), formal(primReal(), "t", false, false)); -#line 2231 "runtime.in" - addFunc(ve, run::gen153, primReal(), "radius", formal(primPath(), "p", false, false), formal(primReal(), "t", false, false)); -#line 2243 "runtime.in" - addFunc(ve, run::gen154, primPath(), "reverse", formal(primPath(), "p", false, false)); + addFunc(ve, run::gen134, primVoid(), "usleep", formal(primInt(), "microseconds", false, false)); +#line 2197 "runtime.in" + addFunc(ve, run::gen135, primVoid(), "_eval", formal(primString(), "s", false, false), formal(primBoolean(), "embedded", false, false), formal(primBoolean(), "interactivewrite", true, false)); +#line 2212 "runtime.in" + addFunc(ve, run::gen136, primVoid(), "_eval", formal(primCode(), "s", false, false), formal(primBoolean(), "embedded", false, false)); +#line 2230 "runtime.in" + addFunc(ve, run::gen137, primString() , "location"); +#line 2242 "runtime.in" + addFunc(ve, run::gen139, primString() , "cd", formal(primString() , "s", true, false)); #line 2248 "runtime.in" - addFunc(ve, run::gen155, primPath(), "subpath", formal(primPath(), "p", false, false), formal(primInt(), "a", false, false), formal(primInt(), "b", false, false)); -#line 2253 "runtime.in" - addFunc(ve, run::gen156, primPath(), "subpath", formal(primPath(), "p", false, false), formal(primReal(), "a", false, false), formal(primReal(), "b", false, false)); -#line 2258 "runtime.in" - addFunc(ve, run::gen157, primPath(), "nurb", formal(primPair(), "z0", false, false), formal(primPair(), "z1", false, false), formal(primPair(), "z2", false, false), formal(primPair(), "z3", false, false), formal(primReal(), "w0", false, false), formal(primReal(), "w1", false, false), formal(primReal(), "w2", false, false), formal(primReal(), "w3", false, false), formal(primInt(), "m", false, false)); -#line 2264 "runtime.in" - addFunc(ve, run::gen158, primInt(), "length", formal(primPath(), "p", false, false)); -#line 2269 "runtime.in" - addFunc(ve, run::gen159, primBoolean(), "cyclic", formal(primPath(), "p", false, false)); -#line 2274 "runtime.in" - addFunc(ve, run::gen160, primBoolean(), "straight", formal(primPath(), "p", false, false), formal(primInt(), "t", false, false)); -#line 2279 "runtime.in" - addFunc(ve, run::gen161, primPath(), "unstraighten", formal(primPath(), "p", false, false)); -#line 2284 "runtime.in" - addFunc(ve, run::gen162, primBoolean(), "piecewisestraight", formal(primPath(), "p", false, false)); -#line 2289 "runtime.in" - addFunc(ve, run::gen163, primReal(), "arclength", formal(primPath(), "p", false, false)); -#line 2294 "runtime.in" - addFunc(ve, run::gen164, primReal(), "arctime", formal(primPath(), "p", false, false), formal(primReal(), "dval", false, false)); -#line 2299 "runtime.in" - addFunc(ve, run::gen165, primReal(), "dirtime", formal(primPath(), "p", false, false), formal(primPair(), "z", false, false)); -#line 2304 "runtime.in" - addFunc(ve, run::gen166, realArray(), "intersect", formal(primPath(), "p", false, false), formal(primPath(), "q", false, false), formal(primReal(), "fuzz", true, false)); -#line 2321 "runtime.in" - addFunc(ve, run::gen167, realArray2(), "intersections", formal(primPath(), "p", false, false), formal(primPath(), "q", false, false), formal(primReal(), "fuzz", true, false)); + addFunc(ve, run::gen140, primVoid(), "list", formal(primString(), "s", false, false), formal(primBoolean(), "imports", true, false)); +#line 2265 "runtime.in" + addFunc(ve, run::gen142, primBoolean(), "==", formal(primPath(), "a", false, false), formal(primPath(), "b", false, false)); +#line 2270 "runtime.in" + addFunc(ve, run::gen143, primBoolean(), "!=", formal(primPath(), "a", false, false), formal(primPath(), "b", false, false)); +#line 2275 "runtime.in" + addFunc(ve, run::gen144, primPair(), "point", formal(primPath(), "p", false, false), formal(primInt(), "t", false, false)); +#line 2280 "runtime.in" + addFunc(ve, run::gen145, primPair(), "point", formal(primPath(), "p", false, false), formal(primReal(), "t", false, false)); +#line 2285 "runtime.in" + addFunc(ve, run::gen146, primPair(), "precontrol", formal(primPath(), "p", false, false), formal(primInt(), "t", false, false)); +#line 2290 "runtime.in" + addFunc(ve, run::gen147, primPair(), "precontrol", formal(primPath(), "p", false, false), formal(primReal(), "t", false, false)); +#line 2295 "runtime.in" + addFunc(ve, run::gen148, primPair(), "postcontrol", formal(primPath(), "p", false, false), formal(primInt(), "t", false, false)); +#line 2300 "runtime.in" + addFunc(ve, run::gen149, primPair(), "postcontrol", formal(primPath(), "p", false, false), formal(primReal(), "t", false, false)); +#line 2305 "runtime.in" + addFunc(ve, run::gen150, primPair(), "dir", formal(primPath(), "p", false, false), formal(primInt(), "t", false, false), formal(primInt(), "sign", true, false), formal(primBoolean(), "normalize", true, false)); +#line 2310 "runtime.in" + addFunc(ve, run::gen151, primPair(), "dir", formal(primPath(), "p", false, false), formal(primReal(), "t", false, false), formal(primBoolean(), "normalize", true, false)); +#line 2315 "runtime.in" + addFunc(ve, run::gen152, primPair(), "accel", formal(primPath(), "p", false, false), formal(primInt(), "t", false, false), formal(primInt(), "sign", true, false)); +#line 2320 "runtime.in" + addFunc(ve, run::gen153, primPair(), "accel", formal(primPath(), "p", false, false), formal(primReal(), "t", false, false)); +#line 2325 "runtime.in" + addFunc(ve, run::gen154, primReal(), "radius", formal(primPath(), "p", false, false), formal(primReal(), "t", false, false)); +#line 2337 "runtime.in" + addFunc(ve, run::gen155, primPath(), "reverse", formal(primPath(), "p", false, false)); +#line 2342 "runtime.in" + addFunc(ve, run::gen156, primPath(), "subpath", formal(primPath(), "p", false, false), formal(primInt(), "a", false, false), formal(primInt(), "b", false, false)); +#line 2347 "runtime.in" + addFunc(ve, run::gen157, primPath(), "subpath", formal(primPath(), "p", false, false), formal(primReal(), "a", false, false), formal(primReal(), "b", false, false)); #line 2352 "runtime.in" - addFunc(ve, run::gen168, realArray(), "intersections", formal(primPath(), "p", false, false), formal(primPair(), "a", false, true), formal(primPair(), "b", false, true), formal(primReal(), "fuzz", true, false)); -#line 2367 "runtime.in" - addFunc(ve, run::gen169, primPair(), "extension", formal(primPair(), "p", false, false), formal(primPair(), "q", false, false), formal(primPair(), "p", false, false), formal(primPair(), "q", false, false)); + addFunc(ve, run::gen158, primPath(), "nurb", formal(primPair(), "z0", false, false), formal(primPair(), "z1", false, false), formal(primPair(), "z2", false, false), formal(primPair(), "z3", false, false), formal(primReal(), "w0", false, false), formal(primReal(), "w1", false, false), formal(primReal(), "w2", false, false), formal(primReal(), "w3", false, false), formal(primInt(), "m", false, false)); +#line 2358 "runtime.in" + addFunc(ve, run::gen159, primInt(), "length", formal(primPath(), "p", false, false)); +#line 2363 "runtime.in" + addFunc(ve, run::gen160, primBoolean(), "cyclic", formal(primPath(), "p", false, false)); +#line 2368 "runtime.in" + addFunc(ve, run::gen161, primBoolean(), "straight", formal(primPath(), "p", false, false), formal(primInt(), "t", false, false)); +#line 2373 "runtime.in" + addFunc(ve, run::gen162, primPath(), "unstraighten", formal(primPath(), "p", false, false)); #line 2378 "runtime.in" - addFunc(ve, run::gen170, primInt(), "size", formal(primPath(), "p", false, false)); + addFunc(ve, run::gen163, primBoolean(), "piecewisestraight", formal(primPath(), "p", false, false)); #line 2383 "runtime.in" - addFunc(ve, run::gen171, primPath(), "&", formal(primPath(), "p", false, false), formal(primPath(), "q", false, false)); + addFunc(ve, run::gen164, primReal(), "arclength", formal(primPath(), "p", false, false)); #line 2388 "runtime.in" - addFunc(ve, run::gen172, primPair(), "min", formal(primPath(), "p", false, false)); + addFunc(ve, run::gen165, primReal(), "arctime", formal(primPath(), "p", false, false), formal(primReal(), "dval", false, false)); #line 2393 "runtime.in" - addFunc(ve, run::gen173, primPair(), "max", formal(primPath(), "p", false, false)); + addFunc(ve, run::gen166, primReal(), "dirtime", formal(primPath(), "p", false, false), formal(primPair(), "z", false, false)); #line 2398 "runtime.in" - addFunc(ve, run::gen174, realArray(), "mintimes", formal(primPath(), "p", false, false)); -#line 2407 "runtime.in" - addFunc(ve, run::gen175, realArray(), "maxtimes", formal(primPath(), "p", false, false)); -#line 2416 "runtime.in" - addFunc(ve, run::gen176, primReal(), "relativedistance", formal(primReal(), "theta", false, false), formal(primReal(), "phi", false, false), formal(primReal(), "t", false, false), formal(primBoolean(), "atleast", false, false)); -#line 2421 "runtime.in" - addFunc(ve, run::gen177, primInt(), "windingnumber", formal(pathArray() , "p", false, false), formal(primPair(), "z", false, false)); -#line 2426 "runtime.in" - addFunc(ve, run::gen178, primBoolean(), "inside", formal(pathArray() , "g", false, true), formal(primPair(), "z", false, false), formal(primPen(), "fillrule", true, false)); -#line 2431 "runtime.in" - addFunc(ve, run::gen179, primBoolean(), "inside", formal(primPath(), "g", false, false), formal(primPair(), "z", false, false), formal(primPen(), "fillrule", true, false)); -#line 2436 "runtime.in" - addFunc(ve, run::gen180, primReal(), "side", formal(primPair(), "a", false, false), formal(primPair(), "b", false, false), formal(primPair(), "c", false, false)); -#line 2443 "runtime.in" - addFunc(ve, run::gen181, primReal(), "incircle", formal(primPair(), "a", false, false), formal(primPair(), "b", false, false), formal(primPair(), "c", false, false), formal(primPair(), "d", false, false)); -#line 2451 "runtime.in" - addFunc(ve, run::gen182, primPath3(), "path3", formal(tripleArray(), "pre", false, false), formal(tripleArray(), "point", false, false), formal(tripleArray(), "post", false, false), formal(boolArray(), "straight", false, false), formal(primBoolean(), "cyclic", false, false)); -#line 2476 "runtime.in" - addFunc(ve, run::gen184, primBoolean(), "==", formal(primPath3(), "a", false, false), formal(primPath3(), "b", false, false)); -#line 2481 "runtime.in" - addFunc(ve, run::gen185, primBoolean(), "!=", formal(primPath3(), "a", false, false), formal(primPath3(), "b", false, false)); -#line 2486 "runtime.in" - addFunc(ve, run::gen186, primTriple(), "point", formal(primPath3(), "p", false, false), formal(primInt(), "t", false, false)); -#line 2491 "runtime.in" - addFunc(ve, run::gen187, primTriple(), "point", formal(primPath3(), "p", false, false), formal(primReal(), "t", false, false)); -#line 2496 "runtime.in" - addFunc(ve, run::gen188, primTriple(), "precontrol", formal(primPath3(), "p", false, false), formal(primInt(), "t", false, false)); + addFunc(ve, run::gen167, realArray(), "intersect", formal(primPath(), "p", false, false), formal(primPath(), "q", false, false), formal(primReal(), "fuzz", true, false)); +#line 2415 "runtime.in" + addFunc(ve, run::gen168, realArray2(), "intersections", formal(primPath(), "p", false, false), formal(primPath(), "q", false, false), formal(primReal(), "fuzz", true, false)); +#line 2446 "runtime.in" + addFunc(ve, run::gen169, realArray(), "intersections", formal(primPath(), "p", false, false), formal(primPair(), "a", false, true), formal(primPair(), "b", false, true), formal(primReal(), "fuzz", true, false)); +#line 2461 "runtime.in" + addFunc(ve, run::gen170, primPair(), "extension", formal(primPair(), "p", false, false), formal(primPair(), "q", false, false), formal(primPair(), "p", false, false), formal(primPair(), "q", false, false)); +#line 2472 "runtime.in" + addFunc(ve, run::gen171, primInt(), "size", formal(primPath(), "p", false, false)); +#line 2477 "runtime.in" + addFunc(ve, run::gen172, primPath(), "&", formal(primPath(), "p", false, false), formal(primPath(), "q", false, false)); +#line 2482 "runtime.in" + addFunc(ve, run::gen173, primPair(), "min", formal(primPath(), "p", false, false)); +#line 2487 "runtime.in" + addFunc(ve, run::gen174, primPair(), "max", formal(primPath(), "p", false, false)); +#line 2492 "runtime.in" + addFunc(ve, run::gen175, realArray(), "mintimes", formal(primPath(), "p", false, false)); #line 2501 "runtime.in" - addFunc(ve, run::gen189, primTriple(), "precontrol", formal(primPath3(), "p", false, false), formal(primReal(), "t", false, false)); -#line 2506 "runtime.in" - addFunc(ve, run::gen190, primTriple(), "postcontrol", formal(primPath3(), "p", false, false), formal(primInt(), "t", false, false)); -#line 2511 "runtime.in" - addFunc(ve, run::gen191, primTriple(), "postcontrol", formal(primPath3(), "p", false, false), formal(primReal(), "t", false, false)); -#line 2516 "runtime.in" - addFunc(ve, run::gen192, primTriple(), "dir", formal(primPath3(), "p", false, false), formal(primInt(), "t", false, false), formal(primInt(), "sign", true, false), formal(primBoolean(), "normalize", true, false)); -#line 2521 "runtime.in" - addFunc(ve, run::gen193, primTriple(), "dir", formal(primPath3(), "p", false, false), formal(primReal(), "t", false, false), formal(primBoolean(), "normalize", true, false)); -#line 2526 "runtime.in" - addFunc(ve, run::gen194, primTriple(), "accel", formal(primPath3(), "p", false, false), formal(primInt(), "t", false, false), formal(primInt(), "sign", true, false)); -#line 2531 "runtime.in" - addFunc(ve, run::gen195, primTriple(), "accel", formal(primPath3(), "p", false, false), formal(primReal(), "t", false, false)); -#line 2536 "runtime.in" - addFunc(ve, run::gen196, primReal(), "radius", formal(primPath3(), "p", false, false), formal(primReal(), "t", false, false)); -#line 2548 "runtime.in" - addFunc(ve, run::gen197, primReal(), "radius", formal(primTriple(), "z0", false, false), formal(primTriple(), "c0", false, false), formal(primTriple(), "c1", false, false), formal(primTriple(), "z1", false, false), formal(primReal(), "t", false, false)); -#line 2560 "runtime.in" - addFunc(ve, run::gen198, primPath3(), "reverse", formal(primPath3(), "p", false, false)); -#line 2565 "runtime.in" - addFunc(ve, run::gen199, primPath3(), "subpath", formal(primPath3(), "p", false, false), formal(primInt(), "a", false, false), formal(primInt(), "b", false, false)); + addFunc(ve, run::gen176, realArray(), "maxtimes", formal(primPath(), "p", false, false)); +#line 2510 "runtime.in" + addFunc(ve, run::gen177, primReal(), "relativedistance", formal(primReal(), "theta", false, false), formal(primReal(), "phi", false, false), formal(primReal(), "t", false, false), formal(primBoolean(), "atleast", false, false)); +#line 2515 "runtime.in" + addFunc(ve, run::gen178, primInt(), "windingnumber", formal(pathArray() , "p", false, false), formal(primPair(), "z", false, false)); +#line 2520 "runtime.in" + addFunc(ve, run::gen179, primBoolean(), "inside", formal(pathArray() , "g", false, true), formal(primPair(), "z", false, false), formal(primPen(), "fillrule", true, false)); +#line 2525 "runtime.in" + addFunc(ve, run::gen180, primBoolean(), "inside", formal(primPath(), "g", false, false), formal(primPair(), "z", false, false), formal(primPen(), "fillrule", true, false)); +#line 2530 "runtime.in" + addFunc(ve, run::gen181, primReal(), "side", formal(primPair(), "a", false, false), formal(primPair(), "b", false, false), formal(primPair(), "c", false, false)); +#line 2537 "runtime.in" + addFunc(ve, run::gen182, primReal(), "incircle", formal(primPair(), "a", false, false), formal(primPair(), "b", false, false), formal(primPair(), "c", false, false), formal(primPair(), "d", false, false)); +#line 2545 "runtime.in" + addFunc(ve, run::gen183, primPath3(), "path3", formal(tripleArray(), "pre", false, false), formal(tripleArray(), "point", false, false), formal(tripleArray(), "post", false, false), formal(boolArray(), "straight", false, false), formal(primBoolean(), "cyclic", false, false)); #line 2570 "runtime.in" - addFunc(ve, run::gen200, primPath3(), "subpath", formal(primPath3(), "p", false, false), formal(primReal(), "a", false, false), formal(primReal(), "b", false, false)); + addFunc(ve, run::gen185, primBoolean(), "==", formal(primPath3(), "a", false, false), formal(primPath3(), "b", false, false)); #line 2575 "runtime.in" - addFunc(ve, run::gen201, primInt(), "length", formal(primPath3(), "p", false, false)); + addFunc(ve, run::gen186, primBoolean(), "!=", formal(primPath3(), "a", false, false), formal(primPath3(), "b", false, false)); #line 2580 "runtime.in" - addFunc(ve, run::gen202, primBoolean(), "cyclic", formal(primPath3(), "p", false, false)); + addFunc(ve, run::gen187, primTriple(), "point", formal(primPath3(), "p", false, false), formal(primInt(), "t", false, false)); #line 2585 "runtime.in" - addFunc(ve, run::gen203, primBoolean(), "straight", formal(primPath3(), "p", false, false), formal(primInt(), "t", false, false)); + addFunc(ve, run::gen188, primTriple(), "point", formal(primPath3(), "p", false, false), formal(primReal(), "t", false, false)); #line 2590 "runtime.in" - addFunc(ve, run::gen204, primTriple(), "perp", formal(primTriple(), "v", false, false), formal(primTriple(), "u", false, false)); -#line 2596 "runtime.in" - addFunc(ve, run::gen205, primReal(), "straightness", formal(primPath3(), "p", false, false), formal(primInt(), "t", false, false)); -#line 2607 "runtime.in" - addFunc(ve, run::gen206, primReal(), "straightness", formal(primTriple(), "z0", false, false), formal(primTriple(), "c0", false, false), formal(primTriple(), "c1", false, false), formal(primTriple(), "z1", false, false)); + addFunc(ve, run::gen189, primTriple(), "precontrol", formal(primPath3(), "p", false, false), formal(primInt(), "t", false, false)); +#line 2595 "runtime.in" + addFunc(ve, run::gen190, primTriple(), "precontrol", formal(primPath3(), "p", false, false), formal(primReal(), "t", false, false)); +#line 2600 "runtime.in" + addFunc(ve, run::gen191, primTriple(), "postcontrol", formal(primPath3(), "p", false, false), formal(primInt(), "t", false, false)); +#line 2605 "runtime.in" + addFunc(ve, run::gen192, primTriple(), "postcontrol", formal(primPath3(), "p", false, false), formal(primReal(), "t", false, false)); +#line 2610 "runtime.in" + addFunc(ve, run::gen193, primTriple(), "dir", formal(primPath3(), "p", false, false), formal(primInt(), "t", false, false), formal(primInt(), "sign", true, false), formal(primBoolean(), "normalize", true, false)); #line 2615 "runtime.in" - addFunc(ve, run::gen207, primBoolean(), "piecewisestraight", formal(primPath3(), "p", false, false)); + addFunc(ve, run::gen194, primTriple(), "dir", formal(primPath3(), "p", false, false), formal(primReal(), "t", false, false), formal(primBoolean(), "normalize", true, false)); #line 2620 "runtime.in" - addFunc(ve, run::gen208, primReal(), "arclength", formal(primPath3(), "p", false, false)); + addFunc(ve, run::gen195, primTriple(), "accel", formal(primPath3(), "p", false, false), formal(primInt(), "t", false, false), formal(primInt(), "sign", true, false)); #line 2625 "runtime.in" - addFunc(ve, run::gen209, primReal(), "arctime", formal(primPath3(), "p", false, false), formal(primReal(), "dval", false, false)); + addFunc(ve, run::gen196, primTriple(), "accel", formal(primPath3(), "p", false, false), formal(primReal(), "t", false, false)); #line 2630 "runtime.in" - addFunc(ve, run::gen210, realArray(), "intersect", formal(primPath3(), "p", false, false), formal(primPath3(), "q", false, false), formal(primReal(), "fuzz", true, false)); -#line 2648 "runtime.in" - addFunc(ve, run::gen211, realArray2(), "intersections", formal(primPath3(), "p", false, false), formal(primPath3(), "q", false, false), formal(primReal(), "fuzz", true, false)); -#line 2681 "runtime.in" - addFunc(ve, run::gen212, primInt(), "size", formal(primPath3(), "p", false, false)); -#line 2686 "runtime.in" - addFunc(ve, run::gen213, primPath3(), "&", formal(primPath3(), "p", false, false), formal(primPath3(), "q", false, false)); -#line 2691 "runtime.in" - addFunc(ve, run::gen214, primTriple(), "min", formal(primPath3(), "p", false, false)); -#line 2696 "runtime.in" - addFunc(ve, run::gen215, primTriple(), "max", formal(primPath3(), "p", false, false)); + addFunc(ve, run::gen197, primReal(), "radius", formal(primPath3(), "p", false, false), formal(primReal(), "t", false, false)); +#line 2642 "runtime.in" + addFunc(ve, run::gen198, primReal(), "radius", formal(primTriple(), "z0", false, false), formal(primTriple(), "c0", false, false), formal(primTriple(), "c1", false, false), formal(primTriple(), "z1", false, false), formal(primReal(), "t", false, false)); +#line 2654 "runtime.in" + addFunc(ve, run::gen199, primPath3(), "reverse", formal(primPath3(), "p", false, false)); +#line 2659 "runtime.in" + addFunc(ve, run::gen200, primPath3(), "subpath", formal(primPath3(), "p", false, false), formal(primInt(), "a", false, false), formal(primInt(), "b", false, false)); +#line 2664 "runtime.in" + addFunc(ve, run::gen201, primPath3(), "subpath", formal(primPath3(), "p", false, false), formal(primReal(), "a", false, false), formal(primReal(), "b", false, false)); +#line 2669 "runtime.in" + addFunc(ve, run::gen202, primInt(), "length", formal(primPath3(), "p", false, false)); +#line 2674 "runtime.in" + addFunc(ve, run::gen203, primBoolean(), "cyclic", formal(primPath3(), "p", false, false)); +#line 2679 "runtime.in" + addFunc(ve, run::gen204, primBoolean(), "straight", formal(primPath3(), "p", false, false), formal(primInt(), "t", false, false)); +#line 2684 "runtime.in" + addFunc(ve, run::gen205, primTriple(), "perp", formal(primTriple(), "v", false, false), formal(primTriple(), "u", false, false)); +#line 2690 "runtime.in" + addFunc(ve, run::gen206, primReal(), "straightness", formal(primPath3(), "p", false, false), formal(primInt(), "t", false, false)); #line 2701 "runtime.in" - addFunc(ve, run::gen216, realArray(), "mintimes", formal(primPath3(), "p", false, false)); -#line 2711 "runtime.in" - addFunc(ve, run::gen217, realArray(), "maxtimes", formal(primPath3(), "p", false, false)); -#line 2721 "runtime.in" - addFunc(ve, run::gen218, primPath3(), "*", formal(realArray2(), "t", false, false), formal(primPath3(), "g", false, false)); -#line 2776 "runtime.in" - addFunc(ve, run::gen223, primGuide(), "operator cast", formal(primCycleToken(), "tok", false, false)); -#line 2783 "runtime.in" - addFunc(ve, run::gen224, primGuide(), "operator spec", formal(primPair(), "z", false, false), formal(primInt(), "p", false, false)); -#line 2791 "runtime.in" - addFunc(ve, run::gen225, primCurlSpecifier(), "operator curl", formal(primReal(), "gamma", false, false), formal(primInt(), "p", false, false)); -#line 2807 "runtime.in" - addFunc(ve, run::gen228, primGuide(), "operator cast", formal(primCurlSpecifier(), "spec", false, false)); -#line 2812 "runtime.in" - addFunc(ve, run::gen229, primTensionSpecifier(), "operator tension", formal(primReal(), "tout", false, false), formal(primReal(), "tin", false, false), formal(primBoolean(), "atleast", false, false)); -#line 2832 "runtime.in" - addFunc(ve, run::gen233, primGuide(), "operator cast", formal(primTensionSpecifier(), "t", false, false)); -#line 2837 "runtime.in" - addFunc(ve, run::gen234, primGuide(), "operator controls", formal(primPair(), "zout", false, false), formal(primPair(), "zin", false, false)); -#line 2842 "runtime.in" - addFunc(ve, run::gen235, primInt(), "size", formal(primGuide(), "g", false, false)); -#line 2849 "runtime.in" - addFunc(ve, run::gen236, primInt(), "length", formal(primGuide(), "g", false, false)); -#line 2856 "runtime.in" - addFunc(ve, run::gen237, primBoolean(), "cyclic", formal(primGuide(), "g", false, false)); -#line 2863 "runtime.in" - addFunc(ve, run::gen238, primPair(), "point", formal(primGuide(), "g", false, false), formal(primInt(), "t", false, false)); + addFunc(ve, run::gen207, primReal(), "straightness", formal(primTriple(), "z0", false, false), formal(primTriple(), "c0", false, false), formal(primTriple(), "c1", false, false), formal(primTriple(), "z1", false, false)); +#line 2709 "runtime.in" + addFunc(ve, run::gen208, primBoolean(), "piecewisestraight", formal(primPath3(), "p", false, false)); +#line 2714 "runtime.in" + addFunc(ve, run::gen209, primReal(), "arclength", formal(primPath3(), "p", false, false)); +#line 2719 "runtime.in" + addFunc(ve, run::gen210, primReal(), "arctime", formal(primPath3(), "p", false, false), formal(primReal(), "dval", false, false)); +#line 2724 "runtime.in" + addFunc(ve, run::gen211, realArray(), "intersect", formal(primPath3(), "p", false, false), formal(primPath3(), "q", false, false), formal(primReal(), "fuzz", true, false)); +#line 2742 "runtime.in" + addFunc(ve, run::gen212, realArray2(), "intersections", formal(primPath3(), "p", false, false), formal(primPath3(), "q", false, false), formal(primReal(), "fuzz", true, false)); +#line 2775 "runtime.in" + addFunc(ve, run::gen213, primInt(), "size", formal(primPath3(), "p", false, false)); +#line 2780 "runtime.in" + addFunc(ve, run::gen214, primPath3(), "&", formal(primPath3(), "p", false, false), formal(primPath3(), "q", false, false)); +#line 2785 "runtime.in" + addFunc(ve, run::gen215, primTriple(), "min", formal(primPath3(), "p", false, false)); +#line 2790 "runtime.in" + addFunc(ve, run::gen216, primTriple(), "max", formal(primPath3(), "p", false, false)); +#line 2795 "runtime.in" + addFunc(ve, run::gen217, realArray(), "mintimes", formal(primPath3(), "p", false, false)); +#line 2805 "runtime.in" + addFunc(ve, run::gen218, realArray(), "maxtimes", formal(primPath3(), "p", false, false)); +#line 2815 "runtime.in" + addFunc(ve, run::gen219, primPath3(), "*", formal(realArray2(), "t", false, false), formal(primPath3(), "g", false, false)); #line 2870 "runtime.in" - addFunc(ve, run::gen239, pairArray(), "dirSpecifier", formal(primGuide(), "g", false, false), formal(primInt(), "t", false, false)); -#line 2882 "runtime.in" - addFunc(ve, run::gen240, pairArray(), "controlSpecifier", formal(primGuide(), "g", false, false), formal(primInt(), "t", false, false)); -#line 2899 "runtime.in" - addFunc(ve, run::gen241, primTensionSpecifier(), "tensionSpecifier", formal(primGuide(), "g", false, false), formal(primInt(), "t", false, false)); -#line 2909 "runtime.in" - addFunc(ve, run::gen242, realArray(), "curlSpecifier", formal(primGuide(), "g", false, false), formal(primInt(), "t", false, false)); -#line 2923 "runtime.in" - addFunc(ve, run::gen243, primGuide(), "reverse", formal(primGuide(), "g", false, false)); -#line 2977 "runtime.in" - addFunc(ve, run::gen244, primVoid(), "_draw", formal(primPicture(), "f", false, false), formal(primPath3(), "g", false, false), formal(primPen(), "p", false, false)); -#line 2985 "runtime.in" - addFunc(ve, run::gen245, primVoid(), "draw", formal(primPicture(), "f", false, false), formal(tripleArray2(), "g", false, false), formal(primBoolean(), "straight", false, false), formal(penArray() , "p", false, false), formal(primReal(), "opacity", false, false), formal(primReal(), "shininess", false, false), formal(primReal(), "granularity", false, false), formal(primTriple(), "normal", false, false), formal(primBoolean(), "lighton", false, false), formal(penArray() , "colors", false, false)); + addFunc(ve, run::gen224, primGuide(), "operator cast", formal(primCycleToken(), "tok", false, false)); +#line 2877 "runtime.in" + addFunc(ve, run::gen225, primGuide(), "operator spec", formal(primPair(), "z", false, false), formal(primInt(), "p", false, false)); +#line 2885 "runtime.in" + addFunc(ve, run::gen226, primCurlSpecifier(), "operator curl", formal(primReal(), "gamma", false, false), formal(primInt(), "p", false, false)); +#line 2901 "runtime.in" + addFunc(ve, run::gen229, primGuide(), "operator cast", formal(primCurlSpecifier(), "spec", false, false)); +#line 2906 "runtime.in" + addFunc(ve, run::gen230, primTensionSpecifier(), "operator tension", formal(primReal(), "tout", false, false), formal(primReal(), "tin", false, false), formal(primBoolean(), "atleast", false, false)); +#line 2926 "runtime.in" + addFunc(ve, run::gen234, primGuide(), "operator cast", formal(primTensionSpecifier(), "t", false, false)); +#line 2931 "runtime.in" + addFunc(ve, run::gen235, primGuide(), "operator controls", formal(primPair(), "zout", false, false), formal(primPair(), "zin", false, false)); +#line 2936 "runtime.in" + addFunc(ve, run::gen236, primInt(), "size", formal(primGuide(), "g", false, false)); +#line 2943 "runtime.in" + addFunc(ve, run::gen237, primInt(), "length", formal(primGuide(), "g", false, false)); +#line 2950 "runtime.in" + addFunc(ve, run::gen238, primBoolean(), "cyclic", formal(primGuide(), "g", false, false)); +#line 2957 "runtime.in" + addFunc(ve, run::gen239, primPair(), "point", formal(primGuide(), "g", false, false), formal(primInt(), "t", false, false)); +#line 2964 "runtime.in" + addFunc(ve, run::gen240, pairArray(), "dirSpecifier", formal(primGuide(), "g", false, false), formal(primInt(), "t", false, false)); +#line 2976 "runtime.in" + addFunc(ve, run::gen241, pairArray(), "controlSpecifier", formal(primGuide(), "g", false, false), formal(primInt(), "t", false, false)); #line 2993 "runtime.in" - addFunc(ve, run::gen246, primTriple(), "min3", formal(primPicture(), "f", false, false)); -#line 2998 "runtime.in" - addFunc(ve, run::gen247, primTriple(), "max3", formal(primPicture(), "f", false, false)); + addFunc(ve, run::gen242, primTensionSpecifier(), "tensionSpecifier", formal(primGuide(), "g", false, false), formal(primInt(), "t", false, false)); #line 3003 "runtime.in" - addFunc(ve, run::gen248, primPair(), "min", formal(primPicture(), "f", false, false), formal(realArray2(), "t", false, false)); -#line 3011 "runtime.in" - addFunc(ve, run::gen249, primPair(), "max", formal(primPicture(), "f", false, false), formal(realArray2(), "t", false, false)); -#line 3019 "runtime.in" - addFunc(ve, run::gen250, primPair(), "minratio", formal(primPicture(), "f", false, false)); -#line 3024 "runtime.in" - addFunc(ve, run::gen251, primPair(), "maxratio", formal(primPicture(), "f", false, false)); -#line 3029 "runtime.in" - addFunc(ve, run::gen252, primReal(), "minbound", formal(realArray(), "a", false, false), formal(primReal(), "b", false, false)); -#line 3037 "runtime.in" - addFunc(ve, run::gen253, primReal(), "maxbound", formal(realArray(), "a", false, false), formal(primReal(), "b", false, false)); -#line 3045 "runtime.in" - addFunc(ve, run::gen254, primPair(), "minbound", formal(tripleArray(), "a", false, false), formal(realArray2(), "t", false, false), formal(primPair(), "b", false, false)); -#line 3056 "runtime.in" - addFunc(ve, run::gen255, primPair(), "maxbound", formal(tripleArray(), "a", false, false), formal(realArray2(), "t", false, false), formal(primPair(), "b", false, false)); -#line 3067 "runtime.in" - addFunc(ve, run::gen256, primPair(), "max", formal(primPath3(), "g", false, false), formal(realArray2(), "t", false, false)); -#line 3075 "runtime.in" - addFunc(ve, run::gen257, primPair(), "min", formal(primPath3(), "g", false, false), formal(realArray2(), "t", false, false)); -#line 3083 "runtime.in" - addFunc(ve, run::gen258, primReal(), "change2", formal(tripleArray2(), "a", false, false)); + addFunc(ve, run::gen243, realArray(), "curlSpecifier", formal(primGuide(), "g", false, false), formal(primInt(), "t", false, false)); +#line 3017 "runtime.in" + addFunc(ve, run::gen244, primGuide(), "reverse", formal(primGuide(), "g", false, false)); +#line 3071 "runtime.in" + addFunc(ve, run::gen245, primVoid(), "_draw", formal(primPicture(), "f", false, false), formal(primPath3(), "g", false, false), formal(primPen(), "p", false, false)); +#line 3079 "runtime.in" + addFunc(ve, run::gen246, primVoid(), "draw", formal(primPicture(), "f", false, false), formal(tripleArray2(), "g", false, false), formal(primBoolean(), "straight", false, false), formal(penArray() , "p", false, false), formal(primReal(), "opacity", false, false), formal(primReal(), "shininess", false, false), formal(primReal(), "granularity", false, false), formal(primTriple(), "normal", false, false), formal(primBoolean(), "lighton", false, false), formal(penArray() , "colors", false, false)); +#line 3087 "runtime.in" + addFunc(ve, run::gen247, primTriple(), "min3", formal(primPicture(), "f", false, false)); +#line 3092 "runtime.in" + addFunc(ve, run::gen248, primTriple(), "max3", formal(primPicture(), "f", false, false)); +#line 3097 "runtime.in" + addFunc(ve, run::gen249, primPair(), "min", formal(primPicture(), "f", false, false), formal(realArray2(), "t", false, false)); #line 3105 "runtime.in" - addFunc(ve, run::gen259, primBoolean(), "is3D", formal(primPicture(), "f", false, false)); -#line 3110 "runtime.in" - addFunc(ve, run::gen260, primPair(), "bezier", formal(primPair(), "a", false, false), formal(primPair(), "b", false, false), formal(primPair(), "c", false, false), formal(primPair(), "d", false, false), formal(primReal(), "t", false, false)); -#line 3117 "runtime.in" - addFunc(ve, run::gen261, primPair(), "bezierP", formal(primPair(), "a", false, false), formal(primPair(), "b", false, false), formal(primPair(), "c", false, false), formal(primPair(), "d", false, false), formal(primReal(), "t", false, false)); -#line 3122 "runtime.in" - addFunc(ve, run::gen262, primPair(), "bezierPP", formal(primPair(), "a", false, false), formal(primPair(), "b", false, false), formal(primPair(), "c", false, false), formal(primPair(), "d", false, false), formal(primReal(), "t", false, false)); -#line 3127 "runtime.in" - addFunc(ve, run::gen263, primPair(), "bezierPPP", formal(primPair(), "a", false, false), formal(primPair(), "b", false, false), formal(primPair(), "c", false, false), formal(primPair(), "d", false, false)); -#line 3132 "runtime.in" - addFunc(ve, run::gen264, primTriple(), "bezier", formal(primTriple(), "a", false, false), formal(primTriple(), "b", false, false), formal(primTriple(), "c", false, false), formal(primTriple(), "d", false, false), formal(primReal(), "t", false, false)); + addFunc(ve, run::gen250, primPair(), "max", formal(primPicture(), "f", false, false), formal(realArray2(), "t", false, false)); +#line 3113 "runtime.in" + addFunc(ve, run::gen251, primPair(), "minratio", formal(primPicture(), "f", false, false)); +#line 3118 "runtime.in" + addFunc(ve, run::gen252, primPair(), "maxratio", formal(primPicture(), "f", false, false)); +#line 3123 "runtime.in" + addFunc(ve, run::gen253, primReal(), "minbound", formal(realArray(), "a", false, false), formal(primReal(), "b", false, false)); +#line 3131 "runtime.in" + addFunc(ve, run::gen254, primReal(), "maxbound", formal(realArray(), "a", false, false), formal(primReal(), "b", false, false)); #line 3139 "runtime.in" - addFunc(ve, run::gen265, primTriple(), "bezierP", formal(primTriple(), "a", false, false), formal(primTriple(), "b", false, false), formal(primTriple(), "c", false, false), formal(primTriple(), "d", false, false), formal(primReal(), "t", false, false)); -#line 3144 "runtime.in" - addFunc(ve, run::gen266, primTriple(), "bezierPP", formal(primTriple(), "a", false, false), formal(primTriple(), "b", false, false), formal(primTriple(), "c", false, false), formal(primTriple(), "d", false, false), formal(primReal(), "t", false, false)); -#line 3149 "runtime.in" - addFunc(ve, run::gen267, primTriple(), "bezierPPP", formal(primTriple(), "a", false, false), formal(primTriple(), "b", false, false), formal(primTriple(), "c", false, false), formal(primTriple(), "d", false, false)); -#line 3162 "runtime.in" - addFunc(ve, run::gen269, primInt(), "length", formal(primString(), "s", false, false)); -#line 3167 "runtime.in" - addFunc(ve, run::gen270, primInt(), "find", formal(primString(), "s", false, false), formal(primString() , "t", false, false), formal(primInt(), "pos", true, false)); -#line 3173 "runtime.in" - addFunc(ve, run::gen271, primInt(), "rfind", formal(primString(), "s", false, false), formal(primString() , "t", false, false), formal(primInt(), "pos", true, false)); -#line 3179 "runtime.in" - addFunc(ve, run::gen272, primString() , "reverse", formal(primString() , "s", false, false)); -#line 3185 "runtime.in" - addFunc(ve, run::gen273, primString() , "insert", formal(primString() , "s", false, false), formal(primInt(), "pos", false, false), formal(primString() , "t", false, false)); -#line 3192 "runtime.in" - addFunc(ve, run::gen274, primString() , "substr", formal(primString(), "s", false, false), formal(primInt(), "pos", false, false), formal(primInt(), "n", true, false)); + addFunc(ve, run::gen255, primPair(), "minbound", formal(tripleArray(), "a", false, false), formal(realArray2(), "t", false, false), formal(primPair(), "b", false, false)); +#line 3150 "runtime.in" + addFunc(ve, run::gen256, primPair(), "maxbound", formal(tripleArray(), "a", false, false), formal(realArray2(), "t", false, false), formal(primPair(), "b", false, false)); +#line 3161 "runtime.in" + addFunc(ve, run::gen257, primPair(), "max", formal(primPath3(), "g", false, false), formal(realArray2(), "t", false, false)); +#line 3169 "runtime.in" + addFunc(ve, run::gen258, primPair(), "min", formal(primPath3(), "g", false, false), formal(realArray2(), "t", false, false)); +#line 3177 "runtime.in" + addFunc(ve, run::gen259, primReal(), "change2", formal(tripleArray2(), "a", false, false)); #line 3199 "runtime.in" - addFunc(ve, run::gen275, primString() , "erase", formal(primString() , "s", false, false), formal(primInt(), "pos", false, false), formal(primInt(), "n", false, false)); -#line 3206 "runtime.in" - addFunc(ve, run::gen276, primString() , "downcase", formal(primString() , "s", false, false)); -#line 3212 "runtime.in" - addFunc(ve, run::gen277, primString() , "upcase", formal(primString() , "s", false, false)); -#line 3218 "runtime.in" - addFunc(ve, run::gen278, primString() , "replace", formal(primString(), "s", false, false), formal(stringArray2(), "translate", false, false)); -#line 3245 "runtime.in" - addFunc(ve, run::gen279, primString() , "format", formal(primString(), "format", false, false), formal(primInt(), "x", false, false)); -#line 3260 "runtime.in" - addFunc(ve, run::gen280, primString() , "format", formal(primString(), "format", false, false), formal(primReal(), "x", false, false), formal(primString() , "locale", true, false)); -#line 3378 "runtime.in" - addFunc(ve, run::gen281, primInt(), "hex", formal(primString() , "s", false, false)); -#line 3389 "runtime.in" - addFunc(ve, run::gen282, primString() , "string", formal(primInt(), "x", false, false)); -#line 3396 "runtime.in" - addFunc(ve, run::gen283, primString() , "string", formal(primReal(), "x", false, false), formal(primInt(), "digits", true, false)); -#line 3404 "runtime.in" - addFunc(ve, run::gen284, primString() , "time", formal(primString() , "format", true, false)); -#line 3415 "runtime.in" - addFunc(ve, run::gen285, primString() , "time", formal(primInt(), "seconds", false, false), formal(primString() , "format", true, false)); -#line 3428 "runtime.in" - addFunc(ve, run::gen286, primInt(), "seconds", formal(primString() , "t", true, false), formal(primString() , "format", true, false)); -#line 3440 "runtime.in" - addFunc(ve, run::gen287, realArray(), "_cputime"); -#line 3454 "runtime.in" - addFunc(ve, run::gen288, primReal(), "^", formal(primReal(), "x", false, false), formal(primInt(), "y", false, false)); -#line 3462 "runtime.in" - addFunc(ve, run::gen289, primPair(), "^", formal(primPair(), "z", false, false), formal(primInt(), "y", false, false)); -#line 3467 "runtime.in" - addFunc(ve, run::gen290, primInt(), "quotient", formal(primInt(), "x", false, false), formal(primInt(), "y", false, false)); -#line 3475 "runtime.in" - addFunc(ve, run::gen291, primInt(), "abs", formal(primInt(), "x", false, false)); -#line 3480 "runtime.in" - addFunc(ve, run::gen292, primInt(), "sgn", formal(primReal(), "x", false, false)); -#line 3485 "runtime.in" - addFunc(ve, run::gen293, primInt(), "rand"); + addFunc(ve, run::gen260, primBoolean(), "is3D", formal(primPicture(), "f", false, false)); +#line 3204 "runtime.in" + addFunc(ve, run::gen261, primPair(), "bezier", formal(primPair(), "a", false, false), formal(primPair(), "b", false, false), formal(primPair(), "c", false, false), formal(primPair(), "d", false, false), formal(primReal(), "t", false, false)); +#line 3211 "runtime.in" + addFunc(ve, run::gen262, primPair(), "bezierP", formal(primPair(), "a", false, false), formal(primPair(), "b", false, false), formal(primPair(), "c", false, false), formal(primPair(), "d", false, false), formal(primReal(), "t", false, false)); +#line 3216 "runtime.in" + addFunc(ve, run::gen263, primPair(), "bezierPP", formal(primPair(), "a", false, false), formal(primPair(), "b", false, false), formal(primPair(), "c", false, false), formal(primPair(), "d", false, false), formal(primReal(), "t", false, false)); +#line 3221 "runtime.in" + addFunc(ve, run::gen264, primPair(), "bezierPPP", formal(primPair(), "a", false, false), formal(primPair(), "b", false, false), formal(primPair(), "c", false, false), formal(primPair(), "d", false, false)); +#line 3226 "runtime.in" + addFunc(ve, run::gen265, primTriple(), "bezier", formal(primTriple(), "a", false, false), formal(primTriple(), "b", false, false), formal(primTriple(), "c", false, false), formal(primTriple(), "d", false, false), formal(primReal(), "t", false, false)); +#line 3233 "runtime.in" + addFunc(ve, run::gen266, primTriple(), "bezierP", formal(primTriple(), "a", false, false), formal(primTriple(), "b", false, false), formal(primTriple(), "c", false, false), formal(primTriple(), "d", false, false), formal(primReal(), "t", false, false)); +#line 3238 "runtime.in" + addFunc(ve, run::gen267, primTriple(), "bezierPP", formal(primTriple(), "a", false, false), formal(primTriple(), "b", false, false), formal(primTriple(), "c", false, false), formal(primTriple(), "d", false, false), formal(primReal(), "t", false, false)); +#line 3243 "runtime.in" + addFunc(ve, run::gen268, primTriple(), "bezierPPP", formal(primTriple(), "a", false, false), formal(primTriple(), "b", false, false), formal(primTriple(), "c", false, false), formal(primTriple(), "d", false, false)); +#line 3256 "runtime.in" + addFunc(ve, run::gen270, primInt(), "length", formal(primString(), "s", false, false)); +#line 3261 "runtime.in" + addFunc(ve, run::gen271, primInt(), "find", formal(primString(), "s", false, false), formal(primString() , "t", false, false), formal(primInt(), "pos", true, false)); +#line 3267 "runtime.in" + addFunc(ve, run::gen272, primInt(), "rfind", formal(primString(), "s", false, false), formal(primString() , "t", false, false), formal(primInt(), "pos", true, false)); +#line 3273 "runtime.in" + addFunc(ve, run::gen273, primString() , "reverse", formal(primString() , "s", false, false)); +#line 3279 "runtime.in" + addFunc(ve, run::gen274, primString() , "insert", formal(primString() , "s", false, false), formal(primInt(), "pos", false, false), formal(primString() , "t", false, false)); +#line 3286 "runtime.in" + addFunc(ve, run::gen275, primString() , "substr", formal(primString(), "s", false, false), formal(primInt(), "pos", false, false), formal(primInt(), "n", true, false)); +#line 3293 "runtime.in" + addFunc(ve, run::gen276, primString() , "erase", formal(primString() , "s", false, false), formal(primInt(), "pos", false, false), formal(primInt(), "n", false, false)); +#line 3300 "runtime.in" + addFunc(ve, run::gen277, primString() , "downcase", formal(primString() , "s", false, false)); +#line 3306 "runtime.in" + addFunc(ve, run::gen278, primString() , "upcase", formal(primString() , "s", false, false)); +#line 3312 "runtime.in" + addFunc(ve, run::gen279, primString() , "replace", formal(primString(), "s", false, false), formal(stringArray2(), "translate", false, false)); +#line 3339 "runtime.in" + addFunc(ve, run::gen280, primString() , "format", formal(primString(), "format", false, false), formal(primInt(), "x", false, false)); +#line 3354 "runtime.in" + addFunc(ve, run::gen281, primString() , "format", formal(primString(), "format", false, false), formal(primReal(), "x", false, false), formal(primString() , "locale", true, false)); +#line 3472 "runtime.in" + addFunc(ve, run::gen282, primInt(), "hex", formal(primString() , "s", false, false)); +#line 3483 "runtime.in" + addFunc(ve, run::gen283, primString() , "string", formal(primInt(), "x", false, false)); #line 3490 "runtime.in" - addFunc(ve, run::gen294, primVoid(), "srand", formal(primInt(), "seed", false, false)); -#line 3495 "runtime.in" - addFunc(ve, run::gen295, primReal(), "unitrand"); -#line 3501 "runtime.in" - addFunc(ve, run::gen296, primInt(), "ceil", formal(primReal(), "x", false, false)); -#line 3506 "runtime.in" - addFunc(ve, run::gen297, primInt(), "floor", formal(primReal(), "x", false, false)); -#line 3511 "runtime.in" - addFunc(ve, run::gen298, primInt(), "round", formal(primReal(), "x", false, false)); -#line 3517 "runtime.in" - addFunc(ve, run::gen299, primInt(), "Ceil", formal(primReal(), "x", false, false)); + addFunc(ve, run::gen284, primString() , "string", formal(primReal(), "x", false, false), formal(primInt(), "digits", true, false)); +#line 3498 "runtime.in" + addFunc(ve, run::gen285, primString() , "time", formal(primString() , "format", true, false)); +#line 3509 "runtime.in" + addFunc(ve, run::gen286, primString() , "time", formal(primInt(), "seconds", false, false), formal(primString() , "format", true, false)); #line 3522 "runtime.in" - addFunc(ve, run::gen300, primInt(), "Floor", formal(primReal(), "x", false, false)); -#line 3527 "runtime.in" - addFunc(ve, run::gen301, primInt(), "Round", formal(primReal(), "x", false, false)); -#line 3532 "runtime.in" - addFunc(ve, run::gen302, primReal(), "fmod", formal(primReal(), "x", false, false), formal(primReal(), "y", false, false)); -#line 3538 "runtime.in" - addFunc(ve, run::gen303, primReal(), "atan2", formal(primReal(), "y", false, false), formal(primReal(), "x", false, false)); -#line 3543 "runtime.in" - addFunc(ve, run::gen304, primReal(), "hypot", formal(primReal(), "x", false, false), formal(primReal(), "y", false, false)); + addFunc(ve, run::gen287, primInt(), "seconds", formal(primString() , "t", true, false), formal(primString() , "format", true, false)); +#line 3534 "runtime.in" + addFunc(ve, run::gen288, realArray(), "_cputime"); #line 3548 "runtime.in" - addFunc(ve, run::gen305, primReal(), "remainder", formal(primReal(), "x", false, false), formal(primReal(), "y", false, false)); -#line 3553 "runtime.in" - addFunc(ve, run::gen306, primReal(), "J", formal(primInt(), "n", false, false), formal(primReal(), "x", false, false)); -#line 3558 "runtime.in" - addFunc(ve, run::gen307, primReal(), "Y", formal(primInt(), "n", false, false), formal(primReal(), "x", false, false)); -#line 3563 "runtime.in" - addFunc(ve, run::gen308, primReal(), "erf", formal(primReal(), "x", false, false)); -#line 3568 "runtime.in" - addFunc(ve, run::gen309, primReal(), "erfc", formal(primReal(), "x", false, false)); -#line 3573 "runtime.in" - addFunc(ve, run::gen310, primInt(), "factorial", formal(primInt(), "n", false, false)); -#line 3578 "runtime.in" - addFunc(ve, run::gen311, primInt(), "choose", formal(primInt(), "n", false, false), formal(primInt(), "k", false, false)); + addFunc(ve, run::gen289, primReal(), "^", formal(primReal(), "x", false, false), formal(primInt(), "y", false, false)); +#line 3556 "runtime.in" + addFunc(ve, run::gen290, primPair(), "^", formal(primPair(), "z", false, false), formal(primInt(), "y", false, false)); +#line 3561 "runtime.in" + addFunc(ve, run::gen291, primInt(), "quotient", formal(primInt(), "x", false, false), formal(primInt(), "y", false, false)); +#line 3569 "runtime.in" + addFunc(ve, run::gen292, primInt(), "abs", formal(primInt(), "x", false, false)); +#line 3574 "runtime.in" + addFunc(ve, run::gen293, primInt(), "sgn", formal(primReal(), "x", false, false)); +#line 3579 "runtime.in" + addFunc(ve, run::gen294, primInt(), "rand"); +#line 3584 "runtime.in" + addFunc(ve, run::gen295, primVoid(), "srand", formal(primInt(), "seed", false, false)); #line 3589 "runtime.in" - addFunc(ve, run::gen312, primReal(), "gamma", formal(primReal(), "x", false, false)); -#line 3599 "runtime.in" - addFunc(ve, run::gen313, primPair(), "gamma", formal(primPair(), "z", false, true)); + addFunc(ve, run::gen296, primReal(), "unitrand"); +#line 3595 "runtime.in" + addFunc(ve, run::gen297, primInt(), "ceil", formal(primReal(), "x", false, false)); +#line 3600 "runtime.in" + addFunc(ve, run::gen298, primInt(), "floor", formal(primReal(), "x", false, false)); #line 3605 "runtime.in" - addFunc(ve, run::gen314, realArray(), "quadraticroots", formal(primReal(), "a", false, false), formal(primReal(), "b", false, false), formal(primReal(), "c", false, false)); -#line 3614 "runtime.in" - addFunc(ve, run::gen315, pairArray(), "quadraticroots", formal(primPair(), "a", false, true), formal(primPair(), "b", false, true), formal(primPair(), "c", false, true)); -#line 3623 "runtime.in" - addFunc(ve, run::gen316, realArray(), "cubicroots", formal(primReal(), "a", false, false), formal(primReal(), "b", false, false), formal(primReal(), "c", false, false), formal(primReal(), "d", false, false)); -#line 3633 "runtime.in" - addFunc(ve, run::gen317, primBoolean(), "==", formal(primTransform(), "a", false, false), formal(primTransform(), "b", false, false)); -#line 3641 "runtime.in" - addFunc(ve, run::gen318, primBoolean(), "!=", formal(primTransform(), "a", false, false), formal(primTransform(), "b", false, false)); -#line 3646 "runtime.in" - addFunc(ve, run::gen319, primTransform(), "+", formal(primTransform(), "a", false, false), formal(primTransform(), "b", false, false)); -#line 3651 "runtime.in" - addFunc(ve, run::gen320, primTransform(), "*", formal(primTransform(), "a", false, false), formal(primTransform(), "b", false, false)); -#line 3656 "runtime.in" - addFunc(ve, run::gen321, primPair(), "*", formal(primTransform(), "t", false, false), formal(primPair(), "z", false, false)); -#line 3661 "runtime.in" - addFunc(ve, run::gen322, primPath(), "*", formal(primTransform(), "t", false, false), formal(primPath(), "g", false, false)); -#line 3666 "runtime.in" - addFunc(ve, run::gen323, primPen(), "*", formal(primTransform(), "t", false, false), formal(primPen(), "p", false, false)); -#line 3671 "runtime.in" - addFunc(ve, run::gen324, primPicture(), "*", formal(primTransform(), "t", false, false), formal(primPicture(), "f", false, false)); -#line 3676 "runtime.in" - addFunc(ve, run::gen325, primPicture(), "*", formal(realArray2(), "t", false, false), formal(primPicture(), "f", false, false)); -#line 3681 "runtime.in" - addFunc(ve, run::gen326, primTransform(), "^", formal(primTransform(), "t", false, false), formal(primInt(), "n", false, false)); -#line 3728 "runtime.in" - addFunc(ve, run::gen334, primTransform(), "shift", formal(primTransform(), "t", false, false)); -#line 3733 "runtime.in" - addFunc(ve, run::gen335, primTransform(), "shiftless", formal(primTransform(), "t", false, false)); -#line 3738 "runtime.in" + addFunc(ve, run::gen299, primInt(), "round", formal(primReal(), "x", false, false)); +#line 3611 "runtime.in" + addFunc(ve, run::gen300, primInt(), "Ceil", formal(primReal(), "x", false, false)); +#line 3616 "runtime.in" + addFunc(ve, run::gen301, primInt(), "Floor", formal(primReal(), "x", false, false)); +#line 3621 "runtime.in" + addFunc(ve, run::gen302, primInt(), "Round", formal(primReal(), "x", false, false)); +#line 3626 "runtime.in" + addFunc(ve, run::gen303, primReal(), "fmod", formal(primReal(), "x", false, false), formal(primReal(), "y", false, false)); +#line 3632 "runtime.in" + addFunc(ve, run::gen304, primReal(), "atan2", formal(primReal(), "y", false, false), formal(primReal(), "x", false, false)); +#line 3637 "runtime.in" + addFunc(ve, run::gen305, primReal(), "hypot", formal(primReal(), "x", false, false), formal(primReal(), "y", false, false)); +#line 3642 "runtime.in" + addFunc(ve, run::gen306, primReal(), "remainder", formal(primReal(), "x", false, false), formal(primReal(), "y", false, false)); +#line 3647 "runtime.in" + addFunc(ve, run::gen307, primReal(), "J", formal(primInt(), "n", false, false), formal(primReal(), "x", false, false)); +#line 3652 "runtime.in" + addFunc(ve, run::gen308, primReal(), "Y", formal(primInt(), "n", false, false), formal(primReal(), "x", false, false)); +#line 3657 "runtime.in" + addFunc(ve, run::gen309, primReal(), "erf", formal(primReal(), "x", false, false)); +#line 3662 "runtime.in" + addFunc(ve, run::gen310, primReal(), "erfc", formal(primReal(), "x", false, false)); +#line 3667 "runtime.in" + addFunc(ve, run::gen311, primInt(), "factorial", formal(primInt(), "n", false, false)); +#line 3672 "runtime.in" + addFunc(ve, run::gen312, primInt(), "choose", formal(primInt(), "n", false, false), formal(primInt(), "k", false, false)); +#line 3683 "runtime.in" + addFunc(ve, run::gen313, primReal(), "gamma", formal(primReal(), "x", false, false)); +#line 3693 "runtime.in" + addFunc(ve, run::gen314, primPair(), "gamma", formal(primPair(), "z", false, true)); +#line 3699 "runtime.in" + addFunc(ve, run::gen315, realArray(), "quadraticroots", formal(primReal(), "a", false, false), formal(primReal(), "b", false, false), formal(primReal(), "c", false, false)); +#line 3708 "runtime.in" + addFunc(ve, run::gen316, pairArray(), "quadraticroots", formal(primPair(), "a", false, true), formal(primPair(), "b", false, true), formal(primPair(), "c", false, true)); +#line 3717 "runtime.in" + addFunc(ve, run::gen317, realArray(), "cubicroots", formal(primReal(), "a", false, false), formal(primReal(), "b", false, false), formal(primReal(), "c", false, false), formal(primReal(), "d", false, false)); +#line 3727 "runtime.in" + addFunc(ve, run::gen318, primBoolean(), "==", formal(primTransform(), "a", false, false), formal(primTransform(), "b", false, false)); +#line 3735 "runtime.in" + addFunc(ve, run::gen319, primBoolean(), "!=", formal(primTransform(), "a", false, false), formal(primTransform(), "b", false, false)); +#line 3740 "runtime.in" + addFunc(ve, run::gen320, primTransform(), "+", formal(primTransform(), "a", false, false), formal(primTransform(), "b", false, false)); +#line 3745 "runtime.in" + addFunc(ve, run::gen321, primTransform(), "*", formal(primTransform(), "a", false, false), formal(primTransform(), "b", false, false)); +#line 3750 "runtime.in" + addFunc(ve, run::gen322, primPair(), "*", formal(primTransform(), "t", false, false), formal(primPair(), "z", false, false)); +#line 3755 "runtime.in" + addFunc(ve, run::gen323, primPath(), "*", formal(primTransform(), "t", false, false), formal(primPath(), "g", false, false)); +#line 3760 "runtime.in" + addFunc(ve, run::gen324, primPen(), "*", formal(primTransform(), "t", false, false), formal(primPen(), "p", false, false)); +#line 3765 "runtime.in" + addFunc(ve, run::gen325, primPicture(), "*", formal(primTransform(), "t", false, false), formal(primPicture(), "f", false, false)); +#line 3770 "runtime.in" + addFunc(ve, run::gen326, primPicture(), "*", formal(realArray2(), "t", false, false), formal(primPicture(), "f", false, false)); +#line 3775 "runtime.in" + addFunc(ve, run::gen327, primTransform(), "^", formal(primTransform(), "t", false, false), formal(primInt(), "n", false, false)); +#line 3822 "runtime.in" + addFunc(ve, run::gen335, primTransform(), "shift", formal(primTransform(), "t", false, false)); +#line 3827 "runtime.in" + addFunc(ve, run::gen336, primTransform(), "shiftless", formal(primTransform(), "t", false, false)); +#line 3832 "runtime.in" addFunc(ve, run::transformIdentity, primTransform(), "identity"); -#line 3743 "runtime.in" - addFunc(ve, run::gen337, primTransform(), "inverse", formal(primTransform(), "t", false, false)); -#line 3748 "runtime.in" - addFunc(ve, run::gen338, primTransform(), "shift", formal(primPair(), "z", false, false)); -#line 3753 "runtime.in" - addFunc(ve, run::gen339, primTransform(), "shift", formal(primReal(), "x", false, false), formal(primReal(), "y", false, false)); -#line 3758 "runtime.in" - addFunc(ve, run::gen340, primTransform(), "xscale", formal(primReal(), "x", false, false)); -#line 3763 "runtime.in" - addFunc(ve, run::gen341, primTransform(), "yscale", formal(primReal(), "y", false, false)); -#line 3768 "runtime.in" - addFunc(ve, run::gen342, primTransform(), "scale", formal(primReal(), "x", false, false)); -#line 3773 "runtime.in" - addFunc(ve, run::gen343, primTransform(), "scale", formal(primReal(), "x", false, false), formal(primReal(), "y", false, false)); -#line 3778 "runtime.in" - addFunc(ve, run::gen344, primTransform(), "slant", formal(primReal(), "s", false, false)); -#line 3783 "runtime.in" - addFunc(ve, run::gen345, primTransform(), "rotate", formal(primReal(), "angle", false, false), formal(primPair(), "z", true, false)); -#line 3788 "runtime.in" - addFunc(ve, run::gen346, primTransform(), "reflect", formal(primPair(), "a", false, false), formal(primPair(), "b", false, false)); -#line 3811 "runtime.in" +#line 3837 "runtime.in" + addFunc(ve, run::gen338, primTransform(), "inverse", formal(primTransform(), "t", false, false)); +#line 3842 "runtime.in" + addFunc(ve, run::gen339, primTransform(), "shift", formal(primPair(), "z", false, false)); +#line 3847 "runtime.in" + addFunc(ve, run::gen340, primTransform(), "shift", formal(primReal(), "x", false, false), formal(primReal(), "y", false, false)); +#line 3852 "runtime.in" + addFunc(ve, run::gen341, primTransform(), "xscale", formal(primReal(), "x", false, false)); +#line 3857 "runtime.in" + addFunc(ve, run::gen342, primTransform(), "yscale", formal(primReal(), "y", false, false)); +#line 3862 "runtime.in" + addFunc(ve, run::gen343, primTransform(), "scale", formal(primReal(), "x", false, false)); +#line 3867 "runtime.in" + addFunc(ve, run::gen344, primTransform(), "scale", formal(primReal(), "x", false, false), formal(primReal(), "y", false, false)); +#line 3872 "runtime.in" + addFunc(ve, run::gen345, primTransform(), "slant", formal(primReal(), "s", false, false)); +#line 3877 "runtime.in" + addFunc(ve, run::gen346, primTransform(), "rotate", formal(primReal(), "angle", false, false), formal(primPair(), "z", true, false)); +#line 3882 "runtime.in" + addFunc(ve, run::gen347, primTransform(), "reflect", formal(primPair(), "a", false, false), formal(primPair(), "b", false, false)); +#line 3905 "runtime.in" addFunc(ve, run::pairXPart, primReal(), "xpart", formal(primPair(), "z", false, false)); -#line 3816 "runtime.in" +#line 3910 "runtime.in" addFunc(ve, run::pairYPart, primReal(), "ypart", formal(primPair(), "z", false, false)); -#line 3821 "runtime.in" - addFunc(ve, run::gen352, primReal(), "length", formal(primPair(), "z", false, false)); -#line 3826 "runtime.in" - addFunc(ve, run::gen353, primReal(), "abs", formal(primPair(), "z", false, false)); -#line 3831 "runtime.in" - addFunc(ve, run::gen354, primPair(), "sqrt", formal(primPair(), "z", false, true)); -#line 3836 "runtime.in" - addFunc(ve, run::gen355, primReal(), "angle", formal(primPair(), "z", false, false), formal(primBoolean(), "warn", true, false)); -#line 3843 "runtime.in" - addFunc(ve, run::gen356, primReal(), "degrees", formal(primPair(), "z", false, false), formal(primBoolean(), "warn", true, false)); -#line 3850 "runtime.in" - addFunc(ve, run::gen357, primReal(), "radians", formal(primReal(), "degrees", false, false)); -#line 3856 "runtime.in" - addFunc(ve, run::gen358, primReal(), "degrees", formal(primReal(), "radians", false, false)); -#line 3862 "runtime.in" - addFunc(ve, run::gen359, primReal(), "Degrees", formal(primReal(), "radians", false, false)); -#line 3868 "runtime.in" - addFunc(ve, run::gen360, primReal(), "Sin", formal(primReal(), "deg", false, false)); -#line 3873 "runtime.in" - addFunc(ve, run::gen361, primReal(), "Cos", formal(primReal(), "deg", false, false)); -#line 3878 "runtime.in" - addFunc(ve, run::gen362, primReal(), "Tan", formal(primReal(), "deg", false, false)); -#line 3883 "runtime.in" - addFunc(ve, run::gen363, primReal(), "aSin", formal(primReal(), "x", false, false)); -#line 3888 "runtime.in" - addFunc(ve, run::gen364, primReal(), "aCos", formal(primReal(), "x", false, false)); -#line 3893 "runtime.in" - addFunc(ve, run::gen365, primReal(), "aTan", formal(primReal(), "x", false, false)); -#line 3898 "runtime.in" - addFunc(ve, run::gen366, primPair(), "unit", formal(primPair(), "z", false, false)); -#line 3903 "runtime.in" - addFunc(ve, run::gen367, primPair(), "dir", formal(primReal(), "degrees", false, false)); -#line 3908 "runtime.in" - addFunc(ve, run::gen368, primPair(), "dir", formal(primPair(), "z", false, true)); -#line 3913 "runtime.in" - addFunc(ve, run::gen369, primPair(), "expi", formal(primReal(), "angle", false, false)); -#line 3918 "runtime.in" - addFunc(ve, run::gen370, primPair(), "exp", formal(primPair(), "z", false, true)); -#line 3923 "runtime.in" - addFunc(ve, run::gen371, primPair(), "log", formal(primPair(), "z", false, true)); -#line 3928 "runtime.in" - addFunc(ve, run::gen372, primPair(), "sin", formal(primPair(), "z", false, true)); -#line 3933 "runtime.in" - addFunc(ve, run::gen373, primPair(), "cos", formal(primPair(), "z", false, true)); -#line 3938 "runtime.in" - addFunc(ve, run::gen374, primPair(), "conj", formal(primPair(), "z", false, false)); -#line 3943 "runtime.in" - addFunc(ve, run::gen375, primPair(), "realmult", formal(primPair(), "z", false, false), formal(primPair(), "w", false, false)); -#line 3948 "runtime.in" - addFunc(ve, run::gen376, primTriple(), "realmult", formal(primTriple(), "u", false, false), formal(primTriple(), "v", false, false)); -#line 3953 "runtime.in" - addFunc(ve, run::gen377, primReal(), "dot", formal(primPair(), "z", false, true), formal(primPair(), "w", false, true)); -#line 3973 "runtime.in" +#line 3915 "runtime.in" + addFunc(ve, run::gen353, primReal(), "length", formal(primPair(), "z", false, false)); +#line 3920 "runtime.in" + addFunc(ve, run::gen354, primReal(), "abs", formal(primPair(), "z", false, false)); +#line 3925 "runtime.in" + addFunc(ve, run::gen355, primPair(), "sqrt", formal(primPair(), "z", false, true)); +#line 3930 "runtime.in" + addFunc(ve, run::gen356, primReal(), "angle", formal(primPair(), "z", false, false), formal(primBoolean(), "warn", true, false)); +#line 3937 "runtime.in" + addFunc(ve, run::gen357, primReal(), "degrees", formal(primPair(), "z", false, false), formal(primBoolean(), "warn", true, false)); +#line 3944 "runtime.in" + addFunc(ve, run::gen358, primReal(), "radians", formal(primReal(), "degrees", false, false)); +#line 3950 "runtime.in" + addFunc(ve, run::gen359, primReal(), "degrees", formal(primReal(), "radians", false, false)); +#line 3956 "runtime.in" + addFunc(ve, run::gen360, primReal(), "Degrees", formal(primReal(), "radians", false, false)); +#line 3962 "runtime.in" + addFunc(ve, run::gen361, primReal(), "Sin", formal(primReal(), "deg", false, false)); +#line 3967 "runtime.in" + addFunc(ve, run::gen362, primReal(), "Cos", formal(primReal(), "deg", false, false)); +#line 3972 "runtime.in" + addFunc(ve, run::gen363, primReal(), "Tan", formal(primReal(), "deg", false, false)); +#line 3977 "runtime.in" + addFunc(ve, run::gen364, primReal(), "aSin", formal(primReal(), "x", false, false)); +#line 3982 "runtime.in" + addFunc(ve, run::gen365, primReal(), "aCos", formal(primReal(), "x", false, false)); +#line 3987 "runtime.in" + addFunc(ve, run::gen366, primReal(), "aTan", formal(primReal(), "x", false, false)); +#line 3992 "runtime.in" + addFunc(ve, run::gen367, primPair(), "unit", formal(primPair(), "z", false, false)); +#line 3997 "runtime.in" + addFunc(ve, run::gen368, primPair(), "dir", formal(primReal(), "degrees", false, false)); +#line 4002 "runtime.in" + addFunc(ve, run::gen369, primPair(), "dir", formal(primPair(), "z", false, true)); +#line 4007 "runtime.in" + addFunc(ve, run::gen370, primPair(), "expi", formal(primReal(), "angle", false, false)); +#line 4012 "runtime.in" + addFunc(ve, run::gen371, primPair(), "exp", formal(primPair(), "z", false, true)); +#line 4017 "runtime.in" + addFunc(ve, run::gen372, primPair(), "log", formal(primPair(), "z", false, true)); +#line 4022 "runtime.in" + addFunc(ve, run::gen373, primPair(), "sin", formal(primPair(), "z", false, true)); +#line 4027 "runtime.in" + addFunc(ve, run::gen374, primPair(), "cos", formal(primPair(), "z", false, true)); +#line 4032 "runtime.in" + addFunc(ve, run::gen375, primPair(), "conj", formal(primPair(), "z", false, false)); +#line 4037 "runtime.in" + addFunc(ve, run::gen376, primPair(), "realmult", formal(primPair(), "z", false, false), formal(primPair(), "w", false, false)); +#line 4042 "runtime.in" + addFunc(ve, run::gen377, primTriple(), "realmult", formal(primTriple(), "u", false, false), formal(primTriple(), "v", false, false)); +#line 4047 "runtime.in" + addFunc(ve, run::gen378, primReal(), "dot", formal(primPair(), "z", false, true), formal(primPair(), "w", false, true)); +#line 4067 "runtime.in" addFunc(ve, run::tripleXPart, primReal(), "xpart", formal(primTriple(), "v", false, false)); -#line 3978 "runtime.in" +#line 4072 "runtime.in" addFunc(ve, run::tripleYPart, primReal(), "ypart", formal(primTriple(), "v", false, false)); -#line 3983 "runtime.in" +#line 4077 "runtime.in" addFunc(ve, run::tripleZPart, primReal(), "zpart", formal(primTriple(), "v", false, false)); -#line 3988 "runtime.in" - addFunc(ve, run::gen383, primTriple(), "*", formal(primReal(), "x", false, false), formal(primTriple(), "v", false, false)); -#line 3993 "runtime.in" - addFunc(ve, run::gen384, primTriple(), "*", formal(primTriple(), "v", false, false), formal(primReal(), "x", false, false)); -#line 3998 "runtime.in" - addFunc(ve, run::gen385, primTriple(), "/", formal(primTriple(), "v", false, false), formal(primReal(), "x", false, false)); -#line 4003 "runtime.in" - addFunc(ve, run::gen386, primReal(), "length", formal(primTriple(), "v", false, false)); -#line 4008 "runtime.in" - addFunc(ve, run::gen387, primReal(), "abs", formal(primTriple(), "v", false, false)); -#line 4013 "runtime.in" - addFunc(ve, run::gen388, primReal(), "polar", formal(primTriple(), "v", false, false)); -#line 4018 "runtime.in" - addFunc(ve, run::gen389, primReal(), "azimuth", formal(primTriple(), "v", false, false)); -#line 4023 "runtime.in" - addFunc(ve, run::gen390, primReal(), "colatitude", formal(primTriple(), "v", false, false)); -#line 4028 "runtime.in" - addFunc(ve, run::gen391, primReal(), "latitude", formal(primTriple(), "v", false, false)); -#line 4033 "runtime.in" - addFunc(ve, run::gen392, primReal(), "longitude", formal(primTriple(), "v", false, false), formal(primBoolean(), "warn", true, false)); -#line 4040 "runtime.in" - addFunc(ve, run::gen393, primTriple(), "unit", formal(primTriple(), "v", false, false)); -#line 4045 "runtime.in" - addFunc(ve, run::gen394, primReal(), "dot", formal(primTriple(), "u", false, false), formal(primTriple(), "v", false, false)); -#line 4050 "runtime.in" - addFunc(ve, run::gen395, primTriple(), "cross", formal(primTriple(), "u", false, false), formal(primTriple(), "v", false, false)); -#line 4055 "runtime.in" - addFunc(ve, run::gen396, primTriple(), "expi", formal(primReal(), "polar", false, false), formal(primReal(), "azimuth", false, false)); -#line 4060 "runtime.in" - addFunc(ve, run::gen397, primTriple(), "dir", formal(primReal(), "colatitude", false, false), formal(primReal(), "longitude", false, false)); -#line 4065 "runtime.in" - addFunc(ve, run::gen398, primVoid(), "atupdate", formal(voidFunction(), "f", false, false)); -#line 4073 "runtime.in" - addFunc(ve, run::gen399, voidFunction(), "atupdate"); -#line 4078 "runtime.in" - addFunc(ve, run::gen400, primVoid(), "atexit", formal(voidFunction(), "f", false, false)); -#line 4083 "runtime.in" - addFunc(ve, run::gen401, voidFunction(), "atexit"); -#line 4088 "runtime.in" - addFunc(ve, run::gen402, primVoid(), "atbreakpoint", formal(breakpointFunction(), "f", false, false)); -#line 4093 "runtime.in" - addFunc(ve, run::gen403, primVoid(), "breakpoint", formal(primCode(), "s", true, false)); -#line 4098 "runtime.in" - addFunc(ve, run::gen404, primString() , "locatefile", formal(primString() , "file", false, false)); -#line 4103 "runtime.in" - addFunc(ve, run::gen405, primVoid(), "stop", formal(primString() , "file", false, false), formal(primInt(), "line", false, false), formal(primCode(), "s", true, false)); -#line 4111 "runtime.in" - addFunc(ve, run::gen406, primVoid(), "breakpoints"); -#line 4117 "runtime.in" - addFunc(ve, run::gen407, primVoid(), "clear", formal(primString() , "file", false, false), formal(primInt(), "line", false, false)); -#line 4123 "runtime.in" - addFunc(ve, run::gen408, primVoid(), "clear"); -#line 4128 "runtime.in" - addFunc(ve, run::gen409, primString() , "stripdirectory", formal(primString(), "s", false, false)); -#line 4134 "runtime.in" - addFunc(ve, run::gen410, primString() , "stripfile", formal(primString(), "s", false, false)); -#line 4140 "runtime.in" - addFunc(ve, run::gen411, primString() , "stripextension", formal(primString(), "s", false, false)); -#line 4146 "runtime.in" - addFunc(ve, run::gen412, primInt(), "convert", formal(primString() , "args", true, false), formal(primString() , "file", true, false), formal(primString() , "format", true, false)); -#line 4164 "runtime.in" - addFunc(ve, run::gen413, primInt(), "animate", formal(primString() , "args", true, false), formal(primString() , "file", true, false), formal(primString() , "format", true, false)); -#line 4180 "runtime.in" - addFunc(ve, run::gen414, primInt(), "delete", formal(primString(), "s", false, false)); -#line 4190 "runtime.in" - addFunc(ve, run::gen415, primInt(), "rename", formal(primString(), "from", false, false), formal(primString(), "to", false, false)); -#line 4489 "runtime.in" - addFunc(ve, run::gen446, IntArray(), "complement", formal(IntArray(), "a", false, false), formal(primInt(), "n", false, false)); -#line 4521 "runtime.in" - addFunc(ve, run::gen448, IntArray(), "sequence", formal(primInt(), "n", false, false)); -#line 4554 "runtime.in" - addFunc(ve, run::gen451, primBoolean(), "all", formal(boolArray(), "a", false, false)); -#line 4563 "runtime.in" - addFunc(ve, run::gen452, boolArray(), "!", formal(boolArray(), "a", false, false)); -#line 4572 "runtime.in" - addFunc(ve, run::gen453, primInt(), "sum", formal(boolArray(), "a", false, false)); -#line 4735 "runtime.in" - addFunc(ve, run::gen460, primInt(), "find", formal(boolArray(), "a", false, false), formal(primInt(), "n", true, false)); -#line 4755 "runtime.in" - addFunc(ve, run::gen461, primBoolean(), "==", formal(realArray2(), "a", false, false), formal(realArray2(), "b", false, false)); -#line 4800 "runtime.in" - addFunc(ve, run::gen463, realArray2(), "identity", formal(primInt(), "n", false, false)); -#line 4823 "runtime.in" - addFunc(ve, run::gen465, realArray2(), "inverse", formal(realArray2(), "a", false, false)); -#line 4915 "runtime.in" - addFunc(ve, run::gen466, realArray(), "solve", formal(realArray2(), "a", false, false), formal(realArray(), "b", false, false), formal(primBoolean(), "warn", true, false)); -#line 4966 "runtime.in" - addFunc(ve, run::gen467, realArray2(), "solve", formal(realArray2(), "a", false, false), formal(realArray2(), "b", false, false), formal(primBoolean(), "warn", true, false)); -#line 5030 "runtime.in" - addFunc(ve, run::gen468, primReal(), "determinant", formal(realArray2(), "a", false, false)); -#line 5046 "runtime.in" - addFunc(ve, run::gen469, realArray(), "*", formal(realArray2(), "a", false, false), formal(realArray(), "b", false, false)); +#line 4082 "runtime.in" + addFunc(ve, run::gen384, primTriple(), "*", formal(primReal(), "x", false, false), formal(primTriple(), "v", false, false)); +#line 4087 "runtime.in" + addFunc(ve, run::gen385, primTriple(), "*", formal(primTriple(), "v", false, false), formal(primReal(), "x", false, false)); +#line 4092 "runtime.in" + addFunc(ve, run::gen386, primTriple(), "/", formal(primTriple(), "v", false, false), formal(primReal(), "x", false, false)); +#line 4097 "runtime.in" + addFunc(ve, run::gen387, primReal(), "length", formal(primTriple(), "v", false, false)); +#line 4102 "runtime.in" + addFunc(ve, run::gen388, primReal(), "abs", formal(primTriple(), "v", false, false)); +#line 4107 "runtime.in" + addFunc(ve, run::gen389, primReal(), "polar", formal(primTriple(), "v", false, false), formal(primBoolean(), "warn", true, false)); +#line 4113 "runtime.in" + addFunc(ve, run::gen390, primReal(), "azimuth", formal(primTriple(), "v", false, false), formal(primBoolean(), "warn", true, false)); +#line 4119 "runtime.in" + addFunc(ve, run::gen391, primReal(), "colatitude", formal(primTriple(), "v", false, false), formal(primBoolean(), "warn", true, false)); +#line 4125 "runtime.in" + addFunc(ve, run::gen392, primReal(), "latitude", formal(primTriple(), "v", false, false), formal(primBoolean(), "warn", true, false)); +#line 4131 "runtime.in" + addFunc(ve, run::gen393, primReal(), "longitude", formal(primTriple(), "v", false, false), formal(primBoolean(), "warn", true, false)); +#line 4138 "runtime.in" + addFunc(ve, run::gen394, primTriple(), "unit", formal(primTriple(), "v", false, false)); +#line 4143 "runtime.in" + addFunc(ve, run::gen395, primReal(), "dot", formal(primTriple(), "u", false, false), formal(primTriple(), "v", false, false)); +#line 4148 "runtime.in" + addFunc(ve, run::gen396, primTriple(), "cross", formal(primTriple(), "u", false, false), formal(primTriple(), "v", false, false)); +#line 4153 "runtime.in" + addFunc(ve, run::gen397, primTriple(), "expi", formal(primReal(), "polar", false, false), formal(primReal(), "azimuth", false, false)); +#line 4158 "runtime.in" + addFunc(ve, run::gen398, primTriple(), "dir", formal(primReal(), "colatitude", false, false), formal(primReal(), "longitude", false, false)); +#line 4163 "runtime.in" + addFunc(ve, run::gen399, primVoid(), "atupdate", formal(voidFunction(), "f", false, false)); +#line 4171 "runtime.in" + addFunc(ve, run::gen400, voidFunction(), "atupdate"); +#line 4176 "runtime.in" + addFunc(ve, run::gen401, primVoid(), "atexit", formal(voidFunction(), "f", false, false)); +#line 4181 "runtime.in" + addFunc(ve, run::gen402, voidFunction(), "atexit"); +#line 4186 "runtime.in" + addFunc(ve, run::gen403, primVoid(), "atbreakpoint", formal(breakpointFunction(), "f", false, false)); +#line 4191 "runtime.in" + addFunc(ve, run::gen404, primVoid(), "breakpoint", formal(primCode(), "s", true, false)); +#line 4196 "runtime.in" + addFunc(ve, run::gen405, primString() , "locatefile", formal(primString() , "file", false, false)); +#line 4201 "runtime.in" + addFunc(ve, run::gen406, primVoid(), "stop", formal(primString() , "file", false, false), formal(primInt(), "line", false, false), formal(primCode(), "s", true, false)); +#line 4209 "runtime.in" + addFunc(ve, run::gen407, primVoid(), "breakpoints"); +#line 4215 "runtime.in" + addFunc(ve, run::gen408, primVoid(), "clear", formal(primString() , "file", false, false), formal(primInt(), "line", false, false)); +#line 4221 "runtime.in" + addFunc(ve, run::gen409, primVoid(), "clear"); +#line 4226 "runtime.in" + addFunc(ve, run::gen410, primString() , "stripdirectory", formal(primString(), "s", false, false)); +#line 4232 "runtime.in" + addFunc(ve, run::gen411, primString() , "stripfile", formal(primString(), "s", false, false)); +#line 4238 "runtime.in" + addFunc(ve, run::gen412, primString() , "stripextension", formal(primString(), "s", false, false)); +#line 4244 "runtime.in" + addFunc(ve, run::gen413, primInt(), "convert", formal(primString() , "args", true, false), formal(primString() , "file", true, false), formal(primString() , "format", true, false)); +#line 4262 "runtime.in" + addFunc(ve, run::gen414, primInt(), "animate", formal(primString() , "args", true, false), formal(primString() , "file", true, false), formal(primString() , "format", true, false)); +#line 4278 "runtime.in" + addFunc(ve, run::gen415, primInt(), "delete", formal(primString(), "s", false, false)); +#line 4288 "runtime.in" + addFunc(ve, run::gen416, primInt(), "rename", formal(primString(), "from", false, false), formal(primString(), "to", false, false)); +#line 4587 "runtime.in" + addFunc(ve, run::gen447, IntArray(), "complement", formal(IntArray(), "a", false, false), formal(primInt(), "n", false, false)); +#line 4619 "runtime.in" + addFunc(ve, run::gen449, IntArray(), "sequence", formal(primInt(), "n", false, false)); +#line 4652 "runtime.in" + addFunc(ve, run::gen452, primBoolean(), "all", formal(boolArray(), "a", false, false)); +#line 4661 "runtime.in" + addFunc(ve, run::gen453, boolArray(), "!", formal(boolArray(), "a", false, false)); +#line 4670 "runtime.in" + addFunc(ve, run::gen454, primInt(), "sum", formal(boolArray(), "a", false, false)); +#line 4833 "runtime.in" + addFunc(ve, run::gen461, primInt(), "find", formal(boolArray(), "a", false, false), formal(primInt(), "n", true, false)); +#line 4853 "runtime.in" + addFunc(ve, run::gen462, primBoolean(), "==", formal(realArray2(), "a", false, false), formal(realArray2(), "b", false, false)); +#line 4898 "runtime.in" + addFunc(ve, run::gen464, realArray2(), "identity", formal(primInt(), "n", false, false)); +#line 4921 "runtime.in" + addFunc(ve, run::gen466, realArray2(), "inverse", formal(realArray2(), "a", false, false)); +#line 5013 "runtime.in" + addFunc(ve, run::gen467, realArray(), "solve", formal(realArray2(), "a", false, false), formal(realArray(), "b", false, false), formal(primBoolean(), "warn", true, false)); #line 5064 "runtime.in" - addFunc(ve, run::gen470, realArray2(), "*", formal(realArray2(), "a", false, false), formal(realArray2(), "b", false, false)); -#line 5099 "runtime.in" - addFunc(ve, run::gen471, primTriple(), "*", formal(realArray2(), "t", false, false), formal(primTriple(), "v", false, false)); -#line 5104 "runtime.in" - addFunc(ve, run::gen472, primPair(), "project", formal(primTriple(), "v", false, false), formal(realArray2(), "t", false, false)); -#line 5129 "runtime.in" - addFunc(ve, run::gen473, primReal(), "dot", formal(realArray(), "a", false, false), formal(realArray(), "b", false, false)); -#line 5139 "runtime.in" - addFunc(ve, run::gen474, realArray(), "tridiagonal", formal(realArray(), "a", false, false), formal(realArray(), "b", false, false), formal(realArray(), "c", false, false), formal(realArray(), "f", false, false)); -#line 5243 "runtime.in" - addFunc(ve, run::gen475, primReal(), "newton", formal(primInt(), "iterations", true, false), formal(realRealFunction(), "f", false, false), formal(realRealFunction(), "fprime", false, false), formal(primReal(), "x", false, false), formal(primBoolean(), "verbose", true, false)); -#line 5290 "runtime.in" - addFunc(ve, run::gen476, primReal(), "newton", formal(primInt(), "iterations", true, false), formal(realRealFunction(), "f", false, false), formal(realRealFunction(), "fprime", false, false), formal(primReal(), "x1", false, false), formal(primReal(), "x2", false, false), formal(primBoolean(), "verbose", true, false)); -#line 5372 "runtime.in" - addFunc(ve, run::gen477, primReal(), "simpson", formal(realRealFunction(), "f", false, false), formal(primReal(), "a", false, false), formal(primReal(), "b", false, false), formal(primReal(), "acc", true, false), formal(primReal(), "dxmax", true, false)); -#line 5414 "runtime.in" - addFunc(ve, run::gen479, IntArray2(), "triangulate", formal(pairArray(), "z", false, false)); -#line 5449 "runtime.in" - addFunc(ve, run::gen480, primBoolean(), "==", formal(primFile(), "a", false, false), formal(primFile(), "b", false, false)); -#line 5457 "runtime.in" - addFunc(ve, run::gen481, primBoolean(), "!=", formal(primFile(), "a", false, false), formal(primFile(), "b", false, false)); -#line 5467 "runtime.in" - addFunc(ve, run::gen483, primFile(), "input", formal(primString() , "name", false, false), formal(primBoolean(), "check", true, false), formal(primString() , "comment", true, false)); -#line 5475 "runtime.in" - addFunc(ve, run::gen484, primFile(), "output", formal(primString() , "name", false, false), formal(primBoolean(), "update", true, false), formal(primString() , "comment", true, false)); -#line 5487 "runtime.in" - addFunc(ve, run::gen485, primFile(), "xinput", formal(primString() , "name", false, false), formal(primBoolean(), "check", true, false)); -#line 5501 "runtime.in" - addFunc(ve, run::gen486, primFile(), "xoutput", formal(primString() , "name", false, false), formal(primBoolean(), "update", true, false)); -#line 5519 "runtime.in" - addFunc(ve, run::gen487, primFile(), "binput", formal(primString() , "name", false, false), formal(primBoolean(), "check", true, false)); -#line 5526 "runtime.in" - addFunc(ve, run::gen488, primFile(), "boutput", formal(primString() , "name", false, false), formal(primBoolean(), "update", true, false)); -#line 5536 "runtime.in" - addFunc(ve, run::gen489, primBoolean(), "eof", formal(primFile(), "file", false, false)); -#line 5541 "runtime.in" - addFunc(ve, run::gen490, primBoolean(), "eol", formal(primFile(), "file", false, false)); -#line 5546 "runtime.in" - addFunc(ve, run::gen491, primBoolean(), "error", formal(primFile(), "file", false, false)); -#line 5551 "runtime.in" - addFunc(ve, run::gen492, primVoid(), "clear", formal(primFile(), "file", false, false)); -#line 5556 "runtime.in" - addFunc(ve, run::gen493, primVoid(), "close", formal(primFile(), "file", false, false)); -#line 5561 "runtime.in" - addFunc(ve, run::gen494, primInt(), "precision", formal(primFile(), "file", true, false), formal(primInt(), "digits", true, false)); -#line 5567 "runtime.in" - addFunc(ve, run::gen495, primVoid(), "flush", formal(primFile(), "file", false, false)); -#line 5572 "runtime.in" - addFunc(ve, run::gen496, primString() , "getc", formal(primFile(), "file", false, false)); -#line 5581 "runtime.in" - addFunc(ve, run::gen497, primInt(), "tell", formal(primFile(), "file", false, false)); -#line 5586 "runtime.in" - addFunc(ve, run::gen498, primVoid(), "seek", formal(primFile(), "file", false, false), formal(primInt(), "pos", false, false)); -#line 5591 "runtime.in" - addFunc(ve, run::gen499, primVoid(), "seekeof", formal(primFile(), "file", false, false)); -#line 5596 "runtime.in" - addFunc(ve, run::gen500, primFile(), "dimension", formal(primFile(), "file", false, false), formal(primInt(), "nx", false, false)); -#line 5603 "runtime.in" - addFunc(ve, run::gen501, primFile(), "dimension", formal(primFile(), "file", false, false), formal(primInt(), "nx", false, false), formal(primInt(), "ny", false, false)); -#line 5609 "runtime.in" - addFunc(ve, run::gen502, primFile(), "dimension", formal(primFile(), "file", false, false), formal(primInt(), "nx", false, false), formal(primInt(), "ny", false, false), formal(primInt(), "nz", false, false)); -#line 5615 "runtime.in" - addFunc(ve, run::gen503, primFile(), "csv", formal(primFile(), "file", false, false), formal(primBoolean(), "b", true, false)); -#line 5622 "runtime.in" - addFunc(ve, run::gen504, primFile(), "word", formal(primFile(), "file", false, false), formal(primBoolean(), "b", true, false)); -#line 5629 "runtime.in" - addFunc(ve, run::gen505, primFile(), "line", formal(primFile(), "file", false, false), formal(primBoolean(), "b", true, false)); -#line 5636 "runtime.in" - addFunc(ve, run::gen506, primFile(), "single", formal(primFile(), "file", false, false), formal(primBoolean(), "b", true, false)); + addFunc(ve, run::gen468, realArray2(), "solve", formal(realArray2(), "a", false, false), formal(realArray2(), "b", false, false), formal(primBoolean(), "warn", true, false)); +#line 5128 "runtime.in" + addFunc(ve, run::gen469, primReal(), "determinant", formal(realArray2(), "a", false, false)); +#line 5144 "runtime.in" + addFunc(ve, run::gen470, realArray(), "*", formal(realArray2(), "a", false, false), formal(realArray(), "b", false, false)); +#line 5162 "runtime.in" + addFunc(ve, run::gen471, realArray2(), "*", formal(realArray2(), "a", false, false), formal(realArray2(), "b", false, false)); +#line 5197 "runtime.in" + addFunc(ve, run::gen472, primTriple(), "*", formal(realArray2(), "t", false, false), formal(primTriple(), "v", false, false)); +#line 5202 "runtime.in" + addFunc(ve, run::gen473, primPair(), "project", formal(primTriple(), "v", false, false), formal(realArray2(), "t", false, false)); +#line 5227 "runtime.in" + addFunc(ve, run::gen474, primReal(), "dot", formal(realArray(), "a", false, false), formal(realArray(), "b", false, false)); +#line 5237 "runtime.in" + addFunc(ve, run::gen475, realArray(), "tridiagonal", formal(realArray(), "a", false, false), formal(realArray(), "b", false, false), formal(realArray(), "c", false, false), formal(realArray(), "f", false, false)); +#line 5341 "runtime.in" + addFunc(ve, run::gen476, primReal(), "newton", formal(primInt(), "iterations", true, false), formal(realRealFunction(), "f", false, false), formal(realRealFunction(), "fprime", false, false), formal(primReal(), "x", false, false), formal(primBoolean(), "verbose", true, false)); +#line 5388 "runtime.in" + addFunc(ve, run::gen477, primReal(), "newton", formal(primInt(), "iterations", true, false), formal(realRealFunction(), "f", false, false), formal(realRealFunction(), "fprime", false, false), formal(primReal(), "x1", false, false), formal(primReal(), "x2", false, false), formal(primBoolean(), "verbose", true, false)); +#line 5470 "runtime.in" + addFunc(ve, run::gen478, primReal(), "simpson", formal(realRealFunction(), "f", false, false), formal(primReal(), "a", false, false), formal(primReal(), "b", false, false), formal(primReal(), "acc", true, false), formal(primReal(), "dxmax", true, false)); +#line 5512 "runtime.in" + addFunc(ve, run::gen480, IntArray2(), "triangulate", formal(pairArray(), "z", false, false)); +#line 5547 "runtime.in" + addFunc(ve, run::gen481, primBoolean(), "==", formal(primFile(), "a", false, false), formal(primFile(), "b", false, false)); +#line 5555 "runtime.in" + addFunc(ve, run::gen482, primBoolean(), "!=", formal(primFile(), "a", false, false), formal(primFile(), "b", false, false)); +#line 5565 "runtime.in" + addFunc(ve, run::gen484, primFile(), "input", formal(primString() , "name", false, false), formal(primBoolean(), "check", true, false), formal(primString() , "comment", true, false)); +#line 5573 "runtime.in" + addFunc(ve, run::gen485, primFile(), "output", formal(primString() , "name", false, false), formal(primBoolean(), "update", true, false), formal(primString() , "comment", true, false)); +#line 5585 "runtime.in" + addFunc(ve, run::gen486, primFile(), "xinput", formal(primString() , "name", false, false), formal(primBoolean(), "check", true, false)); +#line 5599 "runtime.in" + addFunc(ve, run::gen487, primFile(), "xoutput", formal(primString() , "name", false, false), formal(primBoolean(), "update", true, false)); +#line 5617 "runtime.in" + addFunc(ve, run::gen488, primFile(), "binput", formal(primString() , "name", false, false), formal(primBoolean(), "check", true, false)); +#line 5624 "runtime.in" + addFunc(ve, run::gen489, primFile(), "boutput", formal(primString() , "name", false, false), formal(primBoolean(), "update", true, false)); +#line 5634 "runtime.in" + addFunc(ve, run::gen490, primBoolean(), "eof", formal(primFile(), "file", false, false)); +#line 5639 "runtime.in" + addFunc(ve, run::gen491, primBoolean(), "eol", formal(primFile(), "file", false, false)); #line 5644 "runtime.in" - addFunc(ve, run::gen507, primFile(), "single", formal(primFile(), "file", false, false), formal(primReal(), "x", false, false), formal(primBoolean(), "b", true, false)); -#line 5652 "runtime.in" - addFunc(ve, run::gen508, primFile(), "single", formal(primFile(), "file", false, false), formal(primInt(), "x", false, false), formal(primBoolean(), "b", true, false)); -#line 5660 "runtime.in" - addFunc(ve, run::gen509, primFile(), "read1", formal(primFile(), "file", false, false)); -#line 5667 "runtime.in" - addFunc(ve, run::gen510, primFile(), "read2", formal(primFile(), "file", false, false)); -#line 5674 "runtime.in" - addFunc(ve, run::gen511, primFile(), "read3", formal(primFile(), "file", false, false)); -#line 5681 "runtime.in" - addFunc(ve, run::gen512, stringArray(), "history", formal(primString() , "name", false, false), formal(primInt(), "n", true, false)); -#line 5714 "runtime.in" - addFunc(ve, run::gen513, stringArray(), "history", formal(primInt(), "n", true, false)); -#line 5725 "runtime.in" - addFunc(ve, run::gen514, primString() , "readline", formal(primString() , "prompt", true, false), formal(primString() , "name", true, false), formal(primBoolean(), "tabcompletion", true, false)); -#line 5769 "runtime.in" - addFunc(ve, run::gen515, primVoid(), "saveline", formal(primString() , "name", false, false), formal(primString() , "value", false, false), formal(primBoolean(), "store", true, false)); -#line 5799 "runtime.in" - addFunc(ve, run::gen516, primVoid(), "generate_random_backtrace"); -#line 5808 "runtime.in" - addFunc(ve, run::gen517, primVoid(), "print_random_addresses", formal(primInt(), "n", true, false)); + addFunc(ve, run::gen492, primBoolean(), "error", formal(primFile(), "file", false, false)); +#line 5649 "runtime.in" + addFunc(ve, run::gen493, primVoid(), "clear", formal(primFile(), "file", false, false)); +#line 5654 "runtime.in" + addFunc(ve, run::gen494, primVoid(), "close", formal(primFile(), "file", false, false)); +#line 5659 "runtime.in" + addFunc(ve, run::gen495, primInt(), "precision", formal(primFile(), "file", true, false), formal(primInt(), "digits", true, false)); +#line 5665 "runtime.in" + addFunc(ve, run::gen496, primVoid(), "flush", formal(primFile(), "file", false, false)); +#line 5670 "runtime.in" + addFunc(ve, run::gen497, primString() , "getc", formal(primFile(), "file", false, false)); +#line 5679 "runtime.in" + addFunc(ve, run::gen498, primInt(), "tell", formal(primFile(), "file", false, false)); +#line 5684 "runtime.in" + addFunc(ve, run::gen499, primVoid(), "seek", formal(primFile(), "file", false, false), formal(primInt(), "pos", false, false)); +#line 5689 "runtime.in" + addFunc(ve, run::gen500, primVoid(), "seekeof", formal(primFile(), "file", false, false)); +#line 5694 "runtime.in" + addFunc(ve, run::gen501, primFile(), "dimension", formal(primFile(), "file", false, false), formal(primInt(), "nx", false, false)); +#line 5701 "runtime.in" + addFunc(ve, run::gen502, primFile(), "dimension", formal(primFile(), "file", false, false), formal(primInt(), "nx", false, false), formal(primInt(), "ny", false, false)); +#line 5707 "runtime.in" + addFunc(ve, run::gen503, primFile(), "dimension", formal(primFile(), "file", false, false), formal(primInt(), "nx", false, false), formal(primInt(), "ny", false, false), formal(primInt(), "nz", false, false)); +#line 5713 "runtime.in" + addFunc(ve, run::gen504, primFile(), "csv", formal(primFile(), "file", false, false), formal(primBoolean(), "b", true, false)); +#line 5720 "runtime.in" + addFunc(ve, run::gen505, primFile(), "word", formal(primFile(), "file", false, false), formal(primBoolean(), "b", true, false)); +#line 5727 "runtime.in" + addFunc(ve, run::gen506, primFile(), "line", formal(primFile(), "file", false, false), formal(primBoolean(), "b", true, false)); +#line 5734 "runtime.in" + addFunc(ve, run::gen507, primFile(), "single", formal(primFile(), "file", false, false), formal(primBoolean(), "b", true, false)); +#line 5742 "runtime.in" + addFunc(ve, run::gen508, primFile(), "single", formal(primFile(), "file", false, false), formal(primReal(), "x", false, false), formal(primBoolean(), "b", true, false)); +#line 5750 "runtime.in" + addFunc(ve, run::gen509, primFile(), "single", formal(primFile(), "file", false, false), formal(primInt(), "x", false, false), formal(primBoolean(), "b", true, false)); +#line 5758 "runtime.in" + addFunc(ve, run::gen510, primFile(), "read1", formal(primFile(), "file", false, false)); +#line 5765 "runtime.in" + addFunc(ve, run::gen511, primFile(), "read2", formal(primFile(), "file", false, false)); +#line 5772 "runtime.in" + addFunc(ve, run::gen512, primFile(), "read3", formal(primFile(), "file", false, false)); +#line 5779 "runtime.in" + addFunc(ve, run::gen513, stringArray(), "history", formal(primString() , "name", false, false), formal(primInt(), "n", true, false)); +#line 5812 "runtime.in" + addFunc(ve, run::gen514, stringArray(), "history", formal(primInt(), "n", true, false)); +#line 5823 "runtime.in" + addFunc(ve, run::gen515, primString() , "readline", formal(primString() , "prompt", true, false), formal(primString() , "name", true, false), formal(primBoolean(), "tabcompletion", true, false)); +#line 5867 "runtime.in" + addFunc(ve, run::gen516, primVoid(), "saveline", formal(primString() , "name", false, false), formal(primString() , "value", false, false), formal(primBoolean(), "store", true, false)); +#line 5897 "runtime.in" + addFunc(ve, run::gen517, primVoid(), "generate_random_backtrace"); +#line 5906 "runtime.in" + addFunc(ve, run::gen518, primVoid(), "print_random_addresses", formal(primInt(), "n", true, false)); } } // namespace trans diff --git a/Build/source/utils/asymptote/runtime.in b/Build/source/utils/asymptote/runtime.in index decee0727b1..f0136b0bfd9 100644 --- a/Build/source/utils/asymptote/runtime.in +++ b/Build/source/utils/asymptote/runtime.in @@ -61,6 +61,8 @@ stringarray* => stringArray() stringarray2* => stringArray2() #include +#include +#include #include #include #include @@ -865,13 +867,15 @@ void unused(void *) { } -pair readpair(stringstream& s, bool tex) +static const double twelvepercent=0.12; +static const double tenpercent=0.1; + +pair readpair(stringstream& s, double hscale=1.0, double vscale=1.0) { - static const double f=12.0/100.0; double x,y; s >> y; s >> x; - return tex ? pair(f*x,-f*y) : pair(x,y); + return pair(hscale*x,vscale*y); } // Ignore unclosed begingroups but not spurious endgroups. @@ -887,7 +891,8 @@ string ASYo="/ASYo {( ) print 12 string cvs print} bind def"; string pathforall="{(M) print ASYo ASYo} {(L) print ASYo ASYo} {(C) print ASYo ASYo ASYo ASYo ASYo ASYo} {(c) print} pathforall"; string currentpoint="print currentpoint ASYo ASYo "; -array *readpath(const string& psname, bool tex, bool keep) +array *readpath(const string& psname, bool keep, + double hscale=1.0, double vscale=1.0) { array *P=new array(0); ostringstream pipe; @@ -895,9 +900,9 @@ array *readpath(const string& psname, bool tex, bool keep) << "' -q -dNOPAUSE -dBATCH"; if(safe) pipe << " -dSAFER"; #ifdef __CYGWIN__ - string null="NUL"; + const string null="NUL"; #else - string null="/dev/null"; + const string null="/dev/null"; #endif pipe << " -sDEVICE=epswrite -sOutputFile="+null+" '" << psname << "'"; iopipestream gs(pipe.str().c_str(),"gs","Ghostscript"); @@ -944,13 +949,13 @@ array *readpath(const string& psname, bool tex, bool keep) } active=false; cyclic=false; - node.pre=node.point=readpair(buf,tex)-offset; + node.pre=node.point=readpair(buf,hscale,vscale)-offset; node.straight=false; break; } case 'L': { - pair point=readpair(buf,tex)-offset; + pair point=readpair(buf,hscale,vscale)-offset; pair delta=(point-node.point)*third; node.post=node.point+delta; node.straight=true; @@ -962,9 +967,9 @@ array *readpath(const string& psname, bool tex, bool keep) } case 'C': { - pair point=readpair(buf,tex)-offset; - pair pre=readpair(buf,tex)-offset; - node.post=readpair(buf,tex)-offset; + pair point=readpair(buf,hscale,vscale)-offset; + pair pre=readpair(buf,hscale,vscale)-offset; + node.post=readpair(buf,hscale,vscale)-offset; node.straight=false; nodes.push_back(node); active=true; @@ -979,7 +984,7 @@ array *readpath(const string& psname, bool tex, bool keep) } case 'Z': { - offset=readpair(buf,tex); + offset=readpair(buf,hscale,vscale); break; } } @@ -1018,6 +1023,20 @@ pair gamma(pair z) return root2pi*pow(t,z+0.5)*exp(-t)*x; } +void cannotread(const string& s) +{ + ostringstream buf; + buf << "Cannot read from " << s << endl; + error(buf); +} + +void cannotwrite(const string& s) +{ + ostringstream buf; + buf << "Cannot write to " << s << endl; + error(buf); +} + // Autogenerated routines: @@ -1243,7 +1262,82 @@ patharray *_texpath(string *s, pen p=CURRENTPEN) unlink(auxname(prefix,"log").c_str()); unlink(dviname.c_str()); } - return readpath(psname,true,keep); + return readpath(psname,keep,twelvepercent,-twelvepercent); +} + +patharray *textpath(string *s, pen p=CURRENTPEN) +{ + array *P=new array(0); + if(s->empty()) return P; + + int status=0; + string prefix=outname(); + spaceToUnderscore(prefix); + string outputname=auxname(prefix,getSetting("textoutputtype")); + + string textname=auxname(prefix,getSetting("textextension")); + std::ofstream text(textname.c_str()); + + if(!text) cannotwrite(textname); + + text << getSetting("textprologue"); + text << p.Font() << endl; + text << *s; + text << getSetting("textepilogue"); + text.close(); + + ostringstream cmd; + string textcommand=getSetting("textcommand"); + cmd << textcommand << " '" << textname << "' '" + << outputname << "'"; + bool quiet=verbose <= 2; + status=System(cmd,quiet ? 1 : 0); + + string epsname=auxname(prefix,"eps"); + + if(status == 0) { + ostringstream cmd; + cmd << "'" << getSetting("gs") + << "' -q -dNOCACHE -dNOPAUSE -dBATCH"; + if(safe) cmd << " -dSAFER"; + cmd << " -sDEVICE=epswrite -sOutputFile='" << epsname << "' '" + << outputname << "'"; + status=System(cmd,0,true,"gs"); + } + + if(status != 0) + error("textpath failed"); + + string psname=auxname(prefix+"_","ps"); + std::ifstream eps(epsname.c_str()); + std::ofstream ps(psname.c_str()); + + if(!eps) cannotread(epsname); + if(!ps) cannotwrite(psname); + + ps << ASYo << endl + << "/ASY1 true def" << endl + << "/fill {ASY1 {(Z) " << currentpoint << "/ASY1 false def} if " + << pathforall << " (M) " << currentpoint + << "currentpoint newpath moveto } bind def" << endl + << "/stroke {ASY1 {(Z) " << currentpoint + << "/ASY1 false def} if strokepath " + << pathforall << " (M) " << currentpoint + << "currentpoint newpath moveto } bind def" << endl; + string line; + while(getline(eps,line)) + ps << line << endl; + ps << "(E) print" << endl; + eps.close(); + ps.close(); + + bool keep=getSetting("keep"); + if(!keep) { // Delete temporary files. + unlink(textname.c_str()); + unlink(outputname.c_str()); + unlink(epsname.c_str()); + } + return readpath(psname,keep,tenpercent,tenpercent); } patharray *_strokepath(path g, pen p=CURRENTPEN) @@ -1255,7 +1349,7 @@ patharray *_strokepath(path g, pen p=CURRENTPEN) spaceToUnderscore(prefix); string psname=auxname(prefix,"ps"); bbox b; - psfile ps(psname, false); + psfile ps(psname,false); ps.prologue(b); ps.verbatimline(ASYo); ps.verbatimline("/stroke {(Z) "+currentpoint+pathforall+"} bind def"); @@ -1267,7 +1361,7 @@ patharray *_strokepath(path g, pen p=CURRENTPEN) ps.verbatimline("(M) "+currentpoint+"(E) print"); ps.epilogue(); ps.close(); - return readpath(psname,false,getSetting("keep")); + return readpath(psname,getSetting("keep")); } void _draw(picture *f, path g, pen p) @@ -1551,18 +1645,18 @@ void shipout(string prefix=emptystring, picture *f, picture *preamble=NULL, void shipout3(string prefix, picture *f, string format=emptystring, real width, real height, real angle, triple m, triple M, - realarray2 *t, triplearray *lights, realarray2 *diffuse, - realarray2 *ambient, realarray2 *specular, bool viewportlighting, - bool view=true) + realarray2 *t, realarray *background, triplearray *lights, + realarray2 *diffuse, realarray2 *ambient, realarray2 *specular, + bool viewportlighting, bool view=true) { size_t n=checkArrays(lights,diffuse); checkEqual(n,checkArray(ambient)); checkEqual(n,checkArray(specular)); - f->shipout3(prefix,format,width,height,angle,m,M,copyArray2C(t,true,4),n, - copyTripleArrayC(lights),copyArray2C(diffuse,false,4), - copyArray2C(ambient,false,4),copyArray2C(specular,false,4), - viewportlighting,view); + f->shipout3(prefix,format,width,height,angle,m,M,copyArray2C(t,true,4), + copyArrayC(background),n,copyTripleArrayC(lights), + copyArray2C(diffuse,false,4),copyArray2C(ambient,false,4), + copyArray2C(specular,false,4),viewportlighting,view); } void shipout3(string prefix, picture *f) @@ -4010,28 +4104,32 @@ real abs(triple v) return v.length(); } -real polar(triple v) +real polar(triple v, bool warn=true) { + if(!warn && v.getx() == 0.0 && v.gety() == 0.0 && v.getz() == 0.0) return 0.0; return v.polar(); } -real azimuth(triple v) +real azimuth(triple v, bool warn=true) { + if(!warn && v.getx() == 0.0 && v.gety() == 0.0) return 0.0; return v.azimuth(); } -real colatitude(triple v) +real colatitude(triple v, bool warn=true) { + if(!warn && v.getx() == 0.0 && v.gety() == 0.0 && v.getz() == 0.0) return 0.0; return degrees(v.polar()); } -real latitude(triple v) +real latitude(triple v, bool warn=true) { + if(!warn && v.getx() == 0.0 && v.gety() == 0.0 && v.getz() == 0.0) return 0.0; return 90.0-degrees(v.polar()); } // Return the longitude of v in [0,360). -real longitude(triple v, bool warn=true) +real longitude(triple v, bool warn=true) { if(!warn && v.getx() == 0.0 && v.gety() == 0.0) return 0.0; return principalBranch(degrees(v.azimuth())); diff --git a/Build/source/utils/asymptote/settings.cc b/Build/source/utils/asymptote/settings.cc index a4961176660..73735e297f1 100644 --- a/Build/source/utils/asymptote/settings.cc +++ b/Build/source/utils/asymptote/settings.cc @@ -105,7 +105,7 @@ string defaultPDFViewer="AcroRd32.exe"; string defaultGhostscript="gswin32c.exe"; string defaultPython="python.exe"; string defaultDisplay="imdisplay"; -string systemDir; +string systemDir=ASYMPTOTE_SYSDIR; const string docdir="."; const string dirsep="\\"; @@ -169,7 +169,9 @@ void queryRegistry() defaultPDFViewer; defaultPSViewer=getEntry("Ghostgum/GSview/*")+"\\gsview\\"+defaultPSViewer; defaultPython=getEntry("Python/PythonCore/*/InstallPath/@")+defaultPython; - systemDir=getEntry("Microsoft/Windows/CurrentVersion/App Paths/Asymptote/Path"); + if(!systemDir.empty()) // An empty systemDir indicates a TeXLive build + systemDir= + getEntry("Microsoft/Windows/CurrentVersion/App Paths/Asymptote/Path"); defaultXasy=asyInstallDir+"\\"+defaultXasy; } @@ -513,7 +515,7 @@ struct userSetting : public argumentSetting { string GetEnv(string s, string Default) { transform(s.begin(), s.end(), s.begin(), toupper); string t=Getenv(("ASYMPTOTE_"+s).c_str(),msdos); - return t != "" ? string(t) : Default; + return t.empty() ? Default : t; } struct envSetting : public stringSetting { @@ -862,7 +864,7 @@ void resetOptions() { for(optionsMap_t::iterator opt=optionsMap.begin(); opt != optionsMap.end(); ++opt) - if(opt->first != "config" && opt->first != "dir") + if(opt->first != "config" && opt->first != "dir" && opt->first != "sysdir") opt->second->reset(); } @@ -993,6 +995,7 @@ void initSettings() { addOption(new boolSetting("embed", 0, "Embed rendered preview image", true)); addOption(new boolSetting("auto3D", 0, "Automatically activate 3D scene", true)); + addOption(new boolSetting("inlineimage", 0, "Generate inline embedded image")); addOption(new boolSetting("parseonly", 'p', "Parse file")); @@ -1108,6 +1111,13 @@ void initSettings() { addOption(new envSetting("papertype", "letter")); addOption(new envSetting("dir", "")); addOption(new envSetting("sysdir", systemDir)); + addOption(new envSetting("textcommand", + "sh -c 'groff -e -P-b16 $1 > $2' groff ")); + addOption(new envSetting("textextension", "roff")); + addOption(new envSetting("textoutputtype", "ps")); + addOption(new envSetting("textprologue", ".EQ\ndelim $$\n.EN\n")); + addOption(new envSetting("textinitialfont", ".fam T\n.ps 12")); + addOption(new envSetting("textepilogue", "")); } // Access the arguments once options have been parsed. -- cgit v1.2.3