summaryrefslogtreecommitdiff
path: root/Build/source/utils/asymptote
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2010-07-11 22:39:53 +0000
committerKarl Berry <karl@freefriends.org>2010-07-11 22:39:53 +0000
commit4e8485b0ddecb55f72929dd6233f254a1e7bf5b0 (patch)
tree354324ee6f54d46053b3ce88fe9dc4acf8e2ed81 /Build/source/utils/asymptote
parent713bb91ad0467fb3b12acad03cae2fa105ed2caa (diff)
asy 2.02
git-svn-id: svn://tug.org/texlive/trunk@19378 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/utils/asymptote')
-rw-r--r--Build/source/utils/asymptote/ChangeLog248
-rw-r--r--Build/source/utils/asymptote/Makefile.in8
-rw-r--r--Build/source/utils/asymptote/ReleaseNotes14
-rw-r--r--Build/source/utils/asymptote/asy-keywords.el4
-rw-r--r--Build/source/utils/asymptote/asymptote.spec2
-rw-r--r--Build/source/utils/asymptote/base/animation.asy9
-rw-r--r--Build/source/utils/asymptote/base/plain.asy24
-rw-r--r--Build/source/utils/asymptote/base/plain_Label.asy1
-rw-r--r--Build/source/utils/asymptote/base/plain_picture.asy43
-rwxr-xr-xBuild/source/utils/asymptote/configure18
-rw-r--r--Build/source/utils/asymptote/configure.ac2
-rw-r--r--Build/source/utils/asymptote/doc/CAD.pdfbin67395 -> 67565 bytes
-rw-r--r--Build/source/utils/asymptote/doc/FAQ/asy-faq.info2
-rw-r--r--Build/source/utils/asymptote/doc/Makefile.in4
-rw-r--r--Build/source/utils/asymptote/doc/asymptote.pdfbin1553892 -> 1705483 bytes
-rw-r--r--Build/source/utils/asymptote/doc/asymptote.sty95
-rw-r--r--Build/source/utils/asymptote/doc/asymptote.texi102
-rw-r--r--Build/source/utils/asymptote/doc/externalprc.tex4
-rw-r--r--Build/source/utils/asymptote/doc/extra/intro.asy8
-rw-r--r--Build/source/utils/asymptote/doc/latexmkrc4
-rw-r--r--Build/source/utils/asymptote/doc/latexusage-1.asy55
-rw-r--r--Build/source/utils/asymptote/doc/latexusage-2.asy23
-rw-r--r--Build/source/utils/asymptote/doc/latexusage-3.asy38
-rw-r--r--Build/source/utils/asymptote/doc/latexusage.pre3
-rw-r--r--Build/source/utils/asymptote/doc/latexusage.tex20
-rw-r--r--Build/source/utils/asymptote/doc/png/asymptote.info441
-rw-r--r--Build/source/utils/asymptote/drawlabel.cc2
-rw-r--r--Build/source/utils/asymptote/entry.cc441
-rw-r--r--Build/source/utils/asymptote/entry.h276
-rw-r--r--Build/source/utils/asymptote/errors6
-rw-r--r--Build/source/utils/asymptote/examples/animations/inlinemovie.tex6
-rw-r--r--Build/source/utils/asymptote/examples/animations/inlinemovie3.tex6
-rw-r--r--Build/source/utils/asymptote/examples/cards.asy26
-rw-r--r--Build/source/utils/asymptote/examples/slidemovies.asy46
-rw-r--r--Build/source/utils/asymptote/examples/washermethod.asy13
-rw-r--r--Build/source/utils/asymptote/item.h6
-rw-r--r--Build/source/utils/asymptote/memory.h3
-rw-r--r--Build/source/utils/asymptote/path.cc3
-rw-r--r--Build/source/utils/asymptote/path.h1
-rw-r--r--Build/source/utils/asymptote/picture.cc2
-rw-r--r--Build/source/utils/asymptote/prc/PRC.h2
-rw-r--r--Build/source/utils/asymptote/prc/PRCbitStream.h2
-rw-r--r--Build/source/utils/asymptote/prc/writePRC.cc8
-rw-r--r--Build/source/utils/asymptote/record.h2
-rw-r--r--Build/source/utils/asymptote/runlabel.cc65
-rw-r--r--Build/source/utils/asymptote/runlabel.in29
-rw-r--r--Build/source/utils/asymptote/runmath.cc8
-rw-r--r--Build/source/utils/asymptote/runmath.in8
-rw-r--r--Build/source/utils/asymptote/runpicture.cc2
-rw-r--r--Build/source/utils/asymptote/runpicture.in2
-rw-r--r--Build/source/utils/asymptote/stm.cc18
-rw-r--r--Build/source/utils/asymptote/symbol.cc12
-rw-r--r--Build/source/utils/asymptote/symbol.h7
-rw-r--r--Build/source/utils/asymptote/texfile.cc2
-rw-r--r--Build/source/utils/asymptote/types.cc28
-rw-r--r--Build/source/utils/asymptote/types.h46
56 files changed, 1417 insertions, 833 deletions
diff --git a/Build/source/utils/asymptote/ChangeLog b/Build/source/utils/asymptote/ChangeLog
index c4bbb69a533..314464fc01c 100644
--- a/Build/source/utils/asymptote/ChangeLog
+++ b/Build/source/utils/asymptote/ChangeLog
@@ -1,4 +1,252 @@
------------------------------------------------------------------------
+r5107 | jcbowman | 2010-07-11 01:42:54 -0600 (Sun, 11 Jul 2010) | 2 lines
+Changed paths:
+ M /trunk/asymptote/doc/latexmkrc
+
+Quote file argument.
+
+------------------------------------------------------------------------
+r5106 | jcbowman | 2010-07-11 00:38:31 -0600 (Sun, 11 Jul 2010) | 2 lines
+Changed paths:
+ M /trunk/asymptote/doc/latexusage.tex
+
+Fix typo.
+
+------------------------------------------------------------------------
+r5105 | hammera | 2010-07-10 16:33:22 -0600 (Sat, 10 Jul 2010) | 2 lines
+Changed paths:
+ M /trunk/asymptote/errors
+
+Changed extended for statement errors.
+
+------------------------------------------------------------------------
+r5104 | hammera | 2010-07-10 15:06:05 -0600 (Sat, 10 Jul 2010) | 2 lines
+Changed paths:
+ M /trunk/asymptote/stm.cc
+
+Better error reporting for extended for statement.
+
+------------------------------------------------------------------------
+r5103 | jcbowman | 2010-07-10 12:03:58 -0600 (Sat, 10 Jul 2010) | 2 lines
+Changed paths:
+ M /trunk/asymptote/doc/latexmkrc
+
+Add latexmk custom dependency for EPS files.
+
+------------------------------------------------------------------------
+r5102 | jcbowman | 2010-07-10 10:52:15 -0600 (Sat, 10 Jul 2010) | 2 lines
+Changed paths:
+ M /trunk/asymptote/Makefile.in
+ M /trunk/asymptote/doc/Makefile.in
+ M /trunk/asymptote/doc/asymptote.texi
+
+Fix makefile dependency; clean up files.
+
+------------------------------------------------------------------------
+r5101 | jcbowman | 2010-07-10 02:19:57 -0600 (Sat, 10 Jul 2010) | 4 lines
+Changed paths:
+ M /trunk/asymptote/base/plain.asy
+ M /trunk/asymptote/doc/extra/intro.asy
+ D /trunk/asymptote/examples/slidemovies.asy
+
+Fix asy() command.
+
+Delete duplicate example.
+
+------------------------------------------------------------------------
+r5100 | jcbowman | 2010-07-10 01:17:53 -0600 (Sat, 10 Jul 2010) | 14 lines
+Changed paths:
+ M /trunk/asymptote/Makefile.in
+ M /trunk/asymptote/doc/Makefile.in
+ M /trunk/asymptote/doc/asymptote.sty
+ M /trunk/asymptote/doc/asymptote.texi
+ M /trunk/asymptote/doc/externalprc.tex
+ A /trunk/asymptote/doc/latexmkrc
+ M /trunk/asymptote/doc/latexusage.tex
+ M /trunk/asymptote/examples/animations/inlinemovie.tex
+ M /trunk/asymptote/examples/animations/inlinemovie3.tex
+ M /trunk/asymptote/picture.cc
+ M /trunk/asymptote/runpicture.in
+ M /trunk/asymptote/texfile.cc
+
+Rename *_.pre preamble files to *.pre.
+
+In inlinetex mode, rename *_.tex files to *.tex.
+
+Allow the inline option to be specified for every figure.
+
+Implement a global attach default option.
+
+Do not generate a global latexusage.asy file along with the individual
+latexusage-*.asy files (this is a backwards incompatible change).
+
+Add latexmk support for compiling individually only those figures that have
+changed.
+
+------------------------------------------------------------------------
+r5099 | jcbowman | 2010-07-09 08:41:10 -0600 (Fri, 09 Jul 2010) | 2 lines
+Changed paths:
+ M /trunk/asymptote/examples/washermethod.asy
+
+Fix example.
+
+------------------------------------------------------------------------
+r5098 | jcbowman | 2010-07-08 12:01:55 -0600 (Thu, 08 Jul 2010) | 2 lines
+Changed paths:
+ M /trunk/asymptote/runlabel.in
+
+Minor simplification.
+
+------------------------------------------------------------------------
+r5097 | jcbowman | 2010-07-08 11:56:43 -0600 (Thu, 08 Jul 2010) | 2 lines
+Changed paths:
+ M /trunk/asymptote/psfile.h
+ M /trunk/asymptote/runlabel.in
+
+Simplify texpath.
+
+------------------------------------------------------------------------
+r5096 | jcbowman | 2010-07-08 10:54:27 -0600 (Thu, 08 Jul 2010) | 2 lines
+Changed paths:
+ M /trunk/asymptote/psfile.h
+ M /trunk/asymptote/runlabel.in
+
+Fix multiple fraction bar bug.
+
+------------------------------------------------------------------------
+r5095 | jcbowman | 2010-07-08 10:46:59 -0600 (Thu, 08 Jul 2010) | 2 lines
+Changed paths:
+ M /trunk/asymptote/base/plain_Label.asy
+
+Fix texpath("\relax").
+
+------------------------------------------------------------------------
+r5094 | jcbowman | 2010-07-07 09:54:38 -0600 (Wed, 07 Jul 2010) | 2 lines
+Changed paths:
+ M /trunk/asymptote/prc/writePRC.cc
+ M /trunk/asymptote/runmath.in
+
+More portability fixes.
+
+------------------------------------------------------------------------
+r5093 | jcbowman | 2010-07-07 09:05:00 -0600 (Wed, 07 Jul 2010) | 2 lines
+Changed paths:
+ M /trunk/asymptote/prc/writePRC.cc
+
+Define __GNUC_PREREQ if undefined.
+
+------------------------------------------------------------------------
+r5092 | jcbowman | 2010-07-07 08:58:43 -0600 (Wed, 07 Jul 2010) | 2 lines
+Changed paths:
+ M /trunk/asymptote/memory.h
+ M /trunk/asymptote/prc/PRC.h
+ M /trunk/asymptote/prc/PRCbitStream.h
+ M /trunk/asymptote/prc/writePRC.cc
+ M /trunk/asymptote/runmath.in
+
+More portability fixes.
+
+------------------------------------------------------------------------
+r5091 | hammera | 2010-07-07 07:22:38 -0600 (Wed, 07 Jul 2010) | 2 lines
+Changed paths:
+ M /trunk/asymptote/entry.cc
+
+Re-implemented sanity checks in venv.
+
+------------------------------------------------------------------------
+r5090 | jcbowman | 2010-07-06 23:45:57 -0600 (Tue, 06 Jul 2010) | 2 lines
+Changed paths:
+ M /trunk/asymptote/asymptote.spec
+ A /trunk/asymptote/examples/cards.asy
+ M /trunk/asymptote/item.h
+ M /trunk/asymptote/path.cc
+ M /trunk/asymptote/path.h
+ M /trunk/asymptote/prc/PRC.h
+ M /trunk/asymptote/prc/PRCbitStream.h
+
+Fix warning messages/portability issues.
+
+------------------------------------------------------------------------
+r5089 | jcbowman | 2010-07-06 15:22:58 -0600 (Tue, 06 Jul 2010) | 2 lines
+Changed paths:
+ M /trunk/asymptote/base/plain_picture.asy
+
+Remove obsolete infinite coordinates.
+
+------------------------------------------------------------------------
+r5088 | jcbowman | 2010-07-06 14:57:47 -0600 (Tue, 06 Jul 2010) | 2 lines
+Changed paths:
+ M /trunk/asymptote/drawlabel.cc
+
+Revert r4988 for frames.
+
+------------------------------------------------------------------------
+r5087 | jcbowman | 2010-07-06 11:57:08 -0600 (Tue, 06 Jul 2010) | 2 lines
+Changed paths:
+ M /trunk/asymptote/doc/asymptote.sty
+ M /trunk/asymptote/doc/asymptote.texi
+ M /trunk/asymptote/doc/latexusage.tex
+
+Fix conflict between asymptote.sty and changebar package.
+
+------------------------------------------------------------------------
+r5086 | hammera | 2010-07-05 14:30:12 -0600 (Mon, 05 Jul 2010) | 2 lines
+Changed paths:
+ M /trunk/asymptote/entry.cc
+ M /trunk/asymptote/entry.h
+
+Minimized the impact of the NOHASH directive.
+
+------------------------------------------------------------------------
+r5085 | hammera | 2010-07-05 13:56:17 -0600 (Mon, 05 Jul 2010) | 2 lines
+Changed paths:
+ M /trunk/asymptote/entry.cc
+
+Common sub-expression elimination.
+
+------------------------------------------------------------------------
+r5084 | hammera | 2010-07-05 13:53:15 -0600 (Mon, 05 Jul 2010) | 2 lines
+Changed paths:
+ M /trunk/asymptote/entry.cc
+ M /trunk/asymptote/entry.h
+
+Removed 'key' class from venv.
+
+------------------------------------------------------------------------
+r5083 | hammera | 2010-07-05 13:35:19 -0600 (Mon, 05 Jul 2010) | 2 lines
+Changed paths:
+ M /trunk/asymptote/entry.cc
+ M /trunk/asymptote/entry.h
+
+Removed dead code.
+
+------------------------------------------------------------------------
+r5082 | hammera | 2010-07-05 11:46:23 -0600 (Mon, 05 Jul 2010) | 2 lines
+Changed paths:
+ M /trunk/asymptote/entry.cc
+ M /trunk/asymptote/entry.h
+ M /trunk/asymptote/record.h
+ M /trunk/asymptote/symbol.cc
+ M /trunk/asymptote/symbol.h
+ M /trunk/asymptote/types.cc
+ M /trunk/asymptote/types.h
+
+Custom hash table in venv.
+
+------------------------------------------------------------------------
+r5081 | jcbowman | 2010-07-05 02:44:07 -0600 (Mon, 05 Jul 2010) | 2 lines
+Changed paths:
+ M /trunk/asymptote/base/animation.asy
+
+Support xelatex animations.
+
+------------------------------------------------------------------------
+r5080 | jcbowman | 2010-07-05 02:27:26 -0600 (Mon, 05 Jul 2010) | 1 line
+Changed paths:
+ M /trunk/asymptote/configure.ac
+
+Increment version to 2.02svn.
+------------------------------------------------------------------------
r5079 | jcbowman | 2010-07-05 01:23:04 -0600 (Mon, 05 Jul 2010) | 2 lines
Changed paths:
M /trunk/asymptote/doc/png/Makefile.in
diff --git a/Build/source/utils/asymptote/Makefile.in b/Build/source/utils/asymptote/Makefile.in
index 8b06fbbef8d..e33778b1806 100644
--- a/Build/source/utils/asymptote/Makefile.in
+++ b/Build/source/utils/asymptote/Makefile.in
@@ -45,7 +45,7 @@ EXTRA = asy-mode.el asy-init.el asy.vim asy-kate.sh asymptote.py reload.js \
EXEXTRA = piicon.eps *.views *.dat
DOCEXTRA = *.asy *.csv *.dat latexusage.tex externalprc.tex pixel.pdf
KEYWORDS = base $(ASYMPTOTE_SITEDIR)
-LATEXFILES = asymptote.sty asycolors.sty ocg.sty
+LATEXFILES = asymptote.sty asycolors.sty ocg.sty latexmkrc
CONTEXTFILES = colo-asy.tex
ASY = ./asy -dir base -config "" -render=0
@@ -220,14 +220,13 @@ install-prebuilt: install-asy
uninstall: uninstall-all
-uninstall-all: uninstall-man uninstall-asy
+uninstall-all: uninstall-man uninstall-asy uninstall-docdir
uninstall-asy:
-cd $(animationsdir) && rm -f *.asy *.tex
-rmdir $(animationsdir)
-cd $(exampledir) && rm -f $(EXEXTRA) $(DOCEXTRA)
-rmdir $(exampledir)
- -rmdir $(docdir)
-cd $(GUIdir) && rm -f *.py
-rmdir $(GUIdir)
-cd $(asydir) && rm -f asy-keywords.el *.asy $(EXTRA)
@@ -241,6 +240,9 @@ uninstall-asy:
uninstall-man:
cd doc && $(MAKE) uninstall
+uninstall-docdir:
+ -rmdir $(docdir)
+
clean: FORCE
-rm -f asy *.o *.d *mon.out $(CLEAN)
diff --git a/Build/source/utils/asymptote/ReleaseNotes b/Build/source/utils/asymptote/ReleaseNotes
index d35e05a8ac1..48b3d7c3d63 100644
--- a/Build/source/utils/asymptote/ReleaseNotes
+++ b/Build/source/utils/asymptote/ReleaseNotes
@@ -1,3 +1,17 @@
+Release Notes for Version 2.02
+
+A global latexusage.asy file is no longer generated, in favour of
+individual latexusage-*.asy files (this is a backwards incompatible
+change). Global and local values can now be given for both the inline and
+attach asymptote.sty (version 1.15) options. Underscores were removed from
+the .pre and .tex file names in inlinetex mode. Latexmk support was added
+for compiling individually only those figures that have changed; this
+requires that the inline option be used for 3D figures.
+The asy() function was fixed. A multiple fraction bar bug in texpath was
+fixed. Warning messages and portability issues were addressed. A frame
+label alignment problem was fixed. PDF animations are now supported with
+the XeLaTeX TeX engine.
+
Release Notes for Version 2.01
The normal vector for perspective projections was fixed. Individual
diff --git a/Build/source/utils/asymptote/asy-keywords.el b/Build/source/utils/asymptote/asy-keywords.el
index 1b4365b88f5..bce38beaa05 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 "2.01")
+(defvar asy-keywords-version "2.02")
(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 FitResult Label Legend Segment Solution 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 light line linefit marginT marker mass object pair parabola path path3 pen picture point position projection real revolution scaleT scientific segment side slice solution 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 CLZ CTZ 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 Jn 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 OmitTickInterval OmitTickIntervals OutTicks Ox Oy Palatino PaletteTicks Pen PenMargin PenMargins Pentype Portrait RadialShade RadialShadeDraw Rainbow Range Relative Right RightTicks Rotate Round SQR Scale ScaleX ScaleY ScaleZ Seascape Segment 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 Yn Z ZX ZXgrid ZYgrid ZapfChancery ZapfDingbats _begingroup3 _cputime _draw _eval _image _labelpath _projection _strokepath _texpath aCos aSin aTan abort abs accel acos acosh acot acsc activatequote add addArrow addMargins addSaveFunction addnode addnodes addpenarc addpenline 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 begin beginclip begingroup beginpoint between bevel bezier bezierP bezierPP bezierPPP bezulate bibliography bibliographystyle binarytree binarytreeNode binomial binput bins bisector bisectorpoint bispline blend blockconnector boutput box bqe breakpoint breakpoints brick buildRestoreDefaults buildRestoreThunk buildcycle bulletcolor byte canonical canonicalcartesiansystem cartesiansystem case1 case2 case3 case4 cbrt cd ceil center centerToFocus centroid cevian change2 changecoordsys checkSegment checkconditionlength checker checkincreasing 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 connected connectedindex containmentTree contains contour contour3 contouredges controlSpecifier convert coordinates coordsys copy cos cosh cot countIntersections cputime crop cropcode cross crossframe crosshatch crossmarksize csc cubicroots curabscissa curlSpecifier curpoint currentarrow currentexitfunction currentmomarrow currentpolarconicroutine curve cut cutafter cutbefore cyclic cylinder deactivatequote debugger deconstruct defaultdir defaultformat defaultpen defined degenerate degrees delete deletepreamble determinant diagonal diamond diffdiv dir dirSpecifier dirtime display distance divisors do_overpaint dot dotframe dotsize downcase draw drawAll drawDoubleLine drawFermion drawGhost drawGluon drawMomArrow drawPRCcylinder drawPRCdisk drawPRCsphere drawPRCtube drawPhoton drawScalar drawVertex drawVertexBox drawVertexBoxO drawVertexBoxX drawVertexO drawVertexOX drawVertexTriangle drawVertexTriangleO drawVertexX drawarrow drawarrow2 drawline drawtick duplicate elle ellipse ellipsenodesnumber embed embed3 empty enclose end endScript endclip endgroup endgroup3 endl endpoint endpoints eof eol equation equations erase erasestep erf erfc error errorbar errorbars eval excenter excircle exit exitXasyMode exitfunction exp expfactors expi expm1 exradius extend extension extouch fabs factorial fermat fft fhorner figure file filecode fill filldraw filloutside fillrule filltype find finite finiteDifferenceJacobian firstcut firstframe fit fit2 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 indexedfigure initXasyMode initdefaults input inradius insert inside integrate interactive interior interp interpolate intersect intersection intersectionpoint intersectionpoints intersections intouch inverse inversion invisible is3D isCCW 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 lexorder lift light limits line linear linecap lineinversion linejoin linemargin lineskip linetype linewidth link list lm_enorm lm_evaluate_default lm_lmdif lm_lmpar lm_minimize lm_print_default lm_print_quiet lm_qrfac lm_qrsolv 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 maxbezier maxbound maxcoords maxlength maxratio maxtimes mean medial median midpoint min min3 minbezier minbound minipage minratio mintimes miterlimit momArrowPath momarrowsize monotonic multifigure nativeformat natural needshipout newl newpage newslide newton newtree nextframe nextnormal nextpage nib nodabscissa none norm normalvideo notaknot nowarn 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 outname outprefix output overloadedMessage overwrite pack pad pairs palette parabola parabolanodesnumber parallel parallelogram partialsum path path3 pattern pause pdf pedal periodic perp perpendicular perpendicularmark phantom phi1 phi2 phi3 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 readline realmult realquarticroots rectangle rectangular rectify reflect relabscissa relative relativedistance reldir relpoint reltime remainder remark removeDuplicates rename replace report resetdefaultpen restore restoredefaults reverse reversevideo rf rfind rgb rgba rgbint rms rotate rotateO rotation round roundbox roundedpath roundrectangle same samecoordsys sameside sample save savedefaults saveline scale scale3 scaleO scaleT scaleless scientific search searchindex searchtree sec secondaryX secondaryY seconds section sector seek seekeof segment sequence setcontour 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 solveBVP 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 texsize 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 unique unit unitrand unitsize unityroot unstraighten upcase updatefunction uperiodic upscale uptodate usepackage usersetting usetypescript usleep value variance variancebiased vbox vector vectorfield verbatim view vline vperiodic vprojection warn warning windingnumber 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 CLZ CTZ 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 Jn 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 OmitTickInterval OmitTickIntervals OutTicks Ox Oy Palatino PaletteTicks Pen PenMargin PenMargins Pentype Portrait RadialShade RadialShadeDraw Rainbow Range Relative Right RightTicks Rotate Round SQR Scale ScaleX ScaleY ScaleZ Seascape Segment 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 Yn Z ZX ZXgrid ZYgrid ZapfChancery ZapfDingbats _begingroup3 _cputime _draw _eval _image _labelpath _projection _strokepath _texpath aCos aSin aTan abort abs accel acos acosh acot acsc activatequote add addArrow addMargins addSaveFunction addnode addnodes addpenarc addpenline 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 begin beginclip begingroup beginpoint between bevel bezier bezierP bezierPP bezierPPP bezulate bibliography bibliographystyle binarytree binarytreeNode binomial binput bins bisector bisectorpoint bispline blend blockconnector boutput box bqe breakpoint breakpoints brick buildRestoreDefaults buildRestoreThunk buildcycle bulletcolor byte canonical canonicalcartesiansystem cartesiansystem case1 case2 case3 case4 cbrt cd ceil center centerToFocus centroid cevian change2 changecoordsys checkSegment checkconditionlength checker checkincreasing 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 connected connectedindex containmentTree contains contour contour3 contouredges controlSpecifier convert coordinates coordsys copy cos cosh cot countIntersections cputime crop cropcode cross crossframe crosshatch crossmarksize csc cubicroots curabscissa curlSpecifier curpoint currentarrow currentexitfunction currentmomarrow currentpolarconicroutine curve cut cutafter cutbefore cyclic cylinder deactivatequote debugger deconstruct defaultdir defaultformat defaultpen defined degenerate degrees delete deletepreamble determinant diagonal diamond diffdiv dir dirSpecifier dirtime display distance divisors do_overpaint dot dotframe dotsize downcase draw drawAll drawDoubleLine drawFermion drawGhost drawGluon drawMomArrow drawPRCcylinder drawPRCdisk drawPRCsphere drawPRCtube drawPhoton drawScalar drawVertex drawVertexBox drawVertexBoxO drawVertexBoxX drawVertexO drawVertexOX drawVertexTriangle drawVertexTriangleO drawVertexX drawarrow drawarrow2 drawline drawtick duplicate elle ellipse ellipsenodesnumber embed embed3 empty enclose end endScript endclip endgroup endgroup3 endl endpoint endpoints eof eol equation equations erase erasestep erf erfc error errorbar errorbars eval excenter excircle exit exitXasyMode exitfunction exp expfactors expi expm1 exradius extend extension extouch fabs factorial fermat fft fhorner figure file filecode fill filldraw filloutside fillrule filltype find finite finiteDifferenceJacobian firstcut firstframe fit fit2 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 indexedfigure initXasyMode initdefaults input inradius insert inside integrate interactive interior interp interpolate intersect intersection intersectionpoint intersectionpoints intersections intouch inverse inversion invisible is3D isCCW 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 lexorder lift light limits line linear linecap lineinversion linejoin linemargin lineskip linetype linewidth link list lm_enorm lm_evaluate_default lm_lmdif lm_lmpar lm_minimize lm_print_default lm_print_quiet lm_qrfac lm_qrsolv 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 maxbezier maxbound maxcoords maxlength maxratio maxtimes mean medial median midpoint min min3 minbezier minbound minipage minratio mintimes miterlimit momArrowPath momarrowsize monotonic multifigure nativeformat natural needshipout newl newpage newslide newton newtree nextframe nextnormal nextpage nib nodabscissa none norm normalvideo notaknot nowarn 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 outname outprefix output overloadedMessage overwrite pack pad pairs palette parabola parabolanodesnumber parallel parallelogram partialsum path path3 pattern pause pdf pedal periodic perp perpendicular perpendicularmark phantom phi1 phi2 phi3 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 readline realmult realquarticroots rectangle rectangular rectify reflect relabscissa relative relativedistance reldir relpoint reltime remainder remark removeDuplicates rename replace report resetdefaultpen restore restoredefaults reverse reversevideo rf rfind rgb rgba rgbint rms rotate rotateO rotation round roundbox roundedpath roundrectangle same samecoordsys sameside sample save savedefaults saveline scale scale3 scaleO scaleT scaleless scientific search searchindex searchtree sec secondaryX secondaryY seconds section sector seek seekeof segment sequence setcontour 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 solveBVP sort sourceline sphere split sqrt square srand standardizecoordsys startScript startTrembling stdev step stickframe stickmarksize stickmarkspace stop straight straightness string stripdirectory stripextension stripfile stripsuffix 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 texsize 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 unique unit unitrand unitsize unityroot unstraighten upcase updatefunction uperiodic upscale uptodate usepackage usersetting usetypescript usleep value variance variancebiased vbox vector vectorfield verbatim view vline vperiodic vprojection warn warning windingnumber 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 Coeff 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 Down Draw E ENE EPS ESE E_Euler E_PC E_RK2 E_RK3BS Emerald EndPoint Euler 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 LM_DWARF LM_MACHEP LM_SQRT_DWARF LM_SQRT_GIANT LM_USERTOL Label Lavender LavenderBlush LawnGreen Left 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 PC PaleGoldenrod PaleGreen PaleTurquoise PaleVioletRed PapayaWhip Peach PeachPuff Periwinkle Peru PineGreen Pink Plum PowderBlue ProcessBlue Purple RK2 RK3 RK3BS RK4 RK5 RK5DP RK5F RawSienna Red RedOrange RedViolet Rhodamine Right 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 Up 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 currentlight 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 defaultControl defaultS defaultbackpen defaultcoordsys defaultexcursion defaultfilename defaultformat defaultmassformat defaultpen diagnostics differentlengths dot dotfactor dotframe dotted doublelinepen doublelinespacing down duplicateFuzz edge ellipsenodesnumberfactor eps epsgeo epsilon evenodd extendcap exterior 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 hyperbola hyperbolanodesnumberfactor identity4 ignore inXasyMode inch inches includegraphicscommand inf infinity institutionpen intMax intMin interior invert invisible itempen itemskip itemstep labelmargin landscape lastnode left legendhskip legendlinelength legendmargin legendmarkersize legendmaxrelativewidth legendvskip lightblue lightcyan lightgray lightgreen lightgrey lightmagenta lightolive lightred lightyellow line linemargin lm_infmsg lm_shortmsg 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 ocgindex 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 stepfactor 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 viewportmargin 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 7972a8c5923..965cde91187 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: 2.01
+Version: 2.02
Release: 1%{?dist}
Summary: Descriptive vector graphics language
diff --git a/Build/source/utils/asymptote/base/animation.asy b/Build/source/utils/asymptote/base/animation.asy
index 582b32bced4..57e13ab6e03 100644
--- a/Build/source/utils/asymptote/base/animation.asy
+++ b/Build/source/utils/asymptote/base/animation.asy
@@ -132,12 +132,17 @@ struct animation {
return s;
}
+ bool pdflatex()
+ {
+ return latex() && pdf();
+ }
+
string pdf(enclosure enclosure=NoBox, real delay=animationdelay,
string options="", bool keep=settings.keep, bool multipage=true) {
if(settings.inlinetex) multipage=true;
if(!global) multipage=false;
- if(settings.tex != "pdflatex")
- abort("inline pdf animations require -tex pdflatex");
+ if(!pdflatex())
+ abort("inline pdf animations require -tex pdflatex or -tex xelatex");
if(settings.outformat != "") settings.outformat="pdf";
string filename=basename();
diff --git a/Build/source/utils/asymptote/base/plain.asy b/Build/source/utils/asymptote/base/plain.asy
index 76f77aaf52c..e06bc66543c 100644
--- a/Build/source/utils/asymptote/base/plain.asy
+++ b/Build/source/utils/asymptote/base/plain.asy
@@ -187,22 +187,31 @@ void usersetting()
eval(settings.user,true);
}
+string stripsuffix(string f, string suffix=".asy")
+{
+ int n=rfind(f,suffix);
+ if(n != -1) f=erase(f,n,-1);
+ return f;
+}
+
// Conditionally process each file name in array s in a new environment.
void asy(string format, bool overwrite=false ... string[] s)
{
for(string f : s) {
- int n=rfind(f,".asy");
- if(n != -1) f=erase(f,n,-1);
- if(overwrite || error(input(f+"."+format,check=false))) {
+ f=stripsuffix(f);
+ string suffix="."+format;
+ string fsuffix=f+suffix;
+ if(overwrite || error(input(fsuffix,check=false))) {
string outformat=settings.outformat;
bool interactiveView=settings.interactiveView;
bool batchView=settings.batchView;
settings.outformat=format;
settings.interactiveView=false;
settings.batchView=false;
- delete(outname()+"_"+".aux");
- eval("defaultfilename=\""+f+"\"; import \""+f+
- "\" as dummy; exitfunction()");
+ string outname=outname();
+ delete(outname+"_"+".aux");
+ eval("import \""+f+"\" as dummy");
+ rename(stripsuffix(outname)+suffix,fsuffix);
settings.outformat=outformat;
settings.interactiveView=interactiveView;
settings.batchView=batchView;
@@ -210,7 +219,8 @@ void asy(string format, bool overwrite=false ... string[] s)
}
}
-void beep() {
+void beep()
+{
write('\7',flush);
}
diff --git a/Build/source/utils/asymptote/base/plain_Label.asy b/Build/source/utils/asymptote/base/plain_Label.asy
index 86d11f8acc0..623619f4a0c 100644
--- a/Build/source/utils/asymptote/base/plain_Label.asy
+++ b/Build/source/utils/asymptote/base/plain_Label.asy
@@ -625,6 +625,7 @@ path[] texpath(Label L, bool tex=settings.tex != "none", bool bbox=false)
}
path[] transform(path[] g, Label L) {
+ if(g.length == 0) return g;
pair m=min(g);
pair M=max(g);
pair dir=rectify(inverse(L.T)*-L.align.dir);
diff --git a/Build/source/utils/asymptote/base/plain_picture.asy b/Build/source/utils/asymptote/base/plain_picture.asy
index 2ec467727d2..6764d885380 100644
--- a/Build/source/utils/asymptote/base/plain_picture.asy
+++ b/Build/source/utils/asymptote/base/plain_picture.asy
@@ -36,7 +36,6 @@ transform3 shiftless(transform3 t)
// coordinates.
struct coord {
real user,truesize;
- bool finite=true;
// Build a coord.
static coord build(real user, real truesize) {
@@ -88,14 +87,13 @@ struct coords2 {
void push(transform t, coords2 c1, coords2 c2) {
for(int i=0; i < c1.x.length; ++i) {
coord cx=c1.x[i], cy=c2.y[i];
- pair tinf=shiftless(t)*((finite(cx.user) ? 0 : 1),
- (finite(cy.user) ? 0 : 1));
+ pair tinf=shiftless(t)*(0,0);
pair z=t*(cx.user,cy.user);
pair w=(cx.truesize,cy.truesize);
w=length(w)*unit(shiftless(t)*w);
coord Cx,Cy;
- Cx.user=(tinf.x == 0 ? z.x : infinity);
- Cy.user=(tinf.y == 0 ? z.y : infinity);
+ Cx.user=z.x;
+ Cy.user=z.y;
Cx.truesize=w.x;
Cy.truesize=w.y;
push(Cx,Cy);
@@ -145,16 +143,14 @@ struct coords3 {
void push(transform3 t, coords3 c1, coords3 c2, coords3 c3) {
for(int i=0; i < c1.x.length; ++i) {
coord cx=c1.x[i], cy=c2.y[i], cz=c3.z[i];
- triple tinf=shiftless(t)*((finite(cx.user) ? 0 : 1),
- (finite(cy.user) ? 0 : 1),
- (finite(cz.user) ? 0 : 1));
+ triple tinf=shiftless(t)*(0,0,0);
triple z=t*(cx.user,cy.user,cz.user);
triple w=(cx.truesize,cy.truesize,cz.truesize);
w=length(w)*unit(shiftless(t)*w);
coord Cx,Cy,Cz;
- Cx.user=(tinf.x == 0 ? z.x : infinity);
- Cy.user=(tinf.y == 0 ? z.y : infinity);
- Cz.user=(tinf.z == 0 ? z.z : infinity);
+ Cx.user=z.x;
+ Cy.user=z.y;
+ Cz.user=z.z;
Cx.truesize=w.x;
Cy.truesize=w.y;
Cz.truesize=w.z;
@@ -185,18 +181,13 @@ coord[] maxcoords(coord[] in, bool operator <= (coord,coord))
int n=in.length;
- // Find the first finite restriction.
- int first=0;
- for(first=0; first < n; ++first)
- if(finite(in[first].user)) break;
-
- if(first == n)
+ if(n == 0)
return c;
- else {
- // Add the first coord without checking restrictions (as there are none).
- best=in[first];
- c.push(best);
- }
+
+ int first=0;
+ // Add the first coord without checking restrictions (as there are none).
+ best=in[first];
+ c.push(best);
static int NONE=-1;
@@ -234,7 +225,7 @@ coord[] maxcoords(coord[] in, bool operator <= (coord,coord))
void add(coord x)
{
- if(x <= best || !finite(x.user))
+ if(x <= best)
return;
else {
int i=dominator(x);
@@ -957,7 +948,7 @@ struct picture {
// Calculate the minimum point in scaling the coords.
real min(real m, scaling s, coord[] c) {
for(int i=0; i < c.length; ++i)
- if(finite(c[i].user) && s.scale(c[i]) < m)
+ if(s.scale(c[i]) < m)
m=s.scale(c[i]);
return m;
}
@@ -965,7 +956,7 @@ struct picture {
// Calculate the maximum point in scaling the coords.
real max(real M, scaling s, coord[] c) {
for(int i=0; i < c.length; ++i)
- if(finite(c[i].user) && s.scale(c[i]) > M)
+ if(s.scale(c[i]) > M)
M=s.scale(c[i]);
return M;
}
@@ -1062,8 +1053,6 @@ struct picture {
bool userzero=true;
for(int i=0; i < coords.length; ++i) {
if(coords[i].user != 0) userzero=false;
- if(!finite(coords[i].user) || !finite(coords[i].truesize))
- abort("unbounded picture");
}
if(userzero) return 1;
warning("cannotfit","cannot fit picture to "+dir+"size "+(string) size
diff --git a/Build/source/utils/asymptote/configure b/Build/source/utils/asymptote/configure
index 15b04f43890..350b6eac0cf 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 2.01.
+# Generated by GNU Autoconf 2.63 for Asymptote 2.02.
#
# Report bugs to <http://sourceforge.net/projects/asymptote>.
#
@@ -596,8 +596,8 @@ SHELL=${CONFIG_SHELL-/bin/sh}
# Identity of this package.
PACKAGE_NAME='Asymptote'
PACKAGE_TARNAME='asymptote'
-PACKAGE_VERSION='2.01'
-PACKAGE_STRING='Asymptote 2.01'
+PACKAGE_VERSION='2.02'
+PACKAGE_STRING='Asymptote 2.02'
PACKAGE_BUGREPORT='http://sourceforge.net/projects/asymptote'
# Factoring default headers for most tests.
@@ -1294,7 +1294,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 2.01 to adapt to many kinds of systems.
+\`configure' configures Asymptote 2.02 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@@ -1355,7 +1355,7 @@ fi
if test -n "$ac_init_help"; then
case $ac_init_help in
- short | recursive ) echo "Configuration of Asymptote 2.01:";;
+ short | recursive ) echo "Configuration of Asymptote 2.02:";;
esac
cat <<\_ACEOF
@@ -1465,7 +1465,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
-Asymptote configure 2.01
+Asymptote configure 2.02
generated by GNU Autoconf 2.63
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
@@ -1479,7 +1479,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 2.01, which was
+It was created by Asymptote $as_me 2.02, which was
generated by GNU Autoconf 2.63. Invocation command line was
$ $0 $@
@@ -12022,7 +12022,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 2.01, which was
+This file was extended by Asymptote $as_me 2.02, which was
generated by GNU Autoconf 2.63. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@@ -12081,7 +12081,7 @@ Report bugs to <bug-autoconf@gnu.org>."
_ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_version="\\
-Asymptote config.status 2.01
+Asymptote config.status 2.02
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 a5529360128..ae65035f24e 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],[2.01],[http://sourceforge.net/projects/asymptote])
+AC_INIT([Asymptote],[2.02],[http://sourceforge.net/projects/asymptote])
VERSION=$PACKAGE_VERSION
AC_SUBST(VERSION)
diff --git a/Build/source/utils/asymptote/doc/CAD.pdf b/Build/source/utils/asymptote/doc/CAD.pdf
index 327f2ff3b0b..59b899d3388 100644
--- a/Build/source/utils/asymptote/doc/CAD.pdf
+++ b/Build/source/utils/asymptote/doc/CAD.pdf
Binary files differ
diff --git a/Build/source/utils/asymptote/doc/FAQ/asy-faq.info b/Build/source/utils/asymptote/doc/FAQ/asy-faq.info
index 64d6def87ce..059fa578d1a 100644
--- a/Build/source/utils/asymptote/doc/FAQ/asy-faq.info
+++ b/Build/source/utils/asymptote/doc/FAQ/asy-faq.info
@@ -9,7 +9,7 @@ END-INFO-DIR-ENTRY
File: $prefix.info, Node: Top, Next: Question 1.1, Up: (dir)
ASYMPTOTE FREQUENTLY ASKED QUESTIONS
- 05 Jul 2010
+ 11 Jul 2010
This is the list of Frequently Asked Questions about Asymptote (asy).
diff --git a/Build/source/utils/asymptote/doc/Makefile.in b/Build/source/utils/asymptote/doc/Makefile.in
index 7c5df2f878c..11651df9e43 100644
--- a/Build/source/utils/asymptote/doc/Makefile.in
+++ b/Build/source/utils/asymptote/doc/Makefile.in
@@ -36,7 +36,7 @@ latexusage.dvi: latexusage.tex
rm -f latexusage_.pre
rm -f latexusage.aux
latex latexusage
- $(ASY) -noprc latexusage
+ $(ASY) -noprc latexusage-*.asy
latex latexusage
latexusage.eps: latexusage.dvi
@@ -67,7 +67,7 @@ CAD.pdf: CAD.tex CAD1.eps
clean: FORCE
-rm -f $(ASYFILES:.asy=.pdf)
- -rm -f *.eps latexusage.{asy,dvi,eps,log,aux,*.eps}
+ -rm -f *.eps latexusage.{dvi,eps,log,aux,*.eps} latexusage-* latexusage_.pre
-rm -f {asymptote,asymptote_}.{aux,cp,cps,dvi,fn,info,ky,log,pg,toc,tp,vr}
-rm -f asymptote_.texi
-rm -f CAD.{aux,dvi,log,toc}
diff --git a/Build/source/utils/asymptote/doc/asymptote.pdf b/Build/source/utils/asymptote/doc/asymptote.pdf
index d4a834d8dde..d480d1c6d84 100644
--- a/Build/source/utils/asymptote/doc/asymptote.pdf
+++ b/Build/source/utils/asymptote/doc/asymptote.pdf
Binary files differ
diff --git a/Build/source/utils/asymptote/doc/asymptote.sty b/Build/source/utils/asymptote/doc/asymptote.sty
index 4b0cda55ee1..4db253d4095 100644
--- a/Build/source/utils/asymptote/doc/asymptote.sty
+++ b/Build/source/utils/asymptote/doc/asymptote.sty
@@ -3,11 +3,13 @@
%%% Modified by John Bowman
%%% Adapted from comment.sty (Under GPL v2+)
-\ProvidesPackage{asymptote}[2010/07/05 v1.13 Asymptote style file for LaTeX]
+\ProvidesPackage{asymptote}[2010/07/10 v1.15 Asymptote style file for LaTeX]
\RequirePackage{keyval}
\RequirePackage{ifthen}
-\newif\ifASYinline
-\DeclareOption{inline}{\ASYinlinetrue}
+\newif\ifASYdefaultinline
+\newif\ifASYdefaultattach
+\DeclareOption{inline}{\ASYdefaultinlinetrue}
+\DeclareOption{attach}{\ASYdefaultattachtrue}
\ProcessOptions*
\def\unquoteJobname#1"#2"#3\relax{\def\rawJobname{#1}%
@@ -24,20 +26,23 @@
\def\makeinnocent#1{\catcode`#1=12 }
\def\csarg#1#2{\expandafter#1\csname#2\endcsname}
\newwrite\AsyStream
-\newwrite\AsyAllStream
-\newread\AsyTestTeXStream
+\newwrite\AsyPreStream
+\newread\AsyTestStream
-\openin\AsyStream=\jobname_.pre
-\ifeof\AsyStream
+\def\AsyInput#1{\openin\AsyTestStream=#1
+\ifeof\AsyTestStream
\else
-\input \jobname_.pre
+ \input #1
\fi
-\closein\AsyStream%
+\closein\AsyTestStream%
+}
+
+\AsyInput{\jobname.pre}
-\immediate\openout\AsyAllStream=\jobname.asy
+\immediate\openout\AsyPreStream=\jobname.pre
+\newif\ifASYinline
\newif\ifASYattach
-\newif\ifASYtex
\newif\ifASYPDF
\ifx\pdfoutput\undefined
@@ -106,14 +111,10 @@
\immediate\write\AsyStream{size(\ASYwidth,\ASYheight);}%
\fi
\fi
- \ASYtexfalse%
\ifASYattach
\def\ASYdefaultviewportwidth{0}%
\else
\def\ASYdefaultviewportwidth{\the\linewidth}%
- \ifASYinline
- \ASYtextrue%
- \fi
\fi
\ifx\ASYviewportwidth\empty
\ifx\ASYviewportheight\empty
@@ -134,44 +135,45 @@
\gdef\ASYviewportheight{}%
\immediate\closeout\AsyStream
- \ifASYtex
- \openin\AsyStream=\AsyFile_.tex
+ \ifASYinline
+ \openin\AsyTestStream=\AsyFile.tex
\else
\ifASYPDF
- \openin\AsyStream=\AsyFile.pdf
+ \openin\AsyTestStream=\AsyFile.pdf
\else
- \openin\AsyStream=\AsyFile.eps
+ \openin\AsyTestStream=\AsyFile.eps
\fi
\fi
- \ifeof\AsyStream
- \ifASYtex
- \PackageWarning{asymptote}{file \AsyFile_.tex does not exist}%
+ \ifeof\AsyTestStream
+ \ifASYinline
+ \PackageWarning{asymptote}{file `\AsyFile.tex' not found}%
+ \closein\AsyTestStream%
\else
- \openin\AsyTestTeXStream=\AsyFile_.tex
- \ifeof\AsyTestTeXStream
+ \closein\AsyTestStream%
+ \openin\AsyTestStream=\AsyFile.tex
+ \ifeof\AsyTestStream
\ifASYPDF
- \PackageWarning{asymptote}{file \AsyFile.pdf does not exist}%
+ \PackageWarning{asymptote}{file `\AsyFile.pdf' not found}%
\else
- \PackageWarning{asymptote}{file \AsyFile.eps does not exist}%
+ \PackageWarning{asymptote}{file `\AsyFile.eps' not found}%
\fi
\else
\catcode`:=12
- \input \AsyFile_.tex%
+ \input \AsyFile.tex%
\fi
- \closein\AsyTestTeXStream%
+ \closein\AsyTestStream%
\fi
- \closein\AsyStream%
\else
- \closein\AsyStream%
- \ifASYtex
+ \closein\AsyTestStream%
+ \ifASYinline
\catcode`:=12
- \input \AsyFile_.tex%
+ \input \AsyFile.tex%
\else
\ifASYattach
\ifASYPDF
- \openin\AsyStream=\AsyFile+0.pdf
+ \openin\AsyTestStream=\AsyFile+0.pdf
\fi
- \ifeof\AsyStream
+ \ifeof\AsyTestStream
\setbox\ASYbox=\hbox{\includegraphics[hiresbb]{\AsyFile}}%
\else
\setbox\ASYbox=\hbox{\includegraphics[hiresbb]{\AsyFile+0}}%
@@ -180,13 +182,12 @@
\vskip-\ht\ASYbox%
\indent%
\box\ASYbox%
- \closein\AsyStream%
+ \closein\AsyTestStream%
\else
\includegraphics[hiresbb]{\AsyFile}%
\fi
\fi
\fi
- \global\ASYattachfalse
\relax%
\endgroup}
\gdef\ASYwidth{}%
@@ -208,15 +209,23 @@
\define@key{ASYkeys}{attach}[true]{%
\ifthenelse{\equal{#1}{true}}{\global\ASYattachtrue}{\global\ASYattachfalse}%
}
+\define@key{ASYkeys}{inline}[true]{%
+ \ifthenelse{\equal{#1}{true}}{\global\ASYinlinetrue}{\global\ASYinlinefalse}%
+}
\newcommand\asy[1][]{%
\begingroup
\let\par\empty
\stepcounter{asy}%
+ \global\let\ifASYinline\ifASYdefaultinline
+ \global\let\ifASYattach\ifASYdefaultattach
\setkeys{ASYkeys}{#1}%
- \immediate\write\AsyAllStream%
- {eval(quote\@charlb include "\jobname-\the\c@asy";\@charrb);}%
- \immediate\openout\AsyStream=\jobname-\the\c@asy.asy
- \gdef\AsyFile{\Jobname-\the\c@asy}
+ \ifASYattach
+ \global\ASYinlinefalse
+ \fi
+ \immediate\write\AsyPreStream%
+ {\@backslashchar AsyInput{\jobname-\the\c@asy.pre}}
+ \immediate\openout\AsyStream=\jobname-\the\c@asy.asy
+ \gdef\AsyFile{\Jobname-\the\c@asy}%
\immediate\write\AsyStream{if(!settings.multipleView)}%
\immediate\write\AsyStream{ settings.batchView=false;}%
\ifx\XeTeXversion\undefined
@@ -257,11 +266,11 @@
\AsymptoteEndDef{asydef}
\def\AfterasydefAsymptote{}
-\AtEndDocument{\immediate\closeout\AsyAllStream}
+\AtEndDocument{\immediate\closeout\AsyPreStream}
\newcommand{\ASYanimategraphics}[5][]{%
-\openin\AsyStream=_#3.pdf
-\ifeof\AsyStream%
+\openin\AsyTestStream=_#3.pdf
+\ifeof\AsyTestStream%
\else%
\animategraphics[{#1}]{#2}{_#3}{#4}{#5}%
\fi%
diff --git a/Build/source/utils/asymptote/doc/asymptote.texi b/Build/source/utils/asymptote/doc/asymptote.texi
index 8eb575e2b03..6fd28e78456 100644
--- a/Build/source/utils/asymptote/doc/asymptote.texi
+++ b/Build/source/utils/asymptote/doc/asymptote.texi
@@ -9,7 +9,7 @@ This file documents @code{Asymptote}, version @value{VERSION}.
@url{http://asymptote.sourceforge.net}
-Copyright @copyright{} 2004-9 Andy Hammerlindl, John Bowman, and Tom Prince.
+Copyright @copyright{} 2004-10 Andy Hammerlindl, John Bowman, and Tom Prince.
@quotation
Permission is granted to copy, distribute and/or modify this document
@@ -587,7 +587,7 @@ in the @code{Asymptote} source directory.
@anchor{multisampling}
@noindent
If your graphics card supports multisampling, we recommend using version
-@code{2.6.0-rc1} (or later) of @code{freeglut} to support antialiasing in
+@code{2.6.0} (or later) of @code{freeglut} to support antialiasing in
@code{Asymptote}'s adaptive @code{OpenGL} 3D renderer
(@code{MacOS X} users can skip this step since @code{Asymptote} is configured
to use the native glut library on that platform). Download
@@ -2934,7 +2934,7 @@ import fontsize;
at the beginning of the file (this requires the @code{type1cm} package
available from
@quotation
-@url{http://www.ctan.org/tex-archive/help/Catalogue/entries/type1cm}
+@url{http://www.ctan.org/tex-archive/macros/latex/contrib/type1cm/}
@end quotation
and included in recent @code{LaTeX} distributions). The font size and line
skip of a pen can be examined with the routines
@@ -5931,7 +5931,7 @@ to the type. This is regardless of what fields the variable actually possesses.
@cindex @code{asymptote.sty}
@code{Asymptote} comes with a convenient @code{LaTeX} style file
-@code{asymptote.sty} that makes @code{LaTeX}
+@code{asymptote.sty} (version 1.15 or later) that makes @code{LaTeX}
@code{Asymptote}-aware. Entering @code{Asymptote} code
directly into the @code{LaTeX} source file, at the point where it is
needed, keeps figures organized and avoids the need to invent new file
@@ -5947,7 +5947,7 @@ The sample @code{LaTeX} file below, named @code{latexusage.tex}, can
be run as follows:
@verbatim
latex latexusage
-asy latexusage
+asy latexusage-*.asy
latex latexusage
@end verbatim
@@ -5955,55 +5955,63 @@ latex latexusage
or
@verbatim
pdflatex latexusage
-asy latexusage
+asy latexusage-*.asy
pdflatex latexusage
@end verbatim
-
+@noindent
To switch between using @code{latex} and @code{pdflatex} you may first
-need to remove the files @code{latexusage-*}, @code{latexusage_.pre}, and
-@code{latexusage.aux}. Version 1.13 of @code{Asymptote.sty} supports
-processing each figure separately: @code{asy latexusage} is equivalent
-to @code{asy latexusage-*.asy}. For example, one may wish to reduce
-memory usage by generating each figure in a separate @code{UNIX} process:
+need to remove the files @code{latexusage-*}, @code{latexusage.pre}, and
+@code{latexusage.aux}.
+
+@cindex @code{latexmk}
+An even better method for processing a @code{LaTeX} file with embedded
+@code{Asymptote} code is to use the @code{latexmk} utility from
+@quotation
+@url{http://www.ctan.org/tex-archive/support/latexmk/}
+@end quotation
+@noindent
+after putting the rules
+@verbatiminclude latexmkrc
+@noindent
+in a file @code{latexmkrc} in the same directory. The command
@verbatim
-/bin/ls latexusage-*.asy | xargs --replace=% asy %
+latexmk -pdf latexusage
@end verbatim
+@noindent
+will then call @code{Asymptote} automatically, recompiling only the figures
+that have changed. Since each figure is compiled in a separate
+system process, this method also tends to use less memory.
@cindex @code{width}
@cindex @code{height}
@cindex @code{viewportwidth}
@cindex @code{viewportheight}
@cindex @code{attach}
+@cindex @code{inline}
One can specify @code{width}, @code{height},
-@code{viewportwidth}, @code{viewportheight}, and @code{attach}
+@code{viewportwidth}, @code{viewportheight}, @code{attach}, and @code{inline}.
@code{keyval}-style options to the @code{asy} environment.
-The current version of @code{asymptote.sty} supports the
-embedding of 3D @acronym{PRC} files, either inline or, using the
-@code{attach} option with the @code{attachfile2} (or older
-@code{attachfile}) @code{LaTeX} package,
-as annotated (but printable) attachments. For many applications, the
-annotated attachment method tends to be more convenient.
-The default value of @code{viewportwidth} is @code{\the\linewidth} for
-inline 3D figures and @code{0} for attachments.
-
-If the @code{inline} option is given to the
-@code{asymptote.sty} package, inline @code{LaTeX} code is generated instead of
-@acronym{EPS} or @acronym{PDF} files. This makes 2D LaTeX symbols visible to the
+Three-dimensional @acronym{PRC} files may either be embedded within
+the page (the default) or attached as annotated (but printable)
+attachments, using the @code{attach} option and the @code{attachfile2}
+(or older @code{attachfile}) @code{LaTeX} package. The default value
+of @code{viewportwidth} is @code{\the\linewidth} for inline 3D figures
+and @code{0} for attachments. The @code{inline} option generates
+inline @code{LaTeX} code instead of @acronym{EPS} or @acronym{PDF}
+files. This makes 2D LaTeX symbols visible to the
@code{\begin@{asy@}...\end@{asy@}} environment. In this mode,
Asymptote correctly aligns 2D LaTeX symbols defined outside of
@code{\begin@{asy@}...\end@{asy@}}, but treats their size as zero; an
optional second string can be given to @code{Label} to provide an
-estimate of the unknown label size.
-
-Note that if @code{latex} is used with the @code{inline} option,
-the labels might not show up in @acronym{DVI} viewers that cannot
-handle raw @code{PostScript} code. One can use @code{dvips}/@code{dvipdf} to
-produce @code{PostScript}/@acronym{PDF} output (we recommend using the
-modified version of @code{dvipdf} in the @code{Asymptote} patches
-directory, which accepts the @code{dvips -z} hyperdvi option).
+estimate of the unknown label size.
-An excellent tutorial by Dario Teixeira on integrating @code{Asymptote} and
-@code{LaTeX} is available at @url{http://dario.dse.nl/projects/asylatex/}.
+Note that if the @code{latex} @TeX{} engine is used with the
+@code{inline} option, labels might not show up in @acronym{DVI}
+viewers that cannot handle raw @code{PostScript} code. One can use
+@code{dvips}/@code{dvipdf} to produce @code{PostScript}/@acronym{PDF}
+output (we recommend using the modified version of @code{dvipdf} in
+the @code{Asymptote} patches directory, which accepts the @code{dvips -z}
+hyperdvi option).
Here now is @code{latexusage.tex}:
@verbatiminclude latexusage.tex
@@ -6404,16 +6412,10 @@ texhash
@end verbatim
@cindex @code{external}
-An example of embedding @code{U3D} code is provided in the file
-@code{embeddedu3d.asy}.
-As of version 7.0.8, @code{Adobe Reader} supports the @code{U3D} format
-under Linux.
-
-Unfortunately, Adobe has not yet made available an embedded movie plugin
-for the Linux version of @code{Adobe Reader}. A portable method for
-embedding movie files, which should work on any platform and does not require
-the @code{movie15} or @code{ifdraft} packages, is provided by using the
-@code{external} module instead of @code{embed}. An example of these
+A more portable method for embedding movie files, which should work on any
+platform and does not require the @code{movie15} or @code{ifdraft}
+packages, is provided by using the @code{external} module instead of
+@code{embed}. An example of these
interfaces is provided in the file @code{embeddedmovie.asy} and
@code{externalmovie.asy} in the @code{animations} subdirectory of the
examples directory. For a higher quality movie generated directly by
@@ -6421,6 +6423,10 @@ examples directory. For a higher quality movie generated directly by
@code{animate.sty} package to embed a portable @acronym{PDF} animation
(@pxref{animate}).
+@cindex @code{U3D}
+An example of embedding @code{U3D} code is provided in the file
+@code{embeddedu3d.asy}.
+
@node slide
@section @code{slide}
@cindex @code{slide}
@@ -9567,6 +9573,6 @@ Mark Henning, Steve Melenchuk, Martin Wiebusch, and Stefan Knorr.
@c LocalWords: singlereal singleint writeoverloaded dvisvg reddash lexorder
@c LocalWords: bigdiagonal autobillboard dvisvgm maxtiles hyperrefOptions
@c LocalWords: setpagesize pdfborder controlsystem OmitTickInterval SixViews
-@c LocalWords: OmitTickIntervals tickmodifiers autorotated SixViewsUS
+@c LocalWords: OmitTickIntervals tickmodifiers autorotated SixViewsUS latexmk
@c LocalWords: ThreeViewsUS ThreeViewsFR SixViewsFR ThreeViews partialsum
-@c LocalWords: defaultrender Vidiassov
+@c LocalWords: defaultrender Vidiassov latexmkrc
diff --git a/Build/source/utils/asymptote/doc/externalprc.tex b/Build/source/utils/asymptote/doc/externalprc.tex
index 96643d7cebf..e6d4ade1dcf 100644
--- a/Build/source/utils/asymptote/doc/externalprc.tex
+++ b/Build/source/utils/asymptote/doc/externalprc.tex
@@ -5,8 +5,8 @@
% asy -inlineimage teapot -render=4 -tex pdflatex
%
\documentclass[12pt]{article}
-\input teapot_.pre
+\input teapot.pre
\RequirePackage{color,graphicx}
\begin{document}
-\input teapot_.tex
+\input teapot.tex
\end{document}
diff --git a/Build/source/utils/asymptote/doc/extra/intro.asy b/Build/source/utils/asymptote/doc/extra/intro.asy
index 20b03c578dc..5d7ce12b184 100644
--- a/Build/source/utils/asymptote/doc/extra/intro.asy
+++ b/Build/source/utils/asymptote/doc/extra/intro.asy
@@ -352,13 +352,9 @@ item("Having prescribed outgoing and incoming path directions $e^{i\theta}$
at node~$z_0$ and $e^{i\phi}$ at node $z_1$ relative to the
vector $z_1-z_0$, the control points are determined as:");
-skip(-3);
-
equations("u&=&z_0+e^{i\theta}(z_1-z_0)f(\theta,-\phi),\nonumber\\
v&=&z_1-e^{i\phi}(z_1-z_0)f(-\phi,\theta),");
-skip(-3);
-
remark("where the relative distance function $f(\theta,\phi)$ is given by Hobby [1986].");
asyfigure("Hobbycontrol","height=9cm");
@@ -376,9 +372,13 @@ equation("\displaystyle x(t)=\sum_{k=0}^3 B_k(t) P_k, \qquad t\in [0,1].");
item("The resulting curve is also a B\'ezier curve:");
+skip(-2);
+
equations("x'_i(t)&=&\sum_{k=0}^3 B_k(t) A_{ij}(P_k)_j+C_i\nonumber\\
&=&\sum_{k=0}^3 B_k(t) P'_k,");
+skip(-2);
+
remark("where $P'_k$ is the transformed $k^{\rm th}$ control point, noting
$\displaystyle\sum_{k=0}^3 B_k(t)=1.$");
}
diff --git a/Build/source/utils/asymptote/doc/latexmkrc b/Build/source/utils/asymptote/doc/latexmkrc
new file mode 100644
index 00000000000..1cca8732e94
--- /dev/null
+++ b/Build/source/utils/asymptote/doc/latexmkrc
@@ -0,0 +1,4 @@
+sub asy {return system("asy '$_[0]'");}
+add_cus_dep("asy","eps",0,"asy");
+add_cus_dep("asy","pdf",0,"asy");
+add_cus_dep("asy","tex",0,"asy");
diff --git a/Build/source/utils/asymptote/doc/latexusage-1.asy b/Build/source/utils/asymptote/doc/latexusage-1.asy
deleted file mode 100644
index 7f0d6a2b3aa..00000000000
--- a/Build/source/utils/asymptote/doc/latexusage-1.asy
+++ /dev/null
@@ -1,55 +0,0 @@
-if(!settings.multipleView)
- settings.batchView=false;
-defaultfilename="latexusage-1";
-if(settings.render < 0) settings.render=4;
-settings.inlineimage=true;
-settings.embed=true;
-settings.outformat="";
-settings.toolbar=false;
-viewportmargin=(2,2);
-
-// Global Asymptote definitions can be put here.
-import three;
-usepackage("bm");
-texpreamble("\def\V#1{\bm{#1}}");
-// One can globally override the default toolbar settings here:
-// settings.toolbar=true;
-
-size(4cm,0);
-pen colour1=red;
-pen colour2=green;
-
-pair z0=(0,0);
-pair z1=(-1,0);
-pair z2=(1,0);
-real r=1.5;
-path c1=circle(z1,r);
-path c2=circle(z2,r);
-fill(c1,colour1);
-fill(c2,colour2);
-
-picture intersection=new picture;
-fill(intersection,c1,colour1+colour2);
-clip(intersection,c2);
-
-add(intersection);
-
-draw(c1);
-draw(c2);
-
-//draw("$\A$",box,z1); // Requires [inline] package option.
-//draw(Label("$\B$","$B$"),box,z2); // Requires [inline] package option.
-draw("$A$",box,z1);
-draw("$\V{B}$",box,z2);
-
-pair z=(0,-2);
-real m=3;
-margin BigMargin=Margin(0,m*dot(unit(z1-z),unit(z0-z)));
-
-draw(Label("$A\cap B$",0),conj(z)--z0,Arrow,BigMargin);
-draw(Label("$A\cup B$",0),z--z0,Arrow,BigMargin);
-draw(z--z1,Arrow,Margin(0,m));
-draw(z--z2,Arrow,Margin(0,m));
-
-shipout(bbox(0.25cm));
-viewportsize=(390.0pt,0);
diff --git a/Build/source/utils/asymptote/doc/latexusage-2.asy b/Build/source/utils/asymptote/doc/latexusage-2.asy
deleted file mode 100644
index b91be72419f..00000000000
--- a/Build/source/utils/asymptote/doc/latexusage-2.asy
+++ /dev/null
@@ -1,23 +0,0 @@
-if(!settings.multipleView)
- settings.batchView=false;
-defaultfilename="latexusage-2";
-if(settings.render < 0) settings.render=4;
-settings.inlineimage=true;
-settings.embed=true;
-settings.outformat="";
-settings.toolbar=false;
-viewportmargin=(2,2);
-
-// Global Asymptote definitions can be put here.
-import three;
-usepackage("bm");
-texpreamble("\def\V#1{\bm{#1}}");
-// One can globally override the default toolbar settings here:
-// settings.toolbar=true;
-
-
-currentprojection=orthographic(5,4,2);
-draw(unitcube,blue);
-label("$V-E+F=2$",(0,1,0.5),3Y,blue+fontsize(17pt));
-size(0,4cm);
-viewportsize=(390.0pt,0);
diff --git a/Build/source/utils/asymptote/doc/latexusage-3.asy b/Build/source/utils/asymptote/doc/latexusage-3.asy
deleted file mode 100644
index d3990c9cbfb..00000000000
--- a/Build/source/utils/asymptote/doc/latexusage-3.asy
+++ /dev/null
@@ -1,38 +0,0 @@
-if(!settings.multipleView)
- settings.batchView=false;
-defaultfilename="latexusage-3";
-if(settings.render < 0) settings.render=4;
-settings.inlineimage=true;
-settings.embed=true;
-settings.outformat="";
-settings.toolbar=false;
-viewportmargin=(2,2);
-
-// Global Asymptote definitions can be put here.
-import three;
-usepackage("bm");
-texpreamble("\def\V#1{\bm{#1}}");
-// One can globally override the default toolbar settings here:
-// settings.toolbar=true;
-
-
-pair z0=(0,0);
-pair z1=(2,0);
-pair z2=(5,0);
-pair zf=z1+0.75*(z2-z1);
-
-draw(z1--z2);
-dot(z1,red+0.15cm);
-dot(z2,darkgreen+0.3cm);
-label("$m$",z1,1.2N,red);
-label("$M$",z2,1.5N,darkgreen);
-label("$\hat{\ }$",zf,0.2*S,fontsize(24pt)+blue);
-
-pair s=-0.2*I;
-draw("$x$",z0+s--z1+s,N,red,Arrows,Bars,PenMargins);
-s=-0.5*I;
-draw("$\bar{x}$",z0+s--zf+s,blue,Arrows,Bars,PenMargins);
-s=-0.95*I;
-draw("$X$",z0+s--z2+s,darkgreen,Arrows,Bars,PenMargins);
-size(390.0pt,0);
-viewportsize=(390.0pt,0);
diff --git a/Build/source/utils/asymptote/doc/latexusage.pre b/Build/source/utils/asymptote/doc/latexusage.pre
new file mode 100644
index 00000000000..fd737b3a1e4
--- /dev/null
+++ b/Build/source/utils/asymptote/doc/latexusage.pre
@@ -0,0 +1,3 @@
+\AsyInput{latexusage-1.pre}
+\AsyInput{latexusage-2.pre}
+\AsyInput{latexusage-3.pre}
diff --git a/Build/source/utils/asymptote/doc/latexusage.tex b/Build/source/utils/asymptote/doc/latexusage.tex
index 6324238f1a2..ae555a476bd 100644
--- a/Build/source/utils/asymptote/doc/latexusage.tex
+++ b/Build/source/utils/asymptote/doc/latexusage.tex
@@ -3,13 +3,16 @@
% Use this form to include EPS (latex) or PDF (pdflatex) files:
\usepackage{asymptote}
-% Use this form with latex or pdflatex to include inline LaTeX code:
+% Use this form with latex or pdflatex to include inline LaTeX code by default:
%\usepackage[inline]{asymptote}
+% Use this form with latex or pdflatex to create PDF attachments by default:
+%\usepackage[attach]{asymptote}
+
% Enable this line to support PDF hyperlinks:
-%\usepackage{hyperref}\hypersetup{setpagesize=false}
+%\usepackage{hyperref}\hypersetup{setpagesize=false,unicode}
-% Enable this line for PDF attachments with asy environment option attach=true:
+% Enable this line to support the attach option:
%\usepackage[dvips]{attachfile2}
\begin{document}
@@ -76,11 +79,12 @@ shipout(bbox(0.25cm));
Each graph is drawn in its own environment. One can specify the width
and height to \LaTeX\ explicitly. This 3D example can be viewed
interactively either with Adobe Reader or Asymptote's fast OpenGL-based
-renderer. It is often desirable to embed such files as annotated attachments;
-this requires the optional \verb+\usepackage{attachfile2}+ package and
-the \verb+{attach=true}+ option:
+renderer. To support {\tt latexmk}, 3D figures should specify
+\verb+inline=true+. It is sometimes desirable to embed 3D files as annotated
+attachments; this requires the optional \verb+\usepackage{attachfile2}+
+package and the \verb+attach=true+ option:
\begin{center}
-\begin{asy}[height=4cm,attach=false]
+\begin{asy}[height=4cm,inline=true,attach=false]
currentprojection=orthographic(5,4,2);
draw(unitcube,blue);
label("$V-E+F=2$",(0,1,0.5),3Y,blue+fontsize(17pt));
@@ -89,7 +93,7 @@ label("$V-E+F=2$",(0,1,0.5),3Y,blue+fontsize(17pt));
One can also scale the figure to the full line width:
\begin{center}
-\begin{asy}[width=\the\linewidth]
+\begin{asy}[width=\the\linewidth,inline=true]
pair z0=(0,0);
pair z1=(2,0);
pair z2=(5,0);
diff --git a/Build/source/utils/asymptote/doc/png/asymptote.info b/Build/source/utils/asymptote/doc/png/asymptote.info
index af0f271a9d2..e72ff70242c 100644
--- a/Build/source/utils/asymptote/doc/png/asymptote.info
+++ b/Build/source/utils/asymptote/doc/png/asymptote.info
@@ -1,11 +1,11 @@
This is asymptote.info, produced by makeinfo version 4.13 from
../asymptote.texi.
-This file documents `Asymptote', version 2.01.
+This file documents `Asymptote', version 2.02.
`http://asymptote.sourceforge.net'
- Copyright (C) 2004-9 Andy Hammerlindl, John Bowman, and Tom Prince.
+ Copyright (C) 2004-10 Andy Hammerlindl, John Bowman, and Tom Prince.
Permission is granted to copy, distribute and/or modify this
document under the terms of the GNU Lesser General Public License
@@ -23,11 +23,11 @@ File: asymptote.info, Node: Top, Next: Description, Up: (dir)
Asymptote
*********
-This file documents `Asymptote', version 2.01.
+This file documents `Asymptote', version 2.02.
`http://asymptote.sourceforge.net'
- Copyright (C) 2004-9 Andy Hammerlindl, John Bowman, and Tom Prince.
+ Copyright (C) 2004-10 Andy Hammerlindl, John Bowman, and Tom Prince.
Permission is granted to copy, distribute and/or modify this
document under the terms of the GNU Lesser General Public License
@@ -499,7 +499,7 @@ used; if it is old we recommend first putting
in the `Asymptote' source directory.
If your graphics card supports multisampling, we recommend using version
-`2.6.0-rc1' (or later) of `freeglut' to support antialiasing in
+`2.6.0' (or later) of `freeglut' to support antialiasing in
`Asymptote''s adaptive `OpenGL' 3D renderer (`MacOS X' users can skip
this step since `Asymptote' is configured to use the native glut
library on that platform). Download
@@ -2325,7 +2325,7 @@ number, until it saturates with one or more color components equal to 1.
at the beginning of the file (this requires the `type1cm' package
available from
- `http://www.ctan.org/tex-archive/help/Catalogue/entries/type1cm'
+ `http://www.ctan.org/tex-archive/macros/latex/contrib/type1cm/'
and included in recent `LaTeX' distributions). The font size and
line skip of a pen can be examined with the routines `real
fontsize(pen p=currentpen)' and `real lineskip(pen p=currentpen)',
@@ -4642,60 +4642,66 @@ File: asymptote.info, Node: LaTeX usage, Next: Base modules, Prev: Programmin
***************
`Asymptote' comes with a convenient `LaTeX' style file `asymptote.sty'
-that makes `LaTeX' `Asymptote'-aware. Entering `Asymptote' code
-directly into the `LaTeX' source file, at the point where it is needed,
-keeps figures organized and avoids the need to invent new file names
-for each figure. Simply add the line `\usepackage{asymptote}' at the
-beginning of your file and enclose your `Asymptote' code within a
-`\begin{asy}...\end{asy}' environment. As with the `LaTeX' `comment'
-environment, the `\end{asy}' command must appear on a line by itself,
-with no leading spaces or trailing commands/comments.
+(version 1.15 or later) that makes `LaTeX' `Asymptote'-aware. Entering
+`Asymptote' code directly into the `LaTeX' source file, at the point
+where it is needed, keeps figures organized and avoids the need to
+invent new file names for each figure. Simply add the line
+`\usepackage{asymptote}' at the beginning of your file and enclose your
+`Asymptote' code within a `\begin{asy}...\end{asy}' environment. As
+with the `LaTeX' `comment' environment, the `\end{asy}' command must
+appear on a line by itself, with no leading spaces or trailing
+commands/comments.
The sample `LaTeX' file below, named `latexusage.tex', can be run as
follows:
latex latexusage
-asy latexusage
+asy latexusage-*.asy
latex latexusage
or
pdflatex latexusage
-asy latexusage
+asy latexusage-*.asy
pdflatex latexusage
+ To switch between using `latex' and `pdflatex' you may first need to
+remove the files `latexusage-*', `latexusage.pre', and `latexusage.aux'.
- To switch between using `latex' and `pdflatex' you may first need to
-remove the files `latexusage-*', `latexusage_.pre', and
-`latexusage.aux'. Version 1.13 of `Asymptote.sty' supports processing
-each figure separately: `asy latexusage' is equivalent to `asy
-latexusage-*.asy'. For example, one may wish to reduce memory usage by
-generating each figure in a separate `UNIX' process:
-/bin/ls latexusage-*.asy | xargs --replace=% asy %
+ An even better method for processing a `LaTeX' file with embedded
+`Asymptote' code is to use the `latexmk' utility from
+
+ `http://www.ctan.org/tex-archive/support/latexmk/'
+ after putting the rules
+
+sub asy {return system("asy '$_[0]'");}
+add_cus_dep("asy","eps",0,"asy");
+add_cus_dep("asy","pdf",0,"asy");
+add_cus_dep("asy","tex",0,"asy");
+in a file `latexmkrc' in the same directory. The command
+latexmk -pdf latexusage
+ will then call `Asymptote' automatically, recompiling only the figures
+that have changed. Since each figure is compiled in a separate system
+process, this method also tends to use less memory.
One can specify `width', `height', `viewportwidth',
-`viewportheight', and `attach' `keyval'-style options to the `asy'
-environment. The current version of `asymptote.sty' supports the
-embedding of 3D PRC files, either inline or, using the `attach' option
-with the `attachfile2' (or older `attachfile') `LaTeX' package, as
-annotated (but printable) attachments. For many applications, the
-annotated attachment method tends to be more convenient. The default
-value of `viewportwidth' is `\the\linewidth' for inline 3D figures and
-`0' for attachments.
-
- If the `inline' option is given to the `asymptote.sty' package,
-inline `LaTeX' code is generated instead of EPS or PDF files. This
-makes 2D LaTeX symbols visible to the `\begin{asy}...\end{asy}'
-environment. In this mode, Asymptote correctly aligns 2D LaTeX symbols
-defined outside of `\begin{asy}...\end{asy}', but treats their size as
-zero; an optional second string can be given to `Label' to provide an
-estimate of the unknown label size.
-
- Note that if `latex' is used with the `inline' option, the labels
-might not show up in DVI viewers that cannot handle raw `PostScript'
-code. One can use `dvips'/`dvipdf' to produce `PostScript'/PDF output
-(we recommend using the modified version of `dvipdf' in the `Asymptote'
-patches directory, which accepts the `dvips -z' hyperdvi option).
-
- An excellent tutorial by Dario Teixeira on integrating `Asymptote'
-and `LaTeX' is available at `http://dario.dse.nl/projects/asylatex/'.
+`viewportheight', `attach', and `inline'. `keyval'-style options to
+the `asy' environment. Three-dimensional PRC files may either be
+embedded within the page (the default) or attached as annotated (but
+printable) attachments, using the `attach' option and the `attachfile2'
+(or older `attachfile') `LaTeX' package. The default value of
+`viewportwidth' is `\the\linewidth' for inline 3D figures and `0' for
+attachments. The `inline' option generates inline `LaTeX' code instead
+of EPS or PDF files. This makes 2D LaTeX symbols visible to the
+`\begin{asy}...\end{asy}' environment. In this mode, Asymptote
+correctly aligns 2D LaTeX symbols defined outside of
+`\begin{asy}...\end{asy}', but treats their size as zero; an optional
+second string can be given to `Label' to provide an estimate of the
+unknown label size.
+
+ Note that if the `latex' TeX engine is used with the `inline'
+option, labels might not show up in DVI viewers that cannot handle raw
+`PostScript' code. One can use `dvips'/`dvipdf' to produce
+`PostScript'/PDF output (we recommend using the modified version of
+`dvipdf' in the `Asymptote' patches directory, which accepts the `dvips
+-z' hyperdvi option).
Here now is `latexusage.tex':
@@ -4704,13 +4710,16 @@ and `LaTeX' is available at `http://dario.dse.nl/projects/asylatex/'.
% Use this form to include EPS (latex) or PDF (pdflatex) files:
\usepackage{asymptote}
-% Use this form with latex or pdflatex to include inline LaTeX code:
+% Use this form with latex or pdflatex to include inline LaTeX code by default:
%\usepackage[inline]{asymptote}
+% Use this form with latex or pdflatex to create PDF attachments by default:
+%\usepackage[attach]{asymptote}
+
% Enable this line to support PDF hyperlinks:
-%\usepackage{hyperref}\hypersetup{setpagesize=false}
+%\usepackage{hyperref}\hypersetup{setpagesize=false,unicode}
-% Enable this line for PDF attachments with asy environment option attach=true:
+% Enable this line to support the attach option:
%\usepackage[dvips]{attachfile2}
\begin{document}
@@ -4777,11 +4786,12 @@ shipout(bbox(0.25cm));
Each graph is drawn in its own environment. One can specify the width
and height to \LaTeX\ explicitly. This 3D example can be viewed
interactively either with Adobe Reader or Asymptote's fast OpenGL-based
-renderer. It is often desirable to embed such files as annotated attachments;
-this requires the optional \verb+\usepackage{attachfile2}+ package and
-the \verb+{attach=true}+ option:
+renderer. To support {\tt latexmk}, 3D figures should specify
+\verb+inline=true+. It is sometimes desirable to embed 3D files as annotated
+attachments; this requires the optional \verb+\usepackage{attachfile2}+
+package and the \verb+attach=true+ option:
\begin{center}
-\begin{asy}[height=4cm,attach=false]
+\begin{asy}[height=4cm,inline=true,attach=false]
currentprojection=orthographic(5,4,2);
draw(unitcube,blue);
label("$V-E+F=2$",(0,1,0.5),3Y,blue+fontsize(17pt));
@@ -4790,7 +4800,7 @@ label("$V-E+F=2$",(0,1,0.5),3Y,blue+fontsize(17pt));
One can also scale the figure to the full line width:
\begin{center}
-\begin{asy}[width=\the\linewidth]
+\begin{asy}[width=\the\linewidth,inline=true]
pair z0=(0,0);
pair z1=(2,0);
pair z2=(5,0);
@@ -5201,20 +5211,18 @@ directory the commands:
tex ifdraft.dtx
texhash
+ A more portable method for embedding movie files, which should work
+on any platform and does not require the `movie15' or `ifdraft'
+packages, is provided by using the `external' module instead of
+`embed'. An example of these interfaces is provided in the file
+`embeddedmovie.asy' and `externalmovie.asy' in the `animations'
+subdirectory of the examples directory. For a higher quality movie
+generated directly by `Asymptote', use the `animate' module along with
+the `animate.sty' package to embed a portable PDF animation (*note
+animate::).
+
An example of embedding `U3D' code is provided in the file
-`embeddedu3d.asy'. As of version 7.0.8, `Adobe Reader' supports the
-`U3D' format under Linux.
-
- Unfortunately, Adobe has not yet made available an embedded movie
-plugin for the Linux version of `Adobe Reader'. A portable method for
-embedding movie files, which should work on any platform and does not
-require the `movie15' or `ifdraft' packages, is provided by using the
-`external' module instead of `embed'. An example of these interfaces is
-provided in the file `embeddedmovie.asy' and `externalmovie.asy' in the
-`animations' subdirectory of the examples directory. For a higher
-quality movie generated directly by `Asymptote', use the `animate'
-module along with the `animate.sty' package to embed a portable PDF
-animation (*note animate::).
+`embeddedu3d.asy'.

File: asymptote.info, Node: slide, Next: MetaPost, Prev: embed, Up: Base modules
@@ -8528,7 +8536,7 @@ Index
(line 6)
* atleast: Bezier curves. (line 56)
* attach <1>: graph. (line 415)
-* attach: LaTeX usage. (line 35)
+* attach: LaTeX usage. (line 46)
* autoadjust: three. (line 354)
* autoimport: Options. (line 110)
* automatic scaling: graph. (line 682)
@@ -8942,7 +8950,7 @@ Index
* guide: Paths and guides. (line 300)
* guide3: three. (line 6)
* hatch: Pens. (line 267)
-* height: LaTeX usage. (line 35)
+* height: LaTeX usage. (line 46)
* help <1>: Debugger. (line 30)
* help <2>: Help. (line 6)
* help: Interactive mode. (line 44)
@@ -8992,6 +9000,7 @@ Index
* initialized: Arrays. (line 39)
* initializers: Variable initializers.
(line 6)
+* inline: LaTeX usage. (line 46)
* InOutTicks: graph3. (line 34)
* input <1>: Interactive mode. (line 48)
* input: Files. (line 11)
@@ -9054,6 +9063,7 @@ Index
* latex: Options. (line 142)
* LaTeX fonts: Pens. (line 192)
* LaTeX usage: LaTeX usage. (line 6)
+* latexmk: LaTeX usage. (line 30)
* latin1: latin1. (line 6)
* latitude: Data types. (line 134)
* latticeshade: fill. (line 32)
@@ -9572,6 +9582,7 @@ Index
* type1cm: Pens. (line 178)
* typedef <1>: Functions. (line 36)
* typedef: Data types. (line 344)
+* U3D: embed. (line 38)
* undefined: Paths and guides. (line 268)
* UnFill: Frames and pictures. (line 152)
* unfill: fill. (line 106)
@@ -9612,10 +9623,10 @@ Index
* verbatim: Frames and pictures. (line 271)
* vertex-dependent colors: three. (line 81)
* Vertical: flowchart. (line 81)
-* viewportheight: LaTeX usage. (line 35)
+* viewportheight: LaTeX usage. (line 46)
* viewportmargin: three. (line 262)
* viewportsize: three. (line 262)
-* viewportwidth: LaTeX usage. (line 35)
+* viewportwidth: LaTeX usage. (line 46)
* views: three. (line 231)
* vim: Editing modes. (line 33)
* virtual functions: Structures. (line 181)
@@ -9626,7 +9637,7 @@ Index
* wheel mouse: GUI. (line 6)
* while: Programming. (line 29)
* white-space string delimiter mode: Arrays. (line 359)
-* width: LaTeX usage. (line 35)
+* width: LaTeX usage. (line 46)
* windingnumber: Paths and guides. (line 268)
* word: Arrays. (line 359)
* write <1>: Arrays. (line 399)
@@ -9696,146 +9707,146 @@ Index

Tag Table:
-Node: Top574
-Node: Description6832
-Node: Installation10333
-Node: UNIX binary distributions11386
-Node: MacOS X binary distributions12492
-Node: Microsoft Windows13376
-Ref: psview14086
-Node: Configuring15007
-Node: Search paths19228
-Node: Compiling from UNIX source20025
-Ref: multisampling20614
-Node: Editing modes23024
-Node: Subversion25456
-Node: Uninstall25919
-Node: Tutorial26269
-Ref: unitcircle30495
-Node: Drawing commands32431
-Node: draw34142
-Ref: arrows35290
-Node: fill40533
-Ref: gradient shading41577
-Node: clip45805
-Node: label46397
-Ref: Label47096
-Node: Bezier curves52821
-Node: Programming56398
-Ref: array iteration57212
-Node: Data types58293
-Ref: format67301
-Node: Paths and guides70904
-Ref: circle71158
-Ref: arctime76646
-Ref: extension80501
-Node: Pens87184
-Ref: fillrule94550
-Ref: basealign95447
-Ref: transparency98274
-Ref: makepen101717
-Ref: overwrite102555
-Node: Transforms103765
-Node: Frames and pictures105556
-Ref: envelope106697
-Ref: size107780
-Ref: unitsize108767
-Ref: shipout109827
-Ref: filltype112160
-Ref: add115297
-Ref: add about116243
-Ref: tex119181
-Node: Files120055
-Ref: cd121020
-Ref: scroll125452
-Node: Variable initializers128525
-Node: Structures131250
-Node: Operators138694
-Node: Arithmetic & logical139008
-Node: Self & prefix operators140982
-Node: User-defined operators141770
-Node: Implicit scaling142681
-Node: Functions143244
-Ref: stack overflow145997
-Node: Default arguments146561
-Node: Named arguments147300
-Node: Rest arguments149462
-Node: Mathematical functions152272
-Node: Arrays156879
-Ref: sort163929
-Ref: tridiagonal166333
-Ref: solve167561
-Node: Slices171754
-Node: Casts175644
-Node: Import177609
-Node: Static182836
-Node: LaTeX usage185730
-Node: Base modules191468
-Node: plain193968
-Node: simplex194620
-Node: math194893
-Node: interpolate197598
-Node: geometry197877
-Node: trembling198471
-Node: stats198822
-Node: patterns199082
-Node: markers199318
-Node: tree201101
-Node: binarytree201289
-Node: drawtree201878
-Node: syzygy202082
-Node: feynman202356
-Node: roundedpath202631
-Node: animation202914
-Ref: animate203331
-Node: embed204470
-Node: slide206259
-Node: MetaPost206599
-Node: unicode207315
-Node: latin1208203
-Node: babel208571
-Node: labelpath208800
-Node: labelpath3209620
-Node: annotate209931
-Node: CAD210402
-Node: graph210712
-Ref: ticks217841
-Ref: pathmarkers231120
-Ref: marker231585
-Ref: markuniform231936
-Ref: errorbars233727
-Ref: automatic scaling237783
-Node: palette248429
-Ref: images248547
-Ref: image252718
-Ref: logimage253196
-Ref: penimage254002
-Node: three254446
-Ref: PostScript3D278988
-Node: obj280680
-Node: graph3280932
-Ref: GaussianSurface286057
-Node: grid3287161
-Node: solids287901
-Node: tube288849
-Node: flowchart291084
-Node: contour295653
-Node: contour3300778
-Node: slopefield301085
-Node: ode302522
-Node: Options302782
-Ref: configuration file308627
-Ref: settings308627
-Ref: convert309828
-Node: Interactive mode312795
-Ref: history314948
-Node: GUI316253
-Node: GUI installation316756
-Node: GUI usage317886
-Node: PostScript to Asymptote318789
-Node: Help319545
-Node: Debugger321281
-Node: Credits323066
-Node: Index323998
+Node: Top575
+Node: Description6834
+Node: Installation10335
+Node: UNIX binary distributions11388
+Node: MacOS X binary distributions12494
+Node: Microsoft Windows13378
+Ref: psview14088
+Node: Configuring15009
+Node: Search paths19230
+Node: Compiling from UNIX source20027
+Ref: multisampling20616
+Node: Editing modes23022
+Node: Subversion25454
+Node: Uninstall25917
+Node: Tutorial26267
+Ref: unitcircle30493
+Node: Drawing commands32429
+Node: draw34140
+Ref: arrows35288
+Node: fill40531
+Ref: gradient shading41575
+Node: clip45803
+Node: label46395
+Ref: Label47094
+Node: Bezier curves52819
+Node: Programming56396
+Ref: array iteration57210
+Node: Data types58291
+Ref: format67299
+Node: Paths and guides70902
+Ref: circle71156
+Ref: arctime76644
+Ref: extension80499
+Node: Pens87182
+Ref: fillrule94548
+Ref: basealign95445
+Ref: transparency98271
+Ref: makepen101714
+Ref: overwrite102552
+Node: Transforms103762
+Node: Frames and pictures105553
+Ref: envelope106694
+Ref: size107777
+Ref: unitsize108764
+Ref: shipout109824
+Ref: filltype112157
+Ref: add115294
+Ref: add about116240
+Ref: tex119178
+Node: Files120052
+Ref: cd121017
+Ref: scroll125449
+Node: Variable initializers128522
+Node: Structures131247
+Node: Operators138691
+Node: Arithmetic & logical139005
+Node: Self & prefix operators140979
+Node: User-defined operators141767
+Node: Implicit scaling142678
+Node: Functions143241
+Ref: stack overflow145994
+Node: Default arguments146558
+Node: Named arguments147297
+Node: Rest arguments149459
+Node: Mathematical functions152269
+Node: Arrays156876
+Ref: sort163926
+Ref: tridiagonal166330
+Ref: solve167558
+Node: Slices171751
+Node: Casts175641
+Node: Import177606
+Node: Static182833
+Node: LaTeX usage185727
+Node: Base modules191768
+Node: plain194268
+Node: simplex194920
+Node: math195193
+Node: interpolate197898
+Node: geometry198177
+Node: trembling198771
+Node: stats199122
+Node: patterns199382
+Node: markers199618
+Node: tree201401
+Node: binarytree201589
+Node: drawtree202178
+Node: syzygy202382
+Node: feynman202656
+Node: roundedpath202931
+Node: animation203214
+Ref: animate203631
+Node: embed204770
+Node: slide206373
+Node: MetaPost206713
+Node: unicode207429
+Node: latin1208317
+Node: babel208685
+Node: labelpath208914
+Node: labelpath3209734
+Node: annotate210045
+Node: CAD210516
+Node: graph210826
+Ref: ticks217955
+Ref: pathmarkers231234
+Ref: marker231699
+Ref: markuniform232050
+Ref: errorbars233841
+Ref: automatic scaling237897
+Node: palette248543
+Ref: images248661
+Ref: image252832
+Ref: logimage253310
+Ref: penimage254116
+Node: three254560
+Ref: PostScript3D279102
+Node: obj280794
+Node: graph3281046
+Ref: GaussianSurface286171
+Node: grid3287275
+Node: solids288015
+Node: tube288963
+Node: flowchart291198
+Node: contour295767
+Node: contour3300892
+Node: slopefield301199
+Node: ode302636
+Node: Options302896
+Ref: configuration file308741
+Ref: settings308741
+Ref: convert309942
+Node: Interactive mode312909
+Ref: history315062
+Node: GUI316367
+Node: GUI installation316870
+Node: GUI usage318000
+Node: PostScript to Asymptote318903
+Node: Help319659
+Node: Debugger321395
+Node: Credits323180
+Node: Index324112

End Tag Table
diff --git a/Build/source/utils/asymptote/drawlabel.cc b/Build/source/utils/asymptote/drawlabel.cc
index 9b9a20ef1af..484ecf3cb89 100644
--- a/Build/source/utils/asymptote/drawlabel.cc
+++ b/Build/source/utils/asymptote/drawlabel.cc
@@ -243,7 +243,7 @@ bool drawLabel::write(texfile *out, const bbox&)
drawElement *drawLabel::transformed(const transform& t)
{
return new drawLabel(label,size,t*T,t*position,
- length(align)*unit(rotation(t)*align),pentype);
+ length(align)*unit(shiftless(t)*align),pentype);
}
void drawLabelPath::bounds(bbox& b, iopipestream& tex, boxvector&, bboxlist&)
diff --git a/Build/source/utils/asymptote/entry.cc b/Build/source/utils/asymptote/entry.cc
index 325438f48d3..d133571f136 100644
--- a/Build/source/utils/asymptote/entry.cc
+++ b/Build/source/utils/asymptote/entry.cc
@@ -10,10 +10,12 @@
#include <iostream>
#include <cmath>
+#include <cstring>
#include <utility>
#include "entry.h"
#include "coder.h"
+using std::memset;
using types::ty;
using types::signature;
using types::overloaded;
@@ -121,7 +123,7 @@ bool tenv::add(symbol src, symbol dest,
return false;
}
-#ifdef NOHASH //{{{
+#if 0 //{{{
/*NOHASH*/ void venv::add(venv& source, varEntry *qualifier, coder &c)
/*NOHASH*/ {
/*NOHASH*/ // Enter each distinct (unshadowed) name,type pair.
@@ -205,38 +207,283 @@ bool tenv::add(symbol src, symbol dest,
// }}}
#else
-ostream& operator<< (ostream& out, const venv::key &k) {
- if(k.special)
- k.u.t->printVar(out, k.name);
- else {
- out << k.name;
- if (k.u.sig)
- out << *k.u.sig;
+// To avoid writing qualifiers everywhere.
+typedef core_venv::cell cell;
+
+void core_venv::initTable(size_t capacity) {
+ // Assert that capacity is a power of two.
+ assert((capacity & (capacity-1)) == 0);
+
+ this->capacity = capacity;
+ size = 0;
+ mask = capacity - 1;
+ table = new (UseGC) cell[capacity];
+ memset(table, 0, sizeof(cell) * capacity);
+}
+
+void core_venv::clear() {
+ if (size != 0) {
+ memset(table, 0, sizeof(cell) * capacity);
+ size = 0;
}
- return out;
}
-#if TEST_COLLISION
-bool venv::keyeq::operator()(const key k, const key l) const {
- keyhash kh;
- if (kh(k)==kh(l)) {
- if (base(k,l))
- return true;
- else {
- cerr << "collision: " << endl;
- cerr << " " << k << " -> " << kh(k) << endl;
- cerr << " " << l << " -> " << kh(l) << endl;
+void core_venv::resize() {
+ size_t oldCapacity = capacity;
+ size_t oldSize = size;
+ cell *oldTable = table;
+
+ initTable(capacity * 4);
+
+ for (size_t i = 0; i < oldCapacity; ++i) {
+ cell& b = oldTable[i];
+ if (!b.empty() && !b.isATomb()) {
+ varEntry *old = store(b.name, b.ent);
+
+ // We should not be shadowing anything when reconstructing the table.
+ DEBUG_CACHE_ASSERT(old == 0);
}
}
- return false;
+
+ assert(size == oldSize);
+
+#if DEBUG_CACHE
+ confirm_size();
+
+ for (size_t i = 0; i < oldCapacity; ++i) {
+ cell& b = oldTable[i];
+ if (!b.empty() && !b.isATomb()) {
+ assert(lookup(b.name, b.ent->getType()) == b.ent);
+ }
+ }
+#endif
+
+ //cout << "resized from " << oldCapacity << " to " << capacity << endl;
}
-#else
-bool venv::keyeq::operator()(const key k, const key l) const {
- return k.name==l.name &&
- (k.special ? equivalent(k.u.t, l.u.t) :
- equivalent(k.u.sig, l.u.sig));
+
+cell& core_venv::cellByIndex(size_t i) {
+ return table[i & mask];
+}
+
+const cell& core_venv::cellByIndex(size_t i) const {
+ return table[i & mask];
+}
+
+void core_venv::confirm_size() {
+ size_t sum = 0;
+ for (size_t i = 0; i < capacity; ++i) {
+ cell& b = table[i];
+ if (!b.empty() && !b.isATomb())
+ ++sum;
+ }
+ assert(sum == size);
+}
+
+varEntry *core_venv::storeNew(cell& cell, symbol name, varEntry *ent) {
+ // Store the value into the cell.
+ cell.storeNew(name, ent);
+
+ // We now have a new entry. Update the size.
+ ++size;
+
+ // Check if the hash table has grown too big and needs to be expanded.
+ if (2*size > capacity)
+ resize();
+
+ // Nothing is shadowed.
+ return 0;
+}
+
+
+varEntry *core_venv::storeNonSpecialAfterTomb(size_t tombIndex,
+ symbol name, varEntry *ent) {
+ DEBUG_CACHE_ASSERT(name.notSpecial());
+ DEBUG_CACHE_ASSERT(ent);
+ DEBUG_CACHE_ASSERT(ent->getType());
+
+ signature *sig = ent->getSignature();
+
+ for (size_t i = tombIndex+1; ; ++i)
+ {
+ cell& b = cellByIndex(i);
+
+ if (b.empty())
+ return storeNew(cellByIndex(tombIndex), name, ent);
+
+ if (b.matches(name, sig))
+ return b.replaceWith(name, ent);
+ }
+}
+
+varEntry *core_venv::storeSpecialAfterTomb(size_t tombIndex,
+ symbol name, varEntry *ent) {
+ DEBUG_CACHE_ASSERT(name.special());
+ DEBUG_CACHE_ASSERT(ent);
+ DEBUG_CACHE_ASSERT(ent->getType());
+
+ ty *t = ent->getType();
+
+ for (size_t i = tombIndex+1; ; ++i)
+ {
+ cell& b = cellByIndex(i);
+
+ if (b.empty())
+ return storeNew(cellByIndex(tombIndex), name, ent);
+
+ if (b.matches(name, t))
+ return b.replaceWith(name, ent);
+ }
+}
+
+size_t hashSig(const signature *sig) {
+ return sig ? sig->hash() : 0;
+}
+size_t nonSpecialHash(symbol name, const signature *sig) {
+ return name.hash() * 107 + hashSig(sig);
+}
+size_t nonSpecialHash(symbol name, const ty *t) {
+ DEBUG_CACHE_ASSERT(t);
+ return nonSpecialHash(name, t->getSignature());
+}
+size_t specialHash(symbol name, const ty *t) {
+ DEBUG_CACHE_ASSERT(t);
+ return name.hash() * 107 + t->hash();
+}
+
+varEntry *core_venv::storeNonSpecial(symbol name, varEntry *ent) {
+ DEBUG_CACHE_ASSERT(name.notSpecial());
+ DEBUG_CACHE_ASSERT(ent);
+ DEBUG_CACHE_ASSERT(ent->getType());
+
+ signature *sig = ent->getSignature();
+
+ for (size_t i = nonSpecialHash(name, sig); ; ++i)
+ {
+ cell& b = cellByIndex(i);
+
+ if (b.empty())
+ return storeNew(b, name, ent);
+
+ if (b.matches(name, sig))
+ return b.replaceWith(name, ent);
+
+ if (b.isATomb())
+ return storeNonSpecialAfterTomb(i, name, ent);
+ }
+}
+
+varEntry *core_venv::storeSpecial(symbol name, varEntry *ent) {
+ DEBUG_CACHE_ASSERT(name.special());
+ DEBUG_CACHE_ASSERT(ent);
+ DEBUG_CACHE_ASSERT(ent->getType());
+
+ ty *t = ent->getType();
+
+ for (size_t i = specialHash(name, t); ; ++i)
+ {
+ cell& b = cellByIndex(i);
+
+ if (b.empty())
+ return storeNew(b, name, ent);
+
+ if (b.matches(name, t))
+ return b.replaceWith(name, ent);
+
+ if (b.isATomb())
+ return storeSpecialAfterTomb(i, name, ent);
+ }
+}
+
+varEntry *core_venv::store(symbol name, varEntry *ent) {
+ DEBUG_CACHE_ASSERT(ent);
+ DEBUG_CACHE_ASSERT(ent->getType());
+
+ return name.special() ? storeSpecial(name, ent) :
+ storeNonSpecial(name, ent);
+}
+
+varEntry *core_venv::lookupSpecial(symbol name, const ty *t) {
+ DEBUG_CACHE_ASSERT(name.special());
+ DEBUG_CACHE_ASSERT(t);
+
+ for (size_t i = specialHash(name, t); ; ++i)
+ {
+ cell& b = cellByIndex(i);
+
+ if (b.matches(name, t))
+ return b.ent;
+
+ if (b.empty())
+ return 0;
+ }
+}
+
+varEntry *core_venv::lookupNonSpecial(symbol name, const signature *sig) {
+ DEBUG_CACHE_ASSERT(name.notSpecial());
+
+ for (size_t i = nonSpecialHash(name, sig); ; ++i)
+ {
+ cell& b = cellByIndex(i);
+
+ if (b.matches(name, sig))
+ return b.ent;
+
+ if (b.empty())
+ return 0;
+ }
+}
+
+varEntry *core_venv::lookup(symbol name, const ty *t) {
+ DEBUG_CACHE_ASSERT(t);
+
+ return name.special() ? lookupSpecial(name, t) :
+ lookupNonSpecial(name, t->getSignature());
+}
+
+void core_venv::removeNonSpecial(symbol name, const signature *sig) {
+ DEBUG_CACHE_ASSERT(name.notSpecial());
+
+ for (size_t i = nonSpecialHash(name, sig); ; ++i)
+ {
+ cell& b = cellByIndex(i);
+
+ if (b.matches(name, sig)) {
+ b.remove();
+ --size;
+ return;
+ }
+
+ DEBUG_CACHE_ASSERT(!b.empty());
+ }
}
-#endif
+
+void core_venv::removeSpecial(symbol name, const ty *t) {
+ DEBUG_CACHE_ASSERT(name.special());
+ DEBUG_CACHE_ASSERT(t);
+
+ for (size_t i = specialHash(name, t); ; ++i)
+ {
+ cell& b = cellByIndex(i);
+
+ if (b.matches(name, t)) {
+ b.remove();
+ --size;
+ return;
+ }
+
+ DEBUG_CACHE_ASSERT(!b.empty());
+ }
+}
+
+void core_venv::remove(symbol name, const ty *t) {
+ DEBUG_CACHE_ASSERT(t);
+
+ if (name.special())
+ removeSpecial(name, t);
+ else
+ removeNonSpecial(name, t->getSignature());
+}
+
#ifdef CALLEE_SEARCH
size_t numFormals(ty *t) {
@@ -247,7 +494,10 @@ size_t numFormals(ty *t) {
void venv::checkName(symbol name)
{
- // TODO: test maxFormals
+#if 0
+ // This size test is too slow, even for DEBUG_CACHE.
+ core.confirm_size();
+#endif
// Get the type, and make it overloaded if it is not (for uniformity).
overloaded o;
@@ -260,8 +510,11 @@ void venv::checkName(symbol name)
}
assert(t->isOverloaded());
+ size_t maxFormals = names[name].maxFormals;
+
size_t size = 0;
for (ty_iterator i = t->begin(); i != t->end(); ++i) {
+ assert(numFormals(*i) <= maxFormals);
varEntry *v = lookByType(name, *i);
assert(v);
assert(equivalent(v->getType(), *i));
@@ -269,11 +522,12 @@ void venv::checkName(symbol name)
}
size_t matches = 0;
- for (keymap::iterator p = all.begin(); p != all.end(); ++p) {
- if (p->first.name == name) {
+ core_venv::const_iterator end = core.end();
+ for (core_venv::const_iterator p = core.begin(); p != end; ++p) {
+ if (p->name == name) {
++matches;
- varEntry *v=p->second.v;
+ varEntry *v=p->ent;
assert(v);
assert(equivalent(t, v->getType()));
}
@@ -334,6 +588,8 @@ void venv::namevalue::replaceType(ty *new_t, ty *old_t) {
assert(t != 0);
RIGHTKIND(t);
#endif
+
+ // TODO: Test for equivalence.
if (t->isOverloaded()) {
for (ty_iterator i = t->begin(); i != t->end(); ++i) {
@@ -399,33 +655,34 @@ void venv::namevalue::popType()
}
void venv::remove(const addition& a) {
- CHECKNAME(a.k.name);
+ CHECKNAME(a.name);
- value &val=all[a.k];
+ if (a.shadowed) {
+ varEntry *popEnt = core.store(a.name, a.shadowed);
-#ifdef DEBUG_CACHE
- assert(val);
-#endif
+ DEBUG_CACHE_ASSERT(popEnt);
- if (a.shadowed) {
// Unshadow the previously shadowed varEntry.
- names[a.k.name].replaceType(a.shadowed->getType(), val.v->getType());
- val.v = a.shadowed;
- } else {
+ names[a.name].replaceType(a.shadowed->getType(), popEnt->getType());
+ }
+ else {
// Remove the (name,sig) key completely.
#if DEBUG_CACHE
- names[a.k.name].popType(val.v->getType());
+ varEntry *popEnt = core.lookup(a.name, a.t);
+ assert(popEnt);
+ names[a.name].popType(popEnt->getType());
#else
- names[a.k.name].popType();
+ names[a.name].popType();
#endif
- all.erase(a.k);
+
+ core.remove(a.name, a.t);
}
- CHECKNAME(a.k.name);
+ CHECKNAME(a.name);
}
void venv::beginScope() {
- if (all.empty()) {
+ if (core.empty()) {
assert(scopesizes.empty());
++empty_scopes;
} else {
@@ -437,7 +694,7 @@ void venv::endScope() {
if (scopesizes.empty()) {
// The corresponding beginScope happened when the venv was empty, so
// clear the hash tables to return to that state.
- all.clear();
+ core.clear();
names.clear();
assert(empty_scopes > 0);
@@ -461,6 +718,9 @@ void venv::collapseScope() {
assert(empty_scopes > 0);
--empty_scopes;
} else {
+ // As scopes are stored solely by the number of entries at the beginning
+ // of the scope, popping the top size will put all of the entries into the
+ // next scope down.
scopesizes.pop();
}
}
@@ -470,30 +730,24 @@ void venv::enter(symbol name, varEntry *v)
{
CHECKNAME(name);
- key k(name, v);
+ // Store the new variable. If it shadows an older variable, that varEntry
+ // will be returned.
+ varEntry *shadowed = core.store(name, v);
- value &slot=all[k];
- if (slot.v) {
+ ty *t = v->getType();
+
+ // Record the addition, so it can be undone during endScope.
+ if (!scopesizes.empty())
+ additions.push(addition(name, t, shadowed));
+
+ if (shadowed)
// The new value shadows an old value. They have the same signature, but
// possibly different return types. If necessary, update the type stored
// by name.
- names[name].replaceType(v->getType(), slot.v->getType());
-
- // Replace the old value, but store its now-shadowed varEntry.
- if (!scopesizes.empty())
- additions.push(addition(k, slot.v));
-
- slot.v = v;
-
- } else {
+ names[name].replaceType(t, shadowed->getType());
+ else
// Add to the names hash table.
- names[name].addType(v->getType());
-
- if (!scopesizes.empty())
- additions.push(addition(k, 0));
-
- slot.v=v;
- }
+ names[name].addType(t);
CHECKNAME(name);
}
@@ -502,58 +756,41 @@ void venv::enter(symbol name, varEntry *v)
varEntry *venv::lookBySignature(symbol name, signature *sig) {
#ifdef CALLEE_SEARCH
// Rest arguments are complicated and rare. Don't handle them here.
- if (sig->hasRest()) {
-#if 0
- if (lookByType(key(name, sig)))
- cout << "FAIL BY REST ARG" << endl;
- else
- cout << "FAIL BY REST ARG AND NO-MATCH" << endl;
-#endif
+ if (sig->hasRest())
return 0;
- }
// Likewise with the special operators.
- if (name.special()) {
- //cout << "FAIL BY SPECIAL" << endl;
+ if (name.special())
return 0;
- }
namevalue& nv = names[name];
// Avoid ambiguities with default parameters.
- if (nv.maxFormals != sig->getNumFormals()) {
-#if 0
- if (lookByType(key(name, sig)))
- cout << "FAIL BY NUMARGS" << endl;
- else
- cout << "FAIL BY NUMARGS AND NO-MATCH" << endl;
-#endif
+ if (nv.maxFormals != sig->getNumFormals())
return 0;
- }
// At this point, any function with an equivalent an signature will be equal
// to the result of the normal overloaded function resolution. We may
// safely return it.
- varEntry *result = lookByType(key(name, sig));
-#if 0
- if (!result) {
- cout << "FAIL BY NO-MATCH" << endl;
- }
-#endif
- return result;
+ return core.lookupNonSpecial(name, sig);
+
#else
- // The maxFormals field is necessary for this optimization.
+ // If the optimization is disabled, always return 0.
return 0;
#endif
}
void venv::add(venv& source, varEntry *qualifier, coder &c)
{
- // Enter each distinct (unshadowed) name,type pair.
- for(keymap::iterator p = source.all.begin(); p != source.all.end(); ++p) {
- varEntry *v=p->second.v;
- if (v->checkPerm(READ, c))
- enter(p->first.name, qualifyVarEntry(qualifier, v));
+ core_venv::const_iterator end = source.core.end();
+ for (core_venv::const_iterator p = source.core.begin(); p != end; ++p)
+ {
+ DEBUG_CACHE_ASSERT(p->filled());
+
+ varEntry *v=p->ent;
+ if (v->checkPerm(READ, c)) {
+ enter(p->name, qualifyVarEntry(qualifier, v));
+ }
}
}
@@ -561,11 +798,14 @@ bool venv::add(symbol src, symbol dest,
venv& source, varEntry *qualifier, coder &c)
{
ty *t=source.getType(src);
+
if (!t)
return false;
- else if (t->isOverloaded()) {
+
+ if (t->isOverloaded()) {
bool added=false;
- for (ty_iterator i = t->begin(); i != t->end(); ++i) {
+ for (ty_iterator i = t->begin(); i != t->end(); ++i)
+ {
varEntry *v=source.lookByType(src, *i);
if (v->checkPerm(READ, c)) {
enter(dest, qualifyVarEntry(qualifier, v));
@@ -573,7 +813,8 @@ bool venv::add(symbol src, symbol dest,
}
}
return added;
- } else {
+ }
+ else {
varEntry *v=source.lookByType(src, t);
if (v->checkPerm(READ, c)) {
enter(dest, qualifyVarEntry(qualifier, v));
@@ -629,6 +870,6 @@ void venv::completions(mem::list<symbol >& l, string start)
l.push_back(N->first);
}
-#endif
+#endif /* not NOHASH */
} // namespace trans
diff --git a/Build/source/utils/asymptote/entry.h b/Build/source/utils/asymptote/entry.h
index c9eeb2e54ff..c543a5df2c6 100644
--- a/Build/source/utils/asymptote/entry.h
+++ b/Build/source/utils/asymptote/entry.h
@@ -179,7 +179,7 @@ public:
tenv& source, varEntry *qualifier, coder &c);
};
-#ifdef NOHASH //{{{
+#if 0 //{{{
/* This version of venv is provided for compiling on systems which do not
* have some form of STL hash table. It will eventually be removed.
* See the hash version below for documentation on the functions.
@@ -214,99 +214,189 @@ public:
//}}}
#else
-// venv implemented with a hash table.
-class venv {
- struct key : public gc {
+// For speed reasons, many asserts are only tested when DEBUG_CACHE is set.
+#ifdef DEBUG_CACHE
+#define DEBUG_CACHE_ASSERT(x) assert(x)
+#else
+#define DEBUG_CACHE_ASSERT(x) (void)(x)
+#endif
+
+// The hash table which is at the core of the variable environment venv.
+class core_venv : public gc {
+
+public:
+ // The cells of the table
+ struct cell {
symbol name;
- bool special;
- union {
- ty *t;
- signature *sig;
- } u;
+ varEntry *ent;
- //key(key& k) : name(k.name), special(k.special), u(k.u) {}
+ bool empty() const {
+ return name == 0;
+ }
- key(symbol name, ty *t)
- : name(name), special(name.special())
- {
- if (special)
- u.t = t;
- else
- u.sig = t->getSignature();
+ bool isATomb() const {
+ DEBUG_CACHE_ASSERT(!empty());
+ return ent == 0;
}
- /* A fake key used for searching just based on a signature. */
- key(symbol name, signature *sig)
- : name(name), special(false)
- {
- assert(!name.special());
- u.sig = sig;
+ bool filled() const {
+ return !empty() and !isATomb();
}
- key(symbol name, varEntry *v)
- : name(name), special(name.special())
- {
- ty *t = v->getType();
- if (special)
- u.t = t;
- else
- u.sig = t->getSignature();
+ bool matches(symbol name, const ty *t) {
+ DEBUG_CACHE_ASSERT(name.special());
+ DEBUG_CACHE_ASSERT(t);
+
+ if (this->name != name)
+ return false;
+ if (!this->ent)
+ return false;
+ return equivalent(this->ent->getType(), t);
}
- };
- friend ostream& operator<< (ostream& out, const venv::key &k);
- struct value : public gc {
- varEntry *v;
- value(varEntry *v)
- : v(v) {}
- value() : v(0) {}
- };
+ bool matches(symbol name, const signature *sig) {
+ DEBUG_CACHE_ASSERT(!name.special());
- struct namehash {
- size_t operator()(const symbol name) const {
- return name.hash();
+ if (this->name != name)
+ return false;
+ if (!this->ent)
+ return false;
+ return equivalent(this->ent->getSignature(), sig);
}
- };
- struct nameeq {
- bool operator()(const symbol s, const symbol t) const {
- return s==t;
+
+ void storeNew(symbol name, varEntry *ent) {
+ DEBUG_CACHE_ASSERT(empty() || isATomb());
+
+ this->name = name;
+ this->ent = ent;
}
- };
- struct keyhash {
- size_t hashSig(signature *sig) const {
- return sig ? sig->hash() : 0;
+
+ varEntry *replaceWith(symbol name, varEntry *ent) {
+ this->name = name;
+
+ varEntry *old = this->ent;
+ this->ent = ent;
+ return old;
}
- size_t operator()(const key k) const {
- return k.name.hash() * 107 +
- (k.special ? k.u.t->hash() : hashSig(k.u.sig));
+
+ void remove() {
+ this->ent = 0;
}
};
- struct keyeq {
-#define TEST_COLLISION 0
-#if TEST_COLLISION
- bool base(const key k, const key l) const {
- return k.name==l.name &&
- (k.special ? equivalent(k.u.t, l.u.t) :
- equivalent(k.u.sig, l.u.sig));
+
+private:
+ size_t capacity;
+ size_t size;
+ size_t mask;
+ cell *table;
+
+ void initTable(size_t capacity);
+
+ void resize();
+
+ cell& cellByIndex(size_t i);
+
+ const cell& cellByIndex(size_t i) const;
+
+ varEntry *storeNew(cell& cell, symbol name, varEntry *ent);
+
+ varEntry *storeNonSpecialAfterTomb(size_t tombIndex,
+ symbol name, varEntry *ent);
+ varEntry *storeSpecialAfterTomb(size_t tombIndex,
+ symbol name, varEntry *ent);
+
+public:
+ core_venv(size_t capacity) {
+ initTable(capacity);
+ }
+
+ bool empty() const { return size == 0; }
+ void clear();
+
+ void confirm_size();
+
+ // Store an entry into the table. If this shadows a previous entry, the old
+ // entry is returned, otherwise 0 is returned.
+ varEntry *storeNonSpecial(symbol name, varEntry *ent);
+ varEntry *storeSpecial(symbol name, varEntry *ent);
+ varEntry *store(symbol name, varEntry *ent);
+
+ // Lookup an entry in the table.
+ varEntry *lookupNonSpecial(symbol name, const signature *sig);
+ varEntry *lookupSpecial(symbol name, const ty *t);
+ varEntry *lookup(symbol name, const ty *t);
+
+ // Remove an entry from the table.
+ void removeNonSpecial(symbol name, const signature *sig);
+ void removeSpecial(symbol name, const ty *t);
+ void remove(symbol name, const ty *t);
+
+ // Features for iterating over the entire table.
+ class const_iterator {
+ const core_venv& core;
+ size_t index;
+
+ public:
+ const_iterator(const core_venv& core, size_t index)
+ : core(core), index(index) {}
+
+ const cell& operator * () const {
+ return core.cellByIndex(index);
+ }
+ const cell* operator -> () const {
+ return &core.cellByIndex(index);
+ }
+
+ const_iterator& operator ++ () {
+ // Advance to the next filled cell, or stop at the end of the array.
+ do {
+ ++index;
+ } while (!(*this)->filled() && index < core.capacity);
+
+ DEBUG_CACHE_ASSERT((*this)->filled() || (*this) == core.end());
+
+ return *this;
+ }
+
+ friend bool operator == (const const_iterator& a, const const_iterator& b)
+ {
+ // For speed, we don't compare the hashtables.
+ return a.index == b.index;
+ }
+ friend bool operator != (const const_iterator& a, const const_iterator& b)
+ {
+ // For speed, we don't compare the hashtables.
+ return a.index != b.index;
}
- bool operator()(const key k, const key l) const;
-#else
- bool operator()(const key k, const key l) const;
-#endif
};
+ const_iterator begin() const {
+ size_t index = 0;
+ while (index < capacity && !cellByIndex(index).filled())
+ ++index;
+ return const_iterator(*this, index);
+ }
+ const_iterator end() const {
+ return const_iterator(*this, capacity);
+ }
+};
+
+
+// venv implemented with a hash table.
+class venv {
// A hash table used to quickly look up a variable once its name and type are
// known. Includes all scopes.
- typedef mem::unordered_map<key, value, keyhash, keyeq> keymap;
- keymap all;
+ core_venv core;
// Record of added variables in the order they were added.
struct addition {
- key k;
+ symbol name;
+ ty *t;
varEntry *shadowed;
- addition(key k, varEntry *shadowed) : k(k), shadowed(shadowed) {}
+ addition(symbol name, ty *t, varEntry *shadowed)
+ : name(name), t(t), shadowed(shadowed) {}
};
typedef mem::stack<addition> addstack;
addstack additions;
@@ -316,6 +406,18 @@ class venv {
typedef mem::stack<size_t> scopestack;
scopestack scopesizes;
+
+ struct namehash {
+ size_t operator()(const symbol name) const {
+ return name.hash();
+ }
+ };
+ struct nameeq {
+ bool operator()(const symbol s, const symbol t) const {
+ return s==t;
+ }
+ };
+
struct namevalue {
#ifdef CALLEE_SEARCH
size_t maxFormals;
@@ -335,37 +437,51 @@ class venv {
#endif
};
- // A hash table indexed solely on the name, storing for each name the
+ // A dictionary indexed solely on the name, storing for each name the
// current (possibly overloaded) type of the name.
+ // The hash table implementation is slightly faster than the std::map binary
+ // tree implementation, so we use it if we can.
+#ifdef NOHASH
+ typedef mem::map<symbol CONST, namevalue> namemap;
+#else
typedef mem::unordered_map<symbol, namevalue, namehash, nameeq> namemap;
+#endif
namemap names;
+
// A sanity check. For a given name, it checks that the type stored in the
// names hash table exactly matches with all of the entries of that name
// stored in the full hash table.
void checkName(symbol name);
- void listValues(symbol name, /*values &vals,*/ record *module);
+ void listValues(symbol name, record *module);
+
// Helper function for endScope.
void remove(const addition& a);
// These are roughly the size the hashtables will be after loading the
// builtin functions and plain module.
- static const size_t fileAllSize=2000;
- static const size_t namesAllSize=1000;
+ static const size_t fileCoreSize=1 << 13;
+ static const size_t fileNamesSize=1000;
// The number of scopes begun (but not yet ended) when the venv was empty.
size_t empty_scopes;
public:
- venv() : empty_scopes(0) {}
+ venv() :
+ core(1 << 2), empty_scopes(0) {}
// Most file level modules automatically import plain, so allocate hashtables
// big enough to hold it in advance.
struct file_env_tag {};
venv(file_env_tag)
- : all(fileAllSize), names(namesAllSize), empty_scopes(0) {}
+ : core(fileCoreSize),
+#ifndef NOHASH
+ names(fileNamesSize),
+#endif
+ empty_scopes(0) {}
+ // Add a new variable definition.
void enter(symbol name, varEntry *v);
// Add the entries in one environment to another, if qualifier is
@@ -379,14 +495,9 @@ public:
bool add(symbol src, symbol dest,
venv& source, varEntry *qualifier, coder &c);
- varEntry *lookByType(key k) {
- keymap::const_iterator p=all.find(k);
- return p!=all.end() ? p->second.v : 0;
- }
-
// Look for a function that exactly matches the type given.
varEntry *lookByType(symbol name, ty *t) {
- return lookByType(key(name, t));
+ return core.lookup(name, t);
}
// An optimization heuristic. Try to guess the signature of a variable and
@@ -403,13 +514,14 @@ public:
// avoid such ambiguities.
varEntry *lookBySignature(symbol name, signature *sig);
+ // Get the (possibly overloaded) type of all variables associated to a
+ // particular name.
ty *getType(symbol name);
void beginScope();
void endScope();
- // Adds the definitions of the top-level scope to the level underneath,
- // and then removes the top scope.
+ // Merges the top-level scope with the level immediately underneath it.
void collapseScope();
// Prints a list of the variables to the standard output.
diff --git a/Build/source/utils/asymptote/errors b/Build/source/utils/asymptote/errors
index aa16dfd0d32..38739ee2d73 100644
--- a/Build/source/utils/asymptote/errors
+++ b/Build/source/utils/asymptote/errors
@@ -111,6 +111,6 @@ errortest.asy: 438.17: cannot cast 'int' to 'var'
errortest.asy: 442.7: could not infer type of initializer
errortest.asy: 446.7: could not infer type of initializer
errortest.asy: 448.7: could not infer type of initializer
-errortest.asy: 452.3: expression is not an array
-errortest.asy: 457.3: could not infer type of initializer
-errortest.asy: 463.3: could not infer type of initializer
+errortest.asy: 452.16: expression is not an array of inferable type
+errortest.asy: 457.16: expression is not an array of inferable type
+errortest.asy: 463.16: expression is not an array of inferable type
diff --git a/Build/source/utils/asymptote/examples/animations/inlinemovie.tex b/Build/source/utils/asymptote/examples/animations/inlinemovie.tex
index f3d9f5b0893..5f1eff9d4bb 100644
--- a/Build/source/utils/asymptote/examples/animations/inlinemovie.tex
+++ b/Build/source/utils/asymptote/examples/animations/inlinemovie.tex
@@ -7,9 +7,13 @@
Here is an inline PDF movie, generated with the commands
\begin{verbatim}
pdflatex inlinemovie
-asy inlinemovie
+asy inlinemovie-*.asy
pdflatex inlinemovie
\end{verbatim}
+or equivalently,
+\begin{verbatim}
+latexmk -pdf inlinemovie
+\end{verbatim}
\begin{center}
\begin{asy}
diff --git a/Build/source/utils/asymptote/examples/animations/inlinemovie3.tex b/Build/source/utils/asymptote/examples/animations/inlinemovie3.tex
index 46779e85b28..5131c652a11 100644
--- a/Build/source/utils/asymptote/examples/animations/inlinemovie3.tex
+++ b/Build/source/utils/asymptote/examples/animations/inlinemovie3.tex
@@ -7,9 +7,13 @@
Here is an inline 3D PDF movie, generated with the commands
\begin{verbatim}
pdflatex inlinemovie3
-asy inlinemovie3
+asy inlinemovie3-*.asy
pdflatex inlinemovie3
\end{verbatim}
+or equivalently,
+\begin{verbatim}
+latexmk -pdf inlinemovie3
+\end{verbatim}
\begin{center}
\begin{asy}
diff --git a/Build/source/utils/asymptote/examples/cards.asy b/Build/source/utils/asymptote/examples/cards.asy
new file mode 100644
index 00000000000..337a886ec86
--- /dev/null
+++ b/Build/source/utils/asymptote/examples/cards.asy
@@ -0,0 +1,26 @@
+picture rect;
+
+size(rect,0,2.5cm);
+
+real x=1;
+real y=1.25;
+
+filldraw(rect,box((-x,-y)/2,(x,y)/2),lightolive);
+
+label(rect,"1",(-x,y)*0.45,SE);
+label(rect,"2",(x,y)*0.45,SW);
+label(rect,"3",(-x,-y)*0.45,NE);
+label(rect,"4",(x,-y)*0.45,NW);
+
+frame rectf=rect.fit();
+frame toplef=rectf;
+frame toprig=xscale(-1)*rectf;
+frame botlef=yscale(-1)*rectf;
+frame botrig=xscale(-1)*yscale(-1)*rectf;
+
+size(0,7.5cm);
+
+add(toplef,(-x,y));
+add(toprig,(x,y));
+add(botlef,(-x,-y));
+add(botrig,(x,-y));
diff --git a/Build/source/utils/asymptote/examples/slidemovies.asy b/Build/source/utils/asymptote/examples/slidemovies.asy
deleted file mode 100644
index ec724cf3326..00000000000
--- a/Build/source/utils/asymptote/examples/slidemovies.asy
+++ /dev/null
@@ -1,46 +0,0 @@
-// Slide demo.
-// Command-line options to enable stepping and/or reverse video:
-// asy [-u stepping=true] [-u reverse=true] slidedemo
-
-orientation=Landscape;
-
-settings.tex="pdflatex";
-
-import slide;
-
-// Optional movie modules:
-import animate; // For portable embedded PDF movies
-import external; // For portable external movies
-import embed; // For non-portable embedded movies
-
-usersetting();
-
-titlepage("Slides with {\tt Asymptote}: Animations","John C. Bowman",
- "University of Alberta","\today","http://asymptote.sf.net");
-
-title("Embedded PDF movies (portable)");
-animation a=animation("A");
-animation b=animation("B");
-int n=20;
-for(int i=0; i < 2n; ++i) {
- picture pic;
- size(pic,100);
- draw(pic,shift(0,sin(pi/n*i))*unitsquare);
- a.add(pic);
- if(i < 1.5n) b.add(rotate(45)*pic);
-}
-display(a.pdf("autoplay,loop,controls"));
-display(b.pdf("controls"));
-
-title("External Movie (portable)");
-display(external.embed("animations/wheel.mpg",
- "poster,text=wheel.mpg,label=wheel.mpg",20cm,5.6cm));
-display(external.link("animations/wheel.mpg","Play","play"));
-
-title("Embedded Movie (not portable)");
-// Generated needed files if they don't already exist.
-asy("mpg","animations/wheel");
-display(embed.embed("animations/wheel.mpg",
- "poster,text=wheel.mpg,label=wheel.mpg",
- 20cm,5.6cm));
-display(embed.link("animations/wheel.mpg","Play","play"));
diff --git a/Build/source/utils/asymptote/examples/washermethod.asy b/Build/source/utils/asymptote/examples/washermethod.asy
index 9a18b871414..d86bf8cd4df 100644
--- a/Build/source/utils/asymptote/examples/washermethod.asy
+++ b/Build/source/utils/asymptote/examples/washermethod.asy
@@ -12,9 +12,14 @@ pair F(real x) {return (x,f(x));}
triple F3(real x) {return (x,f(x),0);}
ngraph=12;
-path[] p={graph(F,0.7476,1.8043,Spline)--cycle,
- graph(F,0.7,0.7476,Spline)--graph(F,1.7787,1.8043,Spline)--cycle,
- graph(F,0,0.7,Spline)--graph(F,1.8043,2,Spline)--cycle};
+
+real x1=0.7476;
+real x2=1.7787;
+real x3=1.8043;
+
+path[] p={graph(F,x1,x2,Spline),
+ graph(F,0.7,x1,Spline)--graph(F,x2,x3,Spline),
+ graph(F,0,0.7,Spline)--graph(F,x3,2,Spline)};
pen[] pn=new pen[] {color1,color2,color1};
@@ -24,7 +29,7 @@ for(int i=0; i < p.length; ++i) {
revolution a=revolution(path3(p[i]),Y,0,alpha);
draw(surface(a),pn[i],render);
- surface s=surface(p[i]);
+ surface s=surface(p[i]--cycle);
draw(s,pn[i],render);
draw(rotate(alpha,Y)*s,pn[i],render);
}
diff --git a/Build/source/utils/asymptote/item.h b/Build/source/utils/asymptote/item.h
index 7c4eec4522f..9be21ab7b6f 100644
--- a/Build/source/utils/asymptote/item.h
+++ b/Build/source/utils/asymptote/item.h
@@ -47,6 +47,10 @@ extern const item Default;
class item : public gc {
private:
+#if !COMPACT
+ const std::type_info *kind;
+#endif
+
union {
Int i;
double x;
@@ -103,8 +107,6 @@ public:
item& operator= (const T &it)
{ i=(Int) new(UseGC) T(it); return *this; }
#else
- const std::type_info *kind;
-
bool empty() const
{return *kind == typeid(void);}
diff --git a/Build/source/utils/asymptote/memory.h b/Build/source/utils/asymptote/memory.h
index be13e5059a0..6f91095fb52 100644
--- a/Build/source/utils/asymptote/memory.h
+++ b/Build/source/utils/asymptote/memory.h
@@ -14,10 +14,11 @@
#include <string>
#include <sstream>
-#ifndef NOHASH
#ifndef __GNUC_PREREQ
#define __GNUC_PREREQ(maj, min) (0)
#endif
+
+#ifndef NOHASH
#if __GNUC_PREREQ(4,3) || defined(__CYGWIN__)
#include <tr1/unordered_map>
#define EXT std::tr1
diff --git a/Build/source/utils/asymptote/path.cc b/Build/source/utils/asymptote/path.cc
index 8e05603f05c..070ec2acd61 100644
--- a/Build/source/utils/asymptote/path.cc
+++ b/Build/source/utils/asymptote/path.cc
@@ -876,7 +876,6 @@ void intersections(std::vector<double>& S, std::vector<double>& T,
size_t n=S1.size();
for(size_t i=0; i < n; ++i) {
double s=S1[i];
- pair z=g.point(s);
double t=dot(g.point(s)-p,factor);
if(t >= -Fuzz && t <= 1.0+Fuzz) {
S.push_back(s);
@@ -1113,8 +1112,6 @@ path concat(const path& p1, const path& p2)
if (n1 == -1) return p2;
if (n2 == -1) return p1;
- pair a=p1.point(n1);
- pair b=p2.point((Int) 0);
mem::vector<solvedKnot> nodes(n1+n2+1);
diff --git a/Build/source/utils/asymptote/path.h b/Build/source/utils/asymptote/path.h
index 858f94fd13b..42f00c9c19c 100644
--- a/Build/source/utils/asymptote/path.h
+++ b/Build/source/utils/asymptote/path.h
@@ -277,7 +277,6 @@ public:
pair preaccel(Int t) const {
if(!cycles && t <= 0) return pair(0,0);
- pair z0=point(t-1);
pair c0=postcontrol(t-1);
pair c1=precontrol(t);
pair z1=point(t);
diff --git a/Build/source/utils/asymptote/picture.cc b/Build/source/utils/asymptote/picture.cc
index c35b1e14dd4..3ebdf94e6db 100644
--- a/Build/source/utils/asymptote/picture.cc
+++ b/Build/source/utils/asymptote/picture.cc
@@ -688,7 +688,7 @@ bool picture::shipout(picture *preamble, const string& Prefix,
texfile *tex=NULL;
if(Labels) {
- texname=auxname(prefix,"tex");
+ texname=TeXmode ? buildname(prefix,"tex") : auxname(prefix,"tex");
tex=svgformat ? new svgtexfile(texname,b) : new texfile(texname,b);
tex->prologue();
}
diff --git a/Build/source/utils/asymptote/prc/PRC.h b/Build/source/utils/asymptote/prc/PRC.h
index eee8dcf928d..8acaa453ca3 100644
--- a/Build/source/utils/asymptote/prc/PRC.h
+++ b/Build/source/utils/asymptote/prc/PRC.h
@@ -1,7 +1,7 @@
#ifndef __PRC_H
#define __PRC_H
-#include <stdint.h>
+#include <inttypes.h>
//const uint32_t PRCVersion=7094; // For Adobe Reader 8 or later
const uint32_t PRCVersion=8137; // For Adobe Reader 9 or later
diff --git a/Build/source/utils/asymptote/prc/PRCbitStream.h b/Build/source/utils/asymptote/prc/PRCbitStream.h
index 58342812c36..89482168f9e 100644
--- a/Build/source/utils/asymptote/prc/PRCbitStream.h
+++ b/Build/source/utils/asymptote/prc/PRCbitStream.h
@@ -21,9 +21,9 @@
#ifndef __PRC_BIT_STREAM_H
#define __PRC_BIT_STREAM_H
+#include <inttypes.h>
#include <string>
#include <stdlib.h>
-#include <stdint.h>
#define CHUNK_SIZE (1024)
// Is this a reasonable initial size?
diff --git a/Build/source/utils/asymptote/prc/writePRC.cc b/Build/source/utils/asymptote/prc/writePRC.cc
index 8f1d7370f33..7e1e1358bd9 100644
--- a/Build/source/utils/asymptote/prc/writePRC.cc
+++ b/Build/source/utils/asymptote/prc/writePRC.cc
@@ -31,10 +31,14 @@
using namespace std;
+#ifndef __GNUC_PREREQ
+#define __GNUC_PREREQ(maj, min) (0)
+#endif
+
// Count leading zeros.
uint32_t CLZ(uint32_t a)
{
-#ifdef __GNUC__
+#if __GNUC_PREREQ(3,4)
return __builtin_clz(a);
#else
// find the log base 2 of a 32-bit integer
@@ -49,7 +53,7 @@ uint32_t CLZ(uint32_t a)
a |= a >> 8;
a |= a >> 16;
- return 31-MultiplyDeBruijnBitPosition[(unsignedInt)(a * 0x07C4ACDDU) >> 27];
+ return 31-MultiplyDeBruijnBitPosition[(uint32_t)(a * 0x07C4ACDDU) >> 27];
#endif
}
diff --git a/Build/source/utils/asymptote/record.h b/Build/source/utils/asymptote/record.h
index b11ffcc53b7..6a285e2afc6 100644
--- a/Build/source/utils/asymptote/record.h
+++ b/Build/source/utils/asymptote/record.h
@@ -56,7 +56,7 @@ public:
return true;
}
- size_t hash() {
+ size_t hash() const {
// Use the pointer, as two records are equivalent only if they are the
// same object.
return (size_t)this;
diff --git a/Build/source/utils/asymptote/runlabel.cc b/Build/source/utils/asymptote/runlabel.cc
index 5d797e8cb7f..fce34183946 100644
--- a/Build/source/utils/asymptote/runlabel.cc
+++ b/Build/source/utils/asymptote/runlabel.cc
@@ -109,17 +109,26 @@ string currentpoint="print currentpoint ASYy ASYx ";
string ASYinit="/ASYX currentpoint pop def /ASYY currentpoint exch pop def ";
string ASY1="ASY1 {"+ASYinit+"/ASY1 false def} if ";
-void showpath(std::ofstream& ps)
+void endpath(std::ostream& ps)
+{
+ ps << ASY1 << pathforall << " (M) " << currentpoint
+ << "currentpoint newpath moveto} bind def" << endl;
+}
+
+void fillpath(std::ostream& ps)
+{
+ ps << "/fill {closepath ";
+ endpath(ps);
+}
+
+void showpath(std::ostream& ps)
{
ps << ASYx << newl
<< ASYy << newl
<< "/ASY1 true def" << newl
- << "/fill {" << ASY1
- << pathforall << " (M) " << currentpoint
- << "currentpoint newpath moveto } bind def" << newl
- << "/stroke {" << ASY1 << "strokepath "
- << pathforall << " (M) " << currentpoint
- << "currentpoint newpath moveto } bind def" << endl;
+ << "/stroke {strokepath ";
+ endpath(ps);
+ fillpath(ps);
}
array *readpath(const string& psname, bool keep,
@@ -246,7 +255,7 @@ array *readpath(const string& psname, bool keep,
#endif
namespace run {
-#line 199 "runlabel.in"
+#line 208 "runlabel.in"
// void label(picture *f, string *s, string *size, transform t, pair position, pair align, pen p);
void gen_runlabel0(stack *Stack)
{
@@ -257,26 +266,26 @@ void gen_runlabel0(stack *Stack)
string * size=vm::pop<string *>(Stack);
string * s=vm::pop<string *>(Stack);
picture * f=vm::pop<picture *>(Stack);
-#line 201 "runlabel.in"
+#line 210 "runlabel.in"
f->append(new drawLabel(*s,*size,t,position,align,p));
}
-#line 205 "runlabel.in"
+#line 214 "runlabel.in"
// bool labels(picture *f);
void gen_runlabel1(stack *Stack)
{
picture * f=vm::pop<picture *>(Stack);
-#line 206 "runlabel.in"
+#line 215 "runlabel.in"
{Stack->push<bool>(f->havelabels()); return;}
}
-#line 210 "runlabel.in"
+#line 219 "runlabel.in"
// realarray* texsize(string *s, pen p=CURRENTPEN);
void gen_runlabel2(stack *Stack)
{
pen p=vm::pop<pen>(Stack,CURRENTPEN);
string * s=vm::pop<string *>(Stack);
-#line 211 "runlabel.in"
+#line 220 "runlabel.in"
texinit();
processDataStruct &pd=processData();
@@ -295,13 +304,13 @@ void gen_runlabel2(stack *Stack)
{Stack->push<realarray*>(t); return;}
}
-#line 230 "runlabel.in"
+#line 239 "runlabel.in"
// patharray2* _texpath(stringarray *s, penarray *p);
void gen_runlabel3(stack *Stack)
{
penarray * p=vm::pop<penarray *>(Stack);
stringarray * s=vm::pop<stringarray *>(Stack);
-#line 231 "runlabel.in"
+#line 240 "runlabel.in"
size_t n=checkArrays(s,p);
if(n == 0) {Stack->push<patharray2*>(new array(0)); return;}
@@ -324,10 +333,10 @@ void gen_runlabel3(stack *Stack)
tex.verbatimline(ASYx);
tex.verbatimline(ASYy);
tex.verbatimline("/ASY1 true def");
- tex.verbatimline("/v {"+ASY1+"neg exch 4 copy 4 2 roll 2 copy 6 2 roll 2 copy (M) print ASYy ASYx (L) print ASYy add ASYx (L) print add ASYy add ASYx (L) print add ASYy ASYx (c) print} bind def");
tex.verbatimline("/show {"+ASY1+
- "currentpoint newpath moveto false charpath "+
- pathforall+"} bind def}");
+ "currentpoint newpath moveto false charpath "+pathforall+
+ "} bind def");
+ tex.verbatimline("/V {"+ASY1+"Ry neg Rx 4 copy 4 2 roll 2 copy 6 2 roll 2 copy (M) print ASYy ASYx (L) print ASYy add ASYx (L) print add ASYy add ASYx (L) print add ASYy ASYx (c) print} bind def}");
}
tex.verbatimline(read<string>(s,i)+"%");
}
@@ -404,13 +413,13 @@ void gen_runlabel3(stack *Stack)
{Stack->push<patharray2*>(pdf ? readpath(psname,keep,0.1) : readpath(psname,keep,0.12,-1.0)); return;}
}
-#line 334 "runlabel.in"
+#line 343 "runlabel.in"
// patharray2* textpath(stringarray *s, penarray *p);
void gen_runlabel4(stack *Stack)
{
penarray * p=vm::pop<penarray *>(Stack);
stringarray * s=vm::pop<stringarray *>(Stack);
-#line 335 "runlabel.in"
+#line 344 "runlabel.in"
size_t n=checkArrays(s,p);
if(n == 0) {Stack->push<patharray2*>(new array(0)); return;}
@@ -481,13 +490,13 @@ void gen_runlabel4(stack *Stack)
{Stack->push<patharray2*>(readpath(psname,keep,0.1)); return;}
}
-#line 406 "runlabel.in"
+#line 415 "runlabel.in"
// patharray* _strokepath(path g, pen p=CURRENTPEN);
void gen_runlabel5(stack *Stack)
{
pen p=vm::pop<pen>(Stack,CURRENTPEN);
path g=vm::pop<path>(Stack);
-#line 407 "runlabel.in"
+#line 416 "runlabel.in"
array *P=new array(0);
if(g.size() == 0) {Stack->push<patharray*>(P); return;}
@@ -517,17 +526,17 @@ namespace trans {
void gen_runlabel_venv(venv &ve)
{
-#line 199 "runlabel.in"
+#line 208 "runlabel.in"
addFunc(ve, run::gen_runlabel0, primVoid(), SYM(label), formal(primPicture(), SYM(f), false, false), formal(primString(), SYM(s), false, false), formal(primString(), SYM(size), false, false), formal(primTransform(), SYM(t), false, false), formal(primPair(), SYM(position), false, false), formal(primPair(), SYM(align), false, false), formal(primPen(), SYM(p), false, false));
-#line 205 "runlabel.in"
+#line 214 "runlabel.in"
addFunc(ve, run::gen_runlabel1, primBoolean(), SYM(labels), formal(primPicture(), SYM(f), false, false));
-#line 210 "runlabel.in"
+#line 219 "runlabel.in"
addFunc(ve, run::gen_runlabel2, realArray(), SYM(texsize), formal(primString(), SYM(s), false, false), formal(primPen(), SYM(p), true, false));
-#line 230 "runlabel.in"
+#line 239 "runlabel.in"
addFunc(ve, run::gen_runlabel3, pathArray2() , SYM(_texpath), formal(stringArray() , SYM(s), false, false), formal(penArray() , SYM(p), false, false));
-#line 334 "runlabel.in"
+#line 343 "runlabel.in"
addFunc(ve, run::gen_runlabel4, pathArray2() , SYM(textpath), formal(stringArray() , SYM(s), false, false), formal(penArray() , SYM(p), false, false));
-#line 406 "runlabel.in"
+#line 415 "runlabel.in"
addFunc(ve, run::gen_runlabel5, pathArray() , SYM(_strokepath), formal(primPath(), SYM(g), false, false), formal(primPen(), SYM(p), true, false));
}
diff --git a/Build/source/utils/asymptote/runlabel.in b/Build/source/utils/asymptote/runlabel.in
index b1279a900f9..0202383e852 100644
--- a/Build/source/utils/asymptote/runlabel.in
+++ b/Build/source/utils/asymptote/runlabel.in
@@ -65,17 +65,26 @@ string currentpoint="print currentpoint ASYy ASYx ";
string ASYinit="/ASYX currentpoint pop def /ASYY currentpoint exch pop def ";
string ASY1="ASY1 {"+ASYinit+"/ASY1 false def} if ";
-void showpath(std::ofstream& ps)
+void endpath(std::ostream& ps)
+{
+ ps << ASY1 << pathforall << " (M) " << currentpoint
+ << "currentpoint newpath moveto} bind def" << endl;
+}
+
+void fillpath(std::ostream& ps)
+{
+ ps << "/fill {closepath ";
+ endpath(ps);
+}
+
+void showpath(std::ostream& ps)
{
ps << ASYx << newl
<< ASYy << newl
<< "/ASY1 true def" << newl
- << "/fill {" << ASY1
- << pathforall << " (M) " << currentpoint
- << "currentpoint newpath moveto } bind def" << newl
- << "/stroke {" << ASY1 << "strokepath "
- << pathforall << " (M) " << currentpoint
- << "currentpoint newpath moveto } bind def" << endl;
+ << "/stroke {strokepath ";
+ endpath(ps);
+ fillpath(ps);
}
array *readpath(const string& psname, bool keep,
@@ -251,10 +260,10 @@ patharray2 *_texpath(stringarray *s, penarray *p)
tex.verbatimline(ASYx);
tex.verbatimline(ASYy);
tex.verbatimline("/ASY1 true def");
- tex.verbatimline("/v {"+ASY1+"neg exch 4 copy 4 2 roll 2 copy 6 2 roll 2 copy (M) print ASYy ASYx (L) print ASYy add ASYx (L) print add ASYy add ASYx (L) print add ASYy ASYx (c) print} bind def");
tex.verbatimline("/show {"+ASY1+
- "currentpoint newpath moveto false charpath "+
- pathforall+"} bind def}");
+ "currentpoint newpath moveto false charpath "+pathforall+
+ "} bind def");
+ tex.verbatimline("/V {"+ASY1+"Ry neg Rx 4 copy 4 2 roll 2 copy 6 2 roll 2 copy (M) print ASYy ASYx (L) print ASYy add ASYx (L) print add ASYy add ASYx (L) print add ASYy ASYx (c) print} bind def}");
}
tex.verbatimline(read<string>(s,i)+"%");
}
diff --git a/Build/source/utils/asymptote/runmath.cc b/Build/source/utils/asymptote/runmath.cc
index adaa5519c01..ba283d72a6b 100644
--- a/Build/source/utils/asymptote/runmath.cc
+++ b/Build/source/utils/asymptote/runmath.cc
@@ -524,7 +524,7 @@ void gen_runmath37(stack *Stack)
{
Int a=vm::pop<Int>(Stack);
#line 299 "runmath.in"
- if((unsignedInt) a > 0xFFFFFFFF) {Stack->push<Int>(-1); return;}
+ if((uint32_t) a > 0xFFFFFFFF) {Stack->push<Int>(-1); return;}
{Stack->push<Int>(CLZ((uint32_t) a)); return;}
}
@@ -534,8 +534,8 @@ void gen_runmath38(stack *Stack)
{
Int a=vm::pop<Int>(Stack);
#line 305 "runmath.in"
- if((unsignedInt) a > 0xFFFFFFFF) {Stack->push<Int>(-1); return;}
-#ifdef __GNUC__
+ if((uint32_t) a > 0xFFFFFFFF) {Stack->push<Int>(-1); return;}
+#if __GNUC_PREREQ(3,4)
{Stack->push<Int>(__builtin_ctz(a)); return;}
#else
// find the number of trailing zeros in a 32-bit number
@@ -543,7 +543,7 @@ void gen_runmath38(stack *Stack)
0, 1, 28, 2, 29, 14, 24, 3, 30, 22, 20, 15, 25, 17, 4, 8,
31, 27, 13, 23, 21, 19, 16, 7, 26, 12, 18, 6, 11, 5, 10, 9
};
- {Stack->push<Int>(MultiplyDeBruijnBitPosition[((unsignedInt)((a & -a) * 0x077CB531U))
+ {Stack->push<Int>(MultiplyDeBruijnBitPosition[((uint32_t)((a & -a) * 0x077CB531U))
>> 27]); return;}
#endif
}
diff --git a/Build/source/utils/asymptote/runmath.in b/Build/source/utils/asymptote/runmath.in
index 5e26311c53c..ed4ad9e7bc8 100644
--- a/Build/source/utils/asymptote/runmath.in
+++ b/Build/source/utils/asymptote/runmath.in
@@ -297,14 +297,14 @@ Int NOT(Int a)
Int CLZ(Int a)
{
- if((unsignedInt) a > 0xFFFFFFFF) return -1;
+ if((uint32_t) a > 0xFFFFFFFF) return -1;
return CLZ((uint32_t) a);
}
Int CTZ(Int a)
{
- if((unsignedInt) a > 0xFFFFFFFF) return -1;
-#ifdef __GNUC__
+ if((uint32_t) a > 0xFFFFFFFF) return -1;
+#if __GNUC_PREREQ(3,4)
return __builtin_ctz(a);
#else
// find the number of trailing zeros in a 32-bit number
@@ -312,7 +312,7 @@ Int CTZ(Int a)
0, 1, 28, 2, 29, 14, 24, 3, 30, 22, 20, 15, 25, 17, 4, 8,
31, 27, 13, 23, 21, 19, 16, 7, 26, 12, 18, 6, 11, 5, 10, 9
};
- return MultiplyDeBruijnBitPosition[((unsignedInt)((a & -a) * 0x077CB531U))
+ return MultiplyDeBruijnBitPosition[((uint32_t)((a & -a) * 0x077CB531U))
>> 27];
#endif
}
diff --git a/Build/source/utils/asymptote/runpicture.cc b/Build/source/utils/asymptote/runpicture.cc
index f8f58b33ae4..e9500a7be72 100644
--- a/Build/source/utils/asymptote/runpicture.cc
+++ b/Build/source/utils/asymptote/runpicture.cc
@@ -541,7 +541,7 @@ void gen_runpicture31(stack *)
{
#line 312 "runpicture.in"
if(getSetting<bool>("inlinetex")) {
- unlink(auxname(outname(),"pre").c_str());
+ unlink(buildname(outname(),"pre").c_str());
}
}
diff --git a/Build/source/utils/asymptote/runpicture.in b/Build/source/utils/asymptote/runpicture.in
index cd22bb5dd97..700695dd9e6 100644
--- a/Build/source/utils/asymptote/runpicture.in
+++ b/Build/source/utils/asymptote/runpicture.in
@@ -311,7 +311,7 @@ void texpreamble(string s)
void deletepreamble()
{
if(getSetting<bool>("inlinetex")) {
- unlink(auxname(outname(),"pre").c_str());
+ unlink(buildname(outname(),"pre").c_str());
}
}
diff --git a/Build/source/utils/asymptote/stm.cc b/Build/source/utils/asymptote/stm.cc
index acc00f0082b..43f56aea042 100644
--- a/Build/source/utils/asymptote/stm.cc
+++ b/Build/source/utils/asymptote/stm.cc
@@ -357,6 +357,17 @@ void extendedForStm::trans(coenv &e) {
// Get the start type. Handle type inference as a special case.
types::ty *t = start->trans(e, true);
if (t->kind == types::ty_inferred) {
+
+ // First ensure the array expression is an unambiguous array.
+ types::ty *at = set->cgetType(e);
+ if (at->kind != ty_array) {
+ em.error(set->getPos());
+ em << "expression is not an array of inferable type";
+
+ // On failure, don't bother trying to translate the loop.
+ return;
+ }
+
// var a=set;
tyEntryTy tet(pos, primInferred());
decid dec1(pos, new decidstart(pos, a), set);
@@ -378,13 +389,6 @@ void extendedForStm::trans(coenv &e) {
b.add(new vardec(pos, start, &dec2));
b.add(body);
- // If there are errors already, just report errors in the body and don't try
- // to translate the for loop.
- if (em.errors()) {
- b.trans(e);
- return;
- }
-
// for (int i=0; i < a.length; ++i)
// <block>
forStm(pos,
diff --git a/Build/source/utils/asymptote/symbol.cc b/Build/source/utils/asymptote/symbol.cc
index 0c6e225af88..b4e173b72be 100644
--- a/Build/source/utils/asymptote/symbol.cc
+++ b/Build/source/utils/asymptote/symbol.cc
@@ -23,11 +23,17 @@ const char SKIP = 2;
struct symbolRecord {
// When a symbol is entered into the table, its hash is computed. If the
// corresponding entry in the table is full, this value is incremented until
- // an empty slot is found. hashplus stores the end value. As entries are
- // removed, each symbol has a unique hashplus value, even if there is a
- // collision in the original hashing function.
+ // an empty slot is found. hashplus stores the end value.
+ // Each symbol has a unique hashplus value, even if there is a collision in
+ // the original hashing function.
uint hashplus;
+
+ // Whether the cell of the table is empty, in use, or a "skip" entry due to
+ // a resizing of the table.
unsigned char flag;
+
+ // Pointer to a copy of the string (allocated on the heap). This string
+ // will never be deallocated. Symbols, in essence, last forever.
char *s;
};
diff --git a/Build/source/utils/asymptote/symbol.h b/Build/source/utils/asymptote/symbol.h
index 35204f16f85..30ebe54fcc5 100644
--- a/Build/source/utils/asymptote/symbol.h
+++ b/Build/source/utils/asymptote/symbol.h
@@ -64,6 +64,9 @@ struct symbol {
bool special() const {
return *this == initsym || *this == castsym || *this == ecastsym;
}
+ bool notSpecial() const {
+ return !special();
+ }
// Translate a string into a unique symbol, such that two strings are equal
// if and only if their resulting symbols are equal.
@@ -97,6 +100,10 @@ struct symbol {
return s1.hashplus == s2.hashplus;
}
+ friend bool operator!= (symbol s1, symbol s2) {
+ return s1.hashplus != s2.hashplus;
+ }
+
friend bool operator< (symbol s1, symbol s2) {
return s1.hashplus < s2.hashplus;
}
diff --git a/Build/source/utils/asymptote/texfile.cc b/Build/source/utils/asymptote/texfile.cc
index 1682bed2866..c1e22b9a7cf 100644
--- a/Build/source/utils/asymptote/texfile.cc
+++ b/Build/source/utils/asymptote/texfile.cc
@@ -61,7 +61,7 @@ void texfile::miniprologue()
void texfile::prologue()
{
if(inlinetex) {
- string prename=auxname(settings::outname(),"pre");
+ string prename=buildname(settings::outname(),"pre");
std::ifstream exists(prename.c_str());
std::ofstream *outpreamble=
new std::ofstream(prename.c_str(),std::ios::app);
diff --git a/Build/source/utils/asymptote/types.cc b/Build/source/utils/asymptote/types.cc
index 6efb04bf630..758ae0cac15 100644
--- a/Build/source/utils/asymptote/types.cc
+++ b/Build/source/utils/asymptote/types.cc
@@ -335,13 +335,13 @@ ostream& operator<< (ostream& out, const formal& f)
return out;
}
-bool equivalent(formal& f1, formal& f2) {
+bool equivalent(const formal& f1, const formal& f2) {
// Just test the types.
// This cannot be used on rest formal with types equal to NULL.
return equivalent(f1.t,f2.t);
}
-bool argumentEquivalent(formal &f1, formal& f2) {
+bool argumentEquivalent(const formal &f1, const formal& f2) {
if (f1.name == f2.name) {
if (f1.t == 0)
return f2.t == 0;
@@ -386,12 +386,13 @@ ostream& operator<< (ostream& out, const signature& s)
// Equivalence by design does not look at the presence of default values.
-bool equivalent(signature *s1, signature *s2)
+bool equivalent(const signature *s1, const signature *s2)
{
+ if (s1 == s2)
+ return true;
+
// Handle null signature
- if (s1 == 0)
- return s2 == 0;
- else if (s2 == 0)
+ if (s1 == 0 || s2 == 0)
return false;
// Two open signatures are always equivalent, as the formals are ignored.
@@ -404,7 +405,7 @@ bool equivalent(signature *s1, signature *s2)
return false;
if (!std::equal(s1->formals.begin(),s1->formals.end(),s2->formals.begin(),
- (bool (*)(formal&,formal&)) equivalent))
+ (bool (*)(const formal&,const formal&)) equivalent))
return false;
if (s1->rest.t)
@@ -413,7 +414,7 @@ bool equivalent(signature *s1, signature *s2)
return s1->rest.t == 0;
}
-bool argumentEquivalent(signature *s1, signature *s2)
+bool argumentEquivalent(const signature *s1, const signature *s2)
{
// Handle null signature
if (s1 == 0)
@@ -425,13 +426,14 @@ bool argumentEquivalent(signature *s1, signature *s2)
return false;
return std::equal(s1->formals.begin(),s1->formals.end(),s2->formals.begin(),
- (bool (*)(formal&,formal&)) argumentEquivalent) &&
+ (bool (*)(const formal&,const formal&))
+ argumentEquivalent) &&
argumentEquivalent(s1->rest, s2->rest);
}
-size_t signature::hash() {
+size_t signature::hash() const {
size_t x=2038;
- for (formal_vector::iterator i=formals.begin(); i!=formals.end(); ++i)
+ for (formal_vector::const_iterator i=formals.begin(); i!=formals.end(); ++i)
x=x*0xFAEC+i->t->hash();
if (rest.t)
@@ -502,7 +504,7 @@ bool overloaded::castable(ty *target, caster &c)
return false;
}
-bool equivalent(ty *t1, ty *t2)
+bool equivalent(const ty *t1, const ty *t2)
{
// The same pointer must point to the same type.
if (t1 == t2)
@@ -523,7 +525,7 @@ bool equivalent(ty *t1, ty *t2)
}
-bool equivalent(ty *t1, ty *t2, bool special) {
+bool equivalent(const ty *t1, const ty *t2, bool special) {
return special ? equivalent(t1, t2) :
equivalent(t1->getSignature(), t2->getSignature());
}
diff --git a/Build/source/utils/asymptote/types.h b/Build/source/utils/asymptote/types.h
index 0bc40863727..c4c560dbad5 100644
--- a/Build/source/utils/asymptote/types.h
+++ b/Build/source/utils/asymptote/types.h
@@ -60,11 +60,11 @@ typedef ty_vector::iterator ty_iterator;
// That is primitive types are equal if they are the same kind.
// Structures are equal if they come from the same struct definition.
// Arrays are equal if their cell types are equal.
-bool equivalent(ty *t1, ty *t2);
+bool equivalent(const ty *t1, const ty *t2);
// If special is true, this is the same as above. If special is false, just the
// signatures are compared.
-bool equivalent(ty *t1, ty *t2, bool special);
+bool equivalent(const ty *t1, const ty *t2, bool special);
class caster {
public:
@@ -98,6 +98,10 @@ public:
return 0;
}
+ virtual const signature *getSignature() const {
+ return 0;
+ }
+
virtual bool primitive() {
return false;
}
@@ -163,7 +167,7 @@ public:
// Returns true if the other type is equivalent to this one.
// The general function equivalent should be preferably used, as it properly
// handles overloaded type comparisons.
- virtual bool equiv(ty *other)
+ virtual bool equiv(const ty *other) const
{
return this==other;
}
@@ -171,7 +175,7 @@ public:
// Returns a number for the type for use in a hash table. Equivalent types
// must yield the same number.
- virtual size_t hash() = 0;
+ virtual size_t hash() const = 0;
};
class primitiveTy : public ty {
@@ -190,12 +194,12 @@ public:
ty *virtualFieldGetType(symbol );
trans::varEntry *virtualField(symbol, signature *);
- bool equiv(ty *other)
+ bool equiv(const ty *other) const
{
return this->kind==other->kind;
}
- size_t hash() {
+ size_t hash() const {
return (size_t)kind + 47;
}
};
@@ -211,7 +215,7 @@ public:
trans::access *castTo(ty *target, caster &);
- size_t hash() {
+ size_t hash() const {
return (size_t)kind + 47;
}
};
@@ -236,12 +240,12 @@ struct array : public ty {
return true;
}
- bool equiv(ty *other) {
+ bool equiv(const ty *other) const {
return other->kind==ty_array &&
equivalent(this->celltype,((array *)other)->celltype);
}
- size_t hash() {
+ size_t hash() const {
return 1007 * celltype->hash();
}
@@ -313,8 +317,8 @@ struct formal {
friend ostream& operator<< (ostream& out, const formal& f);
};
-bool equivalent(formal& f1, formal& f2);
-bool argumentEquivalent(formal &f1, formal& f2);
+bool equivalent(const formal& f1, const formal& f2);
+bool argumentEquivalent(const formal &f1, const formal& f2);
typedef mem::vector<formal> formal_vector;
@@ -369,18 +373,18 @@ struct signature : public gc {
friend ostream& operator<< (ostream& out, const signature& s);
- friend bool equivalent(signature *s1, signature *s2);
+ friend bool equivalent(const signature *s1, const signature *s2);
// Check if a signature of argument types (as opposed to formal parameters)
// are equivalent. Here, the arguments, if named, must have the same names,
// and (for simplicity) no overloaded arguments are allowed.
- friend bool argumentEquivalent(signature *s1, signature *s2);
+ friend bool argumentEquivalent(const signature *s1, const signature *s2);
#if 0
friend bool castable(signature *target, signature *source);
friend Int numFormalsMatch(signature *s1, signature *s2);
#endif
- size_t hash();
+ size_t hash() const;
};
struct function : public ty {
@@ -429,7 +433,7 @@ struct function : public ty {
return true;
}
- bool equiv(ty *other)
+ bool equiv(const ty *other) const
{
if (other->kind==ty_function) {
function *that=(function *)other;
@@ -439,7 +443,7 @@ struct function : public ty {
else return false;
}
- size_t hash() {
+ size_t hash() const {
return sig.hash()*0x1231+result->hash();
}
@@ -459,6 +463,10 @@ struct function : public ty {
return &sig;
}
+ const signature *getSignature() const {
+ return &sig;
+ }
+
#if 0
ty *stripDefaults();
#endif
@@ -481,15 +489,15 @@ public:
: ty(ty_overloaded) { add(t); }
virtual ~overloaded() {}
- bool equiv(ty *other)
+ bool equiv(const ty *other) const
{
- for(ty_vector::iterator i=sub.begin();i!=sub.end();++i)
+ for(ty_vector::const_iterator i=sub.begin();i!=sub.end();++i)
if (equivalent(*i,other))
return true;
return false;
}
- size_t hash() {
+ size_t hash() const {
// Overloaded types should not be hashed.
assert(False);
return 0;