diff options
author | Karl Berry <karl@freefriends.org> | 2012-05-31 00:02:26 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2012-05-31 00:02:26 +0000 |
commit | 19fc9fd9a26973d87fad437ce549ffaba479df54 (patch) | |
tree | f40a9d2592b3cf827970c8bf54a1eebf9cc8f9c0 /Build | |
parent | 24b3bac312553b2cc61e94fda581aba311967f5c (diff) |
asy 2.16 sources
git-svn-id: svn://tug.org/texlive/trunk@26734 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build')
143 files changed, 17499 insertions, 5475 deletions
diff --git a/Build/source/utils/README b/Build/source/utils/README index d03eaac85bf..572d6bd26e0 100644 --- a/Build/source/utils/README +++ b/Build/source/utils/README @@ -4,7 +4,7 @@ Public domain. Originally written 2005 by Karl Berry. Extra utilities we (optionally) compile for TeX Live. See comments in ../texk/README. -asymptote 2.13 - checked 19jun11 +asymptote 2.16 - checked 19jun11 update to TL from CTAN, to include prebuilt doc. see http://tug.org/texlive/build.html#asymptote and tlpkg/bin/tl-update-asy diff --git a/Build/source/utils/asymptote/ChangeLog b/Build/source/utils/asymptote/ChangeLog index 2ee11ce1ef3..efcc9018d4e 100644 --- a/Build/source/utils/asymptote/ChangeLog +++ b/Build/source/utils/asymptote/ChangeLog @@ -1,4 +1,963 @@ ------------------------------------------------------------------------ +r5434 | jcbowman | 2012-05-30 13:45:48 -0600 (Wed, 30 May 2012) | 2 lines +Changed paths: + M /trunk/asymptote/GUI/xasy2asy.py + +Work around Windows Python bug. + +------------------------------------------------------------------------ +r5433 | jcbowman | 2012-05-30 11:53:45 -0600 (Wed, 30 May 2012) | 3 lines +Changed paths: + M /trunk/asymptote/doc/asymptote.texi + M /trunk/asymptote/fileio.h + M /trunk/asymptote/runfile.in + +Replace xinput by input(mode="xdr") and xoutput by input(mode="xdr"). +Replace binput by input(mode="binary") and xoutput by input(mode="binary"). + +------------------------------------------------------------------------ +r5432 | jcbowman | 2012-05-30 10:35:57 -0600 (Wed, 30 May 2012) | 2 lines +Changed paths: + M /trunk/asymptote/runhistory.in + +Update setting. + +------------------------------------------------------------------------ +r5431 | jcbowman | 2012-05-30 10:24:17 -0600 (Wed, 30 May 2012) | 2 lines +Changed paths: + M /trunk/asymptote/GUI/xasy2asy.py + M /trunk/asymptote/base/plain_constants.asy + M /trunk/asymptote/doc/asymptote.texi + M /trunk/asymptote/fileio.h + M /trunk/asymptote/interact.cc + M /trunk/asymptote/runfile.in + M /trunk/asymptote/settings.cc + +Workaround limited pipe support in cygwin. + +------------------------------------------------------------------------ +r5430 | jcbowman | 2012-05-29 23:06:58 -0600 (Tue, 29 May 2012) | 2 lines +Changed paths: + M /trunk/asymptote/settings.cc + +Fix type in conditional. + +------------------------------------------------------------------------ +r5429 | jcbowman | 2012-05-29 10:02:48 -0600 (Tue, 29 May 2012) | 2 lines +Changed paths: + M /trunk/asymptote/GUI/xasy2asy.py + M /trunk/asymptote/GUI/xasyMainWin.py + M /trunk/asymptote/doc/asymptote.texi + +Update diagnostics and documentation. + +------------------------------------------------------------------------ +r5428 | jcbowman | 2012-05-29 07:20:20 -0600 (Tue, 29 May 2012) | 2 lines +Changed paths: + M /trunk/asymptote/configure.ac + M /trunk/asymptote/glrender.cc + M /trunk/asymptote/locate.cc + M /trunk/asymptote/main.cc + M /trunk/asymptote/picture.cc + M /trunk/asymptote/psfile.cc + M /trunk/asymptote/runlabel.in + M /trunk/asymptote/runsystem.in + M /trunk/asymptote/settings.cc + M /trunk/asymptote/util.cc + +Support compilation of native CYGWIN binaries. + +------------------------------------------------------------------------ +r5427 | jcbowman | 2012-05-29 06:12:56 -0600 (Tue, 29 May 2012) | 2 lines +Changed paths: + M /trunk/asymptote/fileio.h + +Fix pair and triple pipe output. + +------------------------------------------------------------------------ +r5426 | jcbowman | 2012-05-29 06:09:25 -0600 (Tue, 29 May 2012) | 2 lines +Changed paths: + M /trunk/asymptote/fileio.h + +Simplify opipe formatting. + +------------------------------------------------------------------------ +r5425 | jcbowman | 2012-05-29 04:30:35 -0600 (Tue, 29 May 2012) | 2 lines +Changed paths: + M /trunk/asymptote/fileio.h + +Work around compiler bug. + +------------------------------------------------------------------------ +r5424 | jcbowman | 2012-05-29 03:34:25 -0600 (Tue, 29 May 2012) | 2 lines +Changed paths: + M /trunk/asymptote/Makefile.in + +Fix makefile. + +------------------------------------------------------------------------ +r5423 | jcbowman | 2012-05-29 02:24:29 -0600 (Tue, 29 May 2012) | 2 lines +Changed paths: + M /trunk/asymptote/Makefile.in + +Improve msdos build. + +------------------------------------------------------------------------ +r5422 | jcbowman | 2012-05-29 02:19:52 -0600 (Tue, 29 May 2012) | 2 lines +Changed paths: + M /trunk/asymptote/Makefile.in + +Fix MSDOS makefile dependencies. + +------------------------------------------------------------------------ +r5421 | jcbowman | 2012-05-29 00:03:06 -0600 (Tue, 29 May 2012) | 1 line +Changed paths: + M /trunk/asymptote/util.h + +Fix CYGWIN build. +------------------------------------------------------------------------ +r5420 | jcbowman | 2012-05-28 23:58:08 -0600 (Mon, 28 May 2012) | 2 lines +Changed paths: + M /trunk/asymptote/configure.ac + +Reinstate -fno-var-tracking option for older compilers. + +------------------------------------------------------------------------ +r5419 | jcbowman | 2012-05-28 22:42:37 -0600 (Mon, 28 May 2012) | 2 lines +Changed paths: + M /trunk/asymptote/interact.cc + +Support arbitrarily long input lines in xasy. + +------------------------------------------------------------------------ +r5418 | jcbowman | 2012-05-28 17:29:40 -0600 (Mon, 28 May 2012) | 2 lines +Changed paths: + M /trunk/asymptote/GUI/xasyOptionsDialog.py + +Remove broken asy path validation code. + +------------------------------------------------------------------------ +r5417 | jcbowman | 2012-05-28 16:30:26 -0600 (Mon, 28 May 2012) | 2 lines +Changed paths: + M /trunk/asymptote/Makefile.in + M /trunk/asymptote/configure.ac + +Fix warning messages. + +------------------------------------------------------------------------ +r5416 | jcbowman | 2012-05-28 14:52:16 -0600 (Mon, 28 May 2012) | 2 lines +Changed paths: + M /trunk/asymptote/fileio.h + +Fix portability issues. + +------------------------------------------------------------------------ +r5415 | jcbowman | 2012-05-28 09:47:51 -0600 (Mon, 28 May 2012) | 2 lines +Changed paths: + M /trunk/asymptote/GUI/xasy2asy.py + M /trunk/asymptote/GUI/xasyMainWin.py + M /trunk/asymptote/base/plain_constants.asy + M /trunk/asymptote/fileio.cc + M /trunk/asymptote/fileio.h + M /trunk/asymptote/interact.cc + M /trunk/asymptote/runfile.in + M /trunk/asymptote/runpicture.in + M /trunk/asymptote/runsystem.in + M /trunk/asymptote/settings.cc + +Use pipes for xasy communication. + +------------------------------------------------------------------------ +r5414 | jcbowman | 2012-05-25 09:04:06 -0600 (Fri, 25 May 2012) | 2 lines +Changed paths: + M /trunk/asymptote/examples/electromagnetic.asy + +Improve example. + +------------------------------------------------------------------------ +r5413 | jcbowman | 2012-05-25 09:02:15 -0600 (Fri, 25 May 2012) | 2 lines +Changed paths: + M /trunk/asymptote/base/three_arrows.asy + +Fix division by zero. + +------------------------------------------------------------------------ +r5412 | jcbowman | 2012-05-25 09:00:56 -0600 (Fri, 25 May 2012) | 2 lines +Changed paths: + M /trunk/asymptote/base/graph.asy + +Don't autoscale ticks when N is specified and autoscale is false. + +------------------------------------------------------------------------ +r5411 | jcbowman | 2012-05-25 08:57:08 -0600 (Fri, 25 May 2012) | 2 lines +Changed paths: + M /trunk/asymptote/base/three.asy + M /trunk/asymptote/doc/asymptote.texi + +Add new new routine for computing camera positions. + +------------------------------------------------------------------------ +r5410 | jcbowman | 2012-05-24 22:38:45 -0600 (Thu, 24 May 2012) | 2 lines +Changed paths: + M /trunk/asymptote/Makefile.in + M /trunk/asymptote/configure.ac + M /trunk/asymptote/doc/asymptote.texi + +Update to gc-7.2b. + +------------------------------------------------------------------------ +r5409 | jcbowman | 2012-05-24 15:49:39 -0600 (Thu, 24 May 2012) | 8 lines +Changed paths: + M /trunk/asymptote/base/three_surface.asy + M /trunk/asymptote/examples/splitpatch.asy + +Respect straight flag in external(). + +Add partialu and partialv derivatives for patches. + +Add a general split function. + +Move split structure into splitpatch example. + +------------------------------------------------------------------------ +r5408 | jcbowman | 2012-05-19 22:51:47 -0600 (Sat, 19 May 2012) | 2 lines +Changed paths: + M /trunk/asymptote/base/palette.asy + +Fix palette range (bug 3487991). + +------------------------------------------------------------------------ +r5407 | jcbowman | 2012-05-19 14:38:43 -0600 (Sat, 19 May 2012) | 2 lines +Changed paths: + M /trunk/asymptote/configure.ac + +Remove obsolete --no-var-tracking compilation option. + +------------------------------------------------------------------------ +r5406 | jcbowman | 2012-05-19 13:44:58 -0600 (Sat, 19 May 2012) | 2 lines +Changed paths: + M /trunk/asymptote/prc/oPRCFile.cc + +Remove unused value. + +------------------------------------------------------------------------ +r5405 | jcbowman | 2012-05-19 13:21:30 -0600 (Sat, 19 May 2012) | 2 lines +Changed paths: + M /trunk/asymptote/main.cc + +Block SIGCHLD. + +------------------------------------------------------------------------ +r5404 | jcbowman | 2012-05-19 13:20:12 -0600 (Sat, 19 May 2012) | 2 lines +Changed paths: + M /trunk/asymptote/common.h + +Force assert to be active. + +------------------------------------------------------------------------ +r5403 | jcbowman | 2012-05-19 10:55:16 -0600 (Sat, 19 May 2012) | 2 lines +Changed paths: + M /trunk/asymptote/base/graph.asy + M /trunk/asymptote/base/graph3.asy + +Fix manual tick scaling. + +------------------------------------------------------------------------ +r5402 | jcbowman | 2012-05-19 09:40:33 -0600 (Sat, 19 May 2012) | 3 lines +Changed paths: + M /trunk/asymptote/base/graph.asy + M /trunk/asymptote/base/graph3.asy + M /trunk/asymptote/base/plain_Label.asy + M /trunk/asymptote/doc/asymptote.texi + +Use currentpen rather than nullpen so that current value of currentpen is +respected. + +------------------------------------------------------------------------ +r5401 | jcbowman | 2012-05-15 05:54:54 -0600 (Tue, 15 May 2012) | 2 lines +Changed paths: + A /trunk/asymptote/config.guess + +Add missing file. + +------------------------------------------------------------------------ +r5400 | jcbowman | 2012-05-15 05:50:40 -0600 (Tue, 15 May 2012) | 1 line +Changed paths: + A /trunk/asymptote/config.sub + +Add missing file. +------------------------------------------------------------------------ +r5399 | jcbowman | 2012-05-15 05:36:47 -0600 (Tue, 15 May 2012) | 2 lines +Changed paths: + A /trunk/asymptote/ax_pthread.m4 + +Add missing file. + +------------------------------------------------------------------------ +r5398 | jcbowman | 2012-05-15 05:28:40 -0600 (Tue, 15 May 2012) | 2 lines +Changed paths: + M /trunk/asymptote/Makefile.in + M /trunk/asymptote/asymptote.spec + M /trunk/asymptote/common.h + M /trunk/asymptote/configure.ac + M /trunk/asymptote/glrender.cc + M /trunk/asymptote/main.cc + M /trunk/asymptote/picture.cc + M /trunk/asymptote/settings.h + +Update POSIX thread support. + +------------------------------------------------------------------------ +r5397 | jcbowman | 2012-05-15 03:49:45 -0600 (Tue, 15 May 2012) | 2 lines +Changed paths: + M /trunk/asymptote/pipestream.h + +Fix warning message. + +------------------------------------------------------------------------ +r5396 | jcbowman | 2012-05-15 03:08:30 -0600 (Tue, 15 May 2012) | 4 lines +Changed paths: + M /trunk/asymptote/Makefile.in + M /trunk/asymptote/configure.ac + M /trunk/asymptote/doc/asymptote.texi + +Update to gc-7.2. + +Simplify makefile; fix shared library version. + +------------------------------------------------------------------------ +r5395 | jcbowman | 2012-05-10 18:06:16 -0600 (Thu, 10 May 2012) | 2 lines +Changed paths: + M /trunk/asymptote/process.cc + +Fix the erase command so it behaves as documented (no reset). + +------------------------------------------------------------------------ +r5394 | jcbowman | 2012-05-10 15:54:47 -0600 (Thu, 10 May 2012) | 2 lines +Changed paths: + M /trunk/asymptote/doc/asy-latex.dtx + M /trunk/asymptote/doc/latexusage.tex + +Don't force a default viewportwidth. + +------------------------------------------------------------------------ +r5393 | jcbowman | 2012-05-10 15:47:54 -0600 (Thu, 10 May 2012) | 2 lines +Changed paths: + M /trunk/asymptote/doc/asymptote.texi + M /trunk/asymptote/examples/animations/wheel.asy + +Improve wheel.asy example to allow pdf animations. + +------------------------------------------------------------------------ +r5392 | jcbowman | 2012-05-10 15:27:32 -0600 (Thu, 10 May 2012) | 2 lines +Changed paths: + M /trunk/asymptote/base/three_surface.asy + M /trunk/asymptote/examples/splitpatch.asy + +Fix split structure. + +------------------------------------------------------------------------ +r5391 | jcbowman | 2012-05-09 13:24:12 -0600 (Wed, 09 May 2012) | 2 lines +Changed paths: + A /trunk/asymptote/EnvVarUpdate.nsh + A /trunk/asymptote/lnkX64IconFix.nsh + +Add NSIS support files. + +------------------------------------------------------------------------ +r5390 | jcbowman | 2012-05-09 12:51:37 -0600 (Wed, 09 May 2012) | 2 lines +Changed paths: + M /trunk/asymptote/asymptote.nsi + +Fix icon directory on 64-bit MSWindows systems. + +------------------------------------------------------------------------ +r5389 | jcbowman | 2012-05-09 12:42:42 -0600 (Wed, 09 May 2012) | 2 lines +Changed paths: + M /trunk/asymptote/base/solids.asy + M /trunk/asymptote/examples/hyperboloid.asy + M /trunk/asymptote/examples/hyperboloidsilhouette.asy + +Remove obsolete constructor; update examples. + +------------------------------------------------------------------------ +r5388 | jcbowman | 2012-05-09 12:40:29 -0600 (Wed, 09 May 2012) | 2 lines +Changed paths: + M /trunk/asymptote/doc/asymptote.texi + +Update documentation. + +------------------------------------------------------------------------ +r5387 | jcbowman | 2012-05-03 19:39:30 -0600 (Thu, 03 May 2012) | 2 lines +Changed paths: + M /trunk/asymptote/base/three_surface.asy + M /trunk/asymptote/examples/splitpatch.asy + +Make split compute subpatches for each input patch. + +------------------------------------------------------------------------ +r5386 | hammera | 2012-03-28 20:36:39 -0600 (Wed, 28 Mar 2012) | 2 lines +Changed paths: + M /trunk/asymptote/tests/Makefile + A /trunk/asymptote/tests/pic + A /trunk/asymptote/tests/pic/trans.asy + +Add picture bounds test. + +------------------------------------------------------------------------ +r5385 | hammera | 2012-03-28 20:35:51 -0600 (Wed, 28 Mar 2012) | 2 lines +Changed paths: + M /trunk/asymptote/base/plain_bounds.asy + +Changed name of class to avoid confusion. + +------------------------------------------------------------------------ +r5384 | hammera | 2012-03-28 18:48:45 -0600 (Wed, 28 Mar 2012) | 2 lines +Changed paths: + M /trunk/asymptote/base/plain_bounds.asy + +Fix translated bound error. + +------------------------------------------------------------------------ +r5383 | jcbowman | 2012-01-26 09:09:57 -0700 (Thu, 26 Jan 2012) | 2 lines +Changed paths: + M /trunk/asymptote/path.cc + +Fix numerical underflow. + +------------------------------------------------------------------------ +r5382 | hammera | 2011-12-28 14:08:25 -0700 (Wed, 28 Dec 2011) | 2 lines +Changed paths: + M /trunk/asymptote/application.cc + M /trunk/asymptote/application.h + M /trunk/asymptote/errors + M /trunk/asymptote/exp.h + M /trunk/asymptote/tests/types/keyword.asy + A /trunk/asymptote/tests/types/order.asy + +Allow named arguments after rest arguments. + +------------------------------------------------------------------------ +r5381 | hammera | 2011-12-28 14:08:00 -0700 (Wed, 28 Dec 2011) | 2 lines +Changed paths: + M /trunk/asymptote/program.cc + +Nicer debug output with COMPACT flag. + +------------------------------------------------------------------------ +r5380 | hammera | 2011-12-28 14:07:37 -0700 (Wed, 28 Dec 2011) | 2 lines +Changed paths: + M /trunk/asymptote/stack.cc + +Refactor vm::frame allocation. + +------------------------------------------------------------------------ +r5379 | wspr | 2011-12-18 00:07:26 -0700 (Sun, 18 Dec 2011) | 1 line +Changed paths: + M /trunk/asymptote/doc/asy-latex.dtx + +fix \CatchFileDef fallback command +------------------------------------------------------------------------ +r5378 | jcbowman | 2011-12-16 01:05:37 -0700 (Fri, 16 Dec 2011) | 2 lines +Changed paths: + M /trunk/asymptote/runstring.in + +Fix trailing zero removal. + +------------------------------------------------------------------------ +r5377 | jcbowman | 2011-12-11 21:46:58 -0700 (Sun, 11 Dec 2011) | 3 lines +Changed paths: + M /trunk/asymptote/base/plain_strings.asy + M /trunk/asymptote/doc/asymptote.texi + M /trunk/asymptote/runstring.in + +Make format more consistent with fprintf; add a defaultseparator argument +for typesetting scientific notation. + +------------------------------------------------------------------------ +r5376 | jcbowman | 2011-11-19 16:08:57 -0700 (Sat, 19 Nov 2011) | 2 lines +Changed paths: + M /trunk/asymptote/doc/asymptote.texi + +Work around quote translation problem. + +------------------------------------------------------------------------ +r5375 | jcbowman | 2011-11-16 18:37:09 -0700 (Wed, 16 Nov 2011) | 1 line +Changed paths: + M /trunk/asymptote/asymptote.spec + M /trunk/asymptote/configure.ac + +Increment version to 2.16svn. +------------------------------------------------------------------------ +r5374 | jcbowman | 2011-11-16 14:35:43 -0700 (Wed, 16 Nov 2011) | 2 lines +Changed paths: + M /trunk/asymptote/runtime.in + +Add missing isnan declaration for MacOS X. + +------------------------------------------------------------------------ +r5373 | jcbowman | 2011-11-16 01:55:41 -0700 (Wed, 16 Nov 2011) | 1 line +Changed paths: + M /trunk/asymptote/configure.ac + +Increment version to 2.15svn. +------------------------------------------------------------------------ +r5372 | jcbowman | 2011-11-16 00:58:35 -0700 (Wed, 16 Nov 2011) | 1 line +Changed paths: + M /trunk/asymptote/util.h + +Add missing CYGWIN declarations. +------------------------------------------------------------------------ +r5371 | jcbowman | 2011-11-15 23:20:57 -0700 (Tue, 15 Nov 2011) | 2 lines +Changed paths: + M /trunk/asymptote/base/solids.asy + M /trunk/asymptote/examples/animations/earthmoon.asy + M /trunk/asymptote/examples/animations/sphere.asy + A /trunk/asymptote/examples/pseudosphere.asy + A /trunk/asymptote/tests/gc/label.asy + A /trunk/asymptote/tests/gc/shipout.asy + +Update examples. + +------------------------------------------------------------------------ +r5370 | jcbowman | 2011-11-15 14:23:53 -0700 (Tue, 15 Nov 2011) | 2 lines +Changed paths: + M /trunk/asymptote/doc/asyRefCard.tex + +Fix typo. + +------------------------------------------------------------------------ +r5369 | jcbowman | 2011-11-15 14:18:41 -0700 (Tue, 15 Nov 2011) | 4 lines +Changed paths: + M /trunk/asymptote/base/geometry.asy + M /trunk/asymptote/base/plain_Label.asy + M /trunk/asymptote/doc/Makefile.in + A /trunk/asymptote/doc/asyRefCard.tex + M /trunk/asymptote/doc/asymptote.texi + +Move obsolete rotate(explicit pair dir) routine to geometry module. + +Add quick reference card. + +------------------------------------------------------------------------ +r5368 | jcbowman | 2011-11-15 14:17:39 -0700 (Tue, 15 Nov 2011) | 2 lines +Changed paths: + M /trunk/asymptote/base/three.asy + +Fix render=0 bugs. + +------------------------------------------------------------------------ +r5367 | jcbowman | 2011-11-15 13:04:28 -0700 (Tue, 15 Nov 2011) | 3 lines +Changed paths: + M /trunk/asymptote/doc/asymptote.texi + M /trunk/asymptote/gsl.cc + +Implement Jacobi elliptic function sndncn(real u, real m), which returns +real[] {sn,dn,cn}. + +------------------------------------------------------------------------ +r5366 | jcbowman | 2011-11-15 12:36:33 -0700 (Tue, 15 Nov 2011) | 2 lines +Changed paths: + M /trunk/asymptote/doc/asymptote.texi + M /trunk/asymptote/runstring.in + +Implement int ascii(string s). + +------------------------------------------------------------------------ +r5365 | jcbowman | 2011-11-15 12:27:56 -0700 (Tue, 15 Nov 2011) | 2 lines +Changed paths: + M /trunk/asymptote/doc/Makefile.in + +Added manpage target to build man page only. + +------------------------------------------------------------------------ +r5364 | jcbowman | 2011-11-15 11:45:15 -0700 (Tue, 15 Nov 2011) | 2 lines +Changed paths: + M /trunk/asymptote/asymptote.spec + M /trunk/asymptote/doc/asymptote.texi + M /trunk/asymptote/runtime.in + +Add bool isnan(real). + +------------------------------------------------------------------------ +r5363 | jcbowman | 2011-11-15 01:45:48 -0700 (Tue, 15 Nov 2011) | 2 lines +Changed paths: + M /trunk/asymptote/base/three.asy + M /trunk/asymptote/base/three_surface.asy + +Fix preview surfaces with render=0. + +------------------------------------------------------------------------ +r5362 | jcbowman | 2011-11-14 23:55:06 -0700 (Mon, 14 Nov 2011) | 2 lines +Changed paths: + M /trunk/asymptote/fileio.h + +Fix string reads from binary files. + +------------------------------------------------------------------------ +r5361 | jcbowman | 2011-11-14 23:53:24 -0700 (Mon, 14 Nov 2011) | 2 lines +Changed paths: + M /trunk/asymptote/doc/asymptote.texi + +Blank lines are not allowed after \begin{asy}. + +------------------------------------------------------------------------ +r5360 | jcbowman | 2011-11-14 23:00:27 -0700 (Mon, 14 Nov 2011) | 2 lines +Changed paths: + M /trunk/asymptote/base/three.asy + +Generate missing preview images for fitted pictures. + +------------------------------------------------------------------------ +r5359 | jcbowman | 2011-11-14 16:52:20 -0700 (Mon, 14 Nov 2011) | 2 lines +Changed paths: + M /trunk/asymptote/base/solids.asy + +Fix draw(revolution). + +------------------------------------------------------------------------ +r5358 | jcbowman | 2011-11-10 17:07:05 -0700 (Thu, 10 Nov 2011) | 2 lines +Changed paths: + M /trunk/asymptote/base/graph.asy + M /trunk/asymptote/base/solids.asy + +Fix axis bug introduced in r5349. + +------------------------------------------------------------------------ +r5357 | jcbowman | 2011-09-30 08:23:17 -0600 (Fri, 30 Sep 2011) | 2 lines +Changed paths: + M /trunk/asymptote/pen.h + M /trunk/asymptote/prc/writePRC.cc + +Portability fixes. + +------------------------------------------------------------------------ +r5356 | jcbowman | 2011-09-29 22:14:23 -0600 (Thu, 29 Sep 2011) | 2 lines +Changed paths: + M /trunk/asymptote/drawlabel.cc + M /trunk/asymptote/pen.cc + +Move lastpen to the end of pen.cc so that it is initialized last. + +------------------------------------------------------------------------ +r5355 | hammera | 2011-09-29 13:32:22 -0600 (Thu, 29 Sep 2011) | 2 lines +Changed paths: + M /trunk/asymptote/impdatum.cc + M /trunk/asymptote/policy.h + +Change Int to int_typ in policy.h + +------------------------------------------------------------------------ +r5354 | jcbowman | 2011-09-29 08:38:53 -0600 (Thu, 29 Sep 2011) | 2 lines +Changed paths: + M /trunk/asymptote/process.cc + +Avoid compiler warnings about virtual function overloading. + +------------------------------------------------------------------------ +r5353 | jcbowman | 2011-09-29 07:54:09 -0600 (Thu, 29 Sep 2011) | 2 lines +Changed paths: + M /trunk/asymptote/drawfill.cc + M /trunk/asymptote/pen.cc + M /trunk/asymptote/pen.h + +Avoid further static initialization issues (courtesy of Michail Vidiassov). + +------------------------------------------------------------------------ +r5352 | jcbowman | 2011-09-29 07:50:13 -0600 (Thu, 29 Sep 2011) | 2 lines +Changed paths: + M /trunk/asymptote/runtime.in + +Remove extraneous comparison. + +------------------------------------------------------------------------ +r5351 | jcbowman | 2011-09-29 07:42:10 -0600 (Thu, 29 Sep 2011) | 2 lines +Changed paths: + M /trunk/asymptote/camp.l + +Avoid unused function warning message. + +------------------------------------------------------------------------ +r5350 | jcbowman | 2011-09-29 07:04:03 -0600 (Thu, 29 Sep 2011) | 2 lines +Changed paths: + M /trunk/asymptote/dec.h + M /trunk/asymptote/drawelement.h + M /trunk/asymptote/drawpath3.h + M /trunk/asymptote/exp.h + M /trunk/asymptote/impdatum.cc + M /trunk/asymptote/program.h + M /trunk/asymptote/record.h + M /trunk/asymptote/settings.cc + M /trunk/asymptote/stack.h + M /trunk/asymptote/texfile.cc + M /trunk/asymptote/texfile.h + M /trunk/asymptote/vm.h + +Fix warning messages. + +------------------------------------------------------------------------ +r5349 | jcbowman | 2011-09-29 06:25:04 -0600 (Thu, 29 Sep 2011) | 2 lines +Changed paths: + M /trunk/asymptote/base/graph.asy + M /trunk/asymptote/base/graph3.asy + +Fix extended axes. + +------------------------------------------------------------------------ +r5348 | jcbowman | 2011-09-28 11:51:42 -0600 (Wed, 28 Sep 2011) | 2 lines +Changed paths: + M /trunk/asymptote/Makefile.in + A /trunk/asymptote/pen.cc + M /trunk/asymptote/pen.h + M /trunk/asymptote/process.h + +Work around static initialization fiasco. + +------------------------------------------------------------------------ +r5347 | jcbowman | 2011-09-28 11:17:50 -0600 (Wed, 28 Sep 2011) | 2 lines +Changed paths: + M /trunk/asymptote/access.h + +Fix typo. + +------------------------------------------------------------------------ +r5346 | jcbowman | 2011-09-28 10:49:33 -0600 (Wed, 28 Sep 2011) | 2 lines +Changed paths: + M /trunk/asymptote/base/plain_paths.asy + M /trunk/asymptote/doc/asymptote.texi + M /trunk/asymptote/runpath.in + +Update documentation. + +------------------------------------------------------------------------ +r5345 | jcbowman | 2011-09-28 10:44:41 -0600 (Wed, 28 Sep 2011) | 2 lines +Changed paths: + M /trunk/asymptote/drawimage.h + +Remove unused member. + +------------------------------------------------------------------------ +r5344 | jcbowman | 2011-09-28 10:24:10 -0600 (Wed, 28 Sep 2011) | 2 lines +Changed paths: + M /trunk/asymptote/gsl.cc + +Fix comparison. + +------------------------------------------------------------------------ +r5343 | jcbowman | 2011-09-28 10:16:20 -0600 (Wed, 28 Sep 2011) | 2 lines +Changed paths: + M /trunk/asymptote/glrender.cc + +Remove extraneous comparisons. + +------------------------------------------------------------------------ +r5342 | jcbowman | 2011-09-28 10:12:33 -0600 (Wed, 28 Sep 2011) | 2 lines +Changed paths: + M /trunk/asymptote/texfile.cc + +Fix comparison. + +------------------------------------------------------------------------ +r5341 | hammera | 2011-09-19 21:18:30 -0600 (Mon, 19 Sep 2011) | 2 lines +Changed paths: + M /trunk/asymptote/Makefile.in + M /trunk/asymptote/stm.cc + +TRANSJUMP no longer an option. + +------------------------------------------------------------------------ +r5340 | hammera | 2011-09-15 16:15:35 -0600 (Thu, 15 Sep 2011) | 2 lines +Changed paths: + M /trunk/asymptote/camp.l + M /trunk/asymptote/opsymbols.pl + M /trunk/asymptote/tests/types/constructor.asy + +Add 'operator tuple' via EXTRASYMBOL command. + +------------------------------------------------------------------------ +r5339 | jcbowman | 2011-09-15 09:23:55 -0600 (Thu, 15 Sep 2011) | 2 lines +Changed paths: + M /trunk/asymptote/camp.l + +Fix build. + +------------------------------------------------------------------------ +r5338 | hammera | 2011-09-07 20:39:57 -0600 (Wed, 07 Sep 2011) | 2 lines +Changed paths: + M /trunk/asymptote/aspy.py + +Add operator overloading to aspy. + +------------------------------------------------------------------------ +r5337 | hammera | 2011-09-07 18:29:08 -0600 (Wed, 07 Sep 2011) | 2 lines +Changed paths: + M /trunk/asymptote/builtin.cc + M /trunk/asymptote/camp.y + M /trunk/asymptote/tests/types/constructor.asy + +Add 'operator tuple'. + +------------------------------------------------------------------------ +r5336 | hammera | 2011-09-05 18:01:39 -0600 (Mon, 05 Sep 2011) | 2 lines +Changed paths: + M /trunk/asymptote/Makefile.in + A /trunk/asymptote/aspy.py + M /trunk/asymptote/common.h + M /trunk/asymptote/dec.cc + M /trunk/asymptote/dec.h + M /trunk/asymptote/errormsg.cc + M /trunk/asymptote/genv.cc + A /trunk/asymptote/impdatum.cc + M /trunk/asymptote/main.cc + M /trunk/asymptote/picture.cc + A /trunk/asymptote/policy.h + M /trunk/asymptote/process.cc + M /trunk/asymptote/settings.cc + M /trunk/asymptote/stack.cc + M /trunk/asymptote/stm.h + M /trunk/asymptote/types.h + +Can compile Asymptote as a shared library. + +------------------------------------------------------------------------ +r5335 | jcbowman | 2011-08-30 16:10:39 -0600 (Tue, 30 Aug 2011) | 4 lines +Changed paths: + M /trunk/asymptote/builtin.cc + M /trunk/asymptote/doc/asymptote.texi + M /trunk/asymptote/examples/ring.asy + M /trunk/asymptote/runarray.in + M /trunk/asymptote/runstring.in + +Generalize copy, map, and sequence functions to arbitrary depths. + +Add locale string to format(string,int). + +------------------------------------------------------------------------ +r5334 | jcbowman | 2011-08-22 10:46:31 -0600 (Mon, 22 Aug 2011) | 2 lines +Changed paths: + M /trunk/asymptote/base/plain_bounds.asy + +Improve nullpath handling. + +------------------------------------------------------------------------ +r5333 | jcbowman | 2011-08-22 09:22:55 -0600 (Mon, 22 Aug 2011) | 2 lines +Changed paths: + M /trunk/asymptote/base/plain_bounds.asy + +Allow draw(nullpath) again. + +------------------------------------------------------------------------ +r5332 | jcbowman | 2011-08-21 18:31:43 -0600 (Sun, 21 Aug 2011) | 2 lines +Changed paths: + M /trunk/asymptote/doc/asy-latex.dtx + +Update version number. + +------------------------------------------------------------------------ +r5331 | jcbowman | 2011-08-21 16:09:54 -0600 (Sun, 21 Aug 2011) | 2 lines +Changed paths: + M /trunk/asymptote/util.h + +Remove portability tweak for MIPS. + +------------------------------------------------------------------------ +r5330 | jcbowman | 2011-08-21 15:09:03 -0600 (Sun, 21 Aug 2011) | 2 lines +Changed paths: + M /trunk/asymptote/util.cc + +Specify arbitrary size if MAXPATHLEN is undefined. + +------------------------------------------------------------------------ +r5329 | wspr | 2011-08-17 02:51:20 -0600 (Wed, 17 Aug 2011) | 3 lines +Changed paths: + M /trunk/asymptote/doc/asy-latex.dtx + +some missing comment chars in \asyinclude + +also bumped the version number of the .sty by a minor increment (hope this is okay) +------------------------------------------------------------------------ +r5328 | jcbowman | 2011-08-13 02:50:17 -0600 (Sat, 13 Aug 2011) | 2 lines +Changed paths: + M /trunk/asymptote/base/plain_markers.asy + +Build Mark and MarkFill from MarkPath. + +------------------------------------------------------------------------ +r5327 | jcbowman | 2011-08-12 23:50:06 -0600 (Fri, 12 Aug 2011) | 2 lines +Changed paths: + M /trunk/asymptote/base/plain_markers.asy + +Implement markthin(path) marker with opacity thinning. + +------------------------------------------------------------------------ +r5326 | jcbowman | 2011-08-04 21:48:05 -0600 (Thu, 04 Aug 2011) | 2 lines +Changed paths: + M /trunk/asymptote/README + +Update link to cygwin1.dll source code. + +------------------------------------------------------------------------ +r5325 | jcbowman | 2011-07-12 08:35:36 -0600 (Tue, 12 Jul 2011) | 2 lines +Changed paths: + M /trunk/asymptote/drawsurface.cc + +Disable billboard interaction for offscreen rendering. + +------------------------------------------------------------------------ +r5324 | pivaldi | 2011-06-29 10:09:51 -0600 (Wed, 29 Jun 2011) | 1 line +Changed paths: + M /trunk/asymptote/base/geometry.asy + +Fix double drawing of path when showing triangle in geometry.asy +------------------------------------------------------------------------ +r5323 | pivaldi | 2011-06-27 16:35:42 -0600 (Mon, 27 Jun 2011) | 1 line +Changed paths: + M /trunk/asymptote/base/geometry.asy + +remove trailing char +------------------------------------------------------------------------ +r5322 | pivaldi | 2011-06-27 11:04:13 -0600 (Mon, 27 Jun 2011) | 4 lines +Changed paths: + M /trunk/asymptote/base/geometry.asy + +Fix arc orientation in arcfromcenter +Enable again arcfromcenter for line (with explicit constraint) +Cleaning and improving code + +------------------------------------------------------------------------ +r5321 | pivaldi | 2011-06-23 08:58:15 -0600 (Thu, 23 Jun 2011) | 1 line +Changed paths: + M /trunk/asymptote/base/geometry.asy + +Remove previous modification in geometry.asy +------------------------------------------------------------------------ +r5320 | jcbowman | 2011-06-22 20:55:18 -0600 (Wed, 22 Jun 2011) | 2 lines +Changed paths: + M /trunk/asymptote/Makefile.in + +Prebuilt target should not rebuild asy-keywords.el. + +------------------------------------------------------------------------ +r5319 | pivaldi | 2011-06-20 14:56:04 -0600 (Mon, 20 Jun 2011) | 1 line +Changed paths: + M /trunk/asymptote/base/geometry.asy + +Fix inverse(real, point, point) in geometry.asy +------------------------------------------------------------------------ +r5318 | jcbowman | 2011-06-19 17:29:55 -0600 (Sun, 19 Jun 2011) | 2 lines +Changed paths: + M /trunk/asymptote/process.cc + +Print version number with -vv. + +------------------------------------------------------------------------ +r5317 | jcbowman | 2011-06-19 13:34:43 -0600 (Sun, 19 Jun 2011) | 1 line +Changed paths: + M /trunk/asymptote/asymptote.spec + M /trunk/asymptote/configure.ac + +Increment version to 2.14svn. +------------------------------------------------------------------------ r5316 | jcbowman | 2011-06-19 07:40:51 -0600 (Sun, 19 Jun 2011) | 2 lines Changed paths: M /trunk/asymptote/configure.ac diff --git a/Build/source/utils/asymptote/EnvVarUpdate.nsh b/Build/source/utils/asymptote/EnvVarUpdate.nsh new file mode 100755 index 00000000000..839d6a02062 --- /dev/null +++ b/Build/source/utils/asymptote/EnvVarUpdate.nsh @@ -0,0 +1,327 @@ +/**
+ * EnvVarUpdate.nsh
+ * : Environmental Variables: append, prepend, and remove entries
+ *
+ * WARNING: If you use StrFunc.nsh header then include it before this file
+ * with all required definitions. This is to avoid conflicts
+ *
+ * Usage:
+ * ${EnvVarUpdate} "ResultVar" "EnvVarName" "Action" "RegLoc" "PathString"
+ *
+ * Credits:
+ * Version 1.0
+ * * Cal Turney (turnec2)
+ * * Amir Szekely (KiCHiK) and e-circ for developing the forerunners of this
+ * function: AddToPath, un.RemoveFromPath, AddToEnvVar, un.RemoveFromEnvVar,
+ * WriteEnvStr, and un.DeleteEnvStr
+ * * Diego Pedroso (deguix) for StrTok
+ * * Kevin English (kenglish_hi) for StrContains
+ * * Hendri Adriaens (Smile2Me), Diego Pedroso (deguix), and Dan Fuhry
+ * (dandaman32) for StrReplace
+ *
+ * Version 1.1 (compatibility with StrFunc.nsh)
+ * * techtonik
+ *
+ * http://nsis.sourceforge.net/Environmental_Variables:_append%2C_prepend%2C_and_remove_entries
+ *
+ */
+
+
+!ifndef ENVVARUPDATE_FUNCTION
+!define ENVVARUPDATE_FUNCTION
+!verbose push
+!verbose 3
+!include "LogicLib.nsh"
+!include "WinMessages.NSH"
+!include "StrFunc.nsh"
+
+; ---- Fix for conflict if StrFunc.nsh is already includes in main file -----------------------
+!macro _IncludeStrFunction StrFuncName
+ !ifndef ${StrFuncName}_INCLUDED
+ ${${StrFuncName}}
+ !endif
+ !ifndef Un${StrFuncName}_INCLUDED
+ ${Un${StrFuncName}}
+ !endif
+ !define un.${StrFuncName} "${Un${StrFuncName}}"
+!macroend
+
+!insertmacro _IncludeStrFunction StrTok
+!insertmacro _IncludeStrFunction StrStr
+!insertmacro _IncludeStrFunction StrRep
+
+; ---------------------------------- Macro Definitions ----------------------------------------
+!macro _EnvVarUpdateConstructor ResultVar EnvVarName Action Regloc PathString
+ Push "${EnvVarName}"
+ Push "${Action}"
+ Push "${RegLoc}"
+ Push "${PathString}"
+ Call EnvVarUpdate
+ Pop "${ResultVar}"
+!macroend
+!define EnvVarUpdate '!insertmacro "_EnvVarUpdateConstructor"'
+
+!macro _unEnvVarUpdateConstructor ResultVar EnvVarName Action Regloc PathString
+ Push "${EnvVarName}"
+ Push "${Action}"
+ Push "${RegLoc}"
+ Push "${PathString}"
+ Call un.EnvVarUpdate
+ Pop "${ResultVar}"
+!macroend
+!define un.EnvVarUpdate '!insertmacro "_unEnvVarUpdateConstructor"'
+; ---------------------------------- Macro Definitions end-------------------------------------
+
+;----------------------------------- EnvVarUpdate start----------------------------------------
+!define hklm_all_users 'HKLM "SYSTEM\CurrentControlSet\Control\Session Manager\Environment"'
+!define hkcu_current_user 'HKCU "Environment"'
+
+!macro EnvVarUpdate UN
+
+Function ${UN}EnvVarUpdate
+
+ Push $0
+ Exch 4
+ Exch $1
+ Exch 3
+ Exch $2
+ Exch 2
+ Exch $3
+ Exch
+ Exch $4
+ Push $5
+ Push $6
+ Push $7
+ Push $8
+ Push $9
+ Push $R0
+
+ /* After this point:
+ -------------------------
+ $0 = ResultVar (returned)
+ $1 = EnvVarName (input)
+ $2 = Action (input)
+ $3 = RegLoc (input)
+ $4 = PathString (input)
+ $5 = Orig EnvVar (read from registry)
+ $6 = Len of $0 (temp)
+ $7 = tempstr1 (temp)
+ $8 = Entry counter (temp)
+ $9 = tempstr2 (temp)
+ $R0 = tempChar (temp) */
+
+ ; Step 1: Read contents of EnvVarName from RegLoc
+ ;
+ ; Check for empty EnvVarName
+ ${If} $1 == ""
+ SetErrors
+ DetailPrint "ERROR: EnvVarName is blank"
+ Goto EnvVarUpdate_Restore_Vars
+ ${EndIf}
+
+ ; Check for valid Action
+ ${If} $2 != "A"
+ ${AndIf} $2 != "P"
+ ${AndIf} $2 != "R"
+ SetErrors
+ DetailPrint "ERROR: Invalid Action - must be A, P, or R"
+ Goto EnvVarUpdate_Restore_Vars
+ ${EndIf}
+
+ ${If} $3 == HKLM
+ ReadRegStr $5 ${hklm_all_users} $1 ; Get EnvVarName from all users into $5
+ ${ElseIf} $3 == HKCU
+ ReadRegStr $5 ${hkcu_current_user} $1 ; Read EnvVarName from current user into $5
+ ${Else}
+ SetErrors
+ DetailPrint 'ERROR: Action is [$3] but must be "HKLM" or HKCU"'
+ Goto EnvVarUpdate_Restore_Vars
+ ${EndIf}
+
+ ; Check for empty PathString
+ ${If} $4 == ""
+ SetErrors
+ DetailPrint "ERROR: PathString is blank"
+ Goto EnvVarUpdate_Restore_Vars
+ ${EndIf}
+
+ ; Make sure we've got some work to do
+ ${If} $5 == ""
+ ${AndIf} $2 == "R"
+ SetErrors
+ DetailPrint "$1 is empty - Nothing to remove"
+ Goto EnvVarUpdate_Restore_Vars
+ ${EndIf}
+
+ ; Step 2: Scrub EnvVar
+ ;
+ StrCpy $0 $5 ; Copy the contents to $0
+ ; Remove spaces around semicolons (NOTE: spaces before the 1st entry or
+ ; after the last one are not removed here but instead in Step 3)
+ ${If} $0 != "" ; If EnvVar is not empty ...
+ ${Do}
+ ${${UN}StrStr} $7 $0 " ;"
+ ${If} $7 == ""
+ ${ExitDo}
+ ${EndIf}
+ ${${UN}StrRep} $0 $0 " ;" ";" ; Remove '<space>;'
+ ${Loop}
+ ${Do}
+ ${${UN}StrStr} $7 $0 "; "
+ ${If} $7 == ""
+ ${ExitDo}
+ ${EndIf}
+ ${${UN}StrRep} $0 $0 "; " ";" ; Remove ';<space>'
+ ${Loop}
+ ${Do}
+ ${${UN}StrStr} $7 $0 ";;"
+ ${If} $7 == ""
+ ${ExitDo}
+ ${EndIf}
+ ${${UN}StrRep} $0 $0 ";;" ";"
+ ${Loop}
+
+ ; Remove a leading or trailing semicolon from EnvVar
+ StrCpy $7 $0 1 0
+ ${If} $7 == ";"
+ StrCpy $0 $0 "" 1 ; Change ';<EnvVar>' to '<EnvVar>'
+ ${EndIf}
+ StrLen $6 $0
+ IntOp $6 $6 - 1
+ StrCpy $7 $0 1 $6
+ ${If} $7 == ";"
+ StrCpy $0 $0 $6 ; Change ';<EnvVar>' to '<EnvVar>'
+ ${EndIf}
+ ; DetailPrint "Scrubbed $1: [$0]" ; Uncomment to debug
+ ${EndIf}
+
+ /* Step 3. Remove all instances of the target path/string (even if "A" or "P")
+ $6 = bool flag (1 = found and removed PathString)
+ $7 = a string (e.g. path) delimited by semicolon(s)
+ $8 = entry counter starting at 0
+ $9 = copy of $0
+ $R0 = tempChar */
+
+ ${If} $5 != "" ; If EnvVar is not empty ...
+ StrCpy $9 $0
+ StrCpy $0 ""
+ StrCpy $8 0
+ StrCpy $6 0
+
+ ${Do}
+ ${${UN}StrTok} $7 $9 ";" $8 "0" ; $7 = next entry, $8 = entry counter
+
+ ${If} $7 == "" ; If we've run out of entries,
+ ${ExitDo} ; were done
+ ${EndIf} ;
+
+ ; Remove leading and trailing spaces from this entry (critical step for Action=Remove)
+ ${Do}
+ StrCpy $R0 $7 1
+ ${If} $R0 != " "
+ ${ExitDo}
+ ${EndIf}
+ StrCpy $7 $7 "" 1 ; Remove leading space
+ ${Loop}
+ ${Do}
+ StrCpy $R0 $7 1 -1
+ ${If} $R0 != " "
+ ${ExitDo}
+ ${EndIf}
+ StrCpy $7 $7 -1 ; Remove trailing space
+ ${Loop}
+ ${If} $7 == $4 ; If string matches, remove it by not appending it
+ StrCpy $6 1 ; Set 'found' flag
+ ${ElseIf} $7 != $4 ; If string does NOT match
+ ${AndIf} $0 == "" ; and the 1st string being added to $0,
+ StrCpy $0 $7 ; copy it to $0 without a prepended semicolon
+ ${ElseIf} $7 != $4 ; If string does NOT match
+ ${AndIf} $0 != "" ; and this is NOT the 1st string to be added to $0,
+ StrCpy $0 $0;$7 ; append path to $0 with a prepended semicolon
+ ${EndIf} ;
+
+ IntOp $8 $8 + 1 ; Bump counter
+ ${Loop} ; Check for duplicates until we run out of paths
+ ${EndIf}
+
+ ; Step 4: Perform the requested Action
+ ;
+ ${If} $2 != "R" ; If Append or Prepend
+ ${If} $6 == 1 ; And if we found the target
+ DetailPrint "Target is already present in $1. It will be removed and"
+ ${EndIf}
+ ${If} $0 == "" ; If EnvVar is (now) empty
+ StrCpy $0 $4 ; just copy PathString to EnvVar
+ ${If} $6 == 0 ; If found flag is either 0
+ ${OrIf} $6 == "" ; or blank (if EnvVarName is empty)
+ DetailPrint "$1 was empty and has been updated with the target"
+ ${EndIf}
+ ${ElseIf} $2 == "A" ; If Append (and EnvVar is not empty),
+ StrCpy $0 $0;$4 ; append PathString
+ ${If} $6 == 1
+ DetailPrint "appended to $1"
+ ${Else}
+ DetailPrint "Target was appended to $1"
+ ${EndIf}
+ ${Else} ; If Prepend (and EnvVar is not empty),
+ StrCpy $0 $4;$0 ; prepend PathString
+ ${If} $6 == 1
+ DetailPrint "prepended to $1"
+ ${Else}
+ DetailPrint "Target was prepended to $1"
+ ${EndIf}
+ ${EndIf}
+ ${Else} ; If Action = Remove
+ ${If} $6 == 1 ; and we found the target
+ DetailPrint "Target was found and removed from $1"
+ ${Else}
+ DetailPrint "Target was NOT found in $1 (nothing to remove)"
+ ${EndIf}
+ ${If} $0 == ""
+ DetailPrint "$1 is now empty"
+ ${EndIf}
+ ${EndIf}
+
+ ; Step 5: Update the registry at RegLoc with the updated EnvVar and announce the change
+ ;
+ ClearErrors
+ ${If} $3 == HKLM
+ WriteRegExpandStr ${hklm_all_users} $1 $0 ; Write it in all users section
+ ${ElseIf} $3 == HKCU
+ WriteRegExpandStr ${hkcu_current_user} $1 $0 ; Write it to current user section
+ ${EndIf}
+
+ IfErrors 0 +4
+ MessageBox MB_OK|MB_ICONEXCLAMATION "Could not write updated $1 to $3"
+ DetailPrint "Could not write updated $1 to $3"
+ Goto EnvVarUpdate_Restore_Vars
+
+ ; "Export" our change
+ SendMessage ${HWND_BROADCAST} ${WM_WININICHANGE} 0 "STR:Environment" /TIMEOUT=5000
+
+ EnvVarUpdate_Restore_Vars:
+ ;
+ ; Restore the user's variables and return ResultVar
+ Pop $R0
+ Pop $9
+ Pop $8
+ Pop $7
+ Pop $6
+ Pop $5
+ Pop $4
+ Pop $3
+ Pop $2
+ Pop $1
+ Push $0 ; Push my $0 (ResultVar)
+ Exch
+ Pop $0 ; Restore his $0
+
+FunctionEnd
+
+!macroend ; EnvVarUpdate UN
+!insertmacro EnvVarUpdate ""
+!insertmacro EnvVarUpdate "un."
+;----------------------------------- EnvVarUpdate end----------------------------------------
+
+!verbose pop
+!endif
diff --git a/Build/source/utils/asymptote/GUI/xasy2asy.py b/Build/source/utils/asymptote/GUI/xasy2asy.py index a86a1e732d1..7779e073f81 100755 --- a/Build/source/utils/asymptote/GUI/xasy2asy.py +++ b/Build/source/utils/asymptote/GUI/xasy2asy.py @@ -25,13 +25,6 @@ except: import CubicBezier -class asyProcessFailure(Exception): - """asy could not be invoked to execute a command because the process has failed.""" - pass - -idCounter = 0; -randString = 'wGd3I26kOcu4ZI4arZZMqoJufO2h1QE2D728f1Lai3aqeTQC9' - quickAsyFailed = True global AsyTempDir @@ -41,10 +34,11 @@ def startQuickAsy(): global quickAsy global quickAsyFailed global AsyTempDir + global fout,fin if quickAsyRunning(): return try: - quickAsy.stdin.close() + fout.close() quickAsy.wait() except: pass @@ -54,9 +48,18 @@ def startQuickAsy(): AsyTempDir=mkdtemp(prefix="asy_", dir="./") else: AsyTempDir=mkdtemp(prefix="asy_")+os.sep - quickAsy = Popen([xasyOptions.options['asyPath'],"-noV","-multiline", - "-interactive","-o"+AsyTempDir], - stdin=PIPE,stdout=PIPE,stderr=STDOUT) + if sys.platform[:3] == 'win': + quickAsy=Popen([xasyOptions.options['asyPath'],"-noV","-multiline","-q", + "-o"+AsyTempDir,"-inpipe=0","-outpipe=2"],stdin=PIPE,stderr=PIPE) + fout=quickAsy.stdin + fin=quickAsy.stderr + else: + (rx,wx) = os.pipe() + (ra,wa) = os.pipe() + quickAsy=Popen([xasyOptions.options['asyPath'],"-noV","-multiline","-q", + "-o"+AsyTempDir,"-inpipe="+str(rx),"-outpipe="+str(wa)]) + fout=os.fdopen(wx,'w') + fin=os.fdopen(ra,'r') if quickAsy.returncode != None: quickAsyFailed = True except: @@ -74,8 +77,7 @@ def quickAsyRunning(): def asyExecute(command): if not quickAsyRunning(): startQuickAsy() - syncQuickAsyOutput() - quickAsy.stdin.write(command) + fout.write(command) def closeConsole(event): global console @@ -96,19 +98,6 @@ def consoleOutput(line): console.insert(END,line) ctl.lift() -def syncQuickAsyOutput(verbose=False,queue=None): - global idCounter - idStr = randString+"-id "+str(idCounter) - idCounter += 1 - quickAsy.stdin.write("\nwrite(\""+idStr+"\");\n") - quickAsy.stdin.flush() - line = quickAsy.stdout.readline() - while not line.endswith(idStr+'\n'): - if verbose: - queue.put(("OUTPUT",line)) - line = quickAsy.stdout.readline() - quickAsy.stdin.flush() - class asyTransform: """A python implementation of an asy transform""" def __init__(self,initTuple,delete=False): @@ -128,7 +117,6 @@ class asyTransform: return str(self.t) def scale(self,s): - #return asyTransform((s*self.t[0],s*self.t[1],s*self.t[2],s*self.t[3],s*self.t[4],s*self.t[5])) return asyTransform((0,0,s,0,0,s))*self def __str__(self): @@ -208,30 +196,27 @@ class asyPen(asyObj): def computeColor(self): """Find out the color of an arbitrary asymptote pen.""" - syncQuickAsyOutput() - quickAsy.stdin.write("pen p="+self.getCode()+';\n') - quickAsy.stdin.write("write(\";\n\");write(colorspace(p));\n") - quickAsy.stdin.write("write(colors(p));\n") - quickAsy.stdin.flush() - testline = quickAsy.stdout.readline() - if testline.startswith("> -:"): - raise Exception,"Invalid pen options" - quickAsy.stdout.readline() - colorspace = quickAsy.stdout.readline() + fout.write("pen p="+self.getCode()+';\n') + fout.write("file fout=output(mode='pipe');\n") + fout.write("write(fout,colorspace(p),newl);\n") + fout.write("write(fout,colors(p));\n") + fout.write("flush(fout);\n") + fout.flush() + colorspace = fin.readline() if colorspace.find("cmyk") != -1: - lines = quickAsy.stdout.readline()+quickAsy.stdout.readline()+quickAsy.stdout.readline()+quickAsy.stdout.readline() + lines = fin.readline()+fin.readline()+fin.readline()+fin.readline() parts = lines.split() - c,m,y,k = eval(parts[2]),eval(parts[4]),eval(parts[6]),eval(parts[8]) + c,m,y,k = eval(parts[0]),eval(parts[1]),eval(parts[2]),eval(parts[3]) k = 1-k r,g,b = ((1-c)*k,(1-m)*k,(1-y)*k) elif colorspace.find("rgb") != -1: - lines = quickAsy.stdout.readline()+quickAsy.stdout.readline()+quickAsy.stdout.readline() + lines = fin.readline()+fin.readline()+fin.readline() parts = lines.split() - r,g,b = eval(parts[2]),eval(parts[4]),eval(parts[6]) + r,g,b = eval(parts[0]),eval(parts[1]),eval(parts[2]) elif colorspace.find("gray") != -1: - lines = quickAsy.stdout.readline() + lines = fin.readline() parts = lines.split() - r = g = b = eval(parts[2]) + r = g = b = eval(parts[0]) self.color = (r,g,b) def tkColor(self): @@ -352,18 +337,19 @@ class asyPath(asyObj): def computeControls(self): """Evaluate the code of the path to obtain its control points""" - syncQuickAsyOutput() - quickAsy.stdin.write("path p="+self.getCode()+';\n') - quickAsy.stdin.write("write(length(p));\n") - quickAsy.stdin.write("write(unstraighten(p));write(\"\");\n") - quickAsy.stdin.flush() - lengthStr = quickAsy.stdout.readline() + fout.write("file fout=output(mode='pipe');\n") + fout.write("path p="+self.getCode()+';\n') + fout.write("write(fout,length(p),newl);\n") + fout.write("write(fout,unstraighten(p),endl);\n") + fout.flush() + lengthStr = fin.readline() pathSegments = eval(lengthStr.split()[-1]) pathStrLines = [] for i in range(pathSegments+1): - pathStrLines.append(quickAsy.stdout.readline()) + line=fin.readline() + line=line.replace("\n","") + pathStrLines.append(line) oneLiner = "".join(split(join(pathStrLines))) - oneLiner = oneLiner.replace(">","") splitList = oneLiner.split("..") nodes = [a for a in splitList if a.find("controls")==-1] self.nodeSet = [] @@ -468,23 +454,20 @@ class xasyItem: def asyfyThread(self,mag=1.0): """Convert the item to a list of images by deconstructing this item's code""" - quickAsy.stdin.write("\nreset;\n") - quickAsy.stdin.write("initXasyMode();\n") - quickAsy.stdin.write("atexit(null);\n") - syncQuickAsyOutput() + fout.write("reset;\n") + fout.write("initXasyMode();\n") + fout.write("atexit(null);\n") global console for line in self.getCode().splitlines(): - quickAsy.stdin.write(line+"\n"); - quickAsy.stdin.flush() - syncQuickAsyOutput(verbose=True,queue=self.imageHandleQueue); - quickAsy.stdin.write("deconstruct(%f);\n"%mag) - quickAsy.stdin.flush() + fout.write(line+"\n"); + fout.write("deconstruct(%f);\n"%mag) + fout.flush() format = "png" - maxargs = int(split(quickAsy.stdout.readline())[1]) + maxargs = int(split(fin.readline())[0]) boxes=[] batch=0 n=0 - text = quickAsy.stdout.readline() + text = fin.readline() template=AsyTempDir+"%d_%d.%s" def render(): for i in range(len(boxes)): @@ -493,7 +476,7 @@ class xasyItem: self.imageHandleQueue.put((name,format,(l,b,r,t),i)) while text != "Done\n" and text != "Error\n": boxes.append(text) - text = quickAsy.stdout.readline() + text = fin.readline() n += 1 if n >= maxargs: render() @@ -501,7 +484,7 @@ class xasyItem: batch += 1 n=0 if text == "Error\n": - self.imageHandleQueue.put(("ERROR",quickAsy.stdout.readline())) + self.imageHandleQueue.put(("ERROR",fin.readline())) else: render() self.imageHandleQueue.put((None,)) diff --git a/Build/source/utils/asymptote/GUI/xasyMainWin.py b/Build/source/utils/asymptote/GUI/xasyMainWin.py index 2876d014a56..0967107ac1a 100755 --- a/Build/source/utils/asymptote/GUI/xasyMainWin.py +++ b/Build/source/utils/asymptote/GUI/xasyMainWin.py @@ -57,7 +57,7 @@ class xasyMainWin: self.createWidgets() self.resetGUI() if sys.platform[:3] == "win": - site="http://effbot.org/downloads/PIL-1.1.7.win32-py2.6.exe" + site="http://effbot.org/downloads/PIL-1.1.7.win32-py2.7.exe" else: site="http://effbot.org/downloads/Imaging-1.1.7.tar.gz" if not PILAvailable: @@ -781,7 +781,7 @@ class xasyMainWin: def helpAsyDocCmd(self): #print "Open documentation about Asymptote" - asyExecute("\nhelp;\n") + asyExecute("help;\n") def helpAboutCmd(self): tkMessageBox.showinfo("About xasy","A graphical interface for Asymptote "+xasyVersion) diff --git a/Build/source/utils/asymptote/GUI/xasyOptionsDialog.py b/Build/source/utils/asymptote/GUI/xasyOptionsDialog.py index b93b2a7fed9..c3162e8673b 100755 --- a/Build/source/utils/asymptote/GUI/xasyOptionsDialog.py +++ b/Build/source/utils/asymptote/GUI/xasyOptionsDialog.py @@ -18,7 +18,6 @@ import tkMessageBox import tkFileDialog import tkColorChooser import os -import subprocess import sys class xasyOptionsDlg(tkSimpleDialog.Dialog): @@ -181,22 +180,6 @@ class xasyOptionsDlg(tkSimpleDialog.Dialog): def validate(self): """Validate the data entered into the dialog""" - #validate the path - pathOK = True - try: - test = subprocess.Popen([self.ap.get(),"-interactive"],stdin=subprocess.PIPE,stdout=subprocess.PIPE,stderr=subprocess.PIPE) - test.stdin.close() - test.wait() - idString = test.stdout.read() - except: - pathOK = False - if not pathOK or not idString.startswith("Welcome to Asymptote"): - tkMessageBox.showerror("xasy Options","Specified file does not exist or is not an Asymptote executable.\r\n"+self.ap.get(),parent=self) - return False - - #validate the external editor - # how can I validate the editor? - #validate the color hexdigits = '0123456789abcdef' if not self.validateAColor(self.pc): diff --git a/Build/source/utils/asymptote/Makefile.in b/Build/source/utils/asymptote/Makefile.in index 9e323a5345b..8460880d319 100644 --- a/Build/source/utils/asymptote/Makefile.in +++ b/Build/source/utils/asymptote/Makefile.in @@ -9,12 +9,16 @@ GCLIB = @GCLIB@ GCPPLIB = @GCPPLIB@ GCLIBS = $(GCPPLIB) $(GCLIB) LFLAGS = @LDFLAGS@ -LIBS = $(LFLAGS) @LIBS@ $(GCLIBS) +LIBS = $(LFLAGS) @PTHREAD_LIBS@ @LIBS@ $(GCLIBS) + +# Libraries needed to make asymptote.so. +# We have to remove OpenGL, threading, GC, etc from this. +SHAREDLIBS = $(filter-out -lGL -lGLU -lglut -pthread $(GCLIBS), $(LIBS)) vpath %.cc prc CAMP = camperror path drawpath drawlabel picture psfile texfile util settings \ - guide flatguide knot drawfill path3 drawpath3 drawsurface + guide flatguide knot drawfill path3 drawpath3 drawsurface pen RUNTIME_FILES = runtime runbacktrace runpicture runlabel runhistory runarray \ runfile runsystem runpair runtriple runpath runpath3d runstring \ @@ -25,14 +29,16 @@ SYMBOL_FILES = types builtin gsl $(RUNTIME_FILES) PRC = PRCbitStream oPRCFile PRCdouble writePRC -FILES = $(CAMP) $(SYMBOL_FILES) env genv main stm dec errormsg \ +COREFILES = $(CAMP) $(SYMBOL_FILES) env genv stm dec errormsg \ callable name symbol entry exp newexp stack camp.tab lex.yy \ access virtualfieldaccess absyn record interact fileio \ - fftw++ simpson coder coenv \ + fftw++ simpson coder coenv impdatum \ @getopt@ locate parser program application varinit fundec refaccess \ envcompleter process constructor array Delaunay predicates \ $(PRC) glrender tr arcball algebra3 quaternion svnrevision +FILES = $(COREFILES) main + DIST = camp.tab.h camp.tab.cc lex.yy.cc runtime.cc keywords.cc \ asy-keywords.el $(RUNTIME_FILES:=.cc) $(RUNTIME_FILES:=.h) asy.list \ allsymbols.h opsymbols.h $(SYMBOL_FILES:=.symbols.h) @@ -49,14 +55,19 @@ LATEXFILES = asymptote.sty asycolors.sty ocg.sty latexmkrc CONTEXTFILES = colo-asy.tex ASY = ./asy -dir base -config "" -render=0 -DEFS = @DEFS@ @OPTIONS@ \ - -DTRANSJUMP +DEFS = @DEFS@ @OPTIONS@ @PTHREAD_CFLAGS@ CFLAGS = @CPPFLAGS@ @CFLAGS@ -OPTS = $(DEFS) $(CFLAGS) +OPTS = $(DEFS) $(CFLAGS) INCL = -I . @INCL@ -CXX = @CXX@ -Wall -ansi -CC = @CC@ -Wall -ansi +# Options for compiling the object files for the shared library. +# gc has to be configured with the option --disable-threads in order to make a +# shared library that doesn't seg fault. For now, just disable gc in the +# shared library. +SHAREDOPTS = $(filter-out -DUSEGC, $(DEFS)) $(CFLAGS) -fPIC -DFOR_SHARED + +CXX = @CXX@ -Wall +CC = @CC@ -Wall MAKEDEPEND = $(OPTS) -O0 -M -DDEPEND BISON = bison LEX = @LEX@ @@ -82,7 +93,17 @@ last = `cat svnrevision.cc | sed -e 's/.*\"\(.*\)\";/\\1/'` export prefix docdir exampledir mandir infodir INSTALL MAKE DESTDIR TEXI2DVI -asy: $(GCLIB) $(FILES:=.o) +asy: version GUIversion + if test -n "$(MSDOS)"; then \ + cat asy.rc | sed -e "s/ASYMPTOTE_VERSION/@VERSION@$(revision)/" | \ + windres -o asy.o; \ + $(CXX) $(OPTS) -o $(NAME) $(FILES:=.o) asy.o $(LIBS) -s -static; \ + else \ + ln -sf GUI/xasy.py $(XNAME); \ + $(CXX) $(DEFS) -o $(NAME) $(FILES:=.o) $(LIBS); \ + fi + +version: $(GCLIB) $(FILES:=.o) if test "$(revision)" != "$(last)"; then \ echo $(REVISION)\"$(revision)\"\; > svnrevision.cc; \ $(CXX) $(OPTS) $(INCL) -o svnrevision.o -c svnrevision.cc; \ @@ -90,26 +111,17 @@ asy: $(GCLIB) $(FILES:=.o) echo string VERSION=\"@VERSION@$(revision)\"\; > base/version.asy echo @set VERSION @VERSION@$(revision) > doc/version.texi echo @set Datadir @datadir@ >> doc/version.texi + +GUIversion: echo "#!/usr/bin/env python" > GUI/xasyVersion.py echo xasyVersion = \"@VERSION@$(revision)\" >> GUI/xasyVersion.py - ln -sf GUI/xasy.py $(XNAME) - $(CXX) $(OPTS) -o $(NAME) $(FILES:=.o) $(LIBS) + +asymptote.so: version + $(CXX) $(OPTS) -shared -o asymptote.so $(COREFILES:=.pic.o) $(SHAREDLIBS) svnrevision.cc: echo $(REVISION)\"\"\; > svnrevision.cc; -msdos: $(GCLIB) $(FILES:=.o) asy.o - echo string VERSION=\"@VERSION@\"\; > base/version.asy - echo @set VERSION @VERSION@ > doc/version.texi - echo @set Datadir @datadir@ >> doc/version.texi - echo "#!/usr/bin/env python" > GUI/xasyVersion.py - echo xasyVersion = \"@VERSION@\" >> GUI/xasyVersion.py - $(CXX) $(OPTS) -o $(NAME) $(FILES:=.o) asy.o $(LIBS) -s -static - -asy.o: asy.rc asy.ico Makefile - cat asy.rc | sed -e "s/ASYMPTOTE_VERSION/@VERSION@$(revision)/" | \ - windres -o asy.o - all: asy sty man faq asy-keywords.el $(GCLIB): $(GC).tar.gz @@ -123,6 +135,9 @@ $(GCLIB): $(GC).tar.gz cd $(GC)/include/private && \ patch < ../../../patches/gc-7.0nomem.patch; \ fi + if test "$(GC)" = "gc-7.2b"; then \ + mv gc-7.2 gc-7.2b; \ + fi cd $(GC); \ ./configure $(GCOPTIONS); \ $(MAKE) check @@ -184,7 +199,7 @@ asy-keywords.el: asy grep -v three_\* | grep -v featpost3D | xargs $(ASY) -l >> asy.list perl ./asy-list.pl asy.list @VERSION@ -install: install-texhash install-man +install: asy-keywords.el install-texhash install-man install-all: install install-html @@ -193,7 +208,7 @@ install-texhash: install-asy texhash; \ fi -install-asy: asy sty asy-keywords.el +install-asy: asy sty ${INSTALL} -d $(bindir) $(asydir) $(GUIdir) $(exampledir) \ $(animationsdir) -${INSTALL} -d $(latexdir) @@ -246,7 +261,7 @@ uninstall-docdir: -rmdir $(docdir) clean: FORCE - -rm -f asy *.o *.d *mon.out $(CLEAN) + -rm -f asy asymptote.so *.pic.o *.o *.d *mon.out $(CLEAN) gc-clean: FORCE clean -if test -d $(GC); then \ @@ -284,7 +299,7 @@ check-all: asy FORCE @echo Creating $@; \ rm -f $@; \ ${CXX} $(MAKEDEPEND) $(INCL) $(MDOPTS) $< > $@.$$$$ 2>/dev/null && \ - sed 's,\($*\)\.o[ :]*,\1.o $@ : ,g' < $@.$$$$ > $@; \ + sed 's,\($*\)\.o[ :]*,\1.o \1.pic.o $@ : ,g' < $@.$$$$ > $@; \ rm -f $@.$$$$ .c.d: @echo Creating $@; \ @@ -293,6 +308,11 @@ check-all: asy FORCE sed 's,\($*\)\.o[ :]*,\1.o $@ : ,g' < $@.$$$$ > $@; \ rm -f $@.$$$$ +# Compile for the shared library. OpenGL must be disabled as it causes +# crashes inside a shared library. +%.pic.o: %.cc + $(CXX) $(SHAREDOPTS) $(INCL) -o $@ -c $< + ifeq (,$(findstring clean,${MAKECMDGOALS})) -include $(FILES:=.d) endif diff --git a/Build/source/utils/asymptote/README b/Build/source/utils/asymptote/README index 016dbda9080..fa924bc670c 100644 --- a/Build/source/utils/asymptote/README +++ b/Build/source/utils/asymptote/README @@ -49,7 +49,7 @@ libraries. This version of Asymptote also ships with the dll libraries noted below. The source code for cygwin1.dll is available under the GPL license: -http://cygwin.com/snapshots/cygwin-src-20100413.tar.bz2 +http://cygwin.com/snapshots/cygwin-src-20110327.tar.bz2 The source code for freeglut.dll is available under the X-Consortium license: http://prdownloads.sourceforge.net/freeglut/freeglut-2.6.0.tar.gz diff --git a/Build/source/utils/asymptote/ReleaseNotes b/Build/source/utils/asymptote/ReleaseNotes index ebaad6556e1..784b628639d 100644 --- a/Build/source/utils/asymptote/ReleaseNotes +++ b/Build/source/utils/asymptote/ReleaseNotes @@ -1,3 +1,38 @@ +Release Notes for Version 2.16 + +Ticks are no longer autoscaled when the number of major intervals is +specified and autoscale is false. Manual tick scaling was fixed. A bug in +the palette range was fixed. A division by zero in constructing curved arrows +was fixed. A numerical underflow was fixed. A picture bound error was +fixed. The current value of currentpen is now always respected in default +arguments. A default viewportwidth is no longer imposed for attached +images. A routine for computing camera positions was added. The format +command is now more consistent with C++ printf formatting. Named arguments +can now appear in function calls after rest arguments. The wheel example +was improved to support PDF animations. The erase command no longer resets +the machine state. Pipes are now used for xasy communication. A new mode +parameter to input and output replaces xinput, xoutput, binput, and +boutput. The icon directory path for 64-bit MSWindows systems was fixed. +Compilation of native CYGWIN binaries is now supported. + +Release Notes for Version 2.15 + +A compilation problem under MacOS X was fixed. + +Release Notes for Version 2.14 + +Minor problems in the geometry module were fixed. Billboard interaction is +now disabled for offscreen rendering. A markthin(path) marker with opacity +thinning was implemented. A locale string was added to format(string,int). +The copy, map, and sequence functions were generalized to arbitrary depths. +Asymptote can now be compiled as a shared library. A tuple operator was +added. The draw(revolution) function now defers drawing until the final +camera position is known. Nonrendered preview images can now be generated +for fitted pictures. String reads from binary files were fixed. An int +ascii(string) function and a bool isnan(real) function were implemented. +Jacobi elliptic functions were implemented. A quick reference card was added. +Compilation and static initialization issues under MacOS X Lion were addressed. + Release Notes for Version 2.13 Compilation and installation issues were addressed. diff --git a/Build/source/utils/asymptote/access.h b/Build/source/utils/asymptote/access.h index eabd5a527ac..08e0a48e3a9 100644 --- a/Build/source/utils/asymptote/access.h +++ b/Build/source/utils/asymptote/access.h @@ -17,7 +17,7 @@ #include "vm.h" namespace vm { - class callable; + struct callable; } namespace trans { diff --git a/Build/source/utils/asymptote/application.cc b/Build/source/utils/asymptote/application.cc index 25221357010..65a4da71ca7 100644 --- a/Build/source/utils/asymptote/application.cc +++ b/Build/source/utils/asymptote/application.cc @@ -233,7 +233,8 @@ bool application::complete() { return false; } -bool application::matchRest(env &e, formal &source, varinit *a) { +bool application::matchRest(env &e, formal &source, varinit *a, + size_t evalIndex) { // First make sure all non-rest arguments are matched (matching to defaults // if necessary). if (complete()) @@ -242,7 +243,7 @@ bool application::matchRest(env &e, formal &source, varinit *a) { formal &target=sig->getRest(); score s=castScore(e, target, source); if (s!=FAIL) { - rest->addRest(new varinitArg(a, target.t)); + rest->addRest(seq.addArg(a, target.t, evalIndex)); scores.push_back(s); return true; } @@ -250,6 +251,13 @@ bool application::matchRest(env &e, formal &source, varinit *a) { return false; } +// When the argument should be evaluated, possibly adjusting for a rest +// argument which occurs before named arguments. +size_t adjustIndex(size_t i, size_t ri) +{ + return i < ri ? i : i+1; +} + bool application::matchSignature(env &e, types::signature *source, arglist &al) { formal_vector &f=source->formals; @@ -259,21 +267,23 @@ bool application::matchSignature(env &e, types::signature *source, cout << "num keyword-only: " << sig->numKeywordOnly << endl; #endif + size_t ri = al.rest.val ? al.restPosition : f.size(); + // First, match all of the named (non-rest) arguments. for (size_t i=0; i<f.size(); ++i) if (f[i].name) - if (!matchNamedArgument(e, f[i], al[i].val, i)) + if (!matchNamedArgument(e, f[i], al[i].val, adjustIndex(i,ri))) return false; // Then, the unnamed. for (size_t i=0; i<f.size(); ++i) if (!f[i].name) - if (!matchArgument(e, f[i], al[i].val, i)) + if (!matchArgument(e, f[i], al[i].val, adjustIndex(i,ri))) return false; // Then, the rest argument. if (source->hasRest()) - if (!matchRest(e, source->getRest(), al.rest.val)) + if (!matchRest(e, source->getRest(), al.rest.val, ri)) return false; // Fill in any remaining arguments with their defaults. diff --git a/Build/source/utils/asymptote/application.h b/Build/source/utils/asymptote/application.h index 0e283d66daa..8ca4296bd3b 100644 --- a/Build/source/utils/asymptote/application.h +++ b/Build/source/utils/asymptote/application.h @@ -110,7 +110,6 @@ public: } }; - // This class generates sequenced args, args whose side-effects occur in order // according to their index, regardless of the order they are called. This is // used to ensure left-to-right order of evaluation of keyword arguments, even @@ -261,7 +260,7 @@ class application : public gc { bool complete(); // Match a rest argument in the calling expression. - bool matchRest(env &e, types::formal& f, varinit *a); + bool matchRest(env &e, types::formal& f, varinit *a, size_t evalIndex); // Match the argument represented in signature to the target signature. On // success, all of the arguments in args will be properly set up. diff --git a/Build/source/utils/asymptote/aspy.py b/Build/source/utils/asymptote/aspy.py new file mode 100644 index 00000000000..6b3fb3ec2e5 --- /dev/null +++ b/Build/source/utils/asymptote/aspy.py @@ -0,0 +1,355 @@ +##### +# +# aspy.py +# +# Andy Hammerlindl 2011/09/03 +# +# Uses ctypes to interface with the shared library version of Python. +# Asymptote can run and its datatypes inspected via Python. +# +# +# To use the module: +# 1. make asymptote.so +# 2. Ensure that asymptote.so is visable to python, say adding its directory +# to LD_LIBRARY_PATH +# 3. Run this module. (See runExample for an example.) +# +##### + +from ctypes import * + +asyInt = c_longlong +handle_typ = c_void_p +arguments_typ = c_void_p +state_typ = c_void_p + +function_typ = CFUNCTYPE(None, state_typ, c_void_p) + +class string_typ(Structure): + _fields_ = [ + ("buf", c_char_p), # Should be NUL-terminated? Maybe replace with + # POINTER(c_char). + ("length", asyInt) + ] + +ErrorCallbackFUNC = CFUNCTYPE(None, string_typ) + +NORMAL_ARG = 45000 +REST_ARG = 45001 + +class Policy(Structure): + _fields_ = [ + ("version", asyInt), + ("copyHandle", CFUNCTYPE(handle_typ, handle_typ)), + ("releaseHandle", CFUNCTYPE(None, handle_typ)), + ("handleFromInt", CFUNCTYPE(handle_typ, asyInt)), + ("handleFromBool", CFUNCTYPE(handle_typ, asyInt)), + ("handleFromDouble", CFUNCTYPE(handle_typ, c_double)), + ("handleFromString", CFUNCTYPE(handle_typ, string_typ)), + ("handleFromFunction", CFUNCTYPE(handle_typ, + c_char_p, + function_typ, + c_void_p)), + ("IntFromHandle", CFUNCTYPE(asyInt, handle_typ)), + ("boolFromHandle", CFUNCTYPE(asyInt, handle_typ)), + ("doubleFromHandle", CFUNCTYPE(c_double, handle_typ)), + ("stringFromHandle", CFUNCTYPE(string_typ, handle_typ)), + ("getField", CFUNCTYPE(handle_typ, + handle_typ, + c_char_p)), + ("getCell", CFUNCTYPE(handle_typ, + handle_typ, + asyInt)), + ("addField", CFUNCTYPE(None, + handle_typ, + c_char_p, + handle_typ)), + ("newArguments", CFUNCTYPE(arguments_typ)), + ("releaseArguments", CFUNCTYPE(None, arguments_typ)), + ("addArgument", CFUNCTYPE(None, + arguments_typ, + c_char_p, + handle_typ, + asyInt)), + ("call", CFUNCTYPE(handle_typ, + handle_typ, + arguments_typ)), + ("globals", CFUNCTYPE(handle_typ, state_typ)), + ("numParams", CFUNCTYPE(asyInt, state_typ)), + ("getParam", CFUNCTYPE(handle_typ, state_typ, asyInt)), + ("setReturnValue", CFUNCTYPE(None, state_typ, handle_typ)), + ("setErrorCallback", CFUNCTYPE(None, ErrorCallbackFUNC)), + ] + +policy = None +baseState = None +def initPolicyAndBaseState(): + global policy, baseState + lib = CDLL("asymptote.so") + + getPolicy = lib._asy_getPolicy + getPolicy.restype = POINTER(Policy) + policy = getPolicy() + + getState = lib._asy_getState + getState.restype = state_typ + baseState = getState() + +initPolicyAndBaseState() + +def pyStringFromAsyString(st): + #TODO: Handle strings with null-terminators. + return str(st.buf) + +def pyStringFromHandle(h): + #TODO: Handle strings with null-terminators. + st = policy.contents.stringFromHandle(h) + checkForErrors() + return pyStringFromAsyString(st) + +def handleFromPyString(s): + st = string_typ(s, len(s)) + h = policy.contents.handleFromString(st) + checkForErrors() + return h + +def ensureDatum(val): + return val if type(val) is Datum else Datum(val) + +# The error detection scheme. +# policyError is set to a string when an error occurs. +policyError = [] +def pyErrorCallback(s): + global policyError + policyError.append(pyStringFromAsyString(s)) + +cErrorCallback = ErrorCallbackFUNC(pyErrorCallback) +policy.contents.setErrorCallback(cErrorCallback) + +class AsyException(Exception): + def __init__(self, msg): + self.msg = msg + def __str__(self): + return self.msg + +def checkForErrors(): + """Raises an exception if an error occured.""" + global policyError + if policyError != []: + s = policyError[0] + if len(policyError) > 1: + s += ' (and other errors)' + policyError = [] + raise AsyException(s) + +class Datum(object): + + def _setHandle(self, handle): + object.__setattr__(self, 'handle', handle) + + def __init__(self, val): + self._setHandle(0) + + if val is None: + return + + if type(val) is int: + self._setHandle(policy.contents.handleFromInt(val)) + checkForErrors() + elif type(val) is bool: + self._setHandle(policy.contents.handleFromBool(1 if val else 0)) + checkForErrors() + elif type(val) is float: + self._setHandle(policy.contents.handleFromDouble(val)) + elif type(val) is str: + self._setHandle(handleFromPyString(val)) + checkForErrors() + elif type(val) is tuple: + # Could do this more efficiently, and avoid a copyHandle + ret = state.globals()["operator tuple"](*val) + self._setHandle(policy.contents.copyHandle(ret.handle)) + checkForErrors() + elif type(val) is Datum: + self._setHandle(policy.contents.copyHandle(val.handle)) + checkForErrors() + else: + # TODO: check if val has a toDatum field + raise TypeError("cannot initialize Datum from '%s'" % + type(val).__name__) + + def __repr__(self): + # TODO: Add type-checking to policy. + return '<Datum with handle %s>' % hex(self.handle) + + def __int__(self): + l = policy.contents.IntFromHandle(self.handle) + checkForErrors() + return int(l) + + def __nonzero__(self): + # This will throw an exception for anything but an underlying bool + # type. Perhaps we should be more pythonic. + l = policy.contents.boolFromHandle(self.handle) + checkForErrors() + assert l in [0,1] + return l == 1 + + def __float__(self): + x = policy.contents.doubleFromHandle(self.handle) + checkForErrors() + return float(x) + + def __str__(self): + return pyStringFromHandle(self.handle) + + def __getattr__(self, name): + field = policy.contents.getField(self.handle, name) + checkForErrors() + return DatumFromHandle(field) + + def __getitem__(self, name): + assert type(name) == str + return self.__getattr__(name) + #TODO: raise an IndexError when appropriate. + #TODO: implement array indices + + def __setattr__(self, name, val): + # TODO: Resolve setting versus declaring. + # One idea: d.x = f or d["x"] = f sets and d["int x()"] = f declares + # anew. + policy.contents.addField(self.handle, + name, ensureDatum(val).handle) + checkForErrors() + + def __setitem__(self, name, val): + assert type(name) == str + self.__setattr__(name, val) + #TODO: raise an IndexError when appropriate. + #TODO: implement array indices + + def __call__(self, *args, **namedArgs): + alist = policy.contents.newArguments() + checkForErrors() + + + for arg in args: + d = ensureDatum(arg) + policy.contents.addArgument(alist, "", d.handle, NORMAL_ARG) + checkForErrors() + + for name,arg in namedArgs.items(): + d = ensureDatum(arg) + policy.contents.addArgument(alist, name, d.handle, NORMAL_ARG) + checkForErrors() + + ret = policy.contents.call(self.handle, alist) + checkForErrors() + + policy.contents.releaseArguments(alist) + checkForErrors() + + if ret != None: + return DatumFromHandle(ret) + + def __add__(self, other): + return state.globals()["operator +"](self, other) + def __sub__(self, other): + return state.globals()["operator -"](self, other) + def __mul__(self, other): + return state.globals()["operator *"](self, other) + def __div__(self, other): + return state.globals()["operator /"](self, other) + def __truediv__(self, other): + return state.globals()["operator /"](self, other) + def __mod__(self, other): + return state.globals()["operator %"](self, other) + def __pow__(self, other): + return state.globals()["operator ^"](self, other) + def __and__(self, other): + return state.globals()["operator &"](self, other) + def __or__(self, other): + return state.globals()["operator |"](self, other) + def __neg__(self, other): + return state.globals()["operator -"](self) + + def __lt__(self, other): + return state.globals()["operator <"](self, other) + def __le__(self, other): + return state.globals()["operator <="](self, other) + def __eq__(self, other): + return state.globals()["operator =="](self, other) + def __ne__(self, other): + return state.globals()["operator !="](self, other) + def __gt__(self, other): + return state.globals()["operator >"](self, other) + def __ge__(self, other): + return state.globals()["operator >="](self, other) + +def DatumFromHandle(handle): + """Initializes a Datum from a given low-level handle. Does not invoke + copyHandle.""" + d = Datum(None) + d._setHandle(handle) + return d + +class State(object): + def __init__(self, base): + self.base = base + + def globals(self): + handle = policy.contents.globals(self.base) + checkForErrors() + return DatumFromHandle(handle) + + def params(self): + p = [] + + numParams = policy.contents.numParams(self.base) + checkForErrors() + + for i in range(numParams): + h = policy.contents.getParam(self.base, i) + checkForErrors() + p.append(DatumFromHandle(h)) + + assert len(p) == numParams + return p + + def setReturnValue(self, val): + policy.contents.setReturnValue(self.base, ensureDatum(val).handle) + checkForErrors() + +# Keep a link to all of the callbacks created, so they aren't garbage +# collected. TODO: See if this is neccessary. +storedCallbacks = [] + +def DatumFromCallable(f): + def wrapped(s, d): + state = State(s) + params = state.params() + r = f(*params) + if r != None: + state.setReturnValue(r) + + cf = function_typ(wrapped) + storedCallbacks.append(cf) + + h = policy.contents.handleFromFunction(f.__name__, cf, None) + checkForErrors() + + return DatumFromHandle(h) + +print "version", policy.contents.version + +state = State(baseState) + +# An example +def runExample(): + g = state.globals() + + g.eval("path p = (0,0) -- (100,100) -- (200,0)", embedded=True) + g.draw(g.p) + g.shipout("frompython") + + g.draw(g.circle(100), g.red) + diff --git a/Build/source/utils/asymptote/asy-keywords.el b/Build/source/utils/asymptote/asy-keywords.el index d004bc7e9b3..0bb5b66e7ab 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.13") +(defvar asy-keywords-version "2.16") (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 DOSendl DOSnewl 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 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 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 calculateScaling 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 copyPairOrTriple 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 drawpixel 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 jobname 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 makeNode makedraw makepen map margin markangle markangleradius markanglespace markarc marker markinterval marknodes markrightangle markuniform mass masscenter massformat math max max3 maxAfterTransform maxbezier maxbound maxcoords maxlength maxratio maxtimes mean medial median midpoint min min3 minAfterTransform minbezier minbound minipage minratio mintimes miterlimit mktemp 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 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 printBytecode 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 sinh size size3 skewness skip slant sleep slope slopefield solve solveBVP sort sourceline sphere split sqrt square srand standardizecoordsys startScript 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 trembleFuzz triangle triangleAbc triangleabc triangulate tricoef tridiagonal trilinear trim 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 DOSendl DOSnewl 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 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 ascii asec asin asinh ask assert asy asycode asydir asyfigure asyfilecode asyinclude asywrite atan atan2 atanh atbreakpoint atexit 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 bins bisector bisectorpoint bispline blend blockconnector box bqe breakpoint breakpoints brick buildRestoreDefaults buildRestoreThunk buildcycle bulletcolor byte calculateScaling 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 copyPairOrTriple 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 drawpixel 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 isnan isogonal isogonalconjugate isotomic isotomicconjugate isparabola italic item jobname 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 makeNode makedraw makepen map margin markangle markangleradius markanglespace markarc marker markinterval marknodes markrightangle markthin markuniform mass masscenter massformat math max max3 maxAfterTransform maxbezier maxbound maxcoords maxlength maxratio maxtimes mean medial median midpoint min min3 minAfterTransform minbezier minbound minipage minratio mintimes miterlimit mktemp 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 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 printBytecode 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 sinh size size3 skewness skip slant sleep slope slopefield solve solveBVP sort sourceline sphere split sqrt square srand standardizecoordsys startScript 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 trembleFuzz triangle triangleAbc triangleabc triangulate tricoef tridiagonal trilinear trim 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 xlimits 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 expansionfactor extendcap exterior fermionpen figureborder figuremattpen file3 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 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 plain_bounds plain_scaling 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 swap textpen ticksize tildeframe tildemarksizefactor tinv titlealign titlepagepen titlepageposition titlepen titleskip top trailingzero treeLevelStep treeMinNodeWidth treeNodeStep trembleAngle trembleFrequency trembleRandom undefined unitcircle unitsquare up urlpen urlskip version vertexpen vertexsize viewportmargin viewportsize vline white wye xformStack yellow ylabelwidth zerotickfuzz zerowinding )) +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 MarkPath 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 defaultseparator diagnostics differentlengths dot dotfactor dotframe dotted doublelinepen doublelinespacing down duplicateFuzz edge ellipsenodesnumberfactor eps epsgeo epsilon evenodd expansionfactor extendcap exterior fermionpen figureborder figuremattpen file3 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 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 plain_bounds plain_scaling 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 swap textpen ticksize tildeframe tildemarksizefactor tinv titlealign titlepagepen titlepageposition titlepen titleskip top trailingzero treeLevelStep treeMinNodeWidth treeNodeStep trembleAngle trembleFrequency trembleRandom 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/asy.list b/Build/source/utils/asymptote/asy.list index e69de29bb2d..6e94649b60b 100644 --- a/Build/source/utils/asymptote/asy.list +++ b/Build/source/utils/asymptote/asy.list @@ -0,0 +1,3753 @@ +string stripfile(string s); +string stripsuffix(string f, string suffix=<default>); +real cbrt(real x); +real[] cbrt(real[] a); +cputime cputime(); +string stripdirectory(string s); +real sqrtEpsilon; +string stripextension(string s); +version version; +void texpreamble(string s); +pen beveljoin; +string cputimeformat; +real Cos(real deg); +string insert(string s, int pos, string t); +marginT EndDotMargin(path, pen); +pen heavyred; +pen black; +pen heavyblue; +pen heavygreen; +pen heavycyan; +marginT PenMargin(path, pen)(real begin, real end); +marginT PenMargin(path, pen); +int realDigits; +pen heavymagenta; +marginT PenMargins(path, pen); +void newl(file file); +void seek(file f, int pos); +string verbatim(string s); +pen heavygray; +pen heavygrey; +void markuniform(picture pic=<default>, frame f, path g)(pair z(real t), real a, real b, int n); +void markuniform(picture pic=<default>, frame f, path g)(bool centered=<default>, int n, bool rotated=<default>); +real[] mintimes(path p); +real[] mintimes(path3 p); +bool straight(path p, int t); +bool straight(path3 p, int t); +pen makepen(path p); +real dotsize(pen p=<default>); +real[] curlSpecifier(guide g, int t); +real straightness(path3 p, int t); +real straightness(triple z0, triple c0, triple c1, triple z1); +real log10(real x); +real[] log10(real[] a); +pen paleblue; +bool prc0(string format=<default>); +int CTZ(int a); +real barfactor; +pen Magenta; +real cos(real x); +real[] cos(real[] a); +pair cos(explicit pair z); +int intMax; +bool cyclic(guide g); +bool cyclic(path p); +bool cyclic(path3 p); +void printBytecode(<open>); +transform Rotate(transform)(pair z); +transform Rotate(transform t); +bool inXasyMode; +path subpath(path p, int a, int b); +path subpath(path p, real a, real b); +path3 subpath(path3 p, int a, int b); +path3 subpath(path3 p, real a, real b); +bool isnan(real x); +string jobname(string name); +void print_random_addresses(int n=<default>); +void attach(picture dest=<default>, frame src, pair position=<default>, bool group=<default>, filltype filltype=<default>, bool above=<default>); +void attach(picture dest=<default>, frame src, pair position, pair align, bool group=<default>, filltype filltype=<default>, bool above=<default>); +real[] quadraticroots(real a, real b, real c); +pair[] quadraticroots(explicit pair a, explicit pair b, explicit pair c); +pen darkcyan; +string[] file3; +real[] maxtimes(path p); +real[] maxtimes(path3 p); +filltype FillDraw; +filltype FillDraw(real xmargin=<default>, real ymargin=<default>, pen fillpen=<default>, pen drawpen=<default>); +void initdefaults(); +void erase(frame f); +string erase(string s, int pos, int n); +void erase(picture pic=<default>); +pair E; +int Ceil(real x); +pair I; +pair SSW; +pen magenta; +pair WSW; +pair N; +bool view(); +void usersetting(); +pair S; +void nowarn(string s); +transform rotate(real angle, pair z=<default>); +int quotient(int x, int y); +transform rotation(transform t); +pair W; +int rand(); +pen ZapfChancery(string series=<default>, string shape=<default>); +int XOR(int a, int b); +void atupdate(void f()); +void atupdate()(); +void unfill(frame f, path[] g, bool copy=<default>); +void unfill(picture pic=<default>, path[] g, bool copy=<default>); +bool Bar(picture, path, pen, marginT(path, pen)); +bool Bar(picture, path, pen, marginT(path, pen))(real size=<default>); +bool eol(file f); +pen zerowinding; +void atbreakpoint(string f(string, int, int, code)); +void savedefaults()(); +bool MidArrow(picture, path, pen, marginT(path, pen))(arrowhead arrowhead=<default>, real size=<default>, real angle=<default>, filltype filltype=<default>); +bool MidArrow(picture, path, pen, marginT(path, pen)); +bool MidArcArrow(picture, path, pen, marginT(path, pen))(arrowhead arrowhead=<default>, real size=<default>, real angle=<default>, filltype filltype=<default>); +bool MidArcArrow(picture, path, pen, marginT(path, pen)); +void exitXasyMode(); +void grestore(frame f); +pair extension(pair p, pair q, pair p, pair q); +pen extendcap; +int ceil(real x); +pen thick(pen p=<default>); +pair left; +int Suppress; +file input(string name=<default>, bool check=<default>, string comment=<default>, string mode=<default>); +int SuppressQuiet; +real[] texsize(string s, pen p=<default>); +string nativeformat(); +bool invisible(pen p); +pen invisible(); +pen invisible; +bool CCW; +void usetypescript(string s, string encoding=<default>); +path randompath(int n, bool cumulate=<default>, guide join(... guide[])=<default>); +int system(string[] s); +int system(string s); +void bar(picture pic, pair a, pair d, pen p=<default>); +picture bar(pair a, pair d, pen p=<default>); +side NoSide; +file stdout; +transform Shift(transform t); +real fmod(real x, real y); +real offset(pen p); +pen rgb(pen p); +pen rgb(real r, real g, real b); +pen rgb(string s); +real inch; +bool ArcArrow(picture, path, pen, marginT(path, pen))(arrowhead arrowhead=<default>, real size=<default>, real angle=<default>, filltype filltype=<default>, position position=<default>); +bool ArcArrow(picture, path, pen, marginT(path, pen)); +bool ArcArrows(picture, path, pen, marginT(path, pen))(arrowhead arrowhead=<default>, real size=<default>, real angle=<default>, filltype filltype=<default>); +bool ArcArrows(picture, path, pen, marginT(path, pen)); +pen currentpen; +pair precontrol(path p, int t); +pair precontrol(path p, real t); +triple precontrol(path3 p, int t); +triple precontrol(path3 p, real t); +light currentlight; +pen royalblue; +picture currentpicture; +frame currentpatterns; +int JOIN_IN; +int JOIN_OUT; +projection currentprojection; +void endScript(); +pen linetype(real[] pattern, real offset=<default>, bool scale=<default>, bool adjust=<default>); +real[] linetype(pen p=<default>); +pen linetype(string pattern, real offset=<default>, bool scale=<default>, bool adjust=<default>); +real xpart(pair z); +real xpart(triple v); +side Center; +real ypart(pair z); +real ypart(triple v); +real zpart(triple v); +frame orientation(frame); +pen Courier(string series=<default>, string shape=<default>); +real simpson(real f(real), real a, real b, real acc=<default>, real dxmax=<default>); +transform shift(transform t); +transform shift(pair z); +transform shift(real x, real y); +transform shift(frame f, pair align); +real asinh(real x); +real[] asinh(real[] a); +pen orange; +pen darkgray; +slice lastcut(path p, path knife); +pen darkgreen; +pen darkgrey; +transform xscale(real x); +transform shiftless(transform t); +real[][] shiftless(real[][] t); +transform yscale(real y); +void usleep(int microseconds); +real cosh(real x); +real[] cosh(real[] a); +position MidPoint; +real Sin(real deg); +void assert(bool b, string s=<default>); +pen Palatino(string series=<default>, string shape=<default>); +real incircle(pair a, pair b, pair c, pair d); +frame Landscape(frame f); +pen purple; +string italic(string s); +real atan(real x); +real[] atan(real[] a); +real acos(real x); +real[] acos(real[] a); +pair minbound(pair a, pair b); +triple minbound(triple a, triple b); +pair minbound(pair[] a); +pair minbound(pair[][] a); +pair minbound(pair[][][] a); +triple minbound(triple[] a); +triple minbound(triple[][] a); +triple minbound(triple[][][] a); +void restore(); +pen basealign(int n); +int basealign(pen p=<default>); +pen basealign; +int min(int a, int b); +int[] min(int a, int[] b); +int[] min(int[] a, int b); +int[] min(int[] a, int[] b); +int min(int[] a); +int min(int[][] a); +int min(int[][][] a); +real min(real a, real b); +real[] min(real a, real[] b); +real[] min(real[] a, real b); +real[] min(real[] a, real[] b); +real min(real[] a); +real min(real[][] a); +real min(real[][][] a); +string min(string a, string b); +string[] min(string a, string[] b); +string[] min(string[] a, string b); +string[] min(string[] a, string[] b); +string min(string[] a); +string min(string[][] a); +string min(string[][][] a); +pair min(pen p); +pair min(frame f); +pair min(path p); +pair min(explicit path[] p); +triple min(path3 p); +real min(... real[] a); +pair min(picture pic, bool user=<default>); +real min(real m, scaling s, coord[] c); +real min(real m, scaling s, coord[] c); +int min(... int[] a); +filltype RadialShade(pen penc, pen penr); +int search(int[] a, int key); +int search(real[] a, real key); +int search(string[] a, string key); +int search(void()()[] a, void key()(), bool less(void()(), void()())); +int search(object[] a, object key, bool less(object, object)); +int search(real[] a, real key, bool less(real, real)); +int search(guide[] a, guide key, bool less(guide, guide)); +int search(coord[] a, coord key, bool less(coord, coord)); +int search(Label[] a, Label key, bool less(Label, Label)); +int search(pair[] a, pair key, bool less(pair, pair)); +int search(frame[] a, frame key, bool less(frame, frame)); +int search(coord[] a, coord key, bool less(coord, coord)); +int search(int[] a, int key, bool less(int, int)); +int search(bool3[] a, bool3 key, bool less(bool3, bool3)); +int search(picture[] a, picture key, bool less(picture, picture)); +int search(marker[] a, marker key, bool less(marker, marker)); +int search(string[] a, string key, bool less(string, string)); +int search(path[] a, path key, bool less(path, path)); +int search(pen[] a, pen key, bool less(pen, pen)); +int search(bool[] a, bool key, bool less(bool, bool)); +int search(triple[] a, triple key, bool less(triple, triple)); +int search(Legend[] a, Legend key, bool less(Legend, Legend)); +filltype RadialShadeDraw(real xmargin=<default>, real ymargin=<default>, pen penc, pen penr, pen drawpen=<default>); +real sin(real x); +real[] sin(real[] a); +pair sin(explicit pair z); +pen deepcyan; +void restoredefaults(); +path[] plus; +pair expi(real angle); +triple expi(real polar, real azimuth); +void endclip(frame f); +void endclip(picture pic=<default>); +pen opacity(real opacity=<default>, string blend=<default>); +real opacity(pen p); +real[] solve(real[][] a, real[] b, bool warn=<default>); +real[][] solve(real[][] a, real[][] b, bool warn=<default>); +int rename(string from, string to); +void DOSendl(file file); +string debugger(string file, int line, int column, code s=<default>); +string getc(file f); +bool debugging; +void shipout(string prefix=<default>, frame f, frame preamble=<default>, string format=<default>, bool wait=<default>, bool view=<default>, transform xform()); +void shipout(string prefix=<default>, frame f, string format=<default>, bool wait=<default>, bool view=<default>, string options=<default>, string script=<default>, light light=<default>, projection P=<default>); +void shipout(string prefix=<default>, picture pic=<default>, frame orientation(frame)=<default>, string format=<default>, bool wait=<default>, bool view=<default>, string options=<default>, string script=<default>, light light=<default>, projection P=<default>); +void shipout3(string prefix, frame f, string format=<default>, real width, real height, real angle, real zoom, triple m, triple m, pair shift, real[][] t, real[] background, triple[] lights, real[][] diffuse, real[][] ambient, real[][] specular, bool viewportlighting, bool view=<default>); +void shipout3(string prefix, frame f, int[] index, triple[] center); +string getstring(string name=<default>, string default=<default>, string prompt=<default>, bool store=<default>); +int debuggerlines; +frame bbox(picture pic=<default>, real xmargin=<default>, real ymargin=<default>, pen p=<default>, filltype filltype=<default>); +real radians(real degrees); +bool pdf(); +void _eval(string s, bool embedded, bool interactivewrite=<default>); +void _eval(code s, bool embedded); +path[][] textpath(string[] s, pen[] p); +void radialshade(frame f, path[] g, bool stroke=<default>, pen pena, pair a, real ra, pen penb, pair b, real rb, bool copy=<default>); +void radialshade(picture pic=<default>, path[] g, bool stroke=<default>, pen pena, pair a, real ra, pen penb, pair b, real rb, bool copy=<default>); +pair maxbound(pair a, pair b); +triple maxbound(triple a, triple b); +pair maxbound(pair[] a); +pair maxbound(pair[][] a); +pair maxbound(pair[][][] a); +triple maxbound(triple[] a); +triple maxbound(triple[][] a); +triple maxbound(triple[][][] a); +string Embed(string name, string options=<default>, real width=<default>, real height=<default>); +pair postcontrol(path p, int t); +pair postcontrol(path p, real t); +triple postcontrol(path3 p, int t); +triple postcontrol(path3 p, real t); +int max(int a, int b); +int[] max(int a, int[] b); +int[] max(int[] a, int b); +int[] max(int[] a, int[] b); +int max(int[] a); +int max(int[][] a); +int max(int[][][] a); +real max(real a, real b); +real[] max(real a, real[] b); +real[] max(real[] a, real b); +real[] max(real[] a, real[] b); +real max(real[] a); +real max(real[][] a); +real max(real[][][] a); +string max(string a, string b); +string[] max(string a, string[] b); +string[] max(string[] a, string b); +string[] max(string[] a, string[] b); +string max(string[] a); +string max(string[][] a); +string max(string[][][] a); +pair max(pen p); +pair max(frame f); +pair max(path p); +pair max(explicit path[] p); +triple max(path3 p); +pair max(picture pic, bool user=<default>); +real max(real M, scaling s, coord[] c); +real max(real M, scaling s, coord[] c); +int max(... int[] a); +real max(... real[] a); +Label Label(Label L, align align=<default>, pen p=<default>, transform embed(transform)=<default>, filltype filltype=<default>); +Label Label(Label L, pair position, align align=<default>, pen p=<default>, transform embed(transform)=<default>, filltype filltype=<default>); +Label Label(string s, string size=<default>, explicit position position, align align=<default>, pen p=<default>, transform embed(transform)=<default>, filltype filltype=<default>); +Label Label(Label L, explicit position position, align align=<default>, pen p=<default>, transform embed(transform)=<default>, filltype filltype=<default>); +Label Label; +Label Label(explicit pair position, align align=<default>, pen p=<default>, transform embed(transform)=<default>, filltype filltype=<default>); +Label Label(string s=<default>, string size=<default>, align align=<default>, pen p=<default>, transform embed(transform)=<default>, filltype filltype=<default>); +Label Label(string s, string size=<default>, pair position, align align=<default>, pen p=<default>, transform embed(transform)=<default>, filltype filltype=<default>); +string font(pen p=<default>); +pen font(string name, string options=<default>); +pen font(string encoding, string family, string series, string shape); +pen font(string name, real size, string options=<default>); +marker markthin(path g, pen p=<default>, real thin(real fraction)=<default>, filltype filltype=<default>); +int intMin; +pen white; +side RightSide; +string replace(string s, string[][] translate); +string replace(string s, string before, string after); +transform fixedscaling(picture pic=<default>, pair min, pair max, pen p=<default>, bool warn=<default>); +pen Symbol(string series=<default>, string shape=<default>); +slice firstcut(path p, path knife); +pen squarecap; +pen squarepen; +bool EndArrow(picture, path, pen, marginT(path, pen)); +bool EndArrow(picture, path, pen, marginT(path, pen))(arrowhead arrowhead=<default>, real size=<default>, real angle=<default>, filltype filltype=<default>, position position=<default>); +real barsize(pen p=<default>); +bool EndArcArrow(picture, path, pen, marginT(path, pen))(arrowhead arrowhead=<default>, real size=<default>, real angle=<default>, filltype filltype=<default>, position position=<default>); +bool EndArcArrow(picture, path, pen, marginT(path, pen)); +void tensorshade(frame f, path[] g, bool stroke=<default>, pen fillrule=<default>, pen[][] p, path[] b=<default>, pair[][] z=<default>, bool copy=<default>); +void tensorshade(picture pic=<default>, path[] g, bool stroke=<default>, pen fillrule=<default>, pen[][] p, path[] b=<default>, pair[][] z=<default>, bool copy=<default>); +void tensorshade(frame f, path[] g, bool stroke=<default>, pen fillrule=<default>, pen[] p, path b=<default>, pair[] z); +void tensorshade(picture pic=<default>, path[] g, bool stroke=<default>, pen fillrule=<default>, pen[] p, path b=<default>, pair[] z); +void tensorshade(frame f, path[] g, bool stroke=<default>, pen fillrule=<default>, pen[] p, path b=<default>); +void tensorshade(picture pic=<default>, path[] g, bool stroke=<default>, pen fillrule=<default>, pen[] p, path b=<default>); +string[] split(string s, string delimiter=<default>); +void addSaveFunction(void s()()); +object embed3(string, frame, string, string, string, light, projection); +filltype NoFill; +real colatitude(triple v, bool warn=<default>); +void label(frame f, string s, string size, transform t, pair position, pair align, pen p); +void label(picture pic=<default>, Label L, align align=<default>, pen p=<default>, filltype filltype=<default>); +void label(frame f, Label L, pair position, align align=<default>, pen p=<default>, filltype filltype=<default>); +void label(picture pic=<default>, Label L, pair position, align align=<default>, pen p=<default>, filltype filltype=<default>); +void label(frame f, Label L, align align=<default>, pen p=<default>, filltype filltype=<default>); +void label(picture pic=<default>, Label L, explicit guide g, align align=<default>, pen p=<default>, filltype filltype=<default>); +void label(picture pic=<default>, Label L, explicit path g, align align=<default>, pen p=<default>, filltype filltype=<default>); +real fabs(real x); +real[] fabs(real[] a); +bool labels(frame f); +light light(pen diffuse=<default>, pen ambient=<default>, pen specular=<default>, pen background=<default>, real specularfactor=<default>, bool viewport=<default> ... triple[] position); +light light(pen[] diffuse, pen[] ambient=<default>, pen[] specular=<default>, pen background=<default>, real specularfactor=<default>, bool viewport=<default>, triple[] position); +light light(explicit light light); +light light(pen diffuse=<default>, pen ambient=<default>, pen specular=<default>, pen background=<default>, bool viewport=<default>, real x, real y, real z); +real remainder(real x, real y); +int byte(real x); +real camerafactor; +pen lightred; +real labelmargin; +real labelmargin(pen p=<default>); +pen lightblue; +pen lightgreen; +pair right; +string outformat(string format=<default>); +pen lightcyan; +pen lightmagenta; +pen lightyellow; +pen lightgray; +pen lightolive; +pen lightgrey; +string upcase(string s); +pen darkblue; +pen darkbrown; +path[] strokepath(path g, pen p=<default>); +real erf(real x); +void saveline(string name, string value, bool store=<default>); +pen fuchsia; +bool needshipout(); +filltype filltype(int type=<default>, pen fillpen=<default>, pen drawpen=<default>, void fill2(frame f, path[] g, pen fillpen)); +frame[] fit(string prefix=<default>, picture[] pictures, string format=<default>, bool view=<default>, string options=<default>, string script=<default>, projection P=<default>); +path box(pair a, pair b); +path box(frame dest, frame src=<default>, real xmargin=<default>, real ymargin=<default>, pen p=<default>, filltype filltype=<default>, bool above=<default>); +path box(frame f, Label L, real xmargin=<default>, real ymargin=<default>, pen p=<default>, filltype filltype=<default>, bool above=<default>); +pen Bookman(string series=<default>, string shape=<default>); +void seekeof(file f); +path unitcircle; +framedTransformStack xformStack; +pair[] conj(pair[] a); +pair[][] conj(pair[][] a); +pair conj(pair z); +pen deepgray; +pen deepgreen; +pen deepgrey; +marker[] Mark; +marker Mark(int n); +real aTan(real x); +void _begingroup3(frame f, string name, real compression, real granularity, bool closed, bool tessellate, bool dobreak, bool nobreak, triple center, int interaction); +path[] MarkPath; +string graphic(string name, string options=<default>); +real aCos(real x); +void texreset(); +int[] complement(int[] a, int n); +path[] complement(frame f, path[] g); +pen Cyan; +marginT NoMargin(path, pen); +marginT NoMargin(path, pen)(); +path[][] _texpath(string[] s, pen[] p); +real sinh(real x); +real[] sinh(real[] a); +real[] _cputime(); +position EndPoint; +hsv hsv(real h, real s, real v); +hsv hsv(pen p); +void deconstruct(frame f, frame preamble=<default>, real magnification=<default>, transform xform()); +void deconstruct(picture pic=<default>, real magnification=<default>); +int sgn(real x); +pair minAfterTransform(transform t, path[] a); +int seconds(string t=<default>, string format=<default>); +pen cyan; +pen grey; +real cm; +filltype Fill; +filltype Fill(real xmargin=<default>, real ymargin=<default>, pen p=<default>); +pen olive; +pen darkolive; +int ascii(string s); +real arcarrowangle; +real arcarrowfactor; +real mm; +real arcarrowsize(pen p=<default>); +real calculateScaling(string dir, coord[] coords, real size, bool warn=<default>); +real calculateScaling(string dir, coord[] coords, real size, bool warn=<default>); +real calculateScaling(string dir, coord[] m, coord[] M, real size, bool warn=<default>); +real calculateScaling(string dir, coord[] m, coord[] M, real size, bool warn=<default>); +triple gettriple(string name=<default>, triple default=<default>, string prompt=<default>, bool store=<default>); +void drawpixel(frame f, triple v, pen p, real width=<default>); +pen fontsize(real size, real lineskip); +real fontsize(pen p=<default>); +pen fontsize(real size); +string Link(string label, string text, string options=<default>); +void close(file f); +real lineskip(pen p=<default>); +pen dashed; +pair maxAfterTransform(transform t, path[] a); +int[][] triangulate(pair[] z); +void fill(frame f, path[] g, pen p=<default>, bool copy=<default>); +path fill(frame dest, frame src, filltype filltype=<default>, real xmargin=<default>, real ymargin=<default>); +void fill(picture pic=<default>, path[] g, pen p=<default>, bool copy=<default>); +void fill(pair origin, picture pic=<default>, path[] g, pen p=<default>); +pair midpoint(path p); +real exp(real x); +real[] exp(real[] a); +pair exp(explicit pair z); +pen linejoin(int n); +int linejoin(pen p=<default>); +real ldexp(real x, int e); +pen rgba(real[] a); +real[] rgba(pen p); +string time(string format=<default>); +string time(int seconds, string format=<default>); +void prepend(frame dest, frame src); +real pt; +settings settings; +int MoveQuiet; +marginT EndMargin(path, pen); +pen nullpen; +side LeftSide; +path nullpath; +guide[] copy(guide[] a, int depth=<default>); +real[] copy(real[] a, int depth=<default>); +triple[] copy(triple[] a, int depth=<default>); +bool[] copy(bool[] a, int depth=<default>); +real[][] copy(real[][] a, int depth=<default>); +pen[] copy(pen[] a, int depth=<default>); +coord[] copy(coord[] a, int depth=<default>); +coord[] copy(coord[] a, int depth=<default>); +picture[] copy(picture[] a, int depth=<default>); +marker[] copy(marker[] a, int depth=<default>); +Legend[] copy(Legend[] a, int depth=<default>); +Label[] copy(Label[] a, int depth=<default>); +pen[][] copy(pen[][] a, int depth=<default>); +path[] copy(path[] a, int depth=<default>); +string[] copy(string[] a, int depth=<default>); +void()()[] copy(void()()[] a, int depth=<default>); +int[] copy(int[] a, int depth=<default>); +string[][] copy(string[][] a, int depth=<default>); +frame[] copy(frame[] a, int depth=<default>); +pair[] copy(pair[] a, int depth=<default>); +bool3[] copy(bool3[] a, int depth=<default>); +object[] copy(object[] a, int depth=<default>); +pair[][] copy(pair[][] a, int depth=<default>); +real[] abs(pair[] a); +real[] abs(triple[] a); +real abs(real x); +real[] abs(real[] a); +real abs(pair z); +real abs(triple v); +int abs(int x); +pen pink; +real inches; +path ellipse(frame dest, frame src=<default>, real xmargin=<default>, real ymargin=<default>, pen p=<default>, filltype filltype=<default>, bool above=<default>); +path ellipse(frame f, Label L, real xmargin=<default>, real ymargin=<default>, pen p=<default>, filltype filltype=<default>, bool above=<default>); +path ellipse(pair c, real a, real b); +pair getpair(string name=<default>, pair default=<default>, string prompt=<default>, bool store=<default>); +void axialshade(frame f, path[] g, bool stroke=<default>, pen pena, pair a, pen penb, pair b, bool copy=<default>); +void axialshade(picture pic=<default>, path[] g, bool stroke=<default>, pen pena, pair a, pen penb, pair b, bool copy=<default>); +string locale(string s=<default>); +real dirtime(path p, pair z); +void copyPairOrTriple(pairOrTriple dest, pairOrTriple src); +real[] colors(pen p); +void filloutside(picture pic=<default>, path[] g, pen p=<default>, bool copy=<default>); +void filloutside(frame f, path[] g, pen p=<default>, bool copy=<default>); +pen[] colorPen; +pen colorless(pen p); +pen solid; +string colorspace(pen p); +void warn(string s); +pen deepblue; +pen palered; +real[] map(real f(pair), pair[] a); +int[] map(int f(real), real[] a); +bool3[] map(bool3 f(bool3), bool3[] a); +frame[] map(frame f(frame), frame[] a); +coord[] map(coord f(coord), coord[] a); +pen[][] map(pen[] f(pen[]), pen[][] a); +triple[] map(triple f(triple), triple[] a); +pen[] map(pen f(pen), pen[] a); +pair[] map(pair f(pair), pair[] a); +coord[] map(coord f(coord), coord[] a); +Label[] map(Label f(Label), Label[] a); +string[] map(string f(string), string[] a); +object[] map(object f(object), object[] a); +void()()[] map(void f()()(void()()), void()()[] a); +pair[][] map(pair[] f(pair[]), pair[][] a); +real[] map(real f(real), real[] a); +Legend[] map(Legend f(Legend), Legend[] a); +int[] map(int f(int), int[] a); +string[][] map(string[] f(string[]), string[][] a); +bool[] map(bool f(bool), bool[] a); +path[] map(path f(path), path[] a); +real[][] map(real[] f(real[]), real[][] a); +picture[] map(picture f(picture), picture[] a); +marker[] map(marker f(marker), marker[] a); +guide[] map(guide f(guide), guide[] a); +path unstraighten(path p); +path3 unstraighten(path3 p); +void _image(frame f, real[][] data, pair initial, pair final, pen[] palette=<default>, transform t=<default>, bool copy=<default>, bool antialias=<default>); +void _image(frame f, pen[][] data, pair initial, pair final, transform t=<default>, bool copy=<default>, bool antialias=<default>); +void _image(frame f, pen f(int, int), int width, int height, pair initial, pair final, transform t=<default>, bool antialias=<default>); +pair arcpoint(path p, real L); +pen Pen(int n); +int rfind(string s, string t, int pos=<default>); +pair minratio(frame f); +pair minratio(triple[][] p, pair b); +pair minratio(path3 g); +int[] sequence(int n); +pen[][] sequence(pen[] f(int), int n); +coord[] sequence(coord f(int), int n); +coord[] sequence(coord f(int), int n); +picture[] sequence(picture f(int), int n); +marker[] sequence(marker f(int), int n); +Legend[] sequence(Legend f(int), int n); +Label[] sequence(Label f(int), int n); +int[] sequence(int f(int), int n); +string[][] sequence(string[] f(int), int n); +pair[] sequence(pair f(int), int n); +guide[] sequence(guide f(int), int n); +pen[] sequence(pen f(int), int n); +void()()[] sequence(void f()()(int), int n); +bool[] sequence(bool f(int), int n); +string[] sequence(string f(int), int n); +pair[][] sequence(pair[] f(int), int n); +bool3[] sequence(bool3 f(int), int n); +object[] sequence(object f(int), int n); +real[][] sequence(real[] f(int), int n); +real[] sequence(real f(int), int n); +int[] sequence(int n, int m); +triple[] sequence(triple f(int), int n); +path[] sequence(path f(int), int n); +frame[] sequence(frame f(int), int n); +triple minbezier(triple[][] p, triple b); +path trim(path g, real begin, real end); +marginT DotMargin(path, pen)(real begin, real end); +marginT DotMargin(path, pen); +marginT DotMargins(path, pen); +string string(int x); +string string(real x, int digits=<default>); +string cd(string s=<default>); +int size(guide g); +pair size(frame f); +int size(path p); +int size(path3 p); +pair size(picture pic, bool user=<default>); +void size(picture pic=<default>, real x, real y=<default>, bool keepAspect=<default>); +void size(picture dest, picture src); +void size(picture pic=<default>, real xsize, real ysize, pair min, pair max); +void clear(file f); +void clear(string file, int line); +void clear(); +void clear(string file, string text); +pen mediumred; +pen mediumblue; +pen mediumgreen; +pen mediumcyan; +pen mediummagenta; +pair arcdir(path p, real L); +pen mediumyellow; +pen mediumgray; +string downcase(string s); +pen mediumgrey; +transform transform(pen p); +string readline(string prompt=<default>, string name=<default>, bool tabcompletion=<default>); +void beep(); +pair relpoint(path p, real l); +pair[][] transpose(pair[][] a); +pen[][] transpose(pen[][] a); +string[][] transpose(string[][] a); +real[][] transpose(real[][] a); +pen overwrite(int n); +int overwrite(pen p=<default>); +pen linewidth(real x); +real linewidth(pen p=<default>); +transformation transformation(real[][] modelview); +transformation transformation(real[][] modelview, real[][] projection); +pair maxratio(frame f); +pair maxratio(triple[][] p, pair b); +pair maxratio(path3 g); +triple maxbezier(triple[][] p, triple b); +void layer(frame f); +void layer(picture pic=<default>); +void DOSnewl(file file); +pen cmyk(pen p); +pen cmyk(real c, real m, real y, real k); +pen blue; +pen evenodd; +int precision(file f=<default>, int digits=<default>); +path3 path3(triple[] pre, triple[] point, triple[] post, bool[] straight, bool cyclic); +bool piecewisestraight(path p); +bool piecewisestraight(path3 p); +void stop(string file, int line, code s=<default>); +void stop(string file, string text, code s=<default>); +pair reldir(path p, real l); +pen TimesRoman(string series=<default>, string shape=<default>); +slice cut(path p, path knife, int n); +bool is3D(frame f); +bool is3D(string format=<default>); +void report(string text); +void report(int i); +void report(transform t); +void add(frame dest, frame src); +void add(picture pic=<default>, Label L); +void add(picture pic=<default>, void d(frame f, transform t), bool exact=<default>); +void add(frame dest, frame src, filltype filltype, bool above=<default>); +void add(frame dest, frame src, bool group, filltype filltype=<default>, bool above=<default>); +void add(picture pic=<default>, void d(picture, real[][]), bool exact=<default>); +void add(frame dest, frame src, pair position, bool group=<default>, filltype filltype=<default>, bool above=<default>); +void add(picture dest=<default>, frame src, pair position=<default>, bool group=<default>, filltype filltype=<default>, bool above=<default>); +void add(picture src, pair position, bool group=<default>, filltype filltype=<default>, bool above=<default>); +void add(picture dest=<default>, frame src, pair position, pair align, bool group=<default>, filltype filltype=<default>, bool above=<default>); +void add(frame dest, frame src, pair position, pair align, bool group=<default>, filltype filltype=<default>, bool above=<default>); +void add(picture src, bool group=<default>, filltype filltype=<default>, bool above=<default>); +void add(picture pic=<default>, void d(frame f, real[][] t, picture pic, projection P), bool exact=<default>); +void add(frame f, transform t=<default>, Label L); +void add(picture pic=<default>, void d(picture, transform), bool exact=<default>); +void add(picture dest, picture src, bool group=<default>, filltype filltype=<default>, bool above=<default>); +void add(picture dest, picture src, pair position, bool group=<default>, filltype filltype=<default>, bool above=<default>); +void add(picture dest=<default>, object F, pair position=<default>, bool group=<default>, filltype filltype=<default>, bool above=<default>); +plain plain; +void purge(int divisor=<default>); +int Round(real x); +real sqrt(real x); +real[] sqrt(real[] a); +pair sqrt(explicit pair z); +real[] times(path p, real x); +real[] times(path p, explicit pair z); +void Draw(picture pic=<default>, path g, pen p=<default>); +filltype Draw; +void Draw(picture pic=<default>, explicit path[] g, pen p=<default>); +filltype Draw(real xmargin=<default>, real ymargin=<default>, pen p=<default>); +void tab(file file); +plain_scaling plain_scaling; +string file(string s); +plain_bounds plain_bounds; +string outprefix(string prefix=<default>); +object object(frame f); +object object(Label L); +object object(Label L, path e(frame dest, frame src=<default>, real xmargin=<default>, real ymargin=<default>, pen p=<default>, filltype filltype=<default>, bool above=<default>), real xmargin=<default>, real ymargin=<default>, pen p=<default>, filltype filltype=<default>, bool above=<default>); +file stdin; +void()()[] array(int n, void value()(), int depth=<default>); +bool[] array(int n, bool value, int depth=<default>); +string[] array(int n, string value, int depth=<default>); +pair[][] array(int n, pair[] value, int depth=<default>); +bool3[] array(int n, bool3 value, int depth=<default>); +object[] array(int n, object value, int depth=<default>); +real[][] array(int n, real[] value, int depth=<default>); +real[] array(int n, real value, int depth=<default>); +triple[] array(int n, triple value, int depth=<default>); +path[] array(int n, path value, int depth=<default>); +frame[] array(int n, frame value, int depth=<default>); +pen[][] array(int n, pen[] value, int depth=<default>); +coord[] array(int n, coord value, int depth=<default>); +coord[] array(int n, coord value, int depth=<default>); +picture[] array(int n, picture value, int depth=<default>); +marker[] array(int n, marker value, int depth=<default>); +Legend[] array(int n, Legend value, int depth=<default>); +Label[] array(int n, Label value, int depth=<default>); +int[] array(int n, int value, int depth=<default>); +string[][] array(int n, string[] value, int depth=<default>); +pair[] array(int n, pair value, int depth=<default>); +guide[] array(int n, guide value, int depth=<default>); +pen[] array(int n, pen value, int depth=<default>); +bool BeginBar(picture, path, pen, marginT(path, pen)); +bool BeginBar(picture, path, pen, marginT(path, pen))(real size=<default>); +triple perp(triple v, triple u); +int find(bool[] a, int n=<default>); +int find(string s, string t, int pos=<default>); +position BeginPoint; +marginT BeginMargin(path, pen); +path buildcycle(... path[] p); +bool BeginArrow(picture, path, pen, marginT(path, pen)); +bool BeginArrow(picture, path, pen, marginT(path, pen))(arrowhead arrowhead=<default>, real size=<default>, real angle=<default>, filltype filltype=<default>, position position=<default>); +marginT BeginPenMargin(path, pen); +int round(real x); +marginT BeginDotMargin(path, pen); +bool BeginArcArrow(picture, path, pen, marginT(path, pen)); +bool BeginArcArrow(picture, path, pen, marginT(path, pen))(arrowhead arrowhead=<default>, real size=<default>, real angle=<default>, filltype filltype=<default>, position position=<default>); +pen roundcap; +void buildRestoreThunk()(); +pen roundjoin; +int sourceline(string file, string text); +void buildRestoreDefaults()(); +path roundbox(frame dest, frame src=<default>, real xmargin=<default>, real ymargin=<default>, pen p=<default>, filltype filltype=<default>, bool above=<default>); +path roundbox(frame f, Label L, real xmargin=<default>, real ymargin=<default>, pen p=<default>, filltype filltype=<default>, bool above=<default>); +real asin(real x); +real[] asin(real[] a); +pair endpoint(path p); +real latitude(triple v, bool warn=<default>); +int sum(int[] a); +real sum(real[] a); +pair sum(pair[] a); +triple sum(triple[] a); +int sum(bool[] a); +real inf; +real arctime(path p, real l); +real arctime(path3 p, real dval); +pen palemagenta; +void draw(frame f, triple[][] p, triple center, bool straight, pen[] p, real opacity, real shininess, real prcshininess, triple normal, pen[] colors, bool lighton, int interaction, bool prc=<default>); +void draw(frame f, triple[] p, real[] knot, real[] weights=<default>, pen p); +void draw(frame f, triple[][] p, real[] uknot, real[] vknot, real[][] weights=<default>, pen[] p, real opacity, real shininess, real prcshininess, pen[] colors, bool lighton); +void draw(picture pic=<default>, path[] g, pen fillrule=<default>, pen[] p); +object draw(picture pic=<default>, Label L, path e(frame dest, frame src=<default>, real xmargin=<default>, real ymargin=<default>, pen p=<default>, filltype filltype=<default>, bool above=<default>), real xmargin=<default>, real ymargin=<default>, pen p=<default>, filltype filltype=<default>, bool above=<default>); +void draw(frame f, explicit path[] g, pen p=<default>); +void draw(frame f, path g, pen p=<default>, bool arrow(picture, path, pen, marginT(path, pen))); +void draw(picture pic=<default>, Label L=<default>, path g, align align=<default>, pen p=<default>, bool arrow(picture, path, pen, marginT(path, pen))=<default>, bool bar(picture, path, pen, marginT(path, pen))=<default>, marginT margin(path, pen)=<default>, Label legend=<default>, marker marker=<default>); +void draw(pair origin, picture pic=<default>, Label L=<default>, path g, align align=<default>, pen p=<default>, bool arrow(picture, path, pen, marginT(path, pen))=<default>, bool bar(picture, path, pen, marginT(path, pen))=<default>, marginT margin(path, pen)=<default>, Label legend=<default>, marker marker=<default>); +void draw(picture pic=<default>, guide[] g, pen p=<default>, Label legend=<default>, marker marker=<default>); +void draw(pair origin, picture pic=<default>, guide[] g, pen p=<default>, Label legend=<default>, marker marker=<default>); +object draw(picture pic=<default>, Label L, path e(frame dest, frame src=<default>, real xmargin=<default>, real ymargin=<default>, pen p=<default>, filltype filltype=<default>, bool above=<default>), pair position, real xmargin=<default>, real ymargin=<default>, pen p=<default>, filltype filltype=<default>, bool above=<default>); +void draw(picture pic=<default>, explicit path[] g, pen p=<default>, Label legend=<default>, marker marker=<default>); +void draw(pair origin, picture pic=<default>, explicit path[] g, pen p=<default>, Label legend=<default>, marker marker=<default>); +void draw(frame f, guide[] g, pen p=<default>); +void draw(frame f, path g, pen p=<default>); +int mantissaBits; +real identity(real x); +real[] identity(real[] a); +transform identity(); +real[][] identity(int n); +real[][] identity4; +marker[] MarkFill; +pen pattern(string s); +string pattern(pen p); +transform invert; +transform inverse(transform t); +real[][] inverse(real[][] a); +pair unit(pair z); +triple unit(triple v); +triple min3(frame f); +triple min3(pen p); +void begin(picture pic=<default>, string name, string id=<default>, bool visible=<default>); +void drawPRCdisk(frame f, real[][] t, pen[] p, real opacity, real shininess); +void drawPRCtube(frame f, path3 center, path3 g, pen[] p, real opacity, real shininess); +int CLZ(int a); +void drawPRCsphere(frame f, real[][] t, bool half=<default>, pen[] p, real opacity, real shininess, int type); +arrowhead DefaultHead; +void drawPRCcylinder(frame f, real[][] t, pen[] p, real opacity, real shininess); +void beginclip(frame f, path[] g, bool stroke=<default>, pen fillrule=<default>, bool copy=<default>); +void beginclip(picture pic=<default>, path[] g, bool stroke=<default>, pen fillrule=<default>, bool copy=<default>); +void begingroup(frame f); +void begingroup(picture pic=<default>); +marker nomarker; +pair beginpoint(path p); +real azimuth(triple v, bool warn=<default>); +real angle(pair z, bool warn=<default>); +real angle(transform t); +pair ENE; +frame pack(pair align=<default> ... object[] inset); +void gsave(frame f); +void write(file file=<default>, string s=<default>, bool x, void suffix(file)=<default> ... bool[]); +void write(file file=<default>, string s=<default>, explicit bool[] a ... bool[][]); +void write(file file=<default>, bool[][]); +void write(file file=<default>, bool[][][]); +void write(file file=<default>, string s=<default>, int x, void suffix(file)=<default> ... int[]); +void write(file file=<default>, string s=<default>, explicit int[] a ... int[][]); +void write(file file=<default>, int[][]); +void write(file file=<default>, int[][][]); +void write(file file=<default>, string s=<default>, real x, void suffix(file)=<default> ... real[]); +void write(file file=<default>, string s=<default>, explicit real[] a ... real[][]); +void write(file file=<default>, real[][]); +void write(file file=<default>, real[][][]); +void write(file file=<default>, string s=<default>, pair x, void suffix(file)=<default> ... pair[]); +void write(file file=<default>, string s=<default>, explicit pair[] a ... pair[][]); +void write(file file=<default>, pair[][]); +void write(file file=<default>, pair[][][]); +void write(file file=<default>, string s=<default>, triple x, void suffix(file)=<default> ... triple[]); +void write(file file=<default>, string s=<default>, explicit triple[] a ... triple[][]); +void write(file file=<default>, triple[][]); +void write(file file=<default>, triple[][][]); +void write(file file=<default>, string s=<default>, string x, void suffix(file)=<default> ... string[]); +void write(file file=<default>, string s=<default>, explicit string[] a ... string[][]); +void write(file file=<default>, string[][]); +void write(file file=<default>, string[][][]); +void write(file file=<default>, string s, void suffix(file)=<default>); +void write(file file=<default>, string s=<default>, transform x, void suffix(file)=<default> ... transform[]); +void write(file file=<default>, string s=<default>, guide x, void suffix(file)=<default> ... guide[]); +void write(file file=<default>, string s=<default>, pen x, void suffix(file)=<default> ... pen[]); +void write(file file, string s=<default>, explicit guide[] x, void suffix(file)=<default>); +void write(pairOrTriple a); +void write(string s=<default>, cputime c, string format=<default>, void suffix(file)=<default>); +void write(string s=<default>, explicit path[] x, void suffix(file)=<default>); +void write(file file, void suffix(file)=<default>); +void write(file file=<default>, string s=<default>, pen[] p); +void write(void suffix(file)=<default>); +void write(file file, string s=<default>, explicit path[] x, void suffix(file)=<default>); +void write(file file=<default>, align align, void suffix(file)=<default>); +void write(file file=<default>, Label L, void suffix(file)=<default>); +void write(file file, string s=<default>, cputime c, string format=<default>, void suffix(file)=<default>); +void write(string s=<default>, bool3 b, void suffix(file)=<default>); +void write(file file, string s=<default>, bool3 b, void suffix(file)=<default>); +void write(string s=<default>, explicit guide[] x, void suffix(file)=<default>); +void save()(); +marginT EndPenMargin(path, pen); +pair NNE; +real[] tridiagonal(real[] a, real[] b, real[] c, real[] f); +pen Dotted; +pen Dotted(pen p=<default>); +pair dir(real degrees); +pair dir(explicit pair z); +triple dir(explicit triple z); +triple dir(real colatitude, real longitude); +pair dir(path p, int t, int sign=<default>, bool normalize=<default>); +pair dir(path p, real t, bool normalize=<default>); +triple dir(path3 p, int t, int sign=<default>, bool normalize=<default>); +triple dir(path3 p, real t, bool normalize=<default>); +pair dir(path p); +pair dir(path p, path q); +int[][] diagonal(... int[]); +real[][] diagonal(... real[]); +pair[][] diagonal(... pair[]); +real reltime(path p, real l); +void marknodes(picture pic=<default>, frame f, path g); +real newton(int iterations=<default>, real f(real), real fprime(real), real x, bool verbose=<default>); +real newton(int iterations=<default>, real f(real), real fprime(real), real x1, real x2, bool verbose=<default>); +string TeXify(string s); +bool3 default; +pair[] controlSpecifier(guide g, int t); +void defaultpen(pen p); +pen defaultpen(); +pen defaultpen; +void defaultpen(real w); +transform Slant(transform t); +triple max3(frame f); +triple max3(pen p); +string defaultformat(int n, string trailingzero=<default>, bool fixed=<default>, bool signed=<default>); +string defaultformat; +pen dashdotted; +string defaultseparator; +string asydir(); +string defaultfilename; +real longitude(triple v, bool warn=<default>); +bool Blank(picture, path, pen, marginT(path, pen)); +tensionSpecifier tensionSpecifier(guide g, int t); +marker marker(frame f=<default>, void markroutine(picture pic=<default>, frame f, path g)=<default>, bool above=<default>); +marker marker(path[] g, void markroutine(picture pic=<default>, frame f, path g)=<default>, pen p=<default>, filltype filltype=<default>, bool above=<default>); +int Move; +string location(); +string locatefile(string file); +pen dotted; +string blend(pen p); +arrowhead HookHead; +arrowhead HookHead(real dir=<default>, real barb=<default>); +Legend[] concat(... Legend[][]); +real[] concat(... real[][]); +object[] concat(... object[][]); +pair[] concat(... pair[][]); +coord[] concat(... coord[][]); +Label[] concat(... Label[][]); +pen[] concat(... pen[][]); +path[] concat(... path[][]); +coord[] concat(... coord[][]); +int[] concat(... int[][]); +void()()[] concat(... void()()[][]); +bool3[] concat(... bool3[][]); +string[] concat(... string[][]); +picture[] concat(... picture[][]); +marker[] concat(... marker[][]); +triple[] concat(... triple[][]); +frame[] concat(... frame[][]); +guide[] concat(... guide[][]); +bool[] concat(... bool[][]); +int OR(int a, int b); +real log1p(real x); +real[] log1p(real[] a); +real infinity; +bool alias(pair[][] a, pair[][] b); +bool alias(guide[] a, guide[] b); +bool alias(hsv a, hsv b); +bool alias(coord[] a, coord[] b); +bool alias(projection a, projection b); +bool alias(picture a, picture b); +bool alias(marker a, marker b); +bool alias(pair[] a, pair[] b); +bool alias(scaling a, scaling b); +bool alias(bounds a, bounds b); +bool alias(scaleT a, scaleT b); +bool alias(position a, position b); +bool alias(cputime a, cputime b); +bool alias(int[] a, int[] b); +bool alias(string[][] a, string[][] b); +bool alias(filltype a, filltype b); +bool alias(coord[] a, coord[] b); +bool alias(coords2 a, coords2 b); +bool alias(Legend a, Legend b); +bool alias(align a, align b); +bool alias(framedTransformStack a, framedTransformStack b); +bool alias(Label[] a, Label[] b); +bool alias(real[][] a, real[][] b); +bool alias(bool3 a, bool3 b); +bool alias(bool3[] a, bool3[] b); +bool alias(light a, light b); +bool alias(indexedTransform a, indexedTransform b); +bool alias(arrowhead a, arrowhead b); +bool alias(string[] a, string[] b); +bool alias(frame[] a, frame[] b); +bool alias(coords2 a, coords2 b); +bool alias(coord a, coord b); +bool alias(autoscaleT a, autoscaleT b); +bool alias(Label a, Label b); +bool alias(Legend[] a, Legend[] b); +bool alias(bool[] a, bool[] b); +bool alias(void()()[] a, void()()[] b); +bool alias(pen[][] a, pen[][] b); +bool alias(marginT a, marginT b); +bool alias(freezableBounds a, freezableBounds b); +bool alias(transformation a, transformation b); +bool alias(pairOrTriple a, pairOrTriple b); +bool alias(path[] a, path[] b); +bool alias(triple[] a, triple[] b); +bool alias(coord a, coord b); +bool alias(coords3 a, coords3 b); +bool alias(side a, side b); +bool alias(picture[] a, picture[] b); +bool alias(marker[] a, marker[] b); +bool alias(processtime a, processtime b); +bool alias(real[] a, real[] b); +bool alias(pen[] a, pen[] b); +bool alias(slice a, slice b); +bool alias(scaling a, scaling b); +bool alias(ScaleT a, ScaleT b); +bool alias(object a, object b); +bool alias(object[] a, object[] b); +real pi; +int getint(string name=<default>, int default=<default>, string prompt=<default>, bool store=<default>); +bool IgnoreAspect; +void postscript(frame f, string s); +void postscript(frame f, string s, pair min, pair max); +void postscript(picture pic=<default>, string s, pair min, pair max); +void postscript(picture pic=<default>, string s); +transform slant(real s); +void breakpoint(code s=<default>); +void breakpoints(); +void endgroup(frame f); +void endgroup(picture pic=<default>); +void endgroup3(frame f); +int Floor(real x); +pair gamma(explicit pair z); +real gamma(real x); +real pow10(real x); +real[] pow10(real[] a); +real bp; +int[] sort(int[] a); +int[][] sort(int[][] a); +real[] sort(real[] a); +real[][] sort(real[][] a); +string[] sort(string[] a); +string[][] sort(string[][] a); +path[] sort(path[] a, bool less(path, path)); +Legend[] sort(Legend[] a, bool less(Legend, Legend)); +pair[] sort(pair[] a, bool less(pair, pair)); +void()()[] sort(void()()[] a, bool less(void()(), void()())); +real[] sort(real[] a, bool less(real, real)); +bool[] sort(bool[] a, bool less(bool, bool)); +object[] sort(object[] a, bool less(object, object)); +coord[] sort(coord[] a, bool less(coord, coord)); +Label[] sort(Label[] a, bool less(Label, Label)); +pen[] sort(pen[] a, bool less(pen, pen)); +pen[][] sort(pen[][] a, bool less(pen[], pen[])); +guide[] sort(guide[] a, bool less(guide, guide)); +real[][] sort(real[][] a, bool less(real[], real[])); +triple[] sort(triple[] a, bool less(triple, triple)); +coord[] sort(coord[] a, bool less(coord, coord)); +string[] sort(string[] a, bool less(string, string)); +int[] sort(int[] a, bool less(int, int)); +string[][] sort(string[][] a, bool less(string[], string[])); +bool3[] sort(bool3[] a, bool less(bool3, bool3)); +pair[][] sort(pair[][] a, bool less(pair[], pair[])); +picture[] sort(picture[] a, bool less(picture, picture)); +marker[] sort(marker[] a, bool less(marker, marker)); +frame[] sort(frame[] a, bool less(frame, frame)); +pen salmon; +bool ignore; +pen Pentype(int n); +pen chartreuse; +void latticeshade(frame f, path[] g, bool stroke=<default>, pen fillrule=<default>, pen[][] p, transform t=<default>, bool copy=<default>); +void latticeshade(picture pic=<default>, path[] g, bool stroke=<default>, pen fillrule=<default>, pen[][] p, bool copy=<default>); +pair[] pairs(real[] x, real[] y); +void eval(code s, bool embedded=<default>); +void eval(string s, bool embedded=<default>); +bool Arrow(picture, path, pen, marginT(path, pen)); +bool Arrow(picture, path, pen, marginT(path, pen))(arrowhead arrowhead=<default>, real size=<default>, real angle=<default>, filltype filltype=<default>, position position=<default>); +bool Arrows(picture, path, pen, marginT(path, pen))(arrowhead arrowhead=<default>, real size=<default>, real angle=<default>, filltype filltype=<default>); +bool Arrows(picture, path, pen, marginT(path, pen)); +int tell(file f); +pen Yellow; +pair up; +guide reverse(guide g); +string reverse(string s); +path reverse(path p); +path3 reverse(path3 p); +triple[] reverse(triple[] a); +int[] reverse(int[] a); +real[] reverse(real[] a); +int[] reverse(int n); +string[] reverse(string[] a); +pair[] reverse(pair[] a); +bool[] reverse(bool[] a); +void _labelpath(frame f, string s, string size, path g, string justify, pair offset, pen p); +int floor(real x); +void resetdefaultpen(); +real aSin(real x); +pen darkred; +transform Scale(transform t); +pen mean(pen[] p, real opacity(real[])=<default>); +pen[] mean(pen[][] palette, real opacity(real[])=<default>); +string mktemp(string s); +void sleep(int seconds); +void unitsize(picture pic=<default>, real x, real y=<default>, real z=<default>); +void arrow(picture pic=<default>, Label L=<default>, pair b, pair dir, real length=<default>, align align=<default>, pen p=<default>, bool arrow(picture, path, pen, marginT(path, pen))=<default>, marginT margin(path, pen)=<default>); +picture arrow(arrowhead arrowhead=<default>, path g, pen p=<default>, real size=<default>, real angle=<default>, filltype filltype=<default>, position position=<default>, bool forwards=<default>, marginT margin(path, pen)=<default>, bool center=<default>); +picture arrow2(arrowhead arrowhead=<default>, path g, pen p=<default>, real size=<default>, real angle=<default>, filltype filltype=<default>, marginT margin(path, pen)=<default>); +path unitsquare; +real arrowdir; +real arrowbarb; +pen yellow; +int delete(string s); +pen miterjoin; +arrowhead SimpleHead; +real arrowangle; +real arrowlength; +pen miterlimit(real x); +real miterlimit(pen p=<default>); +real arrowfactor; +real arrowsize(pen p=<default>); +real Tan(real deg); +real arrowsizelimit; +real arrow2sizelimit; +real arrowhookfactor; +real arrowtexfactor; +void comma(file file); +void deletepreamble(); +real[] arrowbasepoints(path base, path left, path right); +path arrowbase(path r, pair y, real t, real size); +int choose(int n, int k); +real hypot(real x, real y); +path[] _strokepath(path g, pen p=<default>); +void pause(string w=<default>); +int ocgindex; +pen springgreen; +pen brown; +bool scale(pen p); +transform scale(real x); +transform scale(real x, real y); +real[][] scale(real x, real y, real z); +scaleT scaleT(real T(real x), real Tinv(real x), bool logarithmic=<default>, bool automin=<default>, bool automax=<default>); +string baseline(string s, string template=<default>); +real[][] scale3(real s); +int AND(int a, int b); +real polar(triple v, bool warn=<default>); +real radius(path p, real t); +real radius(path3 p, real t); +real radius(triple z0, triple c0, triple c1, triple z1, real t); +transform scaleless(transform t); +void makedraw(frame f, path g, pen p, int depth=<default>); +pair down; +path arc(pair c, real r, real angle1, real angle2); +path arc(pair c, explicit pair z1, explicit pair z2, bool direction=<default>); +path arc(pair c, real r, real angle1, real angle2, bool direction); +real[] cubicroots(real a, real b, real c, real d); +pen green; +real tan(real x); +real[] tan(real[] a); +pen longdashed; +pair point(guide g, int t); +pair point(path p, int t); +pair point(path p, real t); +triple point(path3 p, int t); +triple point(path3 p, real t); +pair point(picture pic=<default>, pair dir, bool user=<default>); +pair point(object F, pair dir, transform t=<default>); +pair point(frame f, pair dir); +pen longdashdotted; +void usepackage(string s, string options=<default>); +real side(pair a, pair b, pair c); +void drawarrow(frame f, arrowhead arrowhead=<default>, path g, pen p=<default>, real size=<default>, real angle=<default>, filltype filltype=<default>, position position=<default>, bool forwards=<default>, marginT margin(path, pen)=<default>, bool center=<default>); +void drawarrow2(frame f, arrowhead arrowhead=<default>, path g, pen p=<default>, real size=<default>, real angle=<default>, filltype filltype=<default>, marginT margin(path, pen)=<default>); +pen fillrule(int n); +int fillrule(pen p); +pair ESE; +pair project(triple v, real[][] t); +bool prc(string format=<default>); +projection projection(triple camera, triple up=<default>, triple target=<default>, triple normal=<default>, real zoom=<default>, real angle=<default>, pair viewportshift=<default>, bool showtarget=<default>, bool autoadjust=<default>, bool center=<default>, transformation projector(triple camera, triple up, triple target)); +void endl(file file); +marginT TrueMargin(path, pen)(real begin, real end); +pair bezier(pair a, pair b, pair c, pair d, real t); +triple bezier(triple a, triple b, triple c, triple d, real t); +pair SSE; +pair bezierP(pair a, pair b, pair c, pair d, real t); +triple bezierP(triple a, triple b, triple c, triple d, real t); +pair bezierPP(pair a, pair b, pair c, pair d, real t); +triple bezierPP(triple a, triple b, triple c, triple d, real t); +real[] _projection(); +pair bezierPPP(pair a, pair b, pair c, pair d); +triple bezierPPP(triple a, triple b, triple c, triple d); +real Jn(int n, real x); +void initXasyMode(); +int randMax; +path nurb(pair z0, pair z1, pair z2, pair z3, real w0, real w1, real w2, real w3, int m); +align NoAlign; +bool EndBar(picture, path, pen, marginT(path, pen)); +bool EndBar(picture, path, pen, marginT(path, pen))(real size=<default>); +Legend Legend(string label, pen plabel=<default>, pen p=<default>, frame mark=<default>, bool above=<default>); +real Yn(int n, real x); +int NOT(int a); +pen[] monoPen; +bool CW; +bool all(bool[] a); +real atanh(real x); +real[] atanh(real[] a); +frame UpsideDown(frame f); +pair realmult(pair z, pair w); +triple realmult(triple u, triple v); +real acosh(real x); +real[] acosh(real[] a); +real realEpsilon; +pair NW; +real norm(real[] a); +real norm(real[][] a); +real norm(triple[][] a); +int length(guide g); +int length(string s); +real length(pair z); +real length(triple v); +int length(path p); +int length(path3 p); +pair SW; +void flush(file f); +pen thin(); +pen palecyan; +void warning(string s, string t, bool position=<default>); +frame legend(picture pic=<default>, int perline=<default>, real xmargin=<default>, real ymargin=<default>, real linelength=<default>, real hskip=<default>, real vskip=<default>, real maxwidth=<default>, real maxheight=<default>, bool hstretch=<default>, bool vstretch=<default>, pen p=<default>); +picture legend(Legend[] Legend, int perline=<default>, real linelength, real hskip, real vskip, real maxwidth=<default>, real maxheight=<default>, bool hstretch=<default>, bool vstretch=<default>); +real Degrees(real radians); +picture legenditem(Legend legenditem, real linelength); +real legendhskip; +real legendvskip; +pen darkmagenta; +real change2(triple[][] a); +real legendmargin; +bool None(picture, path, pen, marginT(path, pen)); +real dotfactor; +real legendlinelength; +bool diagnostics; +string minipage(string s, real width=<default>); +real legendmaxrelativewidth; +triple cross(triple u, triple v); +path cross(int n, bool round=<default>, real r=<default>); +string operator +(string a, string b); +int operator +(int a, int b); +int[] operator +(int a, int[] b); +int[] operator +(int[] a, int b); +int[] operator +(int[] a, int[] b); +int[][] operator +(int[][] a, int[][] b); +int operator +(int a); +int[] operator +(int[] a); +real operator +(real a, real b); +real[] operator +(real a, real[] b); +real[] operator +(real[] a, real b); +real[] operator +(real[] a, real[] b); +real[][] operator +(real[][] a, real[][] b); +real operator +(real a); +real[] operator +(real[] a); +pair operator +(pair a, pair b); +pair[] operator +(pair a, pair[] b); +pair[] operator +(pair[] a, pair b); +pair[] operator +(pair[] a, pair[] b); +pair[][] operator +(pair[][] a, pair[][] b); +pair operator +(pair a); +pair[] operator +(pair[] a); +triple operator +(triple a, triple b); +triple[] operator +(triple a, triple[] b); +triple[] operator +(triple[] a, triple b); +triple[] operator +(triple[] a, triple[] b); +triple[][] operator +(triple[][] a, triple[][] b); +triple operator +(triple a); +triple[] operator +(triple[] a); +pen operator +(pen a, pen b); +transform operator +(transform a, transform b); +pen operator +(pen p, real w); +marginT operator +(path, pen)(marginT ma(path, pen), marginT mb(path, pen)); +pen[] operator +(pen a, pen[] b); +pen operator +(real w, pen p); +pen[] operator +(pen[] a, pen b); +int operator -(int a, int b); +int[] operator -(int a, int[] b); +int[] operator -(int[] a, int b); +int[] operator -(int[] a, int[] b); +int[][] operator -(int[][] a, int[][] b); +int operator -(int a); +int[] operator -(int[] a); +int[][] operator -(int[][] a); +real operator -(real a, real b); +real[] operator -(real a, real[] b); +real[] operator -(real[] a, real b); +real[] operator -(real[] a, real[] b); +real[][] operator -(real[][] a, real[][] b); +real operator -(real a); +real[] operator -(real[] a); +real[][] operator -(real[][] a); +pair operator -(pair a, pair b); +pair[] operator -(pair a, pair[] b); +pair[] operator -(pair[] a, pair b); +pair[] operator -(pair[] a, pair[] b); +pair[][] operator -(pair[][] a, pair[][] b); +pair operator -(pair a); +pair[] operator -(pair[] a); +pair[][] operator -(pair[][] a); +triple operator -(triple a, triple b); +triple[] operator -(triple a, triple[] b); +triple[] operator -(triple[] a, triple b); +triple[] operator -(triple[] a, triple[] b); +triple[][] operator -(triple[][] a, triple[][] b); +triple operator -(triple a); +triple[] operator -(triple[] a); +triple[][] operator -(triple[][] a); +int operator *(int a, int b); +int[] operator *(int a, int[] b); +int[] operator *(int[] a, int b); +int[] operator *(int[] a, int[] b); +int[][] operator *(int a, int[][] b); +int[][] operator *(int[][] a, int b); +real operator *(real a, real b); +real[] operator *(real a, real[] b); +real[] operator *(real[] a, real b); +real[] operator *(real[] a, real[] b); +real[][] operator *(real a, real[][] b); +real[][] operator *(real[][] a, real b); +pair operator *(pair a, pair b); +pair[] operator *(pair a, pair[] b); +pair[] operator *(pair[] a, pair b); +pair[] operator *(pair[] a, pair[] b); +pair[][] operator *(pair a, pair[][] b); +pair[][] operator *(pair[][] a, pair b); +triple[] operator *(real a, triple[] b); +triple[][] operator *(real a, triple[][] b); +triple[] operator *(triple[] a, real b); +triple[][] operator *(triple[][] a, real b); +pen operator *(real a, pen b); +pen operator *(pen a, real b); +transform operator *(transform a, transform b); +pair operator *(transform t, pair z); +path operator *(transform t, path g); +pen operator *(transform t, pen p); +frame operator *(transform t, frame f); +frame operator *(real[][] t, frame f); +real[] operator *(real[][] a, real[] b); +real[] operator *(real[] a, real[][] b); +int[][] operator *(int[][] a, int[][] b); +real[][] operator *(real[][] a, real[][] b); +pair[][] operator *(pair[][] a, pair[][] b); +triple operator *(real[][] t, triple v); +triple operator *(real x, triple v); +triple operator *(triple v, real x); +path3 operator *(real[][] t, path3 g); +object operator *(transform t, explicit object F); +Label operator *(transform t, Label L); +picture operator *(real[][] t, picture orig); +path[] operator *(transform t, explicit path[] p); +bounds operator *(transform t, bounds b); +pair[] operator *(transform t, pair[] z); +picture operator *(transform t, picture orig); +side operator *(real x, side s); +Label operator *(real[][] t, Label L); +bool operator init(); +int operator init(); +real operator init(); +string operator init(); +pair operator init(); +triple operator init(); +transform operator init(); +guide operator init(); +path operator init(); +path3 operator init(); +pen operator init(); +frame operator init(); +file operator init(); +hsv operator init(); +projection operator init(); +picture operator init(); +marker operator init(); +marginT operator init(); +transformation operator init(); +pairOrTriple operator init(); +filltype operator init(); +coords2 operator init(); +Legend operator init(); +align operator init(); +framedTransformStack operator init(); +slice operator init(); +scaling operator init(); +ScaleT operator init(); +object operator init(); +coords2 operator init(); +coord operator init(); +autoscaleT operator init(); +Label operator init(); +scaling operator init(); +bounds operator init(); +scaleT operator init(); +position operator init(); +cputime operator init(); +coord operator init(); +coords3 operator init(); +side operator init(); +processtime operator init(); +bool3 operator init(); +light operator init(); +indexedTransform operator init(); +arrowhead operator init(); +real operator cast(int); +pair operator cast(int); +pair operator cast(real); +path operator cast(pair); +guide operator cast(pair); +guide operator cast(path); +path operator cast(guide); +file operator cast(null); +real[] operator cast(int[]); +pair[] operator cast(int[]); +pair[] operator cast(real[]); +real[][] operator cast(int[][]); +pair[][] operator cast(int[][]); +pair[][] operator cast(real[][]); +bool operator cast(file); +bool[] operator cast(file); +bool[][] operator cast(file); +bool[][][] operator cast(file); +int operator cast(file); +int[] operator cast(file); +int[][] operator cast(file); +int[][][] operator cast(file); +real operator cast(file); +real[] operator cast(file); +real[][] operator cast(file); +real[][][] operator cast(file); +pair operator cast(file); +pair[] operator cast(file); +pair[][] operator cast(file); +pair[][][] operator cast(file); +triple operator cast(file); +triple[] operator cast(file); +triple[][] operator cast(file); +triple[][][] operator cast(file); +string operator cast(file); +string[] operator cast(file); +string[][] operator cast(file); +string[][][] operator cast(file); +guide operator cast(cycleToken tok); +guide operator cast(curlSpecifier spec); +guide operator cast(tensionSpecifier t); +object operator cast(Label L); +Label operator cast(object F); +guide[] operator cast(path[] g); +position operator cast(pair x); +align operator cast(side side); +pair operator cast(position P); +bool3[] operator cast(bool[] b); +object operator cast(frame f); +guide[] operator cast(pair[] z); +path[] operator cast(guide[] g); +bool operator cast(bool3 b); +path[] operator cast(guide g); +pen operator cast(hsv hsv); +path[] operator cast(pair[] z); +path[] operator cast(path p); +pair operator cast(pairOrTriple a); +triple operator cast(pairOrTriple a); +bool[] operator cast(bool3[] b); +position operator cast(int x); +hsv operator cast(pen p); +object operator cast(string s); +align operator cast(pair dir); +bool3 operator cast(bool b); +position operator cast(real x); +Label operator cast(string s); +align operator cast(triple dir); +frame operator cast(object F); +pen deepred; +bool error(file f); +string operator ecast(int); +string operator ecast(real); +string operator ecast(pair); +string operator ecast(triple); +int operator ecast(string); +real operator ecast(string); +pair operator ecast(string); +triple operator ecast(string); +int operator ecast(real); +int[] operator ecast(real[]); +real[] operator ecast(string[] a); +int[] operator ecast(string[] a); +pair operator tuple(real x, real y); +triple operator tuple(real x, real y, real z); +transform operator tuple(real x, real y, real xx, real xy, real yx, real yy); +real operator /(real a, real b); +real[] operator /(real a, real[] b); +real[] operator /(real[] a, real b); +real[] operator /(real[] a, real[] b); +real[][] operator /(real[][] a, real b); +pair operator /(pair a, pair b); +pair[] operator /(pair a, pair[] b); +pair[] operator /(pair[] a, pair b); +pair[] operator /(pair[] a, pair[] b); +pair[][] operator /(pair[][] a, pair b); +triple[] operator /(triple[] a, real b); +real operator /(int a, int b); +real[] operator /(int[] a, int b); +real[] operator /(int a, int[] b); +real[] operator /(int[] a, int[] b); +triple operator /(triple v, real x); +path[] texpath(Label L, bool tex=<default>, bool bbox=<default>); +bool uptodate(); +int operator %(int a, int b); +int[] operator %(int a, int[] b); +int[] operator %(int[] a, int b); +int[] operator %(int[] a, int[] b); +real operator %(real a, real b); +real[] operator %(real a, real[] b); +real[] operator %(real[] a, real b); +real[] operator %(real[] a, real[] b); +bool operator ^(bool a, bool b); +bool[] operator ^(bool a, bool[] b); +bool[] operator ^(bool[] a, bool b); +bool[] operator ^(bool[] a, bool[] b); +int operator ^(int a, int b); +int[] operator ^(int a, int[] b); +int[] operator ^(int[] a, int b); +int[] operator ^(int[] a, int[] b); +real operator ^(real a, real b); +real[] operator ^(real a, real[] b); +real[] operator ^(real[] a, real b); +real[] operator ^(real[] a, real[] b); +pair operator ^(pair a, pair b); +pair[] operator ^(pair a, pair[] b); +pair[] operator ^(pair[] a, pair b); +pair[] operator ^(pair[] a, pair[] b); +transform operator ^(transform t, int n); +real operator ^(real x, int y); +pair operator ^(pair z, int y); +bool operator ==(bool a, bool b); +bool[] operator ==(bool a, bool[] b); +bool[] operator ==(bool[] a, bool b); +bool[] operator ==(bool[] a, bool[] b); +bool operator ==(bool[][] a, bool[][] b); +bool operator ==(int a, int b); +bool[] operator ==(int a, int[] b); +bool[] operator ==(int[] a, int b); +bool[] operator ==(int[] a, int[] b); +bool operator ==(int[][] a, int[][] b); +bool operator ==(real a, real b); +bool[] operator ==(real a, real[] b); +bool[] operator ==(real[] a, real b); +bool[] operator ==(real[] a, real[] b); +bool operator ==(real[][] a, real[][] b); +bool operator ==(pair a, pair b); +bool[] operator ==(pair a, pair[] b); +bool[] operator ==(pair[] a, pair b); +bool[] operator ==(pair[] a, pair[] b); +bool operator ==(pair[][] a, pair[][] b); +bool operator ==(triple a, triple b); +bool[] operator ==(triple a, triple[] b); +bool[] operator ==(triple[] a, triple b); +bool[] operator ==(triple[] a, triple[] b); +bool operator ==(triple[][] a, triple[][] b); +bool operator ==(string a, string b); +bool[] operator ==(string a, string[] b); +bool[] operator ==(string[] a, string b); +bool[] operator ==(string[] a, string[] b); +bool operator ==(string[][] a, string[][] b); +bool[] operator ==(pen[] a, pen[] b); +bool operator ==(pen a, pen b); +bool operator ==(transform a, transform b); +bool operator ==(file a, file b); +bool operator ==(path a, path b); +bool operator ==(path3 a, path3 b); +bool operator ==(bool3 a, bool3 b); +bool operator ==(light a, light b); +bool operator ==(indexedTransform a, indexedTransform b); +bool operator ==(arrowhead a, arrowhead b); +bool operator ==(coords2 a, coords2 b); +bool operator ==(coord a, coord b); +bool operator ==(autoscaleT a, autoscaleT b); +bool operator ==(Label a, Label b); +bool operator ==(marginT a, marginT b); +bool operator ==(freezableBounds a, freezableBounds b); +bool operator ==(transformation a, transformation b); +bool operator ==(pairOrTriple a, pairOrTriple b); +bool operator ==(coord a, coord b); +bool operator ==(coords3 a, coords3 b); +bool operator ==(side a, side b); +bool operator ==(processtime a, processtime b); +bool operator ==(slice a, slice b); +bool operator ==(scaling a, scaling b); +bool operator ==(ScaleT a, ScaleT b); +bool operator ==(object a, object b); +bool operator ==(bool3 a, bool b); +bool operator ==(hsv a, hsv b); +bool operator ==(projection a, projection b); +bool operator ==(picture a, picture b); +bool operator ==(marker a, marker b); +bool operator ==(scaling a, scaling b); +bool operator ==(bounds a, bounds b); +bool operator ==(scaleT a, scaleT b); +bool operator ==(position a, position b); +bool operator ==(cputime a, cputime b); +bool operator ==(bool a, bool3 b); +bool operator ==(filltype a, filltype b); +bool operator ==(coords2 a, coords2 b); +bool operator ==(Legend a, Legend b); +bool operator ==(align a, align b); +bool operator ==(framedTransformStack a, framedTransformStack b); +bool operator !=(bool a, bool b); +bool[] operator !=(bool a, bool[] b); +bool[] operator !=(bool[] a, bool b); +bool[] operator !=(bool[] a, bool[] b); +bool operator !=(bool[][] a, bool[][] b); +bool operator !=(int a, int b); +bool[] operator !=(int a, int[] b); +bool[] operator !=(int[] a, int b); +bool[] operator !=(int[] a, int[] b); +bool operator !=(int[][] a, int[][] b); +bool operator !=(real a, real b); +bool[] operator !=(real a, real[] b); +bool[] operator !=(real[] a, real b); +bool[] operator !=(real[] a, real[] b); +bool operator !=(real[][] a, real[][] b); +bool operator !=(pair a, pair b); +bool[] operator !=(pair a, pair[] b); +bool[] operator !=(pair[] a, pair b); +bool[] operator !=(pair[] a, pair[] b); +bool operator !=(pair[][] a, pair[][] b); +bool operator !=(triple a, triple b); +bool[] operator !=(triple a, triple[] b); +bool[] operator !=(triple[] a, triple b); +bool[] operator !=(triple[] a, triple[] b); +bool operator !=(triple[][] a, triple[][] b); +bool operator !=(string a, string b); +bool[] operator !=(string a, string[] b); +bool[] operator !=(string[] a, string b); +bool[] operator !=(string[] a, string[] b); +bool operator !=(string[][] a, string[][] b); +bool[] operator !=(pen[] a, pen[] b); +bool operator !=(pen a, pen b); +bool operator !=(transform a, transform b); +bool operator !=(file a, file b); +bool operator !=(path a, path b); +bool operator !=(path3 a, path3 b); +bool operator !=(bool3 a, bool3 b); +bool operator !=(light a, light b); +bool operator !=(indexedTransform a, indexedTransform b); +bool operator !=(arrowhead a, arrowhead b); +bool operator !=(coords2 a, coords2 b); +bool operator !=(coord a, coord b); +bool operator !=(autoscaleT a, autoscaleT b); +bool operator !=(Label a, Label b); +bool operator !=(marginT a, marginT b); +bool operator !=(freezableBounds a, freezableBounds b); +bool operator !=(transformation a, transformation b); +bool operator !=(pairOrTriple a, pairOrTriple b); +bool operator !=(coord a, coord b); +bool operator !=(coords3 a, coords3 b); +bool operator !=(side a, side b); +bool operator !=(processtime a, processtime b); +bool operator !=(slice a, slice b); +bool operator !=(scaling a, scaling b); +bool operator !=(ScaleT a, ScaleT b); +bool operator !=(object a, object b); +bool operator !=(bool3 a, bool b); +bool operator !=(hsv a, hsv b); +bool operator !=(projection a, projection b); +bool operator !=(picture a, picture b); +bool operator !=(marker a, marker b); +bool operator !=(scaling a, scaling b); +bool operator !=(bounds a, bounds b); +bool operator !=(scaleT a, scaleT b); +bool operator !=(position a, position b); +bool operator !=(cputime a, cputime b); +bool operator !=(bool a, bool3 b); +bool operator !=(filltype a, filltype b); +bool operator !=(coords2 a, coords2 b); +bool operator !=(Legend a, Legend b); +bool operator !=(align a, align b); +bool operator !=(framedTransformStack a, framedTransformStack b); +bool operator <(int a, int b); +bool[] operator <(int a, int[] b); +bool[] operator <(int[] a, int b); +bool[] operator <(int[] a, int[] b); +bool operator <(real a, real b); +bool[] operator <(real a, real[] b); +bool[] operator <(real[] a, real b); +bool[] operator <(real[] a, real[] b); +bool operator <(string a, string b); +bool[] operator <(string a, string[] b); +bool[] operator <(string[] a, string b); +bool[] operator <(string[] a, string[] b); +bool operator <=(int a, int b); +bool[] operator <=(int a, int[] b); +bool[] operator <=(int[] a, int b); +bool[] operator <=(int[] a, int[] b); +bool operator <=(real a, real b); +bool[] operator <=(real a, real[] b); +bool[] operator <=(real[] a, real b); +bool[] operator <=(real[] a, real[] b); +bool operator <=(string a, string b); +bool[] operator <=(string a, string[] b); +bool[] operator <=(string[] a, string b); +bool[] operator <=(string[] a, string[] b); +bool operator <=(coord a, coord b); +bool operator <=(coord a, coord b); +bool operator >(int a, int b); +bool[] operator >(int a, int[] b); +bool[] operator >(int[] a, int b); +bool[] operator >(int[] a, int[] b); +bool operator >(real a, real b); +bool[] operator >(real a, real[] b); +bool[] operator >(real[] a, real b); +bool[] operator >(real[] a, real[] b); +bool operator >(string a, string b); +bool[] operator >(string a, string[] b); +bool[] operator >(string[] a, string b); +bool[] operator >(string[] a, string[] b); +void srand(int seed); +bool operator >=(int a, int b); +bool[] operator >=(int a, int[] b); +bool[] operator >=(int[] a, int b); +bool[] operator >=(int[] a, int[] b); +bool operator >=(real a, real b); +bool[] operator >=(real a, real[] b); +bool[] operator >=(real[] a, real b); +bool[] operator >=(real[] a, real[] b); +bool operator >=(string a, string b); +bool[] operator >=(string a, string[] b); +bool[] operator >=(string[] a, string b); +bool[] operator >=(string[] a, string[] b); +bool operator >=(coord a, coord b); +bool operator >=(coord a, coord b); +filltype UnFill(real xmargin=<default>, real ymargin=<default>); +filltype UnFill; +bool[] operator !(bool[] a); +bool operator !(bool b); +path[] operator ^^(path p, path q); +path[] operator ^^(explicit path[] p, path q); +path[] operator ^^(path p, explicit path[] q); +path[] operator ^^(explicit path[] p, explicit path[] q); +real degrees(pair z, bool warn=<default>); +real degrees(real radians); +guide operator ::(... guide[]); +pen Helvetica(string series=<default>, string shape=<default>); +transform reflect(pair a, pair b); +bool Bars(picture, path, pen, marginT(path, pen)); +bool Bars(picture, path, pen, marginT(path, pen))(real size=<default>); +guide operator ..(... guide[]); +guide operator ..(... guide[])(tensionSpecifier t); +void none(file file); +int factorial(int n); +real log(real x); +real[] log(real[] a); +pair log(explicit pair z); +guide operator --(... guide[]); +path polygon(int n); +guide operator ---(... guide[]); +bool operator &(bool a, bool b); +bool[] operator &(bool a, bool[] b); +bool[] operator &(bool[] a, bool b); +bool[] operator &(bool[] a, bool[] b); +path operator &(path p, path q); +path3 operator &(path3 p, path3 q); +path operator &(path p, cycleToken tok); +pen NewCenturySchoolBook(string series=<default>, string shape=<default>); +void()()[] saveFunctions; +bool operator |(bool a, bool b); +bool[] operator |(bool a, bool[] b); +bool[] operator |(bool[] a, bool b); +bool[] operator |(bool[] a, bool[] b); +guide operator controls(pair zout, pair zin); +guide operator controls(pair z); +string texify(string s); +tensionSpecifier operator tension(real tout, real tin, bool atleast); +tensionSpecifier operator tension(real t, bool atLeast); +bool empty(frame f); +curlSpecifier operator curl(real gamma, int p); +void end(picture pic=<default>); +guide operator spec(pair z, int p); +string substr(string s, int pos, int n=<default>); +pen paleyellow; +file output(string name=<default>, bool update=<default>, string comment=<default>, string mode=<default>); +pen ZapfDingbats(string series=<default>, string shape=<default>); +real tanh(real x); +real[] tanh(real[] a); +real interp(real a, real b, real t); +pair interp(explicit pair a, explicit pair b, real t); +triple interp(triple a, triple b, real t); +pen interp(pen a, pen b, real t); +frame Seascape(frame f); +bool interior(int windingnumber, pen fillrule); +real[] intersect(path p, path q, real fuzz=<default>); +real[] intersect(path3 p, path3 q, real fuzz=<default>); +bool interactive(); +real[][] intersections(path p, path q, real fuzz=<default>); +real[] intersections(path p, explicit pair a, explicit pair b, real fuzz=<default>); +real[][] intersections(path3 p, path3 q, real fuzz=<default>); +real[][] intersections(path3 p, triple[][] p, real fuzz=<default>); +int animate(string args=<default>, string file=<default>, string format=<default>); +void generate_random_backtrace(); +pair intersectionpoint(path p, path q, real fuzz=<default>); +pair[] intersectionpoints(path p, path q, real fuzz=<default>); +pair[] intersectionpoints(explicit path[] p, explicit path[] q, real fuzz=<default>); +void asy(string format, bool overwrite=<default> ... string[] s); +bool latex(); +void startScript(); +bool adjust(pen p); +pen adjust(pen p, real arclength, bool cyclic); +pair Align; +void exit(); +real[] uniform(real a, real b, int n); +pair viewportsize; +pair viewportmargin; +string VERSION; +void filldraw(picture pic=<default>, path[] g, pen fillpen=<default>, pen drawpen=<default>); +void filldraw(frame f, path[] g, pen fillpen=<default>, pen drawpen=<default>); +real dot(real[] a, real[] b); +pair dot(pair[] a, pair[] b); +real dot(explicit pair z, explicit pair w); +real dot(triple u, triple v); +void dot(picture pic=<default>, Label[] L=<default>, explicit path g, align align=<default>, string format=<default>, pen p=<default>, filltype filltype=<default>); +marker dot(pen p=<default>, filltype filltype=<default>); +void dot(picture pic=<default>, pair z, pen p=<default>, filltype filltype=<default>); +void dot(frame f, pair z, pen p=<default>, filltype filltype=<default>); +void dot(picture pic=<default>, Label L, pen p=<default>, filltype filltype=<default>); +marker dot; +void dot(picture pic=<default>, Label[] L=<default>, pair[] z, align align=<default>, string format=<default>, pen p=<default>, filltype filltype=<default>); +void dot(picture pic=<default>, path[] g, pen p=<default>, filltype filltype=<default>); +void dot(picture pic=<default>, Label L, pair z, align align=<default>, string format=<default>, pen p=<default>, filltype filltype=<default>); +void list(string s, bool imports=<default>); +pair NNW; +string phantom(string s); +void atexit(void f()); +void atexit()(); +real getreal(string name=<default>, real default=<default>, string prompt=<default>, bool store=<default>); +int convert(string args=<default>, string file=<default>, string format=<default>); +pair WNW; +pen palegray; +pen palegreen; +pen palegrey; +void clip(frame f, path[] g, bool stroke=<default>, pen fillrule=<default>, bool copy=<default>); +void clip(picture pic=<default>, path[] g, bool stroke=<default>, pen fillrule=<default>, bool copy=<default>); +marginT Margin(path, pen)(real begin, real end); +marginT Margin(path, pen); +position Relative(real position); +side Relative(explicit pair align); +marginT Margins(path, pen); +pair truepoint(picture pic=<default>, pair dir, bool user=<default>); +real arclength(path p); +real arclength(path3 p); +indexedTransform indexedTransform(int index, transform t, bool active=<default>); +bool finite(real x); +bool finite(pair z); +bool finite(triple v); +void updatefunction(); +void _draw(frame f, path g, pen p); +void _draw(frame f, path3 g, triple center=<default>, pen p, int interaction=<default>); +void _draw(picture pic, path g, pen p, marginT margin(path, pen)); +frame align(frame f, pair align); +path[] align(path[] g, transform t=<default>, pair position, pair align, pen p=<default>); +object align(object F, pair align); +real unitrand(); +string[] history(string name, int n=<default>); +string[] history(int n=<default>); +coord[] maxcoords(coord[] in, bool operator <=(coord, coord)); +coord[] maxcoords(coord[] in, bool operator <=(coord, coord)); +pen AvantGarde(string series=<default>, string shape=<default>); +frame enclose(string prefix=<default>, object F, string format=<default>); +int count; +real atan2(real y, real x); +bool inside(explicit path[] g, pair z, pen fillrule=<default>); +bool inside(path g, pair z, pen fillrule=<default>); +int inside(path p, path q, pen fillrule=<default>); +pair inside(path p, pen fillrule=<default>); +pair rectify(pair dir); +arrowhead TeXHead; +path[] margin(path[] g, real xmargin, real ymargin); +pair relative(picture pic=<default>, pair z); +real expansionfactor; +real erfc(real x); +int windingnumber(path[] p, pair z); +void addArrow(picture pic, arrowhead arrowhead, path g, pen p, real size, real angle, filltype filltype, real position); +void exitfunction(); +pen gray(pen p); +pen gray(real gray); +pen gray; +real relativedistance(real theta, real phi, real t, bool atleast); +path circle(pair c, real r); +void overloadedMessage(file file); +pen deepmagenta; +real circlescale; +string math(real x); +string math(string s); +real circleprecision; +int Allow; +real determinant(real[][] a); +void functionshade(frame f, path[] g, bool stroke=<default>, pen fillrule=<default>, string shader=<default>, bool copy=<default>); +void functionshade(picture pic=<default>, path[] g, bool stroke=<default>, pen fillrule=<default>, string shader, bool copy=<default>); +pen red; +pair[] dirSpecifier(guide g, int t); +void abort(string s=<default>); +bool Aspect; +string hex(pen p); +int hex(string s); +void deactivatequote(picture pic=<default>); +string format(string format, int x, string locale=<default>); +string format(string format, string separator, real x, string locale=<default>); +string format(string format, real x, string locale=<default>); +string format(real x, string locale=<default>); +real expm1(real x); +real[] expm1(real[] a); +void activatequote(picture pic=<default>); +int undefined; +frame[] fit2(picture[] pictures, picture all); +string ask(string prompt); +pen linecap(int n); +int linecap(pen p=<default>); +string outname(); +void newpage(frame f); +void newpage(picture pic=<default>); +pen fontcommand(string s); +pair accel(path p, int t, int sign=<default>); +pair accel(path p, real t); +triple accel(path3 p, int t, int sign=<default>); +triple accel(path3 p, real t); +frame Portrait(frame f); +void tex(frame f, string s); +void tex(frame f, string s, pair min, pair max); +void tex(picture pic=<default>, string s, pair min, pair max); +void tex(picture pic=<default>, string s); +pen Black; +triple size3(frame f); +void size3(picture pic=<default>, real x, real y=<default>, real z=<default>, bool keepAspect=<default>); +bool eof(file f); +frame dotframe(pen p=<default>, filltype filltype=<default>); +frame dotframe; +real realMax; +pair NE; +real realMin; +path nib(pen p); +void gouraudshade(frame f, path[] g, bool stroke=<default>, pen fillrule=<default>, pen[] p, pair[] z, int[] edges, bool copy=<default>); +void gouraudshade(frame f, path[] g, bool stroke=<default>, pen fillrule=<default>, pen[] p, int[] edges, bool copy=<default>); +void gouraudshade(picture pic=<default>, path[] g, bool stroke=<default>, pen fillrule=<default>, pen[] p, pair[] z, int[] edges, bool copy=<default>); +void gouraudshade(picture pic=<default>, path[] g, bool stroke=<default>, pen fillrule=<default>, pen[] p, int[] edges, bool copy=<default>); +bool shipped; +pair[] fft(pair[] a, int sign=<default>); +pair SE; +pen nobasealign; +sCAD operator init(); +real animationdelay; +animation operator init(); +frame NoBox(frame f); +frame BBox(frame)(real xmargin=<default>, real ymargin=<default>, pen p=<default>, filltype filltype=<default>); +void annotate(picture pic=<default>, string title, string text, pair position); +void babel(string s); +path removeDuplicates(path p); +path uncycle(path p, real t); +path[] bezulate(path[] p); +real[][] intersections(pair a, pair b, path p); +void connect(path[] paths, path[] result, path[] patch); +int countIntersections(path[] p, pair start, pair end); +real duplicateFuzz; +path subdivide(path p); +bool isDuplicate(pair a, pair b, real relSize); +bool checkSegment(path g, pair p, pair q); +path section(path p, real t1, real t2, bool loop=<default>); +real fuzz; +path[][] containmentTree(path[] paths); +binarytree searchtree(... int[] keys); +object draw(picture pic=<default>, binarytreeNode node, pair pos, int height, real minDist, real levelDist, real nodeDiameter, pen p=<default>); +void draw(picture pic=<default>, binarytree tree, real minDist=<default>, real nodeMargin=<default>, pen p=<default>); +real nodeMarginDefault; +key key(int n, bool active=<default>); +binarytree binarytree(... key[] keys); +binarytreeNode binarytreeNode(int key); +key nil; +real minDistDefault; +binarytreeNode operator init(); +key operator init(); +binarytree operator init(); +key operator cast(int n); +int operator cast(key k); +int[] operator cast(key[] k); +line intersection(face a, face b); +real epsilon; +splitface split(face a, face cut, projection P); +face operator init(); +line operator init(); +half operator init(); +splitface operator init(); +bsp operator init(); +picture operator cast(face f); +face operator cast(path3 p); +void add(picture pic=<default>, face[] faces, projection P=<default>); +void searchindex(boxcontour bc, bool forward, void f(int i, int j)); +segment case1(pair p0, pair p1, pair p2, real v0, real v1, real v2); +void draw(picture pic=<default>, Label[] L=<default>, guide[][] g, pen[] p); +void draw(picture pic=<default>, Label[] L=<default>, guide[][] g, pen p=<default>); +void draw(picture pic=<default>, Label L, guide[] g, pen p=<default>); +int interior; +pen[][] interior(picture pic=<default>, guide[][] g, pen[] palette); +pen[] extend(pen[] palette, pen below, pen above); +bool same(gridpoint gp1, gridpoint gp2); +guide connect(Segment S, pair[][] z, guide join(... guide[])); +guide[] connect(Segment[] S, pair[][] z, guide join(... guide[])); +guide[][] connect(Segment[][] S, pair[][] z, guide join(... guide[])); +guide[][] connect(pair[][][] points, real[] c, guide join(... guide[])); +bool connected(boxcontour bc1, boxcontour bc2); +int exterior; +int connectedindex(boxcontour bc, boxcontour[] bca, bool activeonly=<default>); +int connectedindex(boxcontour[] bca, boxcontour bc, bool activeonly=<default>); +segment case2(pair p0, pair p1, pair p2, real v0, real v1, real v2); +void collect(pair[][][] points, real[] c); +int hyperbola; +int edge; +int line; +segment case3(pair p0, pair p1, pair p2, real v0, real v1, real v2); +segment checktriangle(pair p0, pair p1, pair p2, real v0, real v1, real v2); +gridpoint operator init(); +boxcontour operator init(); +boxdata operator init(); +segment operator init(); +Segment operator init(); +segment operator init(); +void fill(picture pic=<default>, guide[][] g, pen[][] palette); +guide[][] contour(pair[][] z, real[][] f, real[] c, guide join(... guide[])=<default>, int subsample=<default>); +guide[][] contour(real[][] f, pair a, pair b, real[] c, guide join(... guide[])=<default>, int subsample=<default>); +guide[][] contour(real f(real, real), pair a, pair b, real[] c, int nx=<default>, int ny=<default>, guide join(... guide[])=<default>, int subsample=<default>); +guide[][] contour(real f(pair), pair a, pair b, real[] c, int nx=<default>, int ny=<default>, guide join(... guide[])=<default>, int subsample=<default>); +guide[][] contour(pair[] z, real[] f, real[] c, guide join(... guide[])=<default>); +segment[][] contouredges(real[][] f, real[] c, int subsample=<default>); +void setcontour(real f00, real f10, real f01, real f11, real epsf, boxdata bd, int i, int j, int index); +Segment[] Segment(segment[] s); +Segment[][] Segment(segment[][] s); +real eps; +segment case4(pair p0, pair p1, pair p2, real v0, real v1, real v2); +bool isCCW(pair p0, pair p1, pair p2); +surface surface(vertex[][] g); +weighted operator init(); +bucket operator init(); +vertex operator init(); +object operator init(); +vertex[][] contour3(triple[][][] v, real[][][] f, real[][][] midpoint=<default>, projection P=<default>); +vertex[][] contour3(real[][][] f, real[][][] midpoint=<default>, triple a, triple b, projection P=<default>); +vertex[][] contour3(real f(real, real, real), triple a, triple b, int nx=<default>, int ny=<default>, int nz=<default>, projection P=<default>); +real eps; +void draw(TreeNode root, pair pos); +real treeNodeStep; +void drawAll(TreeNode node, frame f); +real layout(int level, TreeNode node); +TreeNode operator init(); +void add(TreeNode child, TreeNode parent); +real treeLevelStep; +real treeMinNodeWidth; +TreeNode makeNode(TreeNode parent=<default>, frame f); +TreeNode makeNode(TreeNode parent=<default>, Label label); +string link(string label, string text, string options=<default>); +string embed(string name, string options=<default>, real width=<default>, real height=<default>); +string hyperlink(string url, string text); +string link(string url, string text, string options=<default>); +string embed(string name, string options=<default>, real width=<default>, real height=<default>, string image=<default>); +string hyperlink(string url, string text); +real gluonratio; +real gluonamplitude; +void drawGluon(picture pic=<default>, path p, real amp=<default>, real width=<default>, pen fgpen=<default>, bool erasebg=<default>, pen bgpen=<default>, real vertexangle=<default>, real margin=<default>); +void drawGhost(picture pic=<default>, path p, pen fgpen=<default>, bool arrow(picture, path, pen, marginT(path, pen))=<default>, bool erasebg=<default>, pen bgpen=<default>, real vertexangle=<default>, real margin=<default>); +void drawVertex(picture pic=<default>, pair xy, real r=<default>, pen fgpen=<default>); +void drawVertexO(picture pic=<default>, pair xy, real r=<default>, pen fgpen=<default>, bool erasebg=<default>, pen bgpen=<default>); +void drawVertexX(picture pic=<default>, pair xy, real r=<default>, pen fgpen=<default>); +void drawVertexBox(picture pic=<default>, pair xy, real r=<default>, pen fgpen=<default>); +void drawVertexBoxO(picture pic=<default>, pair xy, real r=<default>, pen fgpen=<default>, bool erasebg=<default>, pen bgpen=<default>); +void drawVertexOX(picture pic=<default>, pair xy, real r=<default>, pen fgpen=<default>, bool erasebg=<default>, pen bgpen=<default>); +void drawVertexTriangle(picture pic=<default>, pair xy, real r=<default>, pen fgpen=<default>); +void drawVertexTriangleO(picture pic=<default>, pair xy, real r=<default>, pen fgpen=<default>, bool erasebg=<default>, pen bgpen=<default>); +void drawVertexBoxX(picture pic=<default>, pair xy, real r=<default>, pen fgpen=<default>, bool erasebg=<default>, pen bgpen=<default>); +bool XYAlign; +void do_overpaint(picture pic, path p, pen bgpen, real halfwidth, real vertexangle); +void texshipout(string stem, picture pic=<default>, bool xalign=<default>); +void drawDoubleLine(picture pic=<default>, path p, pen fgpen=<default>, real dlspacing=<default>, bool arrow(picture, path, pen, marginT(path, pen))=<default>, bool erasebg=<default>, pen bgpen=<default>, real vertexangle=<default>, real margin=<default>); +void drawScalar(picture pic=<default>, path p, pen fgpen=<default>, bool arrow(picture, path, pen, marginT(path, pen))=<default>, bool erasebg=<default>, pen bgpen=<default>, real vertexangle=<default>, real margin=<default>); +bool overpaint; +path photon(path p, real amp=<default>, real width=<default>); +pen photonpen; +real photonratio; +real photonamplitude; +string includegraphicscommand; +pen momarrowpen; +real momarrowsize(pen p=<default>); +real momarrowlength; +real momarrowoffset; +real momarrowmargin; +real momarrowfactor; +pen vertexpen; +real vertexsize; +path momArrowPath(path p, align align, position pos, real offset=<default>, real length=<default>); +void drawPhoton(picture pic=<default>, path p, real amp=<default>, real width=<default>, pen fgpen=<default>, bool erasebg=<default>, pen bgpen=<default>, real vertexangle=<default>, real margin=<default>); +bool YAlign; +pen backgroundpen; +pen ghostpen; +pen scalarpen; +pen fermionpen; +pen bigvertexpen; +real bigvertexsize; +real minvertexangle; +void drawMomArrow(picture pic=<default>, path p, align align, position pos=<default>, real offset=<default>, real length=<default>, pen fgpen=<default>, bool arrow(picture, path, pen, marginT(path, pen))=<default>, bool erasebg=<default>, pen bgpen=<default>, real margin=<default>); +void fmdefaults(); +real linemargin; +void drawFermion(picture pic=<default>, path p, pen fgpen=<default>, bool arrow(picture, path, pen, marginT(path, pen))=<default>, bool erasebg=<default>, pen bgpen=<default>, real vertexangle=<default>, real margin=<default>); +bool currentarrow(picture, path, pen, marginT(path, pen)); +bool currentmomarrow(picture, path, pen, marginT(path, pen)); +bool appendsuffix; +pen doublelinepen; +real doublelinespacing; +path gluon(path p, real amp=<default>, real width=<default>); +pen gluonpen; +Dir Left; +block roundrectangle(object body, pair center=<default>, pen fillpen=<default>, pen drawpen=<default>, real ds=<default>, real dw=<default>, real minwidth=<default>, real minheight=<default>); +block diamond(object body, pair center=<default>, pen fillpen=<default>, pen drawpen=<default>, real ds=<default>, real dw=<default>, real height=<default>, real minwidth=<default>, real minheight=<default>); +void draw(picture pic=<default>, block block, pen p=<default>); +real minblockwidth; +real defaultexcursion; +real minblockheight; +path path(pair[] point ... flowdir[] dir); +Dir Up; +real mincirclediameter; +flowdir Vertical; +block rectangle(object header, object body, pair center=<default>, pen headerpen=<default>, pen bodypen=<default>, pen drawpen=<default>, real dx=<default>, real minheaderwidth=<default>, real minheaderheight=<default>, real minbodywidth=<default>, real minbodyheight=<default>); +block rectangle(object body, pair center=<default>, pen fillpen=<default>, pen drawpen=<default>, real dx=<default>, real minwidth=<default>, real minheight=<default>); +block parallelogram(object body, pair center=<default>, pen fillpen=<default>, pen drawpen=<default>, real dx=<default>, real slope=<default>, real minwidth=<default>, real minheight=<default>); +block blockconnector(block, block)(picture pic, transform t, pen p=<default>, marginT margin(path, pen)=<default>); +block circle(object body, pair center=<default>, pen fillpen=<default>, pen drawpen=<default>, real dr=<default>, real mindiameter=<default>); +flowdir operator init(); +block operator init(); +Dir operator init(); +block operator --(block b1, Label label); +block operator --(block b1, Dir dir); +block operator --(block b, bool arrowbar(picture, path, pen, marginT(path, pen))); +flowdir Horizontal; +block bevel(object body, pair center=<default>, pen fillpen=<default>, pen drawpen=<default>, real dh=<default>, real dw=<default>, real minwidth=<default>, real minheight=<default>); +Dir Right; +Dir Down; +int[] numarray; +point midpoint(segment s); +point midpoint(side side); +point isotomicconjugate(triangle t, point M); +line altitude(vertex V); +line altitude(side side); +real rd(real x, real y, real z); +point circumcenter(point A, point B, point C); +point circumcenter(triangle t); +circle circumcircle(point A, point B, point C); +circle circumcircle(triangle t); +point point(coordsys R, pair p, real m=<default>); +point point(explicit pair p, real m); +point point(coordsys R, explicit point M, real m=<default>); +point point(explicit vector u); +point point(circle c, abscissa l); +point point(ellipse el, abscissa l); +point point(parabola p, abscissa l); +point point(hyperbola h, abscissa l); +point point(explicit conic co, abscissa l); +point point(line l, abscissa x); +point point(line l, explicit real x); +point point(line l, explicit int x); +point point(explicit circle c, explicit real x); +point point(explicit circle c, explicit int x); +point point(explicit ellipse el, explicit real x); +point point(explicit ellipse el, explicit int x); +point point(explicit parabola p, explicit real x); +point point(explicit parabola p, explicit int x); +point point(explicit hyperbola h, explicit real x); +point point(explicit hyperbola h, explicit int x); +point point(explicit conic co, explicit real x); +point point(explicit conic co, explicit int x); +point point(arc a, abscissa l); +point point(arc a, real x); +pair point(explicit arc a, int x); +point point(explicit mass m); +point point(explicit vertex V); +point point(trilinear tri); +point point(circle c, point M); +point point(circle c, explicit vector v); +bool finite(explicit point p); +void dot(picture pic=<default>, Label L, explicit point Z, align align=<default>, string format=<default>, pen p=<default>); +real dot(point A, point B); +real dot(point A, explicit pair B); +real dot(explicit pair A, point B); +void dot(picture pic=<default>, Label L, explicit mass M, align align=<default>, string format=<default>, pen p=<default>); +void dot(picture pic=<default>, triangle t, pen p=<default>); +real[] realquarticroots(real a, real b, real c, real d, real e); +point origin; +point origin(coordsys R=<default>); +void draw(picture pic=<default>, Label L=<default>, line l, bool dirA=<default>, bool dirB=<default>, align align=<default>, pen p=<default>, bool arrow(picture, path, pen, marginT(path, pen))=<default>, Label legend=<default>, marker marker=<default>, path pathModifier(path)=<default>); +void draw(picture pic=<default>, Label[] L=<default>, line[] l, align align=<default>, pen[] p=<default>, bool arrow(picture, path, pen, marginT(path, pen))=<default>, Label[] legend=<default>, marker marker=<default>, path pathModifier(path)=<default>); +void draw(picture pic=<default>, Label[] L=<default>, line[] l, align align=<default>, pen p, bool arrow(picture, path, pen, marginT(path, pen))=<default>, Label[] legend=<default>, marker marker=<default>, path pathModifier(path)=<default>); +void draw(picture pic=<default>, Label L=<default>, circle c, align align=<default>, pen p=<default>, bool arrow(picture, path, pen, marginT(path, pen))=<default>, bool bar(picture, path, pen, marginT(path, pen))=<default>, marginT margin(path, pen)=<default>, Label legend=<default>, marker marker=<default>); +void draw(picture pic=<default>, Label L=<default>, ellipse el, align align=<default>, pen p=<default>, bool arrow(picture, path, pen, marginT(path, pen))=<default>, bool bar(picture, path, pen, marginT(path, pen))=<default>, marginT margin(path, pen)=<default>, Label legend=<default>, marker marker=<default>); +void draw(picture pic=<default>, Label L=<default>, parabola parabola, align align=<default>, pen p=<default>, bool arrow(picture, path, pen, marginT(path, pen))=<default>, bool bar(picture, path, pen, marginT(path, pen))=<default>, marginT margin(path, pen)=<default>, Label legend=<default>, marker marker=<default>); +void draw(picture pic=<default>, Label L=<default>, hyperbola h, align align=<default>, pen p=<default>, bool arrow(picture, path, pen, marginT(path, pen))=<default>, bool bar(picture, path, pen, marginT(path, pen))=<default>, marginT margin(path, pen)=<default>, Label legend=<default>, marker marker=<default>); +void draw(picture pic=<default>, Label L=<default>, explicit conic co, align align=<default>, pen p=<default>, bool arrow(picture, path, pen, marginT(path, pen))=<default>, bool bar(picture, path, pen, marginT(path, pen))=<default>, marginT margin(path, pen)=<default>, Label legend=<default>, marker marker=<default>); +void draw(picture pic=<default>, Label L=<default>, arc a, align align=<default>, pen p=<default>, bool arrow(picture, path, pen, marginT(path, pen))=<default>, bool bar(picture, path, pen, marginT(path, pen))=<default>, marginT margin(path, pen)=<default>, Label legend=<default>, marker marker=<default>); +void draw(picture pic=<default>, triangle t, pen p=<default>, marker marker=<default>); +void draw(picture pic=<default>, triangle[] t, pen p=<default>, marker marker=<default>); +coordsys defaultcoordsys; +string defaultmassformat; +line radicalline(circle c1, circle c2); +point radicalcenter(circle c1, circle c2); +point radicalcenter(circle c1, circle c2, circle c3); +ellipse ellipse(point F1, point F2, real a); +ellipse ellipse(point F1, point F2, point M); +ellipse ellipse(point C, real a, real b, real angle=<default>); +ellipse ellipse(bqe bqe); +ellipse ellipse(point M1, point M2, point M3, point M4, point M5); +path arctopath(arc a, int n); +bool inside(ellipse el, point M); +bool inside(parabola p, point M); +int ellipsenodesnumber(real a, real b); +int ellipsenodesnumber(real a, real b, real angle1, real angle2, bool dir); +int ellipsenodesnumberfactor; +bool byfoci; +point[] standardizecoordsys(coordsys R=<default>, bool warn=<default> ... point[] M); +transform reflect(line l); +transform reflect(line l1, line l2, bool safe=<default>); +abscissa relabscissa(real x); +abscissa relabscissa(int x); +abscissa relabscissa(line l, point M); +abscissa relabscissa(circle c, point M); +abscissa relabscissa(ellipse el, point M); +abscissa relabscissa(conic co, point M); +abscissa relabscissa(arc a, point M); +circle incircle(point A, point B, point C); +circle incircle(triangle t); +mass masscenter(... mass[] M); +vector unit(point M); +vector unit(vector u); +line Ox(coordsys R=<default>); +line Ox; +conic conic(point F, line l, real e); +conic conic(point M1, point M2, point M3, point M4, point M5); +conic conic(bqe bqe); +bool defined(point P); +string conictype(bqe bqe); +triangle antipedal(triangle t, point M); +void clipdraw(picture pic=<default>, Label L=<default>, path g, align align=<default>, pen p=<default>, bool arrow(picture, path, pen, marginT(path, pen))=<default>, bool bar(picture, path, pen, marginT(path, pen))=<default>, real xmargin=<default>, real ymargin=<default>, Label legend=<default>, marker marker=<default>); +real perpfactor; +int conicnodesfactor; +int conicnodesnumber(conic co, real angle1, real angle2, bool dir=<default>); +line hline(coordsys R=<default>); +line hline; +int[] tricoef(side side); +path arcfromfocus(conic co, real angle1, real angle2, int n=<default>, bool direction=<default>); +line sector(int n=<default>, int p=<default>, line l1, line l2, real angle=<default>, bool sharp=<default>); +path arcfromcenter(ellipse el, real angle1, real angle2, bool direction=<default>, int n=<default>); +path arcfromcenter(hyperbola h, real angle1, real angle2, int n=<default>, bool direction=<default>); +path arcfromcenter(explicit conic co, real angle1, real angle2, int n, bool direction=<default>); +line vline(coordsys R=<default>); +line vline; +vector vector(coordsys R=<default>, pair v); +vector vector(point M); +real[] intersect(path g, explicit pair p, real fuzz=<default>); +real[] intersect(path g, explicit point P, real fuzz=<default>); +int sgnd(real x); +int sgnd(int x); +circle excircle(point A, point B, point C); +circle excircle(side side); +line extend(line l); +point intersectionpoint(line l1, line l2); +pair[] intersectionpoints(pair A, pair B, real a, real b, real c, real d, real f, real g); +pair[] intersectionpoints(pair A, pair B, real[] equation); +point[] intersectionpoints(line l, path g); +point[] intersectionpoints(bqe bqe1, bqe bqe2); +point[] intersectionpoints(triangle t, line l, bool extended=<default>); +point[] intersectionpoints(line l, triangle t, bool extended=<default>); +point[] intersectionpoints(line l, circle c); +point[] intersectionpoints(circle c, line l); +point[] intersectionpoints(line l, ellipse el); +point[] intersectionpoints(ellipse el, line l); +point[] intersectionpoints(line l, parabola p); +point[] intersectionpoints(parabola p, line l); +point[] intersectionpoints(line l, hyperbola h); +point[] intersectionpoints(hyperbola h, line l); +point[] intersectionpoints(line l, conic co); +point[] intersectionpoints(conic co, line l); +point[] intersectionpoints(conic co1, conic co2); +point[] intersectionpoints(triangle t, conic co, bool extended=<default>); +point[] intersectionpoints(conic co, triangle t, bool extended=<default>); +point[] intersectionpoints(ellipse a, ellipse b); +point[] intersectionpoints(ellipse a, circle b); +point[] intersectionpoints(circle a, ellipse b); +point[] intersectionpoints(ellipse a, parabola b); +point[] intersectionpoints(parabola a, ellipse b); +point[] intersectionpoints(ellipse a, hyperbola b); +point[] intersectionpoints(hyperbola a, ellipse b); +point[] intersectionpoints(circle a, parabola b); +point[] intersectionpoints(parabola a, circle b); +point[] intersectionpoints(circle a, hyperbola b); +point[] intersectionpoints(hyperbola a, circle b); +point[] intersectionpoints(parabola a, parabola b); +point[] intersectionpoints(parabola a, hyperbola b); +point[] intersectionpoints(hyperbola a, parabola b); +point[] intersectionpoints(hyperbola a, hyperbola b); +point[] intersectionpoints(circle c1, circle c2); +point[] intersectionpoints(conic co, arc a); +point[] intersectionpoints(arc a, conic co); +point[] intersectionpoints(arc a1, arc a2); +point[] intersectionpoints(line l, arc a); +point[] intersectionpoints(arc a, line l); +point intouch(side side); +triangle intouch(triangle t); +point orthocentercenter(point A, point B, point C); +point orthocentercenter(triangle t); +real rf(real x, real y, real z); +bool concurrent(... line[] l); +real inradius(point A, point B, point C); +real inradius(triangle t); +pen addpenline; +pen addpenline(pen p); +pen addpenarc; +pen addpenarc(pen p); +void label(picture pic=<default>, Label L, explicit mass M, align align=<default>, string format=<default>, pen p=<default>, filltype filltype=<default>); +void label(picture pic=<default>, Label L, vertex V, pair align=<default>, real alignFactor=<default>, pen p=<default>, filltype filltype=<default>); +void label(picture pic=<default>, Label LA=<default>, Label LB=<default>, Label LC=<default>, triangle t, real alignAngle=<default>, real alignFactor=<default>, pen p=<default>, filltype filltype=<default>); +real abs(coordsys R, pair m); +real abs(explicit point M); +point curpoint(line l, real x); +point curpoint(explicit circle c, real x); +point curpoint(explicit ellipse el, real x); +point curpoint(explicit parabola p, real x); +point curpoint(conic co, real x); +point curpoint(arc a, real x); +line bisector(line l1, line l2, real angle=<default>, bool sharp=<default>); +line bisector(point A, point B, point C, point D, real angle=<default>, bool sharp=<default>); +line bisector(segment s, real angle=<default>); +line bisector(point A, point B, real angle=<default>); +line bisector(vertex V, real angle=<default>); +line bisector(side side); +bqe canonical(bqe bqe); +bool between(point M, point O, point N); +point bisectorpoint(side side); +abscissa angabscissa(real x, path polarconicroutine(conic co, real angle1, real angle2, int n, bool direction)=<default>); +abscissa angabscissa(int x, path polarconicroutine(conic co, real angle1, real angle2, int n, bool direction)=<default>); +abscissa angabscissa(circle c, point M); +abscissa angabscissa(ellipse el, point M, path polarconicroutine(conic co, real angle1, real angle2, int n, bool direction)=<default>); +abscissa angabscissa(hyperbola h, point M, path polarconicroutine(conic co, real angle1, real angle2, int n, bool direction)=<default>); +abscissa angabscissa(parabola p, point M); +abscissa angabscissa(explicit conic co, point M); +abscissa angabscissa(arc a, point M); +pair locate(point P); +point locate(pair p); +pair locate(explicit vector v); +bool samecoordsys(bool warn=<default> ... point[] M); +bool samecoordsys(bool warn=<default> ... bqe[] bqes); +triangle extouch(triangle t); +triangle extouch(side side); +coordsys canonicalcartesiansystem(ellipse el); +coordsys canonicalcartesiansystem(parabola p); +coordsys canonicalcartesiansystem(hyperbola h); +coordsys canonicalcartesiansystem(explicit conic co); +arc arc(ellipse el, real angle1, real angle2, path polarconicroutine(conic co, real angle1, real angle2, int n, bool direction)=<default>, bool direction=<default>); +arc arc(ellipse el, explicit abscissa x1, explicit abscissa x2, bool direction=<default>); +arc arc(ellipse el, point M, point N, bool direction=<default>); +arc arc(explicit arc a, abscissa x1, abscissa x2); +arc arc(explicit arc a, point M, point N); +path arc(explicit pair B, explicit pair A, explicit pair C, real r); +void markrightangle(picture pic=<default>, point A, point O, point B, real size=<default>, pen p=<default>, marginT margin(path, pen)=<default>, filltype filltype=<default>); +real epsgeo; +real sharpangle(line l1, line l2); +bool isparabola(bqe bqe); +real sharpdegrees(line l1, line l2); +real exradius(point A, point B, point C); +real exradius(side side); +abscissa nodabscissa(real x); +abscissa nodabscissa(int x); +abscissa nodabscissa(line l, point M); +abscissa nodabscissa(circle c, point M); +abscissa nodabscissa(ellipse el, point M); +abscissa nodabscissa(parabola p, point M); +abscissa nodabscissa(conic co, point M); +abscissa nodabscissa(arc a, point M); +coordsys coordsys(line l); +coordsys coordsys(conic co); +coordsys coordsys(ellipse el); +pair coordinates(point M); +real length(explicit point M); +real length(segment s); +int arcnodesnumber(explicit arc a); +int nodesystem; +bool collinear(vector u, vector v); +point centroid(point A, point B, point C); +point centroid(triangle t); +int angularsystem; +path square(pair z1, pair z2); +point symmedian(triangle t); +point symmedian(side side); +line symmedian(vertex V); +triangle symmedial(triangle t); +int curvilinearsystem; +bqe bqe(coordsys R=<default>, real a, real b, real c, real d, real e, real f); +bqe bqe(point M1, point M2, point M3, point M4, point M5); +arc arccircle(point A, point M, point B); +arc arccircle(point A, point B, real angle, bool direction=<default>); +point relpoint(line l, real x); +point relpoint(explicit circle c, real x); +point relpoint(explicit ellipse el, real x); +point relpoint(explicit parabola p, real x); +point relpoint(explicit hyperbola h, real x); +point relpoint(explicit conic co, explicit real x); +point relpoint(explicit conic co, explicit int x); +point relpoint(arc a, real x); +point changecoordsys(coordsys R, point M); +vector changecoordsys(coordsys R, vector v); +line changecoordsys(coordsys R, line l); +bqe changecoordsys(coordsys R, bqe bqe); +conic changecoordsys(coordsys R, conic co); +real angle(explicit point M, coordsys R=<default>, bool warn=<default>); +real angle(explicit vector v, coordsys R=<default>, bool warn=<default>); +real angle(line l, coordsys R=<default>); +real angle(line l1, line l2); +real angle(arc a); +point[] fermat(triangle t); +real arclength(circle c); +real arclength(ellipse el); +real arclength(ellipse el, real angle1, real angle2, bool direction=<default>, path polarconicroutine(conic co, real angle1, real angle2, int n, bool direction)=<default>); +real arclength(parabola p, real angle); +real arclength(parabola p, real angle1, real angle2); +real arclength(parabola p); +real arclength(arc a); +line reverse(line l); +arc reverse(arc a); +point gergonne(triangle t); +real focusToCenter(ellipse el, real a); +hyperbola hyperbola(point P1, point P2, real ae, bool byfoci=<default>); +hyperbola hyperbola(point C, real a, real b, real angle=<default>); +hyperbola hyperbola(bqe bqe); +hyperbola hyperbola(point M1, point M2, point M3, point M4, point M5); +side opposite(vertex V); +vertex opposite(side side); +int hyperbolanodesnumber(hyperbola h, real angle1, real angle2); +path polarconicroutine(conic co, real angle1, real angle2, int n, bool direction)(conic co); +int hyperbolanodesnumberfactor; +line parallel(point M, line l); +line parallel(point M, explicit vector dir); +line parallel(point M, explicit pair dir); +bool parallel(line l1, line l2, bool strictly=<default>); +transform projection(point A, point B); +transform projection(point A, point B, point C, point D, bool safe=<default>); +transform projection(line l); +transform projection(line l1, line l2, bool safe=<default>); +bool degenerate(conic c); +bool degenerate(circle c); +bool degenerate(ellipse el); +line line(point A, bool extendA=<default>, point B, bool extendB=<default>); +line line(segment s); +line line(real a, point A=<default>); +line line(point A=<default>, real a); +line line(int a, point A=<default>); +line line(coordsys R=<default>, real slope, real origin); +line line(coordsys R=<default>, real a, real b, real c); +line line(circle c); +line line(explicit side side); +line complementary(explicit line l); +line[] complementary(explicit segment s); +arc complementary(arc a); +point ppoint(arc a, real x); +path fromFocus(conic co, real angle1, real angle2, int n, bool direction); +bool sameside(point M, point N, point O); +bool sameside(point M, point P, line l); +point[] sameside(point M, line l1, line l2); +arc arcsubtended(point A, point B, real angle); +void distance(picture pic=<default>, Label L=<default>, point A, point B, bool rotated=<default>, real offset=<default>, pen p=<default>, pen joinpen=<default>, bool arrow(picture, path, pen, marginT(path, pen))=<default>); +real distance(point M, line l); +real distance(line l, point M); +point incenter(point A, point B, point C); +point incenter(triangle t); +void write(explicit line l); +void write(explicit segment s); +void write(trilinear tri); +triangle incentral(triangle t); +point arcsubtendedcenter(point A, point B, real angle); +circle circle(explicit point C, real r); +circle circle(point A, point B); +circle circle(segment s); +circle circle(point A, point B, point C); +circle circle(triangle t); +circle circle(inversion i); +point angpoint(conic co, real angle); +point angpoint(explicit circle c, real x); +point angpoint(explicit ellipse el, real x, path polarconicroutine(conic co, real angle1, real angle2, int n, bool direction)=<default>); +point angpoint(explicit parabola p, real x); +point angpoint(explicit hyperbola h, real x, path polarconicroutine(conic co, real angle1, real angle2, int n, bool direction)=<default>); +point angpoint(arc a, real angle); +triangle orthic(triangle t); +int circlenodesnumber(real r); +int circlenodesnumber(real r, real angle1, real angle2); +path compassmark(pair O, pair A, real position, real angle=<default>); +bool byvertices; +int circlenodesnumberfactor; +transform xscale(real k, point M); +transform yscale(real k, point M); +transform scale(real k, point M); +transform scale(real k, point A, point B, point C, point D, bool safe=<default>); +transform scale(real k, line l1, line l2, bool safe=<default>); +point operator +(explicit point P1, explicit point P2); +point operator +(explicit point P1, explicit pair p2); +point operator +(explicit pair p1, explicit point p2); +point operator +(point M, explicit vector v); +point operator +(explicit pair m, explicit vector v); +vector operator +(explicit vector v1, explicit vector v2); +line operator +(line l, vector u); +conic operator +(conic c, explicit point M); +conic operator +(conic c, explicit pair m); +conic operator +(conic c, vector v); +circle operator +(explicit circle c, explicit point M); +circle operator +(explicit circle c, pair m); +circle operator +(explicit circle c, vector m); +abscissa operator +(real x, explicit abscissa a); +abscissa operator +(explicit abscissa a, real x); +abscissa operator +(int x, explicit abscissa a); +arc operator +(explicit arc a, point M); +arc operator +(explicit arc a, vector v); +mass operator +(mass M1, mass M2); +mass operator +(explicit mass M, real x); +mass operator +(explicit mass M, int x); +point operator -(explicit point P); +point operator -(explicit point P1, explicit point P2); +point operator -(explicit point P1, explicit pair p2); +point operator -(explicit pair p1, explicit point P2); +point operator -(point M, explicit vector v); +vector operator -(explicit vector v); +point operator -(explicit pair m, explicit vector v); +vector operator -(explicit vector v1, explicit vector v2); +line operator -(line l, vector u); +conic operator -(conic c, explicit point M); +conic operator -(conic c, explicit pair m); +conic operator -(conic c, vector v); +circle operator -(explicit circle c, explicit point M); +circle operator -(explicit circle c, pair m); +circle operator -(explicit circle c, vector m); +abscissa operator -(explicit abscissa a); +abscissa operator -(real x, explicit abscissa a); +abscissa operator -(explicit abscissa a, real x); +abscissa operator -(int x, explicit abscissa a); +arc operator -(explicit arc a, point M); +arc operator -(explicit arc a, vector v); +mass operator -(mass M1, mass M2); +mass operator -(explicit mass M, real x); +mass operator -(explicit mass M, int x); +transform xscaleO(real x); +pair operator *(coordsys R, pair p); +path operator *(coordsys R, path g); +coordsys operator *(transform t, coordsys R); +point operator *(real x, explicit point P); +point operator *(transform t, explicit point P); +point operator *(explicit point P1, explicit point P2); +point operator *(explicit point P1, explicit pair p2); +point operator *(explicit pair p1, explicit point p2); +vector operator *(real x, explicit vector v); +vector operator *(transform t, explicit vector v); +vector operator *(explicit point M, explicit vector v); +line operator *(transform t, line l); +line operator *(real x, line l); +line operator *(int x, line l); +line operator *(point M, line l); +circle operator *(real x, explicit circle c); +circle operator *(int x, explicit circle c); +ellipse operator *(transform t, ellipse el); +parabola operator *(transform t, parabola p); +ellipse operator *(transform t, circle c); +hyperbola operator *(transform t, hyperbola h); +conic operator *(transform t, conic co); +ellipse operator *(real x, ellipse el); +abscissa operator *(real x, explicit abscissa a); +abscissa operator *(explicit abscissa a, real x); +arc operator *(transform t, explicit arc a); +arc operator *(real x, explicit arc a); +arc operator *(int x, explicit arc a); +mass operator *(real x, explicit mass M); +mass operator *(int x, explicit mass M); +mass operator *(transform t, mass M); +triangle operator *(transform T, triangle t); +point operator *(inversion i, point P); +circle operator *(inversion i, line l); +circle operator *(inversion i, circle c); +arc operator *(inversion i, segment s); +path operator *(inversion i, triangle t); +transform yscaleO(real x); +coordsys operator init(); +point operator init(); +vector operator init(); +line operator init(); +segment operator init(); +bqe operator init(); +conic operator init(); +circle operator init(); +ellipse operator init(); +parabola operator init(); +hyperbola operator init(); +abscissa operator init(); +arc operator init(); +mass operator init(); +triangle operator init(); +trilinear operator init(); +inversion operator init(); +pair operator cast(point P); +pair[] operator cast(point[] P); +point operator cast(pair p); +point[] operator cast(pair[] p); +guide operator cast(point p); +path operator cast(point p); +point operator cast(vector v); +vector operator cast(pair v); +vector operator cast(explicit point v); +pair operator cast(explicit vector v); +align operator cast(vector v); +line operator cast(segment s); +segment operator cast(line l); +ellipse operator cast(circle c); +circle operator cast(ellipse el); +ellipse operator cast(conic co); +parabola operator cast(conic co); +conic operator cast(parabola p); +hyperbola operator cast(conic co); +conic operator cast(hyperbola h); +conic operator cast(ellipse el); +conic operator cast(circle c); +circle operator cast(conic c); +path operator cast(ellipse el); +path operator cast(circle c); +path operator cast(parabola p); +path operator cast(hyperbola h); +path operator cast(conic co); +abscissa operator cast(explicit position position); +abscissa operator cast(real x); +abscissa operator cast(int x); +path operator cast(explicit arc a); +guide operator cast(explicit arc a); +point operator cast(mass m); +mass operator cast(point M); +point[] operator cast(mass[] m); +mass[] operator cast(point[] P); +mass operator cast(pair m); +path operator cast(mass M); +guide operator cast(mass M); +line operator cast(side side); +point operator cast(vertex V); +point operator cast(trilinear tri); +circle operator cast(inversion i); +inversion operator cast(circle c); +void lineinversion(); +pair operator /(pair p, coordsys R); +point operator /(explicit point P, real x); +point operator /(real x, explicit point P); +vector operator /(explicit vector v, real x); +line operator /(line l, real x); +line operator /(line l, int x); +circle operator /(explicit circle c, real x); +circle operator /(explicit circle c, int x); +ellipse operator /(ellipse el, real x); +abscissa operator /(real x, explicit abscissa a); +abscissa operator /(explicit abscissa a, real x); +abscissa operator /(int x, explicit abscissa a); +arc operator /(explicit arc a, real x); +mass operator /(explicit mass M, real x); +mass operator /(explicit mass M, int x); +transform scaleO(real x); +real operator ^(point M, explicit circle c); +segment segment(point A, point B); +segment segment(line l); +segment segment(explicit side side); +bool operator ==(coordsys c1, coordsys c2); +bool operator ==(explicit point M, explicit point N); +bool operator ==(explicit vector u, explicit vector v); +bool operator ==(line l1, line l2); +bool operator !=(explicit point M, explicit point N); +bool operator !=(line l1, line l2); +line[] operator ^^(line l1, line l2); +line[] operator ^^(line l1, line[] l2); +line[] operator ^^(line[] l2, line l1); +line[] operator ^^(line[] l1, line[] l2); +triangle[] operator ^^(triangle[] t1, triangle t2); +triangle[] operator ^^(... triangle[] t); +real elle(real phi, real k); +point excenter(point A, point B, point C); +point excenter(side side); +mass mass(point M, real m); +mass mass(explicit point P); +mass mass(coordsys R, explicit pair p, real m); +bool operator @(point m, line l); +bool operator @(point M, conic co); +bool operator @(point M, explicit circle c); +bool operator @(point M, arc a); +triangle cevian(triangle t, point P); +point cevian(side side, point P); +line cevian(vertex V, point P); +triangle triangle(line l1, line l2, line l3); +trilinear trilinear(triangle t, real a, real b, real c); +trilinear trilinear(triangle t, point M); +trilinear trilinear(triangle t, real f(real, real, real), real a=<default>, real b=<default>, real c=<default>); +triangle triangleAbc(real alpha, real b, real c, real angle=<default>, point A=<default>); +triangle triangleabc(real a, real b, real c, real angle=<default>, point A=<default>); +triangle anticomplementary(triangle t); +vector dir(vertex V); +real degrees(explicit point M, coordsys R=<default>, bool warn=<default>); +real degrees(vector v, coordsys R=<default>, bool warn=<default>); +real degrees(line l, coordsys R=<default>); +real degrees(line l1, line l2); +real degrees(arc a); +real linemargin; +real linemargin(); +line Oy(coordsys R=<default>); +line Oy; +path fromCenter(conic co, real angle1, real angle2, int n, bool direction); +void markarc(picture pic=<default>, Label L=<default>, int n=<default>, real radius=<default>, real space=<default>, arc a, pen sectorpen=<default>, pen markpen=<default>, marginT margin(path, pen)=<default>, bool arrow(picture, path, pen, marginT(path, pen))=<default>, marker marker=<default>); +real approximate(real t); +real[] approximate(real[] T); +void markangle(picture pic=<default>, Label L=<default>, int n=<default>, real radius=<default>, real space=<default>, explicit line l1, explicit line l2, explicit pair align=<default>, bool arrow(picture, path, pen, marginT(path, pen))=<default>, pen p=<default>, filltype filltype=<default>, marginT margin(path, pen)=<default>, marker marker=<default>); +void markangle(picture pic=<default>, Label L=<default>, int n=<default>, real radius=<default>, real space=<default>, explicit line l1, explicit line l2, explicit vector align, bool arrow(picture, path, pen, marginT(path, pen))=<default>, pen p=<default>, filltype filltype=<default>, marginT margin(path, pen)=<default>, marker marker=<default>); +transform hprojection(line l, bool safe=<default>); +point conj(explicit point M); +vector conj(explicit vector u); +hyperbola conj(hyperbola h); +transform vprojection(line l, bool safe=<default>); +parabola parabola(point F, line l); +parabola parabola(point F, point vertex); +parabola parabola(point F, real a, real angle); +parabola parabola(bqe bqe); +parabola parabola(point M1, point M2, point M3, line l); +parabola parabola(point M1, point M2, point M3, point M4, point M5); +bool onpath(picture pic=<default>, path g, point M, pen p=<default>); +int parabolanodesnumber(parabola p, real angle1, real angle2); +int parabolanodesnumberfactor; +path NoModifier(path); +real[] bangles(picture pic=<default>, parabola p); +real[][] bangles(picture pic=<default>, hyperbola h); +coordsys currentcoordsys; +point foot(vertex V); +point foot(side side); +path currentpolarconicroutine(conic co, real angle1, real angle2, int n, bool direction); +transform rotate(explicit pair dir); +transform rotate(explicit vector dir); +transform rotate(explicit point dir); +real EPS; +transform rotateO(real a); +pair attract(pair m, path g, real fuzz=<default>); +point attract(point M, path g, real fuzz=<default>); +line perpendicular(point M, line l); +line perpendicular(point M, explicit vector normal); +line perpendicular(point M, explicit pair normal); +bool perpendicular(line l1, line l2); +void perpendicular(picture pic=<default>, pair z, pair align, pair dir=<default>, real size=<default>, pen p=<default>, marginT margin(path, pen)=<default>, filltype filltype=<default>); +void perpendicular(picture pic=<default>, pair z, pair align, path g, real size=<default>, pen p=<default>, marginT margin(path, pen)=<default>, filltype filltype=<default>); +real binomial(real n, real k); +void perpendicularmark(picture pic=<default>, point z, explicit pair align, explicit pair dir=<default>, real size=<default>, pen p=<default>, marginT margin(path, pen)=<default>, filltype filltype=<default>); +void perpendicularmark(picture pic=<default>, point z, vector align, vector dir=<default>, real size=<default>, pen p=<default>, marginT margin(path, pen)=<default>, filltype filltype=<default>); +void perpendicularmark(picture pic=<default>, point z, explicit pair align, path g, real size=<default>, pen p=<default>, marginT margin(path, pen)=<default>, filltype filltype=<default>); +void perpendicularmark(picture pic=<default>, point z, vector align, path g, real size=<default>, pen p=<default>, marginT margin(path, pen)=<default>, filltype filltype=<default>); +void perpendicularmark(picture pic=<default>, line l1, line l2, real size=<default>, pen p=<default>, int quarter=<default>, marginT margin(path, pen)=<default>, filltype filltype=<default>); +point isogonalconjugate(triangle t, point M); +point isogonal(side side, point M); +line isogonal(vertex V, point M); +triangle isogonal(triangle t, point M); +void Drawline(picture pic=<default>, Label L=<default>, pair P, bool dirP=<default>, pair Q, bool dirQ=<default>, align align=<default>, pen p=<default>, bool arrow(picture, path, pen, marginT(path, pen))=<default>, Label legend=<default>, marker marker=<default>, path pathModifier(path)=<default>); +bool simeq(point A, point B, real fuzz=<default>); +bool simeq(point a, real b, real fuzz=<default>); +point inverse(real k, point A, point M); +circle inverse(real k, point A, line l); +circle inverse(real k, point A, circle c); +arc inverse(real k, point A, segment s); +inversion inversion(real k, point C); +inversion inversion(point C, real k); +inversion inversion(circle c1, circle c2, real sgn=<default>); +inversion inversion(circle c1, circle c2, circle c3); +inversion inversion(circle c); +coordsys cartesiansystem(pair O=<default>, pair i, pair j); +line tangent(circle c, abscissa x); +line tangent(circle c, point M); +line tangent(circle c, explicit vector v); +line tangent(ellipse el, abscissa x); +line tangent(parabola p, abscissa x); +line tangent(hyperbola h, abscissa x); +line tangent(explicit arc a, abscissa x); +line tangent(explicit arc a, point M); +line[] tangents(circle c, point M); +line[] tangents(ellipse el, point M); +line[] tangents(parabola p, point M); +line[] tangents(hyperbola h, point M); +real centerToFocus(ellipse el, real a); +bqe equation(ellipse el); +bqe equation(parabola p); +bqe equation(hyperbola h); +bqe equation(explicit conic co); +triangle tangential(triangle t); +triangle pedal(triangle t, point M); +line pedal(side side, point M); +string massformat(string format=<default>, string s, mass M); +int relativesystem; +void drawline(picture pic=<default>, triangle t, pen p=<default>); +void addMargins(picture pic=<default>, real lmargin=<default>, real bmargin=<default>, real rmargin=<default>, real tmargin=<default>, bool rigid=<default>, bool allObject=<default>); +triangle medial(triangle t); +line median(vertex V); +line median(side side); +void show(picture pic=<default>, Label lo=<default>, Label li=<default>, Label lj=<default>, coordsys R, pen dotpen=<default>, pen xpen=<default>, pen ypen=<default>, pen ipen=<default>, pen jpen=<default>, bool arrow(picture, path, pen, marginT(path, pen))=<default>); +void show(Label L, vector v, pen p=<default>, bool arrow(picture, path, pen, marginT(path, pen))=<default>); +void show(picture pic=<default>, line l, pen p=<default>); +void show(picture pic=<default>, Label LA=<default>, Label LB=<default>, Label LC=<default>, Label La=<default>, Label Lb=<default>, Label Lc=<default>, triangle t, pen p=<default>, filltype filltype=<default>); +line isotomic(vertex V, point M); +point isotomic(side side, point M); +triangle isotomic(triangle t, point M); +abscissa curabscissa(real x); +abscissa curabscissa(int x); +abscissa curabscissa(line l, point M); +abscissa curabscissa(circle c, point M); +abscissa curabscissa(ellipse el, point M); +abscissa curabscissa(parabola p, point M); +abscissa curabscissa(conic co, point M); +abscissa curabscissa(arc a, point M); +string DefaultFormat(real); +string DefaultLogFormat(real)(int base); +string DefaultLogFormat(real); +guide graph(pair f(real), real, real, int)(guide join(... guide[])); +guide[] graph(pair f(real), real, real, int)(guide join(... guide[]), bool3 cond(real)); +guide graph(picture pic=<default>, real f(real), real a, real b, int n=<default>, real T(real)=<default>, guide join(... guide[])=<default>); +guide[] graph(picture pic=<default>, real f(real), real a, real b, int n=<default>, real T(real)=<default>, bool3 cond(real), guide join(... guide[])=<default>); +guide graph(picture pic=<default>, real x(real), real y(real), real a, real b, int n=<default>, real T(real)=<default>, guide join(... guide[])=<default>); +guide[] graph(picture pic=<default>, real x(real), real y(real), real a, real b, int n=<default>, real T(real)=<default>, bool3 cond(real), guide join(... guide[])=<default>); +guide graph(picture pic=<default>, pair z(real), real a, real b, int n=<default>, real T(real)=<default>, guide join(... guide[])=<default>); +guide[] graph(picture pic=<default>, pair z(real), real a, real b, int n=<default>, real T(real)=<default>, bool3 cond(real), guide join(... guide[])=<default>); +guide graph(picture pic=<default>, pair[] z, guide join(... guide[])=<default>); +guide[] graph(picture pic=<default>, pair[] z, bool3[] cond, guide join(... guide[])=<default>); +guide graph(picture pic=<default>, real[] x, real[] y, guide join(... guide[])=<default>); +guide[] graph(picture pic=<default>, real[] x, real[] y, bool3[] cond, guide join(... guide[])=<default>); +scientific scientific(real x); +void Left(picture, axisT)(bool extend=<default>); +void Left(picture, axisT); +autoscaleT defaultS; +void XEquals(picture, axisT)(real x, bool extend=<default>); +void YEquals(picture, axisT)(real y, bool extend=<default>); +tickvalues OmitTickIntervals(tickvalues)(real[] a, real[] b); +tickvalues OmitTickInterval(tickvalues)(real a, real b); +tickvalues OmitTick(tickvalues)(... real[] x); +string LogFormat(real)(int base); +string LogFormat(real); +axisT axis; +void axis(picture pic=<default>, Label L=<default>, path g, path g2=<default>, pen p=<default>, void ticks(frame, transform, Label, pair, path, path, pen, bool(picture, path, pen, marginT(path, pen)), marginT(path, pen), ticklocate, int[], bool opposite=<default>), ticklocate locate, bool arrow(picture, path, pen, marginT(path, pen))=<default>, marginT margin(path, pen)=<default>, int[] divisor=<default>, bool above=<default>, bool opposite=<default>); +void drawtick(frame f, transform T, path g, path g2, ticklocate locate, real val, real Size, int sign, pen p, bool extend); +real maxlength(pair a, pair b, int nx, int ny); +void errorbar(picture pic, pair z, pair dp, pair dm, pen p=<default>, real size=<default>); +void errorbars(picture pic=<default>, pair[] z, pair[] dp, pair[] dm=<default>, bool[] cond=<default>, pen p=<default>, real size=<default>); +void errorbars(picture pic=<default>, real[] x, real[] y, real[] dpx, real[] dpy, real[] dmx=<default>, real[] dmy=<default>, bool[] cond=<default>, pen p=<default>, real size=<default>); +void errorbars(picture pic=<default>, real[] x, real[] y, real[] dpy, bool[] cond=<default>, pen p=<default>, real size=<default>); +void xlimits(picture pic=<default>, real min=<default>, real max=<default>, bool crop=<default>); +string conditionlength; +void ylimits(picture pic=<default>, real min=<default>, real max=<default>, bool crop=<default>); +tickvalues None(tickvalues v); +scaleT Logarithmic; +void limits(picture pic=<default>, pair min, pair max, bool crop=<default>); +void crop(picture pic=<default>); +picture vectorfield(path vector(real), path g, int n, bool truesize=<default>, pen p=<default>, bool arrow(picture, path, pen, marginT(path, pen))=<default>, marginT margin(path, pen)=<default>); +picture vectorfield(path vector(pair), pair a, pair b, int nx=<default>, int ny=<default>, bool truesize=<default>, real maxlength=<default>, bool cond(pair z)=<default>, pen p=<default>, bool arrow(picture, path, pen, marginT(path, pen))=<default>, marginT margin(path, pen)=<default>); +string OmitFormat(real)(string s=<default> ... real[] x); +guide Straight(... guide[]); +int Min; +string trailingzero; +void label(picture pic, Label L, pair z, real x, align align, string format, pen p); +void labelx(picture pic=<default>, Label L=<default>, explicit pair z, align align=<default>, string format=<default>, pen p=<default>); +void labelx(picture pic=<default>, Label L=<default>, real x, align align=<default>, string format=<default>, pen p=<default>); +void labelx(picture pic=<default>, Label L, string format=<default>, explicit pen p=<default>); +path Arc(pair c, real r, real angle1, real angle2, bool direction, int n=<default>); +path Arc(pair c, real r, real angle1, real angle2, int n=<default>); +path Arc(pair c, explicit pair z1, explicit pair z2, bool direction=<default>, int n=<default>); +void labely(picture pic=<default>, Label L=<default>, explicit pair z, align align=<default>, string format=<default>, pen p=<default>); +void labely(picture pic=<default>, Label L=<default>, real y, align align=<default>, string format=<default>, pen p=<default>); +void labely(picture pic=<default>, Label L, string format=<default>, explicit pen p=<default>); +pair labeltick(frame d, transform T, path g, ticklocate locate, real val, pair side, int sign, real Size, string ticklabel(real), Label F, real norm=<default>); +void labelaxis(frame f, transform T, Label L, path g, ticklocate locate=<default>, int sign=<default>, bool ticklabels=<default>); +void xaxisAt(picture pic=<default>, Label L=<default>, void axis(picture, axisT), real xmin=<default>, real xmax=<default>, pen p=<default>, void ticks(frame, transform, Label, pair, path, path, pen, bool(picture, path, pen, marginT(path, pen)), marginT(path, pen), ticklocate, int[], bool opposite=<default>)=<default>, bool arrow(picture, path, pen, marginT(path, pen))=<default>, marginT margin(path, pen)=<default>, bool above=<default>, bool opposite=<default>); +void yaxisAt(picture pic=<default>, Label L=<default>, void axis(picture, axisT), real ymin=<default>, real ymax=<default>, pen p=<default>, void ticks(frame, transform, Label, pair, path, path, pen, bool(picture, path, pen, marginT(path, pen)), marginT(path, pen), ticklocate, int[], bool opposite=<default>)=<default>, bool arrow(picture, path, pen, marginT(path, pen))=<default>, marginT margin(path, pen)=<default>, bool above=<default>, bool opposite=<default>); +void xaxis(picture pic=<default>, Label L=<default>, void axis(picture, axisT)=<default>, real xmin=<default>, real xmax=<default>, pen p=<default>, void ticks(frame, transform, Label, pair, path, path, pen, bool(picture, path, pen, marginT(path, pen)), marginT(path, pen), ticklocate, int[], bool opposite=<default>)=<default>, bool arrow(picture, path, pen, marginT(path, pen))=<default>, marginT margin(path, pen)=<default>, bool above=<default>); +void yaxis(picture pic=<default>, Label L=<default>, void axis(picture, axisT)=<default>, real ymin=<default>, real ymax=<default>, pen p=<default>, void ticks(frame, transform, Label, pair, path, path, pen, bool(picture, path, pen, marginT(path, pen)), marginT(path, pen), ticklocate, int[], bool opposite=<default>)=<default>, bool arrow(picture, path, pen, marginT(path, pen))=<default>, marginT margin(path, pen)=<default>, bool above=<default>, bool autorotate=<default>); +void xtick(picture pic=<default>, explicit pair z, pair dir=<default>, real size=<default>, pen p=<default>); +void xtick(picture pic=<default>, real x, pair dir=<default>, real size=<default>, pen p=<default>); +void xtick(picture pic=<default>, Label L, explicit pair z, pair dir=<default>, string format=<default>, real size=<default>, pen p=<default>); +void xtick(picture pic=<default>, Label L, real x, pair dir=<default>, string format=<default>, real size=<default>, pen p=<default>); +void ytick(picture pic=<default>, explicit pair z, pair dir=<default>, real size=<default>, pen p=<default>); +void ytick(picture pic=<default>, real y, pair dir=<default>, real size=<default>, pen p=<default>); +void ytick(picture pic=<default>, Label L, explicit pair z, pair dir=<default>, string format=<default>, real size=<default>, pen p=<default>); +void ytick(picture pic=<default>, Label L, real y, pair dir=<default>, string format=<default>, real size=<default>, pen p=<default>); +picture secondaryX(picture primary=<default>, void f(picture)); +picture secondaryY(picture primary=<default>, void f(picture)); +Label Break; +tickvalues Break(tickvalues)(real, real); +scaleT Linear; +scaleT Linear(bool automin=<default>, bool automax=<default>, real s=<default>, real intercept=<default>); +pair tickMin(picture pic); +pair tickMax(picture pic); +string autoformat(string format=<default>, real norm ... real[] a); +real linear(real)(real S(real x)=<default>, real Min, real Max); +pair polar(real r, real theta); +string Format(real)(string s=<default>); +guide polargraph(picture pic=<default>, real r(real), real a, real b, int n=<default>, guide join(... guide[])=<default>); +guide polargraph(picture pic=<default>, real[] r, real[] theta, guide join(... guide[])=<default>); +void LeftTicks(frame, transform, Label, pair, path, path, pen, bool(picture, path, pen, marginT(path, pen)), marginT(path, pen), ticklocate, int[], bool opposite=<default>)(Label format=<default>, string ticklabel(real)=<default>, bool beginlabel=<default>, bool endlabel=<default>, int N=<default>, int n=<default>, real Step=<default>, real step=<default>, bool begin=<default>, bool end=<default>, tickvalues modify(tickvalues)=<default>, real Size=<default>, real size=<default>, bool extend=<default>, pen pTick=<default>, pen ptick=<default>); +void LeftTicks(frame, transform, Label, pair, path, path, pen, bool(picture, path, pen, marginT(path, pen)), marginT(path, pen), ticklocate, int[], bool opposite=<default>)(Label format=<default>, string ticklabel(real)=<default>, bool beginlabel=<default>, bool endlabel=<default>, real[] Ticks, real[] ticks=<default>, real Size=<default>, real size=<default>, bool extend=<default>, pen pTick=<default>, pen ptick=<default>); +void LeftTicks(frame, transform, Label, pair, path, path, pen, bool(picture, path, pen, marginT(path, pen)), marginT(path, pen), ticklocate, int[], bool opposite=<default>); +tickvalues NoZero(tickvalues); +string NoZeroFormat(real); +guide Hermite(... guide[])(real[] splinetype(real[], real[])); +guide Hermite(... guide[]); +path Circle(pair c, real r, int n=<default>); +bool axiscoverage(int N, transform T, path g, ticklocate locate, real Step, pair side, int sign, real Size, Label F, string ticklabel(real), real norm, real limit); +scaleT Broken(real a, real b, bool automin=<default>, bool automax=<default>); +scaleT BrokenLog(real a, real b, bool automin=<default>, bool automax=<default>); +void Ticks(frame, transform, Label, pair, path, path, pen, bool(picture, path, pen, marginT(path, pen)), marginT(path, pen), ticklocate, int[], bool opposite=<default>)(int sign, Label F=<default>, string ticklabel(real)=<default>, bool beginlabel=<default>, bool endlabel=<default>, real[] Ticks=<default>, real[] ticks=<default>, int N=<default>, bool begin=<default>, bool end=<default>, real Size=<default>, real size=<default>, bool extend=<default>, pen pTick=<default>, pen ptick=<default>); +void Ticks(frame, transform, Label, pair, path, path, pen, bool(picture, path, pen, marginT(path, pen)), marginT(path, pen), ticklocate, int[], bool opposite=<default>)(int sign, Label F=<default>, string ticklabel(real)=<default>, bool beginlabel=<default>, bool endlabel=<default>, int N, int n=<default>, real Step=<default>, real step=<default>, bool begin=<default>, bool end=<default>, tickvalues modify(tickvalues)=<default>, real Size=<default>, real size=<default>, bool extend=<default>, pen pTick=<default>, pen ptick=<default>); +void Ticks(frame, transform, Label, pair, path, path, pen, bool(picture, path, pen, marginT(path, pen)), marginT(path, pen), ticklocate, int[], bool opposite=<default>)(Label format=<default>, string ticklabel(real)=<default>, bool beginlabel=<default>, bool endlabel=<default>, int N=<default>, int n=<default>, real Step=<default>, real step=<default>, bool begin=<default>, bool end=<default>, tickvalues modify(tickvalues)=<default>, real Size=<default>, real size=<default>, bool extend=<default>, pen pTick=<default>, pen ptick=<default>); +void Ticks(frame, transform, Label, pair, path, path, pen, bool(picture, path, pen, marginT(path, pen)), marginT(path, pen), ticklocate, int[], bool opposite=<default>)(Label format=<default>, string ticklabel(real)=<default>, bool beginlabel=<default>, bool endlabel=<default>, real[] Ticks, real[] ticks=<default>, real Size=<default>, real size=<default>, bool extend=<default>, pen pTick=<default>, pen ptick=<default>); +void Ticks(frame, transform, Label, pair, path, path, pen, bool(picture, path, pen, marginT(path, pen)), marginT(path, pen), ticklocate, int[], bool opposite=<default>); +string noprimary; +void xequals(picture pic=<default>, Label L=<default>, real x, bool extend=<default>, real ymin=<default>, real ymax=<default>, pen p=<default>, void ticks(frame, transform, Label, pair, path, path, pen, bool(picture, path, pen, marginT(path, pen)), marginT(path, pen), ticklocate, int[], bool opposite=<default>)=<default>, bool arrow(picture, path, pen, marginT(path, pen))=<default>, marginT margin(path, pen)=<default>, bool above=<default>); +void yequals(picture pic=<default>, Label L=<default>, real y, bool extend=<default>, real xmin=<default>, real xmax=<default>, pen p=<default>, void ticks(frame, transform, Label, pair, path, path, pen, bool(picture, path, pen, marginT(path, pen)), marginT(path, pen), ticklocate, int[], bool opposite=<default>)=<default>, bool arrow(picture, path, pen, marginT(path, pen))=<default>, marginT margin(path, pen)=<default>, bool above=<default>); +pair Scale(picture pic=<default>, pair z); +real ScaleX(picture pic=<default>, real x); +real ScaleY(picture pic=<default>, real y); +tickvalues generateticks(int sign, Label F=<default>, string ticklabel(real)=<default>, int N, int n=<default>, real Step=<default>, real step=<default>, real Size=<default>, real size=<default>, transform T, pair side, path g, real limit, pen p, ticklocate locate, int[] divisor, bool opposite); +void checkconditionlength(int x, int y); +real xtrans(transform t, real x); +void Top(picture, axisT)(bool extend=<default>); +void Top(picture, axisT); +real ytrans(transform t, real y); +void scale(picture pic=<default>, scaleT x, scaleT y=<default>, scaleT z=<default>); +void scale(picture pic=<default>, bool xautoscale=<default>, bool yautoscale=<default>, bool zautoscale=<default>); +int[] divisors(int a, int b); +scientific operator init(); +bounds operator init(); +ticklocate operator init(); +locateT operator init(); +tickvalues operator init(); +axisT operator init(); +path[] segment(pair[] z, bool[] cond, guide join(... guide[])=<default>); +int Both; +void axes(picture pic=<default>, Label xlabel=<default>, Label ylabel=<default>, pair min=<default>, pair max=<default>, pen p=<default>, bool arrow(picture, path, pen, marginT(path, pen))=<default>, marginT margin(path, pen)=<default>, bool above=<default>); +string signedtrailingzero; +ticklocate ticklocate(real a, real b, autoscaleT S=<default>, real tickmin=<default>, real tickmax=<default>, real time(real)=<default>, pair dir(real)=<default>); +pair ticklabelshift(pair align, pen p=<default>); +pair zero(real); +void Bottom(picture, axisT)(bool extend=<default>); +void Bottom(picture, axisT); +void BottomTop(picture, axisT)(bool extend=<default>); +void BottomTop(picture, axisT); +real zerotickfuzz; +real upscale(real b, real a); +bool logaxiscoverage(int N, transform T, path g, ticklocate locate, pair side, int sign, real Size, Label F, string ticklabel(real), real limit, int first, int last); +string baselinetemplate; +void NoTicks(frame, transform, Label, pair, path, path, pen, bool(picture, path, pen, marginT(path, pen)), marginT(path, pen), ticklocate, int[], bool opposite=<default>)(); +void NoTicks(frame, transform, Label, pair, path, path, pen, bool(picture, path, pen, marginT(path, pen)), marginT(path, pen), ticklocate, int[], bool opposite=<default>); +void tick(picture pic=<default>, pair z, pair dir, real size=<default>, pen p=<default>); +void tick(picture pic=<default>, Label L, real value, explicit pair z, pair dir, string format=<default>, real size=<default>, pen p=<default>); +int Value; +scaleT Log; +scaleT Log(bool automin=<default>, bool automax=<default>); +void Right(picture, axisT)(bool extend=<default>); +void Right(picture, axisT); +void RightTicks(frame, transform, Label, pair, path, path, pen, bool(picture, path, pen, marginT(path, pen)), marginT(path, pen), ticklocate, int[], bool opposite=<default>)(Label format=<default>, string ticklabel(real)=<default>, bool beginlabel=<default>, bool endlabel=<default>, int N=<default>, int n=<default>, real Step=<default>, real step=<default>, bool begin=<default>, bool end=<default>, tickvalues modify(tickvalues)=<default>, real Size=<default>, real size=<default>, bool extend=<default>, pen pTick=<default>, pen ptick=<default>); +void RightTicks(frame, transform, Label, pair, path, path, pen, bool(picture, path, pen, marginT(path, pen)), marginT(path, pen), ticklocate, int[], bool opposite=<default>)(Label format=<default>, string ticklabel(real)=<default>, bool beginlabel=<default>, bool endlabel=<default>, real[] Ticks, real[] ticks=<default>, real Size=<default>, real size=<default>, bool extend=<default>, pen pTick=<default>, pen ptick=<default>); +void RightTicks(frame, transform, Label, pair, path, path, pen, bool(picture, path, pen, marginT(path, pen)), marginT(path, pen), ticklocate, int[], bool opposite=<default>); +int Max; +void XZero(picture, axisT)(bool extend=<default>); +void XZero(picture, axisT); +void YZero(picture, axisT)(bool extend=<default>); +void YZero(picture, axisT); +bounds autoscale(real Min, real Max, scaleT scale=<default>); +void autoscale(picture pic=<default>, void axis(picture, axisT)); +guide Spline(... guide[]); +void LeftRight(picture, axisT)(bool extend=<default>); +void LeftRight(picture, axisT); +locateT operator init(); +void Straight(flatguide3)(... void(flatguide3)[]); +void graph(flatguide3)(triple F(real), real, real, int)(void join(flatguide3)(... void(flatguide3)[])); +void(flatguide3)[] graph(triple F(real), real, real, int)(void join(flatguide3)(... void(flatguide3)[]), bool3 cond(real)); +void graph(flatguide3)(picture pic=<default>, real x(real), real y(real), real z(real), real a, real b, int n=<default>, void join(flatguide3)(... void(flatguide3)[])=<default>); +void(flatguide3)[] graph(picture pic=<default>, real x(real), real y(real), real z(real), real a, real b, int n=<default>, bool3 cond(real), void join(flatguide3)(... void(flatguide3)[])=<default>); +void graph(flatguide3)(picture pic=<default>, triple v(real), real a, real b, int n=<default>, void join(flatguide3)(... void(flatguide3)[])=<default>); +void(flatguide3)[] graph(picture pic=<default>, triple v(real), real a, real b, int n=<default>, bool3 cond(real), void join(flatguide3)(... void(flatguide3)[])=<default>); +void graph(flatguide3)(picture pic=<default>, triple[] v, void join(flatguide3)(... void(flatguide3)[])=<default>); +void(flatguide3)[] graph(picture pic=<default>, triple[] v, bool3[] cond, void join(flatguide3)(... void(flatguide3)[])=<default>); +void graph(flatguide3)(picture pic=<default>, real[] x, real[] y, real[] z, void join(flatguide3)(... void(flatguide3)[])=<default>); +void(flatguide3)[] graph(picture pic=<default>, real[] x, real[] y, real[] z, bool3[] cond, void join(flatguide3)(... void(flatguide3)[])=<default>); +void graph(flatguide3)(triple F(path, real), path p, int n=<default>, void join(flatguide3)(... void(flatguide3)[])=<default>); +void graph(flatguide3)(triple F(pair), path p, int n=<default>, void join(flatguide3)(... void(flatguide3)[])=<default>); +void graph(flatguide3)(picture pic=<default>, real f(pair), path p, int n=<default>, void join(flatguide3)(... void(flatguide3)[])=<default>); +void graph(flatguide3)(real f(pair), path p, int n=<default>, real T(pair), void join(flatguide3)(... void(flatguide3)[])=<default>); +void(flatguide3)[][] lift(real f(real x, real y), guide[][] g, void join(flatguide3)(... void(flatguide3)[])=<default>); +void(flatguide3)[][] lift(real f(pair z), guide[][] g, void join(flatguide3)(... void(flatguide3)[])=<default>); +triple polar(real r, real theta, real phi); +void polargraph(flatguide3)(real r(real, real), real theta(real), real phi(real), int n=<default>, void join(flatguide3)(... void(flatguide3)[])=<default>); +void xaxis3At(picture pic=<default>, Label L=<default>, void axis(picture, axisT), real xmin=<default>, real xmax=<default>, pen p=<default>, void ticks(picture, real[][], Label, path3, path3, pen, bool(picture, path3, material, marginT3(path3, pen), light, light), marginT3(path3, pen), ticklocate, int[], bool opposite=<default>, bool primary=<default>)=<default>, bool arrow(picture, path3, material, marginT3(path3, pen), light, light)=<default>, marginT3 margin(path3, pen)=<default>, bool above=<default>, bool opposite=<default>, bool opposite2=<default>, bool primary=<default>); +void yaxis3At(picture pic=<default>, Label L=<default>, void axis(picture, axisT), real ymin=<default>, real ymax=<default>, pen p=<default>, void ticks(picture, real[][], Label, path3, path3, pen, bool(picture, path3, material, marginT3(path3, pen), light, light), marginT3(path3, pen), ticklocate, int[], bool opposite=<default>, bool primary=<default>)=<default>, bool arrow(picture, path3, material, marginT3(path3, pen), light, light)=<default>, marginT3 margin(path3, pen)=<default>, bool above=<default>, bool opposite=<default>, bool opposite2=<default>, bool primary=<default>); +void zaxis3At(picture pic=<default>, Label L=<default>, void axis(picture, axisT), real zmin=<default>, real zmax=<default>, pen p=<default>, void ticks(picture, real[][], Label, path3, path3, pen, bool(picture, path3, material, marginT3(path3, pen), light, light), marginT3(path3, pen), ticklocate, int[], bool opposite=<default>, bool primary=<default>)=<default>, bool arrow(picture, path3, material, marginT3(path3, pen), light, light)=<default>, marginT3 margin(path3, pen)=<default>, bool above=<default>, bool opposite=<default>, bool opposite2=<default>, bool primary=<default>); +void xaxis3(picture pic=<default>, Label L=<default>, void axis(picture, axisT)=<default>, real xmin=<default>, real xmax=<default>, pen p=<default>, void ticks(picture, real[][], Label, path3, path3, pen, bool(picture, path3, material, marginT3(path3, pen), light, light), marginT3(path3, pen), ticklocate, int[], bool opposite=<default>, bool primary=<default>)=<default>, bool arrow(picture, path3, material, marginT3(path3, pen), light, light)=<default>, marginT3 margin(path3, pen)=<default>, bool above=<default>); +void yaxis3(picture pic=<default>, Label L=<default>, void axis(picture, axisT)=<default>, real ymin=<default>, real ymax=<default>, pen p=<default>, void ticks(picture, real[][], Label, path3, path3, pen, bool(picture, path3, material, marginT3(path3, pen), light, light), marginT3(path3, pen), ticklocate, int[], bool opposite=<default>, bool primary=<default>)=<default>, bool arrow(picture, path3, material, marginT3(path3, pen), light, light)=<default>, marginT3 margin(path3, pen)=<default>, bool above=<default>); +void zaxis3(picture pic=<default>, Label L=<default>, void axis(picture, axisT)=<default>, real zmin=<default>, real zmax=<default>, pen p=<default>, void ticks(picture, real[][], Label, path3, path3, pen, bool(picture, path3, material, marginT3(path3, pen), light, light), marginT3(path3, pen), ticklocate, int[], bool opposite=<default>, bool primary=<default>)=<default>, bool arrow(picture, path3, material, marginT3(path3, pen), light, light)=<default>, marginT3 margin(path3, pen)=<default>, bool above=<default>); +bool uperiodic(triple[][] a); +bool vperiodic(triple[][] a); +void OutTicks(picture, real[][], Label, path3, path3, pen, bool(picture, path3, material, marginT3(path3, pen), light, light), marginT3(path3, pen), ticklocate, int[], bool opposite=<default>, bool primary=<default>)(Label format=<default>, string ticklabel(real)=<default>, bool beginlabel=<default>, bool endlabel=<default>, int N=<default>, int n=<default>, real Step=<default>, real step=<default>, bool begin=<default>, bool end=<default>, tickvalues modify(tickvalues)=<default>, real Size=<default>, real size=<default>, bool extend=<default>, pen pTick=<default>, pen ptick=<default>); +void OutTicks(picture, real[][], Label, path3, path3, pen, bool(picture, path3, material, marginT3(path3, pen), light, light), marginT3(path3, pen), ticklocate, int[], bool opposite=<default>, bool primary=<default>)(Label format=<default>, string ticklabel(real)=<default>, bool beginlabel=<default>, bool endlabel=<default>, real[] Ticks, real[] ticks=<default>, real Size=<default>, real size=<default>, bool extend=<default>, pen pTick=<default>, pen ptick=<default>); +void OutTicks(picture, real[][], Label, path3, path3, pen, bool(picture, path3, material, marginT3(path3, pen), light, light), marginT3(path3, pen), ticklocate, int[], bool opposite=<default>, bool primary=<default>); +void axis(picture pic=<default>, Label L=<default>, path3 g, path3 g2=<default>, pen p=<default>, void ticks(picture, real[][], Label, path3, path3, pen, bool(picture, path3, material, marginT3(path3, pen), light, light), marginT3(path3, pen), ticklocate, int[], bool opposite=<default>, bool primary=<default>), ticklocate locate, bool arrow(picture, path3, material, marginT3(path3, pen), light, light)=<default>, marginT3 margin(path3, pen)=<default>, int[] divisor=<default>, bool above=<default>, bool opposite=<default>); +void Bounds(picture, axisT)(int type=<default>, int type2=<default>, triple align=<default>, bool extend=<default>); +void Bounds(picture, axisT); +void XZZero(picture, axisT)(triple align=<default>, bool extend=<default>); +void XZZero(picture, axisT); +void YZZero(picture, axisT)(triple align=<default>, bool extend=<default>); +void YZZero(picture, axisT); +surface surface(triple[][] f, bool[][] cond=<default>); +surface surface(real[][] f, real[] x, real[] y, real[] xsplinetype(real[], real[])=<default>, real[] ysplinetype(real[], real[])=<default>, bool[][] cond=<default>); +surface surface(real[][] f, pair a, pair b, real[] xsplinetype(real[], real[]), real[] ysplinetype(real[], real[])=<default>, bool[][] cond=<default>); +surface surface(real[][] f, pair a, pair b, bool[][] cond=<default>); +surface surface(triple f(pair z), pair a, pair b, int nu=<default>, int nv=<default>, bool cond(pair z)=<default>); +surface surface(triple f(pair z), pair a, pair b, int nu=<default>, int nv=<default>, real[](real[], real[])[] usplinetype, real[](real[], real[])[] vsplinetype=<default>, bool cond(pair z)=<default>); +surface surface(real f(pair z), pair a, pair b, int nx=<default>, int ny=<default>, bool cond(pair z)=<default>); +surface surface(real f(pair z), pair a, pair b, int nx=<default>, int ny=<default>, real[] xsplinetype(real[], real[]), real[] ysplinetype(real[], real[])=<default>, bool cond(pair z)=<default>); +void XYEquals(picture, axisT)(real x, real y, triple align=<default>, bool extend=<default>); +triple Dir(real)(triple dir); +void draw(picture pic=<default>, Label[] L=<default>, void(flatguide3)[][] g, pen[] p, light light=<default>, string name=<default>, render render=<default>, interaction interaction=<default>); +void draw(picture pic=<default>, Label[] L=<default>, void(flatguide3)[][] g, pen p=<default>, light light=<default>, string name=<default>, render render=<default>, interaction interaction=<default>); +void Ticks3(picture, real[][], Label, path3, path3, pen, bool(picture, path3, material, marginT3(path3, pen), light, light), marginT3(path3, pen), ticklocate, int[], bool opposite=<default>, bool primary=<default>)(int sign, Label F=<default>, string ticklabel(real)=<default>, bool beginlabel=<default>, bool endlabel=<default>, real[] Ticks=<default>, real[] ticks=<default>, int N=<default>, bool begin=<default>, bool end=<default>, real Size=<default>, real size=<default>, bool extend=<default>, pen pTick=<default>, pen ptick=<default>); +void Ticks3(picture, real[][], Label, path3, path3, pen, bool(picture, path3, material, marginT3(path3, pen), light, light), marginT3(path3, pen), ticklocate, int[], bool opposite=<default>, bool primary=<default>)(int sign, Label F=<default>, string ticklabel(real)=<default>, bool beginlabel=<default>, bool endlabel=<default>, int N, int n=<default>, real Step=<default>, real step=<default>, bool begin=<default>, bool end=<default>, tickvalues modify(tickvalues)=<default>, real Size=<default>, real size=<default>, bool extend=<default>, pen pTick=<default>, pen ptick=<default>); +real maxlength(triple f(pair z), pair a, pair b, int nu, int nv); +void drawtick(picture pic, real[][] T, path3 g, path3 g2, ticklocate locate, real val, real Size, int sign, pen p, bool extend); +triple tickMin3(picture pic); +triple tickMax3(picture pic); +triple Scale(picture pic=<default>, triple v); +real ScaleZ(picture pic=<default>, real z); +picture vectorfield(path3 vector(pair v), triple f(pair z), pair a, pair b, int nu=<default>, int nv=<default>, bool truesize=<default>, real maxlength=<default>, bool cond(pair z)=<default>, pen p=<default>, bool arrow(picture, path3, material, marginT3(path3, pen), light, light)=<default>, marginT3 margin(path3, pen)=<default>, string name=<default>, render render=<default>); +path3 Circle(triple c, real r, triple normal=<default>, int n=<default>); +void InTicks(picture, real[][], Label, path3, path3, pen, bool(picture, path3, material, marginT3(path3, pen), light, light), marginT3(path3, pen), ticklocate, int[], bool opposite=<default>, bool primary=<default>)(Label format=<default>, string ticklabel(real)=<default>, bool beginlabel=<default>, bool endlabel=<default>, int N=<default>, int n=<default>, real Step=<default>, real step=<default>, bool begin=<default>, bool end=<default>, tickvalues modify(tickvalues)=<default>, real Size=<default>, real size=<default>, bool extend=<default>, pen pTick=<default>, pen ptick=<default>); +void InTicks(picture, real[][], Label, path3, path3, pen, bool(picture, path3, material, marginT3(path3, pen), light, light), marginT3(path3, pen), ticklocate, int[], bool opposite=<default>, bool primary=<default>)(Label format=<default>, string ticklabel(real)=<default>, bool beginlabel=<default>, bool endlabel=<default>, real[] Ticks, real[] ticks=<default>, real Size=<default>, real size=<default>, bool extend=<default>, pen pTick=<default>, pen ptick=<default>); +void InTicks(picture, real[][], Label, path3, path3, pen, bool(picture, path3, material, marginT3(path3, pen), light, light), marginT3(path3, pen), ticklocate, int[], bool opposite=<default>, bool primary=<default>); +void Spline(flatguide3)(... void(flatguide3)[]); +void InOutTicks(picture, real[][], Label, path3, path3, pen, bool(picture, path3, material, marginT3(path3, pen), light, light), marginT3(path3, pen), ticklocate, int[], bool opposite=<default>, bool primary=<default>)(Label format=<default>, string ticklabel(real)=<default>, bool beginlabel=<default>, bool endlabel=<default>, int N=<default>, int n=<default>, real Step=<default>, real step=<default>, bool begin=<default>, bool end=<default>, tickvalues modify(tickvalues)=<default>, real Size=<default>, real size=<default>, bool extend=<default>, pen pTick=<default>, pen ptick=<default>); +void InOutTicks(picture, real[][], Label, path3, path3, pen, bool(picture, path3, material, marginT3(path3, pen), light, light), marginT3(path3, pen), ticklocate, int[], bool opposite=<default>, bool primary=<default>)(Label format=<default>, string ticklabel(real)=<default>, bool beginlabel=<default>, bool endlabel=<default>, real[] Ticks, real[] ticks=<default>, real Size=<default>, real size=<default>, bool extend=<default>, pen pTick=<default>, pen ptick=<default>); +void InOutTicks(picture, real[][], Label, path3, path3, pen, bool(picture, path3, material, marginT3(path3, pen), light, light), marginT3(path3, pen), ticklocate, int[], bool opposite=<default>, bool primary=<default>); +void axes3(picture pic=<default>, Label xlabel=<default>, Label ylabel=<default>, Label zlabel=<default>, triple min=<default>, triple max=<default>, pen p=<default>, bool arrow(picture, path3, material, marginT3(path3, pen), light, light)=<default>, marginT3 margin(path3, pen)=<default>); +void label(picture pic, Label L, triple v, real x, align align, string format, pen p); +void labelx(picture pic=<default>, Label L=<default>, triple v, align align=<default>, string format=<default>, pen p=<default>); +void labely(picture pic=<default>, Label L=<default>, triple v, align align=<default>, string format=<default>, pen p=<default>); +void labeltick(picture pic, real[][] T, path3 g, ticklocate locate, real val, int sign, real Size, string ticklabel(real), Label F, real norm=<default>); +void labelaxis(picture pic, real[][] T, Label L, path3 g, ticklocate locate=<default>, int sign=<default>, bool ticklabels=<default>); +void labelx3(picture pic=<default>, Label L=<default>, real x, align align=<default>, string format=<default>, pen p=<default>); +void labely3(picture pic=<default>, Label L=<default>, real y, align align=<default>, string format=<default>, pen p=<default>); +void labelz(picture pic=<default>, Label L=<default>, triple v, align align=<default>, string format=<default>, pen p=<default>); +void labelz3(picture pic=<default>, Label L=<default>, real z, align align=<default>, string format=<default>, pen p=<default>); +void autoscale3(picture pic=<default>, void axis(picture, axisT)); +void xtick(picture pic=<default>, triple v, triple dir=<default>, real size=<default>, pen p=<default>); +void xtick(picture pic=<default>, Label L, triple v, triple dir=<default>, string format=<default>, real size=<default>, pen p=<default>); +void ytick(picture pic=<default>, triple v, triple dir=<default>, real size=<default>, pen p=<default>); +void ytick(picture pic=<default>, Label L, triple v, triple dir=<default>, string format=<default>, real size=<default>, pen p=<default>); +void xtick3(picture pic=<default>, real x, triple dir=<default>, real size=<default>, pen p=<default>); +void xtick3(picture pic=<default>, Label L, real x, triple dir=<default>, string format=<default>, real size=<default>, pen p=<default>); +void ytick3(picture pic=<default>, real y, triple dir=<default>, real size=<default>, pen p=<default>); +void ytick3(picture pic=<default>, Label L, real y, triple dir=<default>, string format=<default>, real size=<default>, pen p=<default>); +void ztick(picture pic=<default>, triple v, triple dir=<default>, real size=<default>, pen p=<default>); +void ztick(picture pic=<default>, Label L, triple v, triple dir=<default>, string format=<default>, real size=<default>, pen p=<default>); +void ztick3(picture pic=<default>, real z, triple dir=<default>, real size=<default>, pen p=<default>); +void ztick3(picture pic=<default>, Label L, real z, triple dir=<default>, string format=<default>, real size=<default>, pen p=<default>); +triple zero3(real); +triple defaultdir(triple X, triple Y, triple Z, bool opposite=<default>, projection P); +real xtrans(real[][] t, real x); +real ytrans(real[][] t, real y); +real ztrans(real[][] t, real z); +ticklocate ticklocate(real a, real b, autoscaleT S=<default>, real tickmin=<default>, real tickmax=<default>, real time(real)=<default>, triple dir(real)); +triple ticklabelshift(triple align, pen p=<default>); +path3 Arc(triple c, triple v1, triple v2, triple normal=<default>, bool direction=<default>, int n=<default>); +path3 Arc(triple c, real r, real theta1, real phi1, real theta2, real phi2, triple normal=<default>, bool direction, int n=<default>); +path3 Arc(triple c, real r, real theta1, real phi1, real theta2, real phi2, triple normal=<default>, int n=<default>); +void limits(picture pic=<default>, triple min, triple max); +void XZEquals(picture, axisT)(real x, real z, triple align=<default>, bool extend=<default>); +void YZEquals(picture, axisT)(real y, real z, triple align=<default>, bool extend=<default>); +void XYZero(picture, axisT)(triple align=<default>, bool extend=<default>); +void XYZero(picture, axisT); +void zlimits(picture pic=<default>, real min=<default>, real max=<default>, bool crop=<default>); +void tick(picture pic=<default>, triple v, triple dir, real size=<default>, pen p=<default>); +void tick(picture pic=<default>, Label L, real value, triple v, triple dir, string format=<default>, real size=<default>, pen p=<default>); +surface bispline(real[][] z, real[][] p, real[][] q, real[][] r, real[] x, real[] y, bool[][] cond=<default>); +path3[] segment(triple[] v, bool[] cond, void join(flatguide3)(... void(flatguide3)[])=<default>); +void NoTicks3(picture, real[][], Label, path3, path3, pen, bool(picture, path3, material, marginT3(path3, pen), light, light), marginT3(path3, pen), ticklocate, int[], bool opposite=<default>, bool primary=<default>)(); +void NoTicks3(picture, real[][], Label, path3, path3, pen, bool(picture, path3, material, marginT3(path3, pen), light, light), marginT3(path3, pen), ticklocate, int[], bool opposite=<default>, bool primary=<default>); +bool Crop; +int ngraph; +real epsilon; +real axiscoverage; +real Ticksize; +bool NoCrop; +real ticksize; +int nCircle; +int nmesh; +real ylabelwidth; +real axislabelfactor; +real[] clamped(real[], real[])(real slopea, real slopeb); +real[] natural(real[] x, real[] y); +real[] monotonic(real[] x, real[] y); +real[] notaknot(real[] x, real[] y); +real[] linear(real[] x, real[] y); +string morepoints; +guide hermite(real[] x, real[] y, real[] splinetype(real[], real[])=<default>); +void checklengths(int x, int y, string text=<default>); +void checkincreasing(real[] x); +real[] periodic(real[] x, real[] y); +string differentlengths; +real[] Spline(real[] x, real[] y); +real[](real[], real[])[] Spline; +grid3(picture pic)[] YXYgrid(position pos=<default>); +grid3(picture pic)[] YXYgrid; +grid3 operator init(); +ticksgridT operator init(); +grid3(picture pic)[] operator cast(grid3 gridroutine(picture pic)); +grid3(picture pic)[][] operator cast(grid3(picture pic)[] gridroutine); +grid3(picture pic)[][] operator cast(grid3 gridroutine(picture pic)); +triple X(picture pic); +triple Y(picture pic); +triple Z(picture pic); +grid3(picture pic)[] XYXgrid(position pos=<default>); +grid3(picture pic)[] XYXgrid; +grid3(picture pic)[] XY_XZgrid(position posa=<default>, position posb=<default>); +grid3(picture pic)[] XY_XZgrid; +grid3(picture pic)[] ZX_ZYgrid(position posa=<default>, position posb=<default>); +grid3(picture pic)[] ZX_ZYgrid; +grid3 XYgrid(picture pic)(position pos=<default>); +grid3 XYgrid(picture pic); +grid3 ZYgrid(picture pic)(position pos=<default>); +grid3 ZYgrid(picture pic); +void xaxis3(picture pic=<default>, Label L=<default>, void axis(picture, axisT)=<default>, pen p=<default>, ticksgridT ticks(), bool arrow(picture, path3, material, marginT3(path3, pen), light, light)=<default>, bool above=<default>); +void yaxis3(picture pic=<default>, Label L=<default>, void axis(picture, axisT)=<default>, pen p=<default>, ticksgridT ticks(), bool arrow(picture, path3, material, marginT3(path3, pen), light, light)=<default>, bool above=<default>); +void zaxis3(picture pic=<default>, Label L=<default>, void axis(picture, axisT)=<default>, pen p=<default>, ticksgridT ticks(), bool arrow(picture, path3, material, marginT3(path3, pen), light, light)=<default>, bool above=<default>); +void grid3(picture pic=<default>, grid3(picture pic)[][] gridroutine=<default>, int N=<default>, int n=<default>, real Step=<default>, real step=<default>, bool begin=<default>, bool end=<default>, pen pGrid=<default>, pen pgrid=<default>, bool above=<default>); +void grid3(picture pic=<default>, grid3(picture pic)[][] gridroutine, int N=<default>, int n=<default>, real Step=<default>, real step=<default>, bool begin=<default>, bool end=<default>, pen[] pGrid, pen[] pgrid, bool above=<default>); +ticksgridT OutTicks()(Label F=<default>, string ticklabel(real)=<default>, bool beginlabel=<default>, bool endlabel=<default>, int N=<default>, int n=<default>, real Step=<default>, real step=<default>, bool begin=<default>, bool end=<default>, real Size=<default>, real size=<default>, pen pTick=<default>, pen ptick=<default>, grid3(picture pic)[][] gridroutine, pen pGrid=<default>, pen pgrid=<default>); +triple YZ(picture pic); +triple ZX(picture pic); +grid3(picture pic)[] XZXgrid(position pos=<default>); +grid3(picture pic)[] XZXgrid; +grid3(picture pic)[] ZXZgrid(position pos=<default>); +grid3(picture pic)[] ZXZgrid; +position top; +ticksgridT InTicks()(Label F=<default>, string ticklabel(real)=<default>, bool beginlabel=<default>, bool endlabel=<default>, int N=<default>, int n=<default>, real Step=<default>, real step=<default>, bool begin=<default>, bool end=<default>, real Size=<default>, real size=<default>, pen pTick=<default>, pen ptick=<default>, grid3(picture pic)[][] gridroutine, pen pGrid=<default>, pen pgrid=<default>); +ticksgridT InOutTicks()(Label F=<default>, string ticklabel(real)=<default>, bool beginlabel=<default>, bool endlabel=<default>, int N=<default>, int n=<default>, real Step=<default>, real step=<default>, bool begin=<default>, bool end=<default>, real Size=<default>, real size=<default>, pen pTick=<default>, pen ptick=<default>, grid3(picture pic)[][] gridroutine, pen pGrid=<default>, pen pgrid=<default>); +grid3(picture pic)[] YX_YZgrid(position posa=<default>, position posb=<default>); +grid3(picture pic)[] YX_YZgrid; +position bottom; +grid3 YXgrid(picture pic)(position pos=<default>); +grid3 YXgrid(picture pic); +grid3 ZXgrid(picture pic)(position pos=<default>); +grid3 ZXgrid(picture pic); +grid3 XZgrid(picture pic)(position pos=<default>); +grid3 XZgrid(picture pic); +grid3 YZgrid(picture pic)(position pos=<default>); +grid3 YZgrid(picture pic); +triple XY(picture pic); +position middle; +grid3(picture pic)[][] XYZgrid(position pos=<default>); +grid3(picture pic)[][] XYZgrid; +grid3(picture pic)[] ZYZgrid(position pos=<default>); +grid3(picture pic)[] ZYZgrid; +grid3(picture pic)[] YZYgrid(position pos=<default>); +grid3(picture pic)[] YZYgrid; +real fspline(real)(real[] x, real[] y, real[] splinetype(real[], real[])=<default>); +real pwhermite(real)(real[] x, real[] y, real[] dy); +horner diffdiv(real[] x, real[] y); +horner hdiffdiv(real[] x, real[] y, real[] dy); +horner operator init(); +real fhorner(real)(horner sh); +void labelpath(frame f, Label L, path g, string justify=<default>, pen p=<default>); +void labelpath(picture pic=<default>, Label L, path g, string justify=<default>, pen p=<default>); +string LeftJustified; +string Centered; +string RightJustified; +surface labelpath(string s, path3 p, real angle=<default>, triple optional=<default>); +triple[] firstframe(path3 p, triple optional=<default>); +triple[] nextframe(path3 p, real reltimestart, triple[] start, real reltimeend, int subdiv=<default>); +real eps; +triple nextnormal(triple p, triple q); +string[] lm_infmsg; +void lm_qrfac(int m, int n, real[] a, bool pivot, int[] ipvt, real[] rdiag, real[] acnorm, real[] wa); +void lm_qrsolv(int n, real[] r, int ldr, int[] ipvt, real[] diag, real[] qtb, real[] x, real[] sdiag, real[] wa); +FitControl defaultControl; +real LM_MACHEP; +real LM_SQRT_DWARF; +real LM_SQRT_GIANT; +void lm_lmpar(int n, real[] r, int ldr, int[] ipvt, real[] diag, real[] qtb, real delta, lm_real_type par, real[] x, real[] sdiag, real[] wa1, real[] wa2); +void lm_lmdif(int m, int n, real[] x, real[] fvec, real ftol, real xtol, real gtol, int maxfev, real epsfcn, real[] diag, int mode, real factor, lm_int_type info, lm_int_type nfev, real[] fjac, int[] ipvt, real[] qtf, real[] wa1, real[] wa2, real[] wa3, real[] wa4, void evaluate(real[] par, int m_dat, real[] fvec, lm_data_type data, lm_int_type info), void printout(int n_par, real[] par, int m_dat, real[] fvec, lm_data_type data, int iflag, int iter, int nfev), lm_data_type data); +void lm_minimize(int m_dat, int n_par, real[] par, void evaluate(real[] par, int m_dat, real[] fvec, lm_data_type data, lm_int_type info), void printout(int n_par, real[] par, int m_dat, real[] fvec, lm_data_type data, int iflag, int iter, int nfev), lm_data_type data, lm_control_type control); +FitResult fit(real[] xdata, real[] ydata, real[] errors, real function(real[], real), real[] parameters, FitControl control=<default>); +FitResult fit(real[] xdata, real[] ydata, real function(real[], real), real[] parameters, FitControl control=<default>); +real lm_enorm(int n, real[] x, int offset=<default>); +lm_data_type operator init(); +lm_int_type operator init(); +lm_real_type operator init(); +lm_control_type operator init(); +FitControl operator init(); +FitResult operator init(); +real SQR(real x); +string[] lm_shortmsg; +void lm_evaluate_default(real[] par, int m_dat, real[] fvec, lm_data_type data, lm_int_type info); +string pad(string str, int count, string pad=<default>); +string pad(int num, int digits, string pad=<default>); +string pad(real num, int digits, string pad=<default>); +real LM_USERTOL; +real LM_DWARF; +void lm_print_quiet(int n_par, real[] par, int m_dat, real[] fvec, lm_data_type data, int iflag, int iter, int nfev); +void lm_print_default(int n_par, real[] par, int m_dat, real[] fvec, lm_data_type data, int iflag, int iter, int nfev); +real barmarksize(pen p=<default>); +real barmarksizefactor; +marker CrossIntervalMarker(int i=<default>, int n=<default>, real size=<default>, real space=<default>, real angle=<default>, pair offset=<default>, bool rotated=<default>, pen p=<default>, frame uniform=<default>, bool above=<default>); +marker StickIntervalMarker(int i=<default>, int n=<default>, real size=<default>, real space=<default>, real angle=<default>, pair offset=<default>, bool rotated=<default>, pen p=<default>, frame uniform=<default>, bool above=<default>); +frame crossframe(int n=<default>, real size=<default>, pair space=<default>, real angle=<default>, pair offset=<default>, pen p=<default>); +real crossmarksize(pen p=<default>); +real crossmarksizefactor; +frame stickframe(int n=<default>, real size=<default>, pair space=<default>, real angle=<default>, pair offset=<default>, pen p=<default>); +frame stickframe; +real stickmarksize(pen p=<default>); +real stickmarkspace(pen p=<default>); +real stickmarksizefactor; +real stickmarkspacefactor; +frame duplicate(path g, int n=<default>, pair space=<default>, pen p=<default>); +marker CircleBarIntervalMarker(int i=<default>, int n=<default>, real barsize=<default>, real radius=<default>, real angle=<default>, pair offset=<default>, bool rotated=<default>, pen p=<default>, filltype filltype=<default>, bool circleabove=<default>, frame uniform=<default>, bool above=<default>); +frame circlebarframe(int n=<default>, real barsize=<default>, real radius=<default>, real angle=<default>, pair offset=<default>, pen p=<default>, filltype filltype=<default>, bool above=<default>); +real circlemarkradius(pen p=<default>); +real circlemarkradiusfactor; +marker operator *(transform T, marker m); +marker TildeIntervalMarker(int i=<default>, int n=<default>, real size=<default>, real space=<default>, real angle=<default>, pair offset=<default>, bool rotated=<default>, pen p=<default>, frame uniform=<default>, bool above=<default>); +frame tildeframe(int n=<default>, real size=<default>, pair space=<default>, real angle=<default>, pair offset=<default>, pen p=<default>); +frame tildeframe; +real tildemarksize(pen p=<default>); +real tildemarksizefactor; +void markangle(picture pic=<default>, Label L=<default>, int n=<default>, real radius=<default>, real space=<default>, pair A, pair O, pair B, bool arrow(picture, path, pen, marginT(path, pen))=<default>, pen p=<default>, filltype filltype=<default>, marginT margin(path, pen)=<default>, marker marker=<default>); +real markanglespace(pen p=<default>); +real markanglespace; +real markangleradius(pen p=<default>); +real markangleradius; +real markanglespacefactor; +real markangleradiusfactor; +void markinterval(picture pic=<default>, frame f, path g)(int n=<default>, frame f, bool rotated=<default>); +real[] partialsum(real[] a); +real[] partialsum(real[] a, real[] dx); +int[] partialsum(int[] a); +int[] partialsum(int[] a, int[] dx); +real cot(real x); +int unique(real[] a, real x); +int unique(string[] a, string x); +int quadrant(real degrees); +pair exp(explicit pair z); +string nopoint; +real intersect(pair p, pair q, pair z); +real intersect(triple P, triple Q, triple n, triple Z); +real interpolate(real[] x, real[] y, real x0, int i); +real interpolate(real[] x, real[] y, real x0); +triple intersectionpoint(triple n0, triple P0, triple n1, triple P1); +pair[] quarticroots(real a, real b, real c, real d, real e); +bool lexorder(pair a, pair b); +bool lexorder(triple a, triple b); +bool square(real[][] m); +real sec(real x); +bool rectangular(real[][] m); +bool rectangular(pair[][] m); +bool rectangular(triple[][] m); +bool polygon(path p); +pair unityroot(int n, int k=<default>); +real acot(real x); +pair[][] fft(pair[][] a, int sign=<default>); +real slope(path g, real x, int n=<default>); +real slope(path g, explicit pair z, int n=<default>); +picture grid(int Nx, int Ny, pen p=<default>); +int[][] segment(bool[] b); +real frac(real x); +real asec(real x); +real time(path g, real x, int n=<default>); +real time(path g, explicit pair z, int n=<default>); +bool increasing(real[] a, bool strict=<default>); +real[] zero(int n); +real[][] zero(int n, int m); +real acsc(real x); +real value(path g, real x, int n=<default>); +real value(path g, explicit pair z, int n=<default>); +real csc(real x); +pair log(explicit pair z); +void drawline(picture pic=<default>, pair P, pair Q, pen p=<default>); +path cutbefore(path p, path q); +path cutafter(path p, path q); +path cuttings; +void draw(picture pic=<default>, obj o, light light=<default>); +obj operator *(real[][] T, obj o); +obj operator init(); +real[][] finiteDifferenceJacobian(real[] f(real[]), real[] t, real[] h=<default>); +RKTableau E_Euler; +real error(real error, real initial, real lowOrder, real norm, real diff); +RKTableau RK5; +real stepfactor; +solution integrate(real y, real c=<default>, real g(real t, real y), real a, real b=<default>, real h=<default>, int n=<default>, bool dynamic=<default>, real tolmin=<default>, real tolmax=<default>, real dtmin=<default>, real dtmax=<default>, RKTableau tableau, bool verbose=<default>); +Solution integrate(real[] y, real[] f(real t, real[] y), real a, real b=<default>, real h=<default>, int n=<default>, bool dynamic=<default>, real tolmin=<default>, real tolmax=<default>, real dtmin=<default>, real dtmax=<default>, RKTableau tableau, bool verbose=<default>); +RKTableau RK4; +real[] newton(int iterations=<default>, real[] f(real[]), real[][] jacobian(real[]), real[] t); +real phi1(real x); +RKTableau RK3; +void expfactors(real x, coefficients a); +real phi2(real x); +void report(real old, real h, real t); +real[] solveBVP(real[] f(real, real[]), real a, real b=<default>, real h=<default>, int n=<default>, bool dynamic=<default>, real tolmin=<default>, real tolmax=<default>, real dtmin=<default>, real dtmax=<default>, RKTableau tableau, bool verbose=<default>, real[] initial(real[]), real[] discrepancy(real[]), real[] guess, int iterations=<default>); +RKTableau Euler; +RKTableau E_PC; +RKTableau RK2; +real phi3(real x); +void write(solution S); +void write(Solution S); +coefficients operator init(); +RKTableau operator init(); +solution operator init(); +Solution operator init(); +RKTableau E_RK2; +RKTableau RK3BS; +RKTableau RK5F; +real adjust(real h, real error, real tolmin, real tolmax, RKTableau tableau); +RKTableau RK5DP; +real[] Coeff; +RKTableau PC; +RKTableau E_RK3BS; +pen[] Grayscale(int NColors=<default>); +pen[] Wheel(int NColors=<default>); +void image(frame f, real[][] data, pair initial, pair final, pen[] palette, bool transpose=<default>, transform t=<default>, bool copy=<default>, bool antialias=<default>); +void image(frame f, pen[][] data, pair initial, pair final, bool transpose=<default>, transform t=<default>, bool copy=<default>, bool antialias=<default>); +bounds image(picture pic=<default>, real[][] f, bounds range(picture pic, real min, real max)=<default>, pair initial, pair final, pen[] palette, bool transpose=<default>, bool copy=<default>, bool antialias=<default>); +bounds image(picture pic=<default>, real f(real, real), bounds range(picture pic, real min, real max)=<default>, pair initial, pair final, int nx=<default>, int ny=<default>, pen[] palette, bool antialias=<default>); +void image(picture pic=<default>, pen[][] data, pair initial, pair final, bool transpose=<default>, bool copy=<default>, bool antialias=<default>); +void image(picture pic=<default>, pen f(int, int), int width, int height, pair initial, pair final, bool transpose=<default>, bool antialias=<default>); +bounds image(picture pic=<default>, pair[] z, real[] f, bounds range(picture pic, real min, real max)=<default>, pen[] palette); +bounds image(picture pic=<default>, real[] x, real[] y, real[] f, bounds range(picture pic, real min, real max)=<default>, pen[] palette); +pen[] cmyk(pen[] Palette); +pen[] BWRainbow(int NColors, bool two); +pen[] BWRainbow(int NColors=<default>); +pen[] BWRainbow2(int NColors=<default>); +transform swap; +bounds Automatic(picture pic, real min, real max); +real[] sequencereal; +pen[] Rainbow(int NColors=<default>); +pen[] adjust(picture pic, real min, real max, real rmin, real rmax, pen[] palette); +pen[] Gradient(int NColors=<default> ... pen[] p); +pen[] quantize(pen[] Palette, int n); +bounds Range(picture pic, real min, real max)(bool automin=<default>, real min=<default>, bool automax=<default>, real max=<default>); +bounds Full(picture pic, real min, real max); +void PaletteTicks(frame, transform, Label, pair, path, path, pen, bool(picture, path, pen, marginT(path, pen)), marginT(path, pen), ticklocate, int[], bool opposite=<default>)(int sign=<default>)(Label format=<default>, string ticklabel(real)=<default>, bool beginlabel=<default>, bool endlabel=<default>, int N=<default>, int n=<default>, real Step=<default>, real step=<default>, pen pTick=<default>, pen ptick=<default>); +void PaletteTicks(frame, transform, Label, pair, path, path, pen, bool(picture, path, pen, marginT(path, pen)), marginT(path, pen), ticklocate, int[], bool opposite=<default>)(int sign=<default>); +pen[] palette(real[] f, pen[] palette); +pen[][] palette(real[][] f, pen[] palette); +void palette(picture pic=<default>, Label L=<default>, bounds bounds, pair initial, pair final, void axis(picture, axisT)=<default>, pen[] palette, pen p=<default>, void ticks(frame, transform, Label, pair, path, path, pen, bool(picture, path, pen, marginT(path, pen)), marginT(path, pen), ticklocate, int[], bool opposite=<default>)(int sign=<default>)=<default>, bool copy=<default>, bool antialias=<default>); +picture brick(real Hx=<default>, real Hy=<default>, pen p=<default>); +picture crosshatch(real H=<default>, pen p=<default>); +picture hatch(real H=<default>, pair dir=<default>, pen p=<default>); +real hatchepsilon; +picture checker(real Hx=<default>, real Hy=<default>, pen p=<default>); +void add(string name, picture pic, pair lb=<default>, pair rt=<default>); +frame tiling(string name, picture pic, pair lb=<default>, pair rt=<default>); +picture tile(real Hx=<default>, real Hy=<default>, pen p=<default>, filltype filltype=<default>); +void grestore(picture pic=<default>); +void gsave(picture pic=<default>); +pair align; +pen textpen; +path roundedpath(path A, real R, real S=<default>); +problem operator init(); +real infinity; +pen authorpen; +void display(frame[] f, real margin=<default>, pair align=<default>, pen p=<default>, pen figuremattpen=<default>, bool final=<default>); +void display(frame f, real margin=<default>, pair align=<default>, pen p=<default>, pen figuremattpen=<default>, bool final=<default>); +void display(string[] s, real margin=<default>, string[] captions=<default>, string caption=<default>, pair align=<default>, pen p=<default>, pen figuremattpen=<default>, bool final=<default>); +void display(string s, string caption=<default>, pair align=<default>, pen p=<default>, pen figuremattpen=<default>, bool final=<default>); +void multifigure(string[] slist, string options=<default>, string caption=<default>, pair align=<default>, pen p=<default>, pen figuremattpen=<default>, bool step=<default>); +void subitem(string s, pen p=<default>); +pen pagenumberpen; +pair pagenumberalign; +pair pagenumberposition; +void indexedfigure(string prefix, int first, int last, string options=<default>, string caption=<default>, pair align=<default>, pen p=<default>, pen figuremattpen=<default>, bool step=<default>); +string texcolor(pen p); +void color(string name, string color); +pen foregroundcolor; +void bibliography(string name); +void bibliographystyle(string name); +int[] lastnode; +void asyfigure(string s, string options=<default>, string caption=<default>, pair align=<default>, pen p=<default>, pen figuremattpen=<default>, filltype filltype=<default>, bool newslide=<default>); +void asyfilecode(bool center=<default>, string s, string options=<default>, string caption=<default>, pair align=<default>, pen p=<default>, pen figuremattpen=<default>, real indent=<default>, real skip=<default>, filltype filltype=<default>, bool newslide=<default>); +bool itemstep; +real itemskip; +void remark(bool center=<default>, string s, pair align=<default>, pen p=<default>, real indent=<default>, bool minipage=<default>, real skip=<default>, filltype filltype=<default>, bool step=<default>); +int page; +void usersetting(); +bool landscape; +real codeskip; +void newslide(bool stepping=<default>); +void nextpage(pen p=<default>); +pen itempen; +void filecode(bool center=<default>, string s, pen p=<default>, real indent=<default>, real skip=<default>, filltype filltype=<default>); +bool reverse; +void reversevideo(); +void vbox(string s, pen p=<default>); +void asycode(bool center=<default>, string s, string options=<default>, string caption=<default>, string preamble=<default>, pair align=<default>, pen p=<default>, pen figuremattpen=<default>, real indent=<default>, real skip=<default>, filltype filltype=<default>, bool newslide=<default>); +void exitfunction(); +bool havepagenumber; +real pageheight; +real pagewidth; +picture background; +void background(); +pen backgroundcolor; +void normalvideo(); +void title(string s, pair position=<default>, pair align=<default>, pen p=<default>, bool newslide=<default>); +pen titlepen; +real titleskip; +pair dateskip; +pair titlealign; +pen titlepagepen; +void titlepage(string title, string author, string institution=<default>, string date=<default>, string url=<default>, bool newslide=<default>); +pair titlepageposition; +pen codepen; +void erasestep(int erasenode); +bool checkposition(); +void setpens(pen red=<default>, pen blue=<default>, pen steppen=<default>); +void code(bool center=<default>, string s, pen p=<default>, real indent=<default>, real skip=<default>, filltype filltype=<default>); +transform tinv; +pair urlskip; +void numberpage(pen p=<default>); +pen urlpen; +void item(string s, pen p=<default>, bool step=<default>); +int[] firstnode; +bool firststep; +string asywrite(string s, string preamble=<default>); +pair startposition; +string oldbulletcolor; +string newbulletcolor; +pen datepen; +void incrementposition(pair z); +pen institutionpen; +string cropcode(string s); +void skip(real n=<default>); +bool stepping; +real pagemargin; +pen steppagenumberpen; +bool allowstepping; +pair currentposition; +bool empty(); +void currentexitfunction(); +void step(); +string[] codefile; +void outline(string s=<default>, pair position=<default>, pair align=<default>, pen p=<default>); +void center(string s, pen p=<default>); +void equation(string s, pen p=<default>); +void equations(string s, pen p=<default>); +void asyinclude(string s, real xsize=<default>, real ysize=<default>); +void figure(string[] s, string options=<default>, real margin=<default>, string[] captions=<default>, string caption=<default>, pair align=<default>, pen p=<default>, pen figuremattpen=<default>, bool final=<default>); +void figure(string s, string options=<default>, string caption=<default>, pair align=<default>, pen p=<default>, pen figuremattpen=<default>, bool final=<default>); +real figureborder; +pen figuremattpen; +string bullet; +int preamblenodes; +string bulletcolor(string color); +real minipagewidth; +real minipagemargin; +real stepfraction; +path curve(pair c, real f(real, real), pair a, pair b); +path curve(pair c, real f(real), pair a, pair b); +picture slopefield(real f(real, real), pair a, pair b, int nx=<default>, int ny=<default>, real tickfactor=<default>, pen p=<default>, bool arrow(picture, path, pen, marginT(path, pen))=<default>); +picture slopefield(real f(real), pair a, pair b, int nx=<default>, int ny=<default>, pen p=<default>, bool arrow(picture, path, pen, marginT(path, pen))=<default>); +revolution operator *(real[][] t, revolution r); +skeleton operator init(); +revolution operator init(); +revolution sphere(triple c=<default>, real r, int n=<default>); +path line(path p, path q, real[] t); +surface surface(revolution r, int n=<default>, pen color(int i, real j)=<default>); +void draw(picture pic=<default>, revolution r, int m=<default>, int n=<default>, pen frontpen=<default>, pen backpen=<default>, pen longitudinalpen=<default>, pen longitudinalbackpen=<default>, light light=<default>, string name=<default>, render render=<default>, projection P=<default>); +real[] tangent(path p, path q, bool side); +pen defaultbackpen; +path[] cylinder(path3 base, real h, triple axis=<default>, projection P); +revolution cylinder(triple c=<default>, real r, real h, triple axis=<default>); +revolution cone(triple c=<default>, real r, real h, triple axis=<default>, int n=<default>); +real rms(real[] A); +int[] frequency(real[] data, real[] bins); +int[] frequency(real[] data, real a, real b, int n); +int[][] frequency(real[] x, real[] y, real[] xbins, real[] ybins); +int[][] frequency(real[] x, real[] y, pair a, pair b, int nx, int ny=<default>); +int[][] frequency(pair[] z, pair a, pair b, int nx, int ny=<default>); +real mean(real[] A); +int bins(real[] data, int max=<default>); +real stdev(real[] A); +path topbox(pair a, pair b); +path halfbox(pair a, pair b); +real Gaussian(real x, real sigma); +real Gaussian(real x); +pair Gaussrandpair(); +real Gaussrand(); +real variance(real[] A); +real legendmarkersize; +real variancebiased(real[] A); +linefit operator init(); +real skewness(real[] A); +linefit leastsquares(real[] x, real[] y); +real kurtosis(real[] A); +real kurtosisexcess(real[] A); +void histogram(picture pic=<default>, real[] bins, real[] count, real low=<default>, pen fillpen=<default>, pen drawpen=<default>, bool bars=<default>, Label legend=<default>, real markersize=<default>); +void histogram(picture pic=<default>, real[] data, real a, real b, int n, bool normalize=<default>, real low=<default>, pen fillpen=<default>, pen drawpen=<default>, bool bars=<default>, Label legend=<default>, real markersize=<default>); +pair[] endpoints(guide[] a); +Relation r3; +picture tableau(frame[] cards, bool number=<default>); +pair min(pair[] z); +Component bp; +Braid apply(Relation r, Braid b, int step, int place); +Component phi; +real gapfactor; +Component bm; +Component wye; +Relation operator -(Relation r); +Component operator init(); +Braid operator init(); +Relation operator init(); +Syzygy operator init(); +Relation r4b; +real hwratio; +Relation r4a; +pair max(pair[] z); +pen Orchid; +pen Magenta; +pen BrickRed; +pen CadetBlue; +pen CarnationPink; +pen SpringGreen; +pen MidnightBlue; +pen OliveGreen; +pen Apricot; +pen Aquamarine; +pen Cyan; +pen Lavender; +pen Red; +pen RawSienna; +pen Mahogany; +pen Gray; +pen Plum; +pen BlueGreen; +pen Cerulean; +pen Blue; +pen BlueViolet; +pen RedOrange; +pen Goldenrod; +pen ForestGreen; +pen BurntOrange; +pen Tan; +pen YellowOrange; +pen Maroon; +pen YellowGreen; +pen Brown; +pen RubineRed; +pen TealBlue; +pen White; +pen Purple; +pen Bittersweet; +pen Orange; +pen OrangeRed; +pen Fuchsia; +pen Peach; +pen Sepia; +pen PineGreen; +pen Dandelion; +pen Black; +pen VioletRed; +pen NavyBlue; +pen Violet; +pen Rhodamine; +pen ProcessBlue; +pen LimeGreen; +pen Thistle; +pen Green; +pen GreenYellow; +pen DarkOrchid; +pen Emerald; +pen Mulberry; +pen RedViolet; +pen SkyBlue; +pen SeaGreen; +pen WildStrawberry; +pen Periwinkle; +pen Yellow; +pen JungleGreen; +pen Salmon; +pen CornflowerBlue; +pen RoyalBlue; +pen Melon; +pen RoyalPurple; +pen Turquoise; +int lookup(tree t, int key); +tree newtree(); +void write(file out=<default>, tree t); +tree operator init(); +tree add(tree t, int key, int value); +bool contains(tree t, int key); +real trembleFuzz(); +real trembleAngle; +real trembleRandom; +real trembleFrequency; +tremble operator init(); +real magneticRadius; +real[] sample(path3 g, real r, real relstep=<default>); +path3 roundedpath(path3 A, real r); +int coloredNodes; +int coloredSegments; +surface surface(rmf[] R, real[] t, coloredpath cp, transform T(real), bool cyclic); +surface tube(path3 g, coloredpath section, transform T(real)=<default>, real corner=<default>, real relstep=<default>); +coloredpath operator init(); +coloredpath operator cast(path p); +coloredpath operator cast(guide p); +real degrees(rmf a, rmf b); +string VERSION; +pen Orchid; +pen Indigo; +pen Beige; +pen SlateBlue; +pen SlateGray; +pen Magenta; +pen SteelBlue; +pen CadetBlue; +pen DeepPink; +pen SpringGreen; +pen MidnightBlue; +pen Olive; +pen OliveDrab; +pen LemonChiffon; +pen Aquamarine; +pen Chocolate; +pen Cyan; +pen Gainsboro; +pen Lavender; +pen Aqua; +pen Ivory; +pen PapayaWhip; +pen Red; +pen Pink; +pen MintCream; +pen DarkTurquoise; +pen Gray; +pen MediumBlue; +pen MediumOrchid; +pen MediumPurple; +pen MediumSeaGreen; +pen MediumSlateBlue; +pen MediumAquamarine; +pen MediumSpringGreen; +pen MediumTurquoise; +pen MediumVioletRed; +pen Plum; +pen Blue; +pen Gold; +pen Sienna; +pen BlueViolet; +pen Goldenrod; +pen ForestGreen; +pen Chartreuse; +pen NavajoWhite; +pen Tan; +pen DarkMagenta; +pen Maroon; +pen AntiqueWhite; +pen YellowGreen; +pen PaleTurquoise; +pen IndianRed; +pen Crimson; +pen Azure; +pen LawnGreen; +pen Brown; +pen BurlyWood; +pen Moccasin; +pen DarkBlue; +pen Peru; +pen White; +pen Purple; +pen WhiteSmoke; +pen DimGray; +pen DarkOliveGreen; +pen DarkOrange; +pen Orange; +pen OrangeRed; +pen Fuchsia; +pen PeachPuff; +pen Honeydew; +pen Bisque; +pen RosyBrown; +pen Silver; +pen Black; +pen Khaki; +pen FireBrick; +pen Violet; +pen Snow; +pen SandyBrown; +pen LimeGreen; +pen Lime; +pen Thistle; +pen DeepSkyBlue; +pen OldLace; +pen Green; +pen GreenYellow; +pen DarkCyan; +pen FloralWhite; +pen DarkRed; +pen DarkOrchid; +pen Cornsilk; +pen BlanchedAlmond; +pen PowderBlue; +pen DarkGray; +pen DarkGreen; +pen DarkGoldenrod; +pen SkyBlue; +pen SeaGreen; +pen DarkViolet; +pen Teal; +pen AliceBlue; +pen HotPink; +pen Seashell; +pen DodgerBlue; +pen SaddleBrown; +pen Tomato; +pen DarkKhaki; +pen GhostWhite; +pen LightBlue; +pen LightCoral; +pen LightCyan; +pen Yellow; +pen LightGreen; +pen PaleGreen; +pen Linen; +pen LightGoldenrodYellow; +pen LightGrey; +pen LightPink; +pen PaleGoldenrod; +pen LightSalmon; +pen LightSeaGreen; +pen Navy; +pen LightSkyBlue; +pen LightSlateGray; +pen PaleVioletRed; +pen Salmon; +pen LightSteelBlue; +pen LightYellow; +pen CornflowerBlue; +pen rgbint(int r, int g, int b); +pen Coral; +pen MistyRose; +pen LavenderBlush; +pen DarkSalmon; +pen Wheat; +pen DarkSeaGreen; +pen RoyalBlue; +pen DarkSlateBlue; +pen DarkSlateGray; +pen Turquoise; diff --git a/Build/source/utils/asymptote/asymptote.nsi b/Build/source/utils/asymptote/asymptote.nsi index 953b44e6346..2ab28843c1b 100644 --- a/Build/source/utils/asymptote/asymptote.nsi +++ b/Build/source/utils/asymptote/asymptote.nsi @@ -15,6 +15,7 @@ XPStyle On !include "MUI.nsh" !include "LogicLib.nsh" !include "EnvVarUpdate.nsh" +!include "lnkX64IconFix.nsh" ; MUI Settings !define MUI_ABORTWARNING @@ -109,7 +110,9 @@ Section "Asymptote" SEC01 CreateDirectory "$SMPROGRAMS\$ICONS_GROUP" SetOutPath "%USERPROFILE%" CreateShortCut "$SMPROGRAMS\$ICONS_GROUP\Asymptote.lnk" "$INSTDIR\asy.bat" "" "$INSTDIR\asy.ico" + ${lnkX64IconFix} "$SMPROGRAMS\$ICONS_GROUP\Asymptote.lnk" CreateShortCut "$DESKTOP\Asymptote.lnk" "$INSTDIR\asy.bat" "" "$INSTDIR\asy.ico" + ${lnkX64IconFix} "$DESKTOP\Asymptote.lnk" CreateShortCut "$DESKTOP\Xasy.lnk" "$INSTDIR\xasy.py" CreateShortCut "$SMPROGRAMS\$ICONS_GROUP\Xasy.lnk" "$INSTDIR\xasy.py" SetOutPath "$INSTDIR" diff --git a/Build/source/utils/asymptote/asymptote.spec b/Build/source/utils/asymptote/asymptote.spec index 752681f4d22..b3ec070547b 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.13 +Version: 2.16 Release: 1%{?dist} Summary: Descriptive vector graphics language diff --git a/Build/source/utils/asymptote/ax_pthread.m4 b/Build/source/utils/asymptote/ax_pthread.m4 new file mode 100644 index 00000000000..d90de34d14b --- /dev/null +++ b/Build/source/utils/asymptote/ax_pthread.m4 @@ -0,0 +1,309 @@ +# =========================================================================== +# http://www.gnu.org/software/autoconf-archive/ax_pthread.html +# =========================================================================== +# +# SYNOPSIS +# +# AX_PTHREAD([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]]) +# +# DESCRIPTION +# +# This macro figures out how to build C programs using POSIX threads. It +# sets the PTHREAD_LIBS output variable to the threads library and linker +# flags, and the PTHREAD_CFLAGS output variable to any special C compiler +# flags that are needed. (The user can also force certain compiler +# flags/libs to be tested by setting these environment variables.) +# +# Also sets PTHREAD_CC to any special C compiler that is needed for +# multi-threaded programs (defaults to the value of CC otherwise). (This +# is necessary on AIX to use the special cc_r compiler alias.) +# +# NOTE: You are assumed to not only compile your program with these flags, +# but also link it with them as well. e.g. you should link with +# $PTHREAD_CC $CFLAGS $PTHREAD_CFLAGS $LDFLAGS ... $PTHREAD_LIBS $LIBS +# +# If you are only building threads programs, you may wish to use these +# variables in your default LIBS, CFLAGS, and CC: +# +# LIBS="$PTHREAD_LIBS $LIBS" +# CFLAGS="$CFLAGS $PTHREAD_CFLAGS" +# CC="$PTHREAD_CC" +# +# In addition, if the PTHREAD_CREATE_JOINABLE thread-attribute constant +# has a nonstandard name, defines PTHREAD_CREATE_JOINABLE to that name +# (e.g. PTHREAD_CREATE_UNDETACHED on AIX). +# +# Also HAVE_PTHREAD_PRIO_INHERIT is defined if pthread is found and the +# PTHREAD_PRIO_INHERIT symbol is defined when compiling with +# PTHREAD_CFLAGS. +# +# ACTION-IF-FOUND is a list of shell commands to run if a threads library +# is found, and ACTION-IF-NOT-FOUND is a list of commands to run it if it +# is not found. If ACTION-IF-FOUND is not specified, the default action +# will define HAVE_PTHREAD. +# +# Please let the authors know if this macro fails on any platform, or if +# you have any other suggestions or comments. This macro was based on work +# by SGJ on autoconf scripts for FFTW (http://www.fftw.org/) (with help +# from M. Frigo), as well as ac_pthread and hb_pthread macros posted by +# Alejandro Forero Cuervo to the autoconf macro repository. We are also +# grateful for the helpful feedback of numerous users. +# +# Updated for Autoconf 2.68 by Daniel Richard G. +# +# LICENSE +# +# Copyright (c) 2008 Steven G. Johnson <stevenj@alum.mit.edu> +# Copyright (c) 2011 Daniel Richard G. <skunk@iSKUNK.ORG> +# +# This program is free software: you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by the +# Free Software Foundation, either version 3 of the License, or (at your +# option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General +# Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program. If not, see <http://www.gnu.org/licenses/>. +# +# As a special exception, the respective Autoconf Macro's copyright owner +# gives unlimited permission to copy, distribute and modify the configure +# scripts that are the output of Autoconf when processing the Macro. You +# need not follow the terms of the GNU General Public License when using +# or distributing such scripts, even though portions of the text of the +# Macro appear in them. The GNU General Public License (GPL) does govern +# all other use of the material that constitutes the Autoconf Macro. +# +# This special exception to the GPL applies to versions of the Autoconf +# Macro released by the Autoconf Archive. When you make and distribute a +# modified version of the Autoconf Macro, you may extend this special +# exception to the GPL to apply to your modified version as well. + +#serial 18 + +AU_ALIAS([ACX_PTHREAD], [AX_PTHREAD]) +AC_DEFUN([AX_PTHREAD], [ +AC_REQUIRE([AC_CANONICAL_HOST]) +AC_LANG_PUSH([C]) +ax_pthread_ok=no + +# We used to check for pthread.h first, but this fails if pthread.h +# requires special compiler flags (e.g. on True64 or Sequent). +# It gets checked for in the link test anyway. + +# First of all, check if the user has set any of the PTHREAD_LIBS, +# etcetera environment variables, and if threads linking works using +# them: +if test x"$PTHREAD_LIBS$PTHREAD_CFLAGS" != x; then + save_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS $PTHREAD_CFLAGS" + save_LIBS="$LIBS" + LIBS="$PTHREAD_LIBS $LIBS" + AC_MSG_CHECKING([for pthread_join in LIBS=$PTHREAD_LIBS with CFLAGS=$PTHREAD_CFLAGS]) + AC_TRY_LINK_FUNC(pthread_join, ax_pthread_ok=yes) + AC_MSG_RESULT($ax_pthread_ok) + if test x"$ax_pthread_ok" = xno; then + PTHREAD_LIBS="" + PTHREAD_CFLAGS="" + fi + LIBS="$save_LIBS" + CFLAGS="$save_CFLAGS" +fi + +# We must check for the threads library under a number of different +# names; the ordering is very important because some systems +# (e.g. DEC) have both -lpthread and -lpthreads, where one of the +# libraries is broken (non-POSIX). + +# Create a list of thread flags to try. Items starting with a "-" are +# C compiler flags, and other items are library names, except for "none" +# which indicates that we try without any flags at all, and "pthread-config" +# which is a program returning the flags for the Pth emulation library. + +ax_pthread_flags="pthreads none -Kthread -kthread lthread -pthread -pthreads -mthreads pthread --thread-safe -mt pthread-config" + +# The ordering *is* (sometimes) important. Some notes on the +# individual items follow: + +# pthreads: AIX (must check this before -lpthread) +# none: in case threads are in libc; should be tried before -Kthread and +# other compiler flags to prevent continual compiler warnings +# -Kthread: Sequent (threads in libc, but -Kthread needed for pthread.h) +# -kthread: FreeBSD kernel threads (preferred to -pthread since SMP-able) +# lthread: LinuxThreads port on FreeBSD (also preferred to -pthread) +# -pthread: Linux/gcc (kernel threads), BSD/gcc (userland threads) +# -pthreads: Solaris/gcc +# -mthreads: Mingw32/gcc, Lynx/gcc +# -mt: Sun Workshop C (may only link SunOS threads [-lthread], but it +# doesn't hurt to check since this sometimes defines pthreads too; +# also defines -D_REENTRANT) +# ... -mt is also the pthreads flag for HP/aCC +# pthread: Linux, etcetera +# --thread-safe: KAI C++ +# pthread-config: use pthread-config program (for GNU Pth library) + +case ${host_os} in + solaris*) + + # On Solaris (at least, for some versions), libc contains stubbed + # (non-functional) versions of the pthreads routines, so link-based + # tests will erroneously succeed. (We need to link with -pthreads/-mt/ + # -lpthread.) (The stubs are missing pthread_cleanup_push, or rather + # a function called by this macro, so we could check for that, but + # who knows whether they'll stub that too in a future libc.) So, + # we'll just look for -pthreads and -lpthread first: + + ax_pthread_flags="-pthreads pthread -mt -pthread $ax_pthread_flags" + ;; + + darwin*) + ax_pthread_flags="-pthread $ax_pthread_flags" + ;; +esac + +if test x"$ax_pthread_ok" = xno; then +for flag in $ax_pthread_flags; do + + case $flag in + none) + AC_MSG_CHECKING([whether pthreads work without any flags]) + ;; + + -*) + AC_MSG_CHECKING([whether pthreads work with $flag]) + PTHREAD_CFLAGS="$flag" + ;; + + pthread-config) + AC_CHECK_PROG(ax_pthread_config, pthread-config, yes, no) + if test x"$ax_pthread_config" = xno; then continue; fi + PTHREAD_CFLAGS="`pthread-config --cflags`" + PTHREAD_LIBS="`pthread-config --ldflags` `pthread-config --libs`" + ;; + + *) + AC_MSG_CHECKING([for the pthreads library -l$flag]) + PTHREAD_LIBS="-l$flag" + ;; + esac + + save_LIBS="$LIBS" + save_CFLAGS="$CFLAGS" + LIBS="$PTHREAD_LIBS $LIBS" + CFLAGS="$CFLAGS $PTHREAD_CFLAGS" + + # Check for various functions. We must include pthread.h, + # since some functions may be macros. (On the Sequent, we + # need a special flag -Kthread to make this header compile.) + # We check for pthread_join because it is in -lpthread on IRIX + # while pthread_create is in libc. We check for pthread_attr_init + # due to DEC craziness with -lpthreads. We check for + # pthread_cleanup_push because it is one of the few pthread + # functions on Solaris that doesn't have a non-functional libc stub. + # We try pthread_create on general principles. + AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <pthread.h> + static void routine(void *a) { a = 0; } + static void *start_routine(void *a) { return a; }], + [pthread_t th; pthread_attr_t attr; + pthread_create(&th, 0, start_routine, 0); + pthread_join(th, 0); + pthread_attr_init(&attr); + pthread_cleanup_push(routine, 0); + pthread_cleanup_pop(0) /* ; */])], + [ax_pthread_ok=yes], + []) + + LIBS="$save_LIBS" + CFLAGS="$save_CFLAGS" + + AC_MSG_RESULT($ax_pthread_ok) + if test "x$ax_pthread_ok" = xyes; then + break; + fi + + PTHREAD_LIBS="" + PTHREAD_CFLAGS="" +done +fi + +# Various other checks: +if test "x$ax_pthread_ok" = xyes; then + save_LIBS="$LIBS" + LIBS="$PTHREAD_LIBS $LIBS" + save_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS $PTHREAD_CFLAGS" + + # Detect AIX lossage: JOINABLE attribute is called UNDETACHED. + AC_MSG_CHECKING([for joinable pthread attribute]) + attr_name=unknown + for attr in PTHREAD_CREATE_JOINABLE PTHREAD_CREATE_UNDETACHED; do + AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <pthread.h>], + [int attr = $attr; return attr /* ; */])], + [attr_name=$attr; break], + []) + done + AC_MSG_RESULT($attr_name) + if test "$attr_name" != PTHREAD_CREATE_JOINABLE; then + AC_DEFINE_UNQUOTED(PTHREAD_CREATE_JOINABLE, $attr_name, + [Define to necessary symbol if this constant + uses a non-standard name on your system.]) + fi + + AC_MSG_CHECKING([if more special flags are required for pthreads]) + flag=no + case ${host_os} in + aix* | freebsd* | darwin*) flag="-D_THREAD_SAFE";; + osf* | hpux*) flag="-D_REENTRANT";; + solaris*) + if test "$GCC" = "yes"; then + flag="-D_REENTRANT" + else + flag="-mt -D_REENTRANT" + fi + ;; + esac + AC_MSG_RESULT(${flag}) + if test "x$flag" != xno; then + PTHREAD_CFLAGS="$flag $PTHREAD_CFLAGS" + fi + + AC_CACHE_CHECK([for PTHREAD_PRIO_INHERIT], + ax_cv_PTHREAD_PRIO_INHERIT, [ + AC_LINK_IFELSE([ + AC_LANG_PROGRAM([[#include <pthread.h>]], [[int i = PTHREAD_PRIO_INHERIT;]])], + [ax_cv_PTHREAD_PRIO_INHERIT=yes], + [ax_cv_PTHREAD_PRIO_INHERIT=no]) + ]) + AS_IF([test "x$ax_cv_PTHREAD_PRIO_INHERIT" = "xyes"], + AC_DEFINE([HAVE_PTHREAD_PRIO_INHERIT], 1, [Have PTHREAD_PRIO_INHERIT.])) + + LIBS="$save_LIBS" + CFLAGS="$save_CFLAGS" + + # More AIX lossage: must compile with xlc_r or cc_r + if test x"$GCC" != xyes; then + AC_CHECK_PROGS(PTHREAD_CC, xlc_r cc_r, ${CC}) + else + PTHREAD_CC=$CC + fi +else + PTHREAD_CC="$CC" +fi + +AC_SUBST(PTHREAD_LIBS) +AC_SUBST(PTHREAD_CFLAGS) +AC_SUBST(PTHREAD_CC) + +# Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND: +if test x"$ax_pthread_ok" = xyes; then + ifelse([$1],,AC_DEFINE(HAVE_PTHREAD,1,[Define if you have POSIX threads libraries and header files.]),[$1]) + : +else + ax_pthread_ok=no + $2 +fi +AC_LANG_POP +])dnl AX_PTHREAD diff --git a/Build/source/utils/asymptote/base/geometry.asy b/Build/source/utils/asymptote/base/geometry.asy index e87dc00550c..bbbc823fc54 100644 --- a/Build/source/utils/asymptote/base/geometry.asy +++ b/Build/source/utils/asymptote/base/geometry.asy @@ -30,12 +30,22 @@ import math; import markers; + +// A rotation in the direction dir limited to [-90,90] +// This is useful for rotating text along a line in the direction dir. +private transform rotate(explicit pair dir) +{ + real angle=degrees(dir); + if(angle > 90 && angle < 270) angle -= 180; + return rotate(angle); +} + // *=======================================================* // *........................HEADER.........................* -/*<asyxml><variable type = "real" signature = "epsgeo"><code></asyxml>*/ +/*<asyxml><variable type="real" signature="epsgeo"><code></asyxml>*/ real epsgeo = 10 * sqrt(realEpsilon);/*<asyxml></code><documentation>Variable used in the approximate calculations.</documentation></variable></asyxml>*/ -/*<asyxml><function type = "void" signature = "addMargins(picture, real, real, real, real)"><code></asyxml>*/ +/*<asyxml><function type="void" signature="addMargins(picture,real,real,real,real)"><code></asyxml>*/ void addMargins(picture pic = currentpicture, real lmargin = 0, real bmargin = 0, real rmargin = lmargin, real tmargin = bmargin, @@ -67,13 +77,13 @@ real[] approximate(real[] T) return map(approximate, T); } -/*<asyxml><function type = "real" signature = "binomial(real, real)"><code></asyxml>*/ +/*<asyxml><function type="real" signature="binomial(real,real)"><code></asyxml>*/ real binomial(real n, real k) {/*<asyxml></code><documentation>Return n!/((n - k)!*k!)</documentation></function></asyxml>*/ return gamma(n + 1)/(gamma(n - k + 1) * gamma(k + 1)); } -/*<asyxml><function type = "real" signature = "rf(real, real, real)"><code></asyxml>*/ +/*<asyxml><function type="real" signature="rf(real,real,real)"><code></asyxml>*/ real rf(real x, real y, real z) {/*<asyxml></code><documentation>Computes Carlson's elliptic integral of the first kind. x, y, and z must be non negative, and at most one can be zero.</documentation></function></asyxml>*/ @@ -109,7 +119,7 @@ real rf(real x, real y, real z) return (1.0 + (C1 * e2 - C2 - C3 * e3) * e2 + C4 * e3)/sqrt(ave); } -/*<asyxml><function type = "real" signature = "rd(real, real, real)"><code></asyxml>*/ +/*<asyxml><function type="real" signature="rd(real,real,real)"><code></asyxml>*/ real rd(real x, real y, real z) {/*<asyxml></code><documentation>Computes Carlson's elliptic integral of the second kind. x and y must be positive, and at most one can be zero. @@ -156,7 +166,7 @@ real rd(real x, real y, real z) +delz * (C2 * ee + delz * (-C3 * ec + delz * C4 * ea)))/(ave * sqrt(ave)); } -/*<asyxml><function type = "real" signature = "elle(real, real)"><code></asyxml>*/ +/*<asyxml><function type="real" signature="elle(real,real)"><code></asyxml>*/ real elle(real phi, real k) {/*<asyxml></code><documentation>Legendre elliptic integral of the 2nd kind, evaluated using Carlson's functions RD and RF. @@ -185,7 +195,7 @@ real elle(real phi, real k) return result; } -/*<asyxml><function type = "pair[]" signature = "intersectionpoints(pair, pair, real, real, real, real, real, real)"><code></asyxml>*/ +/*<asyxml><function type="pair[]" signature="intersectionpoints(pair,pair,real,real,real,real,real,real)"><code></asyxml>*/ pair[] intersectionpoints(pair A, pair B, real a, real b, real c, real d, real f, real g) {/*<asyxml></code><documentation>Intersection points with the line (AB) and the quadric curve @@ -215,7 +225,7 @@ pair[] intersectionpoints(pair A, pair B, return op; } -/*<asyxml><function type = "pair[]" signature = "intersectionpoints(pair, pair, real[])"><code></asyxml>*/ +/*<asyxml><function type="pair[]" signature="intersectionpoints(pair,pair,real[])"><code></asyxml>*/ pair[] intersectionpoints(pair A, pair B, real[] equation) {/*<asyxml></code><documentation>Return the intersection points of the line AB with the conic whose an equation is @@ -241,24 +251,24 @@ typedef real dot(pair, pair);/*<asyxml></code><documentation>Function type to ca /*<asyxml><typedef type = "polar" return = "pair" params = "real, real"><code></asyxml>*/ typedef pair polar(real, real);/*<asyxml></code><documentation>Function type to calculate the coordinates from the polar coordinates.</documentation></typedef></asyxml>*/ -/*<asyxml><struct signature = "coordsys"><code></asyxml>*/ +/*<asyxml><struct signature="coordsys"><code></asyxml>*/ struct coordsys {/*<asyxml></code><documentation>This structure represents a coordinate system in the plane.</documentation></asyxml>*/ - /*<asyxml><method type = "pair" signature = "relativetodefault(pair)"><code></asyxml>*/ + /*<asyxml><method type = "pair" signature="relativetodefault(pair)"><code></asyxml>*/ restricted convert relativetodefault = new pair(pair m){return m;};/*<asyxml></code><documentation>Convert a pair given relatively to this coordinate system to the pair relatively to the default coordinate system.</documentation></method></asyxml>*/ - /*<asyxml><method type = "pair" signature = "defaulttorelativet(pair)"><code></asyxml>*/ + /*<asyxml><method type = "pair" signature="defaulttorelativet(pair)"><code></asyxml>*/ restricted convert defaulttorelative = new pair(pair m){return m;};/*<asyxml></code><documentation>Convert a pair given relatively to the default coordinate system to the pair relatively to this coordinate system.</documentation></method></asyxml>*/ - /*<asyxml><method type = "real" signature = "dot(pair, pair)"><code></asyxml>*/ + /*<asyxml><method type = "real" signature="dot(pair,pair)"><code></asyxml>*/ restricted dot dot = new real(pair m, pair n){return dot(m, n);};/*<asyxml></code><documentation>Return the dot product of this coordinate system.</documentation></method></asyxml>*/ - /*<asyxml><method type = "real" signature = "abs(pair)"><code></asyxml>*/ + /*<asyxml><method type = "real" signature="abs(pair)"><code></asyxml>*/ restricted abs abs = new real(pair m){return abs(m);};/*<asyxml></code><documentation>Return the modulus of a pair in this coordinate system.</documentation></method></asyxml>*/ - /*<asyxml><method type = "pair" signature = "polar(real, real)"><code></asyxml>*/ + /*<asyxml><method type = "pair" signature="polar(real,real)"><code></asyxml>*/ restricted polar polar = new pair(real r, real a){return (r * cos(a), r * sin(a));};/*<asyxml></code><documentation>Polar coordinates routine of this coordinate system.</documentation></method></asyxml>*/ - /*<asyxml><property type = "pair" signature = "O, i, j"><code></asyxml>*/ + /*<asyxml><property type = "pair" signature="O,i,j"><code></asyxml>*/ restricted pair O = (0, 0), i = (1, 0), j = (0, 1);/*<asyxml></code><documentation>Origin and units vector.</documentation></property></asyxml>*/ - /*<asyxml><method type = "void" signature = "init(convert, convert, polar, dot)"><code></asyxml>*/ + /*<asyxml><method type = "void" signature="init(convert,convert,polar,dot)"><code></asyxml>*/ void init(convert rtd, convert dtr, polar polar, dot dot) {/*<asyxml></code><documentation>The default constructor of the coordinate system.</documentation></method></asyxml>*/ @@ -273,13 +283,13 @@ struct coordsys } }/*<asyxml></struct></asyxml>*/ -/*<asyxml><operator type = "bool" signature = "==(coordsys, coordsys)"><code></asyxml>*/ +/*<asyxml><operator type = "bool" signature="==(coordsys,coordsys)"><code></asyxml>*/ bool operator ==(coordsys c1, coordsys c2) {/*<asyxml></code><documentation>Return true iff the coordinate system have the same origin and units vector.</documentation></operator></asyxml>*/ return c1.O == c2.O && c1.i == c2.i && c1.j == c2.j; } -/*<asyxml><function type = "coordsys" signature = "cartesiansystem(pair, pair, pair)"><code></asyxml>*/ +/*<asyxml><function type="coordsys" signature="cartesiansystem(pair,pair,pair)"><code></asyxml>*/ coordsys cartesiansystem(pair O = (0, 0), pair i, pair j) {/*<asyxml></code><documentation>Return the Cartesian coordinate system (O, i, j).</documentation></function></asyxml>*/ coordsys R; @@ -322,7 +332,7 @@ coordsys cartesiansystem(pair O = (0, 0), pair i, pair j) } -/*<asyxml><function type = "void" signature = "show(picture, Label, Label, Label, coordsys, pen, pen, pen, pen, pen)"><code></asyxml>*/ +/*<asyxml><function type="void" signature="show(picture,Label,Label,Label,coordsys,pen,pen,pen,pen,pen)"><code></asyxml>*/ void show(picture pic = currentpicture, Label lo = "$O$", Label li = "$\vec{\imath}$", Label lj = "$\vec{\jmath}$", @@ -347,7 +357,7 @@ void show(picture pic = currentpicture, Label lo = "$O$", label(pic, lo, O); } -/*<asyxml><operator type = "pair" signature = "/(pair, coordsys)"><code></asyxml>*/ +/*<asyxml><operator type = "pair" signature="/(pair,coordsys)"><code></asyxml>*/ pair operator /(pair p, coordsys R) {/*<asyxml></code><documentation>Return the xy - coordinates of 'p' relatively to the coordinate system 'R'. @@ -355,7 +365,7 @@ pair operator /(pair p, coordsys R) return R.defaulttorelative(p); } -/*<asyxml><operator type = "pair" signature = "*(coordsys, pair)"><code></asyxml>*/ +/*<asyxml><operator type = "pair" signature="*(coordsys,pair)"><code></asyxml>*/ pair operator *(coordsys R, pair p) {/*<asyxml></code><documentation>Return the coordinates of 'p' given in the xy - coordinates 'R'. @@ -363,7 +373,7 @@ pair operator *(coordsys R, pair p) return R.relativetodefault(p); } -/*<asyxml><operator type = "path" signature = "*(coordsys, path)"><code></asyxml>*/ +/*<asyxml><operator type = "path" signature="*(coordsys,path)"><code></asyxml>*/ path operator *(coordsys R, path g) {/*<asyxml></code><documentation>Return the reconstructed path applying R * pair to each node, pre and post control point of 'g'.</documentation></operator></asyxml>*/ guide og = R * point(g, 0); @@ -381,8 +391,8 @@ path operator *(coordsys R, path g) return og; } -/*<asyxml><operator type = "coordsys" signature = "*(transform, coordsys)"><code></asyxml>*/ -coordsys operator *(transform t, coordsys R) +/*<asyxml><operator type = "coordsys" signature="*(transform,coordsys)"><code></asyxml>*/ +coordsys operator *(transform t,coordsys R) {/*<asyxml></code><documentation>Provide transform * coordsys. Note that shiftless(t) is applied to R.i and R.j.</documentation></operator></asyxml>*/ coordsys oc; @@ -390,21 +400,21 @@ coordsys operator *(transform t, coordsys R) return oc; } -/*<asyxml><constant type = "coordsys" signature = "defaultcoordsys"><code></asyxml>*/ +/*<asyxml><constant type = "coordsys" signature="defaultcoordsys"><code></asyxml>*/ restricted coordsys defaultcoordsys = cartesiansystem(0, (1, 0), (0, 1));/*<asyxml></code><documentation>One can always refer to the default coordinate system using this constant.</documentation></constant></asyxml>*/ -/*<asyxml><variable type = "coordsys" signature = "currentcoordsys"><code></asyxml>*/ +/*<asyxml><variable type="coordsys" signature="currentcoordsys"><code></asyxml>*/ coordsys currentcoordsys = defaultcoordsys;/*<asyxml></code><documentation>The coordinate system used by default.</documentation></variable></asyxml>*/ -/*<asyxml><struct signature = "point"><code></asyxml>*/ +/*<asyxml><struct signature="point"><code></asyxml>*/ struct point {/*<asyxml></code><documentation>This structure replaces the pair to embed its coordinate system. For example, if 'P = point(cartesiansystem((1, 2), i, j), (0, 0))', P is equal to the pair (1, 2).</documentation></asyxml>*/ - /*<asyxml><property type = "coordsys" signature = "coordsys"><code></asyxml>*/ - coordsys coordsys;/*<asyxml></code><documentation>The coordinate system of this point.</documentation></property><property type = "pair" signature = "coordinates"><code></asyxml>*/ - restricted pair coordinates;/*<asyxml></code><documentation>The coordinates of this point relatively to the coordinate system 'coordsys'.</documentation></property><property type = "real" signature = "x, y"><code></asyxml>*/ + /*<asyxml><property type = "coordsys" signature="coordsys"><code></asyxml>*/ + coordsys coordsys;/*<asyxml></code><documentation>The coordinate system of this point.</documentation></property><property type = "pair" signature="coordinates"><code></asyxml>*/ + restricted pair coordinates;/*<asyxml></code><documentation>The coordinates of this point relatively to the coordinate system 'coordsys'.</documentation></property><property type = "real" signature="x, y"><code></asyxml>*/ restricted real x, y;/*<asyxml></code><documentation>The xpart and the ypart of 'coordinates'.</documentation></property></asyxml>*/ - /*<asyxml><method type = "" signature = "init(coordsys, pair)"><code><property type = "real" signature = "m"><code></asyxml>*/ + /*<asyxml><method type = "" signature="init(coordsys,pair)"><code><property type = "real" signature="m"><code></asyxml>*/ real m = 1;/*<asyxml></code><documentation>Used to cast mass<->point.</documentation></property></asyxml>*/ void init(coordsys R, pair coordinates, real mass) {/*<asyxml></code><documentation>The constructor.</documentation></method></asyxml>*/ @@ -416,7 +426,7 @@ struct point } }/*<asyxml></struct></asyxml>*/ -/*<asyxml><function type = "point" signature = "point(coordsys, pair, real)"><code></asyxml>*/ +/*<asyxml><function type="point" signature="point(coordsys,pair,real)"><code></asyxml>*/ point point(coordsys R, pair p, real m = 1) {/*<asyxml></code><documentation>Return the point which has the coodinates 'p' in the coordinate system 'R' and the mass 'm'.</documentation></function></asyxml>*/ @@ -425,7 +435,7 @@ point point(coordsys R, pair p, real m = 1) return op; } -/*<asyxml><function type = "point" signature = "point(explicit pair, real)"><code></asyxml>*/ +/*<asyxml><function type="point" signature="point(explicit pair,real)"><code></asyxml>*/ point point(explicit pair p, real m) {/*<asyxml></code><documentation>Return the point which has the coodinates 'p' in the current coordinate system and the mass 'm'.</documentation></function></asyxml>*/ @@ -434,7 +444,7 @@ point point(explicit pair p, real m) return op; } -/*<asyxml><function type = "point" signature = "point(coordsys, explicit point, real)"><code></asyxml>*/ +/*<asyxml><function type="point" signature="point(coordsys,explicit point,real)"><code></asyxml>*/ point point(coordsys R, explicit point M, real m = M.m) {/*<asyxml></code><documentation>Return the point of 'R' which has the coordinates of 'M' and the mass 'm'. Do not confuse this routine with the further routine 'changecoordsys'.</documentation></function></asyxml>*/ @@ -443,7 +453,7 @@ point point(coordsys R, explicit point M, real m = M.m) return op; } -/*<asyxml><function type = "point" signature = "changecoordsys(coordsys, point)"><code></asyxml>*/ +/*<asyxml><function type="point" signature="changecoordsys(coordsys,point)"><code></asyxml>*/ point changecoordsys(coordsys R, point M) {/*<asyxml></code><documentation>Return the point 'M' in the coordinate system 'coordsys'. In other words, the returned point marks the same plot as 'M' does.</documentation></function></asyxml>*/ @@ -453,13 +463,13 @@ point changecoordsys(coordsys R, point M) return op; } -/*<asyxml><function type = "pair" signature = "pair coordinates(point)"><code></asyxml>*/ +/*<asyxml><function type="pair" signature="pair coordinates(point)"><code></asyxml>*/ pair coordinates(point M) {/*<asyxml></code><documentation>Return the coordinates of 'M' in its coordinate system.</documentation></function></asyxml>*/ return M.coordinates; } -/*<asyxml><function type = "bool" signature = "bool samecoordsys(bool...point[])"><code></asyxml>*/ +/*<asyxml><function type="bool" signature="bool samecoordsys(bool...point[])"><code></asyxml>*/ bool samecoordsys(bool warn = true ... point[] M) {/*<asyxml></code><documentation>Return true iff all the points have the same coordinate system. If 'warn' is true and the coordinate systems are different, a warning is sent.</documentation></function></asyxml>*/ @@ -477,7 +487,7 @@ The operation will be done relative to the default coordinate system."); return ret; } -/*<asyxml><function type = "point[]" signature = "standardizecoordsys(coordsys, bool...point[])"><code></asyxml>*/ +/*<asyxml><function type="point[]" signature="standardizecoordsys(coordsys,bool...point[])"><code></asyxml>*/ point[] standardizecoordsys(coordsys R = currentcoordsys, bool warn = true ... point[] M) {/*<asyxml></code><documentation>Return the points with the same coordinate system 'R'. @@ -490,13 +500,13 @@ point[] standardizecoordsys(coordsys R = currentcoordsys, return op; } -/*<asyxml><operator type = "pair" signature = "cast(point)"><code></asyxml>*/ +/*<asyxml><operator type = "pair" signature="cast(point)"><code></asyxml>*/ pair operator cast(point P) {/*<asyxml></code><documentation>Cast point to pair.</documentation></operator></asyxml>*/ return P.coordsys.relativetodefault(P.coordinates); } -/*<asyxml><operator type = "pair[]" signature = "cast(point[])"><code></asyxml>*/ +/*<asyxml><operator type = "pair[]" signature="cast(point[])"><code></asyxml>*/ pair[] operator cast(point[] P) {/*<asyxml></code><documentation>Cast point[] to pair[].</documentation></operator></asyxml>*/ pair[] op; @@ -506,14 +516,14 @@ pair[] operator cast(point[] P) return op; } -/*<asyxml><operator type = "point" signature = "cast(pair)"><code></asyxml>*/ +/*<asyxml><operator type = "point" signature="cast(pair)"><code></asyxml>*/ point operator cast(pair p) {/*<asyxml></code><documentation>Cast pair to point relatively to the current coordinate system 'currentcoordsys'.</documentation></operator></asyxml>*/ return point(currentcoordsys, p); } -/*<asyxml><operator type = "point[]" signature = "cast(pair[])"><code></asyxml>*/ +/*<asyxml><operator type = "point[]" signature="cast(pair[])"><code></asyxml>*/ point[] operator cast(pair[] p) {/*<asyxml></code><documentation>Cast pair[] to point[] relatively to the current coordinate system 'currentcoordsys'.</documentation></operator></asyxml>*/ @@ -524,43 +534,43 @@ point[] operator cast(pair[] p) return op; } -/*<asyxml><function type = "pair" signature = "locate(point)"><code></asyxml>*/ +/*<asyxml><function type="pair" signature="locate(point)"><code></asyxml>*/ pair locate(point P) {/*<asyxml></code><documentation>Return the coordinates of 'P' in the default coordinate system.</documentation></function></asyxml>*/ return P.coordsys * P.coordinates; } -/*<asyxml><function type = "point" signature = "locate(pair)"><code></asyxml>*/ +/*<asyxml><function type="point" signature="locate(pair)"><code></asyxml>*/ point locate(pair p) {/*<asyxml></code><documentation>Return the point in the current coordinate system 'currentcoordsys'.</documentation></function></asyxml>*/ return p; //automatic casting 'pair to point'. } -/*<asyxml><operator type = "point" signature = "*(real, explicit point)"><code></asyxml>*/ +/*<asyxml><operator type = "point" signature="*(real,explicit point)"><code></asyxml>*/ point operator *(real x, explicit point P) {/*<asyxml></code><documentation>Multiply the coordinates (not the mass) of 'P' by 'x'.</documentation></operator></asyxml>*/ return point(P.coordsys, x * P.coordinates, P.m); } -/*<asyxml><operator type = "point" signature = "/(explicit point, real)"><code></asyxml>*/ +/*<asyxml><operator type = "point" signature="/(explicit point,real)"><code></asyxml>*/ point operator /(explicit point P, real x) {/*<asyxml></code><documentation>Divide the coordinates (not the mass) of 'P' by 'x'.</documentation></operator></asyxml>*/ return point(P.coordsys, P.coordinates/x, P.m); } -/*<asyxml><operator type = "point" signature = "/(real, explicit point)"><code></asyxml>*/ +/*<asyxml><operator type = "point" signature="/(real,explicit point)"><code></asyxml>*/ point operator /(real x, explicit point P) {/*<asyxml></code><documentation></documentation></operator></asyxml>*/ return point(P.coordsys, x/P.coordinates, P.m); } -/*<asyxml><operator type = "point" signature = "-(explicit point)"><code></asyxml>*/ +/*<asyxml><operator type = "point" signature="-(explicit point)"><code></asyxml>*/ point operator -(explicit point P) {/*<asyxml></code><documentation>-P. The mass is inchanged.</documentation></operator></asyxml>*/ return point(P.coordsys, -P.coordinates, P.m); } -/*<asyxml><operator type = "point" signature = "+(explicit point, explicit point)"><code></asyxml>*/ +/*<asyxml><operator type = "point" signature="+(explicit point,explicit point)"><code></asyxml>*/ point operator +(explicit point P1, explicit point P2) {/*<asyxml></code><documentation>Provide 'point + point'. If the two points haven't the same coordinate system, a warning is sent and the @@ -571,7 +581,7 @@ point operator +(explicit point P1, explicit point P2) return point(R, P[0].coordinates + P[1].coordinates, P1.m + P2.m); } -/*<asyxml><operator type = "point" signature = "+(explicit point, explicit pair)"><code></asyxml>*/ +/*<asyxml><operator type = "point" signature="+(explicit point,explicit pair)"><code></asyxml>*/ point operator +(explicit point P1, explicit pair p2) {/*<asyxml></code><documentation>Provide 'point + pair'. The pair 'p2' is supposed to be coordinates relatively to the coordinates system of 'P1'. @@ -584,13 +594,13 @@ point operator +(explicit pair p1, explicit point p2) return p2 + p1; } -/*<asyxml><operator type = "point" signature = "-(explicit point, explicit point)"><code></asyxml>*/ +/*<asyxml><operator type = "point" signature="-(explicit point,explicit point)"><code></asyxml>*/ point operator -(explicit point P1, explicit point P2) {/*<asyxml></code><documentation>Provide 'point - point'.</documentation></operator></asyxml>*/ return P1 + (-P2); } -/*<asyxml><operator type = "point" signature = "-(explicit point, explicit pair)"><code></asyxml>*/ +/*<asyxml><operator type = "point" signature="-(explicit point,explicit pair)"><code></asyxml>*/ point operator -(explicit point P1, explicit pair p2) {/*<asyxml></code><documentation>Provide 'point - pair'. The pair 'p2' is supposed to be coordinates relatively to the coordinates system of 'P1'.</documentation></operator></asyxml>*/ @@ -601,7 +611,7 @@ point operator -(explicit pair p1, explicit point P2) return p1 + (-P2); } -/*<asyxml><operator type = "point" signature = "*(transform, explicit point)"><code></asyxml>*/ +/*<asyxml><operator type = "point" signature="*(transform,explicit point)"><code></asyxml>*/ point operator *(transform t, explicit point P) {/*<asyxml></code><documentation>Provide 'transform * point'. Note that the transforms scale, xscale, yscale and rotate are carried out relatively @@ -614,7 +624,7 @@ point operator *(transform t, explicit point P) return point(R, (t * locate(P))/R, P.m); } -/*<asyxml><operator type = "point" signature = "*(explicit point, explicit point)"><code></asyxml>*/ +/*<asyxml><operator type = "point" signature="*(explicit point,explicit point)"><code></asyxml>*/ point operator *(explicit point P1, explicit point P2) {/*<asyxml></code><documentation>Provide 'point * point'. The resulted mass is the mass of P2</documentation></operator></asyxml>*/ @@ -623,7 +633,7 @@ point operator *(explicit point P1, explicit point P2) return point(R, P[0].coordinates * P[1].coordinates, P2.m); } -/*<asyxml><operator type = "point" signature = "*(explicit point, explicit pair)"><code></asyxml>*/ +/*<asyxml><operator type = "point" signature="*(explicit point,explicit pair)"><code></asyxml>*/ point operator *(explicit point P1, explicit pair p2) {/*<asyxml></code><documentation>Provide 'point * pair'. The pair 'p2' is supposed to be the coordinates of @@ -637,31 +647,31 @@ point operator *(explicit pair p1, explicit point p2) return p2 * p1; } -/*<asyxml><operator type = "bool" signature = "==(explicit point, explicit point)"><code></asyxml>*/ +/*<asyxml><operator type = "bool" signature="==(explicit point,explicit point)"><code></asyxml>*/ bool operator ==(explicit point M, explicit point N) {/*<asyxml></code><documentation>Provide the test 'M == N' wish returns true iff MN < EPS</documentation></operator></asyxml>*/ return abs(locate(M) - locate(N)) < EPS; } -/*<asyxml><operator type = "bool" signature = "!=(explicit point, explicit point)"><code></asyxml>*/ +/*<asyxml><operator type = "bool" signature="!=(explicit point,explicit point)"><code></asyxml>*/ bool operator !=(explicit point M, explicit point N) {/*<asyxml></code><documentation>Provide the test 'M != N' wish return true iff MN >= EPS</documentation></operator></asyxml>*/ return !(M == N); } -/*<asyxml><operator type = "guide" signature = "cast(point)"><code></asyxml>*/ +/*<asyxml><operator type = "guide" signature="cast(point)"><code></asyxml>*/ guide operator cast(point p) {/*<asyxml></code><documentation>Cast point to guide.</documentation></operator></asyxml>*/ return locate(p); } -/*<asyxml><operator type = "path" signature = "cast(point)"><code></asyxml>*/ +/*<asyxml><operator type = "path" signature="cast(point)"><code></asyxml>*/ path operator cast(point p) {/*<asyxml></code><documentation>Cast point to path.</documentation></operator></asyxml>*/ return locate(p); } -/*<asyxml><function type = "void" signature = "dot(picture, Label, explicit point, align, string, pen)"><code></asyxml>*/ +/*<asyxml><function type="void" signature="dot(picture,Label,explicit point,align,string,pen)"><code></asyxml>*/ void dot(picture pic = currentpicture, Label L, explicit point Z, align align = NoAlign, string format = defaultformat, pen p = currentpen) @@ -678,56 +688,56 @@ void dot(picture pic = currentpicture, Label L, explicit point Z, add(pic, L); } -/*<asyxml><function type = "real" signature = "abs(coordsys, pair)"><code></asyxml>*/ +/*<asyxml><function type="real" signature="abs(coordsys,pair)"><code></asyxml>*/ real abs(coordsys R, pair m) {/*<asyxml></code><documentation>Return the modulus |m| in the coordinate system 'R'.</documentation></function></asyxml>*/ return R.abs(m); } -/*<asyxml><function type = "real" signature = "abs(explicit point)"><code></asyxml>*/ +/*<asyxml><function type="real" signature="abs(explicit point)"><code></asyxml>*/ real abs(explicit point M) {/*<asyxml></code><documentation>Return the modulus |M| in its coordinate system.</documentation></function></asyxml>*/ return M.coordsys.abs(M.coordinates); } -/*<asyxml><function type = "real" signature = "length(explicit point)"><code></asyxml>*/ +/*<asyxml><function type="real" signature="length(explicit point)"><code></asyxml>*/ real length(explicit point M) {/*<asyxml></code><documentation>Return the modulus |M| in its coordinate system (same as 'abs').</documentation></function></asyxml>*/ return M.coordsys.abs(M.coordinates); } -/*<asyxml><function type = "point" signature = "conj(explicit point)"><code></asyxml>*/ +/*<asyxml><function type="point" signature="conj(explicit point)"><code></asyxml>*/ point conj(explicit point M) {/*<asyxml></code><documentation>Conjugate.</documentation></function></asyxml>*/ return point(M.coordsys, conj(M.coordinates), M.m); } -/*<asyxml><function type = "real" signature = "degrees(explicit point, coordsys, bool)"><code></asyxml>*/ +/*<asyxml><function type="real" signature="degrees(explicit point,coordsys,bool)"><code></asyxml>*/ real degrees(explicit point M, coordsys R = M.coordsys, bool warn = true) {/*<asyxml></code><documentation>Return the angle of M (in degrees) relatively to 'R'.</documentation></function></asyxml>*/ return (degrees(locate(M) - R.O, warn) - degrees(R.i))%360; } -/*<asyxml><function type = "real" signature = "angle(explicit point, coordsys, bool)"><code></asyxml>*/ +/*<asyxml><function type="real" signature="angle(explicit point,coordsys,bool)"><code></asyxml>*/ real angle(explicit point M, coordsys R = M.coordsys, bool warn = true) {/*<asyxml></code><documentation>Return the angle of M (in radians) relatively to 'R'.</documentation></function></asyxml>*/ return radians(degrees(M, R, warn)); } -/*<asyxml><function type = "bool" signature = "finite(explicit point)"><code></asyxml>*/ +/*<asyxml><function type="bool" signature="finite(explicit point)"><code></asyxml>*/ bool finite(explicit point p) {/*<asyxml></code><documentation>Avoid to compute 'finite((pair)(infinite_point))'.</documentation></function></asyxml>*/ return finite(p.coordinates); } -/*<asyxml><function type = "real" signature = "dot(point, point)"><code></asyxml>*/ +/*<asyxml><function type="real" signature="dot(point,point)"><code></asyxml>*/ real dot(point A, point B) {/*<asyxml></code><documentation>Return the dot product in the coordinate system of 'A'.</documentation></function></asyxml>*/ point[] P = standardizecoordsys(A.coordsys, A, B); return P[0].coordsys.dot(P[0].coordinates, P[1].coordinates); } -/*<asyxml><function type = "real" signature = "dot(point, explicit pair)"><code></asyxml>*/ +/*<asyxml><function type="real" signature="dot(point,explicit pair)"><code></asyxml>*/ real dot(point A, explicit pair B) {/*<asyxml></code><documentation>Return the dot product in the default coordinate system. dot(explicit pair, point) is also defined.</documentation></function></asyxml>*/ @@ -738,13 +748,13 @@ real dot(explicit pair A, point B) return dot(A, locate(B)); } -/*<asyxml><function type = "transforms" signature = "rotateO(real)"><code></asyxml>*/ +/*<asyxml><function type="transforms" signature="rotateO(real)"><code></asyxml>*/ transform rotateO(real a) {/*<asyxml></code><documentation>Rotation around the origin of the current coordinate system.</documentation></function></asyxml>*/ return rotate(a, currentcoordsys.O); }; -/*<asyxml><function type = "transform" signature = "projection(point, point)"><code></asyxml>*/ +/*<asyxml><function type="transform" signature="projection(point,point)"><code></asyxml>*/ transform projection(point A, point B) {/*<asyxml></code><documentation>Return the orthogonal projection on the line (AB).</documentation></function></asyxml>*/ pair dir = unit(locate(A) - locate(B)); @@ -760,7 +770,7 @@ transform projection(point A, point B) return t; } -/*<asyxml><function type = "transform" signature = "projection(point, point, point, point, bool)"><code></asyxml>*/ +/*<asyxml><function type="transform" signature="projection(point,point,point,point,bool)"><code></asyxml>*/ transform projection(point A, point B, point C, point D, bool safe = false) {/*<asyxml></code><documentation>Return the (CD) parallel projection on (AB). If 'safe = true' and (AB)//(CD) return the identity. @@ -783,14 +793,14 @@ transform projection(point A, point B, point C, point D, bool safe = false) return t; } -/*<asyxml><function type = "transform" signature = "scale(real, point)"><code></asyxml>*/ +/*<asyxml><function type="transform" signature="scale(real,point)"><code></asyxml>*/ transform scale(real k, point M) {/*<asyxml></code><documentation>Homothety.</documentation></function></asyxml>*/ pair P = locate(M); return shift(P) * scale(k) * shift(-P); } -/*<asyxml><function type = "transform" signature = "xscale(real, point)"><code></asyxml>*/ +/*<asyxml><function type="transform" signature="xscale(real,point)"><code></asyxml>*/ transform xscale(real k, point M) {/*<asyxml></code><documentation>xscale from 'M' relatively to the x - axis of the coordinate system of 'M'.</documentation></function></asyxml>*/ pair P = locate(M); @@ -798,7 +808,7 @@ transform xscale(real k, point M) return (shift(P) * rotate(a)) * xscale(k) * (rotate(-a) * shift(-P)); } -/*<asyxml><function type = "transform" signature = "yscale(real, point)"><code></asyxml>*/ +/*<asyxml><function type="transform" signature="yscale(real,point)"><code></asyxml>*/ transform yscale(real k, point M) {/*<asyxml></code><documentation>yscale from 'M' relatively to the y - axis of the coordinate system of 'M'.</documentation></function></asyxml>*/ pair P = locate(M); @@ -806,7 +816,7 @@ transform yscale(real k, point M) return (shift(P) * rotate(a)) * yscale(k) * (rotate(-a) * shift(-P)); } -/*<asyxml><function type = "transform" signature = "scale(real, point, point, point, point, bool)"><code></asyxml>*/ +/*<asyxml><function type="transform" signature="scale(real,point,point,point,point,bool)"><code></asyxml>*/ transform scale(real k, point A, point B, point C, point D, bool safe = false) {/*<asyxml></code><documentation><url href = "http://fr.wikipedia.org/wiki/Affinit%C3%A9_%28math%C3%A9matiques%29"/> (help me for English translation...) @@ -831,38 +841,38 @@ transform scale(real k, point A, point B, point C, point D, bool safe = false) return t; } -/*<asyxml><function type = "transform" signature = "scaleO(real)"><code></asyxml>*/ +/*<asyxml><function type="transform" signature="scaleO(real)"><code></asyxml>*/ transform scaleO(real x) {/*<asyxml></code><documentation>Homothety from the origin of the current coordinate system.</documentation></function></asyxml>*/ return scale(x, (0, 0)); } -/*<asyxml><function type = "transform" signature = "xscaleO(real)"><code></asyxml>*/ +/*<asyxml><function type="transform" signature="xscaleO(real)"><code></asyxml>*/ transform xscaleO(real x) {/*<asyxml></code><documentation>xscale from the origin and relatively to the current coordinate system.</documentation></function></asyxml>*/ return scale(x, (0, 0), (0, 1), (0, 0), (1, 0)); } -/*<asyxml><function type = "transform" signature = "yscaleO(real)"><code></asyxml>*/ +/*<asyxml><function type="transform" signature="yscaleO(real)"><code></asyxml>*/ transform yscaleO(real x) {/*<asyxml></code><documentation>yscale from the origin and relatively to the current coordinate system.</documentation></function></asyxml>*/ return scale(x, (0, 0), (1, 0), (0, 0), (0, 1)); } -/*<asyxml><struct signature = "vector"><code></asyxml>*/ +/*<asyxml><struct signature="vector"><code></asyxml>*/ struct vector {/*<asyxml></code><documentation>Like a point but casting to pair, adding etc does not take account - of the origin of the coordinate system.</documentation><property type = "point" signature = "v"><code></asyxml>*/ + of the origin of the coordinate system.</documentation><property type = "point" signature="v"><code></asyxml>*/ point v;/*<asyxml></code><documentation>Coordinates as a point (embed coordinate system and pair).</documentation></property></asyxml>*/ }/*<asyxml></struct></asyxml>*/ -/*<asyxml><operator type = "point" signature = "cast(vector)"><code></asyxml>*/ +/*<asyxml><operator type = "point" signature="cast(vector)"><code></asyxml>*/ point operator cast(vector v) {/*<asyxml></code><documentation>Cast vector 'v' to point 'M' so that OM = v.</documentation></operator></asyxml>*/ return v.v; } -/*<asyxml><operator type = "vector" signature = "cast(pair)"><code></asyxml>*/ +/*<asyxml><operator type = "vector" signature="cast(pair)"><code></asyxml>*/ vector operator cast(pair v) {/*<asyxml></code><documentation>Cast pair to vector relatively to the current coordinate system 'currentcoordsys'.</documentation></operator></asyxml>*/ @@ -871,7 +881,7 @@ vector operator cast(pair v) return ov; } -/*<asyxml><operator type = "vector" signature = "cast(explicit point)"><code></asyxml>*/ +/*<asyxml><operator type = "vector" signature="cast(explicit point)"><code></asyxml>*/ vector operator cast(explicit point v) {/*<asyxml></code><documentation>A point can be interpreted like a vector using the code '(vector)a_point'.</documentation></operator></asyxml>*/ @@ -880,19 +890,19 @@ vector operator cast(explicit point v) return ov; } -/*<asyxml><operator type = "pair" signature = "cast(explicit vector)"><code></asyxml>*/ +/*<asyxml><operator type = "pair" signature="cast(explicit vector)"><code></asyxml>*/ pair operator cast(explicit vector v) {/*<asyxml></code><documentation>Cast vector to pair (the coordinates of 'v' in the default coordinate system).</documentation></operator></asyxml>*/ return locate(v.v) - v.v.coordsys.O; } -/*<asyxml><operator type = "align" signature = "cast(vector)"><code></asyxml>*/ +/*<asyxml><operator type = "align" signature="cast(vector)"><code></asyxml>*/ align operator cast(vector v) {/*<asyxml></code><documentation>Cast vector to align.</documentation></operator></asyxml>*/ return (pair)v; } -/*<asyxml><function type = "vector" signature = "vector(coordsys, pair)"><code></asyxml>*/ +/*<asyxml><function type="vector" signature="vector(coordsys, pair)"><code></asyxml>*/ vector vector(coordsys R = currentcoordsys, pair v) {/*<asyxml></code><documentation>Return the vector of 'R' which has the coordinates 'v'.</documentation></function></asyxml>*/ vector ov; @@ -900,33 +910,33 @@ vector vector(coordsys R = currentcoordsys, pair v) return ov; } -/*<asyxml><function type = "vector" signature = "vector(point)"><code></asyxml>*/ +/*<asyxml><function type="vector" signature="vector(point)"><code></asyxml>*/ vector vector(point M) {/*<asyxml></code><documentation>Return the vector OM, where O is the origin of the coordinate system of 'M'. Useful to write 'vector(P - M);' instead of '(vector)(P - M)'.</documentation></function></asyxml>*/ return M; } -/*<asyxml><function type = "point" signature = "point(explicit vector)"><code></asyxml>*/ +/*<asyxml><function type="point" signature="point(explicit vector)"><code></asyxml>*/ point point(explicit vector u) {/*<asyxml></code><documentation>Return the point M so that OM = u, where O is the origin of the coordinate system of 'u'.</documentation></function></asyxml>*/ return u.v; } -/*<asyxml><function type = "pair" signature = "locate(explicit vector)"><code></asyxml>*/ +/*<asyxml><function type="pair" signature="locate(explicit vector)"><code></asyxml>*/ pair locate(explicit vector v) {/*<asyxml></code><documentation>Return the coordinates of 'v' in the default coordinate system (like casting vector to pair).</documentation></function></asyxml>*/ return (pair)v; } -/*<asyxml><function type = "void" signature = "show(Label, pen, arrowbar)"><code></asyxml>*/ +/*<asyxml><function type="void" signature="show(Label,pen,arrowbar)"><code></asyxml>*/ void show(Label L, vector v, pen p = currentpen, arrowbar arrow = Arrow) {/*<asyxml></code><documentation>Draw the vector v (from the origin of its coordinate system).</documentation></function></asyxml>*/ coordsys R = v.v.coordsys; draw(L, R.O--v.v, p, arrow); } -/*<asyxml><function type = "vector" signature = "changecoordsys(coordsys, vector)"><code></asyxml>*/ +/*<asyxml><function type="vector" signature="changecoordsys(coordsys,vector)"><code></asyxml>*/ vector changecoordsys(coordsys R, vector v) {/*<asyxml></code><documentation>Return the vector 'v' relatively to coordinate system 'R'.</documentation></function></asyxml>*/ vector ov; @@ -934,49 +944,49 @@ vector changecoordsys(coordsys R, vector v) return ov; } -/*<asyxml><operator type = "vector" signature = "*(real, explicit vector)"><code></asyxml>*/ +/*<asyxml><operator type = "vector" signature="*(real,explicit vector)"><code></asyxml>*/ vector operator *(real x, explicit vector v) {/*<asyxml></code><documentation>Provide real * vector.</documentation></operator></asyxml>*/ return x * v.v; } -/*<asyxml><operator type = "vector" signature = "/(explicit vector, real)"><code></asyxml>*/ +/*<asyxml><operator type = "vector" signature="/(explicit vector,real)"><code></asyxml>*/ vector operator /(explicit vector v, real x) {/*<asyxml></code><documentation>Provide vector/real</documentation></operator></asyxml>*/ return v.v/x; } -/*<asyxml><operator type = "vector" signature = "*(transform t, explicit vector)"><code></asyxml>*/ +/*<asyxml><operator type = "vector" signature="*(transform t,explicit vector)"><code></asyxml>*/ vector operator *(transform t, explicit vector v) {/*<asyxml></code><documentation>Provide transform * vector.</documentation></operator></asyxml>*/ return t * v.v; } -/*<asyxml><operator type = "vector" signature = "*(explicit point, explicit vector)"><code></asyxml>*/ +/*<asyxml><operator type = "vector" signature="*(explicit point,explicit vector)"><code></asyxml>*/ vector operator *(explicit point M, explicit vector v) {/*<asyxml></code><documentation>Provide point * vector</documentation></operator></asyxml>*/ return M * v.v; } -/*<asyxml><operator type = "point" signature = "+(explicit point, explicit vector)"><code></asyxml>*/ +/*<asyxml><operator type = "point" signature="+(explicit point,explicit vector)"><code></asyxml>*/ point operator +(point M, explicit vector v) {/*<asyxml></code><documentation>Return 'M' shifted by 'v'.</documentation></operator></asyxml>*/ return shift(locate(v)) * M; } -/*<asyxml><operator type = "point" signature = "-(explicit point, explicit vector)"><code></asyxml>*/ +/*<asyxml><operator type = "point" signature="-(explicit point,explicit vector)"><code></asyxml>*/ point operator -(point M, explicit vector v) {/*<asyxml></code><documentation>Return 'M' shifted by '-v'.</documentation></operator></asyxml>*/ return shift(-locate(v)) * M; } -/*<asyxml><operator type = "vector" signature = "-(explicit vector)"><code></asyxml>*/ +/*<asyxml><operator type = "vector" signature="-(explicit vector)"><code></asyxml>*/ vector operator -(explicit vector v) {/*<asyxml></code><documentation>Provide -v.</documentation></operator></asyxml>*/ return -v.v; } -/*<asyxml><operator type = "point" signature = "+(explicit pair, explicit vector)"><code></asyxml>*/ +/*<asyxml><operator type = "point" signature="+(explicit pair,explicit vector)"><code></asyxml>*/ point operator +(explicit pair m, explicit vector v) {/*<asyxml></code><documentation>The pair 'm' is supposed to be the coordinates of a point in the current coordinates system 'currentcoordsys'. @@ -984,7 +994,7 @@ point operator +(explicit pair m, explicit vector v) return locate(m) + v; } -/*<asyxml><operator type = "point" signature = "-(explicit pair, explicit vector)"><code></asyxml>*/ +/*<asyxml><operator type = "point" signature="-(explicit pair,explicit vector)"><code></asyxml>*/ point operator -(explicit pair m, explicit vector v) {/*<asyxml></code><documentation>The pair 'm' is supposed to be the coordinates of a point in the current coordinates system 'currentcoordsys'. @@ -992,7 +1002,7 @@ point operator -(explicit pair m, explicit vector v) return m + (-v); } -/*<asyxml><operator type = "vector" signature = "+(explicit vector, explicit vector)"><code></asyxml>*/ +/*<asyxml><operator type = "vector" signature="+(explicit vector,explicit vector)"><code></asyxml>*/ vector operator +(explicit vector v1, explicit vector v2) {/*<asyxml></code><documentation>Provide vector + vector. If the two vector haven't the same coordinate system, the returned @@ -1002,7 +1012,7 @@ vector operator +(explicit vector v1, explicit vector v2) return vector(R, (locate(v1) + locate(v2))/R); } -/*<asyxml><operator type = "vector" signature = "-(explicit vector, explicit vector)"><code></asyxml>*/ +/*<asyxml><operator type = "vector" signature="-(explicit vector, explicit vector)"><code></asyxml>*/ vector operator -(explicit vector v1, explicit vector v2) {/*<asyxml></code><documentation>Provide vector - vector. If the two vector haven't the same coordinate system, the returned @@ -1010,31 +1020,31 @@ vector operator -(explicit vector v1, explicit vector v2) return v1 + (-v2); } -/*<asyxml><operator type = "bool" signature = "==(explicit vector, explicit vector)"><code></asyxml>*/ +/*<asyxml><operator type = "bool" signature="==(explicit vector,explicit vector)"><code></asyxml>*/ bool operator ==(explicit vector u, explicit vector v) {/*<asyxml></code><documentation>Return true iff |u - v|<EPS.</documentation></operator></asyxml>*/ return abs(u - v) < EPS; } -/*<asyxml><function type = "bool" signature = "collinear(vector, vector)"><code></asyxml>*/ +/*<asyxml><function type="bool" signature="collinear(vector,vector)"><code></asyxml>*/ bool collinear(vector u, vector v) {/*<asyxml></code><documentation>Return 'true' iff the vectors 'u' and 'v' are collinear.</documentation></function></asyxml>*/ return abs(ypart((conj((pair)u) * (pair)v))) < EPS; } -/*<asyxml><function type = "vector" signature = "unit(point)"><code></asyxml>*/ +/*<asyxml><function type="vector" signature="unit(point)"><code></asyxml>*/ vector unit(point M) {/*<asyxml></code><documentation>Return the unit vector according to the modulus of its coordinate system.</documentation></function></asyxml>*/ return M/abs(M); } -/*<asyxml><function type = "vector" signature = "unit(vector)"><code></asyxml>*/ +/*<asyxml><function type="vector" signature="unit(vector)"><code></asyxml>*/ vector unit(vector u) {/*<asyxml></code><documentation>Return the unit vector according to the modulus of its coordinate system.</documentation></function></asyxml>*/ return u.v/abs(u.v); } -/*<asyxml><function type = "real" signature = "degrees(vector, coordsys, bool)"><code></asyxml>*/ +/*<asyxml><function type="real" signature="degrees(vector,coordsys,bool)"><code></asyxml>*/ real degrees(vector v, coordsys R = v.v.coordsys, bool warn = true) @@ -1042,7 +1052,7 @@ real degrees(vector v, return (degrees(locate(v), warn) - degrees(R.i))%360; } -/*<asyxml><function type = "real" signature = "angle(vector, coordsys, bool)"><code></asyxml>*/ +/*<asyxml><function type="real" signature="angle(vector,coordsys,bool)"><code></asyxml>*/ real angle(explicit vector v, coordsys R = v.v.coordsys, bool warn = true) @@ -1050,13 +1060,13 @@ real angle(explicit vector v, return radians(degrees(v, R, warn)); } -/*<asyxml><function type = "vector" signature = "conj(explicit vector)"><code></asyxml>*/ +/*<asyxml><function type="vector" signature="conj(explicit vector)"><code></asyxml>*/ vector conj(explicit vector u) {/*<asyxml></code><documentation>Conjugate.</documentation></function></asyxml>*/ return conj(u.v); } -/*<asyxml><function type = "transform" signature = "rotate(explicit vector)"><code></asyxml>*/ +/*<asyxml><function type="transform" signature="rotate(explicit vector)"><code></asyxml>*/ transform rotate(explicit vector dir) {/*<asyxml></code><documentation>A rotation in the direction 'dir' limited to [-90, 90] This is useful for rotating text along a line in the direction dir. @@ -1070,37 +1080,37 @@ transform rotate(explicit point dir){return rotate(locate(vector(dir)));} // *=======================================================* // *.........................BASES.........................* -/*<asyxml><variable type = "point" signature = "origin"><code></asyxml>*/ +/*<asyxml><variable type="point" signature="origin"><code></asyxml>*/ point origin = point(defaultcoordsys, (0, 0));/*<asyxml></code><documentation>The origin of the current coordinate system.</documentation></variable></asyxml>*/ -/*<asyxml><function type = "point" signature = "origin(coordsys)"><code></asyxml>*/ +/*<asyxml><function type="point" signature="origin(coordsys)"><code></asyxml>*/ point origin(coordsys R = currentcoordsys) {/*<asyxml></code><documentation>Return the origin of the coordinate system 'R'.</documentation></function></asyxml>*/ return point(R, (0, 0)); //use automatic casting; } -/*<asyxml><variable type = "real" signature = "linemargin"><code></asyxml>*/ +/*<asyxml><variable type="real" signature="linemargin"><code></asyxml>*/ real linemargin = 0;/*<asyxml></code><documentation>Margin used to draw lines.</documentation></variable></asyxml>*/ -/*<asyxml><function type = "real" signature = "linemargin()"><code></asyxml>*/ +/*<asyxml><function type="real" signature="linemargin()"><code></asyxml>*/ real linemargin() {/*<asyxml></code><documentation>Return the margin used to draw lines.</documentation></function></asyxml>*/ return linemargin; } -/*<asyxml><variable type = "pen" signature = "addpenline"><code></asyxml>*/ +/*<asyxml><variable type="pen" signature="addpenline"><code></asyxml>*/ pen addpenline = squarecap;/*<asyxml></code><documentation>Add this property to the drawing pen of "finish" lines.</documentation></variable></asyxml>*/ pen addpenline(pen p) { return addpenline + p; } -/*<asyxml><variable type = "pen" signature = "addpenarc"><code></asyxml>*/ +/*<asyxml><variable type="pen" signature="addpenarc"><code></asyxml>*/ pen addpenarc = squarecap;/*<asyxml></code><documentation>Add this property to the drawing pen of arcs.</documentation></variable></asyxml>*/ pen addpenarc(pen p) {return addpenarc + p;} -/*<asyxml><variable type = "string" signature = "defaultmassformat"><code></asyxml>*/ -string defaultmassformat = "$\left(%L;%.4g \ right)$";/*<asyxml></code><documentation>Format used to construct the default label of masses.</documentation></variable></asyxml>*/ +/*<asyxml><variable type="string" signature="defaultmassformat"><code></asyxml>*/ +string defaultmassformat = "$\left(%L;%.4g\right)$";/*<asyxml></code><documentation>Format used to construct the default label of masses.</documentation></variable></asyxml>*/ -/*<asyxml><function type = "int" signature = "sgnd(real)"><code></asyxml>*/ +/*<asyxml><function type="int" signature="sgnd(real)"><code></asyxml>*/ int sgnd(real x) {/*<asyxml></code><documentation>Return the -1 if x < 0, 1 if x >= 0.</documentation></function></asyxml>*/ return (x == 0) ? 1 : sgn(x); @@ -1110,27 +1120,27 @@ int sgnd(int x) return (x == 0) ? 1 : sgn(x); } -/*<asyxml><function type = "bool" signature = "defined(pair)"><code></asyxml>*/ +/*<asyxml><function type="bool" signature="defined(pair)"><code></asyxml>*/ bool defined(point P) {/*<asyxml></code><documentation>Return true iff the coordinates of 'P' are finite.</documentation></function></asyxml>*/ return finite(P.coordinates); } -/*<asyxml><function type = "bool" signature = "onpath(picture, path, point, pen)"><code></asyxml>*/ +/*<asyxml><function type="bool" signature="onpath(picture,path,point,pen)"><code></asyxml>*/ bool onpath(picture pic = currentpicture, path g, point M, pen p = currentpen) {/*<asyxml></code><documentation>Return true iff 'M' is on the path drawn with the pen 'p' in 'pic'.</documentation></function></asyxml>*/ transform t = inverse(pic.calculateTransform()); return intersect(g, shift(locate(M)) * scale(linewidth(p)/2) * t * unitcircle).length > 0; } -/*<asyxml><function type = "bool" signature = "sameside(point, point, point)"><code></asyxml>*/ +/*<asyxml><function type="bool" signature="sameside(point,point,point)"><code></asyxml>*/ bool sameside(point M, point N, point O) {/*<asyxml></code><documentation>Return 'true' iff 'M' and 'N' are same side of the point 'O'.</documentation></function></asyxml>*/ pair m = M, n = N, o = O; return dot(m - o, n - o) >= -epsgeo; } -/*<asyxml><function type = "bool" signature = "between(point, point, point)"><code></asyxml>*/ +/*<asyxml><function type="bool" signature="between(point,point,point)"><code></asyxml>*/ bool between(point M, point O, point N) {/*<asyxml></code><documentation>Return 'true' iff 'O' is between 'M' and 'N'.</documentation></function></asyxml>*/ return (!sameside(N, M, O) || M == O || N == O); @@ -1224,7 +1234,7 @@ private void Drawline(picture pic = currentpicture, Label L = "", pair P, bool d }); } -/*<asyxml><function type = "void" signature = "clipdraw(picture, Label, path, align, pen, arrowbar, arrowbar, real, real, Label, marker)"><code></asyxml>*/ +/*<asyxml><function type="void" signature="clipdraw(picture,Label,path,align,pen,arrowbar,arrowbar,real,real,Label,marker)"><code></asyxml>*/ void clipdraw(picture pic = currentpicture, Label L = "", path g, align align = NoAlign, pen p = currentpen, arrowbar arrow = None, arrowbar bar = None, @@ -1247,7 +1257,7 @@ void clipdraw(picture pic = currentpicture, Label L = "", path g, }); } -/*<asyxml><function type = "void" signature = "distance(picture pic, Label, point, point, bool, real, pen, pen, arrow)"><code></asyxml>*/ +/*<asyxml><function type="void" signature="distance(picture pic,Label,point,point,bool,real,pen,pen,arrow)"><code></asyxml>*/ void distance(picture pic = currentpicture, Label L = "", point A, point B, bool rotated = true, real offset = 3mm, pen p = currentpen, pen joinpen = invisible, @@ -1273,9 +1283,9 @@ void distance(picture pic = currentpicture, Label L = "", point A, point B, pic.addBox(min(g), max(g), Tp * min(p), Tp * max(p)); } -/*<asyxml><variable type = "real" signature = "perpfactor"><code></asyxml>*/ +/*<asyxml><variable type="real" signature="perpfactor"><code></asyxml>*/ real perpfactor = 1;/*<asyxml></code><documentation>Factor for drawing perpendicular symbol.</documentation></variable></asyxml>*/ -/*<asyxml><function type = "void" signature = "perpendicularmark(picture, point, explicit pair, explicit pair, real, pen, margin, filltype)"><code></asyxml>*/ +/*<asyxml><function type="void" signature="perpendicularmark(picture,point,explicit pair,explicit pair,real,pen,margin,filltype)"><code></asyxml>*/ void perpendicularmark(picture pic = currentpicture, point z, explicit pair align, explicit pair dir = E, real size = 0, @@ -1298,7 +1308,7 @@ void perpendicularmark(picture pic = currentpicture, point z, add(pic, apic, locate(z)); } -/*<asyxml><function type = "void" signature = "perpendicularmark(picture, point, vector, vector, real, pen, margin, filltype)"><code></asyxml>*/ +/*<asyxml><function type="void" signature="perpendicularmark(picture,point,vector,vector,real,pen,margin,filltype)"><code></asyxml>*/ void perpendicularmark(picture pic = currentpicture, point z, vector align, vector dir = E, real size = 0, @@ -1312,7 +1322,7 @@ void perpendicularmark(picture pic = currentpicture, point z, p, margin, filltype); } -/*<asyxml><function type = "void" signature = "perpendicularmark(picture, point, explicit pair, path, real, pen, margin, filltype)"><code></asyxml>*/ +/*<asyxml><function type="void" signature="perpendicularmark(picture,point,explicit pair,path,real,pen,margin,filltype)"><code></asyxml>*/ void perpendicularmark(picture pic = currentpicture, point z, explicit pair align, path g, real size = 0, pen p = currentpen, margin margin = NoMargin, @@ -1323,7 +1333,7 @@ void perpendicularmark(picture pic = currentpicture, point z, explicit pair alig perpendicularmark(pic, z, align, dir(g, 0), size, p, margin, filltype); } -/*<asyxml><function type = "void" signature = "perpendicularmark(picture, point, vector, path, real, pen, margin, filltype)"><code></asyxml>*/ +/*<asyxml><function type="void" signature="perpendicularmark(picture,point,vector,path,real,pen,margin,filltype)"><code></asyxml>*/ void perpendicularmark(picture pic = currentpicture, point z, vector align, path g, real size = 0, pen p = currentpen, margin margin = NoMargin, @@ -1334,7 +1344,7 @@ void perpendicularmark(picture pic = currentpicture, point z, vector align, path perpendicularmark(pic, z, (pair)align, dir(g, 0), size, p, margin, filltype); } -/*<asyxml><function type = "void" signature = "markrightangle(picture, point, point, point, real, pen, margin, filltype)"><code></asyxml>*/ +/*<asyxml><function type="void" signature="markrightangle(picture,point,point,point,real,pen,margin,filltype)"><code></asyxml>*/ void markrightangle(picture pic = currentpicture, point A, point O, point B, real size = 0, pen p = currentpen, margin margin = NoMargin, @@ -1351,7 +1361,7 @@ void markrightangle(picture pic = currentpicture, point A, point O, margin = margin, filltype = filltype); } -/*<asyxml><function type = "bool" signature = "simeq(point, point, real)"><code></asyxml>*/ +/*<asyxml><function type="bool" signature="simeq(point,point,real)"><code></asyxml>*/ bool simeq(point A, point B, real fuzz = epsgeo) {/*<asyxml></code><documentation>Return true iff abs(A - B) < fuzz. This routine is used internally to know if two points are equal, in particular by the operator == in 'point == point'.</documentation></function></asyxml>*/ @@ -1363,7 +1373,7 @@ bool simeq(point a, real b, real fuzz = epsgeo) return (abs(a - point(R, ((pair)b)/R)) < fuzz); } -/*<asyxml><function type = "pair" signature = "attract(pair, path, real)"><code></asyxml>*/ +/*<asyxml><function type="pair" signature="attract(pair,path,real)"><code></asyxml>*/ pair attract(pair m, path g, real fuzz = 0) {/*<asyxml></code><documentation>Return the nearest point (A PAIR) of 'm' which is on the path g. 'fuzz' is the argument 'fuzz' of 'intersect'.</documentation></function></asyxml>*/ @@ -1391,14 +1401,14 @@ pair attract(pair m, path g, real fuzz = 0) return p; } -/*<asyxml><function type = "point" signature = "attract(point, path, real)"><code></asyxml>*/ +/*<asyxml><function type="point" signature="attract(point,path,real)"><code></asyxml>*/ point attract(point M, path g, real fuzz = 0) {/*<asyxml></code><documentation>Return the nearest point (A POINT) of 'M' which is on the path g. 'fuzz' is the argument 'fuzz' of 'intersect'.</documentation></function></asyxml>*/ return point(M.coordsys, attract(locate(M), g)/M.coordsys); } -/*<asyxml><function type = "real[]" signature = "intersect(path, explicit pair)"><code></asyxml>*/ +/*<asyxml><function type="real[]" signature="intersect(path,explicit pair)"><code></asyxml>*/ real[] intersect(path g, explicit pair p, real fuzz = 0) {/*<asyxml></code><documentation></documentation></function></asyxml>*/ fuzz = fuzz <= 0 ? sqrt(realEpsilon) : fuzz; @@ -1411,7 +1421,7 @@ real[] intersect(path g, explicit pair p, real fuzz = 0) return or; } -/*<asyxml><function type = "real[]" signature = "intersect(path, explicit point)"><code></asyxml>*/ +/*<asyxml><function type="real[]" signature="intersect(path,explicit point)"><code></asyxml>*/ real[] intersect(path g, explicit point P, real fuzz = epsgeo) {/*<asyxml></code><documentation></documentation></function></asyxml>*/ return intersect(g, locate(P), fuzz); @@ -1421,18 +1431,18 @@ real[] intersect(path g, explicit point P, real fuzz = epsgeo) // *=======================================================* // *.........................LINES.........................* -/*<asyxml><struct signature = "line"><code></asyxml>*/ +/*<asyxml><struct signature="line"><code></asyxml>*/ struct line {/*<asyxml></code><documentation>This structure provides the objects line, semi - line and segment oriented from A to B. All the calculus with this structure will be as exact as Asymptote can do. For a full precision, you must not cast 'line' to 'path' excepted for drawing routines.</documentation></asyxml>*/ - /*<asyxml><property type = "point" signature = "A, B"><code></asyxml>*/ - restricted point A, B;/*<asyxml></code><documentation>Two line's points with same coordinate system.</documentation></property><property type = "bool" signature = "extendA, extendB"><code></asyxml>*/ - bool extendA, extendB;/*<asyxml></code><documentation>If true, extend 'l' in direction of A (resp. B).</documentation></property><property type = "vector" signature = "u, v"><code></asyxml>*/ - restricted vector u, v;/*<asyxml></code><documentation>u = unit(AB) = direction vector, v = normal vector.</documentation></property><property type = "real" signature = "a, b, c"><code></asyxml>*/ - restricted real a, b, c;/*<asyxml></code><documentation>Coefficients of the equation ax + by + c = 0 in the coordinate system of 'A'.</documentation></property><property type = "real" signature = "slope, origin"><code></asyxml>*/ + /*<asyxml><property type = "point" signature="A,B"><code></asyxml>*/ + restricted point A,B;/*<asyxml></code><documentation>Two line's points with same coordinate system.</documentation></property><property type = "bool" signature="extendA,extendB"><code></asyxml>*/ + bool extendA,extendB;/*<asyxml></code><documentation>If true,extend 'l' in direction of A (resp. B).</documentation></property><property type = "vector" signature="u,v"><code></asyxml>*/ + restricted vector u,v;/*<asyxml></code><documentation>u = unit(AB) = direction vector,v = normal vector.</documentation></property><property type = "real" signature="a,b,c"><code></asyxml>*/ + restricted real a,b,c;/*<asyxml></code><documentation>Coefficients of the equation ax + by + c = 0 in the coordinate system of 'A'.</documentation></property><property type = "real" signature="slope,origin"><code></asyxml>*/ restricted real slope, origin;/*<asyxml></code><documentation>Slope and ordinate at the origin.</documentation></property></asyxml>*/ - /*<asyxml><method type = "line" signature = "copy()"><code></asyxml>*/ + /*<asyxml><method type = "line" signature="copy()"><code></asyxml>*/ line copy() {/*<asyxml></code><documentation>Copy a line in a new instance.</documentation></method></asyxml>*/ line l = new line; @@ -1450,7 +1460,7 @@ struct line return l; } - /*<asyxml><method type = "void" signature = "init(point, bool, point, bool)"><code></asyxml>*/ + /*<asyxml><method type = "void" signature="init(point,bool,point,bool)"><code></asyxml>*/ void init(point A, bool extendA = true, point B, bool extendB = true) {/*<asyxml></code><documentation>Initialize line. If 'extendA' is true, the "line" is infinite in the direction of A.</documentation></method></asyxml>*/ @@ -1471,7 +1481,7 @@ struct line } }/*<asyxml></struct></asyxml>*/ -/*<asyxml><function type = "line" signature = "line(point, bool, point, bool)"><code></asyxml>*/ +/*<asyxml><function type="line" signature="line(point,bool,point,bool)"><code></asyxml>*/ line line(point A, bool extendA = true, point B, bool extendB = true) {/*<asyxml></code><documentation>Return the line passing through 'A' and 'B'. If 'extendA' is true, the "line" is infinite in the direction of A. @@ -1482,7 +1492,7 @@ line line(point A, bool extendA = true, point B, bool extendB = true) return l; } -/*<asyxml><struct signature = "segment"><code></asyxml>*/ +/*<asyxml><struct signature="segment"><code></asyxml>*/ struct segment {/*<asyxml></code><documentation><look href = "struct line"/>.</documentation></asyxml>*/ restricted point A, B;// Extremity. @@ -1515,7 +1525,7 @@ struct segment } }/*<asyxml></struct></asyxml>*/ -/*<asyxml><function type = "segment" signature = "segment(point, point)"><code></asyxml>*/ +/*<asyxml><function type="segment" signature="segment(point,point)"><code></asyxml>*/ segment segment(point A, point B) {/*<asyxml></code><documentation>Return the segment whose the extremities are A and B.</documentation></function></asyxml>*/ segment s; @@ -1523,37 +1533,37 @@ segment segment(point A, point B) return s; } -/*<asyxml><function type = "real" signature = "length(segment)"><code></asyxml>*/ +/*<asyxml><function type="real" signature="length(segment)"><code></asyxml>*/ real length(segment s) {/*<asyxml></code><documentation>Return the length of 's'.</documentation></function></asyxml>*/ return abs(s.A - s.B); } -/*<asyxml><operator type = "line" signature = "cast(segment)"><code></asyxml>*/ +/*<asyxml><operator type = "line" signature="cast(segment)"><code></asyxml>*/ line operator cast(segment s) {/*<asyxml></code><documentation>A segment is casted to a "finite line".</documentation></operator></asyxml>*/ return line(s.A, false, s.B, false); } -/*<asyxml><operator type = "segment" signature = "cast(line)"><code></asyxml>*/ +/*<asyxml><operator type = "segment" signature="cast(line)"><code></asyxml>*/ segment operator cast(line l) {/*<asyxml></code><documentation>Cast line 'l' to segment [l.A l.B].</documentation></operator></asyxml>*/ return segment(l.A, l.B); } -/*<asyxml><operator type = "line" signature = "*(transform, line)"><code></asyxml>*/ +/*<asyxml><operator type = "line" signature="*(transform,line)"><code></asyxml>*/ line operator *(transform t, line l) {/*<asyxml></code><documentation>Provide transform * line</documentation></operator></asyxml>*/ return line(t * l.A, l.extendA, t * l.B, l.extendB); } -/*<asyxml><operator type = "line" signature = "/(line, real)"><code></asyxml>*/ +/*<asyxml><operator type = "line" signature="/(line,real)"><code></asyxml>*/ line operator /(line l, real x) {/*<asyxml></code><documentation>Provide l/x. Return the line passing through l.A/x and l.B/x.</documentation></operator></asyxml>*/ return line(l.A/x, l.extendA, l.B/x, l.extendB); } line operator /(line l, int x){return line(l.A/x, l.B/x);} -/*<asyxml><operator type = "line" signature = "*(real, line)"><code></asyxml>*/ +/*<asyxml><operator type = "line" signature="*(real,line)"><code></asyxml>*/ line operator *(real x, line l) {/*<asyxml></code><documentation>Provide x * l. Return the line passing through x * l.A and x * l.B.</documentation></operator></asyxml>*/ @@ -1561,26 +1571,26 @@ line operator *(real x, line l) } line operator *(int x, line l){return line(x * l.A, l.extendA, x * l.B, l.extendB);} -/*<asyxml><operator type = "line" signature = "*(point, line)"><code></asyxml>*/ +/*<asyxml><operator type = "line" signature="*(point,line)"><code></asyxml>*/ line operator *(point M, line l) {/*<asyxml></code><documentation>Provide point * line. Return the line passing through unit(M) * l.A and unit(M) * l.B.</documentation></operator></asyxml>*/ return line(unit(M) * l.A, l.extendA, unit(M) * l.B, l.extendB); } -/*<asyxml><operator type = "line" signature = "+(line, point)"><code></asyxml>*/ +/*<asyxml><operator type = "line" signature="+(line,point)"><code></asyxml>*/ line operator +(line l, vector u) {/*<asyxml></code><documentation>Provide line + vector (and so line + point). Return the line 'l' shifted by 'u'.</documentation></operator></asyxml>*/ return line(l.A + u, l.extendA, l.B + u, l.extendB); } -/*<asyxml><operator type = "line" signature = "-(line, vector)"><code></asyxml>*/ +/*<asyxml><operator type = "line" signature="-(line,vector)"><code></asyxml>*/ line operator -(line l, vector u) {/*<asyxml></code><documentation>Provide line - vector (and so line - point). Return the line 'l' shifted by '-u'.</documentation></operator></asyxml>*/ return line(l.A - u, l.extendA, l.B - u, l.extendB); } -/*<asyxml><operator type = "line[]" signature = "^^(line, line)"><code></asyxml>*/ +/*<asyxml><operator type = "line[]" signature="^^(line,line)"><code></asyxml>*/ line[] operator ^^(line l1, line l2) {/*<asyxml></code><documentation>Provide line^^line. Return the line array {l1, l2}.</documentation></operator></asyxml>*/ @@ -1589,7 +1599,7 @@ line[] operator ^^(line l1, line l2) return ol; } -/*<asyxml><operator type = "line[]" signature = "^^(line, line[])"><code></asyxml>*/ +/*<asyxml><operator type = "line[]" signature="^^(line,line[])"><code></asyxml>*/ line[] operator ^^(line l1, line[] l2) {/*<asyxml></code><documentation>Provide line^^line[]. Return the line array {l1, l2[0], l2[1]...}. @@ -1608,7 +1618,7 @@ line[] operator ^^(line[] l2, line l1) return ol; } -/*<asyxml><operator type = "line[]" signature = "^^(line, line[])"><code></asyxml>*/ +/*<asyxml><operator type = "line[]" signature="^^(line,line[])"><code></asyxml>*/ line[] operator ^^(line l1[], line[] l2) {/*<asyxml></code><documentation>Provide line[]^^line[]. Return the line array {l1[0], l1[1], ..., l2[0], l2[1], ...}.</documentation></operator></asyxml>*/ @@ -1619,7 +1629,7 @@ line[] operator ^^(line l1[], line[] l2) return ol; } -/*<asyxml><function type = "bool" signature = "sameside(point, point, line)"><code></asyxml>*/ +/*<asyxml><function type="bool" signature="sameside(point,point,line)"><code></asyxml>*/ bool sameside(point M, point P, line l) {/*<asyxml></code><documentation>Return 'true' iff 'M' and 'N' are same side of the line (or on the line) 'l'.</documentation></function></asyxml>*/ pair A = l.A, B = l.B, m = M, p = P; @@ -1634,26 +1644,26 @@ bool sameside(point M, point P, line l) // return dot(locate(Mp - M), locate(Pp - P)) >= 0; } -/*<asyxml><function type = "line" signature = "line(segment)"><code></asyxml>*/ +/*<asyxml><function type="line" signature="line(segment)"><code></asyxml>*/ line line(segment s) {/*<asyxml></code><documentation>Return the line passing through 's.A' and 's.B'.</documentation></function></asyxml>*/ return line(s.A, s.B); } -/*<asyxml><function type = "segment" signature = "segment(line)"><code></asyxml>*/ +/*<asyxml><function type="segment" signature="segment(line)"><code></asyxml>*/ segment segment(line l) {/*<asyxml></code><documentation>Return the segment whose extremities are 'l.A' and 'l.B'.</documentation></function></asyxml>*/ return segment(l.A, l.B); } -/*<asyxml><function type = "point" signature = "midpoint(segment)"><code></asyxml>*/ +/*<asyxml><function type="point" signature="midpoint(segment)"><code></asyxml>*/ point midpoint(segment s) {/*<asyxml></code><documentation>Return the midpoint of 's'.</documentation></function></asyxml>*/ return 0.5 * (s.A + s.B); } -/*<asyxml><function type = "void" signature = "write(line)"><code></asyxml>*/ +/*<asyxml><function type="void" signature="write(line)"><code></asyxml>*/ void write(explicit line l) {/*<asyxml></code><documentation>Write some informations about 'l'.</documentation></function></asyxml>*/ write("A = "+(string)((pair)l.A)); @@ -1669,7 +1679,7 @@ void write(explicit line l) write("origin = "+(string) l.origin); } -/*<asyxml><function type = "void" signature = "write(explicit segment)"><code></asyxml>*/ +/*<asyxml><function type="void" signature="write(explicit segment)"><code></asyxml>*/ void write(explicit segment s) {/*<asyxml></code><documentation>Write some informations about 's'.</documentation></function></asyxml>*/ write("A = "+(string)((pair)s.A)); @@ -1683,7 +1693,7 @@ void write(explicit segment s) write("origin = "+(string) s.origin); } -/*<asyxml><operator type = "bool" signature = "==(line, line)"><code></asyxml>*/ +/*<asyxml><operator type = "bool" signature="==(line,line)"><code></asyxml>*/ bool operator ==(line l1, line l2) {/*<asyxml></code><documentation>Provide the test 'line == line'.</documentation></operator></asyxml>*/ return (collinear(l1.u, l2.u) && @@ -1691,13 +1701,13 @@ bool operator ==(line l1, line l2) l1.extendA == l2.extendA && l1.extendB == l2.extendB); } -/*<asyxml><operator type = "bool" signature = "!=(line, line)"><code></asyxml>*/ +/*<asyxml><operator type = "bool" signature="!=(line,line)"><code></asyxml>*/ bool operator !=(line l1, line l2) {/*<asyxml></code><documentation>Provide the test 'line != line'.</documentation></operator></asyxml>*/ return !(l1 == l2); } -/*<asyxml><operator type = "bool" signature = "@(point, line)"><code></asyxml>*/ +/*<asyxml><operator type = "bool" signature="@(point,line)"><code></asyxml>*/ bool operator @(point m, line l) {/*<asyxml></code><documentation>Provide the test 'point @ line'. Return true iff 'm' is on the 'l'.</documentation></operator></asyxml>*/ @@ -1709,19 +1719,19 @@ bool operator @(point m, line l) return sameside(M, l.B, l.A); } -/*<asyxml><function type = "coordsys" signature = "coordsys(line)"><code></asyxml>*/ +/*<asyxml><function type="coordsys" signature="coordsys(line)"><code></asyxml>*/ coordsys coordsys(line l) {/*<asyxml></code><documentation>Return the coordinate system in which 'l' is defined.</documentation></function></asyxml>*/ return l.A.coordsys; } -/*<asyxml><function type = "line" signature = "reverse(line)"><code></asyxml>*/ +/*<asyxml><function type="line" signature="reverse(line)"><code></asyxml>*/ line reverse(line l) {/*<asyxml></code><documentation>Permute the points 'A' and 'B' of 'l' and so its orientation.</documentation></function></asyxml>*/ return line(l.B, l.extendB, l.A, l.extendA); } -/*<asyxml><function type = "line" signature = "extend(line)"><code></asyxml>*/ +/*<asyxml><function type="line" signature="extend(line)"><code></asyxml>*/ line extend(line l) {/*<asyxml></code><documentation>Return the infinite line passing through 'l.A' and 'l.B'.</documentation></function></asyxml>*/ line ol = l.copy(); @@ -1730,7 +1740,7 @@ line extend(line l) return ol; } -/*<asyxml><function type = "line" signature = "complementary(explicit line)"><code></asyxml>*/ +/*<asyxml><function type="line" signature="complementary(explicit line)"><code></asyxml>*/ line complementary(explicit line l) {/*<asyxml></code><documentation>Return the complementary of a half-line with respect of the full line 'l'.</documentation></function></asyxml>*/ @@ -1742,7 +1752,7 @@ line complementary(explicit line l) return line(origin, false, ptdir); } -/*<asyxml><function type = "line[]" signature = "complementary(explicit segment)"><code></asyxml>*/ +/*<asyxml><function type="line[]" signature="complementary(explicit segment)"><code></asyxml>*/ line[] complementary(explicit segment s) {/*<asyxml></code><documentation>Return the two half-lines of origin 's.A' and 's.B' respectively.</documentation></function></asyxml>*/ line[] ol = new line[2]; @@ -1751,25 +1761,25 @@ line[] complementary(explicit segment s) return ol; } -/*<asyxml><function type = "line" signature = "Ox(coordsys)"><code></asyxml>*/ +/*<asyxml><function type="line" signature="Ox(coordsys)"><code></asyxml>*/ line Ox(coordsys R = currentcoordsys) {/*<asyxml></code><documentation>Return the x-axis of 'R'.</documentation></function></asyxml>*/ return line(point(R, (0, 0)), point(R, E)); } -/*<asyxml><constant type = "line" signature = "Ox"><code></asyxml>*/ +/*<asyxml><constant type = "line" signature="Ox"><code></asyxml>*/ restricted line Ox = Ox();/*<asyxml></code><documentation>the x-axis of the default coordinate system.</documentation></constant></asyxml>*/ -/*<asyxml><function type = "line" signature = "Oy(coordsys)"><code></asyxml>*/ +/*<asyxml><function type="line" signature="Oy(coordsys)"><code></asyxml>*/ line Oy(coordsys R = currentcoordsys) {/*<asyxml></code><documentation>Return the y-axis of 'R'.</documentation></function></asyxml>*/ return line(point(R, (0, 0)), point(R, N)); } -/*<asyxml><constant type = "line" signature = "Oy"><code></asyxml>*/ +/*<asyxml><constant type = "line" signature="Oy"><code></asyxml>*/ restricted line Oy = Oy();/*<asyxml></code><documentation>the y-axis of the default coordinate system.</documentation></constant></asyxml>*/ -/*<asyxml><function type = "line" signature = "line(real, point)"><code></asyxml>*/ +/*<asyxml><function type="line" signature="line(real,point)"><code></asyxml>*/ line line(real a, point A = point(currentcoordsys, (0, 0))) {/*<asyxml></code><documentation>Return the line passing through 'A' with an angle (in the coordinate system of A) 'a' in degrees. @@ -1785,7 +1795,7 @@ line line(int a, point A = point(currentcoordsys, (0, 0))) return line((real)a, A); } -/*<asyxml><function type = "line" signature = "line(coordsys, real, real)"><code></asyxml>*/ +/*<asyxml><function type="line" signature="line(coordsys,real,real)"><code></asyxml>*/ line line(coordsys R = currentcoordsys, real slope, real origin) {/*<asyxml></code><documentation>Return the line defined by slope and y-intercept relative to 'R'.</documentation></function></asyxml>*/ if (slope == infinity || slope == -infinity) @@ -1793,7 +1803,7 @@ line line(coordsys R = currentcoordsys, real slope, real origin) return line(point(R, (0, origin)), point(R, (1, origin + slope))); } -/*<asyxml><function type = "line" signature = "line(coordsys, real, real, real)"><code></asyxml>*/ +/*<asyxml><function type="line" signature="line(coordsys,real,real,real)"><code></asyxml>*/ line line(coordsys R = currentcoordsys, real a, real b, real c) {/*<asyxml></code><documentation>Retrun the line defined by equation relative to 'R'.</documentation></function></asyxml>*/ if (a == 0 && b == 0) abort("line: inconsistent equation..."); @@ -1802,29 +1812,29 @@ line line(coordsys R = currentcoordsys, real a, real b, real c) return line(point(R, M), point(R, M + (-b, a))); } -/*<asyxml><function type = "line" signature = "vline(coordsys)"><code></asyxml>*/ +/*<asyxml><function type="line" signature="vline(coordsys)"><code></asyxml>*/ line vline(coordsys R = currentcoordsys) {/*<asyxml></code><documentation>Return a vertical line in 'R' passing through the origin of 'R'.</documentation></function></asyxml>*/ point P = point(R, (0, 0)); point PP = point(R, (R.O + N)/R); return line(P, PP); } -/*<asyxml><constant type = "line" signature = "vline"><code></asyxml>*/ +/*<asyxml><constant type = "line" signature="vline"><code></asyxml>*/ restricted line vline = vline();/*<asyxml></code><documentation>The vertical line in the current coordinate system passing through the origin of this system.</documentation></constant></asyxml>*/ -/*<asyxml><function type = "line" signature = "hline(coordsys)"><code></asyxml>*/ +/*<asyxml><function type="line" signature="hline(coordsys)"><code></asyxml>*/ line hline(coordsys R = currentcoordsys) {/*<asyxml></code><documentation>Return a horizontal line in 'R' passing through the origin of 'R'.</documentation></function></asyxml>*/ point P = point(R, (0, 0)); point PP = point(R, (R.O + E)/R); return line(P, PP); } -/*<asyxml><constant type = "line" signature = "hline"><code></asyxml>*/ +/*<asyxml><constant type = "line" signature="hline"><code></asyxml>*/ line hline = hline();/*<asyxml></code><documentation>The horizontal line in the current coordinate system passing through the origin of this system.</documentation></constant></asyxml>*/ -/*<asyxml><function type = "line" signature = "changecoordsys(coordsys, line)"><code></asyxml>*/ +/*<asyxml><function type="line" signature="changecoordsys(coordsys,line)"><code></asyxml>*/ line changecoordsys(coordsys R, line l) {/*<asyxml></code><documentation>Return the line 'l' in the coordinate system 'R'.</documentation></function></asyxml>*/ point A = changecoordsys(R, l.A); @@ -1832,20 +1842,20 @@ line changecoordsys(coordsys R, line l) return line(A, B); } -/*<asyxml><function type = "transform" signature = "scale(real, line, line, bool)"><code></asyxml>*/ +/*<asyxml><function type="transform" signature="scale(real,line,line,bool)"><code></asyxml>*/ transform scale(real k, line l1, line l2, bool safe = false) {/*<asyxml></code><documentation>Return the dilatation with respect to 'l1' in the direction of 'l2'.</documentation></function></asyxml>*/ return scale(k, l1.A, l1.B, l2.A, l2.B, safe); } -/*<asyxml><function type = "transform" signature = "reflect(line)"><code></asyxml>*/ +/*<asyxml><function type="transform" signature="reflect(line)"><code></asyxml>*/ transform reflect(line l) {/*<asyxml></code><documentation>Return the reflect about the line 'l'.</documentation></function></asyxml>*/ return reflect((pair)l.A, (pair)l.B); } -/*<asyxml><function type = "transform" signature = "reflect(line, line)"><code></asyxml>*/ +/*<asyxml><function type="transform" signature="reflect(line,line)"><code></asyxml>*/ transform reflect(line l1, line l2, bool safe = false) {/*<asyxml></code><documentation>Return the reflect about the line 'l1' in the direction of 'l2'.</documentation></function></asyxml>*/ @@ -1853,7 +1863,7 @@ transform reflect(line l1, line l2, bool safe = false) } -/*<asyxml><function type = "point[]" signature = "intersectionpoints(line, path)"><code></asyxml>*/ +/*<asyxml><function type="point[]" signature="intersectionpoints(line,path)"><code></asyxml>*/ point[] intersectionpoints(line l, path g) {/*<asyxml></code><documentation>Return all points of intersection of the line 'l' with the path 'g'.</documentation></function></asyxml>*/ // TODO utiliser la version 1.44 de intersections(path g, pair p, pair q) @@ -1905,7 +1915,7 @@ point[] intersectionpoints(line l, path g) return opp; } -/*<asyxml><function type = "point" signature = "intersectionpoint(line, line)"><code></asyxml>*/ +/*<asyxml><function type="point" signature="intersectionpoint(line,line)"><code></asyxml>*/ point intersectionpoint(line l1, line l2) {/*<asyxml></code><documentation>Return the point of intersection of line 'l1' with 'l2'. If 'l1' and 'l2' have an infinity or none point of intersection, @@ -1920,7 +1930,7 @@ point intersectionpoint(line l1, line l2) return point(R, (infinity, infinity)); } -/*<asyxml><function type = "line" signature = "parallel(point, line)"><code></asyxml>*/ +/*<asyxml><function type="line" signature="parallel(point,line)"><code></asyxml>*/ line parallel(point M, line l) {/*<asyxml></code><documentation>Return the line parallel to 'l' passing through 'M'.</documentation></function></asyxml>*/ point A, B; @@ -1932,26 +1942,26 @@ line parallel(point M, line l) return line(M, M - A + B); } -/*<asyxml><function type = "line" signature = "parallel(point, explicit vector)"><code></asyxml>*/ +/*<asyxml><function type="line" signature="parallel(point,explicit vector)"><code></asyxml>*/ line parallel(point M, explicit vector dir) {/*<asyxml></code><documentation>Return the line of direction 'dir' and passing through 'M'.</documentation></function></asyxml>*/ return line(M, M + locate(dir)); } -/*<asyxml><function type = "line" signature = "parallel(point, explicit pair)"><code></asyxml>*/ +/*<asyxml><function type="line" signature="parallel(point,explicit pair)"><code></asyxml>*/ line parallel(point M, explicit pair dir) {/*<asyxml></code><documentation>Return the line of direction 'dir' and passing through 'M'.</documentation></function></asyxml>*/ return line(M, M + vector(currentcoordsys, dir)); } -/*<asyxml><function type = "bool" signature = "parallel(line, line)"><code></asyxml>*/ +/*<asyxml><function type="bool" signature="parallel(line,line)"><code></asyxml>*/ bool parallel(line l1, line l2, bool strictly = false) {/*<asyxml></code><documentation>Return 'true' if 'l1' and 'l2' are (strictly ?) parallel.</documentation></function></asyxml>*/ bool coll = collinear(l1.u, l2.u); return strictly ? coll && (l1 != l2) : coll; } -/*<asyxml><function type = "bool" signature = "concurrent(...line[])"><code></asyxml>*/ +/*<asyxml><function type="bool" signature="concurrent(...line[])"><code></asyxml>*/ bool concurrent(... line[] l) {/*<asyxml></code><documentation>Returns true if all the lines 'l' are concurrent.</documentation></function></asyxml>*/ if (l.length < 3) abort("'concurrent' needs at least for three lines ..."); @@ -1965,13 +1975,13 @@ bool concurrent(... line[] l) return conc; } -/*<asyxml><function type = "transform" signature = "projection(line)"><code></asyxml>*/ +/*<asyxml><function type="transform" signature="projection(line)"><code></asyxml>*/ transform projection(line l) {/*<asyxml></code><documentation>Return the orthogonal projection on 'l'.</documentation></function></asyxml>*/ return projection(l.A, l.B); } -/*<asyxml><function type = "transform" signature = "projection(line, line, bool)"><code></asyxml>*/ +/*<asyxml><function type="transform" signature="projection(line,line,bool)"><code></asyxml>*/ transform projection(line l1, line l2, bool safe = false) {/*<asyxml></code><documentation>Return the projection on (AB) in parallel of (CD). If 'safe = true' and (l1)//(l2) return the identity. @@ -1979,7 +1989,7 @@ transform projection(line l1, line l2, bool safe = false) return projection(l1.A, l1.B, l2.A, l2.B, safe); } -/*<asyxml><function type = "transform" signature = "vprojection(line, bool)"><code></asyxml>*/ +/*<asyxml><function type="transform" signature="vprojection(line,bool)"><code></asyxml>*/ transform vprojection(line l, bool safe = false) {/*<asyxml></code><documentation>Return the projection on 'l' in parallel of N--S. If 'safe' is 'true' the projected point keeps the same place if 'l' @@ -1988,7 +1998,7 @@ transform vprojection(line l, bool safe = false) return projection(l, line(point(R, N), point(R, S)), safe); } -/*<asyxml><function type = "transform" signature = "hprojection(line, bool)"><code></asyxml>*/ +/*<asyxml><function type="transform" signature="hprojection(line,bool)"><code></asyxml>*/ transform hprojection(line l, bool safe = false) {/*<asyxml></code><documentation>Return the projection on 'l' in parallel of E--W. If 'safe' is 'true' the projected point keeps the same place if 'l' @@ -1997,7 +2007,7 @@ transform hprojection(line l, bool safe = false) return projection(l, line(point(R, E), point(R, W)), safe); } -/*<asyxml><function type = "line" signature = "perpendicular(point, line)"><code></asyxml>*/ +/*<asyxml><function type="line" signature="perpendicular(point,line)"><code></asyxml>*/ line perpendicular(point M, line l) {/*<asyxml></code><documentation>Return the perpendicular line of 'l' passing through 'M'.</documentation></function></asyxml>*/ point Mp = projection(l) * M; @@ -2005,41 +2015,41 @@ line perpendicular(point M, line l) return line(Mp, rotate(90, Mp) * A); } -/*<asyxml><function type = "line" signature = "perpendicular(point, explicit vector)"><code></asyxml>*/ +/*<asyxml><function type="line" signature="perpendicular(point,explicit vector)"><code></asyxml>*/ line perpendicular(point M, explicit vector normal) {/*<asyxml></code><documentation>Return the line passing through 'M' whose normal is \param{normal}.</documentation></function></asyxml>*/ return perpendicular(M, line(M, M + locate(normal))); } -/*<asyxml><function type = "line" signature = "perpendicular(point, explicit pair)"><code></asyxml>*/ +/*<asyxml><function type="line" signature="perpendicular(point,explicit pair)"><code></asyxml>*/ line perpendicular(point M, explicit pair normal) {/*<asyxml></code><documentation>Return the line passing through 'M' whose normal is \param{normal} (given in the currentcoordsys).</documentation></function></asyxml>*/ return perpendicular(M, line(M, M + vector(currentcoordsys, normal))); } -/*<asyxml><function type = "bool" signature = "perpendicular(line, line)"><code></asyxml>*/ +/*<asyxml><function type="bool" signature="perpendicular(line,line)"><code></asyxml>*/ bool perpendicular(line l1, line l2) {/*<asyxml></code><documentation>Return 'true' if 'l1' and 'l2' are perpendicular.</documentation></function></asyxml>*/ return abs(dot(locate(l1.u), locate(l2.u))) < epsgeo ; } -/*<asyxml><function type = "real" signature = "angle(line, coordsys)"><code></asyxml>*/ +/*<asyxml><function type="real" signature="angle(line,coordsys)"><code></asyxml>*/ real angle(line l, coordsys R = coordsys(l)) {/*<asyxml></code><documentation>Return the angle of the oriented line 'l', in radian, in the interval ]-pi, pi] and relatively to 'R'.</documentation></function></asyxml>*/ return angle(l.u, R, false); } -/*<asyxml><function type = "real" signature = "degrees(line, coordsys, bool)"><code></asyxml>*/ +/*<asyxml><function type="real" signature="degrees(line,coordsys,bool)"><code></asyxml>*/ real degrees(line l, coordsys R = coordsys(l)) {/*<asyxml></code><documentation>Returns the angle of the oriented line 'l' in degrees, in the interval [0, 360[ and relatively to 'R'.</documentation></function></asyxml>*/ return degrees(angle(l, R)); } -/*<asyxml><function type = "real" signature = "sharpangle(line, line)"><code></asyxml>*/ +/*<asyxml><function type="real" signature="sharpangle(line,line)"><code></asyxml>*/ real sharpangle(line l1, line l2) {/*<asyxml></code><documentation>Return the measure in radians of the sharp angle formed by 'l1' and 'l2'.</documentation></function></asyxml>*/ vector u1 = l1.u; @@ -2054,26 +2064,26 @@ real sharpangle(line l1, line l2) return a12; } -/*<asyxml><function type = "real" signature = "angle(line, line)"><code></asyxml>*/ +/*<asyxml><function type="real" signature="angle(line,line)"><code></asyxml>*/ real angle(line l1, line l2) {/*<asyxml></code><documentation>Return the measure in radians of oriented angle (l1.u, l2.u).</documentation></function></asyxml>*/ return angle(locate(l2.u)) - angle(locate(l1.u)); } -/*<asyxml><function type = "real" signature = "degrees(line, line)"><code></asyxml>*/ +/*<asyxml><function type="real" signature="degrees(line,line)"><code></asyxml>*/ real degrees(line l1, line l2) {/*<asyxml></code><documentation>Return the measure in degrees of the angle formed by the oriented lines 'l1' and 'l2'.</documentation></function></asyxml>*/ return degrees(angle(l1, l2)); } -/*<asyxml><function type = "real" signature = "sharpdegrees(line, line)"><code></asyxml>*/ +/*<asyxml><function type="real" signature="sharpdegrees(line,line)"><code></asyxml>*/ real sharpdegrees(line l1, line l2) {/*<asyxml></code><documentation>Return the measure in degrees of the sharp angle formed by 'l1' and 'l2'.</documentation></function></asyxml>*/ return degrees(sharpangle(l1, l2)); } -/*<asyxml><function type = "line" signature = "bisector(line, line, real, bool)"><code></asyxml>*/ +/*<asyxml><function type="line" signature="bisector(line,line,real,bool)"><code></asyxml>*/ line bisector(line l1, line l2, real angle = 0, bool sharp = true) {/*<asyxml></code><documentation>Return the bisector of the angle formed by 'l1' and 'l2' rotated by the angle 'angle' (in degrees) around intersection point of 'l1' with 'l2'. @@ -2096,7 +2106,7 @@ line bisector(line l1, line l2, real angle = 0, bool sharp = true) return ol; } -/*<asyxml><function type = "line" signature = "sector(int, int, line, line, real, bool)"><code></asyxml>*/ +/*<asyxml><function type="line" signature="sector(int,int,line,line,real,bool)"><code></asyxml>*/ line sector(int n = 2, int p = 1, line l1, line l2, real angle = 0, bool sharp = true) {/*<asyxml></code><documentation>Return the p-th nth-sector of the angle formed by the oriented line 'l1' and 'l2' @@ -2117,7 +2127,7 @@ line sector(int n = 2, int p = 1, line l1, line l2, real angle = 0, bool sharp = return ol; } -/*<asyxml><function type = "line" signature = "bisector(point, point, point, point, real)"><code></asyxml>*/ +/*<asyxml><function type="line" signature="bisector(point,point,point,point,real)"><code></asyxml>*/ line bisector(point A, point B, point C, point D, real angle = 0, bool sharp = true) {/*<asyxml></code><documentation>Return the bisector of the angle formed by the lines (AB) and (CD). <look href = "#bisector(line, line, real, bool)"/>.</documentation></function></asyxml>*/ @@ -2125,7 +2135,7 @@ line bisector(point A, point B, point C, point D, real angle = 0, bool sharp = t return bisector(line(P[0], P[1]), line(P[2], P[3]), angle, sharp); } -/*<asyxml><function type = "line" signature = "bisector(segment, real)"><code></asyxml>*/ +/*<asyxml><function type="line" signature="bisector(segment,real)"><code></asyxml>*/ line bisector(segment s, real angle = 0) {/*<asyxml></code><documentation>Return the bisector of the segment line 's' rotated by 'angle' (in degrees) around the midpoint of 's'.</documentation></function></asyxml>*/ @@ -2135,7 +2145,7 @@ line bisector(segment s, real angle = 0) return rotate(angle, m) * line(m + dir, m - dir); } -/*<asyxml><function type = "line" signature = "bisector(point, point, real)"><code></asyxml>*/ +/*<asyxml><function type="line" signature="bisector(point,point,real)"><code></asyxml>*/ line bisector(point A, point B, real angle = 0) {/*<asyxml></code><documentation>Return the bisector of the segment line [AB] rotated by 'angle' (in degrees) around the midpoint of [AB].</documentation></function></asyxml>*/ @@ -2143,7 +2153,7 @@ line bisector(point A, point B, real angle = 0) return bisector(segment(P[0], P[1]), angle); } -/*<asyxml><function type = "real" signature = "distance(point, line)"><code></asyxml>*/ +/*<asyxml><function type="real" signature="distance(point,line)"><code></asyxml>*/ real distance(point M, line l) {/*<asyxml></code><documentation>Return the distance from 'M' to 'l'. distance(line, point) is also defined.</documentation></function></asyxml>*/ @@ -2159,7 +2169,7 @@ real distance(line l, point M) return distance(M, l); } -/*<asyxml><function type = "void" signature = "draw(picture, Label, line, bool, bool, align, pen, arrowbar, Label, marker)"><code></asyxml>*/ +/*<asyxml><function type="void" signature="draw(picture,Label,line,bool,bool,align,pen,arrowbar,Label,marker)"><code></asyxml>*/ void draw(picture pic = currentpicture, Label L = "", line l, bool dirA = l.extendA, bool dirB = l.extendB, align align = NoAlign, pen p = currentpen, @@ -2176,7 +2186,7 @@ void draw(picture pic = currentpicture, Label L = "", legend, marker, pathModifier); } -/*<asyxml><function type = "void" signature = "draw(picture, Label[], line[], align, pen[], arrowbar, Label, marker)"><code></asyxml>*/ +/*<asyxml><function type="void" signature="draw(picture,Label[], line[], align,pen[], arrowbar,Label,marker)"><code></asyxml>*/ void draw(picture pic = currentpicture, Label[] L = new Label[], line[] l, align align = NoAlign, pen[] p = new pen[], arrowbar arrow = None, @@ -2191,7 +2201,7 @@ void draw(picture pic = currentpicture, Label[] L = new Label[], line[] l, } } -/*<asyxml><function type = "void" signature = "draw(picture, Label[], line[], align, pen, arrowbar, Label, marker)"><code></asyxml>*/ +/*<asyxml><function type="void" signature="draw(picture,Label[], line[], align,pen,arrowbar,Label,marker)"><code></asyxml>*/ void draw(picture pic = currentpicture, Label[] L = new Label[], line[] l, align align = NoAlign, pen p, arrowbar arrow = None, @@ -2202,7 +2212,7 @@ void draw(picture pic = currentpicture, Label[] L = new Label[], line[] l, draw(pic, L, l, align, tp, arrow, legend, marker, pathModifier); } -/*<asyxml><function type = "void" signature = "show(picture, line, pen)"><code></asyxml>*/ +/*<asyxml><function type="void" signature="show(picture,line,pen)"><code></asyxml>*/ void show(picture pic = currentpicture, line l, pen p = red) {/*<asyxml></code><documentation>Draw some informations of 'l'.</documentation></function></asyxml>*/ dot("$A$", (pair)l.A, align = -locate(l.v), p); @@ -2212,7 +2222,7 @@ void show(picture pic = currentpicture, line l, pen p = red) draw("$\vec{v}$", locate(l.A)--locate(l.A + l.v), p, Arrow); } -/*<asyxml><function type = "point[]" signature = "sameside(point, line, line)"><code></asyxml>*/ +/*<asyxml><function type="point[]" signature="sameside(point,line,line)"><code></asyxml>*/ point[] sameside(point M, line l1, line l2) {/*<asyxml></code><documentation>Return two points on 'l1' and 'l2' respectively. The first point is from the same side of M relatively to 'l2', @@ -2233,77 +2243,77 @@ point[] sameside(point M, line l1, line l2) return op; } -// /*<asyxml><function type = "void" signature = "markangle(picture, Label, int, real, real, line, line, explicit pair, arrowbar, pen, filltype, margin, marker)"><code></asyxml>*/ -// void markangle(picture pic = currentpicture, -// Label L = "", int n = 1, real radius = 0, real space = 0, -// line l1, line l2, explicit pair align = dir(1), -// arrowbar arrow = None, pen p = currentpen, -// filltype filltype = NoFill, -// margin margin = NoMargin, marker marker = nomarker) -// {/*<asyxml></code><documentation>Mark the angle (l1, l2) aligned in the direction 'align' relative to 'l1'. -// Commune values for 'align' are dir(real).</documentation></function></asyxml>*/ -// if (parallel(l1, l2, true)) return; -// real al = degrees(l1, defaultcoordsys); -// pair O, A, B; -// if (radius == 0) radius = markangleradius(p); -// real d = degrees(locate(l1.u)); -// align = rotate(d) * align; -// if (l1 == l2) { -// O = midpoint(segment(l1.A, l1.B)); -// A = l1.A;B = l1.B; -// if (sameside(rotate(sgn(angle(B-A)) * 45, O) * A, O + align, l1)) {radius = -radius;} -// } else { -// O = intersectionpoint(extend(l1), extend(l2)); -// pair R = O + align; -// point [] ss = sameside(point(coordsys(l1), R/coordsys(l1)), l1, l2); -// A = ss[0]; -// B = ss[1]; -// } -// markangle(pic = pic, L = L, n = n, radius = radius, space = space, -// O = O, A = A, B = B, -// arrow = arrow, p = p, filltype = filltype, -// margin = margin, marker = marker); -// } - -// /*<asyxml><function type = "void" signature = "markangle(picture, Label, int, real, real, line, line, explicit vector, arrowbar, pen, filltype, margin, marker)"><code></asyxml>*/ -// void markangle(picture pic = currentpicture, -// Label L = "", int n = 1, real radius = 0, real space = 0, -// line l1, line l2, explicit vector align, -// arrowbar arrow = None, pen p = currentpen, -// filltype filltype = NoFill, -// margin margin = NoMargin, marker marker = nomarker) -// {/*<asyxml></code><documentation>Mark the angle (l1, l2) in the direction 'dir' given relatively to 'l1'.</documentation></function></asyxml>*/ -// markangle(pic, L, n, radius, space, l1, l2, (pair)align, arrow, -// p, filltype, margin, marker); -// } - -/*<asyxml><function type = "void" signature = "markangle(picture, Label, int, real, real, line, line, arrowbar, pen, filltype, margin, marker)"><code></asyxml>*/ +/*<asyxml><function type="void" signature="markangle(picture,Label,int,real,real,explicit line,explicit line,explicit pair,arrowbar,pen,filltype,margin,marker)"><code></asyxml>*/ void markangle(picture pic = currentpicture, Label L = "", int n = 1, real radius = 0, real space = 0, - line l1, line l2, + explicit line l1, explicit line l2, explicit pair align = dir(1), arrowbar arrow = None, pen p = currentpen, filltype filltype = NoFill, margin margin = NoMargin, marker marker = nomarker) -{/*<asyxml></code><documentation>Mark the oriented angle (l1, l2).</documentation></function></asyxml>*/ +{/*<asyxml></code><documentation>Mark the angle (l1, l2) aligned in the direction 'align' relative to 'l1'. + Commune values for 'align' are dir(real).</documentation></function></asyxml>*/ if (parallel(l1, l2, true)) return; real al = degrees(l1, defaultcoordsys); pair O, A, B; if (radius == 0) radius = markangleradius(p); real d = degrees(locate(l1.u)); + align = rotate(d) * align; if (l1 == l2) { O = midpoint(segment(l1.A, l1.B)); + A = l1.A;B = l1.B; + if (sameside(rotate(sgn(angle(B-A)) * 45, O) * A, O + align, l1)) {radius = -radius;} } else { O = intersectionpoint(extend(l1), extend(l2)); + pair R = O + align; + point [] ss = sameside(point(coordsys(l1), R/coordsys(l1)), l1, l2); + A = ss[0]; + B = ss[1]; } - A = O + locate(l1.u); - B = O + locate(l2.u); markangle(pic = pic, L = L, n = n, radius = radius, space = space, O = O, A = A, B = B, arrow = arrow, p = p, filltype = filltype, margin = margin, marker = marker); } -/*<asyxml><function type = "void" signature = "perpendicularmark(picture, line, line, real, pen, int, margin, filltype)"><code></asyxml>*/ +/*<asyxml><function type="void" signature="markangle(picture,Label,int,real,real,explicit line,explicit line,explicit vector,arrowbar,pen,filltype,margin,marker)"><code></asyxml>*/ +void markangle(picture pic = currentpicture, + Label L = "", int n = 1, real radius = 0, real space = 0, + explicit line l1, explicit line l2, explicit vector align, + arrowbar arrow = None, pen p = currentpen, + filltype filltype = NoFill, + margin margin = NoMargin, marker marker = nomarker) +{/*<asyxml></code><documentation>Mark the angle (l1, l2) in the direction 'dir' given relatively to 'l1'.</documentation></function></asyxml>*/ + markangle(pic, L, n, radius, space, l1, l2, (pair)align, arrow, + p, filltype, margin, marker); +} + +/*<asyxml><function type="void" signature="markangle(picture,Label,int,real,real,line,line,arrowbar,pen,filltype,margin,marker)"><code></asyxml>*/ +// void markangle(picture pic = currentpicture, +// Label L = "", int n = 1, real radius = 0, real space = 0, +// explicit line l1, explicit line l2, +// arrowbar arrow = None, pen p = currentpen, +// filltype filltype = NoFill, +// margin margin = NoMargin, marker marker = nomarker) +// {/*<asyxml></code><documentation>Mark the oriented angle (l1, l2).</documentation></function></asyxml>*/ +// if (parallel(l1, l2, true)) return; +// real al = degrees(l1, defaultcoordsys); +// pair O, A, B; +// if (radius == 0) radius = markangleradius(p); +// real d = degrees(locate(l1.u)); +// if (l1 == l2) { +// O = midpoint(segment(l1.A, l1.B)); +// } else { +// O = intersectionpoint(extend(l1), extend(l2)); +// } +// A = O + locate(l1.u); +// B = O + locate(l2.u); +// markangle(pic = pic, L = L, n = n, radius = radius, space = space, +// O = O, A = A, B = B, +// arrow = arrow, p = p, filltype = filltype, +// margin = margin, marker = marker); +// } + +/*<asyxml><function type="void" signature="perpendicularmark(picture,line,line,real,pen,int,margin,filltype)"><code></asyxml>*/ void perpendicularmark(picture pic = currentpicture, line l1, line l2, real size = 0, pen p = currentpen, int quarter = 1, margin margin = NoMargin, filltype filltype = NoFill) @@ -2319,15 +2329,15 @@ void perpendicularmark(picture pic = currentpicture, line l1, line l2, // *=======================================================* // *........................CONICS.........................* -/*<asyxml><struct signature = "bqe"><code></asyxml>*/ +/*<asyxml><struct signature="bqe"><code></asyxml>*/ struct bqe {/*<asyxml></code><documentation>Bivariate Quadratic Equation.</documentation></asyxml>*/ - /*<asyxml><property type = "real[]" signature = "a"><code></asyxml>*/ - real[] a;/*<asyxml></code><documentation>a[0] * x^2 + a[1] * x * y + a[2] * y^2 + a[3] * x + a[4] * y + a[5] = 0</documentation></property><property type = "coordsys" signature = "coordsys"><code></asyxml>*/ + /*<asyxml><property type = "real[]" signature="a"><code></asyxml>*/ + real[] a;/*<asyxml></code><documentation>a[0] * x^2 + a[1] * x * y + a[2] * y^2 + a[3] * x + a[4] * y + a[5] = 0</documentation></property><property type = "coordsys" signature="coordsys"><code></asyxml>*/ coordsys coordsys;/*<asyxml></code></property></asyxml>*/ }/*<asyxml></struct></asyxml>*/ -/*<asyxml><function type = "bqe" signature = "bqe(coordsys, real, real, real, real, real, real)"><code></asyxml>*/ +/*<asyxml><function type="bqe" signature="bqe(coordsys,real,real,real,real,real,real)"><code></asyxml>*/ bqe bqe(coordsys R = currentcoordsys, real a, real b, real c, real d, real e, real f) {/*<asyxml></code><documentation>Return the bivariate quadratic equation @@ -2339,7 +2349,7 @@ bqe bqe(coordsys R = currentcoordsys, return obqe; } -/*<asyxml><function type = "bqe" signature = "changecoordsys(coordsys, bqe)"><code></asyxml>*/ +/*<asyxml><function type="bqe" signature="changecoordsys(coordsys,bqe)"><code></asyxml>*/ bqe changecoordsys(coordsys R, bqe bqe) {/*<asyxml></code><documentation>Returns the bivariate quadratic equation relatively to 'R'.</documentation></function></asyxml>*/ pair i = coordinates(changecoordsys(R, vector(defaultcoordsys, @@ -2372,7 +2382,7 @@ bqe changecoordsys(coordsys R, bqe bqe) return obqe; } -/*<asyxml><function type = "bqe" signature = "bqe(point, point, point, point, point)"><code></asyxml>*/ +/*<asyxml><function type="bqe" signature="bqe(point,point,point,point,point)"><code></asyxml>*/ bqe bqe(point M1, point M2, point M3, point M4, point M5) {/*<asyxml></code><documentation>Return the bqe of conic passing through the five points (if possible).</documentation></function></asyxml>*/ coordsys R; @@ -2407,7 +2417,7 @@ bqe bqe(point M1, point M2, point M3, point M4, point M5) return bqe; } -/*<asyxml><function type = "bool" signature = "samecoordsys(bool...bqe[])"><code></asyxml>*/ +/*<asyxml><function type="bool" signature="samecoordsys(bool...bqe[])"><code></asyxml>*/ bool samecoordsys(bool warn = true ... bqe[] bqes) {/*<asyxml></code><documentation>Return true if all the bivariate quadratic equations have the same coordinate system.</documentation></function></asyxml>*/ bool ret = true; @@ -2425,7 +2435,7 @@ system."); return ret; } -/*<asyxml><function type = "real[]" signature = "realquarticroots(real, real, real, real, real)"><code></asyxml>*/ +/*<asyxml><function type="real[]" signature="realquarticroots(real,real,real,real,real)"><code></asyxml>*/ real[] realquarticroots(real a, real b, real c, real d, real e) {/*<asyxml></code><documentation>Return the real roots of the quartic equation ax^4 + b^x3 + cx^2 + dx = 0.</documentation></function></asyxml>*/ static real Fuzz = sqrt(realEpsilon); @@ -2469,7 +2479,7 @@ real[] realquarticroots(real a, real b, real c, real d, real e) return roots; } -/*<asyxml><function type = "point[]" signature = "intersectionpoints(bqe, bqe)"><code></asyxml>*/ +/*<asyxml><function type="point[]" signature="intersectionpoints(bqe,bqe)"><code></asyxml>*/ point[] intersectionpoints(bqe bqe1, bqe bqe2) {/*<asyxml></code><documentation>Return the interscetion of the two conic sections whose equations are 'bqe1' and 'bqe2'.</documentation></function></asyxml>*/ coordsys R = bqe1.coordsys; @@ -2544,13 +2554,13 @@ point[] intersectionpoints(bqe bqe1, bqe bqe2) return P; } -/*<asyxml><struct signature = "conic"><code></asyxml>*/ +/*<asyxml><struct signature="conic"><code></asyxml>*/ struct conic -{/*<asyxml></code><documentation></documentation><property type = "real" signature = "e, p, h"><code></asyxml>*/ +{/*<asyxml></code><documentation></documentation><property type = "real" signature="e,p,h"><code></asyxml>*/ real e, p, h;/*<asyxml></code><documentation>BE CAREFUL: h = distance(F, D) and p = h * e (http://en.wikipedia.org/wiki/Ellipse) - While http://mathworld.wolfram.com/ takes p = distance(F, D).</documentation></property><property type = "point" signature = "F"><code></asyxml>*/ - point F;/*<asyxml></code><documentation>Focus.</documentation></property><property type = "line" signature = "D"><code></asyxml>*/ - line D;/*<asyxml></code><documentation>Directrix.</documentation></property><property type = "line" signature = "l"><code></asyxml>*/ + While http://mathworld.wolfram.com/ takes p = distance(F,D).</documentation></property><property type = "point" signature="F"><code></asyxml>*/ + point F;/*<asyxml></code><documentation>Focus.</documentation></property><property type = "line" signature="D"><code></asyxml>*/ + line D;/*<asyxml></code><documentation>Directrix.</documentation></property><property type = "line" signature="l"><code></asyxml>*/ line[] l;/*<asyxml></code><documentation>Case of degenerated conic (not yet implemented !).</documentation></property></asyxml>*/ }/*<asyxml></struct></asyxml>*/ @@ -2582,11 +2592,11 @@ conic conic(point F, line l, real e) return oc; } -/*<asyxml><struct signature = "circle"><code></asyxml>*/ +/*<asyxml><struct signature="circle"><code></asyxml>*/ struct circle {/*<asyxml></code><documentation>All the calculus with this structure will be as exact as Asymptote can do. For a full precision, you must not cast 'circle' to 'path' excepted for drawing routines.</documentation></asyxml>*/ - /*<asyxml><property type = "point" signature = "C"><code></asyxml>*/ + /*<asyxml><property type = "point" signature="C"><code></asyxml>*/ point C;/*<asyxml></code><documentation>Center</documentation></property><property><code></asyxml>*/ real r;/*<asyxml></code><documentation>Radius</documentation></property><property><code></asyxml>*/ line l;/*<asyxml></code><documentation>If the radius is infinite, this line is used instead of circle.</documentation></property></asyxml>*/ @@ -2602,16 +2612,16 @@ line line(circle c){ return c.l; } -/*<asyxml><struct signature = "ellipse"><code></asyxml>*/ +/*<asyxml><struct signature="ellipse"><code></asyxml>*/ struct ellipse {/*<asyxml></code><documentation>Look at <html><a href = "http://mathworld.wolfram.com/Ellipse.html">http://mathworld.wolfram.com/Ellipse.html</a></html></documentation></asyxml>*/ - /*<asyxml><property type = "point" signature = "F1, F2, C"><code></asyxml>*/ - restricted point F1, F2, C;/*<asyxml></code><documentation>Foci and center.</documentation></property><property type = "real" signature = "a, b, c, e, p"><code></asyxml>*/ - restricted real a, b, c, e, p;/*<asyxml></code></property><property type = "real" signature = "angle"><code></asyxml>*/ - restricted real angle;/*<asyxml></code><documentation>Value is degrees(F1 - F2).</documentation></property><property type = "line" signature = "D1, D2"><code></asyxml>*/ - restricted line D1, D2;/*<asyxml></code><documentation>Directrices.</documentation></property><property type = "line" signature = "l"><code></asyxml>*/ + /*<asyxml><property type = "point" signature="F1,F2,C"><code></asyxml>*/ + restricted point F1,F2,C;/*<asyxml></code><documentation>Foci and center.</documentation></property><property type = "real" signature="a,b,c,e,p"><code></asyxml>*/ + restricted real a,b,c,e,p;/*<asyxml></code></property><property type = "real" signature="angle"><code></asyxml>*/ + restricted real angle;/*<asyxml></code><documentation>Value is degrees(F1 - F2).</documentation></property><property type = "line" signature="D1,D2"><code></asyxml>*/ + restricted line D1,D2;/*<asyxml></code><documentation>Directrices.</documentation></property><property type = "line" signature="l"><code></asyxml>*/ line l;/*<asyxml></code><documentation>If one axis is infinite, this line is used instead of ellipse.</documentation></property></asyxml>*/ - /*<asyxml><method type = "void" signature = "init(point, point, real)"><code></asyxml>*/ + /*<asyxml><method type = "void" signature="init(point,point,real)"><code></asyxml>*/ void init(point f1, point f2, real a) {/*<asyxml></code><documentation>Ellipse given by foci and semimajor axis</documentation></method></asyxml>*/ point[] P = standardizecoordsys(f1, f2); @@ -2645,17 +2655,17 @@ bool degenerate(ellipse el) return (!finite(el.a) || !finite(el.b)); } -/*<asyxml><struct signature = "parabola"><code></asyxml>*/ +/*<asyxml><struct signature="parabola"><code></asyxml>*/ struct parabola -{/*<asyxml></code><documentation>Look at <html><a href = "http://mathworld.wolfram.com/Parabola.html">http://mathworld.wolfram.com/Parabola.html</a></html></documentation><property type = "point" signature = "F, V"><code></asyxml>*/ - restricted point F, V;/*<asyxml></code><documentation>Focus and vertex</documentation></property><property type = "real" signature = "a, p, e = 1"><code></asyxml>*/ - restricted real a, p, e = 1;/*<asyxml></code></property><property type = "real" signature = "angle"><code></asyxml>*/ - restricted real angle;/*<asyxml></code><documentation>Angle, in degrees, of the line (FV).</documentation></property><property type = "line" signature = "D"><code></asyxml>*/ - restricted line D;/*<asyxml></code><documentation>Directrix</documentation></property><property type = "pair" signature = "bmin, bmax"><code></asyxml>*/ +{/*<asyxml></code><documentation>Look at <html><a href = "http://mathworld.wolfram.com/Parabola.html">http://mathworld.wolfram.com/Parabola.html</a></html></documentation><property type = "point" signature="F,V"><code></asyxml>*/ + restricted point F,V;/*<asyxml></code><documentation>Focus and vertex</documentation></property><property type = "real" signature="a,p,e = 1"><code></asyxml>*/ + restricted real a,p,e = 1;/*<asyxml></code></property><property type = "real" signature="angle"><code></asyxml>*/ + restricted real angle;/*<asyxml></code><documentation>Angle, in degrees, of the line (FV).</documentation></property><property type = "line" signature="D"><code></asyxml>*/ + restricted line D;/*<asyxml></code><documentation>Directrix</documentation></property><property type = "pair" signature="bmin,bmax"><code></asyxml>*/ pair bmin, bmax;/*<asyxml></code><documentation>The (left, bottom) and (right, top) coordinates of region bounding box for drawing the parabola. If unset the current picture bounding box is used instead.</documentation></property></asyxml>*/ - /*<asyxml><method type = "void" signature = "init(point, line)"><code></asyxml>*/ + /*<asyxml><method type = "void" signature="init(point,line)"><code></asyxml>*/ void init(point F, line directrix) {/*<asyxml></code><documentation>Parabola given by focus and directrix.</documentation></method></asyxml>*/ point[] P = standardizecoordsys(F, directrix.A, directrix.B); @@ -2669,18 +2679,18 @@ struct parabola } }/*<asyxml></struct></asyxml>*/ -/*<asyxml><struct signature = "hyperbola"><code></asyxml>*/ +/*<asyxml><struct signature="hyperbola"><code></asyxml>*/ struct hyperbola -{/*<asyxml></code><documentation><html>Look at <a href = "http://mathworld.wolfram.com/Hyperbola.html">http://mathworld.wolfram.com/Hyperbola.html</a></html></documentation><property type = "point" signature = "F1, F2"><code></asyxml>*/ - restricted point F1, F2;/*<asyxml></code><documentation>Foci.</documentation></property><property type = "point" signature = "C, V1, V2"><code></asyxml>*/ - restricted point C, V1, V2;/*<asyxml></code><documentation>Center and vertices.</documentation></property><property type = "real" signature = "a, b, c, e, p"><code></asyxml>*/ - restricted real a, b, c, e, p;/*<asyxml></code><documentation></documentation></property><property type = "real" signature = "angle"><code></asyxml>*/ - restricted real angle;/*<asyxml></code><documentation>Angle, in degrees, of the line (F1F2).</documentation></property><property type = "line" signature = "D1, D2, A1, A2"><code></asyxml>*/ - restricted line D1, D2, A1, A2;/*<asyxml></code><documentation>Directrices and asymptotes.</documentation></property><property type = "pair" signature = "bmin, bmax"><code></asyxml>*/ +{/*<asyxml></code><documentation><html>Look at <a href = "http://mathworld.wolfram.com/Hyperbola.html">http://mathworld.wolfram.com/Hyperbola.html</a></html></documentation><property type = "point" signature="F1,F2"><code></asyxml>*/ + restricted point F1,F2;/*<asyxml></code><documentation>Foci.</documentation></property><property type = "point" signature="C,V1,V2"><code></asyxml>*/ + restricted point C,V1,V2;/*<asyxml></code><documentation>Center and vertices.</documentation></property><property type = "real" signature="a,b,c,e,p"><code></asyxml>*/ + restricted real a,b,c,e,p;/*<asyxml></code><documentation></documentation></property><property type = "real" signature="angle"><code></asyxml>*/ + restricted real angle;/*<asyxml></code><documentation>Angle,in degrees,of the line (F1F2).</documentation></property><property type = "line" signature="D1,D2,A1,A2"><code></asyxml>*/ + restricted line D1,D2,A1,A2;/*<asyxml></code><documentation>Directrices and asymptotes.</documentation></property><property type = "pair" signature="bmin,bmax"><code></asyxml>*/ pair bmin, bmax; /*<asyxml></code><documentation>The (left, bottom) and (right, top) coordinates of region bounding box for drawing the hyperbola. If unset the current picture bounding box is used instead.</documentation></property></asyxml>*/ - /*<asyxml><method type = "void" signature = "init(point, point, real)"><code></asyxml>*/ + /*<asyxml><method type = "void" signature="init(point,point,real)"><code></asyxml>*/ void init(point f1, point f2, real a) {/*<asyxml></code><documentation>Hyperbola given by foci and semimajor axis.</documentation></method></asyxml>*/ point[] P = standardizecoordsys(f1, f2); @@ -2704,12 +2714,12 @@ struct hyperbola } }/*<asyxml></struct></asyxml>*/ -/*<asyxml><variable type = "int" signature = "conicnodesfactor"><code></asyxml>*/ +/*<asyxml><variable type="int" signature="conicnodesfactor"><code></asyxml>*/ int conicnodesfactor = 1;/*<asyxml></code><documentation>Factor for the node number of all conics.</documentation></variable></asyxml>*/ -/*<asyxml><variable type = "int" signature = "circlenodesnumberfactor"><code></asyxml>*/ +/*<asyxml><variable type="int" signature="circlenodesnumberfactor"><code></asyxml>*/ int circlenodesnumberfactor = 100;/*<asyxml></code><documentation>Factor for the node number of circles.</documentation></variable></asyxml>*/ -/*<asyxml><function type = "int" signature = "circlenodesnumber(real)"><code></asyxml>*/ +/*<asyxml><function type="int" signature="circlenodesnumber(real)"><code></asyxml>*/ int circlenodesnumber(real r) {/*<asyxml></code><documentation>Return the number of nodes for drawing a circle of radius 'r'.</documentation></function></asyxml>*/ if (circlenodesnumberfactor < 100) @@ -2720,7 +2730,7 @@ int circlenodesnumber(real r) return oi == 0 ? 4 : conicnodesfactor * oi; } -/*<asyxml><function type = "int" signature = "circlenodesnumber(real, real, real)"><code></asyxml>*/ +/*<asyxml><function type="int" signature="circlenodesnumber(real,real,real)"><code></asyxml>*/ int circlenodesnumber(real r, real angle1, real angle2) {/*<asyxml></code><documentation>Return the number of nodes to draw a circle arc.</documentation></function></asyxml>*/ return (r > 0) ? @@ -2728,9 +2738,9 @@ int circlenodesnumber(real r, real angle1, real angle2) ceil(circlenodesnumber(r) * abs((1 - abs(angle1 - angle2)/360))); } -/*<asyxml><variable type = "int" signature = "ellispenodesnumberfactor"><code></asyxml>*/ +/*<asyxml><variable type="int" signature="ellispenodesnumberfactor"><code></asyxml>*/ int ellipsenodesnumberfactor = 250;/*<asyxml></code><documentation>Factor for the node number of ellispe (non-circle).</documentation></variable></asyxml>*/ -/*<asyxml><function type = "int" signature = "ellipsenodesnumber(real, real)"><code></asyxml>*/ +/*<asyxml><function type="int" signature="ellipsenodesnumber(real,real)"><code></asyxml>*/ int ellipsenodesnumber(real a, real b) {/*<asyxml></code><documentation>Return the number of nodes to draw a ellipse of axis 'a' and 'b'.</documentation></function></asyxml>*/ if (ellipsenodesnumberfactor < 250) @@ -2743,7 +2753,7 @@ int ellipsenodesnumber(real a, real b) return conicnodesfactor * oi; } -/*<asyxml><function type = "int" signature = "ellipsenodesnumber(real, real, real)"><code></asyxml>*/ +/*<asyxml><function type="int" signature="ellipsenodesnumber(real,real,real)"><code></asyxml>*/ int ellipsenodesnumber(real a, real b, real angle1, real angle2, bool dir) {/*<asyxml></code><documentation>Return the number of nodes to draw an ellipse arc.</documentation></function></asyxml>*/ real d; @@ -2757,62 +2767,62 @@ int ellipsenodesnumber(real a, real b, real angle1, real angle2, bool dir) return n < 5 ? 5 : n; } -/*<asyxml><variable type = "int" signature = "parabolanodesnumberfactor"><code></asyxml>*/ +/*<asyxml><variable type="int" signature="parabolanodesnumberfactor"><code></asyxml>*/ int parabolanodesnumberfactor = 100;/*<asyxml></code><documentation>Factor for the number of nodes of parabolas.</documentation></variable></asyxml>*/ -/*<asyxml><function type = "int" signature = "parabolanodesnumber(parabola, real, real)"><code></asyxml>*/ +/*<asyxml><function type="int" signature="parabolanodesnumber(parabola,real,real)"><code></asyxml>*/ int parabolanodesnumber(parabola p, real angle1, real angle2) {/*<asyxml></code><documentation>Return the number of nodes for drawing a parabola.</documentation></function></asyxml>*/ return conicnodesfactor * floor(0.01 * parabolanodesnumberfactor * abs(angle1 - angle2)); } -/*<asyxml><variable type = "int" signature = "hyperbolanodesnumberfactor"><code></asyxml>*/ +/*<asyxml><variable type="int" signature="hyperbolanodesnumberfactor"><code></asyxml>*/ int hyperbolanodesnumberfactor = 100;/*<asyxml></code><documentation>Factor for the number of nodes of hyperbolas.</documentation></variable></asyxml>*/ -/*<asyxml><function type = "int" signature = "hyperbolanodesnumber(hyperbola, real, real)"><code></asyxml>*/ +/*<asyxml><function type="int" signature="hyperbolanodesnumber(hyperbola,real,real)"><code></asyxml>*/ int hyperbolanodesnumber(hyperbola h, real angle1, real angle2) {/*<asyxml></code><documentation>Return the number of nodes for drawing an hyperbola.</documentation></function></asyxml>*/ return conicnodesfactor * floor(0.01 * hyperbolanodesnumberfactor * abs(angle1 - angle2)/h.e); } -/*<asyxml><operator type = "conic" signature = "+(conic, explicit point)"><code></asyxml>*/ +/*<asyxml><operator type = "conic" signature="+(conic,explicit point)"><code></asyxml>*/ conic operator +(conic c, explicit point M) {/*<asyxml></code><documentation></documentation></operator></asyxml>*/ return conic(c.F + M, c.D + M, c.e); } -/*<asyxml><operator type = "conic" signature = "-(conic, explicit point)"><code></asyxml>*/ +/*<asyxml><operator type = "conic" signature="-(conic,explicit point)"><code></asyxml>*/ conic operator -(conic c, explicit point M) {/*<asyxml></code><documentation></documentation></operator></asyxml>*/ return conic(c.F - M, c.D - M, c.e); } -/*<asyxml><operator type = "conic" signature = "+(conic, explicit pair)"><code></asyxml>*/ +/*<asyxml><operator type = "conic" signature="+(conic,explicit pair)"><code></asyxml>*/ conic operator +(conic c, explicit pair m) {/*<asyxml></code><documentation></documentation></operator></asyxml>*/ point M = point(c.F.coordsys, m); return conic(c.F + M, c.D + M, c.e); } -/*<asyxml><operator type = "conic" signature = "-(conic, explicit pair)"><code></asyxml>*/ +/*<asyxml><operator type = "conic" signature="-(conic,explicit pair)"><code></asyxml>*/ conic operator -(conic c, explicit pair m) {/*<asyxml></code><documentation></documentation></operator></asyxml>*/ point M = point(c.F.coordsys, m); return conic(c.F - M, c.D - M, c.e); } -/*<asyxml><operator type = "conic" signature = "+(conic, vector)"><code></asyxml>*/ +/*<asyxml><operator type = "conic" signature="+(conic,vector)"><code></asyxml>*/ conic operator +(conic c, vector v) {/*<asyxml></code><documentation></documentation></operator></asyxml>*/ return conic(c.F + v, c.D + v, c.e); } -/*<asyxml><operator type = "conic" signature = "-(conic, vector)"><code></asyxml>*/ +/*<asyxml><operator type = "conic" signature="-(conic,vector)"><code></asyxml>*/ conic operator -(conic c, vector v) {/*<asyxml></code><documentation></documentation></operator></asyxml>*/ return conic(c.F - v, c.D - v, c.e); } -/*<asyxml><function type = "coordsys" signature = "coordsys(conic)"><code></asyxml>*/ +/*<asyxml><function type="coordsys" signature="coordsys(conic)"><code></asyxml>*/ coordsys coordsys(conic co) {/*<asyxml></code><documentation>Return the coordinate system of 'co'.</documentation></function></asyxml>*/ return co.F.coordsys; } -/*<asyxml><function type = "conic" signature = "changecoordsys(coordsys, conic)"><code></asyxml>*/ +/*<asyxml><function type="conic" signature="changecoordsys(coordsys,conic)"><code></asyxml>*/ conic changecoordsys(coordsys R, conic co) {/*<asyxml></code><documentation>Change the coordinate system of 'co' to 'R'</documentation></function></asyxml>*/ line l = changecoordsys(R, co.D); @@ -2823,7 +2833,7 @@ conic changecoordsys(coordsys R, conic co) /*<asyxml><typedef type = "polarconicroutine" return = "path" params = "conic, real, real, int, bool"><code></asyxml>*/ typedef path polarconicroutine(conic co, real angle1, real angle2, int n, bool direction);/*<asyxml></code><documentation>Routine type used to draw conics from 'angle1' to 'angle2'</documentation></typedef></asyxml>*/ -/*<asyxml><function type = "path" signature = "arcfromfocus(conic, real, real, int, bool)"><code></asyxml>*/ +/*<asyxml><function type="path" signature="arcfromfocus(conic,real,real,int,bool)"><code></asyxml>*/ path arcfromfocus(conic co, real angle1, real angle2, int n = 400, bool direction = CCW) {/*<asyxml></code><documentation>Return the path of the conic section 'co' from angle1 to angle2 in degrees, drawing in the given direction, with n nodes.</documentation></function></asyxml>*/ @@ -2859,10 +2869,10 @@ path arcfromfocus(conic co, real angle1, real angle2, int n = 400, bool directio return (direction ? op : op == nullpath ? op :reverse(op)); } -/*<asyxml><variable type = "polarconicroutine" signature = "currentpolarconicroutine"><code></asyxml>*/ +/*<asyxml><variable type="polarconicroutine" signature="currentpolarconicroutine"><code></asyxml>*/ polarconicroutine currentpolarconicroutine = arcfromfocus;/*<asyxml></code><documentation>Default routine used to cast conic section to path.</documentation></variable></asyxml>*/ -/*<asyxml><function type = "point" signature = "angpoint(conic, real)"><code></asyxml>*/ +/*<asyxml><function type="point" signature="angpoint(conic,real)"><code></asyxml>*/ point angpoint(conic co, real angle) {/*<asyxml></code><documentation>Return the point of 'co' whose the angular (in degrees) coordinate is 'angle' (mesured from the focus of 'co', relatively @@ -2871,20 +2881,20 @@ point angpoint(conic co, real angle) return point(R, point(arcfromfocus(co, angle, angle, 1, CCW), 0)/R); } -/*<asyxml><operator type = "bool" signature = "@(point, conic)"><code></asyxml>*/ +/*<asyxml><operator type = "bool" signature="@(point,conic)"><code></asyxml>*/ bool operator @(point M, conic co) {/*<asyxml></code><documentation>Return true iff 'M' on 'co'.</documentation></operator></asyxml>*/ if(co.e == 0) return abs(abs(co.F - M) - co.p) < 10 * epsgeo; return abs(co.e * distance(M, co.D) - abs(co.F - M)) < 10 * epsgeo; } -/*<asyxml><function type = "coordsys" signature = "coordsys(ellipse)"><code></asyxml>*/ +/*<asyxml><function type="coordsys" signature="coordsys(ellipse)"><code></asyxml>*/ coordsys coordsys(ellipse el) {/*<asyxml></code><documentation>Return the coordinate system of 'el'.</documentation></function></asyxml>*/ return el.F1.coordsys; } -/*<asyxml><function type = "coordsys" signature = "canonicalcartesiansystem(ellipse)"><code></asyxml>*/ +/*<asyxml><function type="coordsys" signature="canonicalcartesiansystem(ellipse)"><code></asyxml>*/ coordsys canonicalcartesiansystem(ellipse el) {/*<asyxml></code><documentation>Return the canonical cartesian system of the ellipse 'el'.</documentation></function></asyxml>*/ if(degenerate(el)) return cartesiansystem(el.l.A, el.l.u, el.l.v); @@ -2894,7 +2904,7 @@ coordsys canonicalcartesiansystem(ellipse el) return cartesiansystem(O, i, j); } -/*<asyxml><function type = "coordsys" signature = "canonicalcartesiansystem(parabola)"><code></asyxml>*/ +/*<asyxml><function type="coordsys" signature="canonicalcartesiansystem(parabola)"><code></asyxml>*/ coordsys canonicalcartesiansystem(parabola p) {/*<asyxml></code><documentation>Return the canonical cartesian system of a parabola, so that Origin = vertex of 'p' and directrix: x = -a.</documentation></function></asyxml>*/ @@ -2905,7 +2915,7 @@ coordsys canonicalcartesiansystem(parabola p) return cartesiansystem(O, i, j); } -/*<asyxml><function type = "coordsys" signature = "canonicalcartesiansystem(hyperbola)"><code></asyxml>*/ +/*<asyxml><function type="coordsys" signature="canonicalcartesiansystem(hyperbola)"><code></asyxml>*/ coordsys canonicalcartesiansystem(hyperbola h) {/*<asyxml></code><documentation>Return the canonical cartesian system of an hyperbola.</documentation></function></asyxml>*/ pair O = locate(h.C); @@ -2914,7 +2924,7 @@ coordsys canonicalcartesiansystem(hyperbola h) return cartesiansystem(O, i, j); } -/*<asyxml><function type = "ellipse" signature = "ellipse(point, point, real)"><code></asyxml>*/ +/*<asyxml><function type="ellipse" signature="ellipse(point,point,real)"><code></asyxml>*/ ellipse ellipse(point F1, point F2, real a) {/*<asyxml></code><documentation>Return the ellipse whose the foci are 'F1' and 'F2' and the semimajor axis is 'a'.</documentation></function></asyxml>*/ @@ -2923,10 +2933,10 @@ ellipse ellipse(point F1, point F2, real a) return oe; } -/*<asyxml><constant type = "bool" signature = "byfoci, byvertices"><code></asyxml>*/ +/*<asyxml><constant type = "bool" signature="byfoci,byvertices"><code></asyxml>*/ restricted bool byfoci = true, byvertices = false;/*<asyxml></code><documentation>Constants useful for the routine 'hyperbola(point P1, point P2, real ae, bool byfoci = byfoci)'</documentation></constant></asyxml>*/ -/*<asyxml><function type = "hyperbola" signature = "hyperbola(point, point, real, bool)"><code></asyxml>*/ +/*<asyxml><function type="hyperbola" signature="hyperbola(point,point,real,bool)"><code></asyxml>*/ hyperbola hyperbola(point P1, point P2, real ae, bool byfoci = byfoci) {/*<asyxml></code><documentation>if 'byfoci = true': return the hyperbola whose the foci are 'P1' and 'P2' @@ -2946,7 +2956,7 @@ hyperbola hyperbola(point P1, point P2, real ae, bool byfoci = byfoci) return oh; } -/*<asyxml><function type = "ellipse" signature = "ellipse(point, point, point)"><code></asyxml>*/ +/*<asyxml><function type="ellipse" signature="ellipse(point,point,point)"><code></asyxml>*/ ellipse ellipse(point F1, point F2, point M) {/*<asyxml></code><documentation>Return the ellipse passing through 'M' whose the foci are 'F1' and 'F2'.</documentation></function></asyxml>*/ point P[] = standardizecoordsys(false, F1, F2, M); @@ -2954,7 +2964,7 @@ ellipse ellipse(point F1, point F2, point M) return ellipse(F1, F2, finite(a) ? a/2 : a); } -/*<asyxml><function type = "ellipse" signature = "ellipse(point, real, real, real)"><code></asyxml>*/ +/*<asyxml><function type="ellipse" signature="ellipse(point,real,real,real)"><code></asyxml>*/ ellipse ellipse(point C, real a, real b, real angle = 0) {/*<asyxml></code><documentation>Return the ellipse centered at 'C' with semimajor axis 'a' along C--C + dir(angle), semiminor axis 'b' along the perpendicular.</documentation></function></asyxml>*/ @@ -2979,7 +2989,7 @@ ellipse ellipse(point C, real a, real b, real angle = 0) return oe; } -/*<asyxml><function type = "ellipse" signature = "ellipse(bqe)"><code></asyxml>*/ +/*<asyxml><function type="ellipse" signature="ellipse(bqe)"><code></asyxml>*/ ellipse ellipse(bqe bqe) {/*<asyxml></code><documentation>Return the ellipse a[0] * x^2 + a[1] * xy + a[2] * y^2 + a[3] * x + a[4] * y + a[5] = 0 given in the coordinate system of 'bqe' with a[i] = bque.a[i]. @@ -3019,25 +3029,25 @@ ellipse ellipse(bqe bqe) a, b, degrees(pi/2 - dir - angle(R.i))); } -/*<asyxml><function type = "ellipse" signature = "ellipse(point, point, point, point, point)"><code></asyxml>*/ +/*<asyxml><function type="ellipse" signature="ellipse(point,point,point,point,point)"><code></asyxml>*/ ellipse ellipse(point M1, point M2, point M3, point M4, point M5) {/*<asyxml></code><documentation>Return the ellipse passing through the five points (if possible)</documentation></function></asyxml>*/ return ellipse(bqe(M1, M2, M3, M4, M5)); } -/*<asyxml><function type = "bool" signature = "inside(ellipse, point)"><code></asyxml>*/ +/*<asyxml><function type="bool" signature="inside(ellipse,point)"><code></asyxml>*/ bool inside(ellipse el, point M) {/*<asyxml></code><documentation>Return 'true' iff 'M' is inside 'el'.</documentation></function></asyxml>*/ return abs(el.F1 - M) + abs(el.F2 - M) - 2 * el.a < -epsgeo; } -/*<asyxml><function type = "bool" signature = "inside(parabola, point)"><code></asyxml>*/ +/*<asyxml><function type="bool" signature="inside(parabola,point)"><code></asyxml>*/ bool inside(parabola p, point M) {/*<asyxml></code><documentation>Return 'true' if 'M' is inside 'p'.</documentation></function></asyxml>*/ return distance(p.D, M) - abs(p.F - M) > epsgeo; } -/*<asyxml><function type = "parabola" signature = "parabola(point, line)"><code></asyxml>*/ +/*<asyxml><function type="parabola" signature="parabola(point,line)"><code></asyxml>*/ parabola parabola(point F, line l) {/*<asyxml></code><documentation>Return the parabola whose focus is 'F' and directrix is 'l'.</documentation></function></asyxml>*/ parabola op; @@ -3045,7 +3055,7 @@ parabola parabola(point F, line l) return op; } -/*<asyxml><function type = "parabola" signature = "parabola(point, point)"><code></asyxml>*/ +/*<asyxml><function type="parabola" signature="parabola(point,point)"><code></asyxml>*/ parabola parabola(point F, point vertex) {/*<asyxml></code><documentation>Return the parabola whose focus is 'F' and vertex is 'vertex'.</documentation></function></asyxml>*/ parabola op; @@ -3056,7 +3066,7 @@ parabola parabola(point F, point vertex) return op; } -/*<asyxml><function type = "parabola" signature = "parabola(point, real, real)"><code></asyxml>*/ +/*<asyxml><function type="parabola" signature="parabola(point,real,real)"><code></asyxml>*/ parabola parabola(point F, real a, real angle) {/*<asyxml></code><documentation>Return the parabola whose focus is F, latus rectum is 4a and the angle of the axis of symmetry (in the coordinate system of F) is 'angle'.</documentation></function></asyxml>*/ @@ -3068,7 +3078,7 @@ parabola parabola(point F, real a, real angle) return op; } -/*<asyxml><function type = "bool" signature = "isparabola(bqe)"><code></asyxml>*/ +/*<asyxml><function type="bool" signature="isparabola(bqe)"><code></asyxml>*/ bool isparabola(bqe bqe) {/*<asyxml></code><documentation>Return true iff 'bqe' is the equation of a parabola.</documentation></function></asyxml>*/ bqe lbqe = changecoordsys(defaultcoordsys, bqe); @@ -3077,7 +3087,7 @@ bool isparabola(bqe bqe) return (abs(delta) > epsgeo && abs(b^2 - a * c) < epsgeo); } -/*<asyxml><function type = "parabola" signature = "parabola(bqe)"><code></asyxml>*/ +/*<asyxml><function type="parabola" signature="parabola(bqe)"><code></asyxml>*/ parabola parabola(bqe bqe) {/*<asyxml></code><documentation>Return the parabola a[0]x^2 + a[1]xy + a[2]y^2 + a[3]x + a[4]y + a[5]] = 0 (a[n] means bqe.a[n]). <url href = "http://mathworld.wolfram.com/QuadraticCurve.html"/> @@ -3119,7 +3129,7 @@ parabola parabola(bqe bqe) return op; } -/*<asyxml><function type = "parabola" signature = "parabola(point, point, point, line)"><code></asyxml>*/ +/*<asyxml><function type="parabola" signature="parabola(point,point,point,line)"><code></asyxml>*/ parabola parabola(point M1, point M2, point M3, line l) {/*<asyxml></code><documentation>Return the parabola passing through the three points with its directix parallel to the line 'l'.</documentation></function></asyxml>*/ @@ -3145,13 +3155,13 @@ parabola parabola(point M1, point M2, point M3, line l) return parabola(changecoordsys(R, bqe(Rp, 1, 0, 0, coef[0], coef[1], coef[2]))); } -/*<asyxml><function type = "parabola" signature = "parabola(point, point, point, point, point)"><code></asyxml>*/ +/*<asyxml><function type="parabola" signature="parabola(point,point,point,point,point)"><code></asyxml>*/ parabola parabola(point M1, point M2, point M3, point M4, point M5) {/*<asyxml></code><documentation>Return the parabola passing through the five points.</documentation></function></asyxml>*/ return parabola(bqe(M1, M2, M3, M4, M5)); } -/*<asyxml><function type = "hyperbola" signature = "hyperbola(point, real, real, real)"><code></asyxml>*/ +/*<asyxml><function type="hyperbola" signature="hyperbola(point,real,real,real)"><code></asyxml>*/ hyperbola hyperbola(point C, real a, real b, real angle = 0) {/*<asyxml></code><documentation>Return the hyperbola centered at 'C' with semimajor axis 'a' along C--C + dir(angle), semiminor axis 'b' along the perpendicular.</documentation></function></asyxml>*/ @@ -3165,7 +3175,7 @@ hyperbola hyperbola(point C, real a, real b, real angle = 0) return oh; } -/*<asyxml><function type = "hyperbola" signature = "hyperbola(bqe)"><code></asyxml>*/ +/*<asyxml><function type="hyperbola" signature="hyperbola(bqe)"><code></asyxml>*/ hyperbola hyperbola(bqe bqe) {/*<asyxml></code><documentation>Return the hyperbola a[0]x^2 + a[1]xy + a[2]y^2 + a[3]x + a[4]y + a[5]] = 0 (a[n] means bqe.a[n]). <url href = "http://mathworld.wolfram.com/QuadraticCurve.html"/> @@ -3192,19 +3202,19 @@ hyperbola hyperbola(bqe bqe) return hyperbola(C, a, b, degrees(-dir - angle(R.i))); } -/*<asyxml><function type = "hyperbola" signature = "hyperbola(point, point, point, point, point)"><code></asyxml>*/ +/*<asyxml><function type="hyperbola" signature="hyperbola(point,point,point,point,point)"><code></asyxml>*/ hyperbola hyperbola(point M1, point M2, point M3, point M4, point M5) {/*<asyxml></code><documentation>Return the hyperbola passing through the five points (if possible).</documentation></function></asyxml>*/ return hyperbola(bqe(M1, M2, M3, M4, M5)); } -/*<asyxml><function type = "hyperbola" signature = "conj(hyperbola)"><code></asyxml>*/ +/*<asyxml><function type="hyperbola" signature="conj(hyperbola)"><code></asyxml>*/ hyperbola conj(hyperbola h) {/*<asyxml></code><documentation>Conjugate.</documentation></function></asyxml>*/ return hyperbola(h.C, h.b, h.a, 90 + h.angle); } -/*<asyxml><function type = "circle" signature = "circle(explicit point, real)"><code></asyxml>*/ +/*<asyxml><function type="circle" signature="circle(explicit point,real)"><code></asyxml>*/ circle circle(explicit point C, real r) {/*<asyxml></code><documentation>Circle given by center and radius.</documentation></function></asyxml>*/ circle oc = new circle; @@ -3214,7 +3224,7 @@ circle circle(explicit point C, real r) return oc; } -/*<asyxml><function type = "circle" signature = "circle(point, point)"><code></asyxml>*/ +/*<asyxml><function type="circle" signature="circle(point,point)"><code></asyxml>*/ circle circle(point A, point B) {/*<asyxml></code><documentation>Return the circle of diameter AB.</documentation></function></asyxml>*/ real r; @@ -3234,13 +3244,13 @@ circle circle(point A, point B) return oc; } -/*<asyxml><function type = "circle" signature = "circle(segment)"><code></asyxml>*/ +/*<asyxml><function type="circle" signature="circle(segment)"><code></asyxml>*/ circle circle(segment s) {/*<asyxml></code><documentation>Return the circle of diameter 's'.</documentation></function></asyxml>*/ return circle(s.A, s.B); } -/*<asyxml><function type = "point" signature = "circumcenter(point, point, point)"><code></asyxml>*/ +/*<asyxml><function type="point" signature="circumcenter(point,point,point)"><code></asyxml>*/ point circumcenter(point A, point B, point C) {/*<asyxml></code><documentation>Return the circumcenter of triangle ABC.</documentation></function></asyxml>*/ point[] P = standardizecoordsys(A, B, C); @@ -3252,7 +3262,7 @@ point circumcenter(point A, point B, point C) return point(R, pp/R); } -/*<asyxml><function type = "circle" signature = "circle(point, point, point)"><code></asyxml>*/ +/*<asyxml><function type="circle" signature="circle(point,point,point)"><code></asyxml>*/ circle circle(point A, point B, point C) {/*<asyxml></code><documentation>Return the circumcircle of the triangle ABC.</documentation></function></asyxml>*/ if(collinear(A - B, A - C)) { @@ -3266,13 +3276,13 @@ circle circle(point A, point B, point C) return circle(c, abs(c - A)); } -/*<asyxml><function type = "circle" signature = "circumcircle(point, point, point)"><code></asyxml>*/ +/*<asyxml><function type="circle" signature="circumcircle(point,point,point)"><code></asyxml>*/ circle circumcircle(point A, point B, point C) {/*<asyxml></code><documentation>Return the circumcircle of the triangle ABC.</documentation></function></asyxml>*/ return circle(A, B, C); } -/*<asyxml><operator type = "circle" signature = "*(real, explicit circle)"><code></asyxml>*/ +/*<asyxml><operator type = "circle" signature="*(real,explicit circle)"><code></asyxml>*/ circle operator *(real x, explicit circle c) {/*<asyxml></code><documentation>Multiply the radius of 'c'.</documentation></operator></asyxml>*/ return finite(c.r) ? circle(c.C, x * c.r) : c; @@ -3281,7 +3291,7 @@ circle operator *(int x, explicit circle c) { return finite(c.r) ? circle(c.C, x * c.r) : c; } -/*<asyxml><operator type = "circle" signature = "/(explicit circle, real)"><code></asyxml>*/ +/*<asyxml><operator type = "circle" signature="/(explicit circle,real)"><code></asyxml>*/ circle operator /(explicit circle c, real x) {/*<asyxml></code><documentation>Divide the radius of 'c'</documentation></operator></asyxml>*/ return finite(c.r) ? circle(c.C, c.r/x) : c; @@ -3290,44 +3300,44 @@ circle operator /(explicit circle c, int x) { return finite(c.r) ? circle(c.C, c.r/x) : c; } -/*<asyxml><operator type = "circle" signature = "+(explicit circle, explicit point)"><code></asyxml>*/ +/*<asyxml><operator type = "circle" signature="+(explicit circle,explicit point)"><code></asyxml>*/ circle operator +(explicit circle c, explicit point M) {/*<asyxml></code><documentation>Translation of 'c'.</documentation></operator></asyxml>*/ return circle(c.C + M, c.r); } -/*<asyxml><operator type = "circle" signature = "-(explicit circle, explicit point)"><code></asyxml>*/ +/*<asyxml><operator type = "circle" signature="-(explicit circle,explicit point)"><code></asyxml>*/ circle operator -(explicit circle c, explicit point M) {/*<asyxml></code><documentation>Translation of 'c'.</documentation></operator></asyxml>*/ return circle(c.C - M, c.r); } -/*<asyxml><operator type = "circle" signature = "+(explicit circle, pair)"><code></asyxml>*/ +/*<asyxml><operator type = "circle" signature="+(explicit circle,pair)"><code></asyxml>*/ circle operator +(explicit circle c, pair m) {/*<asyxml></code><documentation>Translation of 'c'. 'm' represent coordinates in the coordinate system where 'c' is defined.</documentation></operator></asyxml>*/ return circle(c.C + m, c.r); } -/*<asyxml><operator type = "circle" signature = "-(explicit circle, pair)"><code></asyxml>*/ +/*<asyxml><operator type = "circle" signature="-(explicit circle,pair)"><code></asyxml>*/ circle operator -(explicit circle c, pair m) {/*<asyxml></code><documentation>Translation of 'c'. 'm' represent coordinates in the coordinate system where 'c' is defined.</documentation></operator></asyxml>*/ return circle(c.C - m, c.r); } -/*<asyxml><operator type = "circle" signature = "+(explicit circle, vector)"><code></asyxml>*/ +/*<asyxml><operator type = "circle" signature="+(explicit circle,vector)"><code></asyxml>*/ circle operator +(explicit circle c, vector m) {/*<asyxml></code><documentation>Translation of 'c'.</documentation></operator></asyxml>*/ return circle(c.C + m, c.r); } -/*<asyxml><operator type = "circle" signature = "-(explicit circle, vector)"><code></asyxml>*/ +/*<asyxml><operator type = "circle" signature="-(explicit circle,vector)"><code></asyxml>*/ circle operator -(explicit circle c, vector m) {/*<asyxml></code><documentation>Translation of 'c'.</documentation></operator></asyxml>*/ return circle(c.C - m, c.r); } -/*<asyxml><operator type = "real" signature = "^(point, explicit circle)"><code></asyxml>*/ +/*<asyxml><operator type = "real" signature="^(point,explicit circle)"><code></asyxml>*/ real operator ^(point M, explicit circle c) {/*<asyxml></code><documentation>The power of 'M' with respect to the circle 'c'</documentation></operator></asyxml>*/ return xpart((abs(locate(M) - locate(c.C)), c.r)^2); } -/*<asyxml><operator type = "bool" signature = "@(point, explicit circle)"><code></asyxml>*/ +/*<asyxml><operator type = "bool" signature="@(point,explicit circle)"><code></asyxml>*/ bool operator @(point M, explicit circle c) {/*<asyxml></code><documentation>Return true iff 'M' is on the circle 'c'.</documentation></operator></asyxml>*/ return finite(c.r) ? @@ -3335,13 +3345,13 @@ bool operator @(point M, explicit circle c) M @ c.l; } -/*<asyxml><operator type = "ellipse" signature = "cast(circle)"><code></asyxml>*/ +/*<asyxml><operator type = "ellipse" signature="cast(circle)"><code></asyxml>*/ ellipse operator cast(circle c) {/*<asyxml></code><documentation></documentation></operator></asyxml>*/ return finite(c.r) ? ellipse(c.C, c.r, c.r, 0) : ellipse(c.l.A, c.l.B, infinity); } -/*<asyxml><operator type = "circle" signature = "cast(ellipse)"><code></asyxml>*/ +/*<asyxml><operator type = "circle" signature="cast(ellipse)"><code></asyxml>*/ circle operator cast(ellipse el) {/*<asyxml></code><documentation></documentation></operator></asyxml>*/ circle oc; @@ -3353,7 +3363,7 @@ circle operator cast(ellipse el) return oc; } -/*<asyxml><operator type = "ellipse" signature = "cast(conic)"><code></asyxml>*/ +/*<asyxml><operator type = "ellipse" signature="cast(conic)"><code></asyxml>*/ ellipse operator cast(conic co) {/*<asyxml></code><documentation>Cast a conic to an ellipse (can be a circle).</documentation></operator></asyxml>*/ if(degenerate(co) && co.e < 1) return ellipse(co.l[0].A, co.l[0].B, infinity); @@ -3371,7 +3381,7 @@ ellipse operator cast(conic co) return oe; } -/*<asyxml><operator type = "parabola" signature = "cast(conic)"><code></asyxml>*/ +/*<asyxml><operator type = "parabola" signature="cast(conic)"><code></asyxml>*/ parabola operator cast(conic co) {/*<asyxml></code><documentation>Cast a conic to a parabola.</documentation></operator></asyxml>*/ parabola op; @@ -3380,13 +3390,13 @@ parabola operator cast(conic co) return op; } -/*<asyxml><operator type = "conic" signature = "cast(parabola)"><code></asyxml>*/ +/*<asyxml><operator type = "conic" signature="cast(parabola)"><code></asyxml>*/ conic operator cast(parabola p) {/*<asyxml></code><documentation>Cast a parabola to a conic section.</documentation></operator></asyxml>*/ return conic(p.F, p.D, 1); } -/*<asyxml><operator type = "hyperbola" signature = "cast(conic)"><code></asyxml>*/ +/*<asyxml><operator type = "hyperbola" signature="cast(conic)"><code></asyxml>*/ hyperbola operator cast(conic co) {/*<asyxml></code><documentation>Cast a conic section to an hyperbola.</documentation></operator></asyxml>*/ hyperbola oh; @@ -3403,13 +3413,13 @@ hyperbola operator cast(conic co) return oh; } -/*<asyxml><operator type = "conic" signature = "cast(hyperbola)"><code></asyxml>*/ +/*<asyxml><operator type = "conic" signature="cast(hyperbola)"><code></asyxml>*/ conic operator cast(hyperbola h) {/*<asyxml></code><documentation>Hyperbola to conic section.</documentation></operator></asyxml>*/ return conic(h.F1, h.D1, h.e); } -/*<asyxml><operator type = "conic" signature = "cast(ellipse)"><code></asyxml>*/ +/*<asyxml><operator type = "conic" signature="cast(ellipse)"><code></asyxml>*/ conic operator cast(ellipse el) {/*<asyxml></code><documentation>Ellipse to conic section.</documentation></operator></asyxml>*/ conic oc; @@ -3432,13 +3442,13 @@ conic operator cast(ellipse el) return oc; } -/*<asyxml><operator type = "conic" signature = "cast(circle)"><code></asyxml>*/ +/*<asyxml><operator type = "conic" signature="cast(circle)"><code></asyxml>*/ conic operator cast(circle c) {/*<asyxml></code><documentation>Circle to conic section.</documentation></operator></asyxml>*/ return (conic)((ellipse)c); } -/*<asyxml><operator type = "circle" signature = "cast(conic)"><code></asyxml>*/ +/*<asyxml><operator type = "circle" signature="cast(conic)"><code></asyxml>*/ circle operator cast(conic c) {/*<asyxml></code><documentation>Conic section to circle.</documentation></operator></asyxml>*/ ellipse el = (ellipse)c; @@ -3451,7 +3461,7 @@ circle operator cast(conic c) return oc; } -/*<asyxml><operator type = "ellipse" signature = "*(transform, ellipse)"><code></asyxml>*/ +/*<asyxml><operator type = "ellipse" signature="*(transform,ellipse)"><code></asyxml>*/ ellipse operator *(transform t, ellipse el) {/*<asyxml></code><documentation>Provide transform * ellipse.</documentation></operator></asyxml>*/ if(!degenerate(el)) { @@ -3466,7 +3476,7 @@ ellipse operator *(transform t, ellipse el) return ellipse(t * el.l.A, t * el.l.B, infinity); } -/*<asyxml><operator type = "parabola" signature = "*(transform, parabola)"><code></asyxml>*/ +/*<asyxml><operator type = "parabola" signature="*(transform,parabola)"><code></asyxml>*/ parabola operator *(transform t, parabola p) {/*<asyxml></code><documentation>Provide transform * parabola.</documentation></operator></asyxml>*/ point[] P; @@ -3480,7 +3490,7 @@ parabola operator *(transform t, parabola p) return op; } -/*<asyxml><operator type = "ellipse" signature = "*(transform, circle)"><code></asyxml>*/ +/*<asyxml><operator type = "ellipse" signature="*(transform,circle)"><code></asyxml>*/ ellipse operator *(transform t, circle c) {/*<asyxml></code><documentation>Provide transform * circle. For example, 'circle C = scale(2) * circle' and 'ellipse E = xscale(2) * circle' are valid @@ -3488,7 +3498,7 @@ ellipse operator *(transform t, circle c) return t * ((ellipse)c); } -/*<asyxml><operator type = "hyperbola" signature = "*(transform, hyperbola)"><code></asyxml>*/ +/*<asyxml><operator type = "hyperbola" signature="*(transform,hyperbola)"><code></asyxml>*/ hyperbola operator *(transform t, hyperbola h) {/*<asyxml></code><documentation>Provide transform * hyperbola.</documentation></operator></asyxml>*/ if (t == identity()) { @@ -3511,7 +3521,7 @@ hyperbola operator *(transform t, hyperbola h) return oe; } -/*<asyxml><operator type = "conic" signature = "*(transform, conic)"><code></asyxml>*/ +/*<asyxml><operator type = "conic" signature="*(transform,conic)"><code></asyxml>*/ conic operator *(transform t, conic co) {/*<asyxml></code><documentation>Provide transform * conic.</documentation></operator></asyxml>*/ if(co.e < 1) return (t * ((ellipse)co)); @@ -3519,58 +3529,58 @@ conic operator *(transform t, conic co) return (t * ((hyperbola)co)); } -/*<asyxml><operator type = "ellipse" signature = "*(real, ellipse)"><code></asyxml>*/ +/*<asyxml><operator type = "ellipse" signature="*(real,ellipse)"><code></asyxml>*/ ellipse operator *(real x, ellipse el) {/*<asyxml></code><documentation>Identical but more efficient (rapid) than 'scale(x, el.C) * el'.</documentation></operator></asyxml>*/ return degenerate(el) ? el : ellipse(el.C, x * el.a, x * el.b, el.angle); } -/*<asyxml><operator type = "ellipse" signature = "/(ellipse, real)"><code></asyxml>*/ +/*<asyxml><operator type = "ellipse" signature="/(ellipse,real)"><code></asyxml>*/ ellipse operator /(ellipse el, real x) {/*<asyxml></code><documentation>Identical but more efficient (rapid) than 'scale(1/x, el.C) * el'.</documentation></operator></asyxml>*/ return degenerate(el) ? el : ellipse(el.C, el.a/x, el.b/x, el.angle); } -/*<asyxml><function type = "path" signature = "arcfromcenter(ellipse, real, real, int, bool)"><code></asyxml>*/ +/*<asyxml><function type="path" signature="arcfromcenter(ellipse,real,real,int,bool)"><code></asyxml>*/ path arcfromcenter(ellipse el, real angle1, real angle2, - bool direction = CCW, - int n = ellipsenodesnumber(el.a, el.b, angle1, angle2, direction)) + bool direction=CCW, + int n=ellipsenodesnumber(el.a,el.b,angle1,angle2,direction)) {/*<asyxml></code><documentation>Return the path of the ellipse 'el' from angle1 to angle2 in degrees, drawing in the given direction, with n nodes. - The angles are mesured relatively to the axis (C, x-axis) where C is + The angles are mesured relatively to the axis (C,x-axis) where C is the center of the ellipse.</documentation></function></asyxml>*/ if(degenerate(el)) abort("arcfromcenter: can not convert degenerated ellipse to path."); if (angle1 > angle2) return reverse(arcfromcenter(el, angle2, angle1, !direction, n)); - path op; - coordsys Rp = coordsys(el); + + guide op; + coordsys Rp=coordsys(el); if (n < 1) return op; + interpolate join = operator ..; real stretch = max(el.a/el.b, el.b/el.a); + if (stretch > 10) { n *= floor(stretch/5); join = operator --; } + real a1 = direction ? radians(angle1) : radians(angle2); real a2 = direction ? radians(angle2) : radians(angle1) + 2 * pi; - real step = (a2 - a1)/(n != 1 ? n - 1 : 1); + real step=(a2 - a1)/(n != 1 ? n-1 : 1); real a, r; real da = radians(el.angle); - real a3 = angle((cos(a1)/el.a, sin(a1)/el.b)); - real a3 = (a3>=0) ? a3 : a3 + 2pi; - real a4 = angle((cos(a2)/el.a, sin(a2)/el.b)); - real a4 = (a4>=0) ? a4 : a4 + 2pi; - real step = (a4 - a3)/(n != 1 ? n - 1 : 1); - for (int i = 0; i < n; ++i) { - a = a3 + i * step; - a = angle((el.a * cos(a), el.b * sin(a))); + + for (int i=0; i < n; ++i) { + a = a1 + i * step; r = el.b/sqrt(1 - (el.e * cos(a))^2); - op = op..Rp * Rp.polar(r, a + da); + op = join(op, Rp*Rp.polar(r, da + a)); } - return shift(el.C.x * Rp.i + el.C.y * Rp.j) * (direction ? op : reverse(op)); + + return shift(el.C.x*Rp.i + el.C.y*Rp.j) * (direction ? op : reverse(op)); } -/*<asyxml><function type = "path" signature = "arcfromcenter(hyperbola, real, real, int, bool)"><code></asyxml>*/ +/*<asyxml><function type="path" signature="arcfromcenter(hyperbola,real,real,int,bool)"><code></asyxml>*/ path arcfromcenter(hyperbola h, real angle1, real angle2, int n = hyperbolanodesnumber(h, angle1, angle2), bool direction = CCW) @@ -3605,7 +3615,7 @@ path arcfromcenter(hyperbola h, real angle1, real angle2, (direction ? op : op == nullpath ? op : reverse(op)); } -/*<asyxml><function type = "path" signature = "arcfromcenter(explicit conic, real, real, int, bool)"><code></asyxml>*/ +/*<asyxml><function type="path" signature="arcfromcenter(explicit conic,real,real,int,bool)"><code></asyxml>*/ path arcfromcenter(explicit conic co, real angle1, real angle2, int n, bool direction = CCW) {/*<asyxml></code><documentation>Use arcfromcenter(ellipse, ...) or arcfromcenter(hyperbola, ...) depending of @@ -3621,12 +3631,12 @@ path arcfromcenter(explicit conic co, real angle1, real angle2, return g; } -/*<asyxml><constant type = "polarconicroutine" signature = "fromCenter"><code></asyxml>*/ +/*<asyxml><constant type = "polarconicroutine" signature="fromCenter"><code></asyxml>*/ restricted polarconicroutine fromCenter = arcfromcenter;/*<asyxml></code><documentation></documentation></constant></asyxml>*/ -/*<asyxml><constant type = "polarconicroutine" signature = "fromFocus"><code></asyxml>*/ +/*<asyxml><constant type = "polarconicroutine" signature="fromFocus"><code></asyxml>*/ restricted polarconicroutine fromFocus = arcfromfocus;/*<asyxml></code><documentation></documentation></constant></asyxml>*/ -/*<asyxml><function type = "bqe" signature = "equation(ellipse)"><code></asyxml>*/ +/*<asyxml><function type="bqe" signature="equation(ellipse)"><code></asyxml>*/ bqe equation(ellipse el) {/*<asyxml></code><documentation>Return the coefficients of the equation of the ellipse in its coordinate system: bqe.a[0] * x^2 + bqe.a[1] * x * y + bqe.a[2] * y^2 + bqe.a[3] * x + bqe.a[4] * y + bqe.a[5] = 0. @@ -3649,7 +3659,7 @@ bqe equation(ellipse el) return bqe; } -/*<asyxml><function type = "bqe" signature = "equation(parabola)"><code></asyxml>*/ +/*<asyxml><function type="bqe" signature="equation(parabola)"><code></asyxml>*/ bqe equation(parabola p) {/*<asyxml></code><documentation>Return the coefficients of the equation of the parabola in its coordinate system. bqe.a[0] * x^2 + bqe.a[1] * x * y + bqe.a[2] * y^2 + bqe.a[3] * x + bqe.a[4] * y + bqe.a[5] = 0 @@ -3662,7 +3672,7 @@ bqe equation(parabola p) bqe(R, 0, 0, 1, -4 * a, 0, 0)); } -/*<asyxml><function type = "bqe" signature = "equation(hyperbola)"><code></asyxml>*/ +/*<asyxml><function type="bqe" signature="equation(hyperbola)"><code></asyxml>*/ bqe equation(hyperbola h) {/*<asyxml></code><documentation>Return the coefficients of the equation of the hyperbola in its coordinate system. bqe.a[0] * x^2 + bqe.a[1] * x * y + bqe.a[2] * y^2 + bqe.a[3] * x + bqe.a[4] * y + bqe.a[5] = 0 @@ -3672,7 +3682,7 @@ bqe equation(hyperbola h) bqe(R, 1/h.a^2, 0, -1/h.b^2, 0, 0, -1)); } -/*<asyxml><operator type = "path" signature = "cast(ellipse)"><code></asyxml>*/ +/*<asyxml><operator type = "path" signature="cast(ellipse)"><code></asyxml>*/ path operator cast(ellipse el) {/*<asyxml></code><documentation>Cast ellipse to path.</documentation></operator></asyxml>*/ if(degenerate(el)) @@ -3681,13 +3691,13 @@ path operator cast(ellipse el) return arcfromcenter(el, 0.0, 360, CCW, n)&cycle; } -/*<asyxml><operator type = "path" signature = "cast(circle)"><code></asyxml>*/ +/*<asyxml><operator type = "path" signature="cast(circle)"><code></asyxml>*/ path operator cast(circle c) {/*<asyxml></code><documentation>Cast circle to path.</documentation></operator></asyxml>*/ return (path)((ellipse)c); } -/*<asyxml><function type = "real[]" signature = "bangles(picture, parabola)"><code></asyxml>*/ +/*<asyxml><function type="real[]" signature="bangles(picture,parabola)"><code></asyxml>*/ real[] bangles(picture pic = currentpicture, parabola p) {/*<asyxml></code><documentation>Return the array {ma, Ma} where 'ma' and 'Ma' are respectively the smaller and the larger angles for which the parabola 'p' is included @@ -3724,7 +3734,7 @@ real[] bangles(picture pic = currentpicture, parabola p) return new real[] {ma, Ma}; } -/*<asyxml><function type = "real[][]" signature = "bangles(picture, hyperbola)"><code></asyxml>*/ +/*<asyxml><function type="real[][]" signature="bangles(picture,hyperbola)"><code></asyxml>*/ real[][] bangles(picture pic = currentpicture, hyperbola h) {/*<asyxml></code><documentation>Return the array {{ma1, Ma1}, {ma2, Ma2}} where 'maX' and 'MaX' are respectively the smaller and the bigger angles (from h.FX) for which the hyperbola 'h' is included @@ -3764,12 +3774,12 @@ real[][] bangles(picture pic = currentpicture, hyperbola h) return (360 - d + degrees(inter[i][n]-F1))%360; }, inter[i].length); ma[i] = a.length != 0 ? min(a) : 0; - Ma[i] = a.length != 0 ? max(a) : 0; + Ma[i] = a.length != 0 ? max(a) : 0; } return new real[][] {{ma[0], Ma[0]}, {ma[1], Ma[1]}}; } -/*<asyxml><operator type = "path" signature = "cast(parabola)"><code></asyxml>*/ +/*<asyxml><operator type = "path" signature="cast(parabola)"><code></asyxml>*/ path operator cast(parabola p) {/*<asyxml></code><documentation>Cast parabola to path. If possible, the returned path is restricted to the actual bounding box @@ -3781,7 +3791,7 @@ path operator cast(parabola p) } -/*<asyxml><function type = "void" signature = "draw(picture, Label, circle, align, pen, arrowbar, arrowbar, margin, Label, marker)"><code></asyxml>*/ +/*<asyxml><function type="void" signature="draw(picture,Label,circle,align,pen,arrowbar,arrowbar,margin,Label,marker)"><code></asyxml>*/ void draw(picture pic = currentpicture, Label L = "", circle c, align align = NoAlign, pen p = currentpen, arrowbar arrow = None, arrowbar bar = None, @@ -3791,7 +3801,7 @@ void draw(picture pic = currentpicture, Label L = "", circle c, else draw(pic, L, (path)c, align, p, arrow, bar, margin, legend, marker); } -/*<asyxml><function type = "void" signature = "draw(picture, Label, ellipse, align, pen, arrowbar, arrowbar, margin, Label, marker)"><code></asyxml>*/ +/*<asyxml><function type="void" signature="draw(picture,Label,ellipse,align,pen,arrowbar,arrowbar,margin,Label,marker)"><code></asyxml>*/ void draw(picture pic = currentpicture, Label L = "", ellipse el, align align = NoAlign, pen p = currentpen, arrowbar arrow = None, arrowbar bar = None, @@ -3801,7 +3811,7 @@ void draw(picture pic = currentpicture, Label L = "", ellipse el, else draw(pic, L, (path)el, align, p, arrow, bar, margin, legend, marker); } -/*<asyxml><function type = "void" signature = "draw(picture, Label, parabola, align, pen, arrowbar, arrowbar, margin, Label, marker)"><code></asyxml>*/ +/*<asyxml><function type="void" signature="draw(picture,Label,parabola,align,pen,arrowbar,arrowbar,margin,Label,marker)"><code></asyxml>*/ void draw(picture pic = currentpicture, Label L = "", parabola parabola, align align = NoAlign, pen p = currentpen, arrowbar arrow = None, arrowbar bar = None, @@ -3814,8 +3824,12 @@ void draw(picture pic = currentpicture, Label L = "", parabola parabola, parabola.bmin = inverse(t) * m; parabola.bmax = inverse(t) * M; picture tmp; - draw(tmp, L, t * ((path) (T * parabola)), align, p, arrow, bar, NoMargin, legend, marker); - add(f, tmp.fit()); + path pp = t * ((path) (T * parabola)); + + if (pp != nullpath) { + draw(tmp, L, pp, align, p, arrow, bar, NoMargin, legend, marker); + add(f, tmp.fit()); + } }, true); pair m = pic.userMin(), M = pic.userMax(); @@ -3824,7 +3838,7 @@ void draw(picture pic = currentpicture, Label L = "", parabola parabola, } } -/*<asyxml><operator type = "path" signature = "cast(hyperbola)"><code></asyxml>*/ +/*<asyxml><operator type = "path" signature="cast(hyperbola)"><code></asyxml>*/ path operator cast(hyperbola h) {/*<asyxml></code><documentation>Cast hyperbola to path. If possible, the returned path is restricted to the actual bounding box @@ -3836,7 +3850,7 @@ path operator cast(hyperbola h) return arcfromfocus(h, bangles[0][0], bangles[0][1], n, CCW); } -/*<asyxml><function type = "void" signature = "draw(picture, Label, hyperbola, align, pen, arrowbar, arrowbar, margin, Label, marker)"><code></asyxml>*/ +/*<asyxml><function type="void" signature="draw(picture,Label,hyperbola,align,pen,arrowbar,arrowbar,margin,Label,marker)"><code></asyxml>*/ void draw(picture pic = currentpicture, Label L = "", hyperbola h, align align = NoAlign, pen p = currentpen, arrowbar arrow = None, arrowbar bar = None, @@ -3848,15 +3862,22 @@ void draw(picture pic = currentpicture, Label L = "", hyperbola h, m -= min(p); M -= max(p); h.bmin = inverse(t) * m; h.bmax = inverse(t) * M; + path hp; picture tmp; - draw(tmp, L, t * ((path) (T * h)), align, p, arrow, bar, NoMargin, legend, marker); + hp = t * ((path) (T * h)); + if (hp != nullpath) { + draw(tmp, L, hp, align, p, arrow, bar, NoMargin, legend, marker); + } hyperbola ht = hyperbola(h.F2, h.F1, h.a); ht.bmin = h.bmin; ht.bmax = h.bmax; - draw(tmp, "", t * ((path) (T * ht)), align, p, arrow, bar, NoMargin, marker); + hp = t * ((path) (T * ht)); + if (hp != nullpath) { + draw(tmp, "", hp, align, p, arrow, bar, NoMargin, marker); + } add(f, tmp.fit()); }, true); @@ -3866,7 +3887,7 @@ void draw(picture pic = currentpicture, Label L = "", hyperbola h, pic.addBox(truepoint(SW), truepoint(NE)); } -/*<asyxml><function type = "void" signature = "draw(picture, Label, explicit conic, align, pen, arrowbar, arrowbar, margin, Label, marker)"><code></asyxml>*/ +/*<asyxml><function type="void" signature="draw(picture,Label,explicit conic,align,pen,arrowbar,arrowbar,margin,Label,marker)"><code></asyxml>*/ void draw(picture pic = currentpicture, Label L = "", explicit conic co, align align = NoAlign, pen p = currentpen, arrowbar arrow = None, arrowbar bar = None, @@ -3884,7 +3905,7 @@ void draw(picture pic = currentpicture, Label L = "", explicit conic co, else abort("draw: unknown conic."); } -/*<asyxml><function type = "int" signature = "conicnodesnumber(conic, real, real)"><code></asyxml>*/ +/*<asyxml><function type="int" signature="conicnodesnumber(conic,real,real)"><code></asyxml>*/ int conicnodesnumber(conic co, real angle1, real angle2, bool dir = CCW) {/*<asyxml></code><documentation>Return the number of node to draw a conic arc.</documentation></function></asyxml>*/ int oi; @@ -3904,7 +3925,7 @@ int conicnodesnumber(conic co, real angle1, real angle2, bool dir = CCW) return oi; } -/*<asyxml><operator type = "path" signature = "cast(conic)"><code></asyxml>*/ +/*<asyxml><operator type = "path" signature="cast(conic)"><code></asyxml>*/ path operator cast(conic co) {/*<asyxml></code><documentation>Cast conic section to path.</documentation></operator></asyxml>*/ if(co.e < 1) return (path)((ellipse)co); @@ -3912,7 +3933,7 @@ path operator cast(conic co) return (path)((hyperbola)co); } -/*<asyxml><function type = "bqe" signature = "equation(explicit conic)"><code></asyxml>*/ +/*<asyxml><function type="bqe" signature="equation(explicit conic)"><code></asyxml>*/ bqe equation(explicit conic co) {/*<asyxml></code><documentation>Return the coefficients of the equation of conic section in its coordinate system: bqe.a[0] * x^2 + bqe.a[1] * x * y + bqe.a[2] * y^2 + bqe.a[3] * x + bqe.a[4] * y + bqe.a[5] = 0. @@ -3930,7 +3951,7 @@ bqe equation(explicit conic co) return obqe; } -/*<asyxml><function type = "string" signature = "conictype(bqe)"><code></asyxml>*/ +/*<asyxml><function type="string" signature="conictype(bqe)"><code></asyxml>*/ string conictype(bqe bqe) {/*<asyxml></code><documentation>Returned values are "ellipse" or "parabola" or "hyperbola" depending of the conic section represented by 'bqe'.</documentation></function></asyxml>*/ @@ -3950,7 +3971,7 @@ string conictype(bqe bqe) return os; } -/*<asyxml><function type = "conic" signature = "conic(point, point, point, point, point)"><code></asyxml>*/ +/*<asyxml><function type="conic" signature="conic(point,point,point,point,point)"><code></asyxml>*/ conic conic(point M1, point M2, point M3, point M4, point M5) {/*<asyxml></code><documentation>Return the conic passing through 'M1', 'M2', 'M3', 'M4' and 'M5' if the conic is not degenerated.</documentation></function></asyxml>*/ bqe bqe = bqe(M1, M2, M3, M4, M5); @@ -3961,7 +3982,7 @@ conic conic(point M1, point M2, point M3, point M4, point M5) return hyperbola(bqe); } -/*<asyxml><function type = "coordsys" signature = "canonicalcartesiansystem(hyperbola)"><code></asyxml>*/ +/*<asyxml><function type="coordsys" signature="canonicalcartesiansystem(hyperbola)"><code></asyxml>*/ coordsys canonicalcartesiansystem(explicit conic co) {/*<asyxml></code><documentation>Return the canonical cartesian system of the conic 'co'.</documentation></function></asyxml>*/ if(co.e < 1) return canonicalcartesiansystem((ellipse)co); @@ -3969,7 +3990,7 @@ coordsys canonicalcartesiansystem(explicit conic co) return canonicalcartesiansystem((hyperbola)co); } -/*<asyxml><function type = "bqe" signature = "canonical(bqe)"><code></asyxml>*/ +/*<asyxml><function type="bqe" signature="canonical(bqe)"><code></asyxml>*/ bqe canonical(bqe bqe) {/*<asyxml></code><documentation>Return the bivariate quadratic equation relative to the canonical coordinate system of the conic section represented by 'bqe'.</documentation></function></asyxml>*/ @@ -3991,7 +4012,7 @@ bqe canonical(bqe bqe) return obqe; } -/*<asyxml><function type = "conic" signature = "conic(bqe)"><code></asyxml>*/ +/*<asyxml><function type="conic" signature="conic(bqe)"><code></asyxml>*/ conic conic(bqe bqe) {/*<asyxml></code><documentation>Return the conic section represented by the bivariate quartic equation 'bqe'.</documentation></function></asyxml>*/ string type = conictype(bqe); @@ -4005,13 +4026,13 @@ conic conic(bqe bqe) return oc; } -/*<asyxml><function type = "real" signature = "arclength(circle)"><code></asyxml>*/ +/*<asyxml><function type="real" signature="arclength(circle)"><code></asyxml>*/ real arclength(circle c) {/*<asyxml></code><documentation></documentation></function></asyxml>*/ return c.r * 2 * pi; } -/*<asyxml><function type = "real" signature = "focusToCenter(ellipse, real)"><code></asyxml>*/ +/*<asyxml><function type="real" signature="focusToCenter(ellipse,real)"><code></asyxml>*/ real focusToCenter(ellipse el, real a) {/*<asyxml></code><documentation>Return the angle relatively to the center of 'el' for the angle 'a' given relatively to the focus of 'el'.</documentation></function></asyxml>*/ @@ -4022,7 +4043,7 @@ real focusToCenter(ellipse el, real a) return d%(sgnd(a) * 360); } -/*<asyxml><function type = "real" signature = "centerToFocus(ellipse, real)"><code></asyxml>*/ +/*<asyxml><function type="real" signature="centerToFocus(ellipse,real)"><code></asyxml>*/ real centerToFocus(ellipse el, real a) {/*<asyxml></code><documentation>Return the angle relatively to the focus of 'el' for the angle 'a' given relatively to the center of 'el'.</documentation></function></asyxml>*/ @@ -4034,13 +4055,13 @@ real centerToFocus(ellipse el, real a) return d%(sgnd(a) * 360); } -/*<asyxml><function type = "real" signature = "arclength(ellipse)"><code></asyxml>*/ +/*<asyxml><function type="real" signature="arclength(ellipse)"><code></asyxml>*/ real arclength(ellipse el) {/*<asyxml></code><documentation></documentation></function></asyxml>*/ return degenerate(el) ? infinity : 4 * el.a * elle(pi/2, el.e); } -/*<asyxml><function type = "real" signature = "arclength(ellipse, real, real, bool, polarconicroutine)"><code></asyxml>*/ +/*<asyxml><function type="real" signature="arclength(ellipse,real,real,bool,polarconicroutine)"><code></asyxml>*/ real arclength(ellipse el, real angle1, real angle2, bool direction = CCW, polarconicroutine polarconicroutine = currentpolarconicroutine) @@ -4113,7 +4134,7 @@ real arclength(ellipse el, real angle1, real angle2, return S(a2) - S(a1); } -/*<asyxml><function type = "real" signature = "arclength(parabola, real)"><code></asyxml>*/ +/*<asyxml><function type="real" signature="arclength(parabola,real)"><code></asyxml>*/ real arclength(parabola p, real angle) {/*<asyxml></code><documentation>Return the arclength from 180 to 'angle' given from focus in the canonical coordinate system of 'p'.</documentation></function></asyxml>*/ @@ -4126,14 +4147,14 @@ real arclength(parabola p, real angle) return S(t); } -/*<asyxml><function type = "real" signature = "arclength(parabola, real, real)"><code></asyxml>*/ +/*<asyxml><function type="real" signature="arclength(parabola,real,real)"><code></asyxml>*/ real arclength(parabola p, real angle1, real angle2) {/*<asyxml></code><documentation>Return the arclength from 'angle1' to 'angle2' given from focus in the canonical coordinate system of 'p'</documentation></function></asyxml>*/ return arclength(p, angle1) - arclength(p, angle2); } -/*<asyxml><function type = "real" signature = "arclength(parabola p)"><code></asyxml>*/ +/*<asyxml><function type="real" signature="arclength(parabola p)"><code></asyxml>*/ real arclength(parabola p) {/*<asyxml></code><documentation>Return the length of the arc of the parabola bounded to the bounding box of the current picture.</documentation></function></asyxml>*/ @@ -4145,15 +4166,15 @@ real arclength(parabola p) // *=======================================================* // *.......................ABSCISSA........................* -/*<asyxml><struct signature = "abscissa"><code></asyxml>*/ +/*<asyxml><struct signature="abscissa"><code></asyxml>*/ struct abscissa {/*<asyxml></code><documentation>Provide abscissa structure on a curve used in the routine-like 'point(object, abscissa)' - where object can be 'line', 'segment', 'ellipse', 'circle', 'conic'...</documentation><property type = "real" signature = "x"><code></asyxml>*/ - real x;/*<asyxml></code><documentation>The abscissa value.</documentation></property><property type = "int" signature = "system"><code></asyxml>*/ - int system;/*<asyxml></code><documentation>0 = relativesystem; 1 = curvilinearsystem; 2 = angularsystem; 3 = nodesystem</documentation></property><property type = "polarconicroutine" signature = "polarconicroutine"><code></asyxml>*/ + where object can be 'line','segment','ellipse','circle','conic'...</documentation><property type = "real" signature="x"><code></asyxml>*/ + real x;/*<asyxml></code><documentation>The abscissa value.</documentation></property><property type = "int" signature="system"><code></asyxml>*/ + int system;/*<asyxml></code><documentation>0 = relativesystem; 1 = curvilinearsystem; 2 = angularsystem; 3 = nodesystem</documentation></property><property type = "polarconicroutine" signature="polarconicroutine"><code></asyxml>*/ polarconicroutine polarconicroutine = fromCenter;/*<asyxml></code><documentation>The routine used with angular system and two foci conic section. Possible values are 'formCenter' and 'formFocus'.</documentation></property></asyxml>*/ - /*<asyxml><method type = "abscissa" signature = "copy()"><code></asyxml>*/ + /*<asyxml><method type = "abscissa" signature="copy()"><code></asyxml>*/ abscissa copy() {/*<asyxml></code><documentation>Return a copy of this abscissa.</documentation></method></asyxml>*/ abscissa oa = new abscissa; @@ -4164,10 +4185,10 @@ struct abscissa } }/*<asyxml></struct></asyxml>*/ -/*<asyxml><constant type = "int" signature = "relativesystem, curvilinearsystem, angularsystem, nodesystem"><code></asyxml>*/ +/*<asyxml><constant type = "int" signature="relativesystem,curvilinearsystem,angularsystem,nodesystem"><code></asyxml>*/ restricted int relativesystem = 0, curvilinearsystem = 1, angularsystem = 2, nodesystem = 3;/*<asyxml></code><documentation>Constant used to set the abscissa system.</documentation></constant></asyxml>*/ -/*<asyxml><operator type = "abscissa" signature = "cast(explicit position)"><code></asyxml>*/ +/*<asyxml><operator type = "abscissa" signature="cast(explicit position)"><code></asyxml>*/ abscissa operator cast(explicit position position) {/*<asyxml></code><documentation>Cast position to abscissa. If 'position' is relative, the abscissa is relative else it's a curvilinear abscissa.</documentation></operator></asyxml>*/ @@ -4177,7 +4198,7 @@ abscissa operator cast(explicit position position) return oarcc; } -/*<asyxml><operator type = "abscissa" signature = "+(real, explicit abscissa)"><code></asyxml>*/ +/*<asyxml><operator type = "abscissa" signature="+(real,explicit abscissa)"><code></asyxml>*/ abscissa operator +(real x, explicit abscissa a) {/*<asyxml></code><documentation>Provide 'real + abscissa'. Return abscissa b so that b.x = a.x + x. @@ -4186,6 +4207,7 @@ abscissa operator +(real x, explicit abscissa a) oa.x = a.x + x; return oa; } + abscissa operator +(explicit abscissa a, real x) { return x + a; @@ -4195,7 +4217,7 @@ abscissa operator +(int x, explicit abscissa a) return ((real)x) + a; } -/*<asyxml><operator type = "abscissa" signature = "-(explicit abscissa a)"><code></asyxml>*/ +/*<asyxml><operator type = "abscissa" signature="-(explicit abscissa a)"><code></asyxml>*/ abscissa operator -(explicit abscissa a) {/*<asyxml></code><documentation>Return the abscissa b so that b.x = -a.x.</documentation></operator></asyxml>*/ abscissa oa; @@ -4223,7 +4245,7 @@ abscissa operator -(int x, explicit abscissa a) return ((real)x) - a; } -/*<asyxml><operator type = "abscissa" signature = "*(real, abscissa)"><code></asyxml>*/ +/*<asyxml><operator type = "abscissa" signature="*(real,abscissa)"><code></asyxml>*/ abscissa operator *(real x, explicit abscissa a) {/*<asyxml></code><documentation>Provide 'real * abscissa'. Return abscissa b so that b.x = x * a.x. @@ -4258,7 +4280,7 @@ abscissa operator /(int x, explicit abscissa a) return ((real)x)/a; } -/*<asyxml><function type = "abscissa" signature = "relabscissa(real)"><code></asyxml>*/ +/*<asyxml><function type="abscissa" signature="relabscissa(real)"><code></asyxml>*/ abscissa relabscissa(real x) {/*<asyxml></code><documentation>Return a relative abscissa.</documentation></function></asyxml>*/ return (abscissa)(Relative(x)); @@ -4268,7 +4290,7 @@ abscissa relabscissa(int x) return (abscissa)(Relative(x)); } -/*<asyxml><function type = "abscissa" signature = "curabscissa(real)"><code></asyxml>*/ +/*<asyxml><function type="abscissa" signature="curabscissa(real)"><code></asyxml>*/ abscissa curabscissa(real x) {/*<asyxml></code><documentation>Return a curvilinear abscissa.</documentation></function></asyxml>*/ return (abscissa)((position)x); @@ -4278,7 +4300,7 @@ abscissa curabscissa(int x) return (abscissa)((position)x); } -/*<asyxml><function type = "abscissa" signature = "angabscissa(real, polarconicroutine)"><code></asyxml>*/ +/*<asyxml><function type="abscissa" signature="angabscissa(real,polarconicroutine)"><code></asyxml>*/ abscissa angabscissa(real x, polarconicroutine polarconicroutine = currentpolarconicroutine) {/*<asyxml></code><documentation>Return a angular abscissa.</documentation></function></asyxml>*/ abscissa oarcc; @@ -4292,7 +4314,7 @@ abscissa angabscissa(int x, polarconicroutine polarconicroutine = currentpolarco return angabscissa((real)x, polarconicroutine); } -/*<asyxml><function type = "abscissa" signature = "nodabscissa(real)"><code></asyxml>*/ +/*<asyxml><function type="abscissa" signature="nodabscissa(real)"><code></asyxml>*/ abscissa nodabscissa(real x) {/*<asyxml></code><documentation>Return an abscissa as time on the path.</documentation></function></asyxml>*/ abscissa oarcc; @@ -4305,7 +4327,7 @@ abscissa nodabscissa(int x) return nodabscissa((real)x); } -/*<asyxml><operator type = "abscissa" signature = "cast(real)"><code></asyxml>*/ +/*<asyxml><operator type = "abscissa" signature="cast(real)"><code></asyxml>*/ abscissa operator cast(real x) {/*<asyxml></code><documentation>Cast real to abscissa, precisely 'nodabscissa'.</documentation></operator></asyxml>*/ return nodabscissa(x); @@ -4315,7 +4337,7 @@ abscissa operator cast(int x) return nodabscissa((real)x); } -/*<asyxml><function type = "point" signature = "point(circle, abscissa)"><code></asyxml>*/ +/*<asyxml><function type="point" signature="point(circle,abscissa)"><code></asyxml>*/ point point(circle c, abscissa l) {/*<asyxml></code><documentation>Return the point of 'c' which has the abscissa 'l.x' according to the abscissa system 'l.system'.</documentation></function></asyxml>*/ @@ -4332,7 +4354,7 @@ point point(circle c, abscissa l) return (0, 0); } -/*<asyxml><function type = "point" signature = "point(ellipse, abscissa)"><code></asyxml>*/ +/*<asyxml><function type="point" signature="point(ellipse,abscissa)"><code></asyxml>*/ point point(ellipse el, abscissa l) {/*<asyxml></code><documentation>Return the point of 'el' which has the abscissa 'l.x' according to the abscissa system 'l.system'.</documentation></function></asyxml>*/ @@ -4362,7 +4384,7 @@ point point(ellipse el, abscissa l) return (0, 0); } -/*<asyxml><function type = "point" signature = "point(parabola, abscissa)"><code></asyxml>*/ +/*<asyxml><function type="point" signature="point(parabola,abscissa)"><code></asyxml>*/ point point(parabola p, abscissa l) {/*<asyxml></code><documentation>Return the point of 'p' which has the abscissa 'l.x' according to the abscissa system 'l.system'.</documentation></function></asyxml>*/ @@ -4390,7 +4412,7 @@ point point(parabola p, abscissa l) return (0, 0); } -/*<asyxml><function type = "point" signature = "point(hyperbola, abscissa)"><code></asyxml>*/ +/*<asyxml><function type="point" signature="point(hyperbola,abscissa)"><code></asyxml>*/ point point(hyperbola h, abscissa l) {/*<asyxml></code><documentation>Return the point of 'h' which has the abscissa 'l.x' according to the abscissa system 'l.system'.</documentation></function></asyxml>*/ @@ -4411,7 +4433,7 @@ Try relpoint((path)your_hyperbola, x);"); return (0, 0); } -/*<asyxml><function type = "abscissa" signature = "point(conic, point)"><code></asyxml>*/ +/*<asyxml><function type="abscissa" signature="point(conic,point)"><code></asyxml>*/ point point(explicit conic co, abscissa l) {/*<asyxml></code><documentation>Return the curvilinear abscissa of 'M' on the conic 'co'.</documentation></function></asyxml>*/ if(co.e == 0) return point((circle)co, l); @@ -4421,7 +4443,7 @@ point point(explicit conic co, abscissa l) } -/*<asyxml><function type = "point" signature = "point(line, abscissa)"><code></asyxml>*/ +/*<asyxml><function type="point" signature="point(line,abscissa)"><code></asyxml>*/ point point(line l, abscissa x) {/*<asyxml></code><documentation>Return the point of 'l' which has the abscissa 'l.x' according to the abscissa system 'l.system'. Note that the origin is l.A, and point(l, relabscissa(x)) returns l.A + x.x * vector(l.B - l.A).</documentation></function></asyxml>*/ @@ -4438,7 +4460,7 @@ point point(line l, abscissa x) return (0, 0); } -/*<asyxml><function type = "point" signature = "point(line, real)"><code></asyxml>*/ +/*<asyxml><function type="point" signature="point(line,real)"><code></asyxml>*/ point point(line l, explicit real x) {/*<asyxml></code><documentation>Return the point between node l.A and l.B (x <= 0 means l.A, x >=1 means l.B).</documentation></function></asyxml>*/ return point(l, nodabscissa(x)); @@ -4448,7 +4470,7 @@ point point(line l, explicit int x) return point(l, nodabscissa(x)); } -/*<asyxml><function type = "circle" signature = "point(explicit circle, explicit real)"><code></asyxml>*/ +/*<asyxml><function type="circle" signature="point(explicit circle,explicit real)"><code></asyxml>*/ point point(explicit circle c, explicit real x) {/*<asyxml></code><documentation>Return the point between node floor(x) and floor(x) + 1.</documentation></function></asyxml>*/ return point(c, nodabscissa(x)); @@ -4458,7 +4480,7 @@ point point(explicit circle c, explicit int x) return point(c, nodabscissa(x)); } -/*<asyxml><function type = "point" signature = "point(explicit ellipse, explicit real)"><code></asyxml>*/ +/*<asyxml><function type="point" signature="point(explicit ellipse,explicit real)"><code></asyxml>*/ point point(explicit ellipse el, explicit real x) {/*<asyxml></code><documentation>Return the point between node floor(x) and floor(x) + 1.</documentation></function></asyxml>*/ return point(el, nodabscissa(x)); @@ -4468,7 +4490,7 @@ point point(explicit ellipse el, explicit int x) return point(el, nodabscissa(x)); } -/*<asyxml><function type = "point" signature = "point(explicit parabola, explicit real)"><code></asyxml>*/ +/*<asyxml><function type="point" signature="point(explicit parabola,explicit real)"><code></asyxml>*/ point point(explicit parabola p, explicit real x) {/*<asyxml></code><documentation>Return the point between node floor(x) and floor(x) + 1.</documentation></function></asyxml>*/ return point(p, nodabscissa(x)); @@ -4478,7 +4500,7 @@ point point(explicit parabola p, explicit int x) return point(p, nodabscissa(x)); } -/*<asyxml><function type = "point" signature = "point(explicit hyperbola, explicit real)"><code></asyxml>*/ +/*<asyxml><function type="point" signature="point(explicit hyperbola,explicit real)"><code></asyxml>*/ point point(explicit hyperbola h, explicit real x) {/*<asyxml></code><documentation>Return the point between node floor(x) and floor(x) + 1.</documentation></function></asyxml>*/ return point(h, nodabscissa(x)); @@ -4488,7 +4510,7 @@ point point(explicit hyperbola h, explicit int x) return point(h, nodabscissa(x)); } -/*<asyxml><function type = "point" signature = "point(explicit conic, explicit real)"><code></asyxml>*/ +/*<asyxml><function type="point" signature="point(explicit conic,explicit real)"><code></asyxml>*/ point point(explicit conic co, explicit real x) {/*<asyxml></code><documentation>Return the point between node floor(x) and floor(x) + 1.</documentation></function></asyxml>*/ point op; @@ -4503,27 +4525,27 @@ point point(explicit conic co, explicit int x) return point(co, (real)x); } -/*<asyxml><function type = "point" signature = "relpoint(line, real)"><code></asyxml>*/ +/*<asyxml><function type="point" signature="relpoint(line,real)"><code></asyxml>*/ point relpoint(line l, real x) {/*<asyxml></code><documentation>Return the relative point of 'l' (0 means l.A, 1 means l.B, x means l.A + x * vector(l.B - l.A) ).</documentation></function></asyxml>*/ return point(l, Relative(x)); } -/*<asyxml><function type = "point" signature = "relpoint(explicit circle, real)"><code></asyxml>*/ +/*<asyxml><function type="point" signature="relpoint(explicit circle,real)"><code></asyxml>*/ point relpoint(explicit circle c, real x) {/*<asyxml></code><documentation>Return the relative point of 'c' (0 means origin, 1 means end). Origin is c.center + c.r * (1, 0).</documentation></function></asyxml>*/ return point(c, Relative(x)); } -/*<asyxml><function type = "point" signature = "relpoint(explicit ellipse, real)"><code></asyxml>*/ +/*<asyxml><function type="point" signature="relpoint(explicit ellipse,real)"><code></asyxml>*/ point relpoint(explicit ellipse el, real x) {/*<asyxml></code><documentation>Return the relative point of 'el' (0 means origin, 1 means end).</documentation></function></asyxml>*/ return point(el, Relative(x)); } -/*<asyxml><function type = "point" signature = "relpoint(explicit parabola, real)"><code></asyxml>*/ +/*<asyxml><function type="point" signature="relpoint(explicit parabola,real)"><code></asyxml>*/ point relpoint(explicit parabola p, real x) {/*<asyxml></code><documentation>Return the relative point of the path of the parabola bounded by the bounding box of the current picture. @@ -4531,13 +4553,13 @@ point relpoint(explicit parabola p, real x) return point(p, Relative(x)); } -/*<asyxml><function type = "point" signature = "relpoint(explicit hyperbola, real)"><code></asyxml>*/ +/*<asyxml><function type="point" signature="relpoint(explicit hyperbola,real)"><code></asyxml>*/ point relpoint(explicit hyperbola h, real x) {/*<asyxml></code><documentation>Not yet implemented... <look href = "point(hyperbola, abscissa)"/></documentation></function></asyxml>*/ return point(h, Relative(x)); } -/*<asyxml><function type = "point" signature = "relpoint(explicit conic, explicit real)"><code></asyxml>*/ +/*<asyxml><function type="point" signature="relpoint(explicit conic,explicit real)"><code></asyxml>*/ point relpoint(explicit conic co, explicit real x) {/*<asyxml></code><documentation>Return the relative point of 'co' (0 means origin, 1 means end).</documentation></function></asyxml>*/ point op; @@ -4552,13 +4574,13 @@ point relpoint(explicit conic co, explicit int x) return relpoint(co, (real)x); } -/*<asyxml><function type = "point" signature = "angpoint(explicit circle, real)"><code></asyxml>*/ +/*<asyxml><function type="point" signature="angpoint(explicit circle,real)"><code></asyxml>*/ point angpoint(explicit circle c, real x) {/*<asyxml></code><documentation>Return the point of 'c' in the direction 'x' measured in degrees.</documentation></function></asyxml>*/ return point(c, angabscissa(x)); } -/*<asyxml><function type = "point" signature = "angpoint(explicit ellipse, real, polarconicroutine)"><code></asyxml>*/ +/*<asyxml><function type="point" signature="angpoint(explicit ellipse,real,polarconicroutine)"><code></asyxml>*/ point angpoint(explicit ellipse el, real x, polarconicroutine polarconicroutine = currentpolarconicroutine) {/*<asyxml></code><documentation>Return the point of 'el' in the direction 'x' @@ -4566,13 +4588,13 @@ point angpoint(explicit ellipse el, real x, return el.e == 0 ? angpoint((circle) el, x) : point(el, angabscissa(x, polarconicroutine)); } -/*<asyxml><function type = "point" signature = "angpoint(explicit parabola, real)"><code></asyxml>*/ +/*<asyxml><function type="point" signature="angpoint(explicit parabola,real)"><code></asyxml>*/ point angpoint(explicit parabola p, real x) {/*<asyxml></code><documentation>Return the point of 'p' in the direction 'x' measured in degrees.</documentation></function></asyxml>*/ return point(p, angabscissa(x)); } -/*<asyxml><function type = "point" signature = "angpoint(explicit hyperbola, real, polarconicroutine)"><code></asyxml>*/ +/*<asyxml><function type="point" signature="angpoint(explicit hyperbola,real,polarconicroutine)"><code></asyxml>*/ point angpoint(explicit hyperbola h, real x, polarconicroutine polarconicroutine = currentpolarconicroutine) {/*<asyxml></code><documentation>Return the point of 'h' in the direction 'x' @@ -4580,34 +4602,34 @@ point angpoint(explicit hyperbola h, real x, return point(h, angabscissa(x, polarconicroutine)); } -/*<asyxml><function type = "point" signature = "curpoint(line, real)"><code></asyxml>*/ +/*<asyxml><function type="point" signature="curpoint(line,real)"><code></asyxml>*/ point curpoint(line l, real x) {/*<asyxml></code><documentation>Return the point of 'l' which has the curvilinear abscissa 'x'. Origin is l.A.</documentation></function></asyxml>*/ return point(l, curabscissa(x)); } -/*<asyxml><function type = "point" signature = "curpoint(explicit circle, real)"><code></asyxml>*/ +/*<asyxml><function type="point" signature="curpoint(explicit circle,real)"><code></asyxml>*/ point curpoint(explicit circle c, real x) {/*<asyxml></code><documentation>Return the point of 'c' which has the curvilinear abscissa 'x'. Origin is c.center + c.r * (1, 0).</documentation></function></asyxml>*/ return point(c, curabscissa(x)); } -/*<asyxml><function type = "point" signature = "curpoint(explicit ellipse, real)"><code></asyxml>*/ +/*<asyxml><function type="point" signature="curpoint(explicit ellipse,real)"><code></asyxml>*/ point curpoint(explicit ellipse el, real x) {/*<asyxml></code><documentation>Return the point of 'el' which has the curvilinear abscissa 'el'.</documentation></function></asyxml>*/ return point(el, curabscissa(x)); } -/*<asyxml><function type = "point" signature = "curpoint(explicit parabola, real)"><code></asyxml>*/ +/*<asyxml><function type="point" signature="curpoint(explicit parabola,real)"><code></asyxml>*/ point curpoint(explicit parabola p, real x) {/*<asyxml></code><documentation>Return the point of 'p' which has the curvilinear abscissa 'x'. Origin is the vertex of 'p'.</documentation></function></asyxml>*/ return point(p, curabscissa(x)); } -/*<asyxml><function type = "point" signature = "curpoint(conic, real)"><code></asyxml>*/ +/*<asyxml><function type="point" signature="curpoint(conic,real)"><code></asyxml>*/ point curpoint(conic co, real x) {/*<asyxml></code><documentation>Return the point of 'co' which has the curvilinear abscissa 'x'.</documentation></function></asyxml>*/ point op; @@ -4618,7 +4640,7 @@ point curpoint(conic co, real x) return op; } -/*<asyxml><function type = "abscissa" signature = "angabscissa(circle, point)"><code></asyxml>*/ +/*<asyxml><function type="abscissa" signature="angabscissa(circle,point)"><code></asyxml>*/ abscissa angabscissa(circle c, point M) {/*<asyxml></code><documentation>Return the angular abscissa of 'M' on the circle 'c'.</documentation></function></asyxml>*/ if(!(M @ c)) abort("angabscissa: the point is not on the circle."); @@ -4629,7 +4651,7 @@ abscissa angabscissa(circle c, point M) return oa; } -/*<asyxml><function type = "abscissa" signature = "angabscissa(ellipse, point, polarconicroutine)"><code></asyxml>*/ +/*<asyxml><function type="abscissa" signature="angabscissa(ellipse,point,polarconicroutine)"><code></asyxml>*/ abscissa angabscissa(ellipse el, point M, polarconicroutine polarconicroutine = currentpolarconicroutine) {/*<asyxml></code><documentation>Return the angular abscissa of 'M' on the ellipse 'el' according to 'polarconicroutine'.</documentation></function></asyxml>*/ @@ -4643,7 +4665,7 @@ abscissa angabscissa(ellipse el, point M, return oa; } -/*<asyxml><function type = "abscissa" signature = "angabscissa(hyperbola, point, polarconicroutine)"><code></asyxml>*/ +/*<asyxml><function type="abscissa" signature="angabscissa(hyperbola,point,polarconicroutine)"><code></asyxml>*/ abscissa angabscissa(hyperbola h, point M, polarconicroutine polarconicroutine = currentpolarconicroutine) {/*<asyxml></code><documentation>Return the angular abscissa of 'M' on the hyperbola 'h' according to 'polarconicroutine'.</documentation></function></asyxml>*/ @@ -4657,7 +4679,7 @@ abscissa angabscissa(hyperbola h, point M, return oa; } -/*<asyxml><function type = "abscissa" signature = "angabscissa(parabola, point)"><code></asyxml>*/ +/*<asyxml><function type="abscissa" signature="angabscissa(parabola,point)"><code></asyxml>*/ abscissa angabscissa(parabola p, point M) {/*<asyxml></code><documentation>Return the angular abscissa of 'M' on the parabola 'p'.</documentation></function></asyxml>*/ if(!(M @ p)) abort("angabscissa: the point is not on the parabola."); @@ -4670,7 +4692,7 @@ abscissa angabscissa(parabola p, point M) return oa; } -/*<asyxml><function type = "abscissa" signature = "angabscissa(conic, point)"><code></asyxml>*/ +/*<asyxml><function type="abscissa" signature="angabscissa(conic,point)"><code></asyxml>*/ abscissa angabscissa(explicit conic co, point M) {/*<asyxml></code><documentation>Return the angular abscissa of 'M' on the conic 'co'.</documentation></function></asyxml>*/ if(co.e == 0) return angabscissa((circle)co, M); @@ -4679,7 +4701,7 @@ abscissa angabscissa(explicit conic co, point M) return angabscissa((hyperbola)co, M); } -/*<asyxml><function type = "abscissa" signature = "curabscissa(line, point)"><code></asyxml>*/ +/*<asyxml><function type="abscissa" signature="curabscissa(line,point)"><code></asyxml>*/ abscissa curabscissa(line l, point M) {/*<asyxml></code><documentation>Return the curvilinear abscissa of 'M' on the line 'l'.</documentation></function></asyxml>*/ if(!(M @ extend(l))) abort("curabscissa: the point is not on the line."); @@ -4689,7 +4711,7 @@ abscissa curabscissa(line l, point M) return oa; } -/*<asyxml><function type = "abscissa" signature = "curabscissa(circle, point)"><code></asyxml>*/ +/*<asyxml><function type="abscissa" signature="curabscissa(circle,point)"><code></asyxml>*/ abscissa curabscissa(circle c, point M) {/*<asyxml></code><documentation>Return the curvilinear abscissa of 'M' on the circle 'c'.</documentation></function></asyxml>*/ if(!(M @ c)) abort("curabscissa: the point is not on the circle."); @@ -4699,7 +4721,7 @@ abscissa curabscissa(circle c, point M) return oa; } -/*<asyxml><function type = "abscissa" signature = "curabscissa(ellipse, point)"><code></asyxml>*/ +/*<asyxml><function type="abscissa" signature="curabscissa(ellipse,point)"><code></asyxml>*/ abscissa curabscissa(ellipse el, point M) {/*<asyxml></code><documentation>Return the curvilinear abscissa of 'M' on the ellipse 'el'.</documentation></function></asyxml>*/ if(!(M @ el)) abort("curabscissa: the point is not on the ellipse."); @@ -4711,7 +4733,7 @@ abscissa curabscissa(ellipse el, point M) return oa; } -/*<asyxml><function type = "abscissa" signature = "curabscissa(parabola, point)"><code></asyxml>*/ +/*<asyxml><function type="abscissa" signature="curabscissa(parabola,point)"><code></asyxml>*/ abscissa curabscissa(parabola p, point M) {/*<asyxml></code><documentation>Return the curvilinear abscissa of 'M' on the parabola 'p'.</documentation></function></asyxml>*/ if(!(M @ p)) abort("curabscissa: the point is not on the parabola."); @@ -4723,7 +4745,7 @@ abscissa curabscissa(parabola p, point M) return oa; } -/*<asyxml><function type = "abscissa" signature = "curabscissa(conic, point)"><code></asyxml>*/ +/*<asyxml><function type="abscissa" signature="curabscissa(conic,point)"><code></asyxml>*/ abscissa curabscissa(conic co, point M) {/*<asyxml></code><documentation>Return the curvilinear abscissa of 'M' on the conic 'co'.</documentation></function></asyxml>*/ if(co.e > 1) abort("curabscissa: not implemented for this hyperbola."); @@ -4732,7 +4754,7 @@ abscissa curabscissa(conic co, point M) return curabscissa((parabola)co, M); } -/*<asyxml><function type = "abscissa" signature = "nodabscissa(line, point)"><code></asyxml>*/ +/*<asyxml><function type="abscissa" signature="nodabscissa(line,point)"><code></asyxml>*/ abscissa nodabscissa(line l, point M) {/*<asyxml></code><documentation>Return the node abscissa of 'M' on the line 'l'.</documentation></function></asyxml>*/ if(!(M @ (segment)l)) abort("nodabscissa: the point is not on the segment."); @@ -4742,7 +4764,7 @@ abscissa nodabscissa(line l, point M) return oa; } -/*<asyxml><function type = "abscissa" signature = "nodabscissa(circle, point)"><code></asyxml>*/ +/*<asyxml><function type="abscissa" signature="nodabscissa(circle,point)"><code></asyxml>*/ abscissa nodabscissa(circle c, point M) {/*<asyxml></code><documentation>Return the node abscissa of 'M' on the circle 'c'.</documentation></function></asyxml>*/ if(!(M @ c)) abort("nodabscissa: the point is not on the circle."); @@ -4752,7 +4774,7 @@ abscissa nodabscissa(circle c, point M) return oa; } -/*<asyxml><function type = "abscissa" signature = "nodabscissa(ellipse, point)"><code></asyxml>*/ +/*<asyxml><function type="abscissa" signature="nodabscissa(ellipse,point)"><code></asyxml>*/ abscissa nodabscissa(ellipse el, point M) {/*<asyxml></code><documentation>Return the node abscissa of 'M' on the ellipse 'el'.</documentation></function></asyxml>*/ if(!(M @ el)) abort("nodabscissa: the point is not on the ellipse."); @@ -4762,7 +4784,7 @@ abscissa nodabscissa(ellipse el, point M) return oa; } -/*<asyxml><function type = "abscissa" signature = "nodabscissa(parabola, point)"><code></asyxml>*/ +/*<asyxml><function type="abscissa" signature="nodabscissa(parabola,point)"><code></asyxml>*/ abscissa nodabscissa(parabola p, point M) {/*<asyxml></code><documentation>Return the node abscissa OF 'M' on the parabola 'p'.</documentation></function></asyxml>*/ if(!(M @ p)) abort("nodabscissa: the point is not on the parabola."); @@ -4775,7 +4797,7 @@ abscissa nodabscissa(parabola p, point M) return oa; } -/*<asyxml><function type = "abscissa" signature = "nodabscissa(conic, point)"><code></asyxml>*/ +/*<asyxml><function type="abscissa" signature="nodabscissa(conic,point)"><code></asyxml>*/ abscissa nodabscissa(conic co, point M) {/*<asyxml></code><documentation>Return the node abscissa of 'M' on the conic 'co'.</documentation></function></asyxml>*/ if(co.e > 1) abort("nodabscissa: not implemented for hyperbola."); @@ -4785,7 +4807,7 @@ abscissa nodabscissa(conic co, point M) } -/*<asyxml><function type = "abscissa" signature = "relabscissa(line, point)"><code></asyxml>*/ +/*<asyxml><function type="abscissa" signature="relabscissa(line,point)"><code></asyxml>*/ abscissa relabscissa(line l, point M) {/*<asyxml></code><documentation>Return the relative abscissa of 'M' on the line 'l'.</documentation></function></asyxml>*/ if(!(M @ extend(l))) abort("relabscissa: the point is not on the line."); @@ -4795,7 +4817,7 @@ abscissa relabscissa(line l, point M) return oa; } -/*<asyxml><function type = "abscissa" signature = "relabscissa(circle, point)"><code></asyxml>*/ +/*<asyxml><function type="abscissa" signature="relabscissa(circle,point)"><code></asyxml>*/ abscissa relabscissa(circle c, point M) {/*<asyxml></code><documentation>Return the relative abscissa of 'M' on the circle 'c'.</documentation></function></asyxml>*/ if(!(M @ c)) abort("relabscissa: the point is not on the circle."); @@ -4805,7 +4827,7 @@ abscissa relabscissa(circle c, point M) return oa; } -/*<asyxml><function type = "abscissa" signature = "relabscissa(ellipse, point)"><code></asyxml>*/ +/*<asyxml><function type="abscissa" signature="relabscissa(ellipse,point)"><code></asyxml>*/ abscissa relabscissa(ellipse el, point M) {/*<asyxml></code><documentation>Return the relative abscissa of 'M' on the ellipse 'el'.</documentation></function></asyxml>*/ if(!(M @ el)) abort("relabscissa: the point is not on the ellipse."); @@ -4816,11 +4838,10 @@ abscissa relabscissa(ellipse el, point M) return oa; } -/*<asyxml><function type = "abscissa" signature = "relabscissa(conic, point)"><code></asyxml>*/ +/*<asyxml><function type="abscissa" signature="relabscissa(conic,point)"><code></asyxml>*/ abscissa relabscissa(conic co, point M) {/*<asyxml></code><documentation>Return the relative abscissa of 'M' on the conic 'co'.</documentation></function></asyxml>*/ - write("PASS"); if(co.e > 1) abort("relabscissa: not implemented for hyperbola and parabola."); if(co.e == 1) return relabscissa((parabola)co, M); if(co.e == 0) return relabscissa((circle)co, M); @@ -4831,20 +4852,20 @@ abscissa relabscissa(conic co, point M) // *=======================================================* // *.........................ARCS..........................* -/*<asyxml><struct signature = "arc"><code></asyxml>*/ +/*<asyxml><struct signature="arc"><code></asyxml>*/ struct arc { /*<asyxml></code><documentation>Implement oriented ellipse (included circle) arcs. All the calculus with this structure will be as exact as Asymptote can do. For a full precision, you must not cast 'arc' to 'path' excepted for drawing routines. - </documentation><property type = "ellipse" signature = "el"><code></asyxml>*/ - ellipse el;/*<asyxml></code><documentation>The support of the arc.</documentation></property><property type = "real" signature = "angle0"><code></asyxml>*/ - restricted real angle0 = 0;/*<asyxml></code><documentation>Internal use: rotating a circle does not modify the origin point, this variable stocks the eventual angle rotation. This value is not used for ellipses which are not circles.</documentation></property><property type = "real" signature = "angle1, angle2"><code></asyxml>*/ - restricted real angle1, angle2;/*<asyxml></code><documentation>Values (in degrees) in ]-360, 360[.</documentation></property><property type = "bool" signature = "direction"><code></asyxml>*/ - bool direction = CCW;/*<asyxml></code><documentation>The arc will be drawn from 'angle1' to 'angle2' rotating in the direction 'direction'.</documentation></property><property type = "polarconicroutine" signature = "polarconicroutine"><code></asyxml>*/ + </documentation><property type = "ellipse" signature="el"><code></asyxml>*/ + ellipse el;/*<asyxml></code><documentation>The support of the arc.</documentation></property><property type = "real" signature="angle0"><code></asyxml>*/ + restricted real angle0 = 0;/*<asyxml></code><documentation>Internal use: rotating a circle does not modify the origin point,this variable stocks the eventual angle rotation. This value is not used for ellipses which are not circles.</documentation></property><property type = "real" signature="angle1,angle2"><code></asyxml>*/ + restricted real angle1, angle2;/*<asyxml></code><documentation>Values (in degrees) in ]-360, 360[.</documentation></property><property type = "bool" signature="direction"><code></asyxml>*/ + bool direction = CCW;/*<asyxml></code><documentation>The arc will be drawn from 'angle1' to 'angle2' rotating in the direction 'direction'.</documentation></property><property type = "polarconicroutine" signature="polarconicroutine"><code></asyxml>*/ polarconicroutine polarconicroutine = currentpolarconicroutine;/*<asyxml></code><documentation>The routine to which the angles refer. If 'el' is a circle 'fromCenter' is always used.</documentation></property></asyxml>*/ - /*<asyxml><method type = "void" signature = "setangles(real, real, real)"><code></asyxml>*/ + /*<asyxml><method type = "void" signature="setangles(real,real,real)"><code></asyxml>*/ void setangles(real a0, real a1, real a2) {/*<asyxml></code><documentation>Set the angles.</documentation></method></asyxml>*/ if (a1 < 0 && a2 < 0) { @@ -4856,7 +4877,7 @@ struct arc { this.angle2 = a2%(sgnd(2) * 360); } - /*<asyxml><method type = "void" signature = "init(ellipse, real, real, real, polarconicroutine, bool)"><code></asyxml>*/ + /*<asyxml><method type = "void" signature="init(ellipse,real,real,real,polarconicroutine,bool)"><code></asyxml>*/ void init(ellipse el, real angle0 = 0, real angle1, real angle2, polarconicroutine polarconicroutine, bool direction = CCW) @@ -4868,7 +4889,7 @@ struct arc { this.direction = direction; } - /*<asyxml><method type = "arc" signature = "copy()"><code></asyxml>*/ + /*<asyxml><method type = "arc" signature="copy()"><code></asyxml>*/ arc copy() {/*<asyxml></code><documentation>Copy the arc.</documentation></method></asyxml>*/ arc oa = new arc; @@ -4882,7 +4903,7 @@ struct arc { } }/*<asyxml></struct></asyxml>*/ -/*<asyxml><function type = "polarconicroutine" signature = "polarconicroutine(ellipse)"><code></asyxml>*/ +/*<asyxml><function type="polarconicroutine" signature="polarconicroutine(ellipse)"><code></asyxml>*/ polarconicroutine polarconicroutine(conic co) {/*<asyxml></code><documentation>Return the default routine used to draw a conic.</documentation></function></asyxml>*/ if(co.e == 0) return fromCenter; @@ -4890,7 +4911,7 @@ polarconicroutine polarconicroutine(conic co) return currentpolarconicroutine; } -/*<asyxml><function type = "arc" signature = "arc(ellipse, real, real, polarconicroutine, bool)"><code></asyxml>*/ +/*<asyxml><function type="arc" signature="arc(ellipse,real,real,polarconicroutine,bool)"><code></asyxml>*/ arc arc(ellipse el, real angle1, real angle2, polarconicroutine polarconicroutine = polarconicroutine(el), bool direction = CCW) @@ -4900,7 +4921,7 @@ arc arc(ellipse el, real angle1, real angle2, return oa; } -/*<asyxml><function type = "arc" signature = "complementary(arc)"><code></asyxml>*/ +/*<asyxml><function type="arc" signature="complementary(arc)"><code></asyxml>*/ arc complementary(arc a) {/*<asyxml></code><documentation>Return the complementary of 'a'.</documentation></function></asyxml>*/ arc oa; @@ -4908,7 +4929,7 @@ arc complementary(arc a) return oa; } -/*<asyxml><function type = "arc" signature = "reverse(arc)"><code></asyxml>*/ +/*<asyxml><function type="arc" signature="reverse(arc)"><code></asyxml>*/ arc reverse(arc a) {/*<asyxml></code><documentation>Return arc 'a' oriented in reverse direction.</documentation></function></asyxml>*/ arc oa; @@ -4916,7 +4937,7 @@ arc reverse(arc a) return oa; } -/*<asyxml><function type = "real" signature = "degrees(arc)"><code></asyxml>*/ +/*<asyxml><function type="real" signature="degrees(arc)"><code></asyxml>*/ real degrees(arc a) {/*<asyxml></code><documentation>Return the measure in degrees of the oriented arc 'a'.</documentation></function></asyxml>*/ real or; @@ -4929,13 +4950,13 @@ real degrees(arc a) return or; } -/*<asyxml><function type = "real" signature = "angle(a)"><code></asyxml>*/ +/*<asyxml><function type="real" signature="angle(a)"><code></asyxml>*/ real angle(arc a) {/*<asyxml></code><documentation>Return the measure in radians of the oriented arc 'a'.</documentation></function></asyxml>*/ return radians(degrees(a)); } -/*<asyxml><function type = "int" signature = "arcnodesnumber(explicit arc)"><code></asyxml>*/ +/*<asyxml><function type="int" signature="arcnodesnumber(explicit arc)"><code></asyxml>*/ int arcnodesnumber(explicit arc a) {/*<asyxml></code><documentation>Return the number of nodes to draw the arc 'a'.</documentation></function></asyxml>*/ return ellipsenodesnumber(a.el.a, a.el.b, a.angle1, a.angle2, a.direction); @@ -4948,7 +4969,7 @@ private path arctopath(arc a, int n) return arcfromfocus(a.el, a.angle1, a.angle2, n, a.direction); } -/*<asyxml><function type = "point" signature = "angpoint(arc, real)"><code></asyxml>*/ +/*<asyxml><function type="point" signature="angpoint(arc,real)"><code></asyxml>*/ point angpoint(arc a, real angle) {/*<asyxml></code><documentation>Return the point given by its angular position (in degrees) relative to the arc 'a'. If 'angle > degrees(a)' or 'angle < 0' the returned point is on the extended arc.</documentation></function></asyxml>*/ @@ -4964,19 +4985,19 @@ point angpoint(arc a, real angle) return point(coordsys(a.el), p/coordsys(a.el)); } -/*<asyxml><operator type = "path" signature = "cast(explicit arc)"><code></asyxml>*/ +/*<asyxml><operator type = "path" signature="cast(explicit arc)"><code></asyxml>*/ path operator cast(explicit arc a) {/*<asyxml></code><documentation>Cast arc to path.</documentation></operator></asyxml>*/ return arctopath(a, arcnodesnumber(a)); } -/*<asyxml><operator type = "guide" signature = "cast(explicit arc)"><code></asyxml>*/ +/*<asyxml><operator type = "guide" signature="cast(explicit arc)"><code></asyxml>*/ guide operator cast(explicit arc a) {/*<asyxml></code><documentation>Cast arc to guide.</documentation></operator></asyxml>*/ return arctopath(a, arcnodesnumber(a)); } -/*<asyxml><operator type = "arc" signature = "*(transform, explicit arc)"><code></asyxml>*/ +/*<asyxml><operator type = "arc" signature="*(transform,explicit arc)"><code></asyxml>*/ arc operator *(transform t, explicit arc a) {/*<asyxml></code><documentation>Provide transform * arc.</documentation></operator></asyxml>*/ pair[] P, PP; @@ -5005,7 +5026,7 @@ arc operator *(transform t, explicit arc a) return oa; } -/*<asyxml><operator type = "arc" signature = "*(real, explicit arc)"><code></asyxml>*/ +/*<asyxml><operator type = "arc" signature="*(real,explicit arc)"><code></asyxml>*/ arc operator *(real x, explicit arc a) {/*<asyxml></code><documentation>Provide real * arc. Return the arc subtracting and adding '(x - 1) * degrees(a)/2' to 'a.angle1' and 'a.angle2' respectively.</documentation></operator></asyxml>*/ @@ -5018,13 +5039,13 @@ arc operator *(real x, explicit arc a) return oa; } arc operator *(int x, explicit arc a){return (real)x * a;} -/*<asyxml><operator type = "arc" signature = "/(real, explicit arc)"><code></asyxml>*/ +/*<asyxml><operator type = "arc" signature="/(real,explicit arc)"><code></asyxml>*/ arc operator /(explicit arc a, real x) {/*<asyxml></code><documentation>Provide arc/real. Return the arc subtracting and adding '(1/x - 1) * degrees(a)/2' to 'a.angle1' and 'a.angle2' respectively.</documentation></operator></asyxml>*/ return (1/x) * a; } -/*<asyxml><operator type = "arc" signature = "+(explicit arc, point)"><code></asyxml>*/ +/*<asyxml><operator type = "arc" signature="+(explicit arc,point)"><code></asyxml>*/ arc operator +(explicit arc a, point M) {/*<asyxml></code><documentation>Provide arc + point. Return shifted arc. @@ -5036,7 +5057,7 @@ arc operator +(explicit arc a, vector v){return shift(locate(v)) * a;} arc operator -(explicit arc a, vector v){return a + (-v);} -/*<asyxml><operator type = "bool" signature = "@(point, arc)"><code></asyxml>*/ +/*<asyxml><operator type = "bool" signature="@(point,arc)"><code></asyxml>*/ bool operator @(point M, arc a) {/*<asyxml></code><documentation>Return true iff 'M' is on the arc 'a'.</documentation></operator></asyxml>*/ if (!(M @ a.el)) return false; @@ -5046,7 +5067,7 @@ bool operator @(point M, arc a) return sameside(M, point(R, point(ap, 1)), l); } -/*<asyxml><function type = "void" signature = "draw(picture, Label, arc, align, pen, arrowbar, arrowbar, margin, Label, marker)"><code></asyxml>*/ +/*<asyxml><function type="void" signature="draw(picture,Label,arc,align,pen,arrowbar,arrowbar,margin,Label,marker)"><code></asyxml>*/ void draw(picture pic = currentpicture, Label L = "", arc a, align align = NoAlign, pen p = currentpen, arrowbar arrow = None, arrowbar bar = None, margin margin = NoMargin, @@ -5056,7 +5077,7 @@ void draw(picture pic = currentpicture, Label L = "", arc a, draw(pic, L, (path)a, align, addpenarc(p), arrow, bar, margin, legend, marker); } -/*<asyxml><function type = "real" signature = "arclength(arc)"><code></asyxml>*/ +/*<asyxml><function type="real" signature="arclength(arc)"><code></asyxml>*/ real arclength(arc a) {/*<asyxml></code><documentation>The arc length of 'a'.</documentation></function></asyxml>*/ return arclength(a.el, a.angle1, a.angle2, a.direction, a.polarconicroutine); @@ -5125,7 +5146,7 @@ private point ppoint(arc a, real x) return oP; } -/*<asyxml><function type = "point" signature = "point(arc, abscissa)"><code></asyxml>*/ +/*<asyxml><function type="point" signature="point(arc,abscissa)"><code></asyxml>*/ point point(arc a, abscissa l) {/*<asyxml></code><documentation>Return the point of 'a' which has the abscissa 'l.x' according to the abscissa system 'l.system'. @@ -5158,7 +5179,7 @@ point point(arc a, abscissa l) } -/*<asyxml><function type = "point" signature = "point(arc, real)"><code></asyxml>*/ +/*<asyxml><function type="point" signature="point(arc,real)"><code></asyxml>*/ point point(arc a, real x) {/*<asyxml></code><documentation>Return the point between node floor(t) and floor(t) + 1.</documentation></function></asyxml>*/ return point(a, nodabscissa(x)); @@ -5168,21 +5189,21 @@ pair point(explicit arc a, int x) return point(a, nodabscissa(x)); } -/*<asyxml><function type = "point" signature = "relpoint(arc, real)"><code></asyxml>*/ +/*<asyxml><function type="point" signature="relpoint(arc,real)"><code></asyxml>*/ point relpoint(arc a, real x) {/*<asyxml></code><documentation>Return the relative point of 'a'. If x > 1 or x < 0, the returned point is on the extended arc.</documentation></function></asyxml>*/ return point(a, relabscissa(x)); } -/*<asyxml><function type = "point" signature = "curpoint(arc, real)"><code></asyxml>*/ +/*<asyxml><function type="point" signature="curpoint(arc,real)"><code></asyxml>*/ point curpoint(arc a, real x) {/*<asyxml></code><documentation>Return the point of 'a' which has the curvilinear abscissa 'x'. If x < 0 or x > arclength(a), the returned point is on the extended arc.</documentation></function></asyxml>*/ return point(a, curabscissa(x)); } -/*<asyxml><function type = "abscissa" signature = "angabscissa(arc, point)"><code></asyxml>*/ +/*<asyxml><function type="abscissa" signature="angabscissa(arc,point)"><code></asyxml>*/ abscissa angabscissa(arc a, point M) {/*<asyxml></code><documentation>Return the angular abscissa of 'M' according to the arc 'a'.</documentation></function></asyxml>*/ if(!(M @ a.el)) @@ -5196,7 +5217,7 @@ abscissa angabscissa(arc a, point M) return oa; } -/*<asyxml><function type = "abscissa" signature = "curabscissa(arc, point)"><code></asyxml>*/ +/*<asyxml><function type="abscissa" signature="curabscissa(arc,point)"><code></asyxml>*/ abscissa curabscissa(arc a, point M) {/*<asyxml></code><documentation>Return the curvilinear abscissa according to the arc 'a'.</documentation></function></asyxml>*/ ellipse el = a.el; @@ -5213,7 +5234,7 @@ abscissa curabscissa(arc a, point M) return oa; } -/*<asyxml><function type = "abscissa" signature = "nodabscissa(arc, point)"><code></asyxml>*/ +/*<asyxml><function type="abscissa" signature="nodabscissa(arc,point)"><code></asyxml>*/ abscissa nodabscissa(arc a, point M) {/*<asyxml></code><documentation>Return the node abscissa according to the arc 'a'.</documentation></function></asyxml>*/ if(!(M @ a)) @@ -5224,7 +5245,7 @@ abscissa nodabscissa(arc a, point M) return oa; } -/*<asyxml><function type = "abscissa" signature = "relabscissa(arc, point)"><code></asyxml>*/ +/*<asyxml><function type="abscissa" signature="relabscissa(arc,point)"><code></asyxml>*/ abscissa relabscissa(arc a, point M) {/*<asyxml></code><documentation>Return the relative abscissa according to the arc 'a'.</documentation></function></asyxml>*/ ellipse el = a.el; @@ -5236,7 +5257,7 @@ abscissa relabscissa(arc a, point M) return oa; } -/*<asyxml><function type = "void" signature = "markarc(picture, Label, int, real, real, arc, arrowbar, pen, pen, margin, marker)"><code></asyxml>*/ +/*<asyxml><function type="void" signature="markarc(picture,Label,int,real,real,arc,arrowbar,pen,pen,margin,marker)"><code></asyxml>*/ void markarc(picture pic = currentpicture, Label L = "", int n = 1, real radius = 0, real space = 0, @@ -5265,13 +5286,13 @@ void markarc(picture pic = currentpicture, // *=======================================================* // *........................MASSES.........................* -/*<asyxml><struct signature = "mass"><code></asyxml>*/ -struct mass {/*<asyxml></code><documentation></documentation><property type = "point" signature = "M"><code></asyxml>*/ - point M;/*<asyxml></code><documentation></documentation></property><property type = "real" signature = "m"><code></asyxml>*/ +/*<asyxml><struct signature="mass"><code></asyxml>*/ +struct mass {/*<asyxml></code><documentation></documentation><property type = "point" signature="M"><code></asyxml>*/ + point M;/*<asyxml></code><documentation></documentation></property><property type = "real" signature="m"><code></asyxml>*/ real m;/*<asyxml></code><documentation></documentation></property></asyxml>*/ }/*<asyxml></struct></asyxml>*/ -/*<asyxml><function type = "mass" signature = "mass(point, real)"><code></asyxml>*/ +/*<asyxml><function type="mass" signature="mass(point,real)"><code></asyxml>*/ mass mass(point M, real m) {/*<asyxml></code><documentation>Constructor of mass point.</documentation></function></asyxml>*/ mass om; @@ -5280,7 +5301,7 @@ mass mass(point M, real m) return om; } -/*<asyxml><operator type = "point" signature = "cast(mass)"><code></asyxml>*/ +/*<asyxml><operator type = "point" signature="cast(mass)"><code></asyxml>*/ point operator cast(mass m) {/*<asyxml></code><documentation>Cast mass point to point.</documentation></operator></asyxml>*/ point op; @@ -5288,11 +5309,11 @@ point operator cast(mass m) op.m = m.m; return op; } -/*<asyxml><function type = "point" signature = "point(explicit mass)"><code></asyxml>*/ +/*<asyxml><function type="point" signature="point(explicit mass)"><code></asyxml>*/ point point(explicit mass m){return m;}/*<asyxml></code><documentation>Cast 'm' to point</documentation></function></asyxml>*/ -/*<asyxml><operator type = "mass" signature = "cast(point)"><code></asyxml>*/ +/*<asyxml><operator type = "mass" signature="cast(point)"><code></asyxml>*/ mass operator cast(point M) {/*<asyxml></code><documentation>Cast point to mass point.</documentation></operator></asyxml>*/ mass om; @@ -5300,13 +5321,13 @@ mass operator cast(point M) om.m = M.m; return om; } -/*<asyxml><function type = "mass" signature = "mass(explicit point)"><code></asyxml>*/ +/*<asyxml><function type="mass" signature="mass(explicit point)"><code></asyxml>*/ mass mass(explicit point P) {/*<asyxml></code><documentation>Cast 'P' to mass.</documentation></function></asyxml>*/ return mass(P, P.m); } -/*<asyxml><operator type = "point[]" signature = "cast(mass[])"><code></asyxml>*/ +/*<asyxml><operator type = "point[]" signature="cast(mass[])"><code></asyxml>*/ point[] operator cast(mass[] m) {/*<asyxml></code><documentation>Cast mass[] to point[].</documentation></operator></asyxml>*/ point[] op; @@ -5314,7 +5335,7 @@ point[] operator cast(mass[] m) return op; } -/*<asyxml><operator type = "mass[]" signature = "cast(point[])"><code></asyxml>*/ +/*<asyxml><operator type = "mass[]" signature="cast(point[])"><code></asyxml>*/ mass[] operator cast(point[] P) {/*<asyxml></code><documentation>Cast point[] to mass[].</documentation></operator></asyxml>*/ mass[] om; @@ -5322,21 +5343,21 @@ mass[] operator cast(point[] P) return om; } -/*<asyxml><function type = "mass" signature = "mass(coordsys, explicit pair, real)"><code></asyxml>*/ +/*<asyxml><function type="mass" signature="mass(coordsys,explicit pair,real)"><code></asyxml>*/ mass mass(coordsys R, explicit pair p, real m) {/*<asyxml></code><documentation>Return the mass which has coordinates 'p' with respect to 'R' and weight 'm'.</documentation></function></asyxml>*/ return point(R, p, m);// Using casting. } -/*<asyxml><operator type = "mass" signature = "cast(pair)"><code></asyxml>*/ +/*<asyxml><operator type = "mass" signature="cast(pair)"><code></asyxml>*/ mass operator cast(pair m){return mass((point)m, 1);}/*<asyxml></code><documentation>Cast pair to mass point.</documentation></operator></asyxml>*/ -/*<asyxml><operator type = "path" signature = "cast(mass)"><code></asyxml>*/ +/*<asyxml><operator type = "path" signature="cast(mass)"><code></asyxml>*/ path operator cast(mass M){return M.M;}/*<asyxml></code><documentation>Cast mass point to path.</documentation></operator></asyxml>*/ -/*<asyxml><operator type = "guide" signature = "cast(mass)"><code></asyxml>*/ +/*<asyxml><operator type = "guide" signature="cast(mass)"><code></asyxml>*/ guide operator cast(mass M){return M.M;}/*<asyxml></code><documentation>Cast mass to guide.</documentation></operator></asyxml>*/ -/*<asyxml><operator type = "mass" signature = "+(mass, mass)"><code></asyxml>*/ +/*<asyxml><operator type = "mass" signature="+(mass,mass)"><code></asyxml>*/ mass operator +(mass M1, mass M2) {/*<asyxml></code><documentation>Provide mass + mass. mass - mass is also defined.</documentation></operator></asyxml>*/ @@ -5347,7 +5368,7 @@ mass operator -(mass M1, mass M2) return mass(M1.M - M2.M, M1.m - M2.m); } -/*<asyxml><operator type = "mass" signature = "*(real, mass)"><code></asyxml>*/ +/*<asyxml><operator type = "mass" signature="*(real,mass)"><code></asyxml>*/ mass operator *(real x, explicit mass M) {/*<asyxml></code><documentation>Provide real * mass. The resulted mass is the mass of 'M' multiplied by 'x' . @@ -5361,13 +5382,13 @@ mass operator +(explicit mass M, real x){return mass(M.M, M.m + x);} mass operator +(explicit mass M, int x){return mass(M.M, M.m + x);} mass operator -(explicit mass M, real x){return mass(M.M, M.m - x);} mass operator -(explicit mass M, int x){return mass(M.M, M.m - x);} -/*<asyxml><operator type = "mass" signature = "*(transform, mass)"><code></asyxml>*/ +/*<asyxml><operator type = "mass" signature="*(transform,mass)"><code></asyxml>*/ mass operator *(transform t, mass M) {/*<asyxml></code><documentation>Provide transform * mass.</documentation></operator></asyxml>*/ return mass(t * M.M, M.m); } -/*<asyxml><function type = "mass" signature = "masscenter(... mass[])"><code></asyxml>*/ +/*<asyxml><function type="mass" signature="masscenter(... mass[])"><code></asyxml>*/ mass masscenter(... mass[] M) {/*<asyxml></code><documentation>Return the center of the masses 'M'.</documentation></function></asyxml>*/ point[] P; @@ -5384,7 +5405,7 @@ mass masscenter(... mass[] M) return mass(oM/m, m); } -/*<asyxml><function type = "string" signature = "massformat(string, string, mass)"><code></asyxml>*/ +/*<asyxml><function type="string" signature="massformat(string,string,mass)"><code></asyxml>*/ string massformat(string format = defaultmassformat, string s, mass M) {/*<asyxml></code><documentation>Return the string formated by 'format' with the mass value. @@ -5394,7 +5415,7 @@ string massformat(string format = defaultmassformat, format(replace(format, "%L", replace(s, "$", "")), M.m); } -/*<asyxml><function type = "void" signature = "label(picture, Label, explicit mass, align, string, pen, filltype)"><code></asyxml>*/ +/*<asyxml><function type="void" signature="label(picture,Label,explicit mass,align,string,pen,filltype)"><code></asyxml>*/ void label(picture pic = currentpicture, Label L, explicit mass M, align align = NoAlign, string format = defaultmassformat, pen p = nullpen, filltype filltype = NoFill) @@ -5406,7 +5427,7 @@ void label(picture pic = currentpicture, Label L, explicit mass M, add(pic, L); } -/*<asyxml><function type = "void" signature = "dot(picture, Label, explicit mass, align, string, pen)"><code></asyxml>*/ +/*<asyxml><function type="void" signature="dot(picture,Label,explicit mass,align,string,pen)"><code></asyxml>*/ void dot(picture pic = currentpicture, Label L, explicit mass M, align align = NoAlign, string format = defaultmassformat, pen p = currentpen) {/*<asyxml></code><documentation>Draw a dot with label 'L' as @@ -5425,7 +5446,7 @@ void dot(picture pic = currentpicture, Label L, explicit mass M, align align = N // *=======================================================* // *.......................TRIANGLES.......................* -/*<asyxml><function type = "point" signature = "orthocentercenter(point, point, point)"><code></asyxml>*/ +/*<asyxml><function type="point" signature="orthocentercenter(point,point,point)"><code></asyxml>*/ point orthocentercenter(point A, point B, point C) {/*<asyxml></code><documentation>Return the orthocenter of the triangle ABC.</documentation></function></asyxml>*/ point[] P = standardizecoordsys(A, B, C); @@ -5434,13 +5455,13 @@ point orthocentercenter(point A, point B, point C) return point(R, pp/R); } -/*<asyxml><function type = "point" signature = "centroid(point, point, point)"><code></asyxml>*/ +/*<asyxml><function type="point" signature="centroid(point,point,point)"><code></asyxml>*/ point centroid(point A, point B, point C) {/*<asyxml></code><documentation>Return the centroid of the triangle ABC.</documentation></function></asyxml>*/ return (A + B + C)/3; } -/*<asyxml><function type = "point" signature = "incenter(point, point, point)"><code></asyxml>*/ +/*<asyxml><function type="point" signature="incenter(point,point,point)"><code></asyxml>*/ point incenter(point A, point B, point C) {/*<asyxml></code><documentation>Return the center of the incircle of the triangle ABC.</documentation></function></asyxml>*/ point[] P = standardizecoordsys(A, B, C); @@ -5450,21 +5471,21 @@ point incenter(point A, point B, point C) return point(R, pp/R); } -/*<asyxml><function type = "real" signature = "inradius(point, point, point)"><code></asyxml>*/ +/*<asyxml><function type="real" signature="inradius(point,point,point)"><code></asyxml>*/ real inradius(point A, point B, point C) {/*<asyxml></code><documentation>Return the radius of the incircle of the triangle ABC.</documentation></function></asyxml>*/ point IC = incenter(A, B, C); return abs(IC - projection(A, B) * IC); } -/*<asyxml><function type = "circle" signature = "incircle(point, point, point)"><code></asyxml>*/ +/*<asyxml><function type="circle" signature="incircle(point,point,point)"><code></asyxml>*/ circle incircle(point A, point B, point C) {/*<asyxml></code><documentation>Return the incircle of the triangle ABC.</documentation></function></asyxml>*/ point IC = incenter(A, B, C); return circle(IC, abs(IC - projection(A, B) * IC)); } -/*<asyxml><function type = "point" signature = "excenter(point, point, point)"><code></asyxml>*/ +/*<asyxml><function type="point" signature="excenter(point,point,point)"><code></asyxml>*/ point excenter(point A, point B, point C) {/*<asyxml></code><documentation>Return the center of the excircle of the triangle tangent with (AB).</documentation></function></asyxml>*/ point[] P = standardizecoordsys(A, B, C); @@ -5474,14 +5495,14 @@ point excenter(point A, point B, point C) return point(R, pp/R); } -/*<asyxml><function type = "real" signature = "exradius(point, point, point)"><code></asyxml>*/ +/*<asyxml><function type="real" signature="exradius(point,point,point)"><code></asyxml>*/ real exradius(point A, point B, point C) {/*<asyxml></code><documentation>Return the radius of the excircle of the triangle ABC with (AB).</documentation></function></asyxml>*/ point EC = excenter(A, B, C); return abs(EC - projection(A, B) * EC); } -/*<asyxml><function type = "circle" signature = "excircle(point, point, point)"><code></asyxml>*/ +/*<asyxml><function type="circle" signature="excircle(point,point,point)"><code></asyxml>*/ circle excircle(point A, point B, point C) {/*<asyxml></code><documentation>Return the excircle of the triangle ABC tangent with (AB).</documentation></function></asyxml>*/ point center = excenter(A, B, C); @@ -5492,22 +5513,22 @@ circle excircle(point A, point B, point C) private int[] numarray = {1, 2, 3}; numarray.cyclic = true; -/*<asyxml><struct signature = "triangle"><code></asyxml>*/ +/*<asyxml><struct signature="triangle"><code></asyxml>*/ struct triangle {/*<asyxml></code><documentation></documentation></asyxml>*/ - /*<asyxml><struct signature = "vertex"><code></asyxml>*/ - struct vertex {/*<asyxml></code><documentation>Structure used to communicate the vertex of a triangle.</documentation><property type = "int" signature = "n"><code></asyxml>*/ - int n;/*<asyxml></code><documentation>1 means VA, 2 means VB, 3 means VC, 4 means VA etc...</documentation></property><property type = "triangle" signature = "triangle"><code></asyxml>*/ + /*<asyxml><struct signature="vertex"><code></asyxml>*/ + struct vertex {/*<asyxml></code><documentation>Structure used to communicate the vertex of a triangle.</documentation><property type = "int" signature="n"><code></asyxml>*/ + int n;/*<asyxml></code><documentation>1 means VA,2 means VB,3 means VC,4 means VA etc...</documentation></property><property type = "triangle" signature="triangle"><code></asyxml>*/ triangle t;/*<asyxml></code><documentation>The triangle to which the vertex refers.</documentation></property></asyxml>*/ }/*<asyxml></struct></asyxml>*/ - /*<asyxml><property type = "point" signature = "A, B, C"><code></asyxml>*/ - restricted point A, B, C;/*<asyxml></code><documentation>The vertices of the triangle (as point).</documentation></property><property type = "vertex" signature = "VA, VB, VC"><code></asyxml>*/ + /*<asyxml><property type = "point" signature="A,B,C"><code></asyxml>*/ + restricted point A, B, C;/*<asyxml></code><documentation>The vertices of the triangle (as point).</documentation></property><property type = "vertex" signature="VA, VB, VC"><code></asyxml>*/ restricted vertex VA, VB, VC;/*<asyxml></code><documentation>The vertices of the triangle (as vertex). Note that the vertex structure contains the triangle to wish it refers.</documentation></property></asyxml>*/ VA.n = 1;VB.n = 2;VC.n = 3; - /*<asyxml><method type = "vertex" signature = "vertex(int)"><code></asyxml>*/ + /*<asyxml><method type = "vertex" signature="vertex(int)"><code></asyxml>*/ vertex vertex(int n) {/*<asyxml></code><documentation>Return numbered vertex. 'n' is 1 means VA, 2 means VB, 3 means VC, 4 means VA etc...</documentation></method></asyxml>*/ @@ -5517,7 +5538,7 @@ struct triangle {/*<asyxml></code><documentation></documentation></asyxml>*/ return VC; } - /*<asyxml><method type = "point" signature = "point(int)"><code></asyxml>*/ + /*<asyxml><method type = "point" signature="point(int)"><code></asyxml>*/ point point(int n) {/*<asyxml></code><documentation>Return numbered point. n is 1 means A, 2 means B, 3 means C, 4 means A etc...</documentation></method></asyxml>*/ @@ -5527,7 +5548,7 @@ struct triangle {/*<asyxml></code><documentation></documentation></asyxml>*/ return C; } - /*<asyxml><method type = "void" signature = "init(point, point, point)"><code></asyxml>*/ + /*<asyxml><method type = "void" signature="init(point,point,point)"><code></asyxml>*/ void init(point A, point B, point C) {/*<asyxml></code><documentation>Constructor.</documentation></method></asyxml>*/ point[] P = standardizecoordsys(A, B, C); @@ -5537,14 +5558,14 @@ struct triangle {/*<asyxml></code><documentation></documentation></asyxml>*/ VA.t = this; VB.t = this; VC.t = this; } - /*<asyxml><method type = "void" signature = "operator init(point, point, point)"><code></asyxml>*/ + /*<asyxml><method type = "void" signature="operator init(point,point,point)"><code></asyxml>*/ void operator init(point A, point B, point C) {/*<asyxml></code><documentation>For backward compatibility. Provide the routine 'triangle(point A, point B, point C)'.</documentation></method></asyxml>*/ this.init(A, B, C); } - /*<asyxml><method type = "void" signature = "init(real, real, real, real, point)"><code></asyxml>*/ + /*<asyxml><method type = "void" signature="init(real,real,real,real,point)"><code></asyxml>*/ void operator init(real b, real alpha, real c, real angle = 0, point A = (0, 0)) {/*<asyxml></code><documentation>For backward compatibility. Provide the routine 'triangle(real b, real alpha, real c, real angle = 0, point A = (0, 0)) @@ -5553,7 +5574,7 @@ struct triangle {/*<asyxml></code><documentation></documentation></asyxml>*/ this.init(A, A + R.polar(c, radians(angle)), A + R.polar(b, radians(angle + alpha))); } - /*<asyxml><method type = "real" signature = "a(), b(), c()"><code></asyxml>*/ + /*<asyxml><method type = "real" signature="a(),b(),c()"><code></asyxml>*/ real a() {/*<asyxml></code><documentation>Return the length BC. b() and c() are also defined and return the length AC and AB respectively.</documentation></method></asyxml>*/ @@ -5564,14 +5585,14 @@ struct triangle {/*<asyxml></code><documentation></documentation></asyxml>*/ private real det(pair a, pair b) {return a.x * b.y - a.y * b.x;} - /*<asyxml><method type = "real" signature = "area()"><code></asyxml>*/ + /*<asyxml><method type = "real" signature="area()"><code></asyxml>*/ real area() {/*<asyxml></code><documentation></documentation></method></asyxml>*/ pair a = locate(A), b = locate(B), c = locate(C); return 0.5 * abs(det(a, b) + det(b, c) + det(c, a)); } - /*<asyxml><method type = "real" signature = "alpha(), beta(), gamma()"><code></asyxml>*/ + /*<asyxml><method type = "real" signature="alpha(),beta(),gamma()"><code></asyxml>*/ real alpha() {/*<asyxml></code><documentation>Return the measure (in degrees) of the angle A. beta() and gamma() are also defined and return the measure of the angles B and C respectively.</documentation></method></asyxml>*/ @@ -5580,20 +5601,20 @@ struct triangle {/*<asyxml></code><documentation></documentation></asyxml>*/ real beta() {return degrees(acos((c()^2 + a()^2 - b()^2)/(2c() * a())));} real gamma() {return degrees(acos((a()^2 + b()^2 - c()^2)/(2a() * b())));} - /*<asyxml><method type = "path" signature = "Path()"><code></asyxml>*/ + /*<asyxml><method type = "path" signature="Path()"><code></asyxml>*/ path Path() {/*<asyxml></code><documentation>The path of the triangle.</documentation></method></asyxml>*/ return A--C--B--cycle; } - /*<asyxml><struct signature = "side"><code></asyxml>*/ + /*<asyxml><struct signature="side"><code></asyxml>*/ struct side - {/*<asyxml></code><documentation>Structure used to communicate the side of a triangle.</documentation><property type = "int" signature = "n"><code></asyxml>*/ - int n;/*<asyxml></code><documentation>1 or 0 means [AB], -1 means [BA], 2 means [BC], -2 means [CB] etc.</documentation></property><property type = "triangle" signature = "triangle"><code></asyxml>*/ + {/*<asyxml></code><documentation>Structure used to communicate the side of a triangle.</documentation><property type = "int" signature="n"><code></asyxml>*/ + int n;/*<asyxml></code><documentation>1 or 0 means [AB],-1 means [BA],2 means [BC],-2 means [CB] etc.</documentation></property><property type = "triangle" signature="triangle"><code></asyxml>*/ triangle t;/*<asyxml></code><documentation>The triangle to which the side refers.</documentation></property></asyxml>*/ }/*<asyxml></struct></asyxml>*/ - /*<asyxml><property type = "side" signature = "AB"><code></asyxml>*/ + /*<asyxml><property type = "side" signature="AB"><code></asyxml>*/ side AB;/*<asyxml></code><documentation>For the routines using the structure 'side', triangle.AB means 'side AB'. BA, AC, CA etc are also defined.</documentation></property></asyxml>*/ AB.n = 1; AB.t = this; @@ -5603,7 +5624,7 @@ struct triangle {/*<asyxml></code><documentation></documentation></asyxml>*/ side CA; CA.n = 3; CA.t = this; side AC; AC.n = -3; AC.t = this; - /*<asyxml><method type = "side" signature = "side(int)"><code></asyxml>*/ + /*<asyxml><method type = "side" signature="side(int)"><code></asyxml>*/ side side(int n) {/*<asyxml></code><documentation>Return numbered side. n is 1 means AB, -1 means BA, 2 means BC, -2 means CB, etc.</documentation></method></asyxml>*/ @@ -5614,7 +5635,7 @@ struct triangle {/*<asyxml></code><documentation></documentation></asyxml>*/ return n > 0 ? CA : AC; } - /*<asyxml><method type = "line" signature = "line(int)"><code></asyxml>*/ + /*<asyxml><method type = "line" signature="line(int)"><code></asyxml>*/ line line(int n) {/*<asyxml></code><documentation>Return the numbered line.</documentation></method></asyxml>*/ if(n == 0) abort('Invalid line number.'); @@ -5646,7 +5667,7 @@ triangle[] operator ^^(... triangle[] t) return T; } -/*<asyxml><operator type = "line" signature = "cast(side)"><code></asyxml>*/ +/*<asyxml><operator type = "line" signature="cast(side)"><code></asyxml>*/ line operator cast(side side) {/*<asyxml></code><documentation>Cast side to (infinite) line. Most routine with line parameters works with side parameters. @@ -5655,56 +5676,56 @@ line operator cast(side side) return t.line(side.n); } -/*<asyxml><function type = "line" signature = "line(explicit side)"><code></asyxml>*/ +/*<asyxml><function type="line" signature="line(explicit side)"><code></asyxml>*/ line line(explicit side side) {/*<asyxml></code><documentation>Return 'side' as line.</documentation></function></asyxml>*/ return (line)side; } -/*<asyxml><function type = "segment" signature = "segment(explicit side)"><code></asyxml>*/ +/*<asyxml><function type="segment" signature="segment(explicit side)"><code></asyxml>*/ segment segment(explicit side side) {/*<asyxml></code><documentation>Return 'side' as segment.</documentation></function></asyxml>*/ return (segment)(line)side; } -/*<asyxml><operator type = "point" signature = "cast(vertex)"><code></asyxml>*/ +/*<asyxml><operator type = "point" signature="cast(vertex)"><code></asyxml>*/ point operator cast(vertex V) {/*<asyxml></code><documentation>Cast vertex to point. Most routine with point parameters works with vertex parameters.</documentation></operator></asyxml>*/ return V.t.point(V.n); } -/*<asyxml><function type = "point" signature = "point(explicit vertex)"><code></asyxml>*/ +/*<asyxml><function type="point" signature="point(explicit vertex)"><code></asyxml>*/ point point(explicit vertex V) {/*<asyxml></code><documentation>Return the point corresponding to the vertex 'V'.</documentation></function></asyxml>*/ return (point)V; } -/*<asyxml><function type = "side" signature = "opposite(vertex)"><code></asyxml>*/ +/*<asyxml><function type="side" signature="opposite(vertex)"><code></asyxml>*/ side opposite(vertex V) {/*<asyxml></code><documentation>Return the opposite side of vertex 'V'.</documentation></function></asyxml>*/ return V.t.side(numarray[abs(V.n)]); } -/*<asyxml><function type = "vertex" signature = "opposite(side)"><code></asyxml>*/ +/*<asyxml><function type="vertex" signature="opposite(side)"><code></asyxml>*/ vertex opposite(side side) {/*<asyxml></code><documentation>Return the opposite vertex of side 'side'.</documentation></function></asyxml>*/ return side.t.vertex(numarray[abs(side.n) + 1]); } -/*<asyxml><function type = "point" signature = "midpoint(side)"><code></asyxml>*/ +/*<asyxml><function type="point" signature="midpoint(side)"><code></asyxml>*/ point midpoint(side side) {/*<asyxml></code><documentation></documentation></function></asyxml>*/ return midpoint(segment(side)); } -/*<asyxml><operator type = "triangle" signature = "*(transform, triangle)"><code></asyxml>*/ +/*<asyxml><operator type = "triangle" signature="*(transform,triangle)"><code></asyxml>*/ triangle operator *(transform T, triangle t) {/*<asyxml></code><documentation>Provide transform * triangle.</documentation></operator></asyxml>*/ return triangle(T * t.A, T * t.B, T * t.C); } -/*<asyxml><function type = "triangle" signature = "triangleAbc(real, real, real, real, point)"><code></asyxml>*/ +/*<asyxml><function type="triangle" signature="triangleAbc(real,real,real,real,point)"><code></asyxml>*/ triangle triangleAbc(real alpha, real b, real c, real angle = 0, point A = (0, 0)) {/*<asyxml></code><documentation>Return the triangle ABC rotated by 'angle' with BAC = alpha, AC = b and AB = c.</documentation></function></asyxml>*/ triangle T; @@ -5713,7 +5734,7 @@ triangle triangleAbc(real alpha, real b, real c, real angle = 0, point A = (0, 0 return T; } -/*<asyxml><function type = "triangle" signature = "triangleabc(real, real, real, real, point)"><code></asyxml>*/ +/*<asyxml><function type="triangle" signature="triangleabc(real,real,real,real,point)"><code></asyxml>*/ triangle triangleabc(real a, real b, real c, real angle = 0, point A = (0, 0)) {/*<asyxml></code><documentation>Return the triangle ABC rotated by 'angle' with BC = a, AC = b and AB = c.</documentation></function></asyxml>*/ triangle T; @@ -5722,7 +5743,7 @@ triangle triangleabc(real a, real b, real c, real angle = 0, point A = (0, 0)) return T; } -/*<asyxml><function type = "triangle" signature = "triangle(line, line, line)"><code></asyxml>*/ +/*<asyxml><function type="triangle" signature="triangle(line,line,line)"><code></asyxml>*/ triangle triangle(line l1, line l2, line l3) {/*<asyxml></code><documentation>Return the triangle defined by three line.</documentation></function></asyxml>*/ point P1, P2, P3; @@ -5733,79 +5754,79 @@ triangle triangle(line l1, line l2, line l3) return triangle(P1, P2, P3); } -/*<asyxml><function type = "point" signature = "foot(vertex)"><code></asyxml>*/ +/*<asyxml><function type="point" signature="foot(vertex)"><code></asyxml>*/ point foot(vertex V) {/*<asyxml></code><documentation>Return the endpoint of the altitude from V.</documentation></function></asyxml>*/ return projection((line)opposite(V)) * ((point)V); } -/*<asyxml><function type = "point" signature = "foot(side)"><code></asyxml>*/ +/*<asyxml><function type="point" signature="foot(side)"><code></asyxml>*/ point foot(side side) {/*<asyxml></code><documentation>Return the endpoint of the altitude on 'side'.</documentation></function></asyxml>*/ return projection((line)side) * point(opposite(side)); } -/*<asyxml><function type = "line" signature = "altitude(vertex)"><code></asyxml>*/ +/*<asyxml><function type="line" signature="altitude(vertex)"><code></asyxml>*/ line altitude(vertex V) {/*<asyxml></code><documentation>Return the altitude passing through 'V'.</documentation></function></asyxml>*/ return line(point(V), foot(V)); } -/*<asyxml><function type = "line" signature = "altitude(vertex)"><code></asyxml>*/ +/*<asyxml><function type="line" signature="altitude(vertex)"><code></asyxml>*/ line altitude(side side) {/*<asyxml></code><documentation>Return the altitude cutting 'side'.</documentation></function></asyxml>*/ return altitude(opposite(side)); } -/*<asyxml><function type = "point" signature = "orthocentercenter(triangle)"><code></asyxml>*/ +/*<asyxml><function type="point" signature="orthocentercenter(triangle)"><code></asyxml>*/ point orthocentercenter(triangle t) {/*<asyxml></code><documentation>Return the orthocenter of the triangle t.</documentation></function></asyxml>*/ return orthocentercenter(t.A, t.B, t.C); } -/*<asyxml><function type = "point" signature = "centroid(triangle)"><code></asyxml>*/ +/*<asyxml><function type="point" signature="centroid(triangle)"><code></asyxml>*/ point centroid(triangle t) {/*<asyxml></code><documentation>Return the centroid of the triangle 't'.</documentation></function></asyxml>*/ return (t.A + t.B + t.C)/3; } -/*<asyxml><function type = "point" signature = "circumcenter(triangle)"><code></asyxml>*/ +/*<asyxml><function type="point" signature="circumcenter(triangle)"><code></asyxml>*/ point circumcenter(triangle t) {/*<asyxml></code><documentation>Return the circumcenter of the triangle 't'.</documentation></function></asyxml>*/ return circumcenter(t.A, t.B, t.C); } -/*<asyxml><function type = "circle" signature = "circle(triangle)"><code></asyxml>*/ +/*<asyxml><function type="circle" signature="circle(triangle)"><code></asyxml>*/ circle circle(triangle t) {/*<asyxml></code><documentation>Return the circumcircle of the triangle 't'.</documentation></function></asyxml>*/ return circle(t.A, t.B, t.C); } -/*<asyxml><function type = "circle" signature = "circumcircle(triangle)"><code></asyxml>*/ +/*<asyxml><function type="circle" signature="circumcircle(triangle)"><code></asyxml>*/ circle circumcircle(triangle t) {/*<asyxml></code><documentation>Return the circumcircle of the triangle 't'.</documentation></function></asyxml>*/ return circle(t.A, t.B, t.C); } -/*<asyxml><function type = "point" signature = "incenter(triangle)"><code></asyxml>*/ +/*<asyxml><function type="point" signature="incenter(triangle)"><code></asyxml>*/ point incenter(triangle t) {/*<asyxml></code><documentation>Return the center of the incircle of the triangle 't'.</documentation></function></asyxml>*/ return incenter(t.A, t.B, t.C); } -/*<asyxml><function type = "real" signature = "inradius(triangle)"><code></asyxml>*/ +/*<asyxml><function type="real" signature="inradius(triangle)"><code></asyxml>*/ real inradius(triangle t) {/*<asyxml></code><documentation>Return the radius of the incircle of the triangle 't'.</documentation></function></asyxml>*/ return inradius(t.A, t.B, t.C); } -/*<asyxml><function type = "circle" signature = "incircle(triangle)"><code></asyxml>*/ +/*<asyxml><function type="circle" signature="incircle(triangle)"><code></asyxml>*/ circle incircle(triangle t) {/*<asyxml></code><documentation>Return the the incircle of the triangle 't'.</documentation></function></asyxml>*/ return incircle(t.A, t.B, t.C); } -/*<asyxml><function type = "point" signature = "excenter(side, triangle)"><code></asyxml>*/ +/*<asyxml><function type="point" signature="excenter(side,triangle)"><code></asyxml>*/ point excenter(side side) {/*<asyxml></code><documentation>Return the center of the excircle tangent with the side 'side' of its triangle. side = 0 means AB, 1 means AC, other means BC. @@ -5819,7 +5840,7 @@ point excenter(side side) return op; } -/*<asyxml><function type = "real" signature = "exradius(side, triangle)"><code></asyxml>*/ +/*<asyxml><function type="real" signature="exradius(side,triangle)"><code></asyxml>*/ real exradius(side side) {/*<asyxml></code><documentation>Return radius of the excircle tangent with the side 'side' of its triangle. side = 0 means AB, 1 means BC, other means CA. @@ -5833,7 +5854,7 @@ real exradius(side side) return or; } -/*<asyxml><function type = "circle" signature = "excircle(side, triangle)"><code></asyxml>*/ +/*<asyxml><function type="circle" signature="excircle(side,triangle)"><code></asyxml>*/ circle excircle(side side) {/*<asyxml></code><documentation>Return the excircle tangent with the side 'side' of its triangle. side = 0 means AB, 1 means AC, other means BC. @@ -5847,15 +5868,15 @@ circle excircle(side side) return oc; } -/*<asyxml><struct signature = "trilinear"><code></asyxml>*/ +/*<asyxml><struct signature="trilinear"><code></asyxml>*/ struct trilinear {/*<asyxml></code><documentation>Trilinear coordinates 'a:b:c' relative to triangle 't'. - <url href = "http://mathworld.wolfram.com/TrilinearCoordinates.html"/></documentation><property type = "real" signature = "a, b, c"><code></asyxml>*/ - real a, b, c;/*<asyxml></code><documentation>The trilinear coordinates.</documentation></property><property type = "triangle" signature = "t"><code></asyxml>*/ + <url href = "http://mathworld.wolfram.com/TrilinearCoordinates.html"/></documentation><property type = "real" signature="a,b,c"><code></asyxml>*/ + real a,b,c;/*<asyxml></code><documentation>The trilinear coordinates.</documentation></property><property type = "triangle" signature="t"><code></asyxml>*/ triangle t;/*<asyxml></code><documentation>The reference triangle.</documentation></property></asyxml>*/ }/*<asyxml></struct></asyxml>*/ -/*<asyxml><function type = "trilinear" signature = "trilinear(triangle, real, real, real)"><code></asyxml>*/ +/*<asyxml><function type="trilinear" signature="trilinear(triangle,real,real,real)"><code></asyxml>*/ trilinear trilinear(triangle t, real a, real b, real c) {/*<asyxml></code><documentation>Return the trilinear coordinates relative to 't'. <url href = "http://mathworld.wolfram.com/TrilinearCoordinates.html"/></documentation></function></asyxml>*/ @@ -5865,7 +5886,7 @@ trilinear trilinear(triangle t, real a, real b, real c) return ot; } -/*<asyxml><function type = "trilinear" signature = "trilinear(triangle, point)"><code></asyxml>*/ +/*<asyxml><function type="trilinear" signature="trilinear(triangle,point)"><code></asyxml>*/ trilinear trilinear(triangle t, point M) {/*<asyxml></code><documentation>Return the trilinear coordinates of 'M' relative to 't'. <url href = "http://mathworld.wolfram.com/TrilinearCoordinates.html"/></documentation></function></asyxml>*/ @@ -5889,13 +5910,13 @@ trilinear trilinear(triangle t, point M) return ot; } -/*<asyxml><function type = "void" signature = "write(trilinear)"><code></asyxml>*/ +/*<asyxml><function type="void" signature="write(trilinear)"><code></asyxml>*/ void write(trilinear tri) {/*<asyxml></code><documentation></documentation></function></asyxml>*/ write(format("%f : ", tri.a) + format("%f : ", tri.b) + format("%f", tri.c)); } -/*<asyxml><function type = "point" signature = "trilinear(triangle, real, real, real)"><code></asyxml>*/ +/*<asyxml><function type="point" signature="trilinear(triangle,real,real,real)"><code></asyxml>*/ point point(trilinear tri) {/*<asyxml></code><documentation>Return the trilinear coordinates relative to 't'. <url href = "http://mathworld.wolfram.com/TrilinearCoordinates.html"/></documentation></function></asyxml>*/ @@ -5905,7 +5926,7 @@ point point(trilinear tri) 0.5 * t.c() * mass(t.C, tri.c)); } -/*<asyxml><function type = "int[]" signature = "tricoef(side)"><code></asyxml>*/ +/*<asyxml><function type="int[]" signature="tricoef(side)"><code></asyxml>*/ int[] tricoef(side side) {/*<asyxml></code><documentation>Return an array of integer (values are 0 or 1) which represents 'side'. For example, side = t.BC will be represented by {0, 1, 1}.</documentation></function></asyxml>*/ @@ -5917,7 +5938,7 @@ int[] tricoef(side side) return oi; } -/*<asyxml><operator type = "point" signature = "cast(trilinear)"><code></asyxml>*/ +/*<asyxml><operator type = "point" signature="cast(trilinear)"><code></asyxml>*/ point operator cast(trilinear tri) {/*<asyxml></code><documentation>Cast trilinear to point. One may use the routine 'point(trilinear)' to force the casting.</documentation></operator></asyxml>*/ @@ -5927,13 +5948,13 @@ point operator cast(trilinear tri) /*<asyxml><typedef type = "centerfunction" return = "real" params = "real, real, real"><code></asyxml>*/ typedef real centerfunction(real, real, real);/*<asyxml></code><documentation><url href = "http://mathworld.wolfram.com/TriangleCenterFunction.html"/></documentation></typedef></asyxml>*/ -/*<asyxml><function type = "trilinear" signature = "trilinear(triangle, centerfunction, real, real, real)"><code></asyxml>*/ +/*<asyxml><function type="trilinear" signature="trilinear(triangle,centerfunction,real,real,real)"><code></asyxml>*/ trilinear trilinear(triangle t, centerfunction f, real a = t.a(), real b = t.b(), real c = t.c()) {/*<asyxml></code><documentation><url href = "http://mathworld.wolfram.com/TriangleCenterFunction.html"/></documentation></function></asyxml>*/ return trilinear(t, f(a, b, c), f(b, c, a), f(c, a, b)); } -/*<asyxml><function type = "point" signature = "symmedian(triangle)"><code></asyxml>*/ +/*<asyxml><function type="point" signature="symmedian(triangle)"><code></asyxml>*/ point symmedian(triangle t) {/*<asyxml></code><documentation>Return the symmedian point of 't'.</documentation></function></asyxml>*/ point A, B, C; @@ -5943,7 +5964,7 @@ point symmedian(triangle t) return intersectionpoint(line(t.A, A), line(t.B, B)); } -/*<asyxml><function type = "point" signature = "symmedian(side)"><code></asyxml>*/ +/*<asyxml><function type="point" signature="symmedian(side)"><code></asyxml>*/ point symmedian(side side) {/*<asyxml></code><documentation>The symmedian point on the side 'side'.</documentation></function></asyxml>*/ triangle t = side.t; @@ -5953,13 +5974,13 @@ point symmedian(side side) return trilinear(t, t.a(), 0, t.c()); } -/*<asyxml><function type = "line" signature = "symmedian(vertex)"><code></asyxml>*/ +/*<asyxml><function type="line" signature="symmedian(vertex)"><code></asyxml>*/ line symmedian(vertex V) {/*<asyxml></code><documentation>Return the symmedian passing through 'V'.</documentation></function></asyxml>*/ return line(point(V), symmedian(V.t)); } -/*<asyxml><function type = "triangle" signature = "cevian(triangle, point)"><code></asyxml>*/ +/*<asyxml><function type="triangle" signature="cevian(triangle,point)"><code></asyxml>*/ triangle cevian(triangle t, point P) {/*<asyxml></code><documentation>Return the Cevian triangle with respect of 'P' <url href = "http://mathworld.wolfram.com/CevianTriangle.html"/>.</documentation></function></asyxml>*/ @@ -5970,7 +5991,7 @@ triangle cevian(triangle t, point P) return triangle(A, B, C); } -/*<asyxml><function type = "point" signature = "cevian(side, point)"><code></asyxml>*/ +/*<asyxml><function type="point" signature="cevian(side,point)"><code></asyxml>*/ point cevian(side side, point P) {/*<asyxml></code><documentation>Return the Cevian point on 'side' with respect of 'P'.</documentation></function></asyxml>*/ triangle t = side.t; @@ -5979,20 +6000,20 @@ point cevian(side side, point P) return point(trilinear(t, s[0] * tri.a, s[1] * tri.b, s[2] * tri.c)); } -/*<asyxml><function type = "line" signature = "cevian(vertex, point)"><code></asyxml>*/ +/*<asyxml><function type="line" signature="cevian(vertex,point)"><code></asyxml>*/ line cevian(vertex V, point P) {/*<asyxml></code><documentation>Return line passing through 'V' and its Cevian image with respect of 'P'.</documentation></function></asyxml>*/ return line(point(V), cevian(opposite(V), P)); } -/*<asyxml><function type = "point" signature = "gergonne(triangle)"><code></asyxml>*/ +/*<asyxml><function type="point" signature="gergonne(triangle)"><code></asyxml>*/ point gergonne(triangle t) {/*<asyxml></code><documentation>Return the Gergonne point of 't'.</documentation></function></asyxml>*/ real f(real a, real b, real c){return 1/(a * (b + c - a));} return point(trilinear(t, f)); } -/*<asyxml><function type = "point[]" signature = "fermat(triangle)"><code></asyxml>*/ +/*<asyxml><function type="point[]" signature="fermat(triangle)"><code></asyxml>*/ point[] fermat(triangle t) {/*<asyxml></code><documentation>Return the Fermat points of 't'.</documentation></function></asyxml>*/ point[] P; @@ -6002,7 +6023,7 @@ point[] fermat(triangle t) return P; } -/*<asyxml><function type = "point" signature = "isotomicconjugate(triangle, point)"><code></asyxml>*/ +/*<asyxml><function type="point" signature="isotomicconjugate(triangle,point)"><code></asyxml>*/ point isotomicconjugate(triangle t, point M) {/*<asyxml></code><documentation><url href = "http://mathworld.wolfram.com/IsotomicConjugate.html"/></documentation></function></asyxml>*/ if(!inside(t.Path(), locate(M))) abort("isotomic: the point must be inside the triangle."); @@ -6010,65 +6031,65 @@ point isotomicconjugate(triangle t, point M) return point(trilinear(t, 1/(t.a()^2 * tr.a), 1/(t.b()^2 * tr.b), 1/(t.c()^2 * tr.c))); } -/*<asyxml><function type = "line" signature = "isotomic(vertex, point)"><code></asyxml>*/ +/*<asyxml><function type="line" signature="isotomic(vertex,point)"><code></asyxml>*/ line isotomic(vertex V, point M) {/*<asyxml></code><documentation><url href = "http://mathworld.wolfram.com/IsotomicConjugate.html"/>.</documentation></function></asyxml>*/ side op = opposite(V); return line(V, rotate(180, midpoint(op)) * cevian(op, M)); } -/*<asyxml><function type = "point" signature = "isotomic(side, point)"><code></asyxml>*/ +/*<asyxml><function type="point" signature="isotomic(side,point)"><code></asyxml>*/ point isotomic(side side, point M) {/*<asyxml></code><documentation><url href = "http://mathworld.wolfram.com/IsotomicConjugate.html"/></documentation></function></asyxml>*/ return intersectionpoint(isotomic(opposite(side), M), side); } -/*<asyxml><function type = "triangle" signature = "isotomic(triangle, point)"><code></asyxml>*/ +/*<asyxml><function type="triangle" signature="isotomic(triangle,point)"><code></asyxml>*/ triangle isotomic(triangle t, point M) {/*<asyxml></code><documentation><url href = "http://mathworld.wolfram.com/IsotomicConjugate.html"/></documentation></function></asyxml>*/ return triangle(isotomic(t.BC, M), isotomic(t.CA, M), isotomic(t.AB, M)); } -/*<asyxml><function type = "point" signature = "isogonalconjugate(triangle, point)"><code></asyxml>*/ +/*<asyxml><function type="point" signature="isogonalconjugate(triangle,point)"><code></asyxml>*/ point isogonalconjugate(triangle t, point M) {/*<asyxml></code><documentation><url href = "http://mathworld.wolfram.com/IsogonalConjugate.html"/></documentation></function></asyxml>*/ trilinear tr = trilinear(t, M); return point(trilinear(t, 1/tr.a, 1/tr.b, 1/tr.c)); } -/*<asyxml><function type = "point" signature = "isogonal(side, point)"><code></asyxml>*/ +/*<asyxml><function type="point" signature="isogonal(side,point)"><code></asyxml>*/ point isogonal(side side, point M) {/*<asyxml></code><documentation><url href = "http://mathworld.wolfram.com/IsogonalConjugate.html"/></documentation></function></asyxml>*/ return cevian(side, isogonalconjugate(side.t, M)); } -/*<asyxml><function type = "line" signature = "isogonal(vertex, point)"><code></asyxml>*/ +/*<asyxml><function type="line" signature="isogonal(vertex,point)"><code></asyxml>*/ line isogonal(vertex V, point M) {/*<asyxml></code><documentation><url href = "http://mathworld.wolfram.com/IsogonalConjugate.html"/></documentation></function></asyxml>*/ return line(V, isogonal(opposite(V), M)); } -/*<asyxml><function type = "triangle" signature = "isogonal(triangle, point)"><code></asyxml>*/ +/*<asyxml><function type="triangle" signature="isogonal(triangle,point)"><code></asyxml>*/ triangle isogonal(triangle t, point M) {/*<asyxml></code><documentation><url href = "http://mathworld.wolfram.com/IsogonalConjugate.html"/></documentation></function></asyxml>*/ return triangle(isogonal(t.BC, M), isogonal(t.CA, M), isogonal(t.AB, M)); } -/*<asyxml><function type = "triangle" signature = "pedal(triangle, point)"><code></asyxml>*/ +/*<asyxml><function type="triangle" signature="pedal(triangle,point)"><code></asyxml>*/ triangle pedal(triangle t, point M) {/*<asyxml></code><documentation>Return the pedal triangle of 'M' in 't'. <url href = "http://mathworld.wolfram.com/PedalTriangle.html"/></documentation></function></asyxml>*/ return triangle(projection(t.BC) * M, projection(t.AC) * M, projection(t.AB) * M); } -/*<asyxml><function type = "triangle" signature = "pedal(triangle, point)"><code></asyxml>*/ +/*<asyxml><function type="triangle" signature="pedal(triangle,point)"><code></asyxml>*/ line pedal(side side, point M) {/*<asyxml></code><documentation>Return the pedal line of 'M' cutting 'side'. <url href = "http://mathworld.wolfram.com/PedalTriangle.html"/></documentation></function></asyxml>*/ return line(M, projection(side) * M); } -/*<asyxml><function type = "triangle" signature = "antipedal(triangle, point)"><code></asyxml>*/ +/*<asyxml><function type="triangle" signature="antipedal(triangle,point)"><code></asyxml>*/ triangle antipedal(triangle t, point M) {/*<asyxml></code><documentation><url href = "http://mathworld.wolfram.com/AntipedalTriangle.html"/></documentation></function></asyxml>*/ trilinear Tm = trilinear(t, M); @@ -6080,7 +6101,7 @@ triangle antipedal(triangle t, point M) return triangle(A, B, C); } -/*<asyxml><function type = "triangle" signature = "extouch(triangle)"><code></asyxml>*/ +/*<asyxml><function type="triangle" signature="extouch(triangle)"><code></asyxml>*/ triangle extouch(triangle t) {/*<asyxml></code><documentation>Return the extouch triangle of the triangle 't'. The extouch triangle of 't' is the triangle formed by the points @@ -6093,7 +6114,7 @@ triangle extouch(triangle t) return triangle(A, B, C); } -/*<asyxml><function type = "triangle" signature = "extouch(triangle)"><code></asyxml>*/ +/*<asyxml><function type="triangle" signature="extouch(triangle)"><code></asyxml>*/ triangle incentral(triangle t) {/*<asyxml></code><documentation>Return the incentral triangle of the triangle 't'. It is the triangle whose vertices are determined by the intersections of the @@ -6106,7 +6127,7 @@ triangle incentral(triangle t) return triangle(A, B, C); } -/*<asyxml><function type = "triangle" signature = "extouch(side)"><code></asyxml>*/ +/*<asyxml><function type="triangle" signature="extouch(side)"><code></asyxml>*/ triangle extouch(side side) {/*<asyxml></code><documentation>Return the triangle formed by the points of tangency of the triangle referenced by 'side' with its excircles. One vertex of the returned triangle is on the segment 'side'.</documentation></function></asyxml>*/ @@ -6118,7 +6139,7 @@ triangle extouch(side side) return triangle(p3 * EP, p2 * EP, p1 * EP); } -/*<asyxml><function type = "point" signature = "bisectorpoint(side)"><code></asyxml>*/ +/*<asyxml><function type="point" signature="bisectorpoint(side)"><code></asyxml>*/ point bisectorpoint(side side) {/*<asyxml></code><documentation>The intersection point of the angle bisector from the opposite point of 'side' with the side 'side'.</documentation></function></asyxml>*/ @@ -6129,20 +6150,20 @@ point bisectorpoint(side side) return trilinear(t, 1, 0, 1); } -/*<asyxml><function type = "line" signature = "bisector(vertex, real)"><code></asyxml>*/ +/*<asyxml><function type="line" signature="bisector(vertex,real)"><code></asyxml>*/ line bisector(vertex V, real angle = 0) {/*<asyxml></code><documentation>Return the interior bisector passing through 'V' rotated by angle (in degrees) around 'V'.</documentation></function></asyxml>*/ return rotate(angle, point(V)) * line(point(V), incenter(V.t)); } -/*<asyxml><function type = "line" signature = "bisector(side)"><code></asyxml>*/ +/*<asyxml><function type="line" signature="bisector(side)"><code></asyxml>*/ line bisector(side side) {/*<asyxml></code><documentation>Return the bisector of the line segment 'side'.</documentation></function></asyxml>*/ return bisector(segment(side)); } -/*<asyxml><function type = "point" signature = "intouch(side)"><code></asyxml>*/ +/*<asyxml><function type="point" signature="intouch(side)"><code></asyxml>*/ point intouch(side side) {/*<asyxml></code><documentation>The point of tangency on the side 'side' of its incircle.</documentation></function></asyxml>*/ triangle t = side.t; @@ -6153,7 +6174,7 @@ point intouch(side side) return trilinear(t, b * c/(-a + b + c), 0, a * b/(a + b - c)); } -/*<asyxml><function type = "triangle" signature = "intouch(triangle)"><code></asyxml>*/ +/*<asyxml><function type="triangle" signature="intouch(triangle)"><code></asyxml>*/ triangle intouch(triangle t) {/*<asyxml></code><documentation>Return the intouch triangle of the triangle 't'. The intouch triangle of 't' is the triangle formed by the points @@ -6166,7 +6187,7 @@ triangle intouch(triangle t) return triangle(A, B, C); } -/*<asyxml><function type = "triangle" signature = "tangential(triangle)"><code></asyxml>*/ +/*<asyxml><function type="triangle" signature="tangential(triangle)"><code></asyxml>*/ triangle tangential(triangle t) {/*<asyxml></code><documentation>Return the tangential triangle of the triangle 't'. The tangential triangle of 't' is the triangle formed by the lines @@ -6179,31 +6200,31 @@ triangle tangential(triangle t) return triangle(A, B, C); } -/*<asyxml><function type = "triangle" signature = "medial(triangle t)"><code></asyxml>*/ +/*<asyxml><function type="triangle" signature="medial(triangle t)"><code></asyxml>*/ triangle medial(triangle t) {/*<asyxml></code><documentation>Return the triangle whose vertices are midpoints of the sides of 't'.</documentation></function></asyxml>*/ return triangle(midpoint(t.BC), midpoint(t.AC), midpoint(t.AB)); } -/*<asyxml><function type = "line" signature = "median(vertex)"><code></asyxml>*/ +/*<asyxml><function type="line" signature="median(vertex)"><code></asyxml>*/ line median(vertex V) {/*<asyxml></code><documentation>Return median from 'V'.</documentation></function></asyxml>*/ return line(point(V), midpoint(segment(opposite(V)))); } -/*<asyxml><function type = "line" signature = "median(side)"><code></asyxml>*/ +/*<asyxml><function type="line" signature="median(side)"><code></asyxml>*/ line median(side side) {/*<asyxml></code><documentation>Return median from the opposite vertex of 'side'.</documentation></function></asyxml>*/ return median(opposite(side)); } -/*<asyxml><function type = "triangle" signature = "orthic(triangle)"><code></asyxml>*/ +/*<asyxml><function type="triangle" signature="orthic(triangle)"><code></asyxml>*/ triangle orthic(triangle t) {/*<asyxml></code><documentation>Return the triangle whose vertices are endpoints of the altitudes from each of the vertices of 't'.</documentation></function></asyxml>*/ return triangle(foot(t.BC), foot(t.AC), foot(t.AB)); } -/*<asyxml><function type = "triangle" signature = "symmedial(triangle)"><code></asyxml>*/ +/*<asyxml><function type="triangle" signature="symmedial(triangle)"><code></asyxml>*/ triangle symmedial(triangle t) {/*<asyxml></code><documentation>Return the symmedial triangle of 't'.</documentation></function></asyxml>*/ point A, B, C; @@ -6214,7 +6235,7 @@ triangle symmedial(triangle t) return triangle(A, B, C); } -/*<asyxml><function type = "triangle" signature = "anticomplementary(triangle)"><code></asyxml>*/ +/*<asyxml><function type="triangle" signature="anticomplementary(triangle)"><code></asyxml>*/ triangle anticomplementary(triangle t) {/*<asyxml></code><documentation>Return the triangle which has the given triangle 't' as its medial triangle.</documentation></function></asyxml>*/ real a = t.a(), b = t.b(), c = t.c(); @@ -6225,7 +6246,7 @@ triangle anticomplementary(triangle t) return triangle(A, B, C); } -/*<asyxml><function type = "point[]" signature = "intersectionpoints(triangle, line, bool)"><code></asyxml>*/ +/*<asyxml><function type="point[]" signature="intersectionpoints(triangle,line,bool)"><code></asyxml>*/ point[] intersectionpoints(triangle t, line l, bool extended = false) {/*<asyxml></code><documentation>Return the intersection points. If 'extended' is true, the sides are lines else the sides are segments. @@ -6258,7 +6279,7 @@ point[] intersectionpoints(line l, triangle t, bool extended = false) return intersectionpoints(t, l, extended); } -/*<asyxml><function type = "vector" signature = "dir(vertex)"><code></asyxml>*/ +/*<asyxml><function type="vector" signature="dir(vertex)"><code></asyxml>*/ vector dir(vertex V) {/*<asyxml></code><documentation>The direction (towards the outside of the triangle) of the interior angle bisector of 'V'.</documentation></function></asyxml>*/ triangle t = V.t; @@ -6267,7 +6288,7 @@ vector dir(vertex V) return vector(defaultcoordsys, (-dir(t.C--t.A, t.C--t.B))); } -/*<asyxml><function type = "void" signature = "lvoid label(picture, Label, vertex, pair, real, pen, filltype)"><code></asyxml>*/ +/*<asyxml><function type="void" signature="lvoid label(picture,Label,vertex,pair,real,pen,filltype)"><code></asyxml>*/ void label(picture pic = currentpicture, Label L, vertex V, pair align = dir(V), real alignFactor = 1, @@ -6276,7 +6297,7 @@ void label(picture pic = currentpicture, Label L, vertex V, label(pic, L, locate(point(V)), alignFactor * align, p, filltype); } -/*<asyxml><function type = "void" signature = "label(picture, Label, Label, Label, triangle, real, real, pen, filltype)"><code></asyxml>*/ +/*<asyxml><function type="void" signature="label(picture,Label,Label,Label,triangle,real,real,pen,filltype)"><code></asyxml>*/ void label(picture pic = currentpicture, Label LA = "$A$", Label LB = "$B$", Label LC = "$C$", triangle t, @@ -6297,7 +6318,7 @@ void label(picture pic = currentpicture, Label LA = "$A$", label(pic, llc, t.VC, align = llc.align.dir, alignFactor = alignFactor, p, filltype); } -/*<asyxml><function type = "void" signature = "show(picture, Label, Label, Label, Label, Label, Label, triangle, pen, filltype)"><code></asyxml>*/ +/*<asyxml><function type="void" signature="show(picture,Label,Label,Label,Label,Label,Label,triangle,pen,filltype)"><code></asyxml>*/ void show(picture pic = currentpicture, Label LA = "$A$", Label LB = "$B$", Label LC = "$C$", Label La = "$a$", Label Lb = "$b$", Label Lc = "$c$", @@ -6310,24 +6331,24 @@ void show(picture pic = currentpicture, label(pic, LC, c, -dir(c--a, c--b), p, filltype); pair aligna = I * unit(c - b), alignb = I * unit(c - a), alignc = I * unit(b - a); pair mAB = locate(midpoint(t.AB)), mAC = locate(midpoint(t.AC)), mBC = locate(midpoint(t.BC)); - draw(pic, La, b--c, align = rotate(dot(a - mBC, aligna) > 0 ? 180 :0) * aligna, p); - draw(pic, Lb, a--c, align = rotate(dot(b - mAC, alignb) > 0 ? 180 :0) * alignb, p); - draw(pic, Lc, a--b, align = rotate(dot(c - mAB, alignc) > 0 ? 180 :0) * alignc, p); + label(pic, La, b--c, align = rotate(dot(a - mBC, aligna) > 0 ? 180 :0) * aligna, p); + label(pic, Lb, a--c, align = rotate(dot(b - mAC, alignb) > 0 ? 180 :0) * alignb, p); + label(pic, Lc, a--b, align = rotate(dot(c - mAB, alignc) > 0 ? 180 :0) * alignc, p); } -/*<asyxml><function type = "void" signature = "draw(picture, triangle, pen, marker)"><code></asyxml>*/ +/*<asyxml><function type="void" signature="draw(picture,triangle,pen,marker)"><code></asyxml>*/ void draw(picture pic = currentpicture, triangle t, pen p = currentpen, marker marker = nomarker) {/*<asyxml></code><documentation>Draw sides of the triangle 't' on picture 'pic' using pen 'p'.</documentation></function></asyxml>*/ draw(pic, t.Path(), p, marker); } -/*<asyxml><function type = "void" signature = "draw(picture, triangle[], pen, marker)"><code></asyxml>*/ +/*<asyxml><function type="void" signature="draw(picture,triangle[],pen,marker)"><code></asyxml>*/ void draw(picture pic = currentpicture, triangle[] t, pen p = currentpen, marker marker = nomarker) {/*<asyxml></code><documentation>Draw sides of the triangles 't' on picture 'pic' using pen 'p'.</documentation></function></asyxml>*/ for(int i = 0; i < t.length; ++i) draw(pic, t[i], p, marker); } -/*<asyxml><function type = "void" signature = "drawline(picture, triangle, pen)"><code></asyxml>*/ +/*<asyxml><function type="void" signature="drawline(picture,triangle,pen)"><code></asyxml>*/ void drawline(picture pic = currentpicture, triangle t, pen p = currentpen) {/*<asyxml></code><documentation>Draw lines of the triangle 't' on picture 'pic' using pen 'p'.</documentation></function></asyxml>*/ draw(t, p); @@ -6336,7 +6357,7 @@ void drawline(picture pic = currentpicture, triangle t, pen p = currentpen) draw(pic, line(t.B, t.C), p); } -/*<asyxml><function type = "void" signature = "dot(picture, triangle, pen)"><code></asyxml>*/ +/*<asyxml><function type="void" signature="dot(picture,triangle,pen)"><code></asyxml>*/ void dot(picture pic = currentpicture, triangle t, pen p = currentpen) {/*<asyxml></code><documentation>Draw a dot at each vertex of 't'.</documentation></function></asyxml>*/ dot(pic, t.A^^t.B^^t.C, p); @@ -6346,13 +6367,13 @@ void dot(picture pic = currentpicture, triangle t, pen p = currentpen) // *=======================================================* // *.......................INVERSIONS......................* -/*<asyxml><function type = "point" signature = "inverse(real k, point, point)"><code></asyxml>*/ +/*<asyxml><function type="point" signature="inverse(real k,point,point)"><code></asyxml>*/ point inverse(real k, point A, point M) {/*<asyxml></code><documentation>Return the inverse point of 'M' with respect to point A and inversion radius 'k'.</documentation></function></asyxml>*/ return A + k/conj(M - A); } -/*<asyxml><function type = "point" signature = "radicalcenter(circle, circle)"><code></asyxml>*/ +/*<asyxml><function type="point" signature="radicalcenter(circle,circle)"><code></asyxml>*/ point radicalcenter(circle c1, circle c2) {/*<asyxml></code><documentation><url href = "http://fr.wikipedia.org/wiki/Puissance_d'un_point_par_rapport_%C3%A0_un_cercle"/></documentation></function></asyxml>*/ point[] P = standardizecoordsys(c1.C, c2.C); @@ -6366,27 +6387,27 @@ point radicalcenter(circle c1, circle c2) return point(P[0].coordsys, K/P[0].coordsys); } -/*<asyxml><function type = "line" signature = "radicalline(circle, circle)"><code></asyxml>*/ +/*<asyxml><function type="line" signature="radicalline(circle,circle)"><code></asyxml>*/ line radicalline(circle c1, circle c2) {/*<asyxml></code><documentation><url href = "http://fr.wikipedia.org/wiki/Puissance_d'un_point_par_rapport_%C3%A0_un_cercle"/></documentation></function></asyxml>*/ if (c1.C == c2.C) abort("radicalline: the centers must be distinct"); return perpendicular(radicalcenter(c1, c2), line(c1.C, c2.C)); } -/*<asyxml><function type = "point" signature = "radicalcenter(circle, circle, circle)"><code></asyxml>*/ +/*<asyxml><function type="point" signature="radicalcenter(circle,circle,circle)"><code></asyxml>*/ point radicalcenter(circle c1, circle c2, circle c3) {/*<asyxml></code><documentation><url href = "http://fr.wikipedia.org/wiki/Puissance_d'un_point_par_rapport_%C3%A0_un_cercle"/></documentation></function></asyxml>*/ return intersectionpoint(radicalline(c1, c2), radicalline(c1, c3)); } -/*<asyxml><struct signature = "inversion"><code></asyxml>*/ +/*<asyxml><struct signature="inversion"><code></asyxml>*/ struct inversion {/*<asyxml></code><documentation>http://mathworld.wolfram.com/Inversion.html</documentation></asyxml>*/ point C; real k; }/*<asyxml></struct></asyxml>*/ -/*<asyxml><function type = "inversion" signature = "inversion(real, point)"><code></asyxml>*/ +/*<asyxml><function type="inversion" signature="inversion(real,point)"><code></asyxml>*/ inversion inversion(real k, point C) {/*<asyxml></code><documentation>Return the inversion with respect to 'C' having inversion radius 'k'.</documentation></function></asyxml>*/ inversion oi; @@ -6394,13 +6415,13 @@ inversion inversion(real k, point C) oi.C = C; return oi; } -/*<asyxml><function type = "inversion" signature = "inversion(real, point)"><code></asyxml>*/ +/*<asyxml><function type="inversion" signature="inversion(real,point)"><code></asyxml>*/ inversion inversion(point C, real k) {/*<asyxml></code><documentation>Return the inversion with respect to 'C' having inversion radius 'k'.</documentation></function></asyxml>*/ return inversion(k, C); } -/*<asyxml><function type = "inversion" signature = "inversion(circle, circle)"><code></asyxml>*/ +/*<asyxml><function type="inversion" signature="inversion(circle,circle)"><code></asyxml>*/ inversion inversion(circle c1, circle c2, real sgn = 1) {/*<asyxml></code><documentation>Return the inversion which transforms 'c1' to . 'c2' and positive inversion radius if 'sgn > 0'; @@ -6419,7 +6440,7 @@ inversion inversion(circle c1, circle c2, real sgn = 1) return inversion(-a * abs(abs(O - c2.C)^2 - c2.r^2), O); } -/*<asyxml><function type = "inversion" signature = "inversion(circle, circle, circle)"><code></asyxml>*/ +/*<asyxml><function type="inversion" signature="inversion(circle,circle,circle)"><code></asyxml>*/ inversion inversion(circle c1, circle c2, circle c3) {/*<asyxml></code><documentation>Return the inversion which transform 'c1' to 'c1', 'c2' to 'c2' and 'c3' to 'c3'.</documentation></function></asyxml>*/ point Rc = radicalcenter(c1, c2, c3); @@ -6427,7 +6448,7 @@ inversion inversion(circle c1, circle c2, circle c3) } circle operator cast(inversion i){return circle(i.C, sgn(i.k) * sqrt(abs(i.k)));} -/*<asyxml><function type = "circle" signature = "circle(inversion)"><code></asyxml>*/ +/*<asyxml><function type="circle" signature="circle(inversion)"><code></asyxml>*/ circle circle(inversion i) {/*<asyxml></code><documentation>Return the inversion circle of 'i'.</documentation></function></asyxml>*/ return i; @@ -6437,13 +6458,13 @@ inversion operator cast(circle c) { return inversion(sgn(c.r) * c.r^2, c.C); } -/*<asyxml><function type = "inversion" signature = "inversion(circle)"><code></asyxml>*/ +/*<asyxml><function type="inversion" signature="inversion(circle)"><code></asyxml>*/ inversion inversion(circle c) {/*<asyxml></code><documentation>Return the inversion represented by the circle of 'c'.</documentation></function></asyxml>*/ return c; } -/*<asyxml><operator type = "point" signature = "*(inversion, point)"><code></asyxml>*/ +/*<asyxml><operator type = "point" signature="*(inversion,point)"><code></asyxml>*/ point operator *(inversion i, point P) {/*<asyxml></code><documentation>Provide inversion * point.</documentation></operator></asyxml>*/ return inverse(i.k, i.C, P); @@ -6456,7 +6477,7 @@ The returned circle has an infinite radius, circle.l has been set."); } -/*<asyxml><function type = "circle" signature = "inverse(real, point, line)"><code></asyxml>*/ +/*<asyxml><function type="circle" signature="inverse(real,point,line)"><code></asyxml>*/ circle inverse(real k, point A, line l) {/*<asyxml></code><documentation>Return the inverse circle of 'l' with respect to point 'A' and inversion radius 'k'.</documentation></function></asyxml>*/ @@ -6470,13 +6491,13 @@ circle inverse(real k, point A, line l) return circle(A, Ap, Bp); } -/*<asyxml><operator type = "circle" signature = "*(inversion, line)"><code></asyxml>*/ +/*<asyxml><operator type = "circle" signature="*(inversion,line)"><code></asyxml>*/ circle operator *(inversion i, line l) {/*<asyxml></code><documentation>Provide inversion * line for lines that don't pass through the inversion center.</documentation></operator></asyxml>*/ return inverse(i.k, i.C, l); } -/*<asyxml><function type = "circle" signature = "inverse(real, point, circle)"><code></asyxml>*/ +/*<asyxml><function type="circle" signature="inverse(real,point,circle)"><code></asyxml>*/ circle inverse(real k, point A, circle c) {/*<asyxml></code><documentation>Return the inverse circle of 'c' with respect to point A and inversion radius 'k'.</documentation></function></asyxml>*/ @@ -6493,7 +6514,7 @@ circle inverse(real k, point A, circle c) return circle(P[0] + s * (P[1]-P[0]), abs(s) * c.r); } -/*<asyxml><operator type = "circle" signature = "*(inversion, circle)"><code></asyxml>*/ +/*<asyxml><operator type = "circle" signature="*(inversion,circle)"><code></asyxml>*/ circle operator *(inversion i, circle c) {/*<asyxml></code><documentation>Provide inversion * circle.</documentation></operator></asyxml>*/ return inverse(i.k, i.C, c); @@ -6503,7 +6524,7 @@ circle operator *(inversion i, circle c) // *=======================================================* // *........................FOOTER.........................* -/*<asyxml><function type = "point[]" signature = "intersectionpoints(line, circle)"><code></asyxml>*/ +/*<asyxml><function type="point[]" signature="intersectionpoints(line,circle)"><code></asyxml>*/ point[] intersectionpoints(line l, circle c) {/*<asyxml></code><documentation>Note that the line 'l' may be a segment by casting. intersectionpoints(circle, line) is also defined.</documentation></function></asyxml>*/ @@ -6534,7 +6555,7 @@ point[] intersectionpoints(circle c, line l) return intersectionpoints(l, c); } -/*<asyxml><function type = "point[]" signature = "intersectionpoints(line, ellipse)"><code></asyxml>*/ +/*<asyxml><function type="point[]" signature="intersectionpoints(line,ellipse)"><code></asyxml>*/ point[] intersectionpoints(line l, ellipse el) {/*<asyxml></code><documentation>Note that the line 'l' may be a segment by casting. intersectionpoints(ellipse, line) is also defined.</documentation></function></asyxml>*/ @@ -6574,7 +6595,7 @@ point[] intersectionpoints(ellipse el, line l) return intersectionpoints(l, el); } -/*<asyxml><function type = "point[]" signature = "intersectionpoints(line, parabola)"><code></asyxml>*/ +/*<asyxml><function type="point[]" signature="intersectionpoints(line,parabola)"><code></asyxml>*/ point[] intersectionpoints(line l, parabola p) {/*<asyxml></code><documentation>Note that the line 'l' may be a segment by casting. intersectionpoints(parabola, line) is also defined.</documentation></function></asyxml>*/ @@ -6610,7 +6631,7 @@ point[] intersectionpoints(parabola p, line l) return intersectionpoints(l, p); } -/*<asyxml><function type = "point[]" signature = "intersectionpoints(line, hyperbola)"><code></asyxml>*/ +/*<asyxml><function type="point[]" signature="intersectionpoints(line,hyperbola)"><code></asyxml>*/ point[] intersectionpoints(line l, hyperbola h) {/*<asyxml></code><documentation>Note that the line 'l' may be a segment by casting. intersectionpoints(hyperbola, line) is also defined.</documentation></function></asyxml>*/ @@ -6638,7 +6659,7 @@ point[] intersectionpoints(hyperbola h, line l) return intersectionpoints(l, h); } -/*<asyxml><function type = "point[]" signature = "intersectionpoints(line, conic)"><code></asyxml>*/ +/*<asyxml><function type="point[]" signature="intersectionpoints(line,conic)"><code></asyxml>*/ point[] intersectionpoints(line l, conic co) {/*<asyxml></code><documentation>Note that the line 'l' may be a segment by casting. intersectionpoints(conic, line) is also defined.</documentation></function></asyxml>*/ @@ -6655,7 +6676,7 @@ point[] intersectionpoints(conic co, line l) return intersectionpoints(l, co); } -/*<asyxml><function type = "point[]" signature = "intersectionpoints(conic, conic)"><code></asyxml>*/ +/*<asyxml><function type="point[]" signature="intersectionpoints(conic,conic)"><code></asyxml>*/ point[] intersectionpoints(conic co1, conic co2) {/*<asyxml></code><documentation>Return the intersection points of the two conics.</documentation></function></asyxml>*/ if(degenerate(co1)) return intersectionpoints(co1.l[0], co2); @@ -6663,7 +6684,7 @@ point[] intersectionpoints(conic co1, conic co2) return intersectionpoints(equation(co1), equation(co2)); } -/*<asyxml><function type = "point[]" signature = "intersectionpoints(triangle, conic, bool)"><code></asyxml>*/ +/*<asyxml><function type="point[]" signature="intersectionpoints(triangle,conic,bool)"><code></asyxml>*/ point[] intersectionpoints(triangle t, conic co, bool extended = false) {/*<asyxml></code><documentation>Return the intersection points. If 'extended' is true, the sides are lines else the sides are segments. @@ -6697,91 +6718,91 @@ point[] intersectionpoints(conic co, triangle t, bool extended = false) return intersectionpoints(t, co, extended); } -/*<asyxml><function type = "point[]" signature = "intersectionpoints(ellipse, ellipse)"><code></asyxml>*/ +/*<asyxml><function type="point[]" signature="intersectionpoints(ellipse,ellipse)"><code></asyxml>*/ point[] intersectionpoints(ellipse a, ellipse b) {/*<asyxml></code><documentation></documentation></function></asyxml>*/ // if(degenerate(a)) return intersectionpoints(a.l, b); // if(degenerate(b)) return intersectionpoints(a, b.l);; return intersectionpoints((conic)a, (conic)b); } -/*<asyxml><function type = "point[]" signature = "intersectionpoints(ellipse, circle)"><code></asyxml>*/ +/*<asyxml><function type="point[]" signature="intersectionpoints(ellipse,circle)"><code></asyxml>*/ point[] intersectionpoints(ellipse a, circle b) {/*<asyxml></code><documentation></documentation></function></asyxml>*/ // if(degenerate(a)) return intersectionpoints(a.l, b); // if(degenerate(b)) return intersectionpoints(a, b.l);; return intersectionpoints((conic)a, (conic)b); } -/*<asyxml><function type = "point[]" signature = "intersectionpoints(circle, ellipse)"><code></asyxml>*/ +/*<asyxml><function type="point[]" signature="intersectionpoints(circle,ellipse)"><code></asyxml>*/ point[] intersectionpoints(circle a, ellipse b) {/*<asyxml></code><documentation></documentation></function></asyxml>*/ return intersectionpoints(b, a); } -/*<asyxml><function type = "point[]" signature = "intersectionpoints(ellipse, parabola)"><code></asyxml>*/ +/*<asyxml><function type="point[]" signature="intersectionpoints(ellipse,parabola)"><code></asyxml>*/ point[] intersectionpoints(ellipse a, parabola b) {/*<asyxml></code><documentation></documentation></function></asyxml>*/ // if(degenerate(a)) return intersectionpoints(a.l, b); return intersectionpoints((conic)a, (conic)b); } -/*<asyxml><function type = "point[]" signature = "intersectionpoints(parabola, ellipse)"><code></asyxml>*/ +/*<asyxml><function type="point[]" signature="intersectionpoints(parabola,ellipse)"><code></asyxml>*/ point[] intersectionpoints(parabola a, ellipse b) {/*<asyxml></code><documentation></documentation></function></asyxml>*/ return intersectionpoints(b, a); } -/*<asyxml><function type = "point[]" signature = "intersectionpoints(ellipse, hyperbola)"><code></asyxml>*/ +/*<asyxml><function type="point[]" signature="intersectionpoints(ellipse,hyperbola)"><code></asyxml>*/ point[] intersectionpoints(ellipse a, hyperbola b) {/*<asyxml></code><documentation></documentation></function></asyxml>*/ // if(degenerate(a)) return intersectionpoints(a.l, b); return intersectionpoints((conic)a, (conic)b); } -/*<asyxml><function type = "point[]" signature = "intersectionpoints(hyperbola, ellipse)"><code></asyxml>*/ +/*<asyxml><function type="point[]" signature="intersectionpoints(hyperbola,ellipse)"><code></asyxml>*/ point[] intersectionpoints(hyperbola a, ellipse b) {/*<asyxml></code><documentation></documentation></function></asyxml>*/ return intersectionpoints(b, a); } -/*<asyxml><function type = "point[]" signature = "intersectionpoints(circle, parabola)"><code></asyxml>*/ +/*<asyxml><function type="point[]" signature="intersectionpoints(circle,parabola)"><code></asyxml>*/ point[] intersectionpoints(circle a, parabola b) {/*<asyxml></code><documentation></documentation></function></asyxml>*/ return intersectionpoints((conic)a, (conic)b); } -/*<asyxml><function type = "point[]" signature = "intersectionpoints(parabola, circle)"><code></asyxml>*/ +/*<asyxml><function type="point[]" signature="intersectionpoints(parabola,circle)"><code></asyxml>*/ point[] intersectionpoints(parabola a, circle b) {/*<asyxml></code><documentation></documentation></function></asyxml>*/ return intersectionpoints((conic)a, (conic)b); } -/*<asyxml><function type = "point[]" signature = "intersectionpoints(circle, hyperbola)"><code></asyxml>*/ +/*<asyxml><function type="point[]" signature="intersectionpoints(circle,hyperbola)"><code></asyxml>*/ point[] intersectionpoints(circle a, hyperbola b) {/*<asyxml></code><documentation></documentation></function></asyxml>*/ return intersectionpoints((conic)a, (conic)b); } -/*<asyxml><function type = "point[]" signature = "intersectionpoints(hyperbola, circle)"><code></asyxml>*/ +/*<asyxml><function type="point[]" signature="intersectionpoints(hyperbola,circle)"><code></asyxml>*/ point[] intersectionpoints(hyperbola a, circle b) {/*<asyxml></code><documentation></documentation></function></asyxml>*/ return intersectionpoints((conic)a, (conic)b); } -/*<asyxml><function type = "point[]" signature = "intersectionpoints(parabola, parabola)"><code></asyxml>*/ +/*<asyxml><function type="point[]" signature="intersectionpoints(parabola,parabola)"><code></asyxml>*/ point[] intersectionpoints(parabola a, parabola b) {/*<asyxml></code><documentation></documentation></function></asyxml>*/ return intersectionpoints((conic)a, (conic)b); } -/*<asyxml><function type = "point[]" signature = "intersectionpoints(parabola, hyperbola)"><code></asyxml>*/ +/*<asyxml><function type="point[]" signature="intersectionpoints(parabola,hyperbola)"><code></asyxml>*/ point[] intersectionpoints(parabola a, hyperbola b) {/*<asyxml></code><documentation></documentation></function></asyxml>*/ return intersectionpoints((conic)a, (conic)b); } -/*<asyxml><function type = "point[]" signature = "intersectionpoints(hyperbola, parabola)"><code></asyxml>*/ +/*<asyxml><function type="point[]" signature="intersectionpoints(hyperbola,parabola)"><code></asyxml>*/ point[] intersectionpoints(hyperbola a, parabola b) {/*<asyxml></code><documentation></documentation></function></asyxml>*/ return intersectionpoints((conic)a, (conic)b); } -/*<asyxml><function type = "point[]" signature = "intersectionpoints(hyperbola, hyperbola)"><code></asyxml>*/ +/*<asyxml><function type="point[]" signature="intersectionpoints(hyperbola,hyperbola)"><code></asyxml>*/ point[] intersectionpoints(hyperbola a, hyperbola b) {/*<asyxml></code><documentation></documentation></function></asyxml>*/ return intersectionpoints((conic)a, (conic)b); } -/*<asyxml><function type = "point[]" signature = "intersectionpoints(circle, circle)"><code></asyxml>*/ +/*<asyxml><function type="point[]" signature="intersectionpoints(circle,circle)"><code></asyxml>*/ point[] intersectionpoints(circle c1, circle c2) {/*<asyxml></code><documentation></documentation></function></asyxml>*/ if(degenerate(c1)) @@ -6793,7 +6814,7 @@ point[] intersectionpoints(circle c1, circle c2) intersectionpoints(radicalline(c1, c2), c1); } -/*<asyxml><function type = "line" signature = "tangent(circle, abscissa)"><code></asyxml>*/ +/*<asyxml><function type="line" signature="tangent(circle,abscissa)"><code></asyxml>*/ line tangent(circle c, abscissa x) {/*<asyxml></code><documentation>Return the tangent of 'c' at 'point(c, x)'.</documentation></function></asyxml>*/ if(c.r == 0) abort("tangent: a circle with a radius equals zero has no tangent."); @@ -6801,7 +6822,7 @@ line tangent(circle c, abscissa x) return line(rotate(90, M) * c.C, M); } -/*<asyxml><function type = "line[]" signature = "tangents(circle, point)"><code></asyxml>*/ +/*<asyxml><function type="line[]" signature="tangents(circle,point)"><code></asyxml>*/ line[] tangents(circle c, point M) {/*<asyxml></code><documentation>Return the tangents of 'c' passing through 'M'.</documentation></function></asyxml>*/ line[] ol; @@ -6817,28 +6838,28 @@ line[] tangents(circle c, point M) return ol; } -/*<asyxml><function type = "point" signature = "point(circle, point)"><code></asyxml>*/ +/*<asyxml><function type="point" signature="point(circle,point)"><code></asyxml>*/ point point(circle c, point M) {/*<asyxml></code><documentation>Return the intersection point of 'c' with the half-line '[c.C M)'.</documentation></function></asyxml>*/ return intersectionpoints(c, line(c.C, false, M))[0]; } -/*<asyxml><function type = "line" signature = "tangent(circle, point)"><code></asyxml>*/ +/*<asyxml><function type="line" signature="tangent(circle,point)"><code></asyxml>*/ line tangent(circle c, point M) {/*<asyxml></code><documentation>Return the tangent of 'c' at the intersection point of the half-line'[c.C M)'.</documentation></function></asyxml>*/ return tangents(c, point(c, M))[0]; } -/*<asyxml><function type = "point" signature = "point(circle, explicit vector)"><code></asyxml>*/ +/*<asyxml><function type="point" signature="point(circle,explicit vector)"><code></asyxml>*/ point point(circle c, explicit vector v) {/*<asyxml></code><documentation>Return the intersection point of 'c' with the half-line '[c.C v)'.</documentation></function></asyxml>*/ return point(c, c.C + v); } -/*<asyxml><function type = "line" signature = "tangent(circle, explicit vector)"><code></asyxml>*/ +/*<asyxml><function type="line" signature="tangent(circle,explicit vector)"><code></asyxml>*/ line tangent(circle c, explicit vector v) {/*<asyxml></code><documentation>Return the tangent of 'c' at the point M so that vec(c.C M) is collinear to 'v' with the same sense.</documentation></function></asyxml>*/ @@ -6846,7 +6867,7 @@ line tangent(circle c, explicit vector v) return dot(ol.v, v) > 0 ? ol : reverse(ol); } -/*<asyxml><function type = "line" signature = "tangent(ellipse, abscissa)"><code></asyxml>*/ +/*<asyxml><function type="line" signature="tangent(ellipse,abscissa)"><code></asyxml>*/ line tangent(ellipse el, abscissa x) {/*<asyxml></code><documentation>Return the tangent of 'el' at 'point(el, x)'.</documentation></function></asyxml>*/ point M = point(el, x); @@ -6856,7 +6877,7 @@ line tangent(ellipse el, abscissa x) return ol; } -/*<asyxml><function type = "line[]" signature = "tangents(ellipse, point)"><code></asyxml>*/ +/*<asyxml><function type="line[]" signature="tangents(ellipse,point)"><code></asyxml>*/ line[] tangents(ellipse el, point M) {/*<asyxml></code><documentation>Return the tangents of 'el' passing through 'M'.</documentation></function></asyxml>*/ line[] ol; @@ -6878,7 +6899,7 @@ line[] tangents(ellipse el, point M) return ol; } -/*<asyxml><function type = "line" signature = "tangent(parabola, abscissa)"><code></asyxml>*/ +/*<asyxml><function type="line" signature="tangent(parabola,abscissa)"><code></asyxml>*/ line tangent(parabola p, abscissa x) {/*<asyxml></code><documentation>Return the tangent of 'p' at 'point(p, x)' (use the Wells method).</documentation></function></asyxml>*/ line lt = rotate(90, p.V) * line(p.V, p.F); @@ -6889,7 +6910,7 @@ line tangent(parabola p, abscissa x) return line(P, projection(lt) * M); } -/*<asyxml><function type = "line[]" signature = "tangents(parabola, point)"><code></asyxml>*/ +/*<asyxml><function type="line[]" signature="tangents(parabola,point)"><code></asyxml>*/ line[] tangents(parabola p, point M) {/*<asyxml></code><documentation>Return the tangent of 'p' at 'M' (use the Wells method).</documentation></function></asyxml>*/ line[] ol; @@ -6914,7 +6935,7 @@ line[] tangents(parabola p, point M) return ol; } -/*<asyxml><function type = "line" signature = "tangent(hyperbola, abscissa)"><code></asyxml>*/ +/*<asyxml><function type="line" signature="tangent(hyperbola,abscissa)"><code></asyxml>*/ line tangent(hyperbola h, abscissa x) {/*<asyxml></code><documentation>Return the tangent of 'h' at 'point(p, x)'.</documentation></function></asyxml>*/ point M = point(h, x); @@ -6923,7 +6944,7 @@ line tangent(hyperbola h, abscissa x) return ol; } -/*<asyxml><function type = "line[]" signature = "tangents(hyperbola, point)"><code></asyxml>*/ +/*<asyxml><function type="line[]" signature="tangents(hyperbola,point)"><code></asyxml>*/ line[] tangents(hyperbola h, point M) {/*<asyxml></code><documentation>Return the tangent of 'h' at 'M'.</documentation></function></asyxml>*/ line[] ol; @@ -6951,7 +6972,7 @@ line[] tangents(hyperbola h, point M) return ol; } -/*<asyxml><function type = "point[]" signature = "intersectionpoints(conic, arc)"><code></asyxml>*/ +/*<asyxml><function type="point[]" signature="intersectionpoints(conic,arc)"><code></asyxml>*/ point[] intersectionpoints(conic co, arc a) {/*<asyxml></code><documentation>intersectionpoints(arc, circle) is also defined.</documentation></function></asyxml>*/ point[] op; @@ -6966,7 +6987,7 @@ point[] intersectionpoints(arc a, conic co) return intersectionpoints(co, a); } -/*<asyxml><function type = "point[]" signature = "intersectionpoints(arc, arc)"><code></asyxml>*/ +/*<asyxml><function type="point[]" signature="intersectionpoints(arc,arc)"><code></asyxml>*/ point[] intersectionpoints(arc a1, arc a2) {/*<asyxml></code><documentation></documentation></function></asyxml>*/ point[] op; @@ -6977,7 +6998,7 @@ point[] intersectionpoints(arc a1, arc a2) } -/*<asyxml><function type = "point[]" signature = "intersectionpoints(line, arc)"><code></asyxml>*/ +/*<asyxml><function type="point[]" signature="intersectionpoints(line,arc)"><code></asyxml>*/ point[] intersectionpoints(line l, arc a) {/*<asyxml></code><documentation>intersectionpoints(arc, line) is also defined.</documentation></function></asyxml>*/ point[] op; @@ -6992,7 +7013,7 @@ point[] intersectionpoints(arc a, line l) return intersectionpoints(l, a); } -/*<asyxml><function type = "point" signature = "arcsubtendedcenter(point, point, real)"><code></asyxml>*/ +/*<asyxml><function type="point" signature="arcsubtendedcenter(point,point,real)"><code></asyxml>*/ point arcsubtendedcenter(point A, point B, real angle) {/*<asyxml></code><documentation>Return the center of the arc retuned by the 'arcsubtended' routine.</documentation></function></asyxml>*/ @@ -7004,7 +7025,7 @@ point arcsubtendedcenter(point A, point B, real angle) return intersectionpoint(bis, rotate(90 - angle, A) * AB); } -/*<asyxml><function type = "arc" signature = "arcsubtended(point, point, real)"><code></asyxml>*/ +/*<asyxml><function type="arc" signature="arcsubtended(point,point,real)"><code></asyxml>*/ arc arcsubtended(point A, point B, real angle) {/*<asyxml></code><documentation>Return the arc circle from which the segment AB is saw with the angle 'angle'. @@ -7019,18 +7040,24 @@ arc arcsubtended(point A, point B, real angle) return arc(circle(C, abs(B - C)), BC, AC, angle > 0 ? CCW : CW); } -/*<asyxml><function type = "arc" signature = "arccircle(point, point, point)"><code></asyxml>*/ +/*<asyxml><function type="arc" signature="arccircle(point,point,point)"><code></asyxml>*/ arc arccircle(point A, point M, point B) {/*<asyxml></code><documentation>Return the CCW arc circle 'AB' passing through 'M'.</documentation></function></asyxml>*/ circle tc = circle(A, M, B); real a = degrees(A - tc.C); real b = degrees(B - tc.C); + real m = degrees(M - tc.C); + arc oa = arc(tc, a, b); - if(!(M @ oa)) oa.direction=!oa.direction; + // TODO : use cross product to determine CWW or CW + if (!(M @ oa)) { + oa.direction = !oa.direction; + } + return oa; } -/*<asyxml><function type = "arc" signature = "arc(ellipse, abscissa, abscissa, bool)"><code></asyxml>*/ +/*<asyxml><function type="arc" signature="arc(ellipse,abscissa,abscissa,bool)"><code></asyxml>*/ arc arc(ellipse el, explicit abscissa x1, explicit abscissa x2, bool direction = CCW) {/*<asyxml></code><documentation>Return the arc from 'point(c, x1)' to 'point(c, x2)' in the direction 'direction'.</documentation></function></asyxml>*/ real a = degrees(point(el, x1) - el.C); @@ -7039,14 +7066,14 @@ arc arc(ellipse el, explicit abscissa x1, explicit abscissa x2, bool direction = return oa; } -/*<asyxml><function type = "arc" signature = "arc(ellipse, point, point, bool)"><code></asyxml>*/ +/*<asyxml><function type="arc" signature="arc(ellipse,point,point,bool)"><code></asyxml>*/ arc arc(ellipse el, point M, point N, bool direction = CCW) {/*<asyxml></code><documentation>Return the arc from 'M' to 'N' in the direction 'direction'. The points 'M' and 'N' must belong to the ellipse 'el'.</documentation></function></asyxml>*/ return arc(el, relabscissa(el, M), relabscissa(el, N), direction); } -/*<asyxml><function type = "arc" signature = "arccircle(point, point, real, bool)"><code></asyxml>*/ +/*<asyxml><function type="arc" signature="arccircle(point,point,real,bool)"><code></asyxml>*/ arc arccircle(point A, point B, real angle, bool direction = CCW) {/*<asyxml></code><documentation>Return the arc circle centered on A from B to rotate(angle, A) * B in the direction 'direction'.</documentation></function></asyxml>*/ @@ -7054,8 +7081,7 @@ arc arccircle(point A, point B, real angle, bool direction = CCW) return arc(circle(A, abs(A - B)), B, M, direction); } - -/*<asyxml><function type = "arc" signature = "arc(explicit arc, abscissa, abscissa)"><code></asyxml>*/ +/*<asyxml><function type="arc" signature="arc(explicit arc,abscissa,abscissa)"><code></asyxml>*/ arc arc(explicit arc a, abscissa x1, abscissa x2) {/*<asyxml></code><documentation>Return the arc from 'point(a, x1)' to 'point(a, x2)' traversed in the direction of the arc direction.</documentation></function></asyxml>*/ real a1 = angabscissa(a.el, point(a, x1), a.polarconicroutine).x; @@ -7063,14 +7089,14 @@ arc arc(explicit arc a, abscissa x1, abscissa x2) return arc(a.el, a1, a2, a.polarconicroutine, a.direction); } -/*<asyxml><function type = "arc" signature = "arc(explicit arc, point, point)"><code></asyxml>*/ +/*<asyxml><function type="arc" signature="arc(explicit arc,point,point)"><code></asyxml>*/ arc arc(explicit arc a, point M, point N) {/*<asyxml></code><documentation>Return the arc from 'M' to 'N'. The points 'M' and 'N' must belong to the arc 'a'.</documentation></function></asyxml>*/ return arc(a, relabscissa(a, M), relabscissa(a, N)); } -/*<asyxml><function type = "arc" signature = "inverse(real, point, segment)"><code></asyxml>*/ +/*<asyxml><function type="arc" signature="inverse(real,point,segment)"><code></asyxml>*/ arc inverse(real k, point A, segment s) {/*<asyxml></code><documentation>Return the inverse arc circle of 's' with respect to point A and inversion radius 'k'.</documentation></function></asyxml>*/ @@ -7079,22 +7105,22 @@ arc inverse(real k, point A, segment s) return arccircle(Ap, M, Bp); } -/*<asyxml><operator type = "arc" signature = "*(inversion, segment)"><code></asyxml>*/ +/*<asyxml><operator type = "arc" signature="*(inversion,segment)"><code></asyxml>*/ arc operator *(inversion i, segment s) {/*<asyxml></code><documentation>Provide inversion * segment.</documentation></operator></asyxml>*/ return inverse(i.k, i.C, s); } -/*<asyxml><operator type = "path" signature = "*(inversion, triangle)"><code></asyxml>*/ +/*<asyxml><operator type = "path" signature="*(inversion,triangle)"><code></asyxml>*/ path operator *(inversion i, triangle t) {/*<asyxml></code><documentation>Provide inversion * triangle.</documentation></operator></asyxml>*/ return (path)(i * segment(t.AB))-- (path)(i * segment(t.BC))-- - (path)(i * segment(t.CA))--cycle; + (path)(i * segment(t.CA))&cycle; } -/*<asyxml><function type = "path" signature = "compassmark(pair, pair, real, real)"><code></asyxml>*/ +/*<asyxml><function type="path" signature="compassmark(pair,pair,real,real)"><code></asyxml>*/ path compassmark(pair O, pair A, real position, real angle = 10) {/*<asyxml></code><documentation>Return an arc centered on O with the angle 'angle' so that the position of 'A' on this arc makes an angle 'position * angle'.</documentation></function></asyxml>*/ @@ -7108,14 +7134,14 @@ path compassmark(pair O, pair A, real position, real angle = 10) return shift(O) * scale(abs(O - A)) * subpath(unitcircle, t1, t2); } -/*<asyxml><function type = "line" signature = "tangent(explicit arc, abscissa)"><code></asyxml>*/ +/*<asyxml><function type="line" signature="tangent(explicit arc,abscissa)"><code></asyxml>*/ line tangent(explicit arc a, abscissa x) {/*<asyxml></code><documentation>Return the tangent of 'a' at 'point(a, x)'.</documentation></function></asyxml>*/ abscissa ag = angabscissa(a, point(a, x)); return tangent(a.el, ag + a.angle1 + (a.el.e == 0 ? a.angle0 : 0)); } -/*<asyxml><function type = "line" signature = "tangent(explicit arc, point)"><code></asyxml>*/ +/*<asyxml><function type="line" signature="tangent(explicit arc,point)"><code></asyxml>*/ line tangent(explicit arc a, point M) {/*<asyxml></code><documentation>Return the tangent of 'a' at 'M'. The points 'M' must belong to the arc 'a'.</documentation></function></asyxml>*/ diff --git a/Build/source/utils/asymptote/base/graph.asy b/Build/source/utils/asymptote/base/graph.asy index a7ffabc6220..cbcea4aeae3 100644 --- a/Build/source/utils/asymptote/base/graph.asy +++ b/Build/source/utils/asymptote/base/graph.asy @@ -593,9 +593,11 @@ tickvalues generateticks(int sign, Label F="", ticklabel ticklabel=null, if(b-a < 100.0*epsilon*norm) b=a; - real tickmin=finite(locate.S.tickMin) && (Step == 0 || locate.S.automin) ? + bool autotick=Step == 0 && N == 0; + + real tickmin=finite(locate.S.tickMin) && (autotick || locate.S.automin) ? locate.S.Tinv(locate.S.tickMin) : a; - real tickmax=finite(locate.S.tickMax) && (Step == 0 || locate.S.automax) ? + real tickmax=finite(locate.S.tickMax) && (autotick || locate.S.automax) ? locate.S.Tinv(locate.S.tickMax) : b; if(tickmin > tickmax) {real temp=tickmin; tickmin=tickmax; tickmax=temp;} @@ -603,7 +605,7 @@ tickvalues generateticks(int sign, Label F="", ticklabel ticklabel=null, bool calcStep=true; real len=tickmax-tickmin; - if(Step == 0 && N == 0) { + if(autotick) { N=1; if(divisor.length > 0) { bool autoscale=locate.S.automin && locate.S.automax; @@ -1202,15 +1204,15 @@ void xaxisAt(picture pic=currentpicture, Label L="", axis axis, }); void bounds() { - if(type == Min) + if(type == Both) { + y2=pic.scale.y.automax() ? tickMax(pic).y : pic.userMax().y; + y=opposite ? y2 : + (pic.scale.y.automin() ? tickMin(pic).y : pic.userMin().y); + } + else if(type == Min) y=pic.scale.y.automin() ? tickMin(pic).y : pic.userMin().y; else if(type == Max) y=pic.scale.y.automax() ? tickMax(pic).y : pic.userMax().y; - else if(type == Both) { - y2=pic.scale.y.automax() ? tickMax(pic).y : pic.userMax().y; - y=opposite ? y2 : - (pic.scale.y.automin() ? tickMin(pic).y : pic.userMin().y); - } real Xmin=finite(xmin) ? xmin : pic.userMin().x; real Xmax=finite(xmax) ? xmax : pic.userMax().x; @@ -1296,15 +1298,14 @@ void yaxisAt(picture pic=currentpicture, Label L="", axis axis, }); void bounds() { - if(type == Min) - x=pic.scale.x.automin() ? tickMin(pic).x : pic.userMin().x; - else if(type == Max) - x=pic.scale.x.automax() ? tickMax(pic).x : pic.userMax().x; - else if(type == Both) { + if(type == Both) { x2=pic.scale.x.automax() ? tickMax(pic).x : pic.userMax().x; x=opposite ? x2 : (pic.scale.x.automin() ? tickMin(pic).x : pic.userMin().x); - } + } else if(type == Min) + x=pic.scale.x.automin() ? tickMin(pic).x : pic.userMin().x; + else if(type == Max) + x=pic.scale.x.automax() ? tickMax(pic).x : pic.userMax().x; real Ymin=finite(ymin) ? ymin : pic.userMin().y; real Ymax=finite(ymax) ? ymax : pic.userMax().y; @@ -1655,6 +1656,7 @@ real ScaleY(picture pic=currentpicture, real y) void tick(picture pic=currentpicture, pair z, pair dir, real size=Ticksize, pen p=currentpen) { + pair z=Scale(pic,z); pic.add(new void (frame f, transform t) { pair tz=t*z; draw(f,tz--tz+unit(dir)*size,p); @@ -1666,32 +1668,32 @@ void tick(picture pic=currentpicture, pair z, pair dir, real size=Ticksize, void xtick(picture pic=currentpicture, explicit pair z, pair dir=N, real size=Ticksize, pen p=currentpen) { - tick(pic,Scale(pic,z),dir,size,p); + tick(pic,z,dir,size,p); } void xtick(picture pic=currentpicture, real x, pair dir=N, real size=Ticksize, pen p=currentpen) { - xtick(pic,(x,pic.scale.y.scale.logarithmic ? 1 : 0),dir,size,p); + tick(pic,(x,pic.scale.y.scale.logarithmic ? 1 : 0),dir,size,p); } void ytick(picture pic=currentpicture, explicit pair z, pair dir=E, real size=Ticksize, pen p=currentpen) { - xtick(pic,z,dir,size,p); + tick(pic,z,dir,size,p); } void ytick(picture pic=currentpicture, real y, pair dir=E, real size=Ticksize, pen p=currentpen) { - xtick(pic,(pic.scale.x.scale.logarithmic ? 1 : 0,y),dir,size,p); + tick(pic,(pic.scale.x.scale.logarithmic ? 1 : 0,y),dir,size,p); } void tick(picture pic=currentpicture, Label L, real value, explicit pair z, pair dir, string format="", real size=Ticksize, pen p=currentpen) { Label L=L.copy(); - L.position(z); + L.position(Scale(pic,z)); L.align(L.align,-dir); if(shift(L.T)*0 == 0) L.T=shift(dot(dir,L.align.dir) > 0 ? dir*size : @@ -1700,7 +1702,7 @@ void tick(picture pic=currentpicture, Label L, real value, explicit pair z, if(L.s == "") L.s=format(format == "" ? defaultformat : format,value); L.s=baseline(L.s,baselinetemplate); add(pic,L); - xtick(pic,z,dir,size,p); + tick(pic,z,dir,size,p); } void xtick(picture pic=currentpicture, Label L, explicit pair z, pair dir=N, @@ -1724,7 +1726,7 @@ void ytick(picture pic=currentpicture, Label L, explicit pair z, pair dir=E, void ytick(picture pic=currentpicture, Label L, real y, pair dir=E, string format="", real size=Ticksize, pen p=currentpen) { - ytick(pic,L,(pic.scale.x.scale.logarithmic ? 1 : 0,y),dir,format,size,p); + xtick(pic,L,(pic.scale.x.scale.logarithmic ? 1 : 0,y),dir,format,size,p); } private void label(picture pic, Label L, pair z, real x, align align, @@ -1743,13 +1745,13 @@ private void label(picture pic, Label L, pair z, real x, align align, // Put a label on the x axis. void labelx(picture pic=currentpicture, Label L="", explicit pair z, - align align=S, string format="", pen p=nullpen) + align align=S, string format="", pen p=currentpen) { label(pic,L,Scale(pic,z),z.x,align,format,p); } void labelx(picture pic=currentpicture, Label L="", real x, - align align=S, string format="", pen p=nullpen) + align align=S, string format="", pen p=currentpen) { labelx(pic,L,(x,pic.scale.y.scale.logarithmic ? 1 : 0),align,format,p); } @@ -1762,19 +1764,19 @@ void labelx(picture pic=currentpicture, Label L, // Put a label on the y axis. void labely(picture pic=currentpicture, Label L="", explicit pair z, - align align=W, string format="", pen p=nullpen) + align align=W, string format="", pen p=currentpen) { label(pic,L,Scale(pic,z),z.y,align,format,p); } void labely(picture pic=currentpicture, Label L="", real y, - align align=W, string format="", pen p=nullpen) + align align=W, string format="", pen p=currentpen) { labely(pic,L,(pic.scale.x.scale.logarithmic ? 1 : 0,y),align,format,p); } void labely(picture pic=currentpicture, Label L, - string format="", explicit pen p=nullpen) + string format="", explicit pen p=currentpen) { labely(pic,L,L.position.position,format,p); } diff --git a/Build/source/utils/asymptote/base/graph3.asy b/Build/source/utils/asymptote/base/graph3.asy index 391b72ca87a..91e5194bea9 100644 --- a/Build/source/utils/asymptote/base/graph3.asy +++ b/Build/source/utils/asymptote/base/graph3.asy @@ -545,10 +545,20 @@ void xaxis3At(picture pic=currentpicture, Label L="", axis axis, ztrans(t,z)) : (xmin,y,z); triple b=xmax == infinity ? tinv*(rt.x-max3(p).x,ytrans(t,y), ztrans(t,z)) : (xmax,y,z); - triple a2=xmin == -infinity ? tinv*(lb.x-min3(p).x,ytrans(t,y2), - ztrans(t,z2)) : (xmin,y2,z2); - triple b2=xmax == infinity ? tinv*(rt.x-max3(p).x,ytrans(t,y2), - ztrans(t,z2)) : (xmax,y2,z2); + real y0; + real z0; + if(abs(dir.y) < abs(dir.z)) { + y0=y; + z0=z2; + } else { + y0=y2; + z0=z; + } + + triple a2=xmin == -infinity ? tinv*(lb.x-min3(p).x,ytrans(t,y0), + ztrans(t,z0)) : (xmin,y0,z0); + triple b2=xmax == infinity ? tinv*(rt.x-max3(p).x,ytrans(t,y0), + ztrans(t,z0)) : (xmax,y0,z0); if(xmin == -infinity || xmax == infinity) { bounds mx=autoscale(a.x,b.x,pic.scale.x.scale); @@ -562,7 +572,8 @@ void xaxis3At(picture pic=currentpicture, Label L="", axis axis, b += fuzz; picture d; - ticks(d,t,L,a--b,finite(y2) ? a2--b2 : nullpath3,p,arrow,margin, + ticks(d,t,L,a--b,finite(y0) && finite(z0) ? a2--b2 : nullpath3, + p,arrow,margin, ticklocate(a.x,b.x,pic.scale.x,Dir(dir)),divisor, opposite,primary); add(f,t*T*tinv*d); @@ -667,11 +678,21 @@ void yaxis3At(picture pic=currentpicture, Label L="", axis axis, ztrans(t,z)) : (x,ymin,z); triple b=ymax == infinity ? tinv*(xtrans(t,x),rt.y-max3(p).y, ztrans(t,z)) : (x,ymax,z); - triple a2=ymin == -infinity ? tinv*(xtrans(t,x2),lb.y-min3(p).y, - ztrans(t,z2)) : (x2,ymin,z2); - triple b2=ymax == infinity ? tinv*(xtrans(t,x2),rt.y-max3(p).y, - ztrans(t,z2)) : (x2,ymax,z2); - + real x0; + real z0; + if(abs(dir.x) < abs(dir.z)) { + x0=x; + z0=z2; + } else { + x0=x2; + z0=z; + } + + triple a2=ymin == -infinity ? tinv*(xtrans(t,x0),lb.y-min3(p).y, + ztrans(t,z0)) : (x0,ymin,z0); + triple b2=ymax == infinity ? tinv*(xtrans(t,x0),rt.y-max3(p).y, + ztrans(t,z0)) : (x0,ymax,z0); + if(ymin == -infinity || ymax == infinity) { bounds my=autoscale(a.y,b.y,pic.scale.y.scale); pic.scale.y.tickMin=my.min; @@ -684,7 +705,8 @@ void yaxis3At(picture pic=currentpicture, Label L="", axis axis, b += fuzz; picture d; - ticks(d,t,L,a--b,finite(x2) ? a2--b2 : nullpath3,p,arrow,margin, + ticks(d,t,L,a--b,finite(x0) && finite(z0) ? a2--b2 : nullpath3, + p,arrow,margin, ticklocate(a.y,b.y,pic.scale.y,Dir(dir)),divisor, opposite,primary); add(f,t*T*tinv*d); @@ -789,10 +811,20 @@ void zaxis3At(picture pic=currentpicture, Label L="", axis axis, lb.z-min3(p).z) : (x,y,zmin); triple b=zmax == infinity ? tinv*(xtrans(t,x),ytrans(t,y), rt.z-max3(p).z) : (x,y,zmax); - triple a2=zmin == -infinity ? tinv*(xtrans(t,x2),ytrans(t,y2), - lb.z-min3(p).z) : (x2,y2,zmin); - triple b2=zmax == infinity ? tinv*(xtrans(t,x2),ytrans(t,y2), - rt.z-max3(p).z) : (x2,y2,zmax); + real x0; + real y0; + if(abs(dir.x) < abs(dir.y)) { + x0=x; + y0=y2; + } else { + x0=x2; + y0=y; + } + + triple a2=zmin == -infinity ? tinv*(xtrans(t,x0),ytrans(t,y0), + lb.z-min3(p).z) : (x0,y0,zmin); + triple b2=zmax == infinity ? tinv*(xtrans(t,x0),ytrans(t,y0), + rt.z-max3(p).z) : (x0,y0,zmax); if(zmin == -infinity || zmax == infinity) { bounds mz=autoscale(a.z,b.z,pic.scale.z.scale); @@ -806,7 +838,8 @@ void zaxis3At(picture pic=currentpicture, Label L="", axis axis, b += fuzz; picture d; - ticks(d,t,L,a--b,finite(x2) ? a2--b2 : nullpath3,p,arrow,margin, + ticks(d,t,L,a--b,finite(x0) && finite(y0) ? a2--b2 : nullpath3, + p,arrow,margin, ticklocate(a.z,b.z,pic.scale.z,Dir(dir)),divisor, opposite,primary); add(f,t*T*tinv*d); @@ -1189,6 +1222,7 @@ real ScaleZ(picture pic=currentpicture, real z) void tick(picture pic=currentpicture, triple v, triple dir, real size=Ticksize, pen p=currentpen) { + triple v=Scale(pic,v); pic.add(new void (picture f, transform3 t) { triple tv=t*v; draw(f,tv--tv+unit(dir)*size,p); @@ -1200,27 +1234,27 @@ void tick(picture pic=currentpicture, triple v, triple dir, real size=Ticksize, void xtick(picture pic=currentpicture, triple v, triple dir=Y, real size=Ticksize, pen p=currentpen) { - tick(pic,Scale(pic,v),dir,size,p); + tick(pic,v,dir,size,p); } void xtick3(picture pic=currentpicture, real x, triple dir=Y, real size=Ticksize, pen p=currentpen) { - xtick(pic,(x,pic.scale.y.scale.logarithmic ? 1 : 0, + tick(pic,(x,pic.scale.y.scale.logarithmic ? 1 : 0, pic.scale.z.scale.logarithmic ? 1 : 0),dir,size,p); } void ytick(picture pic=currentpicture, triple v, triple dir=X, real size=Ticksize, pen p=currentpen) { - xtick(pic,v,dir,size,p); + tick(pic,v,dir,size,p); } -void ytick(picture pic=currentpicture, real y, triple dir=X, - real size=Ticksize, pen p=currentpen) +void ytick3(picture pic=currentpicture, real y, triple dir=X, + real size=Ticksize, pen p=currentpen) { - xtick(pic,(pic.scale.x.scale.logarithmic ? 1 : 0,y, - pic.scale.z.scale.logarithmic ? 1 : 0),dir,size,p); + tick(pic,(pic.scale.x.scale.logarithmic ? 1 : 0,y, + pic.scale.z.scale.logarithmic ? 1 : 0),dir,size,p); } void ztick(picture pic=currentpicture, triple v, triple dir=X, @@ -1229,8 +1263,8 @@ void ztick(picture pic=currentpicture, triple v, triple dir=X, xtick(pic,v,dir,size,p); } -void ztick(picture pic=currentpicture, real z, triple dir=X, - real size=Ticksize, pen p=currentpen) +void ztick3(picture pic=currentpicture, real z, triple dir=X, + real size=Ticksize, pen p=currentpen) { xtick(pic,(pic.scale.x.scale.logarithmic ? 1 : 0, pic.scale.y.scale.logarithmic ? 1 : 0,z),dir,size,p); @@ -1241,15 +1275,14 @@ void tick(picture pic=currentpicture, Label L, real value, triple v, { Label L=L.copy(); L.align(L.align,-dir); - if(shift(L.T3)*O == O) { + if(shift(L.T3)*O == O) L.T3=shift(dot(dir,L.align.dir3) > 0 ? dir*size : ticklabelshift(L.align.dir3,p))*L.T3; - } L.p(p); if(L.s == "") L.s=format(format == "" ? defaultformat : format,value); L.s=baseline(L.s,baselinetemplate); - label(pic,L,v); - xtick(pic,v,dir,size,p); + label(pic,L,Scale(pic,v)); + tick(pic,v,dir,size,p); } void xtick(picture pic=currentpicture, Label L, triple v, triple dir=Y, @@ -1262,7 +1295,7 @@ void xtick3(picture pic=currentpicture, Label L, real x, triple dir=Y, string format="", real size=Ticksize, pen p=currentpen) { xtick(pic,L,(x,pic.scale.y.scale.logarithmic ? 1 : 0, - pic.scale.z.scale.logarithmic ? 1 : 0),dir,size,p); + pic.scale.z.scale.logarithmic ? 1 : 0),dir,size,p); } void ytick(picture pic=currentpicture, Label L, triple v, triple dir=X, @@ -1274,8 +1307,8 @@ void ytick(picture pic=currentpicture, Label L, triple v, triple dir=X, void ytick3(picture pic=currentpicture, Label L, real y, triple dir=X, string format="", real size=Ticksize, pen p=currentpen) { - ytick(pic,L,(pic.scale.x.scale.logarithmic ? 1 : 0,y, - pic.scale.z.scale.logarithmic ? 1 : 0),dir,format,size,p); + xtick(pic,L,(pic.scale.x.scale.logarithmic ? 1 : 0,y, + pic.scale.z.scale.logarithmic ? 1 : 0),dir,format,size,p); } void ztick(picture pic=currentpicture, Label L, triple v, triple dir=X, @@ -1287,8 +1320,8 @@ void ztick(picture pic=currentpicture, Label L, triple v, triple dir=X, void ztick3(picture pic=currentpicture, Label L, real z, triple dir=X, string format="", real size=Ticksize, pen p=currentpen) { - ztick(pic,L,(pic.scale.x.scale.logarithmic ? 1 : 0, - pic.scale.z.scale.logarithmic ? 1 : 0,z),dir,format,size,p); + xtick(pic,L,(pic.scale.x.scale.logarithmic ? 1 : 0, + pic.scale.z.scale.logarithmic ? 1 : 0,z),dir,format,size,p); } private void label(picture pic, Label L, triple v, real x, align align, @@ -1305,39 +1338,39 @@ private void label(picture pic, Label L, triple v, real x, align align, } void labelx(picture pic=currentpicture, Label L="", triple v, - align align=-Y, string format="", pen p=nullpen) + align align=-Y, string format="", pen p=currentpen) { label(pic,L,Scale(pic,v),v.x,align,format,p); } void labelx3(picture pic=currentpicture, Label L="", real x, - align align=-Y, string format="", pen p=nullpen) + align align=-Y, string format="", pen p=currentpen) { labelx(pic,L,(x,pic.scale.y.scale.logarithmic ? 1 : 0, pic.scale.z.scale.logarithmic ? 1 : 0),align,format,p); } void labely(picture pic=currentpicture, Label L="", triple v, - align align=-X, string format="", pen p=nullpen) + align align=-X, string format="", pen p=currentpen) { label(pic,L,Scale(pic,v),v.y,align,format,p); } void labely3(picture pic=currentpicture, Label L="", real y, - align align=-X, string format="", pen p=nullpen) + align align=-X, string format="", pen p=currentpen) { labely(pic,L,(pic.scale.x.scale.logarithmic ? 1 : 0,y, pic.scale.z.scale.logarithmic ? 1 : 0),align,format,p); } void labelz(picture pic=currentpicture, Label L="", triple v, - align align=-X, string format="", pen p=nullpen) + align align=-X, string format="", pen p=currentpen) { label(pic,L,Scale(pic,v),v.z,align,format,p); } void labelz3(picture pic=currentpicture, Label L="", real z, - align align=-X, string format="", pen p=nullpen) + align align=-X, string format="", pen p=currentpen) { labelz(pic,L,(pic.scale.x.scale.logarithmic ? 1 : 0, pic.scale.y.scale.logarithmic ? 1 : 0,z),align,format,p); diff --git a/Build/source/utils/asymptote/base/palette.asy b/Build/source/utils/asymptote/base/palette.asy index 9a2d1845604..b1d1985a323 100644 --- a/Build/source/utils/asymptote/base/palette.asy +++ b/Build/source/utils/asymptote/base/palette.asy @@ -54,14 +54,10 @@ pen[] adjust(picture pic, real min, real max, real rmin, real rmax, real factor=palette.length/delta; int minindex=floor(factor*(dmin-rmin)); if(minindex < 0) minindex=0; - int maxindex=floor(factor*(dmax-rmin)); + int maxindex=ceil(factor*(dmax-rmin)); if(maxindex > palette.length) maxindex=palette.length; - if(minindex > 0 || maxindex < palette.length) { - pen[] newpalette; - for(int i=minindex; i < maxindex; ++i) - newpalette.push(palette[i]); - return newpalette; - } + if(minindex > 0 || maxindex < palette.length) + return palette[minindex:maxindex]; } return palette; } @@ -170,6 +166,8 @@ bounds image(picture pic=currentpicture, pair[] z, real[] f, real rmax=pic.scale.z.T(bounds.max); palette=adjust(pic,m,M,rmin,rmax,palette); + rmin=max(rmin,m); + rmax=min(rmax,M); // Crop data to allowed range and scale if(range != Full || pic.scale.z.scale.T != identity || diff --git a/Build/source/utils/asymptote/base/plain_Label.asy b/Build/source/utils/asymptote/base/plain_Label.asy index 623619f4a0c..a559ae88298 100644 --- a/Build/source/utils/asymptote/base/plain_Label.asy +++ b/Build/source/utils/asymptote/base/plain_Label.asy @@ -1,12 +1,3 @@ -// A rotation in the direction dir limited to [-90,90] -// This is useful for rotating text along a line in the direction dir. -transform rotate(explicit pair dir) -{ - real angle=degrees(dir); - if(angle > 90 && angle < 270) angle -= 180; - return rotate(angle); -} - real angle(transform t) { pair z=(2t.xx*t.yy,t.yx*t.yy-t.xx*t.xy); @@ -475,27 +466,27 @@ void label(frame f, Label L, align align=NoAlign, } void label(picture pic=currentpicture, Label L, pair position, - align align=NoAlign, pen p=nullpen, filltype filltype=NoFill) + align align=NoAlign, pen p=currentpen, filltype filltype=NoFill) { Label L=Label(L,position,align,p,filltype); add(pic,L); } void label(picture pic=currentpicture, Label L, align align=NoAlign, - pen p=nullpen, filltype filltype=NoFill) + pen p=currentpen, filltype filltype=NoFill) { label(pic,L,L.position,align,p,filltype); } void label(picture pic=currentpicture, Label L, explicit path g, - align align=NoAlign, pen p=nullpen, filltype filltype=NoFill) + align align=NoAlign, pen p=currentpen, filltype filltype=NoFill) { Label L=Label(L,align,p,filltype); L.out(pic,g); } void label(picture pic=currentpicture, Label L, explicit guide g, - align align=NoAlign, pen p=nullpen, filltype filltype=NoFill) + align align=NoAlign, pen p=currentpen, filltype filltype=NoFill) { label(pic,L,(path) g,align,p,filltype); } diff --git a/Build/source/utils/asymptote/base/plain_bounds.asy b/Build/source/utils/asymptote/base/plain_bounds.asy index 71c304da02f..871d82f01b5 100644 --- a/Build/source/utils/asymptote/base/plain_bounds.asy +++ b/Build/source/utils/asymptote/base/plain_bounds.asy @@ -346,10 +346,14 @@ private struct freezableBounds { addMaxToExtremes(e, max(pathBounds), (0,0)); } - for (var pp : pathpenBounds) { - if (pp.g.length > 0) { - addMinToExtremes(e, min(pp.g), min(pp.p)); - addMaxToExtremes(e, max(pp.g), max(pp.p)); + for(var pp : pathpenBounds) { + pair m=min(pp.p); + pair M=max(pp.p); + for(path gg : pp.g) { + if (size(gg) > 0) { + addMinToExtremes(e,min(gg),m); + addMaxToExtremes(e,max(gg),M); + } } } } @@ -396,7 +400,7 @@ private struct freezableBounds { // would be easily computable from extremes, except that the picture // interface actually allows calls that manually change the usermin and // usermax values. Therefore, we have to compute these values separately. - private static struct bounds { + private static struct userbounds { bool areSet=false; pair min; pair max; @@ -410,15 +414,15 @@ private struct freezableBounds { maxs.push(M); } - void push(bounds b) { + void push(userbounds b) { if (b.areSet) push(b.min, b.max); } - void push(transform t, bounds b) { + void push(transform t, userbounds b) { if (b.areSet) { pair[] box = { t*(b.min.x,b.max.y), t*b.max, - t*b.min.x, t*(b.min.x,b.max.y) }; + t*b.min, t*(b.max.x,b.min.y) }; for (var z : box) push(z,z); } @@ -435,8 +439,8 @@ private struct freezableBounds { (max.x[i].user, max.y[i].user)); } - bounds collapse() { - bounds b; + userbounds collapse() { + userbounds b; if (mins.length > 0) { b.areSet = true; b.min = minbound(mins); @@ -450,7 +454,7 @@ private struct freezableBounds { } // The user bounds already calculated for this data. - private bounds storedUserBounds = null; + private userbounds storedUserBounds = null; private void accumulateUserBounds(boundsAccumulator acc) { @@ -483,7 +487,7 @@ private struct freezableBounds { storedUserBounds = acc.collapse(); } - private bounds userBounds() { + private userbounds userBounds() { if (storedUserBounds == null) computeUserBounds(); @@ -565,7 +569,7 @@ private struct freezableBounds { max.xclip(Min,Max); // Cap the userBounds. - bounds b = storedUserBounds; + userbounds b = storedUserBounds; b.min = (max(Min, b.min.x), b.min.y); b.max = (min(Max, b.max.x), b.max.y); } @@ -578,7 +582,7 @@ private struct freezableBounds { max.yclip(Min,Max); // Cap the userBounds. - bounds b = storedUserBounds; + userbounds b = storedUserBounds; b.min = (b.min.x, max(Min, b.min.y)); b.max = (b.max.x, min(Max, b.max.y)); } diff --git a/Build/source/utils/asymptote/base/plain_constants.asy b/Build/source/utils/asymptote/base/plain_constants.asy index d41cfb770b8..bf6988d4c42 100644 --- a/Build/source/utils/asymptote/base/plain_constants.asy +++ b/Build/source/utils/asymptote/base/plain_constants.asy @@ -57,8 +57,8 @@ bool finite(triple v) return abs(v.x) < infinity && abs(v.y) < infinity && abs(v.z) < infinity; } -restricted file stdin=input(""); -restricted file stdout=output(""); +restricted file stdin=input(); +restricted file stdout=output(); void none(file file) {} void endl(file file) {write(file,'\n',flush);} @@ -101,8 +101,8 @@ struct bool3 { void write(file file, string s="", bool3 b, suffix suffix=none) { - if(b.set) write(b.value); - else write("default"); + if(b.set) write(b.value,suffix); + else write("default",suffix); } void write(string s="", bool3 b, suffix suffix=endl) diff --git a/Build/source/utils/asymptote/base/plain_markers.asy b/Build/source/utils/asymptote/base/plain_markers.asy index 67b218f716d..42b4e8a036c 100644 --- a/Build/source/utils/asymptote/base/plain_markers.asy +++ b/Build/source/utils/asymptote/base/plain_markers.asy @@ -117,22 +117,43 @@ marker marker(path[] g, markroutine markroutine=marknodes, pen p=currentpen, return marker(f,markroutine,above); } +// On picture pic, add path g with opacity thinning about every node. +marker markthin(path g, pen p=currentpen, + real thin(real fraction)=new real(real x) {return x^2;}, + filltype filltype=NoFill) { + marker M=new marker; + M.above=true; + filltype.fill(M.f,g,p); + real factor=1/abs(size(M.f)); + M.markroutine=new void(picture pic=currentpicture, frame, path G) { + transform t=pic.calculateTransform(); + int n=size(G); + for(int i=0; i < n; ++i) { + pair z=point(G,i); + frame f; + real fraction=1; + if(i > 0) fraction=min(fraction,abs(t*(z-point(G,i-1)))*factor); + if(i < n-1) fraction=min(fraction,abs(t*(point(G,i+1)-z))*factor); + filltype.fill(f,g,p+opacity(thin(fraction))); + add(pic,f,point(G,i)); + } + }; + return M; +} + marker nomarker; real circlescale=0.85; -marker[] Mark={ - marker(scale(circlescale)*unitcircle), - marker(polygon(3)),marker(polygon(4)), - marker(polygon(5)),marker(invert*polygon(3)), - marker(cross(4)),marker(cross(6)) -}; - -marker[] MarkFill={ - marker(scale(circlescale)*unitcircle,Fill),marker(polygon(3),Fill), - marker(polygon(4),Fill),marker(polygon(5),Fill), - marker(invert*polygon(3),Fill) -}; +path[] MarkPath={scale(circlescale)*unitcircle, + polygon(3),polygon(4),polygon(5),invert*polygon(3), + cross(4),cross(6)}; + +marker[] Mark=sequence(new marker(int i) {return marker(MarkPath[i]);}, + MarkPath.length); + +marker[] MarkFill=sequence(new marker(int i) {return marker(MarkPath[i],Fill);}, + MarkPath.length-2); marker Mark(int n) { diff --git a/Build/source/utils/asymptote/base/plain_paths.asy b/Build/source/utils/asymptote/base/plain_paths.asy index b073e8090ec..c768922ffd1 100644 --- a/Build/source/utils/asymptote/base/plain_paths.asy +++ b/Build/source/utils/asymptote/base/plain_paths.asy @@ -204,9 +204,9 @@ pair dir(path p) return dir(p,length(p)); } -pair dir(path p, path g) +pair dir(path p, path q) { - return unit(dir(p)+dir(g)); + return unit(dir(p)+dir(q)); } // return the point on path p at arclength L diff --git a/Build/source/utils/asymptote/base/plain_strings.asy b/Build/source/utils/asymptote/base/plain_strings.asy index 98f72f460aa..a466159d9c7 100644 --- a/Build/source/utils/asymptote/base/plain_strings.asy +++ b/Build/source/utils/asymptote/base/plain_strings.asy @@ -5,6 +5,7 @@ string defaultformat(int n, string trailingzero="", bool fixed=false, } string defaultformat=defaultformat(4); +string defaultseparator="\!\times\!"; string ask(string prompt) { @@ -208,9 +209,14 @@ string math(real x) return math((string) x); } +string format(string format, real x, string locale="") +{ + return format(format,defaultseparator,x,locale); +} + string format(real x, string locale="") { - return format(defaultformat,x,locale); + return format(defaultformat,defaultseparator,x,locale); } string phantom(string s) diff --git a/Build/source/utils/asymptote/base/solids.asy b/Build/source/utils/asymptote/base/solids.asy index 239bce4b9a0..e6613fc29c5 100644 --- a/Build/source/utils/asymptote/base/solids.asy +++ b/Build/source/utils/asymptote/base/solids.asy @@ -35,8 +35,7 @@ path line(path p, path q, real[] t) // Return the projection of a generalized cylinder of height h constructed // from area base in the XY plane and aligned with axis. -path[] cylinder(path3 base, real h, triple axis=Z, - projection P=currentprojection) +path[] cylinder(path3 base, real h, triple axis=Z, projection P) { base=rotate(-colatitude(axis),cross(axis,Z))*base; path3 top=shift(h*axis)*base; @@ -84,14 +83,6 @@ struct revolution { m=min(g); } - // Return the surface of rotation obtain by rotating the path3 (x,0,f(x)) - // sampled n times between x=a and x=b about an axis lying in the XZ plane. - void operator init(triple c=O, real f(real x), real a, real b, int n=ngraph, - interpolate3 join=operator --, triple axis=Z, - real angle1=0, real angle2=360) { - operator init(c,graph(new triple(real x) {return (x,0,f(x));},a,b,n, - join),axis,angle1,angle2); - } revolution copy() { return revolution(c,g,axis,angle1,angle2); @@ -134,9 +125,7 @@ struct revolution { } // add transverse slice to skeleton s; - // must be recomputed if camera is adjusted - void transverse(skeleton s, real t, int n=nslice, - projection P=currentprojection) { + void transverse(skeleton s, real t, int n=nslice, projection P) { skeleton.curve s=s.transverse; path3 S=slice(t,n); triple camera=camera(P); @@ -192,8 +181,7 @@ struct revolution { } // add m evenly spaced transverse slices to skeleton s - void transverse(skeleton s, int m=0, int n=nslice, - projection P=currentprojection) { + void transverse(skeleton s, int m=0, int n=nslice, projection P) { if(m == 0) { int N=size(g); for(int i=0; i < N; ++i) @@ -281,8 +269,7 @@ struct revolution { } // add longitudinal curves to skeleton; - // must be recomputed if camera is adjusted - void longitudinal(skeleton s, int n=nslice, projection P=currentprojection) { + void longitudinal(skeleton s, int n=nslice, projection P) { real t, d=0; // Find a point on g of maximal distance from the axis. int N=size(g); @@ -326,7 +313,7 @@ struct revolution { push(t2); } - skeleton skeleton(int m=0, int n=nslice, projection P=currentprojection) { + skeleton skeleton(int m=0, int n=nslice, projection P) { skeleton s; transverse(s,m,n,P); longitudinal(s,n,P); @@ -349,18 +336,43 @@ void draw(picture pic=currentpicture, revolution r, int m=0, int n=nslice, light light=currentlight, string name="", render render=defaultrender, projection P=currentprojection) { - pen thin=is3D() ? thin() : defaultpen; - skeleton s=r.skeleton(m,n,P); - begingroup3(pic,name == "" ? "skeleton" : name,render); - if(frontpen != nullpen) { - draw(pic,s.transverse.back,thin+defaultbackpen+backpen,light); - draw(pic,s.transverse.front,thin+frontpen,light); - } - if(longitudinalpen != nullpen) { - draw(pic,s.longitudinal.back,thin+defaultbackpen+longitudinalbackpen,light); - draw(pic,s.longitudinal.front,thin+longitudinalpen,light); + if(is3D()) { + pen thin=thin(); + void drawskeleton(frame f, transform3 t, projection P) { + skeleton s=r.skeleton(m,n,inverse(t)*P); + if(frontpen != nullpen) { + draw(f,t*s.transverse.back,thin+defaultbackpen+backpen,light); + draw(f,t*s.transverse.front,thin+frontpen,light); + } + if(longitudinalpen != nullpen) { + draw(f,t*s.longitudinal.back,thin+defaultbackpen+longitudinalbackpen, + light); + draw(f,t*s.longitudinal.front,thin+longitudinalpen,light); + } + } + + begingroup3(pic,name == "" ? "skeleton" : name,render); + pic.add(new void(frame f, transform3 t, picture pic, projection P) { + drawskeleton(f,t,P); + if(pic != null) + pic.addBox(min(f,P),max(f,P),min(frontpen),max(frontpen)); + }); + frame f; + drawskeleton(f,identity4,P); + pic.addBox(min3(f),max3(f)); + endgroup3(pic); + } else { + skeleton s=r.skeleton(m,n,P); + if(frontpen != nullpen) { + draw(pic,s.transverse.back,defaultbackpen+backpen,light); + draw(pic,s.transverse.front,frontpen,light); + } + if(longitudinalpen != nullpen) { + draw(pic,s.longitudinal.back,defaultbackpen+longitudinalbackpen, + light); + draw(pic,s.longitudinal.front,longitudinalpen,light); + } } - endgroup3(pic); } revolution operator * (transform3 t, revolution r) diff --git a/Build/source/utils/asymptote/base/three.asy b/Build/source/utils/asymptote/base/three.asy index 033461263eb..5d7ae1a8ba5 100644 --- a/Build/source/utils/asymptote/base/three.asy +++ b/Build/source/utils/asymptote/base/three.asy @@ -328,6 +328,16 @@ projection orthographic(real x, real y, real z, triple up=Z, center=center); } +// Compute camera position with x axis below the horizontal at angle alpha, +// y axis below the horizontal at angle beta, and z axis up. +triple camera(real alpha, real beta) +{ + real denom=Tan(alpha+beta); + real Tanalpha=Tan(alpha); + real Tanbeta=Tan(beta); + return (sqrt(Tanalpha/denom),sqrt(Tanbeta/denom),sqrt(Tanalpha*Tanbeta)); +} + projection oblique(real angle=45) { transform3 t=identity(4); @@ -2830,13 +2840,13 @@ struct scene return b == 0 ? (0.5*(a.x+a.y)) : (b.x^2*a.x+b.y^2*a.y)/(b.x^2+b.y^2); } - pic2.erase(); transform3 s=keepAspect ? scale3(min(f(v,x),f(v,y),f(v,z))) : xscale3(f(v,x))*yscale3(f(v,y))*zscale3(f(v,z)); s=shift(this.P.target)*s*shift(-this.P.target); t=s*t; this.P=s*this.P; this.P.bboxonly=false; + if(!is3D) pic2.erase(); f=pic.fit3(t,is3D ? null : pic2,this.P); } @@ -2988,6 +2998,11 @@ object embed(string label="", string text=label, string prefix=defaultfilename, if((preview || (prc && settings.render == 0)) && settings.embed) { image=prefix; if(settings.inlinetex) image += "_0"; + if(!preview && !shipped && !S.pic2.empty2()) { + transform T=S.pic2.scaling(S.width,S.height); + shipout(image,S.pic2.fit(T),newframe,nativeformat(),false,false,null); + } + image += "."+nativeformat(); if(!settings.inlinetex) file3.push(image); image=graphic(image,"hiresbb"); @@ -3019,7 +3034,7 @@ object embed(string label="", string text=label, object F; transform T=S.pic2.scaling(xsize,ysize,keepAspect); F.f=pic.fit(scale(S.t[0][0])*T); - add(F.f,S.pic2.fit(T)); + add(F.f,S.pic2.fit()); return F; } } diff --git a/Build/source/utils/asymptote/base/three_arrows.asy b/Build/source/utils/asymptote/base/three_arrows.asy index d81650ec948..8346a5bc6c1 100644 --- a/Build/source/utils/asymptote/base/three_arrows.asy +++ b/Build/source/utils/asymptote/base/three_arrows.asy @@ -25,9 +25,9 @@ transform3 bend(path3 g, real t) triple q=point(g,t); return new real[][] { {u.x,w.x,dir.x,q.x}, - {u.y,w.y,dir.y,q.y}, - {u.z,w.z,dir.z,q.z}, - {0,0,0,1} + {u.y,w.y,dir.y,q.y}, + {u.z,w.z,dir.z,q.z}, + {0,0,0,1} }; } @@ -150,23 +150,25 @@ DefaultHead3.head=new surface(path3 g, position position=EndPoint, bool first=true; for(int i=0; i < n; ++i) { render(subpath(s,i,i+1),new void(path3 q, real) { - real l=arclength(q); - real w=remainL*aspect; - surface segment=scale(w,w,l)*unitcylinder; - if(first) { // add base - first=false; - segment.append(scale(w,w,1)*unitdisk); - } - for(patch p : segment.s) { - for(int i=0; i < 4; ++i) { - for(int j=0; j < 4; ++j) { - real k=1-p.P[i][j].z/remainL; - p.P[i][j]=bend((k*p.P[i][j].x,k*p.P[i][j].y,p.P[i][j].z),q,l); + if(remainL > 0) { + real l=arclength(q); + real w=remainL*aspect; + surface segment=scale(w,w,l)*unitcylinder; + if(first) { // add base + first=false; + segment.append(scale(w,w,1)*unitdisk); + } + for(patch p : segment.s) { + for(int i=0; i < 4; ++i) { + for(int j=0; j < 4; ++j) { + real k=1-p.P[i][j].z/remainL; + p.P[i][j]=bend((k*p.P[i][j].x,k*p.P[i][j].y,p.P[i][j].z),q,l); + } + } } + head.append(segment); + remainL -= l; } - } - head.append(segment); - remainL -= l; }); } } @@ -263,12 +265,12 @@ arrowhead3 DefaultHead2(triple normal=O) { real angle=arrowangle, filltype filltype=null, bool forwards=true, projection P=currentprojection) { - if(size == 0) size=a.size(p); - path h=a.project(g,forwards,P); - a.size=min(size,arclength(h)); - path[] H=a.align(DefaultHead.head(h,p,size,angle),h); - H=forwards ? yscale(-1)*H : H; - return a.surface(g,position,size,H,p,filltype,normal,P); + if(size == 0) size=a.size(p); + path h=a.project(g,forwards,P); + a.size=min(size,arclength(h)); + path[] H=a.align(DefaultHead.head(h,p,size,angle),h); + H=forwards ? yscale(-1)*H : H; + return a.surface(g,position,size,H,p,filltype,normal,P); }; a.gap=1.005; return a; @@ -301,15 +303,15 @@ arrowhead3 TeXHead2(triple normal=O) { pen p=currentpen, real size=0, real angle=arrowangle, filltype filltype=null, bool forwards=true, projection P=currentprojection) { - if(size == 0) size=a.size(p); - path h=a.project(g,forwards,P); - a.size=min(size,arclength(h)); - h=rotate(-degrees(dir(h,length(h)),warn=false))*h; - path[] H=TeXHead.head(h,p,size,angle); - H=forwards ? yscale(-1)*H : H; - return a.surface(g,position,size,H,p, - filltype == null ? TeXHead.defaultfilltype(p) : filltype, - normal,P); + if(size == 0) size=a.size(p); + path h=a.project(g,forwards,P); + a.size=min(size,arclength(h)); + h=rotate(-degrees(dir(h,length(h)),warn=false))*h; + path[] H=TeXHead.head(h,p,size,angle); + H=forwards ? yscale(-1)*H : H; + return a.surface(g,position,size,H,p, + filltype == null ? TeXHead.defaultfilltype(p) : filltype, + normal,P); }; a.arrowhead2=TeXHead; a.size=TeXHead.size; diff --git a/Build/source/utils/asymptote/base/three_surface.asy b/Build/source/utils/asymptote/base/three_surface.asy index 88e42cf6640..7d356e45e22 100644 --- a/Build/source/utils/asymptote/base/three_surface.asy +++ b/Build/source/utils/asymptote/base/three_surface.asy @@ -17,7 +17,7 @@ struct patch { bool3 planar; // Patch is planar. path3 external() { - return + return straight ? P[0][0]--P[3][0]--P[3][3]--P[0][3]--cycle : P[0][0]..controls P[1][0] and P[2][0].. P[3][0]..controls P[3][1] and P[3][2].. P[3][3]..controls P[2][3] and P[1][3].. @@ -93,9 +93,16 @@ struct patch { static real fuzz=1000*realEpsilon; + triple partialu(real u, real v) { + return bezier(BuP(0,u),BuP(1,u),BuP(2,u),BuP(3,u),v); + } + + triple partialv(real u, real v) { + return bezier(BvP(0,v),BvP(1,v),BvP(2,v),BvP(3,v),u); + } + triple normal(real u, real v) { - triple n=cross(bezier(BuP(0,u),BuP(1,u),BuP(2,u),BuP(3,u),v), - bezier(BvP(0,v),BvP(1,v),BvP(2,v),BvP(3,v),u)); + triple n=cross(partialu(u,v),partialv(u,v)); real epsilon=fuzz*change2(P); return (abs(n) > epsilon) ? n : normal0(u,v,epsilon); } @@ -940,59 +947,105 @@ private triple[] split(triple z0, triple c0, triple c1, triple z1, real t=0.5) // produced by a horizontal split of P triple[][][] hsplit(triple[][] P) { - // get control points in rows - triple[] P0=P[0]; - triple[] P1=P[1]; - triple[] P2=P[2]; - triple[] P3=P[3]; - - triple[] c0=split(P0[0],P1[0],P2[0],P3[0]); - triple[] c1=split(P0[1],P1[1],P2[1],P3[1]); - triple[] c2=split(P0[2],P1[2],P2[2],P3[2]); - triple[] c3=split(P0[3],P1[3],P2[3],P3[3]); - // bottom, top - return new triple[][][] { - {{c0[2],c1[2],c2[2],c3[2]}, - {c0[3],c1[3],c2[3],c3[3]}, - {c0[4],c1[4],c2[4],c3[4]}, - {P3[0],P3[1],P3[2],P3[3]}}, - {{P0[0],P0[1],P0[2],P0[3]}, - {c0[0],c1[0],c2[0],c3[0]}, - {c0[1],c1[1],c2[1],c3[1]}, - {c0[2],c1[2],c2[2],c3[2]}} - }; + // get control points in rows + triple[] P0=P[0]; + triple[] P1=P[1]; + triple[] P2=P[2]; + triple[] P3=P[3]; + + triple[] c0=split(P0[0],P0[1],P0[2],P0[3]); + triple[] c1=split(P1[0],P1[1],P1[2],P1[3]); + triple[] c2=split(P2[0],P2[1],P2[2],P2[3]); + triple[] c3=split(P3[0],P3[1],P3[2],P3[3]); + // bottom, top + return new triple[][][] { + {{P0[0],c0[0],c0[1],c0[2]}, + {P1[0],c1[0],c1[1],c1[2]}, + {P2[0],c2[0],c2[1],c2[2]}, + {P3[0],c3[0],c3[1],c3[2]}}, + {{c0[2],c0[3],c0[4],P0[3]}, + {c1[2],c1[3],c1[4],P1[3]}, + {c2[2],c2[3],c2[4],P2[3]}, + {c3[2],c3[3],c3[4],P3[3]}} + }; } // Return the control points of the subpatches // produced by a vertical split of P triple[][][] vsplit(triple[][] P) { - // get control points in rows + // get control points in rows + triple[] P0=P[0]; + triple[] P1=P[1]; + triple[] P2=P[2]; + triple[] P3=P[3]; + + triple[] c0=split(P0[0],P1[0],P2[0],P3[0]); + triple[] c1=split(P0[1],P1[1],P2[1],P3[1]); + triple[] c2=split(P0[2],P1[2],P2[2],P3[2]); + triple[] c3=split(P0[3],P1[3],P2[3],P3[3]); + // left, right + return new triple[][][] { + {{P0[0],P0[1],P0[2],P0[3]}, + {c0[0],c1[0],c2[0],c3[0]}, + {c0[1],c1[1],c2[1],c3[1]}, + {c0[2],c1[2],c2[2],c3[2]}}, + {{c0[2],c1[2],c2[2],c3[2]}, + {c0[3],c1[3],c2[3],c3[3]}, + {c0[4],c1[4],c2[4],c3[4]}, + {P3[0],P3[1],P3[2],P3[3]}} + }; +} + +// Return a 2D array of the control point arrays of the subpatches +// produced by horizontal and vertical splits of P at u and v +triple[][][][] split(triple[][] P, real u=1/2, real v=1/2) +{ triple[] P0=P[0]; triple[] P1=P[1]; triple[] P2=P[2]; triple[] P3=P[3]; - - triple[] c0=split(P0[0],P0[1],P0[2],P0[3]); - triple[] c1=split(P1[0],P1[1],P1[2],P1[3]); - triple[] c2=split(P2[0],P2[1],P2[2],P2[3]); - triple[] c3=split(P3[0],P3[1],P3[2],P3[3]); - // left, right - return new triple[][][] { - {{P0[0],c0[0],c0[1],c0[2]}, - {P1[0],c1[0],c1[1],c1[2]}, - {P2[0],c2[0],c2[1],c2[2]}, - {P3[0],c3[0],c3[1],c3[2]}}, - - {{c0[2],c0[3],c0[4],P0[3]}, - {c1[2],c1[3],c1[4],P1[3]}, - {c2[2],c2[3],c2[4],P2[3]}, - {c3[2],c3[3],c3[4],P3[3]}} - }; + + // slice horizontally + triple[] c0=split(P0[0],P0[1],P0[2],P0[3],v); + triple[] c1=split(P1[0],P1[1],P1[2],P1[3],v); + triple[] c2=split(P2[0],P2[1],P2[2],P2[3],v); + triple[] c3=split(P3[0],P3[1],P3[2],P3[3],v); + + // bottom patch + triple[] c4=split(P0[0],P1[0],P2[0],P3[0],u); + triple[] c5=split(c0[0],c1[0],c2[0],c3[0],u); + triple[] c6=split(c0[1],c1[1],c2[1],c3[1],u); + triple[] c7=split(c0[2],c1[2],c2[2],c3[2],u); + + // top patch + triple[] c8=split(c0[3],c1[3],c2[3],c3[3],u); + triple[] c9=split(c0[4],c1[4],c2[4],c3[4],u); + triple[] cA=split(P0[3],P1[3],P2[3],P3[3],u); + +// {{bottom-left, top-left}, {bottom-right, top-right}} + return new triple[][][][] { + {{{P0[0],c0[0],c0[1],c0[2]}, + {c4[0],c5[0],c6[0],c7[0]}, + {c4[1],c5[1],c6[1],c7[1]}, + {c4[2],c5[2],c6[2],c7[2]}}, + {{c0[2],c0[3],c0[4],P0[3]}, + {c7[0],c8[0],c9[0],cA[0]}, + {c7[1],c8[1],c9[1],cA[1]}, + {c7[2],c8[2],c9[2],cA[2]}}}, + {{{c4[2],c5[2],c6[2],c7[2]}, + {c4[3],c5[3],c6[3],c7[3]}, + {c4[4],c5[4],c6[4],c7[4]}, + {P3[0],c3[0],c3[1],c3[2]}}, + {{c7[2],c8[2],c9[2],cA[2]}, + {c7[3],c8[3],c9[3],cA[3]}, + {c7[4],c8[4],c9[4],cA[4]}, + {c3[2],c3[3],c3[4],P3[3]}}} + }; } // Return the control points for a subpatch of P on [u,1] x [v,1]. -triple[][] subpatchbegin(triple[][] P, real u, real v) +triple[][] subpatchend(triple[][] P, real u, real v) { triple[] P0=P[0]; triple[] P1=P[1]; @@ -1004,21 +1057,20 @@ triple[][] subpatchbegin(triple[][] P, real u, real v) triple[] c2=split(P2[0],P2[1],P2[2],P2[3],v); triple[] c3=split(P3[0],P3[1],P3[2],P3[3],v); - u=1.0-u; - - triple[] c7=split(c3[2],c2[2],c1[2],c0[2],u); - triple[] c8=split(c3[3],c2[3],c1[3],c0[3],u); - triple[] c9=split(c3[4],c2[4],c1[4],c0[4],u); - triple[] c10=split(P3[3],P2[3],P1[3],P0[3],u); - - return new triple[][] {{c7[2],c8[2],c9[2],c10[2]}, - {c7[1],c8[1],c9[1],c10[1]}, - {c7[0],c8[0],c9[0],c10[0]}, + triple[] c7=split(c0[2],c1[2],c2[2],c3[2],u); + triple[] c8=split(c0[3],c1[3],c2[3],c3[3],u); + triple[] c9=split(c0[4],c1[4],c2[4],c3[4],u); + triple[] cA=split(P0[3],P1[3],P2[3],P3[3],u); + + return new triple[][] { + {c7[2],c8[2],c9[2],cA[2]}, + {c7[3],c8[3],c9[3],cA[3]}, + {c7[4],c8[4],c9[4],cA[4]}, {c3[2],c3[3],c3[4],P3[3]}}; } // Return the control points for a subpatch of P on [0,u] x [0,v]. -triple[][] subpatchend(triple[][] P, real u, real v) +triple[][] subpatchbegin(triple[][] P, real u, real v) { triple[] P0=P[0]; triple[] P1=P[1]; @@ -1030,28 +1082,31 @@ triple[][] subpatchend(triple[][] P, real u, real v) triple[] c2=split(P2[0],P2[1],P2[2],P2[3],v); triple[] c3=split(P3[0],P3[1],P3[2],P3[3],v); - u=1.0-u; - - triple[] c4=split(P3[0],P2[0],P1[0],P0[0],u); - triple[] c5=split(c3[0],c2[0],c1[0],c0[0],u); - triple[] c6=split(c3[1],c2[1],c1[1],c0[1],u); - triple[] c7=split(c3[2],c2[2],c1[2],c0[2],u); + triple[] c4=split(P0[0],P1[0],P2[0],P3[0],u); + triple[] c5=split(c0[0],c1[0],c2[0],c3[0],u); + triple[] c6=split(c0[1],c1[1],c2[1],c3[1],u); + triple[] c7=split(c0[2],c1[2],c2[2],c3[2],u); return new triple[][] { {P0[0],c0[0],c0[1],c0[2]}, - {c4[4],c5[4],c6[4],c7[4]}, - {c4[3],c5[3],c6[3],c7[3]}, + {c4[0],c5[0],c6[0],c7[0]}, + {c4[1],c5[1],c6[1],c7[1]}, {c4[2],c5[2],c6[2],c7[2]}}; } +triple[][] subpatch(triple[][] P, pair a, pair b) +{ + return subpatchend(subpatchbegin(P,b.x,b.y),a.x/b.x,a.y/b.y); +} + patch subpatch(patch s, pair a, pair b) { assert(a.x >= 0 && a.y >= 0 && b.x <= 1 && b.y <= 1 && a.x < b.x && a.y < b.y); - return patch(subpatchbegin(subpatchend(s.P,b.x,b.y),a.x/b.x,a.y/b.y), - s.straight,s.planar); + return patch(subpatch(s.P,a,b),s.straight,s.planar); } + // return an array containing all intersection times of path p and patch s. real[][] intersections(path3 p, patch s, real fuzz=-1) { @@ -1216,7 +1271,8 @@ void draw(transform t=identity(), frame f, surface s, int nu=1, int nv=1, light light=currentlight, light meshlight=light, string name="", render render=defaultrender, projection P=currentprojection) { - if(is3D()) { + bool is3D=is3D(); + if(is3D) { begingroup3(f,name == "" ? "surface" : name,render); for(int i=0; i < s.s.length; ++i) draw3D(f,s.s[i],surfacepen[i],light); @@ -1238,7 +1294,8 @@ void draw(transform t=identity(), frame f, surface s, int nu=1, int nv=1, endgroup3(f); } } - } else { + } + if(!is3D || settings.render == 0) { begingroup(f); // Sort patches by mean distance from camera triple camera=P.camera; @@ -1299,11 +1356,10 @@ void draw(picture pic=currentpicture, surface s, int nu=1, int nv=1, surface S=t*s; if(is3D()) draw(f,S,nu,nv,surfacepen,meshpen,light,meshlight,name,render); - else if(pic != null) + if(pic != null) { pic.add(new void(frame f, transform T) { draw(T,f,S,nu,nv,surfacepen,meshpen,light,meshlight,P); },true); - if(pic != null) { pic.addPoint(min(S,P)); pic.addPoint(max(S,P)); } @@ -1941,52 +1997,3 @@ void draw(picture pic=currentpicture, triple[][] P, real[] uknot, real[] vknot, },true); pic.addBox(minbound(P),maxbound(P)); } - -// A structure to subdivide two intersecting patches about their intersection. -struct split -{ - // Container for subpatches of p. - triple[][][] T; - - struct tree { - tree[] tree=new tree[2]; - } - // Default subdivision depth. - int n=23; - - // Subdivide p and q to depth n if they overlap. - void write(tree t, triple[][] p, triple[][] q, int depth=n) { - --depth; - triple[][][] split(triple[][] P)=depth % 2 == 0 ? hsplit : vsplit; - triple[][][] P=split(p); - triple[][][] Q=split(q); - - for(int i=0; i < 2; ++i) { - for(int j=0; j < 2; ++j) { - if(overlap(P[i],Q[j])) { - if(!t.tree.initialized(i)) t.tree[i]=new tree; - if(depth > 0) write(t.tree[i],P[i],Q[j],depth); - } - } - } - } - - // Output the subpatches of p from subdivision. - void read(tree t, triple[][] p, int depth=n) { - --depth; - triple[][][] split(triple[][] P)=depth % 2 == 0 ? hsplit : vsplit; - triple[][][] P=split(p); - - for(int i=0; i < 2; ++i) { - if(t.tree.initialized(i)) - read(t.tree[i],P[i],depth); - else T.push(P[i]); - } - } - - void operator init(triple[][] p, triple[][] q, int depth=n) { - tree trunk; - write(trunk,p,q,depth); - read(trunk,p,depth); - } -} diff --git a/Build/source/utils/asymptote/builtin.cc b/Build/source/utils/asymptote/builtin.cc index b5066061384..acb84eb2bd0 100644 --- a/Build/source/utils/asymptote/builtin.cc +++ b/Build/source/utils/asymptote/builtin.cc @@ -395,6 +395,24 @@ void addCasts(venv &ve) addCast(ve, pairArray2(), realArray2(), array2ToArray2<double,pair>); } +void addTupleOperators(venv &ve) +{ + addFunc(ve, realRealToPair, primPair(), SYM_TUPLE, + formal(primReal(), SYM(x)), + formal(primReal(), SYM(y))); + addFunc(ve, realRealRealToTriple, primTriple(), SYM_TUPLE, + formal(primReal(), SYM(x)), + formal(primReal(), SYM(y)), + formal(primReal(), SYM(z))); + addFunc(ve, real6ToTransform, primTransform(), SYM_TUPLE, + formal(primReal(), SYM(x)), + formal(primReal(), SYM(y)), + formal(primReal(), SYM(xx)), + formal(primReal(), SYM(xy)), + formal(primReal(), SYM(yx)), + formal(primReal(), SYM(yy))); +} + void addGuideOperators(venv &ve) { // The guide operators .. and -- take an array of guides, and turn them @@ -599,35 +617,38 @@ void addArrayOps(venv &ve, types::array *t) // which may not be known at runtime. Therefore, the depth, which is known // here at compile-time, is pushed on the stack beforehand by use of a // thunk. - callable *copyFunc = new thunk(new vm::bfunc(run::copyArray),(Int) depth-1); - addFunc(ve, new callableAccess(copyFunc), + callable *copyValueFunc = new thunk(new vm::bfunc(run::copyArrayValue),(Int) depth-1); + addFunc(ve, new callableAccess(copyValueFunc), t, SYM(array), formal(primInt(), SYM(n)), formal(ct, SYM(value)), formal(primInt(), SYM(depth), true)); + + callable *copyFunc = new thunk(new vm::bfunc(run::copyArray),(Int) depth); + addFunc(ve, new callableAccess(copyFunc), + t, SYM(copy), formal(t, SYM(a)), formal(primInt(), SYM(depth), true)); + addFunc(ve, run::arrayFunction, + t, SYM(map), formal(new function(ct, ct), SYM(f)), formal(t, SYM(a))); + + addFunc(ve, run::arraySequence, + t, SYM(sequence), formal(new function(ct, primInt()), SYM(f)), + formal(primInt(), SYM(n))); + + addFunc(ve, run::arraySort, + t, SYM(sort), formal(t, SYM(a)), + formal(new function(primBoolean(), ct, ct), SYM(less))); + switch (depth) { case 1: - addFunc(ve, run::arrayCopy, t, SYM(copy), formal(t, SYM(a))); addRestFunc(ve, run::arrayConcat, t, SYM(concat), new types::array(t)); - addFunc(ve, run::arraySequence, - t, SYM(sequence), formal(new function(ct, primInt()), SYM(f)), - formal(primInt(), SYM(n))); - addFunc(ve, run::arrayFunction, - t, SYM(map), formal(new function(ct, ct), SYM(f)), - formal(t, SYM(a))); - addFunc(ve, run::arraySort, - t, SYM(sort), formal(t, SYM(a)), - formal(new function(primBoolean(), ct, ct), SYM(less))); addFunc(ve, run::arraySearch, primInt(), SYM(search), formal(t, SYM(a)), formal(ct, SYM(key)), formal(new function(primBoolean(), ct, ct), SYM(less))); break; case 2: - addFunc(ve, run::array2Copy, t, SYM(copy), formal(t, SYM(a))); addFunc(ve, run::array2Transpose, t, SYM(transpose), formal(t, SYM(a))); break; case 3: - addFunc(ve, run::array3Copy, t, SYM(copy), formal(t, SYM(a))); addFunc(ve, run::array3Transpose, t, SYM(transpose), formal(t, SYM(a)), formal(IntArray(),SYM(perm))); break; @@ -789,6 +810,7 @@ void base_venv(venv &ve) addInitializers(ve); addCasts(ve); addOperators(ve); + addTupleOperators(ve); addGuideOperators(ve); addRealFunc(sin,SYM(sin)); diff --git a/Build/source/utils/asymptote/camp.l b/Build/source/utils/asymptote/camp.l index 5eb8d706808..278e4b3baad 100644 --- a/Build/source/utils/asymptote/camp.l +++ b/Build/source/utils/asymptote/camp.l @@ -27,6 +27,8 @@ using mem::string; #include "opsymbols.h" +#define YY_NO_INPUT + static void yyunput(int, char *); void (*unused)(int,char *) = yyunput; @@ -103,6 +105,11 @@ void savesymbol(symbol name) #define DEFSYMBOL(name) \ savesymbol(name) + /* Extra symbols can be added by EXTRASYMBOL */ +#define EXTRASYMBOL(chars, codename) /* blank */ + +EXTRASYMBOL(tuple, SYM_TUPLE); + void makesymbol() { assert(strlen(yytext) == (size_t)yyleng); diff --git a/Build/source/utils/asymptote/camp.tab.cc b/Build/source/utils/asymptote/camp.tab.cc index b274b4fc881..d3bdbcc88fb 100644 --- a/Build/source/utils/asymptote/camp.tab.cc +++ b/Build/source/utils/asymptote/camp.tab.cc @@ -1,9 +1,8 @@ -/* A Bison parser, made by GNU Bison 2.4.3. */ +/* A Bison parser, made by GNU Bison 2.5. */ -/* Skeleton implementation for Bison's Yacc-like parsers in C +/* Bison implementation for Yacc-like parsers in C - Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006, - 2009, 2010 Free Software Foundation, Inc. + Copyright (C) 1984, 1989-1990, 2000-2011 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -45,7 +44,7 @@ #define YYBISON 1 /* Bison version. */ -#define YYBISON_VERSION "2.4.3" +#define YYBISON_VERSION "2.5" /* Skeleton name. */ #define YYSKELETON_NAME "yacc.c" @@ -66,7 +65,7 @@ /* Copy the first part of user declarations. */ -/* Line 189 of yacc.c */ +/* Line 268 of yacc.c */ #line 1 "camp.y" /***** @@ -127,8 +126,8 @@ using sym::symbol; using mem::string; -/* Line 189 of yacc.c */ -#line 132 "camp.tab.c" +/* Line 268 of yacc.c */ +#line 131 "camp.tab.c" /* Enabling traces. */ #ifndef YYDEBUG @@ -220,7 +219,7 @@ using mem::string; typedef union YYSTYPE { -/* Line 214 of yacc.c */ +/* Line 293 of yacc.c */ #line 60 "camp.y" position pos; @@ -270,8 +269,8 @@ typedef union YYSTYPE -/* Line 214 of yacc.c */ -#line 275 "camp.tab.c" +/* Line 293 of yacc.c */ +#line 274 "camp.tab.c" } YYSTYPE; # define YYSTYPE_IS_TRIVIAL 1 # define yystype YYSTYPE /* obsolescent; will be withdrawn */ @@ -282,8 +281,8 @@ typedef union YYSTYPE /* Copy the second part of user declarations. */ -/* Line 264 of yacc.c */ -#line 287 "camp.tab.c" +/* Line 343 of yacc.c */ +#line 286 "camp.tab.c" #ifdef short # undef short @@ -386,11 +385,11 @@ YYID (yyi) # define alloca _alloca # else # define YYSTACK_ALLOC alloca -# if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ +# if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */ -# ifndef _STDLIB_H -# define _STDLIB_H 1 +# ifndef EXIT_SUCCESS +# define EXIT_SUCCESS 0 # endif # endif # endif @@ -413,24 +412,24 @@ YYID (yyi) # ifndef YYSTACK_ALLOC_MAXIMUM # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM # endif -# if (defined __cplusplus && ! defined _STDLIB_H \ +# if (defined __cplusplus && ! defined EXIT_SUCCESS \ && ! ((defined YYMALLOC || defined malloc) \ && (defined YYFREE || defined free))) # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */ -# ifndef _STDLIB_H -# define _STDLIB_H 1 +# ifndef EXIT_SUCCESS +# define EXIT_SUCCESS 0 # endif # endif # ifndef YYMALLOC # define YYMALLOC malloc -# if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ +# if ! defined malloc && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */ # endif # endif # ifndef YYFREE # define YYFREE free -# if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ +# if ! defined free && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) void free (void *); /* INFRINGES ON USER NAME SPACE */ # endif @@ -459,23 +458,7 @@ union yyalloc ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \ + YYSTACK_GAP_MAXIMUM) -/* Copy COUNT objects from FROM to TO. The source and destination do - not overlap. */ -# ifndef YYCOPY -# if defined __GNUC__ && 1 < __GNUC__ -# define YYCOPY(To, From, Count) \ - __builtin_memcpy (To, From, (Count) * sizeof (*(From))) -# else -# define YYCOPY(To, From, Count) \ - do \ - { \ - YYSIZE_T yyi; \ - for (yyi = 0; yyi < (Count); yyi++) \ - (To)[yyi] = (From)[yyi]; \ - } \ - while (YYID (0)) -# endif -# endif +# define YYCOPY_NEEDED 1 /* Relocate STACK from its old location to the new one. The local variables YYSIZE and YYSTACKSIZE give the old and new number of @@ -495,19 +478,39 @@ union yyalloc #endif +#if defined YYCOPY_NEEDED && YYCOPY_NEEDED +/* Copy COUNT objects from FROM to TO. The source and destination do + not overlap. */ +# ifndef YYCOPY +# if defined __GNUC__ && 1 < __GNUC__ +# define YYCOPY(To, From, Count) \ + __builtin_memcpy (To, From, (Count) * sizeof (*(From))) +# else +# define YYCOPY(To, From, Count) \ + do \ + { \ + YYSIZE_T yyi; \ + for (yyi = 0; yyi < (Count); yyi++) \ + (To)[yyi] = (From)[yyi]; \ + } \ + while (YYID (0)) +# endif +# endif +#endif /* !YYCOPY_NEEDED */ + /* YYFINAL -- State number of the termination state. */ #define YYFINAL 3 /* YYLAST -- Last index in YYTABLE. */ -#define YYLAST 2151 +#define YYLAST 1917 /* YYNTOKENS -- Number of terminals. */ #define YYNTOKENS 76 /* YYNNTS -- Number of nonterminals. */ -#define YYNNTS 49 +#define YYNNTS 50 /* YYNRULES -- Number of rules. */ #define YYNRULES 199 /* YYNRULES -- Number of states. */ -#define YYNSTATES 381 +#define YYNSTATES 374 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ #define YYUNDEFTOK 2 @@ -568,16 +571,16 @@ static const yytype_uint16 yyprhs[] = 215, 218, 222, 226, 228, 229, 232, 236, 242, 247, 254, 260, 267, 271, 274, 276, 279, 282, 286, 290, 295, 300, 305, 310, 314, 319, 323, 328, 332, 336, - 338, 340, 344, 346, 349, 353, 357, 359, 361, 363, - 365, 368, 373, 379, 382, 385, 388, 392, 396, 400, + 338, 340, 344, 346, 349, 353, 357, 361, 365, 367, + 369, 371, 373, 376, 381, 387, 390, 393, 396, 400, 404, 408, 412, 416, 420, 424, 428, 432, 436, 440, - 444, 448, 452, 456, 460, 464, 467, 471, 476, 480, - 485, 491, 498, 505, 513, 519, 523, 529, 537, 551, - 555, 558, 561, 564, 567, 571, 576, 578, 580, 583, - 586, 590, 595, 599, 605, 613, 615, 619, 623, 625, - 627, 630, 635, 639, 645, 648, 653, 655, 657, 660, - 666, 674, 680, 688, 698, 707, 710, 713, 716, 720, - 722, 724, 725, 727, 729, 730, 732, 733, 735, 737 + 444, 448, 452, 456, 460, 464, 468, 472, 475, 479, + 484, 488, 493, 499, 506, 513, 521, 527, 531, 535, + 539, 542, 545, 548, 551, 555, 560, 562, 564, 567, + 570, 574, 579, 583, 589, 597, 599, 603, 607, 609, + 611, 614, 619, 623, 629, 632, 637, 639, 641, 644, + 650, 658, 664, 672, 682, 691, 694, 697, 700, 704, + 706, 708, 709, 711, 713, 714, 716, 717, 719, 721 }; /* YYRHS -- A `-1'-separated list of the rules' RHS. */ @@ -585,7 +588,7 @@ static const yytype_int8 yyrhs[] = { 77, 0, -1, 78, -1, -1, 78, 81, -1, -1, 79, 81, -1, 3, -1, 80, 44, 3, -1, 29, - -1, 83, -1, 118, -1, 82, 83, -1, 82, 118, + -1, 83, -1, 119, -1, 82, 83, -1, 82, 119, -1, 73, -1, 72, -1, 82, 73, -1, 82, 72, -1, 89, -1, 106, -1, 107, -1, 50, 88, 48, -1, 54, 80, 51, 85, 48, -1, 54, 80, 51, @@ -597,10 +600,10 @@ static const yytype_int8 yyrhs[] = 3, 3, -1, 87, -1, 88, 45, 87, -1, 90, 48, -1, 91, 95, -1, 92, -1, 80, 93, -1, 80, -1, 46, 47, -1, 93, 46, 47, -1, 46, - 112, 47, -1, 94, 46, 112, 47, -1, 96, -1, + 113, 47, -1, 94, 46, 113, 47, -1, 96, -1, 95, 45, 96, -1, 97, -1, 97, 34, 98, -1, 3, -1, 3, 93, -1, 3, 42, 43, -1, 3, - 42, 103, 43, -1, 112, -1, 100, -1, 40, 79, + 42, 103, 43, -1, 113, -1, 100, -1, 40, 79, 41, -1, 40, 41, -1, 40, 49, 98, 41, -1, 40, 101, 41, -1, 40, 101, 49, 98, 41, -1, 45, -1, 102, -1, 102, 45, -1, 98, -1, 102, @@ -608,56 +611,54 @@ static const yytype_int8 yyrhs[] = 105, -1, 103, 49, 105, -1, 68, -1, -1, 104, 91, -1, 104, 91, 97, -1, 104, 91, 97, 34, 98, -1, 104, 91, 3, 97, -1, 104, 91, 3, - 97, 34, 98, -1, 91, 3, 42, 43, 120, -1, - 91, 3, 42, 103, 43, 120, -1, 56, 3, 99, - -1, 57, 89, -1, 36, -1, 112, 36, -1, 36, - 112, -1, 112, 36, 112, -1, 109, 44, 3, -1, - 80, 46, 112, 47, -1, 109, 46, 112, 47, -1, + 97, 34, 98, -1, 91, 3, 42, 43, 121, -1, + 91, 3, 42, 103, 43, 121, -1, 56, 3, 99, + -1, 57, 89, -1, 36, -1, 113, 36, -1, 36, + 113, -1, 113, 36, 113, -1, 109, 44, 3, -1, + 80, 46, 113, 47, -1, 109, 46, 113, 47, -1, 80, 46, 108, 47, -1, 109, 46, 108, 47, -1, 80, 42, 43, -1, 80, 42, 111, 43, -1, 109, - 42, 43, -1, 109, 42, 111, 43, -1, 42, 112, - 43, -1, 42, 80, 43, -1, 67, -1, 112, -1, - 3, 34, 112, -1, 110, -1, 49, 110, -1, 111, - 45, 110, -1, 111, 49, 110, -1, 80, -1, 109, - -1, 70, -1, 71, -1, 70, 112, -1, 42, 80, - 43, 112, -1, 42, 80, 93, 43, 112, -1, 25, - 112, -1, 26, 112, -1, 31, 112, -1, 112, 25, - 112, -1, 112, 26, 112, -1, 112, 27, 112, -1, - 112, 28, 112, -1, 112, 29, 112, -1, 112, 30, - 112, -1, 112, 20, 112, -1, 112, 21, 112, -1, - 112, 22, 112, -1, 112, 23, 112, -1, 112, 18, - 112, -1, 112, 19, 112, -1, 112, 15, 112, -1, - 112, 14, 112, -1, 112, 24, 112, -1, 112, 17, - 112, -1, 112, 16, 112, -1, 112, 32, 112, -1, - 112, 8, 112, -1, 58, 92, -1, 58, 92, 94, - -1, 58, 92, 94, 93, -1, 58, 92, 93, -1, - 58, 92, 93, 100, -1, 58, 92, 42, 43, 120, - -1, 58, 92, 93, 42, 43, 120, -1, 58, 92, - 42, 103, 43, 120, -1, 58, 92, 93, 42, 103, - 43, 120, -1, 112, 35, 112, 36, 112, -1, 112, - 34, 112, -1, 42, 112, 45, 112, 43, -1, 42, - 112, 45, 112, 45, 112, 43, -1, 42, 112, 45, - 112, 45, 112, 45, 112, 45, 112, 45, 112, 43, - -1, 112, 113, 112, -1, 112, 114, -1, 8, 112, - -1, 7, 112, -1, 112, 8, -1, 112, 4, 112, - -1, 55, 40, 78, 41, -1, 7, -1, 115, -1, - 114, 115, -1, 115, 114, -1, 114, 115, 114, -1, - 40, 13, 112, 41, -1, 40, 112, 41, -1, 40, - 112, 45, 112, 41, -1, 40, 112, 45, 112, 45, - 112, 41, -1, 5, -1, 5, 116, 5, -1, 5, - 117, 5, -1, 6, -1, 9, -1, 11, 112, -1, - 11, 112, 39, 112, -1, 11, 12, 112, -1, 11, - 12, 112, 39, 112, -1, 10, 112, -1, 10, 112, - 39, 112, -1, 48, -1, 120, -1, 119, 48, -1, - 59, 42, 112, 43, 118, -1, 59, 42, 112, 43, - 118, 60, 118, -1, 61, 42, 112, 43, 118, -1, - 62, 118, 61, 42, 112, 43, 48, -1, 63, 42, - 121, 48, 122, 48, 123, 43, 118, -1, 63, 42, - 91, 3, 36, 112, 43, 118, -1, 64, 48, -1, - 65, 48, -1, 66, 48, -1, 66, 112, 48, -1, - 112, -1, 99, -1, -1, 124, -1, 90, -1, -1, - 112, -1, -1, 124, -1, 119, -1, 124, 45, 119, - -1 + 42, 43, -1, 109, 42, 111, 43, -1, 42, 113, + 43, -1, 42, 80, 43, -1, 67, -1, 113, -1, + 3, 34, 113, -1, 110, -1, 49, 110, -1, 111, + 45, 110, -1, 111, 49, 110, -1, 113, 45, 113, + -1, 112, 45, 113, -1, 80, -1, 109, -1, 70, + -1, 71, -1, 70, 113, -1, 42, 80, 43, 113, + -1, 42, 80, 93, 43, 113, -1, 25, 113, -1, + 26, 113, -1, 31, 113, -1, 113, 25, 113, -1, + 113, 26, 113, -1, 113, 27, 113, -1, 113, 28, + 113, -1, 113, 29, 113, -1, 113, 30, 113, -1, + 113, 20, 113, -1, 113, 21, 113, -1, 113, 22, + 113, -1, 113, 23, 113, -1, 113, 18, 113, -1, + 113, 19, 113, -1, 113, 15, 113, -1, 113, 14, + 113, -1, 113, 24, 113, -1, 113, 17, 113, -1, + 113, 16, 113, -1, 113, 32, 113, -1, 113, 8, + 113, -1, 58, 92, -1, 58, 92, 94, -1, 58, + 92, 94, 93, -1, 58, 92, 93, -1, 58, 92, + 93, 100, -1, 58, 92, 42, 43, 121, -1, 58, + 92, 93, 42, 43, 121, -1, 58, 92, 42, 103, + 43, 121, -1, 58, 92, 93, 42, 103, 43, 121, + -1, 113, 35, 113, 36, 113, -1, 113, 34, 113, + -1, 42, 112, 43, -1, 113, 114, 113, -1, 113, + 115, -1, 8, 113, -1, 7, 113, -1, 113, 8, + -1, 113, 4, 113, -1, 55, 40, 78, 41, -1, + 7, -1, 116, -1, 115, 116, -1, 116, 115, -1, + 115, 116, 115, -1, 40, 13, 113, 41, -1, 40, + 113, 41, -1, 40, 113, 45, 113, 41, -1, 40, + 113, 45, 113, 45, 113, 41, -1, 5, -1, 5, + 117, 5, -1, 5, 118, 5, -1, 6, -1, 9, + -1, 11, 113, -1, 11, 113, 39, 113, -1, 11, + 12, 113, -1, 11, 12, 113, 39, 113, -1, 10, + 113, -1, 10, 113, 39, 113, -1, 48, -1, 121, + -1, 120, 48, -1, 59, 42, 113, 43, 119, -1, + 59, 42, 113, 43, 119, 60, 119, -1, 61, 42, + 113, 43, 119, -1, 62, 119, 61, 42, 113, 43, + 48, -1, 63, 42, 122, 48, 123, 48, 124, 43, + 119, -1, 63, 42, 91, 3, 36, 113, 43, 119, + -1, 64, 48, -1, 65, 48, -1, 66, 48, -1, + 66, 113, 48, -1, 113, -1, 99, -1, -1, 125, + -1, 90, -1, -1, 113, -1, -1, 125, -1, 120, + -1, 125, 45, 120, -1 }; /* YYRLINE[YYN] -- source line where rule number YYN was defined. */ @@ -673,11 +674,11 @@ static const yytype_uint16 yyrline[] = 368, 369, 371, 376, 377, 381, 383, 385, 388, 391, 397, 399, 404, 405, 409, 410, 411, 412, 416, 417, 419, 420, 422, 423, 426, 430, 431, 433, 435, 437, - 441, 442, 446, 447, 449, 451, 456, 457, 458, 459, - 461, 462, 464, 466, 468, 470, 471, 472, 473, 474, - 475, 476, 477, 478, 479, 480, 481, 482, 483, 484, - 485, 486, 487, 488, 489, 490, 492, 494, 496, 498, - 500, 502, 507, 509, 514, 516, 518, 520, 522, 524, + 441, 442, 446, 447, 449, 451, 457, 458, 462, 463, + 464, 465, 467, 468, 470, 472, 474, 476, 477, 478, + 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, + 489, 490, 491, 492, 493, 494, 495, 496, 498, 500, + 502, 504, 506, 508, 513, 515, 520, 522, 523, 524, 526, 532, 534, 537, 539, 540, 547, 548, 550, 553, 556, 562, 563, 564, 567, 573, 574, 576, 578, 579, 583, 585, 588, 591, 597, 598, 603, 604, 605, 606, @@ -706,7 +707,7 @@ static const char *const yytname[] = "barevardec", "type", "celltype", "dims", "dimexps", "decidlist", "decid", "decidstart", "varinit", "block", "arrayinit", "basearrayinit", "varinits", "formals", "explicitornot", "formal", "fundec", "typedec", - "slice", "value", "argument", "arglist", "exp", "join", "dir", + "slice", "value", "argument", "arglist", "tuple", "exp", "join", "dir", "basicjoin", "tension", "controls", "stm", "stmexp", "blockstm", "forinit", "fortest", "forupdate", "stmexplist", 0 }; @@ -741,16 +742,16 @@ static const yytype_uint8 yyr1[] = 103, 103, 103, 104, 104, 105, 105, 105, 105, 105, 106, 106, 107, 107, 108, 108, 108, 108, 109, 109, 109, 109, 109, 109, 109, 109, 109, 109, 109, 109, - 110, 110, 111, 111, 111, 111, 112, 112, 112, 112, - 112, 112, 112, 112, 112, 112, 112, 112, 112, 112, - 112, 112, 112, 112, 112, 112, 112, 112, 112, 112, - 112, 112, 112, 112, 112, 112, 112, 112, 112, 112, - 112, 112, 112, 112, 112, 112, 112, 112, 112, 112, - 112, 112, 112, 112, 112, 112, 113, 113, 113, 113, - 113, 114, 114, 114, 114, 115, 115, 115, 115, 115, - 116, 116, 116, 116, 117, 117, 118, 118, 118, 118, - 118, 118, 118, 118, 118, 118, 118, 118, 118, 119, - 120, 121, 121, 121, 122, 122, 123, 123, 124, 124 + 110, 110, 111, 111, 111, 111, 112, 112, 113, 113, + 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, + 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, + 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, + 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, + 113, 113, 113, 113, 113, 113, 114, 114, 114, 114, + 114, 115, 115, 115, 115, 116, 116, 116, 116, 116, + 117, 117, 117, 117, 118, 118, 119, 119, 119, 119, + 119, 119, 119, 119, 119, 119, 119, 119, 119, 120, + 121, 122, 122, 122, 123, 123, 124, 124, 125, 125 }; /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ @@ -766,11 +767,11 @@ static const yytype_uint8 yyr2[] = 2, 3, 3, 1, 0, 2, 3, 5, 4, 6, 5, 6, 3, 2, 1, 2, 2, 3, 3, 4, 4, 4, 4, 3, 4, 3, 4, 3, 3, 1, - 1, 3, 1, 2, 3, 3, 1, 1, 1, 1, - 2, 4, 5, 2, 2, 2, 3, 3, 3, 3, + 1, 3, 1, 2, 3, 3, 3, 3, 1, 1, + 1, 1, 2, 4, 5, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 2, 3, 4, 3, 4, - 5, 6, 6, 7, 5, 3, 5, 7, 13, 3, + 3, 3, 3, 3, 3, 3, 3, 2, 3, 4, + 3, 4, 5, 6, 6, 7, 5, 3, 3, 3, 2, 2, 2, 2, 3, 4, 1, 1, 2, 2, 3, 4, 3, 5, 7, 1, 3, 3, 1, 1, 2, 4, 3, 5, 2, 4, 1, 1, 2, 5, @@ -778,463 +779,432 @@ static const yytype_uint8 yyr2[] = 1, 0, 1, 1, 0, 1, 0, 1, 1, 3 }; -/* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state - STATE-NUM when YYTABLE doesn't specify something else to do. Zero +/* YYDEFACT[STATE-NAME] -- Default reduction number in state STATE-NUM. + Performed when YYTABLE doesn't specify something else to do. Zero means the default is an error. */ static const yytype_uint8 yydefact[] = { 3, 0, 2, 1, 7, 0, 0, 0, 0, 9, 0, 5, 0, 176, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 99, 108, 109, 15, 14, 106, 4, 0, 10, 18, - 0, 0, 42, 190, 19, 20, 107, 189, 11, 0, - 177, 106, 152, 151, 113, 114, 115, 0, 106, 0, - 36, 35, 0, 38, 0, 0, 0, 0, 0, 7, - 0, 0, 3, 0, 44, 83, 0, 44, 135, 0, - 0, 0, 191, 185, 186, 187, 0, 110, 0, 0, - 0, 43, 17, 16, 12, 13, 40, 53, 41, 49, - 51, 0, 0, 0, 0, 165, 168, 156, 153, 169, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 99, 110, 111, 15, 14, 108, 4, 0, 10, 18, + 0, 0, 42, 190, 19, 20, 109, 189, 11, 0, + 177, 108, 152, 151, 115, 116, 117, 0, 108, 0, + 0, 36, 35, 0, 38, 0, 0, 0, 0, 0, + 7, 0, 0, 3, 0, 44, 83, 0, 44, 137, + 0, 0, 0, 191, 185, 186, 187, 0, 112, 0, + 0, 0, 43, 17, 16, 12, 13, 40, 53, 41, + 49, 51, 0, 0, 0, 0, 165, 168, 156, 153, + 169, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 150, 157, 178, 0, 59, 6, 98, 0, - 97, 0, 0, 0, 21, 24, 27, 28, 29, 0, - 0, 0, 82, 0, 53, 74, 0, 138, 136, 0, - 0, 0, 193, 0, 198, 0, 192, 188, 7, 93, - 0, 102, 0, 100, 8, 84, 45, 0, 0, 0, - 74, 54, 0, 0, 95, 0, 88, 0, 0, 154, - 0, 0, 0, 0, 134, 129, 128, 132, 131, 126, - 127, 122, 123, 124, 125, 130, 116, 117, 118, 119, - 120, 121, 133, 145, 0, 0, 0, 149, 158, 159, - 111, 0, 0, 37, 39, 30, 0, 32, 0, 0, - 0, 155, 74, 0, 74, 73, 0, 0, 69, 0, - 0, 74, 139, 0, 137, 0, 0, 0, 53, 194, - 0, 0, 103, 94, 0, 0, 86, 91, 85, 89, - 46, 55, 0, 50, 52, 58, 57, 96, 92, 90, - 174, 0, 170, 166, 167, 0, 0, 162, 0, 160, - 112, 146, 0, 0, 23, 0, 22, 26, 25, 55, - 0, 140, 70, 0, 74, 74, 75, 47, 60, 64, - 0, 67, 0, 65, 0, 0, 0, 179, 181, 0, - 0, 195, 0, 199, 101, 104, 105, 87, 80, 56, - 0, 172, 0, 144, 161, 0, 0, 31, 33, 56, - 142, 71, 72, 53, 76, 0, 62, 0, 66, 141, - 0, 48, 0, 0, 0, 196, 81, 175, 0, 171, - 163, 0, 147, 0, 78, 0, 61, 0, 68, 143, - 180, 182, 0, 0, 197, 173, 0, 0, 0, 77, - 63, 184, 0, 164, 0, 79, 183, 0, 0, 0, - 148 + 0, 0, 0, 150, 157, 178, 0, 59, 6, 98, + 0, 148, 0, 97, 0, 0, 0, 21, 24, 27, + 28, 29, 0, 0, 0, 82, 0, 53, 74, 0, + 140, 138, 0, 0, 0, 193, 0, 198, 0, 192, + 188, 7, 93, 0, 102, 0, 100, 8, 84, 45, + 0, 0, 0, 74, 54, 0, 0, 95, 0, 88, + 0, 0, 154, 0, 0, 0, 0, 136, 131, 130, + 134, 133, 128, 129, 124, 125, 126, 127, 132, 118, + 119, 120, 121, 122, 123, 135, 147, 0, 0, 0, + 149, 158, 159, 113, 0, 107, 106, 37, 39, 30, + 0, 32, 0, 0, 0, 155, 74, 0, 74, 73, + 0, 0, 69, 0, 0, 74, 141, 0, 139, 0, + 0, 0, 53, 194, 0, 0, 103, 94, 0, 0, + 86, 91, 85, 89, 46, 55, 0, 50, 52, 58, + 57, 96, 92, 90, 174, 0, 170, 166, 167, 0, + 0, 162, 0, 160, 114, 0, 23, 0, 22, 26, + 25, 55, 0, 142, 70, 0, 74, 74, 75, 47, + 60, 64, 0, 67, 0, 65, 0, 0, 0, 179, + 181, 0, 0, 195, 0, 199, 101, 104, 105, 87, + 80, 56, 0, 172, 0, 146, 161, 0, 31, 33, + 56, 144, 71, 72, 53, 76, 0, 62, 0, 66, + 143, 0, 48, 0, 0, 0, 196, 81, 175, 0, + 171, 163, 0, 78, 0, 61, 0, 68, 145, 180, + 182, 0, 0, 197, 173, 0, 0, 77, 63, 184, + 0, 164, 79, 183 }; /* YYDEFGOTO[NTERM-NUM]. */ static const yytype_int16 yydefgoto[] = { - -1, 1, 2, 57, 51, 36, 37, 38, 227, 228, - 62, 63, 64, 39, 40, 41, 42, 181, 158, 98, - 99, 100, 264, 43, 265, 302, 303, 236, 237, 238, - 44, 45, 177, 46, 171, 172, 47, 131, 132, 133, - 192, 193, 48, 49, 50, 165, 312, 363, 166 + -1, 1, 2, 57, 51, 36, 37, 38, 231, 232, + 63, 64, 65, 39, 40, 41, 42, 184, 161, 99, + 100, 101, 268, 43, 269, 304, 305, 240, 241, 242, + 44, 45, 180, 46, 174, 175, 59, 47, 132, 133, + 134, 195, 196, 48, 49, 50, 168, 314, 362, 169 }; /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing STATE-NUM. */ -#define YYPACT_NINF -261 +#define YYPACT_NINF -283 static const yytype_int16 yypact[] = { - -261, 13, 488, -261, -261, 927, 927, 927, 927, -261, - 927, -261, 927, -261, 15, 20, 15, 16, 11, 23, - 49, 20, 20, 14, 37, 630, 53, 54, 83, 747, - -261, 101, -261, -261, -261, 18, -261, 559, -261, -261, - 89, 98, -261, -261, -261, -261, 217, 1818, -261, 93, - -261, 264, 127, 127, 127, 127, -261, 346, 239, 1211, - 161, -261, 172, -261, 94, -2, 135, 136, 156, 177, - 40, 179, -261, 191, -3, -261, 203, 204, 108, 927, - 927, 190, 927, -261, -261, -261, 1026, 127, 673, 259, - 229, 221, -261, -261, -261, -261, -261, 222, 227, -261, - 245, 704, 283, 757, 927, 78, -261, -261, 101, -261, - 927, 927, 927, 927, 927, 927, 927, 927, 927, 927, - 927, 927, 927, 927, 927, 927, 927, 927, 927, 927, - 800, 927, -261, 253, -261, 757, -261, -261, 101, 22, - -261, 927, 294, 15, -261, -261, -261, -261, -261, 26, - 32, 417, -261, 254, 246, -10, 831, 106, 256, 1505, - 1545, 261, -261, 306, -261, 270, 277, -261, 289, -261, - 958, -261, 104, 1818, -261, 927, -261, 278, 1063, 279, - 8, 221, 203, 874, -261, 117, -261, 280, 1100, 1818, - 927, 884, 319, 323, 193, 1999, 2027, 2055, 2083, 2111, - 2111, 497, 497, 497, 497, 330, 284, 284, 127, 127, - 127, 127, 426, 1818, 1781, 927, 1253, 193, 253, -261, - -261, 927, 1295, -261, -261, 326, 282, -261, 169, 286, - 195, -261, 12, 191, 263, -261, 124, 20, -261, 1137, - 249, 95, -261, 831, 221, 630, 630, 927, 2, 927, - 927, 927, -261, -261, 958, 958, 1818, -261, 927, -261, - -261, 191, 166, -261, -261, -261, 1818, -261, -261, -261, - 173, 927, 1853, -261, -261, 927, 1705, -261, 927, -261, - -261, -261, 927, 337, -261, 339, -261, -261, -261, -261, - 185, -261, -261, 191, 263, 263, 341, -261, -261, -261, - 874, -261, -4, 300, 191, 196, 1174, 287, -261, 1585, - 927, 1818, 304, -261, 1818, -261, -261, 1818, -261, 191, - 927, 1890, 927, 1963, -261, 1337, 1379, -261, -261, -261, - -261, -261, -261, 24, 327, 321, -261, 874, 874, -261, - 191, -261, 630, 316, 1625, 927, -261, 1927, 927, 1927, - -261, 927, -261, 927, 331, 874, -261, 325, -261, -261, - -261, -261, 630, 324, 277, 1927, 1743, 1421, 874, -261, - -261, -261, 630, -261, 927, -261, -261, 1463, 927, 1665, - -261 + -283, 36, 399, -283, -283, 885, 885, 885, 885, -283, + 885, -283, 885, -283, 14, 17, 14, 16, 8, 23, + 53, 17, 17, 31, 41, 541, 46, 50, 101, 684, + -283, 11, -283, -283, -283, 18, -283, 470, -283, -283, + 111, 162, -283, -283, -283, -283, 237, 1547, -283, 157, + -283, 243, 196, 196, 196, 196, -283, 145, 148, 60, + 1148, 211, -283, 234, -283, 85, 13, 208, 212, 213, + 216, -21, 218, -283, 231, 138, -283, 269, 229, 49, + 885, 885, 217, 885, -283, -283, -283, 963, 196, 233, + 277, 627, 238, -283, -283, -283, -283, -283, 96, 241, + -283, 256, 641, 293, 698, 885, 34, -283, -283, 11, + -283, 885, 885, 885, 885, 885, 885, 885, 885, 885, + 885, 885, 885, 885, 885, 885, 885, 885, 885, 885, + 885, 754, 885, -283, 258, -283, 698, -283, -283, 11, + 126, -283, 885, -283, 885, 296, 14, -283, -283, -283, + -283, -283, 38, 74, 328, -283, 254, 104, -14, 768, + 105, 259, 1274, 1314, 260, -283, 303, -283, 261, 263, + -283, 276, -283, 895, -283, 117, 1547, -283, 885, -283, + 264, 1000, 266, -10, 238, 269, 811, -283, 134, -283, + 267, 1037, 1547, 885, 842, 307, 310, 195, 1765, 1793, + 1821, 1849, 1877, 1877, 408, 408, 408, 408, 548, 265, + 265, 196, 196, 196, 196, 479, 1547, 1510, 885, 1190, + 195, 258, -283, -283, 885, 1547, 1547, -283, -283, 313, + 270, -283, 199, 272, 207, -283, 0, 231, 253, -283, + 184, 17, -283, 1074, 584, 112, -283, 768, 238, 541, + 541, 885, 121, 885, 885, 885, -283, -283, 895, 895, + 1547, -283, 885, -283, -283, 231, 189, -283, -283, -283, + 1547, -283, -283, -283, 1582, 885, 1619, -283, -283, 885, + 1434, -283, 885, -283, -283, 319, -283, 320, -283, -283, + -283, -283, 200, -283, -283, 231, 253, 253, 322, -283, + -283, -283, 811, -283, -1, 281, 231, 220, 1111, 268, + -283, 1354, 885, 1547, 279, -283, 1547, -283, -283, 1547, + -283, 231, 885, 1656, 885, 1729, -283, 1232, -283, -283, + -283, -283, -283, -283, 48, 295, 289, -283, 811, 811, + -283, 231, -283, 541, 284, 1394, 885, -283, 1693, 885, + 1693, -283, 885, 304, 811, -283, 298, -283, -283, -283, + -283, 541, 294, 263, 1693, 1472, 811, -283, -283, -283, + 541, -283, -283, -283 }; /* YYPGOTO[NTERM-NUM]. */ static const yytype_int16 yypgoto[] = { - -261, -261, 296, -261, 10, 317, -261, 342, 91, 228, - 362, -8, -261, 360, 301, -11, 363, -24, -261, -261, - 200, -260, -210, 311, 232, -261, -261, -160, -261, -217, - -261, -261, 288, -261, -161, 291, -5, -261, -118, 258, - -261, -261, -21, -76, -164, -261, -261, -261, 48 + -283, -283, 273, -283, 10, 283, -283, 306, 54, 192, + 330, -6, -283, 329, 275, -13, 333, -20, -283, -283, + 167, -282, -210, 282, 202, -283, -283, -156, -283, -225, + -283, -283, 262, -283, -123, 271, -283, -5, -283, -125, + 227, -283, -283, -19, -79, -163, -283, -283, -283, 19 }; /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If positive, shift that token. If negative, reduce the rule which - number is the opposite. If zero, do what YYDEFACT says. - If YYTABLE_NINF, syntax error. */ + number is the opposite. If YYTABLE_NINF, syntax error. */ #define YYTABLE_NINF -45 static const yytype_int16 yytable[] = { - 52, 53, 54, 55, 81, 56, 164, 59, 66, 252, - 76, 91, 35, 3, 69, 219, 95, 292, 60, 67, - 262, -44, 58, 4, 86, 65, 87, 154, 70, 225, - 301, 74, 77, 233, 139, 225, 334, 336, 310, 234, - 9, 89, 89, 153, 232, 337, 145, 35, 153, 9, - 91, 261, 73, 226, 157, 289, 79, 234, 235, 229, - 88, 234, 89, 72, 90, 221, 232, 35, 179, 291, - 153, 163, 290, 354, 159, 160, 235, 331, 332, 80, - 235, 305, 61, 173, 89, 178, 61, 68, 190, 191, - 335, 149, 35, 315, 316, 82, 173, 318, 188, 189, - 279, 97, 83, 194, 4, 195, 196, 197, 198, 199, - 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, - 210, 211, 212, 213, 214, 216, 217, 357, 358, 330, - 178, 84, 10, 220, 244, 224, 222, 96, 304, 143, - 339, 134, 144, 12, 234, 369, 240, 253, 241, 254, - 155, 239, 179, 255, 156, 346, 19, 126, 375, 22, - 267, 35, 254, 235, -34, 173, 255, 293, 30, 294, - 256, 31, 32, 295, 313, 142, 359, 104, 266, 106, - 107, 108, 109, 146, 147, 270, 272, 110, 111, 112, - 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, - 123, 124, 125, 126, 148, 127, 154, 128, 129, 319, - 276, 294, 320, 130, 285, 295, 280, 286, 121, 122, - 123, 124, 125, 126, 307, 308, 296, -34, 329, 150, - 294, 11, 4, 130, 295, 266, 5, 6, 306, 340, - 285, 294, 309, 288, 311, 295, 314, 74, 89, 173, - 173, 161, 4, 317, 7, 8, 5, 6, 9, 101, - 10, 102, 174, 103, 180, 175, 321, 179, 153, 164, - 323, 12, 182, 325, 7, 8, 176, 326, 9, 183, - 10, 88, 138, 89, 19, 90, 186, 22, 232, 240, - 298, 12, 153, 130, 299, 266, 30, 223, 300, 31, - 32, 176, 243, 247, 19, 344, 88, 22, 89, 248, - 135, 123, 124, 125, 126, 347, 30, 349, 249, 31, - 32, 360, 250, 251, 273, 257, 260, 268, 274, 283, - 284, 235, 266, 266, 287, 105, 106, 107, 108, 109, - 327, 371, 225, 365, 333, 338, 366, 342, 367, 4, - 266, 376, 345, 5, 6, 121, 122, 123, 124, 125, - 126, 355, 356, 266, 361, 368, 370, 372, 151, 377, - 130, 7, 8, 379, 137, 9, 328, 10, 230, 94, - 71, 75, 263, 162, 152, 78, 11, 136, 12, 242, - 218, 187, 185, 364, 13, 0, 14, 15, 16, 17, - 18, 19, 20, 21, 22, 23, 0, 24, 25, 26, - 27, 28, 29, 30, 0, 0, 31, 32, 33, 34, - 4, 0, 0, 0, 5, 6, 0, 0, 0, 0, - 0, 105, 106, 107, 108, 109, 0, 0, 0, 0, - 0, 0, 7, 8, 0, 0, 9, 0, 10, 0, - 120, 121, 122, 123, 124, 125, 126, 11, 231, 12, - 0, 0, 0, 0, 0, 13, 130, 14, 15, 16, - 17, 18, 19, 20, 21, 22, 23, 0, 24, 25, - 26, 27, 28, 29, 30, 0, 0, 31, 32, 33, - 34, 4, 0, 0, 0, 5, 6, 0, 0, 0, - 0, 0, 105, 106, 107, 108, 109, 0, 0, 0, - 0, 0, 0, 7, 8, 0, 0, 9, 0, 10, - 0, 120, 121, 122, 123, 124, 125, 126, 11, 127, - 12, 0, 0, 0, 0, 0, 13, 130, 14, 15, + 52, 53, 54, 55, 167, 56, 82, 60, 77, 222, + 67, 70, 35, 294, 4, 92, 335, 61, 96, 68, + 4, -44, 58, 90, 87, 66, 88, 266, 71, 237, + 152, 75, 78, 265, 303, 238, 3, 9, 140, 238, + 337, 229, 10, 291, 193, 194, 9, 35, 338, 238, + 256, 157, 353, 12, 239, 92, 74, 90, 239, 160, + 89, 148, 90, 73, 91, 230, 19, 35, 239, 22, + 166, 332, 333, 80, 293, 162, 163, 229, 30, 62, + 292, 31, 32, 81, 176, 62, 181, 69, 83, 307, + 236, 158, 336, 35, 156, 159, 283, 176, 84, 191, + 192, 233, 320, 141, 197, 142, 198, 199, 200, 201, + 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, + 212, 213, 214, 215, 216, 217, 219, 220, 356, 357, + 146, 181, 331, 147, 223, 317, 318, 225, 183, 226, + 228, 248, 156, 340, 367, 244, 236, 245, 4, 85, + 156, 182, 5, 6, 243, 306, 372, 312, 347, 97, + 257, 238, 258, 236, 35, 98, 259, 156, 176, 224, + 7, 8, 182, 260, 9, 315, 10, 271, 358, 258, + 239, 270, 90, 259, 156, 11, 137, 12, 274, 276, + 89, 139, 90, 13, 91, 14, 15, 16, 17, 18, + 19, 20, 21, 22, 23, 135, 24, 25, 26, 27, + 28, 29, 30, 280, -34, 31, 32, 33, 34, 284, + 122, 123, 124, 125, 126, 127, 127, 295, 298, 296, + 309, 310, 321, 297, 296, 131, 171, 145, 297, 270, + 5, 6, 308, 330, 287, 296, 311, 288, 313, 297, + 316, 75, 287, 176, 176, 290, 149, 319, 7, 8, + 150, 151, 9, 341, 10, 296, -34, 167, 153, 297, + 323, 11, 157, 90, 325, 12, 172, 327, 164, 102, + 177, 103, 173, 104, 182, 89, 185, 90, 19, 136, + 186, 22, 124, 125, 126, 127, 189, 270, 131, 227, + 30, 179, 251, 31, 32, 247, 252, 345, 254, 253, + 255, 261, 277, 264, 272, 278, 285, 348, 286, 350, + 289, 239, 328, 229, 359, 334, 339, 346, 343, 354, + 355, 4, 360, 270, 270, 5, 6, 370, 366, 368, + 138, 329, 369, 95, 364, 234, 154, 365, 72, 270, + 76, 373, 267, 7, 8, 79, 155, 9, 165, 10, + 221, 270, 246, 0, 0, 363, 190, 0, 11, 235, + 12, 0, 0, 188, 0, 0, 13, 0, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 0, 24, 25, 26, 27, 28, 29, 30, 0, 0, 31, 32, 33, 34, 4, 0, 0, 0, 5, 6, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 106, 107, 108, 109, 110, 0, 0, 0, 0, 0, 0, 7, 8, 0, 0, 9, 0, - 10, 0, 0, 0, 0, 0, 0, 0, 0, 11, - 0, 12, 0, 0, 0, 0, 0, 13, 0, 14, + 10, 0, 121, 122, 123, 124, 125, 126, 127, 11, + 128, 12, 0, 0, 0, 0, 0, 13, 131, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 0, 24, 25, 26, 27, 28, 29, 30, 0, 0, 31, - 32, 92, 93, 4, 0, 0, 0, 5, 6, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 32, 33, 34, 4, 0, 0, 0, 5, 6, 0, + 0, 0, 0, 0, 106, 107, 108, 109, 110, 0, 0, 0, 0, 0, 0, 7, 8, 0, 0, 9, - 0, 10, 0, 0, 0, 0, 0, 0, 0, 0, - 11, 0, 12, 0, 0, 0, 168, 0, 13, 0, - 5, 6, 0, 0, 0, 19, 0, 0, 22, 23, - 0, 24, 25, 26, 27, 28, 29, 30, 7, 8, - 31, 32, 9, 0, 10, 0, 0, 168, 0, 0, - 0, 5, 6, 0, 0, 12, 169, 0, 0, 0, - 0, 0, 170, 0, 0, 0, 0, 0, 19, 7, - 8, 22, 0, 9, 0, 10, 0, 0, 0, 0, - 30, 0, 0, 31, 32, 0, 12, 184, 0, 0, - 4, 0, 0, 170, 5, 6, 0, 0, 0, 19, - 4, 0, 22, 0, 5, 6, 0, 0, 0, 0, - 0, 30, 7, 8, 31, 32, 9, 0, 10, 0, - 0, 0, 7, 8, 0, 0, 9, 0, 10, 12, - 0, 0, 0, 175, 0, 85, 0, 0, 0, 12, - 0, 0, 19, 4, 0, 22, 0, 5, 6, 0, - 0, 0, 19, 215, 30, 22, 0, 31, 32, 0, - 0, 0, 0, 0, 30, 7, 8, 31, 32, 9, - 0, 10, 0, 0, 4, 0, 0, 0, 5, 6, - 0, 0, 12, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 19, 7, 8, 22, 0, - 9, 0, 10, 0, 0, 0, 0, 30, 0, 0, - 31, 32, 0, 12, 0, 0, 0, 4, 176, 0, - 0, 5, 6, 0, 0, 0, 19, 4, 0, 22, - 0, 5, 6, 0, 0, 0, 271, 0, 30, 7, - 8, 31, 32, 9, 0, 10, 0, 0, 0, 7, - 8, 0, 0, 9, 240, 10, 12, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 12, 0, 0, 19, - 4, 0, 22, 0, 5, 6, 0, 0, 0, 19, - 0, 30, 22, 0, 31, 32, 0, 0, 0, 0, + 0, 10, 0, 121, 122, 123, 124, 125, 126, 127, + 11, 0, 12, 0, 0, 0, 0, 0, 13, 131, + 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, + 0, 24, 25, 26, 27, 28, 29, 30, 0, 0, + 31, 32, 93, 94, 4, 0, 0, 0, 5, 6, + 0, 0, 0, 106, 107, 108, 109, 110, 0, 0, + 0, 0, 0, 0, 0, 0, 7, 8, 0, 0, + 9, 0, 10, 122, 123, 124, 125, 126, 127, 0, + 0, 11, 0, 12, 0, 0, 0, 4, 131, 13, + 0, 5, 6, 0, 0, 0, 19, 0, 0, 22, + 23, 0, 24, 25, 26, 27, 28, 29, 30, 7, + 8, 31, 32, 9, 0, 10, 0, 0, 0, 0, + 0, 0, 0, 0, 244, 300, 12, 0, 0, 301, + 4, 0, 0, 302, 5, 6, 0, 0, 0, 19, + 0, 0, 22, 0, 171, 0, 0, 0, 5, 6, 0, 30, 7, 8, 31, 32, 9, 0, 10, 0, - 0, 168, 0, 0, 0, 5, 6, 0, 0, 12, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 19, 7, 8, 22, 0, 9, 0, 10, - 0, 0, 0, 0, 30, 0, 0, 31, 32, 0, - 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 19, 0, 0, 22, 0, 0, 0, - 0, 0, 0, 0, 0, 30, 0, 0, 31, 32, - 104, 105, 106, 107, 108, 109, 0, 0, 0, 0, - 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, - 120, 121, 122, 123, 124, 125, 126, 0, 127, 0, - 128, 129, 0, 0, 0, 0, 130, 104, 105, 106, - 107, 108, 109, 0, 167, 0, 0, 110, 111, 112, + 0, 0, 0, 178, 0, 0, 7, 8, 0, 12, + 9, 0, 10, 0, 179, 0, 0, 0, 0, 0, + 0, 0, 19, 12, 187, 22, 0, 4, 0, 0, + 173, 5, 6, 0, 30, 0, 19, 31, 32, 22, + 0, 4, 0, 0, 0, 5, 6, 0, 30, 7, + 8, 31, 32, 9, 0, 10, 0, 0, 0, 0, + 0, 0, 0, 7, 8, 0, 12, 9, 0, 10, + 0, 0, 86, 0, 178, 0, 0, 0, 0, 19, + 12, 0, 22, 0, 0, 0, 0, 0, 0, 0, + 0, 30, 0, 19, 31, 32, 22, 4, 0, 0, + 0, 5, 6, 0, 0, 30, 0, 218, 31, 32, + 0, 4, 0, 0, 0, 5, 6, 0, 0, 7, + 8, 0, 0, 9, 0, 10, 0, 0, 0, 0, + 0, 0, 0, 7, 8, 0, 12, 9, 0, 10, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, + 12, 0, 22, 0, 4, 179, 0, 0, 5, 6, + 0, 30, 0, 19, 31, 32, 22, 0, 0, 0, + 0, 0, 0, 0, 0, 30, 7, 8, 31, 32, + 9, 0, 10, 0, 0, 4, 0, 0, 0, 5, + 6, 244, 0, 12, 275, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 19, 7, 8, 22, + 0, 9, 0, 10, 0, 0, 0, 0, 30, 0, + 0, 31, 32, 0, 12, 0, 0, 0, 4, 0, + 0, 0, 5, 6, 0, 0, 0, 19, 171, 0, + 22, 0, 5, 6, 0, 0, 0, 0, 0, 30, + 7, 8, 31, 32, 9, 0, 10, 0, 0, 0, + 7, 8, 0, 0, 9, 0, 10, 12, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 12, 0, 0, + 19, 0, 0, 22, 0, 0, 0, 0, 0, 0, + 19, 0, 30, 22, 0, 31, 32, 0, 0, 0, + 0, 0, 30, 0, 0, 31, 32, 105, 106, 107, + 108, 109, 110, 0, 0, 0, 0, 111, 112, 113, + 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, + 124, 125, 126, 127, 0, 128, 0, 129, 130, 0, + 0, 0, 0, 131, 105, 106, 107, 108, 109, 110, + 0, 170, 0, 0, 111, 112, 113, 114, 115, 116, + 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, + 127, 0, 128, 0, 129, 130, 262, 0, 0, 0, + 131, 105, 106, 107, 108, 109, 110, 263, 0, 0, + 0, 111, 112, 113, 114, 115, 116, 117, 118, 119, + 120, 121, 122, 123, 124, 125, 126, 127, 0, 128, + 0, 129, 130, 262, 0, 0, 0, 131, 105, 106, + 107, 108, 109, 110, 273, 0, 0, 0, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, - 123, 124, 125, 126, 0, 127, 0, 128, 129, 258, - 0, 0, 0, 130, 104, 105, 106, 107, 108, 109, - 259, 0, 0, 0, 110, 111, 112, 113, 114, 115, + 123, 124, 125, 126, 127, 0, 128, 0, 129, 130, + 0, 0, 0, 0, 131, 105, 106, 107, 108, 109, + 110, 299, 0, 0, 0, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, - 126, 0, 127, 0, 128, 129, 258, 0, 0, 0, - 130, 104, 105, 106, 107, 108, 109, 269, 0, 0, - 0, 110, 111, 112, 113, 114, 115, 116, 117, 118, - 119, 120, 121, 122, 123, 124, 125, 126, 0, 127, - 0, 128, 129, 0, 0, 0, 0, 130, 104, 105, - 106, 107, 108, 109, 297, 0, 0, 0, 110, 111, - 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, - 122, 123, 124, 125, 126, 0, 127, 0, 128, 129, - 0, 0, 0, 0, 130, 104, 105, 106, 107, 108, - 109, 341, 0, 0, 0, 110, 111, 112, 113, 114, - 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, - 125, 126, 0, 127, 0, 128, 129, 0, 0, 0, - 0, 130, 0, 0, 140, 0, 141, 104, 105, 106, - 107, 108, 109, 0, 0, 0, 0, 110, 111, 112, - 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, - 123, 124, 125, 126, 0, 127, 0, 128, 129, 0, - 0, 0, 0, 130, 277, 0, 0, 0, 278, 104, - 105, 106, 107, 108, 109, 0, 0, 0, 0, 110, - 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, - 121, 122, 123, 124, 125, 126, 0, 127, 0, 128, - 129, 0, 0, 0, 0, 130, 0, 0, 281, 0, - 282, 104, 105, 106, 107, 108, 109, 0, 0, 0, - 0, 110, 111, 112, 113, 114, 115, 116, 117, 118, - 119, 120, 121, 122, 123, 124, 125, 126, 0, 127, - 0, 128, 129, 0, 0, 0, 0, 130, 350, 0, - 0, 0, 351, 104, 105, 106, 107, 108, 109, 0, - 0, 0, 0, 110, 111, 112, 113, 114, 115, 116, + 126, 127, 0, 128, 0, 129, 130, 0, 0, 0, + 0, 131, 105, 106, 107, 108, 109, 110, 342, 0, + 0, 0, 111, 112, 113, 114, 115, 116, 117, 118, + 119, 120, 121, 122, 123, 124, 125, 126, 127, 0, + 128, 0, 129, 130, 0, 0, 0, 0, 131, 0, + 0, 143, 0, 144, 105, 106, 107, 108, 109, 110, + 0, 0, 0, 0, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, - 0, 127, 0, 128, 129, 0, 0, 0, 0, 130, - 0, 0, 352, 0, 353, 104, 105, 106, 107, 108, - 109, 0, 0, 0, 0, 110, 111, 112, 113, 114, + 127, 0, 128, 0, 129, 130, 0, 0, 0, 0, + 131, 281, 0, 0, 0, 282, 105, 106, 107, 108, + 109, 110, 0, 0, 0, 0, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, - 125, 126, 0, 127, 0, 128, 129, 0, 0, 0, - 0, 130, 0, 0, 0, 0, 374, 104, 105, 106, - 107, 108, 109, 0, 0, 0, 0, 110, 111, 112, + 125, 126, 127, 0, 128, 0, 129, 130, 0, 0, + 0, 0, 131, 351, 0, 0, 0, 352, 105, 106, + 107, 108, 109, 110, 0, 0, 0, 0, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, - 123, 124, 125, 126, 0, 127, 0, 128, 129, 0, - 0, 0, 0, 130, 0, 0, 0, 0, 378, 104, - 105, 106, 107, 108, 109, 0, 0, 0, 0, 110, - 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, - 121, 122, 123, 124, 125, 126, 0, 127, 0, 128, - 129, 0, 0, 0, 0, 130, 0, 0, 245, 104, - 105, 106, 107, 108, 109, 0, 0, 0, 0, 110, - 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, - 121, 122, 123, 124, 125, 126, 0, 127, 0, 128, - 129, 0, 0, 0, 0, 130, 0, 0, 246, 104, - 105, 106, 107, 108, 109, 0, 0, 0, 0, 110, - 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, - 121, 122, 123, 124, 125, 126, 0, 127, 0, 128, - 129, 0, 0, 0, 0, 130, 0, 0, 343, 104, - 105, 106, 107, 108, 109, 0, 0, 0, 0, 110, - 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, - 121, 122, 123, 124, 125, 126, 0, 127, 0, 128, - 129, 0, 0, 0, 0, 130, 0, 0, 362, 104, - 105, 106, 107, 108, 109, 0, 0, 0, 0, 110, - 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, - 121, 122, 123, 124, 125, 126, 0, 127, 0, 128, - 129, 0, 0, 0, 0, 130, 0, 0, 380, 104, - 105, 106, 107, 108, 109, 0, 0, 0, 0, 110, - 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, - 121, 122, 123, 124, 125, 126, 0, 127, 0, 128, - 129, 0, 0, 0, 0, 130, 324, 104, 105, 106, - 107, 108, 109, 0, 0, 0, 0, 110, 111, 112, + 123, 124, 125, 126, 127, 0, 128, 0, 129, 130, + 0, 0, 0, 0, 131, 0, 0, 249, 105, 106, + 107, 108, 109, 110, 0, 0, 0, 0, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, - 123, 124, 125, 126, 0, 127, 0, 128, 129, 0, - 0, 0, 0, 130, 373, 104, 105, 106, 107, 108, - 109, 0, 0, 0, 0, 110, 111, 112, 113, 114, - 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, - 125, 126, 0, 127, 0, 128, 129, 275, 0, 0, - 0, 130, 104, 105, 106, 107, 108, 109, 0, 0, - 0, 0, 110, 111, 112, 113, 114, 115, 116, 117, - 118, 119, 120, 121, 122, 123, 124, 125, 126, 0, - 127, 0, 128, 129, 0, 0, 0, 104, 130, 106, - 107, 108, 109, 0, 0, 0, 0, 110, 111, 112, + 123, 124, 125, 126, 127, 0, 128, 0, 129, 130, + 0, 0, 0, 0, 131, 0, 0, 250, 105, 106, + 107, 108, 109, 110, 0, 0, 0, 0, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, - 123, 124, 125, 126, 0, 127, 0, 128, 129, 0, - 0, 0, 322, 130, 104, 0, 106, 107, 108, 109, - 0, 0, 0, 0, 110, 111, 112, 113, 114, 115, - 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, - 126, 0, 127, 0, 128, 129, 0, 0, 0, 348, - 130, 104, 0, 106, 107, 108, 109, 0, 0, 0, - 0, 110, 111, 112, 113, 114, 115, 116, 117, 118, - 119, 120, 121, 122, 123, 124, 125, 126, 0, 127, - 0, 128, 129, 0, 0, 0, 0, 130, 105, 106, - 107, 108, 109, 0, 0, 0, 0, 110, 111, 112, + 123, 124, 125, 126, 127, 0, 128, 0, 129, 130, + 0, 0, 0, 0, 131, 0, 0, 344, 105, 106, + 107, 108, 109, 110, 0, 0, 0, 0, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, - 123, 124, 125, 126, 0, 127, 0, 0, 129, 0, - 0, 0, 0, 130, 105, 106, 107, 108, 109, 0, + 123, 124, 125, 126, 127, 0, 128, 0, 129, 130, + 0, 0, 0, 0, 131, 0, 0, 361, 105, 106, + 107, 108, 109, 110, 0, 0, 0, 0, 111, 112, + 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, + 123, 124, 125, 126, 127, 0, 128, 0, 129, 130, + 0, 0, 0, 0, 131, 326, 105, 106, 107, 108, + 109, 110, 0, 0, 0, 0, 111, 112, 113, 114, + 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, + 125, 126, 127, 0, 128, 0, 129, 130, 0, 0, + 0, 0, 131, 371, 105, 106, 107, 108, 109, 110, 0, 0, 0, 0, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, - 0, 127, 105, 106, 107, 108, 109, 0, 0, 130, - 0, 0, 0, 112, 113, 114, 115, 116, 117, 118, - 119, 120, 121, 122, 123, 124, 125, 126, 0, 127, - 105, 106, 107, 108, 109, 0, 0, 130, 0, 0, - 0, 0, 113, 114, 115, 116, 117, 118, 119, 120, - 121, 122, 123, 124, 125, 126, 0, 127, 105, 106, - 107, 108, 109, 0, 0, 130, 0, 0, 0, 0, - 0, 114, 115, 116, 117, 118, 119, 120, 121, 122, - 123, 124, 125, 126, 0, 127, 105, 106, 107, 108, - 109, 0, 0, 130, 0, 0, 0, 0, 0, 0, - 0, 116, 117, 118, 119, 120, 121, 122, 123, 124, - 125, 126, 0, 127, 0, 0, 0, 0, 0, 0, - 0, 130 + 127, 0, 128, 0, 129, 130, 279, 0, 0, 0, + 131, 105, 106, 107, 108, 109, 110, 0, 0, 0, + 0, 111, 112, 113, 114, 115, 116, 117, 118, 119, + 120, 121, 122, 123, 124, 125, 126, 127, 0, 128, + 0, 129, 130, 0, 0, 0, 105, 131, 107, 108, + 109, 110, 0, 0, 0, 0, 111, 112, 113, 114, + 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, + 125, 126, 127, 0, 128, 0, 129, 130, 0, 0, + 0, 322, 131, 105, 0, 107, 108, 109, 110, 0, + 0, 0, 0, 111, 112, 113, 114, 115, 116, 117, + 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, + 0, 128, 0, 129, 130, 0, 0, 0, 324, 131, + 105, 0, 107, 108, 109, 110, 0, 0, 0, 0, + 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, + 121, 122, 123, 124, 125, 126, 127, 0, 128, 0, + 129, 130, 0, 0, 0, 349, 131, 105, 0, 107, + 108, 109, 110, 0, 0, 0, 0, 111, 112, 113, + 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, + 124, 125, 126, 127, 0, 128, 0, 129, 130, 0, + 0, 0, 0, 131, 106, 107, 108, 109, 110, 0, + 0, 0, 0, 111, 112, 113, 114, 115, 116, 117, + 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, + 0, 128, 0, 0, 130, 0, 0, 0, 0, 131, + 106, 107, 108, 109, 110, 0, 0, 0, 0, 0, + 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, + 122, 123, 124, 125, 126, 127, 0, 128, 106, 107, + 108, 109, 110, 0, 0, 131, 0, 0, 0, 113, + 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, + 124, 125, 126, 127, 0, 128, 106, 107, 108, 109, + 110, 0, 0, 131, 0, 0, 0, 0, 114, 115, + 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, + 126, 127, 0, 128, 106, 107, 108, 109, 110, 0, + 0, 131, 0, 0, 0, 0, 0, 115, 116, 117, + 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, + 0, 128, 106, 107, 108, 109, 110, 0, 0, 131, + 0, 0, 0, 0, 0, 0, 0, 117, 118, 119, + 120, 121, 122, 123, 124, 125, 126, 127, 0, 128, + 0, 0, 0, 0, 0, 0, 0, 131 }; +#define yypact_value_is_default(yystate) \ + ((yystate) == (-283)) + +#define yytable_value_is_error(yytable_value) \ + YYID (0) + static const yytype_int16 yycheck[] = { - 5, 6, 7, 8, 25, 10, 82, 12, 16, 170, - 21, 35, 2, 0, 3, 133, 37, 234, 3, 3, - 180, 3, 12, 3, 29, 15, 31, 3, 18, 3, - 240, 21, 22, 43, 58, 3, 296, 41, 36, 49, - 29, 44, 44, 46, 42, 49, 48, 37, 46, 29, - 74, 43, 3, 27, 78, 43, 42, 49, 68, 27, - 42, 49, 44, 40, 46, 43, 42, 57, 46, 233, - 46, 82, 232, 333, 79, 80, 68, 294, 295, 42, - 68, 241, 71, 88, 44, 90, 71, 71, 10, 11, - 300, 51, 82, 254, 255, 42, 101, 261, 103, 104, - 218, 3, 48, 108, 3, 110, 111, 112, 113, 114, + 5, 6, 7, 8, 83, 10, 25, 12, 21, 134, + 16, 3, 2, 238, 3, 35, 298, 3, 37, 3, + 3, 3, 12, 44, 29, 15, 31, 183, 18, 43, + 51, 21, 22, 43, 244, 49, 0, 29, 58, 49, + 41, 3, 31, 43, 10, 11, 29, 37, 49, 49, + 173, 3, 334, 42, 68, 75, 3, 44, 68, 79, + 42, 48, 44, 40, 46, 27, 55, 57, 68, 58, + 83, 296, 297, 42, 237, 80, 81, 3, 67, 71, + 236, 70, 71, 42, 89, 71, 91, 71, 42, 245, + 42, 42, 302, 83, 46, 46, 221, 102, 48, 104, + 105, 27, 265, 43, 109, 45, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, - 125, 126, 127, 128, 129, 130, 131, 337, 338, 293, - 135, 48, 31, 138, 158, 143, 141, 48, 43, 45, - 304, 48, 48, 42, 49, 355, 40, 43, 42, 45, - 42, 156, 46, 49, 46, 319, 55, 30, 368, 58, - 43, 151, 45, 68, 3, 170, 49, 43, 67, 45, - 175, 70, 71, 49, 250, 3, 340, 4, 183, 6, - 7, 8, 9, 48, 48, 190, 191, 14, 15, 16, - 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, - 27, 28, 29, 30, 48, 32, 3, 34, 35, 43, - 215, 45, 39, 40, 45, 49, 221, 48, 25, 26, - 27, 28, 29, 30, 245, 246, 237, 50, 43, 50, - 45, 40, 3, 40, 49, 240, 7, 8, 243, 43, - 45, 45, 247, 48, 249, 49, 251, 237, 44, 254, - 255, 61, 3, 258, 25, 26, 7, 8, 29, 42, - 31, 44, 3, 46, 42, 36, 271, 46, 46, 345, - 275, 42, 45, 278, 25, 26, 47, 282, 29, 34, - 31, 42, 43, 44, 55, 46, 3, 58, 42, 40, - 41, 42, 46, 40, 45, 300, 67, 3, 49, 70, - 71, 47, 46, 42, 55, 310, 42, 58, 44, 3, - 46, 27, 28, 29, 30, 320, 67, 322, 48, 70, - 71, 342, 45, 34, 5, 47, 47, 47, 5, 3, - 48, 68, 337, 338, 48, 5, 6, 7, 8, 9, - 3, 362, 3, 348, 3, 45, 351, 60, 353, 3, - 355, 372, 48, 7, 8, 25, 26, 27, 28, 29, - 30, 34, 41, 368, 48, 34, 41, 43, 72, 374, - 40, 25, 26, 378, 57, 29, 285, 31, 150, 37, - 18, 21, 182, 82, 73, 22, 40, 41, 42, 157, - 132, 103, 101, 345, 48, -1, 50, 51, 52, 53, - 54, 55, 56, 57, 58, 59, -1, 61, 62, 63, - 64, 65, 66, 67, -1, -1, 70, 71, 72, 73, - 3, -1, -1, -1, 7, 8, -1, -1, -1, -1, - -1, 5, 6, 7, 8, 9, -1, -1, -1, -1, - -1, -1, 25, 26, -1, -1, 29, -1, 31, -1, - 24, 25, 26, 27, 28, 29, 30, 40, 41, 42, - -1, -1, -1, -1, -1, 48, 40, 50, 51, 52, - 53, 54, 55, 56, 57, 58, 59, -1, 61, 62, - 63, 64, 65, 66, 67, -1, -1, 70, 71, 72, - 73, 3, -1, -1, -1, 7, 8, -1, -1, -1, - -1, -1, 5, 6, 7, 8, 9, -1, -1, -1, - -1, -1, -1, 25, 26, -1, -1, 29, -1, 31, - -1, 24, 25, 26, 27, 28, 29, 30, 40, 32, - 42, -1, -1, -1, -1, -1, 48, 40, 50, 51, + 125, 126, 127, 128, 129, 130, 131, 132, 338, 339, + 45, 136, 295, 48, 139, 258, 259, 142, 42, 144, + 146, 161, 46, 306, 354, 40, 42, 42, 3, 48, + 46, 46, 7, 8, 159, 43, 366, 36, 321, 48, + 43, 49, 45, 42, 154, 3, 49, 46, 173, 43, + 25, 26, 46, 178, 29, 254, 31, 43, 341, 45, + 68, 186, 44, 49, 46, 40, 41, 42, 193, 194, + 42, 43, 44, 48, 46, 50, 51, 52, 53, 54, + 55, 56, 57, 58, 59, 48, 61, 62, 63, 64, + 65, 66, 67, 218, 3, 70, 71, 72, 73, 224, + 25, 26, 27, 28, 29, 30, 30, 43, 241, 45, + 249, 250, 43, 49, 45, 40, 3, 3, 49, 244, + 7, 8, 247, 43, 45, 45, 251, 48, 253, 49, + 255, 241, 45, 258, 259, 48, 48, 262, 25, 26, + 48, 48, 29, 43, 31, 45, 50, 346, 50, 49, + 275, 40, 3, 44, 279, 42, 43, 282, 61, 42, + 3, 44, 49, 46, 46, 42, 45, 44, 55, 46, + 34, 58, 27, 28, 29, 30, 3, 302, 40, 3, + 67, 47, 42, 70, 71, 46, 3, 312, 45, 48, + 34, 47, 5, 47, 47, 5, 3, 322, 48, 324, + 48, 68, 3, 3, 343, 3, 45, 48, 60, 34, + 41, 3, 48, 338, 339, 7, 8, 43, 34, 41, + 57, 287, 361, 37, 349, 153, 73, 352, 18, 354, + 21, 370, 185, 25, 26, 22, 74, 29, 83, 31, + 133, 366, 160, -1, -1, 346, 104, -1, 40, 41, + 42, -1, -1, 102, -1, -1, 48, -1, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, -1, 61, 62, 63, 64, 65, 66, 67, -1, -1, 70, 71, 72, 73, 3, -1, -1, -1, 7, 8, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 5, 6, 7, 8, 9, -1, -1, -1, -1, -1, -1, 25, 26, -1, -1, 29, -1, - 31, -1, -1, -1, -1, -1, -1, -1, -1, 40, - -1, 42, -1, -1, -1, -1, -1, 48, -1, 50, + 31, -1, 24, 25, 26, 27, 28, 29, 30, 40, + 32, 42, -1, -1, -1, -1, -1, 48, 40, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, -1, 61, 62, 63, 64, 65, 66, 67, -1, -1, 70, 71, 72, 73, 3, -1, -1, -1, 7, 8, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 5, 6, 7, 8, 9, -1, -1, -1, -1, -1, -1, 25, 26, -1, -1, 29, - -1, 31, -1, -1, -1, -1, -1, -1, -1, -1, - 40, -1, 42, -1, -1, -1, 3, -1, 48, -1, - 7, 8, -1, -1, -1, 55, -1, -1, 58, 59, - -1, 61, 62, 63, 64, 65, 66, 67, 25, 26, - 70, 71, 29, -1, 31, -1, -1, 3, -1, -1, - -1, 7, 8, -1, -1, 42, 43, -1, -1, -1, - -1, -1, 49, -1, -1, -1, -1, -1, 55, 25, - 26, 58, -1, 29, -1, 31, -1, -1, -1, -1, - 67, -1, -1, 70, 71, -1, 42, 43, -1, -1, + -1, 31, -1, 24, 25, 26, 27, 28, 29, 30, + 40, -1, 42, -1, -1, -1, -1, -1, 48, 40, + 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, + -1, 61, 62, 63, 64, 65, 66, 67, -1, -1, + 70, 71, 72, 73, 3, -1, -1, -1, 7, 8, + -1, -1, -1, 5, 6, 7, 8, 9, -1, -1, + -1, -1, -1, -1, -1, -1, 25, 26, -1, -1, + 29, -1, 31, 25, 26, 27, 28, 29, 30, -1, + -1, 40, -1, 42, -1, -1, -1, 3, 40, 48, + -1, 7, 8, -1, -1, -1, 55, -1, -1, 58, + 59, -1, 61, 62, 63, 64, 65, 66, 67, 25, + 26, 70, 71, 29, -1, 31, -1, -1, -1, -1, + -1, -1, -1, -1, 40, 41, 42, -1, -1, 45, 3, -1, -1, 49, 7, 8, -1, -1, -1, 55, - 3, -1, 58, -1, 7, 8, -1, -1, -1, -1, + -1, -1, 58, -1, 3, -1, -1, -1, 7, 8, -1, 67, 25, 26, 70, 71, 29, -1, 31, -1, - -1, -1, 25, 26, -1, -1, 29, -1, 31, 42, - -1, -1, -1, 36, -1, 48, -1, -1, -1, 42, - -1, -1, 55, 3, -1, 58, -1, 7, 8, -1, - -1, -1, 55, 13, 67, 58, -1, 70, 71, -1, - -1, -1, -1, -1, 67, 25, 26, 70, 71, 29, - -1, 31, -1, -1, 3, -1, -1, -1, 7, 8, - -1, -1, 42, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 55, 25, 26, 58, -1, - 29, -1, 31, -1, -1, -1, -1, 67, -1, -1, - 70, 71, -1, 42, -1, -1, -1, 3, 47, -1, - -1, 7, 8, -1, -1, -1, 55, 3, -1, 58, - -1, 7, 8, -1, -1, -1, 12, -1, 67, 25, - 26, 70, 71, 29, -1, 31, -1, -1, -1, 25, - 26, -1, -1, 29, 40, 31, 42, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 42, -1, -1, 55, - 3, -1, 58, -1, 7, 8, -1, -1, -1, 55, - -1, 67, 58, -1, 70, 71, -1, -1, -1, -1, - -1, 67, 25, 26, 70, 71, 29, -1, 31, -1, - -1, 3, -1, -1, -1, 7, 8, -1, -1, 42, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 55, 25, 26, 58, -1, 29, -1, 31, - -1, -1, -1, -1, 67, -1, -1, 70, 71, -1, - 42, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 55, -1, -1, 58, -1, -1, -1, - -1, -1, -1, -1, -1, 67, -1, -1, 70, 71, - 4, 5, 6, 7, 8, 9, -1, -1, -1, -1, - 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, - 24, 25, 26, 27, 28, 29, 30, -1, 32, -1, - 34, 35, -1, -1, -1, -1, 40, 4, 5, 6, - 7, 8, 9, -1, 48, -1, -1, 14, 15, 16, + -1, -1, -1, 36, -1, -1, 25, 26, -1, 42, + 29, -1, 31, -1, 47, -1, -1, -1, -1, -1, + -1, -1, 55, 42, 43, 58, -1, 3, -1, -1, + 49, 7, 8, -1, 67, -1, 55, 70, 71, 58, + -1, 3, -1, -1, -1, 7, 8, -1, 67, 25, + 26, 70, 71, 29, -1, 31, -1, -1, -1, -1, + -1, -1, -1, 25, 26, -1, 42, 29, -1, 31, + -1, -1, 48, -1, 36, -1, -1, -1, -1, 55, + 42, -1, 58, -1, -1, -1, -1, -1, -1, -1, + -1, 67, -1, 55, 70, 71, 58, 3, -1, -1, + -1, 7, 8, -1, -1, 67, -1, 13, 70, 71, + -1, 3, -1, -1, -1, 7, 8, -1, -1, 25, + 26, -1, -1, 29, -1, 31, -1, -1, -1, -1, + -1, -1, -1, 25, 26, -1, 42, 29, -1, 31, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 55, + 42, -1, 58, -1, 3, 47, -1, -1, 7, 8, + -1, 67, -1, 55, 70, 71, 58, -1, -1, -1, + -1, -1, -1, -1, -1, 67, 25, 26, 70, 71, + 29, -1, 31, -1, -1, 3, -1, -1, -1, 7, + 8, 40, -1, 42, 12, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 55, 25, 26, 58, + -1, 29, -1, 31, -1, -1, -1, -1, 67, -1, + -1, 70, 71, -1, 42, -1, -1, -1, 3, -1, + -1, -1, 7, 8, -1, -1, -1, 55, 3, -1, + 58, -1, 7, 8, -1, -1, -1, -1, -1, 67, + 25, 26, 70, 71, 29, -1, 31, -1, -1, -1, + 25, 26, -1, -1, 29, -1, 31, 42, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 42, -1, -1, + 55, -1, -1, 58, -1, -1, -1, -1, -1, -1, + 55, -1, 67, 58, -1, 70, 71, -1, -1, -1, + -1, -1, 67, -1, -1, 70, 71, 4, 5, 6, + 7, 8, 9, -1, -1, -1, -1, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, - 27, 28, 29, 30, -1, 32, -1, 34, 35, 36, + 27, 28, 29, 30, -1, 32, -1, 34, 35, -1, -1, -1, -1, 40, 4, 5, 6, 7, 8, 9, - 47, -1, -1, -1, 14, 15, 16, 17, 18, 19, + -1, 48, -1, -1, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, -1, 32, -1, 34, 35, 36, -1, -1, -1, 40, 4, 5, 6, 7, 8, 9, 47, -1, -1, -1, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, -1, 32, - -1, 34, 35, -1, -1, -1, -1, 40, 4, 5, + -1, 34, 35, 36, -1, -1, -1, 40, 4, 5, 6, 7, 8, 9, 47, -1, -1, -1, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, -1, 32, -1, 34, 35, @@ -1242,97 +1212,83 @@ static const yytype_int16 yycheck[] = 9, 47, -1, -1, -1, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, -1, 32, -1, 34, 35, -1, -1, -1, - -1, 40, -1, -1, 43, -1, 45, 4, 5, 6, - 7, 8, 9, -1, -1, -1, -1, 14, 15, 16, - 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, - 27, 28, 29, 30, -1, 32, -1, 34, 35, -1, - -1, -1, -1, 40, 41, -1, -1, -1, 45, 4, - 5, 6, 7, 8, 9, -1, -1, -1, -1, 14, - 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, - 25, 26, 27, 28, 29, 30, -1, 32, -1, 34, - 35, -1, -1, -1, -1, 40, -1, -1, 43, -1, - 45, 4, 5, 6, 7, 8, 9, -1, -1, -1, + -1, 40, 4, 5, 6, 7, 8, 9, 47, -1, + -1, -1, 14, 15, 16, 17, 18, 19, 20, 21, + 22, 23, 24, 25, 26, 27, 28, 29, 30, -1, + 32, -1, 34, 35, -1, -1, -1, -1, 40, -1, + -1, 43, -1, 45, 4, 5, 6, 7, 8, 9, + -1, -1, -1, -1, 14, 15, 16, 17, 18, 19, + 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, + 30, -1, 32, -1, 34, 35, -1, -1, -1, -1, + 40, 41, -1, -1, -1, 45, 4, 5, 6, 7, + 8, 9, -1, -1, -1, -1, 14, 15, 16, 17, + 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, + 28, 29, 30, -1, 32, -1, 34, 35, -1, -1, + -1, -1, 40, 41, -1, -1, -1, 45, 4, 5, + 6, 7, 8, 9, -1, -1, -1, -1, 14, 15, + 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, + 26, 27, 28, 29, 30, -1, 32, -1, 34, 35, + -1, -1, -1, -1, 40, -1, -1, 43, 4, 5, + 6, 7, 8, 9, -1, -1, -1, -1, 14, 15, + 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, + 26, 27, 28, 29, 30, -1, 32, -1, 34, 35, + -1, -1, -1, -1, 40, -1, -1, 43, 4, 5, + 6, 7, 8, 9, -1, -1, -1, -1, 14, 15, + 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, + 26, 27, 28, 29, 30, -1, 32, -1, 34, 35, + -1, -1, -1, -1, 40, -1, -1, 43, 4, 5, + 6, 7, 8, 9, -1, -1, -1, -1, 14, 15, + 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, + 26, 27, 28, 29, 30, -1, 32, -1, 34, 35, + -1, -1, -1, -1, 40, -1, -1, 43, 4, 5, + 6, 7, 8, 9, -1, -1, -1, -1, 14, 15, + 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, + 26, 27, 28, 29, 30, -1, 32, -1, 34, 35, + -1, -1, -1, -1, 40, 41, 4, 5, 6, 7, + 8, 9, -1, -1, -1, -1, 14, 15, 16, 17, + 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, + 28, 29, 30, -1, 32, -1, 34, 35, -1, -1, + -1, -1, 40, 41, 4, 5, 6, 7, 8, 9, + -1, -1, -1, -1, 14, 15, 16, 17, 18, 19, + 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, + 30, -1, 32, -1, 34, 35, 36, -1, -1, -1, + 40, 4, 5, 6, 7, 8, 9, -1, -1, -1, -1, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, -1, 32, - -1, 34, 35, -1, -1, -1, -1, 40, 41, -1, - -1, -1, 45, 4, 5, 6, 7, 8, 9, -1, + -1, 34, 35, -1, -1, -1, 4, 40, 6, 7, + 8, 9, -1, -1, -1, -1, 14, 15, 16, 17, + 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, + 28, 29, 30, -1, 32, -1, 34, 35, -1, -1, + -1, 39, 40, 4, -1, 6, 7, 8, 9, -1, -1, -1, -1, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, - -1, 32, -1, 34, 35, -1, -1, -1, -1, 40, - -1, -1, 43, -1, 45, 4, 5, 6, 7, 8, - 9, -1, -1, -1, -1, 14, 15, 16, 17, 18, - 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, - 29, 30, -1, 32, -1, 34, 35, -1, -1, -1, - -1, 40, -1, -1, -1, -1, 45, 4, 5, 6, + -1, 32, -1, 34, 35, -1, -1, -1, 39, 40, + 4, -1, 6, 7, 8, 9, -1, -1, -1, -1, + 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, + 24, 25, 26, 27, 28, 29, 30, -1, 32, -1, + 34, 35, -1, -1, -1, 39, 40, 4, -1, 6, 7, 8, 9, -1, -1, -1, -1, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, -1, 32, -1, 34, 35, -1, - -1, -1, -1, 40, -1, -1, -1, -1, 45, 4, - 5, 6, 7, 8, 9, -1, -1, -1, -1, 14, - 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, - 25, 26, 27, 28, 29, 30, -1, 32, -1, 34, - 35, -1, -1, -1, -1, 40, -1, -1, 43, 4, - 5, 6, 7, 8, 9, -1, -1, -1, -1, 14, - 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, - 25, 26, 27, 28, 29, 30, -1, 32, -1, 34, - 35, -1, -1, -1, -1, 40, -1, -1, 43, 4, - 5, 6, 7, 8, 9, -1, -1, -1, -1, 14, - 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, - 25, 26, 27, 28, 29, 30, -1, 32, -1, 34, - 35, -1, -1, -1, -1, 40, -1, -1, 43, 4, - 5, 6, 7, 8, 9, -1, -1, -1, -1, 14, - 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, - 25, 26, 27, 28, 29, 30, -1, 32, -1, 34, - 35, -1, -1, -1, -1, 40, -1, -1, 43, 4, - 5, 6, 7, 8, 9, -1, -1, -1, -1, 14, - 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, - 25, 26, 27, 28, 29, 30, -1, 32, -1, 34, - 35, -1, -1, -1, -1, 40, -1, -1, 43, 4, - 5, 6, 7, 8, 9, -1, -1, -1, -1, 14, + -1, -1, -1, 40, 5, 6, 7, 8, 9, -1, + -1, -1, -1, 14, 15, 16, 17, 18, 19, 20, + 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, + -1, 32, -1, -1, 35, -1, -1, -1, -1, 40, + 5, 6, 7, 8, 9, -1, -1, -1, -1, -1, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, - 25, 26, 27, 28, 29, 30, -1, 32, -1, 34, - 35, -1, -1, -1, -1, 40, 41, 4, 5, 6, - 7, 8, 9, -1, -1, -1, -1, 14, 15, 16, + 25, 26, 27, 28, 29, 30, -1, 32, 5, 6, + 7, 8, 9, -1, -1, 40, -1, -1, -1, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, - 27, 28, 29, 30, -1, 32, -1, 34, 35, -1, - -1, -1, -1, 40, 41, 4, 5, 6, 7, 8, - 9, -1, -1, -1, -1, 14, 15, 16, 17, 18, + 27, 28, 29, 30, -1, 32, 5, 6, 7, 8, + 9, -1, -1, 40, -1, -1, -1, -1, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, - 29, 30, -1, 32, -1, 34, 35, 36, -1, -1, - -1, 40, 4, 5, 6, 7, 8, 9, -1, -1, - -1, -1, 14, 15, 16, 17, 18, 19, 20, 21, - 22, 23, 24, 25, 26, 27, 28, 29, 30, -1, - 32, -1, 34, 35, -1, -1, -1, 4, 40, 6, - 7, 8, 9, -1, -1, -1, -1, 14, 15, 16, - 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, - 27, 28, 29, 30, -1, 32, -1, 34, 35, -1, - -1, -1, 39, 40, 4, -1, 6, 7, 8, 9, - -1, -1, -1, -1, 14, 15, 16, 17, 18, 19, - 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, - 30, -1, 32, -1, 34, 35, -1, -1, -1, 39, - 40, 4, -1, 6, 7, 8, 9, -1, -1, -1, - -1, 14, 15, 16, 17, 18, 19, 20, 21, 22, - 23, 24, 25, 26, 27, 28, 29, 30, -1, 32, - -1, 34, 35, -1, -1, -1, -1, 40, 5, 6, - 7, 8, 9, -1, -1, -1, -1, 14, 15, 16, - 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, - 27, 28, 29, 30, -1, 32, -1, -1, 35, -1, - -1, -1, -1, 40, 5, 6, 7, 8, 9, -1, - -1, -1, -1, -1, 15, 16, 17, 18, 19, 20, + 29, 30, -1, 32, 5, 6, 7, 8, 9, -1, + -1, 40, -1, -1, -1, -1, -1, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, -1, 32, 5, 6, 7, 8, 9, -1, -1, 40, - -1, -1, -1, 16, 17, 18, 19, 20, 21, 22, + -1, -1, -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, -1, 32, - 5, 6, 7, 8, 9, -1, -1, 40, -1, -1, - -1, -1, 17, 18, 19, 20, 21, 22, 23, 24, - 25, 26, 27, 28, 29, 30, -1, 32, 5, 6, - 7, 8, 9, -1, -1, 40, -1, -1, -1, -1, - -1, 18, 19, 20, 21, 22, 23, 24, 25, 26, - 27, 28, 29, 30, -1, 32, 5, 6, 7, 8, - 9, -1, -1, 40, -1, -1, -1, -1, -1, -1, - -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, - 29, 30, -1, 32, -1, -1, -1, -1, -1, -1, - -1, 40 + -1, -1, -1, -1, -1, -1, -1, 40 }; /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing @@ -1343,41 +1299,40 @@ static const yytype_uint8 yystos[] = 31, 40, 42, 48, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 61, 62, 63, 64, 65, 66, 67, 70, 71, 72, 73, 80, 81, 82, 83, 89, - 90, 91, 92, 99, 106, 107, 109, 112, 118, 119, - 120, 80, 112, 112, 112, 112, 112, 79, 80, 112, - 3, 71, 86, 87, 88, 80, 87, 3, 71, 3, - 80, 86, 40, 3, 80, 89, 91, 80, 92, 42, - 42, 118, 42, 48, 48, 48, 112, 112, 42, 44, - 46, 93, 72, 73, 83, 118, 48, 3, 95, 96, - 97, 42, 44, 46, 4, 5, 6, 7, 8, 9, - 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, - 24, 25, 26, 27, 28, 29, 30, 32, 34, 35, - 40, 113, 114, 115, 48, 46, 41, 81, 43, 93, - 43, 45, 3, 45, 48, 48, 48, 48, 48, 51, - 50, 78, 99, 46, 3, 42, 46, 93, 94, 112, - 112, 61, 90, 91, 119, 121, 124, 48, 3, 43, - 49, 110, 111, 112, 3, 36, 47, 108, 112, 46, - 42, 93, 45, 34, 43, 111, 3, 108, 112, 112, - 10, 11, 116, 117, 112, 112, 112, 112, 112, 112, - 112, 112, 112, 112, 112, 112, 112, 112, 112, 112, - 112, 112, 112, 112, 112, 13, 112, 112, 115, 114, - 112, 43, 112, 3, 87, 3, 27, 84, 85, 27, - 85, 41, 42, 43, 49, 68, 103, 104, 105, 112, - 40, 42, 100, 46, 93, 43, 43, 42, 3, 48, - 45, 34, 110, 43, 45, 49, 112, 47, 36, 47, - 47, 43, 103, 96, 98, 100, 112, 43, 47, 47, - 112, 12, 112, 5, 5, 36, 112, 41, 45, 114, - 112, 43, 45, 3, 48, 45, 48, 48, 48, 43, - 103, 120, 105, 43, 45, 49, 91, 47, 41, 45, - 49, 98, 101, 102, 43, 103, 112, 118, 118, 112, - 36, 112, 122, 119, 112, 110, 110, 112, 120, 43, - 39, 112, 39, 112, 41, 112, 112, 3, 84, 43, - 120, 105, 105, 3, 97, 98, 41, 49, 45, 120, - 43, 47, 60, 43, 112, 48, 120, 112, 39, 112, - 41, 45, 43, 45, 97, 34, 41, 98, 98, 120, - 118, 48, 43, 123, 124, 112, 112, 112, 34, 98, - 41, 118, 43, 41, 45, 98, 118, 112, 45, 112, - 43 + 90, 91, 92, 99, 106, 107, 109, 113, 119, 120, + 121, 80, 113, 113, 113, 113, 113, 79, 80, 112, + 113, 3, 71, 86, 87, 88, 80, 87, 3, 71, + 3, 80, 86, 40, 3, 80, 89, 91, 80, 92, + 42, 42, 119, 42, 48, 48, 48, 113, 113, 42, + 44, 46, 93, 72, 73, 83, 119, 48, 3, 95, + 96, 97, 42, 44, 46, 4, 5, 6, 7, 8, + 9, 14, 15, 16, 17, 18, 19, 20, 21, 22, + 23, 24, 25, 26, 27, 28, 29, 30, 32, 34, + 35, 40, 114, 115, 116, 48, 46, 41, 81, 43, + 93, 43, 45, 43, 45, 3, 45, 48, 48, 48, + 48, 48, 51, 50, 78, 99, 46, 3, 42, 46, + 93, 94, 113, 113, 61, 90, 91, 120, 122, 125, + 48, 3, 43, 49, 110, 111, 113, 3, 36, 47, + 108, 113, 46, 42, 93, 45, 34, 43, 111, 3, + 108, 113, 113, 10, 11, 117, 118, 113, 113, 113, + 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, + 113, 113, 113, 113, 113, 113, 113, 113, 13, 113, + 113, 116, 115, 113, 43, 113, 113, 3, 87, 3, + 27, 84, 85, 27, 85, 41, 42, 43, 49, 68, + 103, 104, 105, 113, 40, 42, 100, 46, 93, 43, + 43, 42, 3, 48, 45, 34, 110, 43, 45, 49, + 113, 47, 36, 47, 47, 43, 103, 96, 98, 100, + 113, 43, 47, 47, 113, 12, 113, 5, 5, 36, + 113, 41, 45, 115, 113, 3, 48, 45, 48, 48, + 48, 43, 103, 121, 105, 43, 45, 49, 91, 47, + 41, 45, 49, 98, 101, 102, 43, 103, 113, 119, + 119, 113, 36, 113, 123, 120, 113, 110, 110, 113, + 121, 43, 39, 113, 39, 113, 41, 113, 3, 84, + 43, 121, 105, 105, 3, 97, 98, 41, 49, 45, + 121, 43, 47, 60, 43, 113, 48, 121, 113, 39, + 113, 41, 45, 97, 34, 41, 98, 98, 121, 119, + 48, 43, 124, 125, 113, 113, 34, 98, 41, 119, + 43, 41, 98, 119 }; #define yyerrok (yyerrstatus = 0) @@ -1413,7 +1368,6 @@ do \ { \ yychar = (Token); \ yylval = (Value); \ - yytoken = YYTRANSLATE (yychar); \ YYPOPSTACK (1); \ goto yybackup; \ } \ @@ -1455,19 +1409,10 @@ while (YYID (0)) #endif -/* YY_LOCATION_PRINT -- Print the location on the stream. - This macro was not mandated originally: define only if we know - we won't break user code: when these are the locations we know. */ +/* This macro is provided for backward compatibility. */ #ifndef YY_LOCATION_PRINT -# if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL -# define YY_LOCATION_PRINT(File, Loc) \ - fprintf (File, "%d.%d-%d.%d", \ - (Loc).first_line, (Loc).first_column, \ - (Loc).last_line, (Loc).last_column) -# else -# define YY_LOCATION_PRINT(File, Loc) ((void) 0) -# endif +# define YY_LOCATION_PRINT(File, Loc) ((void) 0) #endif @@ -1659,7 +1604,6 @@ int yydebug; # define YYMAXDEPTH 10000 #endif - #if YYERROR_VERBOSE @@ -1762,115 +1706,142 @@ yytnamerr (char *yyres, const char *yystr) } # endif -/* Copy into YYRESULT an error message about the unexpected token - YYCHAR while in state YYSTATE. Return the number of bytes copied, - including the terminating null byte. If YYRESULT is null, do not - copy anything; just return the number of bytes that would be - copied. As a special case, return 0 if an ordinary "syntax error" - message will do. Return YYSIZE_MAXIMUM if overflow occurs during - size calculation. */ -static YYSIZE_T -yysyntax_error (char *yyresult, int yystate, int yychar) -{ - int yyn = yypact[yystate]; +/* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message + about the unexpected token YYTOKEN for the state stack whose top is + YYSSP. - if (! (YYPACT_NINF < yyn && yyn <= YYLAST)) - return 0; - else + Return 0 if *YYMSG was successfully written. Return 1 if *YYMSG is + not large enough to hold the message. In that case, also set + *YYMSG_ALLOC to the required number of bytes. Return 2 if the + required number of bytes is too large to store. */ +static int +yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg, + yytype_int16 *yyssp, int yytoken) +{ + YYSIZE_T yysize0 = yytnamerr (0, yytname[yytoken]); + YYSIZE_T yysize = yysize0; + YYSIZE_T yysize1; + enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; + /* Internationalized format string. */ + const char *yyformat = 0; + /* Arguments of yyformat. */ + char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; + /* Number of reported tokens (one for the "unexpected", one per + "expected"). */ + int yycount = 0; + + /* There are many possibilities here to consider: + - Assume YYFAIL is not used. It's too flawed to consider. See + <http://lists.gnu.org/archive/html/bison-patches/2009-12/msg00024.html> + for details. YYERROR is fine as it does not invoke this + function. + - If this state is a consistent state with a default action, then + the only way this function was invoked is if the default action + is an error action. In that case, don't check for expected + tokens because there are none. + - The only way there can be no lookahead present (in yychar) is if + this state is a consistent state with a default action. Thus, + detecting the absence of a lookahead is sufficient to determine + that there is no unexpected or expected token to report. In that + case, just report a simple "syntax error". + - Don't assume there isn't a lookahead just because this state is a + consistent state with a default action. There might have been a + previous inconsistent state, consistent state with a non-default + action, or user semantic action that manipulated yychar. + - Of course, the expected token list depends on states to have + correct lookahead information, and it depends on the parser not + to perform extra reductions after fetching a lookahead from the + scanner and before detecting a syntax error. Thus, state merging + (from LALR or IELR) and default reductions corrupt the expected + token list. However, the list is correct for canonical LR with + one exception: it will still contain any token that will not be + accepted due to an error action in a later state. + */ + if (yytoken != YYEMPTY) { - int yytype = YYTRANSLATE (yychar); - YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]); - YYSIZE_T yysize = yysize0; - YYSIZE_T yysize1; - int yysize_overflow = 0; - enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; - char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; - int yyx; - -# if 0 - /* This is so xgettext sees the translatable formats that are - constructed on the fly. */ - YY_("syntax error, unexpected %s"); - YY_("syntax error, unexpected %s, expecting %s"); - YY_("syntax error, unexpected %s, expecting %s or %s"); - YY_("syntax error, unexpected %s, expecting %s or %s or %s"); - YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"); -# endif - char *yyfmt; - char const *yyf; - static char const yyunexpected[] = "syntax error, unexpected %s"; - static char const yyexpecting[] = ", expecting %s"; - static char const yyor[] = " or %s"; - char yyformat[sizeof yyunexpected - + sizeof yyexpecting - 1 - + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2) - * (sizeof yyor - 1))]; - char const *yyprefix = yyexpecting; - - /* Start YYX at -YYN if negative to avoid negative indexes in - YYCHECK. */ - int yyxbegin = yyn < 0 ? -yyn : 0; - - /* Stay within bounds of both yycheck and yytname. */ - int yychecklim = YYLAST - yyn + 1; - int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; - int yycount = 1; - - yyarg[0] = yytname[yytype]; - yyfmt = yystpcpy (yyformat, yyunexpected); - - for (yyx = yyxbegin; yyx < yyxend; ++yyx) - if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR) - { - if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM) - { - yycount = 1; - yysize = yysize0; - yyformat[sizeof yyunexpected - 1] = '\0'; - break; - } - yyarg[yycount++] = yytname[yyx]; - yysize1 = yysize + yytnamerr (0, yytname[yyx]); - yysize_overflow |= (yysize1 < yysize); - yysize = yysize1; - yyfmt = yystpcpy (yyfmt, yyprefix); - yyprefix = yyor; - } + int yyn = yypact[*yyssp]; + yyarg[yycount++] = yytname[yytoken]; + if (!yypact_value_is_default (yyn)) + { + /* Start YYX at -YYN if negative to avoid negative indexes in + YYCHECK. In other words, skip the first -YYN actions for + this state because they are default actions. */ + int yyxbegin = yyn < 0 ? -yyn : 0; + /* Stay within bounds of both yycheck and yytname. */ + int yychecklim = YYLAST - yyn + 1; + int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; + int yyx; + + for (yyx = yyxbegin; yyx < yyxend; ++yyx) + if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR + && !yytable_value_is_error (yytable[yyx + yyn])) + { + if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM) + { + yycount = 1; + yysize = yysize0; + break; + } + yyarg[yycount++] = yytname[yyx]; + yysize1 = yysize + yytnamerr (0, yytname[yyx]); + if (! (yysize <= yysize1 + && yysize1 <= YYSTACK_ALLOC_MAXIMUM)) + return 2; + yysize = yysize1; + } + } + } - yyf = YY_(yyformat); - yysize1 = yysize + yystrlen (yyf); - yysize_overflow |= (yysize1 < yysize); - yysize = yysize1; + switch (yycount) + { +# define YYCASE_(N, S) \ + case N: \ + yyformat = S; \ + break + YYCASE_(0, YY_("syntax error")); + YYCASE_(1, YY_("syntax error, unexpected %s")); + YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s")); + YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s")); + YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s")); + YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s")); +# undef YYCASE_ + } - if (yysize_overflow) - return YYSIZE_MAXIMUM; + yysize1 = yysize + yystrlen (yyformat); + if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM)) + return 2; + yysize = yysize1; - if (yyresult) - { - /* Avoid sprintf, as that infringes on the user's name space. - Don't have undefined behavior even if the translation - produced a string with the wrong number of "%s"s. */ - char *yyp = yyresult; - int yyi = 0; - while ((*yyp = *yyf) != '\0') - { - if (*yyp == '%' && yyf[1] == 's' && yyi < yycount) - { - yyp += yytnamerr (yyp, yyarg[yyi++]); - yyf += 2; - } - else - { - yyp++; - yyf++; - } - } - } - return yysize; + if (*yymsg_alloc < yysize) + { + *yymsg_alloc = 2 * yysize; + if (! (yysize <= *yymsg_alloc + && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM)) + *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM; + return 1; } + + /* Avoid sprintf, as that infringes on the user's name space. + Don't have undefined behavior even if the translation + produced a string with the wrong number of "%s"s. */ + { + char *yyp = *yymsg; + int yyi = 0; + while ((*yyp = *yyformat) != '\0') + if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount) + { + yyp += yytnamerr (yyp, yyarg[yyi++]); + yyformat += 2; + } + else + { + yyp++; + yyformat++; + } + } + return 0; } #endif /* YYERROR_VERBOSE */ - /*-----------------------------------------------. | Release the memory associated to this symbol. | @@ -1903,6 +1874,7 @@ yydestruct (yymsg, yytype, yyvaluep) } } + /* Prevent warnings from -Wmissing-prototypes. */ #ifdef YYPARSE_PARAM #if defined __STDC__ || defined __cplusplus @@ -1929,10 +1901,9 @@ YYSTYPE yylval; int yynerrs; - -/*-------------------------. -| yyparse or yypush_parse. | -`-------------------------*/ +/*----------. +| yyparse. | +`----------*/ #ifdef YYPARSE_PARAM #if (defined __STDC__ || defined __C99__FUNC__ \ @@ -1956,8 +1927,6 @@ yyparse () #endif #endif { - - int yystate; /* Number of tokens to shift before error messages enabled. */ int yyerrstatus; @@ -2112,7 +2081,7 @@ yybackup: /* First try to decide what to do without reference to lookahead token. */ yyn = yypact[yystate]; - if (yyn == YYPACT_NINF) + if (yypact_value_is_default (yyn)) goto yydefault; /* Not known => get a lookahead token if don't already have one. */ @@ -2143,8 +2112,8 @@ yybackup: yyn = yytable[yyn]; if (yyn <= 0) { - if (yyn == 0 || yyn == YYTABLE_NINF) - goto yyerrlab; + if (yytable_value_is_error (yyn)) + goto yyerrlab; yyn = -yyn; goto yyreduce; } @@ -2199,1427 +2168,1438 @@ yyreduce: { case 2: -/* Line 1464 of yacc.c */ +/* Line 1806 of yacc.c */ #line 192 "camp.y" - { absyntax::root = (yyvsp[(1) - (1)].b); ;} + { absyntax::root = (yyvsp[(1) - (1)].b); } break; case 3: -/* Line 1464 of yacc.c */ +/* Line 1806 of yacc.c */ #line 196 "camp.y" - { (yyval.b) = new file(lexerPos(), false); ;} + { (yyval.b) = new file(lexerPos(), false); } break; case 4: -/* Line 1464 of yacc.c */ +/* Line 1806 of yacc.c */ #line 198 "camp.y" - { (yyval.b) = (yyvsp[(1) - (2)].b); (yyval.b)->add((yyvsp[(2) - (2)].run)); ;} + { (yyval.b) = (yyvsp[(1) - (2)].b); (yyval.b)->add((yyvsp[(2) - (2)].run)); } break; case 5: -/* Line 1464 of yacc.c */ +/* Line 1806 of yacc.c */ #line 202 "camp.y" - { (yyval.b) = new block(lexerPos(), true); ;} + { (yyval.b) = new block(lexerPos(), true); } break; case 6: -/* Line 1464 of yacc.c */ +/* Line 1806 of yacc.c */ #line 204 "camp.y" - { (yyval.b) = (yyvsp[(1) - (2)].b); (yyval.b)->add((yyvsp[(2) - (2)].run)); ;} + { (yyval.b) = (yyvsp[(1) - (2)].b); (yyval.b)->add((yyvsp[(2) - (2)].run)); } break; case 7: -/* Line 1464 of yacc.c */ +/* Line 1806 of yacc.c */ #line 208 "camp.y" - { (yyval.n) = new simpleName((yyvsp[(1) - (1)].ps).pos, (yyvsp[(1) - (1)].ps).sym); ;} + { (yyval.n) = new simpleName((yyvsp[(1) - (1)].ps).pos, (yyvsp[(1) - (1)].ps).sym); } break; case 8: -/* Line 1464 of yacc.c */ +/* Line 1806 of yacc.c */ #line 209 "camp.y" - { (yyval.n) = new qualifiedName((yyvsp[(2) - (3)].pos), (yyvsp[(1) - (3)].n), (yyvsp[(3) - (3)].ps).sym); ;} + { (yyval.n) = new qualifiedName((yyvsp[(2) - (3)].pos), (yyvsp[(1) - (3)].n), (yyvsp[(3) - (3)].ps).sym); } break; case 9: -/* Line 1464 of yacc.c */ +/* Line 1806 of yacc.c */ #line 210 "camp.y" { (yyval.n) = new simpleName((yyvsp[(1) - (1)].ps).pos, - symbol::trans("operator answer")); ;} + symbol::trans("operator answer")); } break; case 10: -/* Line 1464 of yacc.c */ +/* Line 1806 of yacc.c */ #line 215 "camp.y" - { (yyval.run) = (yyvsp[(1) - (1)].d); ;} + { (yyval.run) = (yyvsp[(1) - (1)].d); } break; case 11: -/* Line 1464 of yacc.c */ +/* Line 1806 of yacc.c */ #line 216 "camp.y" - { (yyval.run) = (yyvsp[(1) - (1)].s); ;} + { (yyval.run) = (yyvsp[(1) - (1)].s); } break; case 12: -/* Line 1464 of yacc.c */ +/* Line 1806 of yacc.c */ #line 218 "camp.y" - { (yyval.run) = new modifiedRunnable((yyvsp[(1) - (2)].ml)->getPos(), (yyvsp[(1) - (2)].ml), (yyvsp[(2) - (2)].d)); ;} + { (yyval.run) = new modifiedRunnable((yyvsp[(1) - (2)].ml)->getPos(), (yyvsp[(1) - (2)].ml), (yyvsp[(2) - (2)].d)); } break; case 13: -/* Line 1464 of yacc.c */ +/* Line 1806 of yacc.c */ #line 220 "camp.y" - { (yyval.run) = new modifiedRunnable((yyvsp[(1) - (2)].ml)->getPos(), (yyvsp[(1) - (2)].ml), (yyvsp[(2) - (2)].s)); ;} + { (yyval.run) = new modifiedRunnable((yyvsp[(1) - (2)].ml)->getPos(), (yyvsp[(1) - (2)].ml), (yyvsp[(2) - (2)].s)); } break; case 14: -/* Line 1464 of yacc.c */ +/* Line 1806 of yacc.c */ #line 224 "camp.y" - { (yyval.ml) = new modifierList((yyvsp[(1) - (1)].mod).pos); (yyval.ml)->add((yyvsp[(1) - (1)].mod).val); ;} + { (yyval.ml) = new modifierList((yyvsp[(1) - (1)].mod).pos); (yyval.ml)->add((yyvsp[(1) - (1)].mod).val); } break; case 15: -/* Line 1464 of yacc.c */ +/* Line 1806 of yacc.c */ #line 225 "camp.y" - { (yyval.ml) = new modifierList((yyvsp[(1) - (1)].perm).pos); (yyval.ml)->add((yyvsp[(1) - (1)].perm).val); ;} + { (yyval.ml) = new modifierList((yyvsp[(1) - (1)].perm).pos); (yyval.ml)->add((yyvsp[(1) - (1)].perm).val); } break; case 16: -/* Line 1464 of yacc.c */ +/* Line 1806 of yacc.c */ #line 227 "camp.y" - { (yyval.ml) = (yyvsp[(1) - (2)].ml); (yyval.ml)->add((yyvsp[(2) - (2)].mod).val); ;} + { (yyval.ml) = (yyvsp[(1) - (2)].ml); (yyval.ml)->add((yyvsp[(2) - (2)].mod).val); } break; case 17: -/* Line 1464 of yacc.c */ +/* Line 1806 of yacc.c */ #line 229 "camp.y" - { (yyval.ml) = (yyvsp[(1) - (2)].ml); (yyval.ml)->add((yyvsp[(2) - (2)].perm).val); ;} + { (yyval.ml) = (yyvsp[(1) - (2)].ml); (yyval.ml)->add((yyvsp[(2) - (2)].perm).val); } break; case 18: -/* Line 1464 of yacc.c */ +/* Line 1806 of yacc.c */ #line 233 "camp.y" - { (yyval.d) = (yyvsp[(1) - (1)].vd); ;} + { (yyval.d) = (yyvsp[(1) - (1)].vd); } break; case 19: -/* Line 1464 of yacc.c */ +/* Line 1806 of yacc.c */ #line 234 "camp.y" - { (yyval.d) = (yyvsp[(1) - (1)].d); ;} + { (yyval.d) = (yyvsp[(1) - (1)].d); } break; case 20: -/* Line 1464 of yacc.c */ +/* Line 1806 of yacc.c */ #line 235 "camp.y" - { (yyval.d) = (yyvsp[(1) - (1)].d); ;} + { (yyval.d) = (yyvsp[(1) - (1)].d); } break; case 21: -/* Line 1464 of yacc.c */ +/* Line 1806 of yacc.c */ #line 237 "camp.y" - { (yyval.d) = new accessdec((yyvsp[(1) - (3)].pos), (yyvsp[(2) - (3)].ipl)); ;} + { (yyval.d) = new accessdec((yyvsp[(1) - (3)].pos), (yyvsp[(2) - (3)].ipl)); } break; case 22: -/* Line 1464 of yacc.c */ +/* Line 1806 of yacc.c */ #line 239 "camp.y" - { (yyval.d) = new unraveldec((yyvsp[(1) - (5)].pos), (yyvsp[(2) - (5)].n), (yyvsp[(4) - (5)].ipl)); ;} + { (yyval.d) = new unraveldec((yyvsp[(1) - (5)].pos), (yyvsp[(2) - (5)].n), (yyvsp[(4) - (5)].ipl)); } break; case 23: -/* Line 1464 of yacc.c */ +/* Line 1806 of yacc.c */ #line 241 "camp.y" - { (yyval.d) = new unraveldec((yyvsp[(1) - (5)].pos), (yyvsp[(2) - (5)].n), WILDCARD); ;} + { (yyval.d) = new unraveldec((yyvsp[(1) - (5)].pos), (yyvsp[(2) - (5)].n), WILDCARD); } break; case 24: -/* Line 1464 of yacc.c */ +/* Line 1806 of yacc.c */ #line 242 "camp.y" - { (yyval.d) = new unraveldec((yyvsp[(1) - (3)].pos), (yyvsp[(2) - (3)].n), WILDCARD); ;} + { (yyval.d) = new unraveldec((yyvsp[(1) - (3)].pos), (yyvsp[(2) - (3)].n), WILDCARD); } break; case 25: -/* Line 1464 of yacc.c */ +/* Line 1806 of yacc.c */ #line 244 "camp.y" - { (yyval.d) = new fromaccessdec((yyvsp[(1) - (5)].pos), (yyvsp[(2) - (5)].ps).sym, (yyvsp[(4) - (5)].ipl)); ;} + { (yyval.d) = new fromaccessdec((yyvsp[(1) - (5)].pos), (yyvsp[(2) - (5)].ps).sym, (yyvsp[(4) - (5)].ipl)); } break; case 26: -/* Line 1464 of yacc.c */ +/* Line 1806 of yacc.c */ #line 246 "camp.y" - { (yyval.d) = new fromaccessdec((yyvsp[(1) - (5)].pos), (yyvsp[(2) - (5)].ps).sym, WILDCARD); ;} + { (yyval.d) = new fromaccessdec((yyvsp[(1) - (5)].pos), (yyvsp[(2) - (5)].ps).sym, WILDCARD); } break; case 27: -/* Line 1464 of yacc.c */ +/* Line 1806 of yacc.c */ #line 248 "camp.y" - { (yyval.d) = new importdec((yyvsp[(1) - (3)].pos), (yyvsp[(2) - (3)].ip)); ;} + { (yyval.d) = new importdec((yyvsp[(1) - (3)].pos), (yyvsp[(2) - (3)].ip)); } break; case 28: -/* Line 1464 of yacc.c */ +/* Line 1806 of yacc.c */ #line 249 "camp.y" - { (yyval.d) = new includedec((yyvsp[(1) - (3)].pos), (yyvsp[(2) - (3)].ps).sym); ;} + { (yyval.d) = new includedec((yyvsp[(1) - (3)].pos), (yyvsp[(2) - (3)].ps).sym); } break; case 29: -/* Line 1464 of yacc.c */ +/* Line 1806 of yacc.c */ #line 251 "camp.y" - { (yyval.d) = new includedec((yyvsp[(1) - (3)].pos), (yyvsp[(2) - (3)].stre)->getString()); ;} + { (yyval.d) = new includedec((yyvsp[(1) - (3)].pos), (yyvsp[(2) - (3)].stre)->getString()); } break; case 30: -/* Line 1464 of yacc.c */ +/* Line 1806 of yacc.c */ #line 255 "camp.y" - { (yyval.ip) = new idpair((yyvsp[(1) - (1)].ps).pos, (yyvsp[(1) - (1)].ps).sym); ;} + { (yyval.ip) = new idpair((yyvsp[(1) - (1)].ps).pos, (yyvsp[(1) - (1)].ps).sym); } break; case 31: -/* Line 1464 of yacc.c */ +/* Line 1806 of yacc.c */ #line 257 "camp.y" - { (yyval.ip) = new idpair((yyvsp[(1) - (3)].ps).pos, (yyvsp[(1) - (3)].ps).sym, (yyvsp[(2) - (3)].ps).sym , (yyvsp[(3) - (3)].ps).sym); ;} + { (yyval.ip) = new idpair((yyvsp[(1) - (3)].ps).pos, (yyvsp[(1) - (3)].ps).sym, (yyvsp[(2) - (3)].ps).sym , (yyvsp[(3) - (3)].ps).sym); } break; case 32: -/* Line 1464 of yacc.c */ +/* Line 1806 of yacc.c */ #line 261 "camp.y" - { (yyval.ipl) = new idpairlist(); (yyval.ipl)->add((yyvsp[(1) - (1)].ip)); ;} + { (yyval.ipl) = new idpairlist(); (yyval.ipl)->add((yyvsp[(1) - (1)].ip)); } break; case 33: -/* Line 1464 of yacc.c */ +/* Line 1806 of yacc.c */ #line 263 "camp.y" - { (yyval.ipl) = (yyvsp[(1) - (3)].ipl); (yyval.ipl)->add((yyvsp[(3) - (3)].ip)); ;} + { (yyval.ipl) = (yyvsp[(1) - (3)].ipl); (yyval.ipl)->add((yyvsp[(3) - (3)].ip)); } break; case 34: -/* Line 1464 of yacc.c */ +/* Line 1806 of yacc.c */ #line 267 "camp.y" - { (yyval.ps) = (yyvsp[(1) - (1)].ps); ;} + { (yyval.ps) = (yyvsp[(1) - (1)].ps); } break; case 35: -/* Line 1464 of yacc.c */ +/* Line 1806 of yacc.c */ #line 268 "camp.y" { (yyval.ps).pos = (yyvsp[(1) - (1)].stre)->getPos(); - (yyval.ps).sym = symbol::literalTrans((yyvsp[(1) - (1)].stre)->getString()); ;} + (yyval.ps).sym = symbol::literalTrans((yyvsp[(1) - (1)].stre)->getString()); } break; case 36: -/* Line 1464 of yacc.c */ +/* Line 1806 of yacc.c */ #line 273 "camp.y" - { (yyval.ip) = new idpair((yyvsp[(1) - (1)].ps).pos, (yyvsp[(1) - (1)].ps).sym); ;} + { (yyval.ip) = new idpair((yyvsp[(1) - (1)].ps).pos, (yyvsp[(1) - (1)].ps).sym); } break; case 37: -/* Line 1464 of yacc.c */ +/* Line 1806 of yacc.c */ #line 275 "camp.y" - { (yyval.ip) = new idpair((yyvsp[(1) - (3)].ps).pos, (yyvsp[(1) - (3)].ps).sym, (yyvsp[(2) - (3)].ps).sym , (yyvsp[(3) - (3)].ps).sym); ;} + { (yyval.ip) = new idpair((yyvsp[(1) - (3)].ps).pos, (yyvsp[(1) - (3)].ps).sym, (yyvsp[(2) - (3)].ps).sym , (yyvsp[(3) - (3)].ps).sym); } break; case 38: -/* Line 1464 of yacc.c */ +/* Line 1806 of yacc.c */ #line 279 "camp.y" - { (yyval.ipl) = new idpairlist(); (yyval.ipl)->add((yyvsp[(1) - (1)].ip)); ;} + { (yyval.ipl) = new idpairlist(); (yyval.ipl)->add((yyvsp[(1) - (1)].ip)); } break; case 39: -/* Line 1464 of yacc.c */ +/* Line 1806 of yacc.c */ #line 281 "camp.y" - { (yyval.ipl) = (yyvsp[(1) - (3)].ipl); (yyval.ipl)->add((yyvsp[(3) - (3)].ip)); ;} + { (yyval.ipl) = (yyvsp[(1) - (3)].ipl); (yyval.ipl)->add((yyvsp[(3) - (3)].ip)); } break; case 40: -/* Line 1464 of yacc.c */ +/* Line 1806 of yacc.c */ #line 285 "camp.y" - { (yyval.vd) = (yyvsp[(1) - (2)].vd); ;} + { (yyval.vd) = (yyvsp[(1) - (2)].vd); } break; case 41: -/* Line 1464 of yacc.c */ +/* Line 1806 of yacc.c */ #line 289 "camp.y" - { (yyval.vd) = new vardec((yyvsp[(1) - (2)].t)->getPos(), (yyvsp[(1) - (2)].t), (yyvsp[(2) - (2)].dil)); ;} + { (yyval.vd) = new vardec((yyvsp[(1) - (2)].t)->getPos(), (yyvsp[(1) - (2)].t), (yyvsp[(2) - (2)].dil)); } break; case 42: -/* Line 1464 of yacc.c */ +/* Line 1806 of yacc.c */ #line 293 "camp.y" - { (yyval.t) = (yyvsp[(1) - (1)].t); ;} + { (yyval.t) = (yyvsp[(1) - (1)].t); } break; case 43: -/* Line 1464 of yacc.c */ +/* Line 1806 of yacc.c */ #line 294 "camp.y" - { (yyval.t) = new arrayTy((yyvsp[(1) - (2)].n), (yyvsp[(2) - (2)].dim)); ;} + { (yyval.t) = new arrayTy((yyvsp[(1) - (2)].n), (yyvsp[(2) - (2)].dim)); } break; case 44: -/* Line 1464 of yacc.c */ +/* Line 1806 of yacc.c */ #line 298 "camp.y" - { (yyval.t) = new nameTy((yyvsp[(1) - (1)].n)); ;} + { (yyval.t) = new nameTy((yyvsp[(1) - (1)].n)); } break; case 45: -/* Line 1464 of yacc.c */ +/* Line 1806 of yacc.c */ #line 302 "camp.y" - { (yyval.dim) = new dimensions((yyvsp[(1) - (2)].pos)); ;} + { (yyval.dim) = new dimensions((yyvsp[(1) - (2)].pos)); } break; case 46: -/* Line 1464 of yacc.c */ +/* Line 1806 of yacc.c */ #line 303 "camp.y" - { (yyval.dim) = (yyvsp[(1) - (3)].dim); (yyval.dim)->increase(); ;} + { (yyval.dim) = (yyvsp[(1) - (3)].dim); (yyval.dim)->increase(); } break; case 47: -/* Line 1464 of yacc.c */ +/* Line 1806 of yacc.c */ #line 307 "camp.y" - { (yyval.elist) = new explist((yyvsp[(1) - (3)].pos)); (yyval.elist)->add((yyvsp[(2) - (3)].e)); ;} + { (yyval.elist) = new explist((yyvsp[(1) - (3)].pos)); (yyval.elist)->add((yyvsp[(2) - (3)].e)); } break; case 48: -/* Line 1464 of yacc.c */ +/* Line 1806 of yacc.c */ #line 309 "camp.y" - { (yyval.elist) = (yyvsp[(1) - (4)].elist); (yyval.elist)->add((yyvsp[(3) - (4)].e)); ;} + { (yyval.elist) = (yyvsp[(1) - (4)].elist); (yyval.elist)->add((yyvsp[(3) - (4)].e)); } break; case 49: -/* Line 1464 of yacc.c */ +/* Line 1806 of yacc.c */ #line 313 "camp.y" - { (yyval.dil) = new decidlist((yyvsp[(1) - (1)].di)->getPos()); (yyval.dil)->add((yyvsp[(1) - (1)].di)); ;} + { (yyval.dil) = new decidlist((yyvsp[(1) - (1)].di)->getPos()); (yyval.dil)->add((yyvsp[(1) - (1)].di)); } break; case 50: -/* Line 1464 of yacc.c */ +/* Line 1806 of yacc.c */ #line 315 "camp.y" - { (yyval.dil) = (yyvsp[(1) - (3)].dil); (yyval.dil)->add((yyvsp[(3) - (3)].di)); ;} + { (yyval.dil) = (yyvsp[(1) - (3)].dil); (yyval.dil)->add((yyvsp[(3) - (3)].di)); } break; case 51: -/* Line 1464 of yacc.c */ +/* Line 1806 of yacc.c */ #line 319 "camp.y" - { (yyval.di) = new decid((yyvsp[(1) - (1)].dis)->getPos(), (yyvsp[(1) - (1)].dis)); ;} + { (yyval.di) = new decid((yyvsp[(1) - (1)].dis)->getPos(), (yyvsp[(1) - (1)].dis)); } break; case 52: -/* Line 1464 of yacc.c */ +/* Line 1806 of yacc.c */ #line 321 "camp.y" - { (yyval.di) = new decid((yyvsp[(1) - (3)].dis)->getPos(), (yyvsp[(1) - (3)].dis), (yyvsp[(3) - (3)].vi)); ;} + { (yyval.di) = new decid((yyvsp[(1) - (3)].dis)->getPos(), (yyvsp[(1) - (3)].dis), (yyvsp[(3) - (3)].vi)); } break; case 53: -/* Line 1464 of yacc.c */ +/* Line 1806 of yacc.c */ #line 325 "camp.y" - { (yyval.dis) = new decidstart((yyvsp[(1) - (1)].ps).pos, (yyvsp[(1) - (1)].ps).sym); ;} + { (yyval.dis) = new decidstart((yyvsp[(1) - (1)].ps).pos, (yyvsp[(1) - (1)].ps).sym); } break; case 54: -/* Line 1464 of yacc.c */ +/* Line 1806 of yacc.c */ #line 326 "camp.y" - { (yyval.dis) = new decidstart((yyvsp[(1) - (2)].ps).pos, (yyvsp[(1) - (2)].ps).sym, (yyvsp[(2) - (2)].dim)); ;} + { (yyval.dis) = new decidstart((yyvsp[(1) - (2)].ps).pos, (yyvsp[(1) - (2)].ps).sym, (yyvsp[(2) - (2)].dim)); } break; case 55: -/* Line 1464 of yacc.c */ +/* Line 1806 of yacc.c */ #line 327 "camp.y" { (yyval.dis) = new fundecidstart((yyvsp[(1) - (3)].ps).pos, (yyvsp[(1) - (3)].ps).sym, 0, - new formals((yyvsp[(2) - (3)].pos))); ;} + new formals((yyvsp[(2) - (3)].pos))); } break; case 56: -/* Line 1464 of yacc.c */ +/* Line 1806 of yacc.c */ #line 330 "camp.y" - { (yyval.dis) = new fundecidstart((yyvsp[(1) - (4)].ps).pos, (yyvsp[(1) - (4)].ps).sym, 0, (yyvsp[(3) - (4)].fls)); ;} + { (yyval.dis) = new fundecidstart((yyvsp[(1) - (4)].ps).pos, (yyvsp[(1) - (4)].ps).sym, 0, (yyvsp[(3) - (4)].fls)); } break; case 57: -/* Line 1464 of yacc.c */ +/* Line 1806 of yacc.c */ #line 334 "camp.y" - { (yyval.vi) = (yyvsp[(1) - (1)].e); ;} + { (yyval.vi) = (yyvsp[(1) - (1)].e); } break; case 58: -/* Line 1464 of yacc.c */ +/* Line 1806 of yacc.c */ #line 335 "camp.y" - { (yyval.vi) = (yyvsp[(1) - (1)].ai); ;} + { (yyval.vi) = (yyvsp[(1) - (1)].ai); } break; case 59: -/* Line 1464 of yacc.c */ +/* Line 1806 of yacc.c */ #line 340 "camp.y" - { (yyval.b) = (yyvsp[(2) - (3)].b); ;} + { (yyval.b) = (yyvsp[(2) - (3)].b); } break; case 60: -/* Line 1464 of yacc.c */ +/* Line 1806 of yacc.c */ #line 344 "camp.y" - { (yyval.ai) = new arrayinit((yyvsp[(1) - (2)].pos)); ;} + { (yyval.ai) = new arrayinit((yyvsp[(1) - (2)].pos)); } break; case 61: -/* Line 1464 of yacc.c */ +/* Line 1806 of yacc.c */ #line 346 "camp.y" - { (yyval.ai) = new arrayinit((yyvsp[(1) - (4)].pos)); (yyval.ai)->addRest((yyvsp[(3) - (4)].vi)); ;} + { (yyval.ai) = new arrayinit((yyvsp[(1) - (4)].pos)); (yyval.ai)->addRest((yyvsp[(3) - (4)].vi)); } break; case 62: -/* Line 1464 of yacc.c */ +/* Line 1806 of yacc.c */ #line 348 "camp.y" - { (yyval.ai) = (yyvsp[(2) - (3)].ai); ;} + { (yyval.ai) = (yyvsp[(2) - (3)].ai); } break; case 63: -/* Line 1464 of yacc.c */ +/* Line 1806 of yacc.c */ #line 350 "camp.y" - { (yyval.ai) = (yyvsp[(2) - (5)].ai); (yyval.ai)->addRest((yyvsp[(4) - (5)].vi)); ;} + { (yyval.ai) = (yyvsp[(2) - (5)].ai); (yyval.ai)->addRest((yyvsp[(4) - (5)].vi)); } break; case 64: -/* Line 1464 of yacc.c */ +/* Line 1806 of yacc.c */ #line 354 "camp.y" - { (yyval.ai) = new arrayinit((yyvsp[(1) - (1)].pos)); ;} + { (yyval.ai) = new arrayinit((yyvsp[(1) - (1)].pos)); } break; case 65: -/* Line 1464 of yacc.c */ +/* Line 1806 of yacc.c */ #line 355 "camp.y" - { (yyval.ai) = (yyvsp[(1) - (1)].ai); ;} + { (yyval.ai) = (yyvsp[(1) - (1)].ai); } break; case 66: -/* Line 1464 of yacc.c */ +/* Line 1806 of yacc.c */ #line 356 "camp.y" - { (yyval.ai) = (yyvsp[(1) - (2)].ai); ;} + { (yyval.ai) = (yyvsp[(1) - (2)].ai); } break; case 67: -/* Line 1464 of yacc.c */ +/* Line 1806 of yacc.c */ #line 360 "camp.y" { (yyval.ai) = new arrayinit((yyvsp[(1) - (1)].vi)->getPos()); - (yyval.ai)->add((yyvsp[(1) - (1)].vi));;} + (yyval.ai)->add((yyvsp[(1) - (1)].vi));} break; case 68: -/* Line 1464 of yacc.c */ +/* Line 1806 of yacc.c */ #line 363 "camp.y" - { (yyval.ai) = (yyvsp[(1) - (3)].ai); (yyval.ai)->add((yyvsp[(3) - (3)].vi)); ;} + { (yyval.ai) = (yyvsp[(1) - (3)].ai); (yyval.ai)->add((yyvsp[(3) - (3)].vi)); } break; case 69: -/* Line 1464 of yacc.c */ +/* Line 1806 of yacc.c */ #line 367 "camp.y" - { (yyval.fls) = new formals((yyvsp[(1) - (1)].fl)->getPos()); (yyval.fls)->add((yyvsp[(1) - (1)].fl)); ;} + { (yyval.fls) = new formals((yyvsp[(1) - (1)].fl)->getPos()); (yyval.fls)->add((yyvsp[(1) - (1)].fl)); } break; case 70: -/* Line 1464 of yacc.c */ +/* Line 1806 of yacc.c */ #line 368 "camp.y" - { (yyval.fls) = new formals((yyvsp[(1) - (2)].pos)); (yyval.fls)->addRest((yyvsp[(2) - (2)].fl)); ;} + { (yyval.fls) = new formals((yyvsp[(1) - (2)].pos)); (yyval.fls)->addRest((yyvsp[(2) - (2)].fl)); } break; case 71: -/* Line 1464 of yacc.c */ +/* Line 1806 of yacc.c */ #line 370 "camp.y" - { (yyval.fls) = (yyvsp[(1) - (3)].fls); (yyval.fls)->add((yyvsp[(3) - (3)].fl)); ;} + { (yyval.fls) = (yyvsp[(1) - (3)].fls); (yyval.fls)->add((yyvsp[(3) - (3)].fl)); } break; case 72: -/* Line 1464 of yacc.c */ +/* Line 1806 of yacc.c */ #line 372 "camp.y" - { (yyval.fls) = (yyvsp[(1) - (3)].fls); (yyval.fls)->addRest((yyvsp[(3) - (3)].fl)); ;} + { (yyval.fls) = (yyvsp[(1) - (3)].fls); (yyval.fls)->addRest((yyvsp[(3) - (3)].fl)); } break; case 73: -/* Line 1464 of yacc.c */ +/* Line 1806 of yacc.c */ #line 376 "camp.y" - { (yyval.boo) = true; ;} + { (yyval.boo) = true; } break; case 74: -/* Line 1464 of yacc.c */ +/* Line 1806 of yacc.c */ #line 377 "camp.y" - { (yyval.boo) = false; ;} + { (yyval.boo) = false; } break; case 75: -/* Line 1464 of yacc.c */ +/* Line 1806 of yacc.c */ #line 382 "camp.y" - { (yyval.fl) = new formal((yyvsp[(2) - (2)].t)->getPos(), (yyvsp[(2) - (2)].t), 0, 0, (yyvsp[(1) - (2)].boo), 0); ;} + { (yyval.fl) = new formal((yyvsp[(2) - (2)].t)->getPos(), (yyvsp[(2) - (2)].t), 0, 0, (yyvsp[(1) - (2)].boo), 0); } break; case 76: -/* Line 1464 of yacc.c */ +/* Line 1806 of yacc.c */ #line 384 "camp.y" - { (yyval.fl) = new formal((yyvsp[(2) - (3)].t)->getPos(), (yyvsp[(2) - (3)].t), (yyvsp[(3) - (3)].dis), 0, (yyvsp[(1) - (3)].boo), 0); ;} + { (yyval.fl) = new formal((yyvsp[(2) - (3)].t)->getPos(), (yyvsp[(2) - (3)].t), (yyvsp[(3) - (3)].dis), 0, (yyvsp[(1) - (3)].boo), 0); } break; case 77: -/* Line 1464 of yacc.c */ +/* Line 1806 of yacc.c */ #line 386 "camp.y" - { (yyval.fl) = new formal((yyvsp[(2) - (5)].t)->getPos(), (yyvsp[(2) - (5)].t), (yyvsp[(3) - (5)].dis), (yyvsp[(5) - (5)].vi), (yyvsp[(1) - (5)].boo), 0); ;} + { (yyval.fl) = new formal((yyvsp[(2) - (5)].t)->getPos(), (yyvsp[(2) - (5)].t), (yyvsp[(3) - (5)].dis), (yyvsp[(5) - (5)].vi), (yyvsp[(1) - (5)].boo), 0); } break; case 78: -/* Line 1464 of yacc.c */ +/* Line 1806 of yacc.c */ #line 389 "camp.y" { bool k = checkKeyword((yyvsp[(3) - (4)].ps).pos, (yyvsp[(3) - (4)].ps).sym); - (yyval.fl) = new formal((yyvsp[(2) - (4)].t)->getPos(), (yyvsp[(2) - (4)].t), (yyvsp[(4) - (4)].dis), 0, (yyvsp[(1) - (4)].boo), k); ;} + (yyval.fl) = new formal((yyvsp[(2) - (4)].t)->getPos(), (yyvsp[(2) - (4)].t), (yyvsp[(4) - (4)].dis), 0, (yyvsp[(1) - (4)].boo), k); } break; case 79: -/* Line 1464 of yacc.c */ +/* Line 1806 of yacc.c */ #line 392 "camp.y" { bool k = checkKeyword((yyvsp[(3) - (6)].ps).pos, (yyvsp[(3) - (6)].ps).sym); - (yyval.fl) = new formal((yyvsp[(2) - (6)].t)->getPos(), (yyvsp[(2) - (6)].t), (yyvsp[(4) - (6)].dis), (yyvsp[(6) - (6)].vi), (yyvsp[(1) - (6)].boo), k); ;} + (yyval.fl) = new formal((yyvsp[(2) - (6)].t)->getPos(), (yyvsp[(2) - (6)].t), (yyvsp[(4) - (6)].dis), (yyvsp[(6) - (6)].vi), (yyvsp[(1) - (6)].boo), k); } break; case 80: -/* Line 1464 of yacc.c */ +/* Line 1806 of yacc.c */ #line 398 "camp.y" - { (yyval.d) = new fundec((yyvsp[(3) - (5)].pos), (yyvsp[(1) - (5)].t), (yyvsp[(2) - (5)].ps).sym, new formals((yyvsp[(3) - (5)].pos)), (yyvsp[(5) - (5)].s)); ;} + { (yyval.d) = new fundec((yyvsp[(3) - (5)].pos), (yyvsp[(1) - (5)].t), (yyvsp[(2) - (5)].ps).sym, new formals((yyvsp[(3) - (5)].pos)), (yyvsp[(5) - (5)].s)); } break; case 81: -/* Line 1464 of yacc.c */ +/* Line 1806 of yacc.c */ #line 400 "camp.y" - { (yyval.d) = new fundec((yyvsp[(3) - (6)].pos), (yyvsp[(1) - (6)].t), (yyvsp[(2) - (6)].ps).sym, (yyvsp[(4) - (6)].fls), (yyvsp[(6) - (6)].s)); ;} + { (yyval.d) = new fundec((yyvsp[(3) - (6)].pos), (yyvsp[(1) - (6)].t), (yyvsp[(2) - (6)].ps).sym, (yyvsp[(4) - (6)].fls), (yyvsp[(6) - (6)].s)); } break; case 82: -/* Line 1464 of yacc.c */ +/* Line 1806 of yacc.c */ #line 404 "camp.y" - { (yyval.d) = new recorddec((yyvsp[(1) - (3)].pos), (yyvsp[(2) - (3)].ps).sym, (yyvsp[(3) - (3)].b)); ;} + { (yyval.d) = new recorddec((yyvsp[(1) - (3)].pos), (yyvsp[(2) - (3)].ps).sym, (yyvsp[(3) - (3)].b)); } break; case 83: -/* Line 1464 of yacc.c */ +/* Line 1806 of yacc.c */ #line 405 "camp.y" - { (yyval.d) = new typedec((yyvsp[(1) - (2)].pos), (yyvsp[(2) - (2)].vd)); ;} + { (yyval.d) = new typedec((yyvsp[(1) - (2)].pos), (yyvsp[(2) - (2)].vd)); } break; case 84: -/* Line 1464 of yacc.c */ +/* Line 1806 of yacc.c */ #line 409 "camp.y" - { (yyval.slice) = new slice((yyvsp[(1) - (1)].pos), 0, 0); ;} + { (yyval.slice) = new slice((yyvsp[(1) - (1)].pos), 0, 0); } break; case 85: -/* Line 1464 of yacc.c */ +/* Line 1806 of yacc.c */ #line 410 "camp.y" - { (yyval.slice) = new slice((yyvsp[(2) - (2)].pos), (yyvsp[(1) - (2)].e), 0); ;} + { (yyval.slice) = new slice((yyvsp[(2) - (2)].pos), (yyvsp[(1) - (2)].e), 0); } break; case 86: -/* Line 1464 of yacc.c */ +/* Line 1806 of yacc.c */ #line 411 "camp.y" - { (yyval.slice) = new slice((yyvsp[(1) - (2)].pos), 0, (yyvsp[(2) - (2)].e)); ;} + { (yyval.slice) = new slice((yyvsp[(1) - (2)].pos), 0, (yyvsp[(2) - (2)].e)); } break; case 87: -/* Line 1464 of yacc.c */ +/* Line 1806 of yacc.c */ #line 412 "camp.y" - { (yyval.slice) = new slice((yyvsp[(2) - (3)].pos), (yyvsp[(1) - (3)].e), (yyvsp[(3) - (3)].e)); ;} + { (yyval.slice) = new slice((yyvsp[(2) - (3)].pos), (yyvsp[(1) - (3)].e), (yyvsp[(3) - (3)].e)); } break; case 88: -/* Line 1464 of yacc.c */ +/* Line 1806 of yacc.c */ #line 416 "camp.y" - { (yyval.e) = new fieldExp((yyvsp[(2) - (3)].pos), (yyvsp[(1) - (3)].e), (yyvsp[(3) - (3)].ps).sym); ;} + { (yyval.e) = new fieldExp((yyvsp[(2) - (3)].pos), (yyvsp[(1) - (3)].e), (yyvsp[(3) - (3)].ps).sym); } break; case 89: -/* Line 1464 of yacc.c */ +/* Line 1806 of yacc.c */ #line 417 "camp.y" { (yyval.e) = new subscriptExp((yyvsp[(2) - (4)].pos), - new nameExp((yyvsp[(1) - (4)].n)->getPos(), (yyvsp[(1) - (4)].n)), (yyvsp[(3) - (4)].e)); ;} + new nameExp((yyvsp[(1) - (4)].n)->getPos(), (yyvsp[(1) - (4)].n)), (yyvsp[(3) - (4)].e)); } break; case 90: -/* Line 1464 of yacc.c */ +/* Line 1806 of yacc.c */ #line 419 "camp.y" - { (yyval.e) = new subscriptExp((yyvsp[(2) - (4)].pos), (yyvsp[(1) - (4)].e), (yyvsp[(3) - (4)].e)); ;} + { (yyval.e) = new subscriptExp((yyvsp[(2) - (4)].pos), (yyvsp[(1) - (4)].e), (yyvsp[(3) - (4)].e)); } break; case 91: -/* Line 1464 of yacc.c */ +/* Line 1806 of yacc.c */ #line 420 "camp.y" { (yyval.e) = new sliceExp((yyvsp[(2) - (4)].pos), - new nameExp((yyvsp[(1) - (4)].n)->getPos(), (yyvsp[(1) - (4)].n)), (yyvsp[(3) - (4)].slice)); ;} + new nameExp((yyvsp[(1) - (4)].n)->getPos(), (yyvsp[(1) - (4)].n)), (yyvsp[(3) - (4)].slice)); } break; case 92: -/* Line 1464 of yacc.c */ +/* Line 1806 of yacc.c */ #line 422 "camp.y" - { (yyval.e) = new sliceExp((yyvsp[(2) - (4)].pos), (yyvsp[(1) - (4)].e), (yyvsp[(3) - (4)].slice)); ;} + { (yyval.e) = new sliceExp((yyvsp[(2) - (4)].pos), (yyvsp[(1) - (4)].e), (yyvsp[(3) - (4)].slice)); } break; case 93: -/* Line 1464 of yacc.c */ +/* Line 1806 of yacc.c */ #line 423 "camp.y" { (yyval.e) = new callExp((yyvsp[(2) - (3)].pos), new nameExp((yyvsp[(1) - (3)].n)->getPos(), (yyvsp[(1) - (3)].n)), - new arglist()); ;} + new arglist()); } break; case 94: -/* Line 1464 of yacc.c */ +/* Line 1806 of yacc.c */ #line 427 "camp.y" { (yyval.e) = new callExp((yyvsp[(2) - (4)].pos), new nameExp((yyvsp[(1) - (4)].n)->getPos(), (yyvsp[(1) - (4)].n)), - (yyvsp[(3) - (4)].alist)); ;} + (yyvsp[(3) - (4)].alist)); } break; case 95: -/* Line 1464 of yacc.c */ +/* Line 1806 of yacc.c */ #line 430 "camp.y" - { (yyval.e) = new callExp((yyvsp[(2) - (3)].pos), (yyvsp[(1) - (3)].e), new arglist()); ;} + { (yyval.e) = new callExp((yyvsp[(2) - (3)].pos), (yyvsp[(1) - (3)].e), new arglist()); } break; case 96: -/* Line 1464 of yacc.c */ +/* Line 1806 of yacc.c */ #line 432 "camp.y" - { (yyval.e) = new callExp((yyvsp[(2) - (4)].pos), (yyvsp[(1) - (4)].e), (yyvsp[(3) - (4)].alist)); ;} + { (yyval.e) = new callExp((yyvsp[(2) - (4)].pos), (yyvsp[(1) - (4)].e), (yyvsp[(3) - (4)].alist)); } break; case 97: -/* Line 1464 of yacc.c */ +/* Line 1806 of yacc.c */ #line 434 "camp.y" - { (yyval.e) = (yyvsp[(2) - (3)].e); ;} + { (yyval.e) = (yyvsp[(2) - (3)].e); } break; case 98: -/* Line 1464 of yacc.c */ +/* Line 1806 of yacc.c */ #line 436 "camp.y" - { (yyval.e) = new nameExp((yyvsp[(2) - (3)].n)->getPos(), (yyvsp[(2) - (3)].n)); ;} + { (yyval.e) = new nameExp((yyvsp[(2) - (3)].n)->getPos(), (yyvsp[(2) - (3)].n)); } break; case 99: -/* Line 1464 of yacc.c */ +/* Line 1806 of yacc.c */ #line 437 "camp.y" - { (yyval.e) = new thisExp((yyvsp[(1) - (1)].pos)); ;} + { (yyval.e) = new thisExp((yyvsp[(1) - (1)].pos)); } break; case 100: -/* Line 1464 of yacc.c */ +/* Line 1806 of yacc.c */ #line 441 "camp.y" - { (yyval.arg).name = symbol::nullsym; (yyval.arg).val=(yyvsp[(1) - (1)].e); ;} + { (yyval.arg).name = symbol::nullsym; (yyval.arg).val=(yyvsp[(1) - (1)].e); } break; case 101: -/* Line 1464 of yacc.c */ +/* Line 1806 of yacc.c */ #line 442 "camp.y" - { (yyval.arg).name = (yyvsp[(1) - (3)].ps).sym; (yyval.arg).val=(yyvsp[(3) - (3)].e); ;} + { (yyval.arg).name = (yyvsp[(1) - (3)].ps).sym; (yyval.arg).val=(yyvsp[(3) - (3)].e); } break; case 102: -/* Line 1464 of yacc.c */ +/* Line 1806 of yacc.c */ #line 446 "camp.y" - { (yyval.alist) = new arglist(); (yyval.alist)->add((yyvsp[(1) - (1)].arg)); ;} + { (yyval.alist) = new arglist(); (yyval.alist)->add((yyvsp[(1) - (1)].arg)); } break; case 103: -/* Line 1464 of yacc.c */ +/* Line 1806 of yacc.c */ #line 448 "camp.y" - { (yyval.alist) = new arglist(); (yyval.alist)->addRest((yyvsp[(2) - (2)].arg)); ;} + { (yyval.alist) = new arglist(); (yyval.alist)->addRest((yyvsp[(2) - (2)].arg)); } break; case 104: -/* Line 1464 of yacc.c */ +/* Line 1806 of yacc.c */ #line 450 "camp.y" - { (yyval.alist) = (yyvsp[(1) - (3)].alist); (yyval.alist)->add((yyvsp[(3) - (3)].arg)); ;} + { (yyval.alist) = (yyvsp[(1) - (3)].alist); (yyval.alist)->add((yyvsp[(3) - (3)].arg)); } break; case 105: -/* Line 1464 of yacc.c */ +/* Line 1806 of yacc.c */ #line 452 "camp.y" - { (yyval.alist) = (yyvsp[(1) - (3)].alist); (yyval.alist)->addRest((yyvsp[(3) - (3)].arg)); ;} + { (yyval.alist) = (yyvsp[(1) - (3)].alist); (yyval.alist)->addRest((yyvsp[(3) - (3)].arg)); } break; case 106: -/* Line 1464 of yacc.c */ -#line 456 "camp.y" - { (yyval.e) = new nameExp((yyvsp[(1) - (1)].n)->getPos(), (yyvsp[(1) - (1)].n)); ;} +/* Line 1806 of yacc.c */ +#line 457 "camp.y" + { (yyval.alist) = new arglist(); (yyval.alist)->add((yyvsp[(1) - (3)].e)); (yyval.alist)->add((yyvsp[(3) - (3)].e)); } break; case 107: -/* Line 1464 of yacc.c */ -#line 457 "camp.y" - { (yyval.e) = (yyvsp[(1) - (1)].e); ;} +/* Line 1806 of yacc.c */ +#line 458 "camp.y" + { (yyval.alist) = (yyvsp[(1) - (3)].alist); (yyval.alist)->add((yyvsp[(3) - (3)].e)); } break; case 108: -/* Line 1464 of yacc.c */ -#line 458 "camp.y" - { (yyval.e) = (yyvsp[(1) - (1)].e); ;} +/* Line 1806 of yacc.c */ +#line 462 "camp.y" + { (yyval.e) = new nameExp((yyvsp[(1) - (1)].n)->getPos(), (yyvsp[(1) - (1)].n)); } break; case 109: -/* Line 1464 of yacc.c */ -#line 459 "camp.y" - { (yyval.e) = (yyvsp[(1) - (1)].stre); ;} +/* Line 1806 of yacc.c */ +#line 463 "camp.y" + { (yyval.e) = (yyvsp[(1) - (1)].e); } break; case 110: -/* Line 1464 of yacc.c */ -#line 461 "camp.y" - { (yyval.e) = new scaleExp((yyvsp[(1) - (2)].e)->getPos(), (yyvsp[(1) - (2)].e), (yyvsp[(2) - (2)].e)); ;} +/* Line 1806 of yacc.c */ +#line 464 "camp.y" + { (yyval.e) = (yyvsp[(1) - (1)].e); } break; case 111: -/* Line 1464 of yacc.c */ -#line 463 "camp.y" - { (yyval.e) = new castExp((yyvsp[(2) - (4)].n)->getPos(), new nameTy((yyvsp[(2) - (4)].n)), (yyvsp[(4) - (4)].e)); ;} +/* Line 1806 of yacc.c */ +#line 465 "camp.y" + { (yyval.e) = (yyvsp[(1) - (1)].stre); } break; case 112: -/* Line 1464 of yacc.c */ -#line 465 "camp.y" - { (yyval.e) = new castExp((yyvsp[(2) - (5)].n)->getPos(), new arrayTy((yyvsp[(2) - (5)].n), (yyvsp[(3) - (5)].dim)), (yyvsp[(5) - (5)].e)); ;} +/* Line 1806 of yacc.c */ +#line 467 "camp.y" + { (yyval.e) = new scaleExp((yyvsp[(1) - (2)].e)->getPos(), (yyvsp[(1) - (2)].e), (yyvsp[(2) - (2)].e)); } break; case 113: -/* Line 1464 of yacc.c */ -#line 467 "camp.y" - { (yyval.e) = new unaryExp((yyvsp[(1) - (2)].ps).pos, (yyvsp[(2) - (2)].e), (yyvsp[(1) - (2)].ps).sym); ;} +/* Line 1806 of yacc.c */ +#line 469 "camp.y" + { (yyval.e) = new castExp((yyvsp[(2) - (4)].n)->getPos(), new nameTy((yyvsp[(2) - (4)].n)), (yyvsp[(4) - (4)].e)); } break; case 114: -/* Line 1464 of yacc.c */ -#line 469 "camp.y" - { (yyval.e) = new unaryExp((yyvsp[(1) - (2)].ps).pos, (yyvsp[(2) - (2)].e), (yyvsp[(1) - (2)].ps).sym); ;} +/* Line 1806 of yacc.c */ +#line 471 "camp.y" + { (yyval.e) = new castExp((yyvsp[(2) - (5)].n)->getPos(), new arrayTy((yyvsp[(2) - (5)].n), (yyvsp[(3) - (5)].dim)), (yyvsp[(5) - (5)].e)); } break; case 115: -/* Line 1464 of yacc.c */ -#line 470 "camp.y" - { (yyval.e) = new unaryExp((yyvsp[(1) - (2)].ps).pos, (yyvsp[(2) - (2)].e), (yyvsp[(1) - (2)].ps).sym); ;} +/* Line 1806 of yacc.c */ +#line 473 "camp.y" + { (yyval.e) = new unaryExp((yyvsp[(1) - (2)].ps).pos, (yyvsp[(2) - (2)].e), (yyvsp[(1) - (2)].ps).sym); } break; case 116: -/* Line 1464 of yacc.c */ -#line 471 "camp.y" - { (yyval.e) = new binaryExp((yyvsp[(2) - (3)].ps).pos, (yyvsp[(1) - (3)].e), (yyvsp[(2) - (3)].ps).sym, (yyvsp[(3) - (3)].e)); ;} +/* Line 1806 of yacc.c */ +#line 475 "camp.y" + { (yyval.e) = new unaryExp((yyvsp[(1) - (2)].ps).pos, (yyvsp[(2) - (2)].e), (yyvsp[(1) - (2)].ps).sym); } break; case 117: -/* Line 1464 of yacc.c */ -#line 472 "camp.y" - { (yyval.e) = new binaryExp((yyvsp[(2) - (3)].ps).pos, (yyvsp[(1) - (3)].e), (yyvsp[(2) - (3)].ps).sym, (yyvsp[(3) - (3)].e)); ;} +/* Line 1806 of yacc.c */ +#line 476 "camp.y" + { (yyval.e) = new unaryExp((yyvsp[(1) - (2)].ps).pos, (yyvsp[(2) - (2)].e), (yyvsp[(1) - (2)].ps).sym); } break; case 118: -/* Line 1464 of yacc.c */ -#line 473 "camp.y" - { (yyval.e) = new binaryExp((yyvsp[(2) - (3)].ps).pos, (yyvsp[(1) - (3)].e), (yyvsp[(2) - (3)].ps).sym, (yyvsp[(3) - (3)].e)); ;} +/* Line 1806 of yacc.c */ +#line 477 "camp.y" + { (yyval.e) = new binaryExp((yyvsp[(2) - (3)].ps).pos, (yyvsp[(1) - (3)].e), (yyvsp[(2) - (3)].ps).sym, (yyvsp[(3) - (3)].e)); } break; case 119: -/* Line 1464 of yacc.c */ -#line 474 "camp.y" - { (yyval.e) = new binaryExp((yyvsp[(2) - (3)].ps).pos, (yyvsp[(1) - (3)].e), (yyvsp[(2) - (3)].ps).sym, (yyvsp[(3) - (3)].e)); ;} +/* Line 1806 of yacc.c */ +#line 478 "camp.y" + { (yyval.e) = new binaryExp((yyvsp[(2) - (3)].ps).pos, (yyvsp[(1) - (3)].e), (yyvsp[(2) - (3)].ps).sym, (yyvsp[(3) - (3)].e)); } break; case 120: -/* Line 1464 of yacc.c */ -#line 475 "camp.y" - { (yyval.e) = new binaryExp((yyvsp[(2) - (3)].ps).pos, (yyvsp[(1) - (3)].e), (yyvsp[(2) - (3)].ps).sym, (yyvsp[(3) - (3)].e)); ;} +/* Line 1806 of yacc.c */ +#line 479 "camp.y" + { (yyval.e) = new binaryExp((yyvsp[(2) - (3)].ps).pos, (yyvsp[(1) - (3)].e), (yyvsp[(2) - (3)].ps).sym, (yyvsp[(3) - (3)].e)); } break; case 121: -/* Line 1464 of yacc.c */ -#line 476 "camp.y" - { (yyval.e) = new binaryExp((yyvsp[(2) - (3)].ps).pos, (yyvsp[(1) - (3)].e), (yyvsp[(2) - (3)].ps).sym, (yyvsp[(3) - (3)].e)); ;} +/* Line 1806 of yacc.c */ +#line 480 "camp.y" + { (yyval.e) = new binaryExp((yyvsp[(2) - (3)].ps).pos, (yyvsp[(1) - (3)].e), (yyvsp[(2) - (3)].ps).sym, (yyvsp[(3) - (3)].e)); } break; case 122: -/* Line 1464 of yacc.c */ -#line 477 "camp.y" - { (yyval.e) = new binaryExp((yyvsp[(2) - (3)].ps).pos, (yyvsp[(1) - (3)].e), (yyvsp[(2) - (3)].ps).sym, (yyvsp[(3) - (3)].e)); ;} +/* Line 1806 of yacc.c */ +#line 481 "camp.y" + { (yyval.e) = new binaryExp((yyvsp[(2) - (3)].ps).pos, (yyvsp[(1) - (3)].e), (yyvsp[(2) - (3)].ps).sym, (yyvsp[(3) - (3)].e)); } break; case 123: -/* Line 1464 of yacc.c */ -#line 478 "camp.y" - { (yyval.e) = new binaryExp((yyvsp[(2) - (3)].ps).pos, (yyvsp[(1) - (3)].e), (yyvsp[(2) - (3)].ps).sym, (yyvsp[(3) - (3)].e)); ;} +/* Line 1806 of yacc.c */ +#line 482 "camp.y" + { (yyval.e) = new binaryExp((yyvsp[(2) - (3)].ps).pos, (yyvsp[(1) - (3)].e), (yyvsp[(2) - (3)].ps).sym, (yyvsp[(3) - (3)].e)); } break; case 124: -/* Line 1464 of yacc.c */ -#line 479 "camp.y" - { (yyval.e) = new binaryExp((yyvsp[(2) - (3)].ps).pos, (yyvsp[(1) - (3)].e), (yyvsp[(2) - (3)].ps).sym, (yyvsp[(3) - (3)].e)); ;} +/* Line 1806 of yacc.c */ +#line 483 "camp.y" + { (yyval.e) = new binaryExp((yyvsp[(2) - (3)].ps).pos, (yyvsp[(1) - (3)].e), (yyvsp[(2) - (3)].ps).sym, (yyvsp[(3) - (3)].e)); } break; case 125: -/* Line 1464 of yacc.c */ -#line 480 "camp.y" - { (yyval.e) = new binaryExp((yyvsp[(2) - (3)].ps).pos, (yyvsp[(1) - (3)].e), (yyvsp[(2) - (3)].ps).sym, (yyvsp[(3) - (3)].e)); ;} +/* Line 1806 of yacc.c */ +#line 484 "camp.y" + { (yyval.e) = new binaryExp((yyvsp[(2) - (3)].ps).pos, (yyvsp[(1) - (3)].e), (yyvsp[(2) - (3)].ps).sym, (yyvsp[(3) - (3)].e)); } break; case 126: -/* Line 1464 of yacc.c */ -#line 481 "camp.y" - { (yyval.e) = new equalityExp((yyvsp[(2) - (3)].ps).pos, (yyvsp[(1) - (3)].e), (yyvsp[(2) - (3)].ps).sym, (yyvsp[(3) - (3)].e)); ;} +/* Line 1806 of yacc.c */ +#line 485 "camp.y" + { (yyval.e) = new binaryExp((yyvsp[(2) - (3)].ps).pos, (yyvsp[(1) - (3)].e), (yyvsp[(2) - (3)].ps).sym, (yyvsp[(3) - (3)].e)); } break; case 127: -/* Line 1464 of yacc.c */ -#line 482 "camp.y" - { (yyval.e) = new equalityExp((yyvsp[(2) - (3)].ps).pos, (yyvsp[(1) - (3)].e), (yyvsp[(2) - (3)].ps).sym, (yyvsp[(3) - (3)].e)); ;} +/* Line 1806 of yacc.c */ +#line 486 "camp.y" + { (yyval.e) = new binaryExp((yyvsp[(2) - (3)].ps).pos, (yyvsp[(1) - (3)].e), (yyvsp[(2) - (3)].ps).sym, (yyvsp[(3) - (3)].e)); } break; case 128: -/* Line 1464 of yacc.c */ -#line 483 "camp.y" - { (yyval.e) = new andExp((yyvsp[(2) - (3)].ps).pos, (yyvsp[(1) - (3)].e), (yyvsp[(2) - (3)].ps).sym, (yyvsp[(3) - (3)].e)); ;} +/* Line 1806 of yacc.c */ +#line 487 "camp.y" + { (yyval.e) = new equalityExp((yyvsp[(2) - (3)].ps).pos, (yyvsp[(1) - (3)].e), (yyvsp[(2) - (3)].ps).sym, (yyvsp[(3) - (3)].e)); } break; case 129: -/* Line 1464 of yacc.c */ -#line 484 "camp.y" - { (yyval.e) = new orExp((yyvsp[(2) - (3)].ps).pos, (yyvsp[(1) - (3)].e), (yyvsp[(2) - (3)].ps).sym, (yyvsp[(3) - (3)].e)); ;} +/* Line 1806 of yacc.c */ +#line 488 "camp.y" + { (yyval.e) = new equalityExp((yyvsp[(2) - (3)].ps).pos, (yyvsp[(1) - (3)].e), (yyvsp[(2) - (3)].ps).sym, (yyvsp[(3) - (3)].e)); } break; case 130: -/* Line 1464 of yacc.c */ -#line 485 "camp.y" - { (yyval.e) = new binaryExp((yyvsp[(2) - (3)].ps).pos, (yyvsp[(1) - (3)].e), (yyvsp[(2) - (3)].ps).sym, (yyvsp[(3) - (3)].e)); ;} +/* Line 1806 of yacc.c */ +#line 489 "camp.y" + { (yyval.e) = new andExp((yyvsp[(2) - (3)].ps).pos, (yyvsp[(1) - (3)].e), (yyvsp[(2) - (3)].ps).sym, (yyvsp[(3) - (3)].e)); } break; case 131: -/* Line 1464 of yacc.c */ -#line 486 "camp.y" - { (yyval.e) = new binaryExp((yyvsp[(2) - (3)].ps).pos, (yyvsp[(1) - (3)].e), (yyvsp[(2) - (3)].ps).sym, (yyvsp[(3) - (3)].e)); ;} +/* Line 1806 of yacc.c */ +#line 490 "camp.y" + { (yyval.e) = new orExp((yyvsp[(2) - (3)].ps).pos, (yyvsp[(1) - (3)].e), (yyvsp[(2) - (3)].ps).sym, (yyvsp[(3) - (3)].e)); } break; case 132: -/* Line 1464 of yacc.c */ -#line 487 "camp.y" - { (yyval.e) = new binaryExp((yyvsp[(2) - (3)].ps).pos, (yyvsp[(1) - (3)].e), (yyvsp[(2) - (3)].ps).sym, (yyvsp[(3) - (3)].e)); ;} +/* Line 1806 of yacc.c */ +#line 491 "camp.y" + { (yyval.e) = new binaryExp((yyvsp[(2) - (3)].ps).pos, (yyvsp[(1) - (3)].e), (yyvsp[(2) - (3)].ps).sym, (yyvsp[(3) - (3)].e)); } break; case 133: -/* Line 1464 of yacc.c */ -#line 488 "camp.y" - { (yyval.e) = new binaryExp((yyvsp[(2) - (3)].ps).pos, (yyvsp[(1) - (3)].e), (yyvsp[(2) - (3)].ps).sym, (yyvsp[(3) - (3)].e)); ;} +/* Line 1806 of yacc.c */ +#line 492 "camp.y" + { (yyval.e) = new binaryExp((yyvsp[(2) - (3)].ps).pos, (yyvsp[(1) - (3)].e), (yyvsp[(2) - (3)].ps).sym, (yyvsp[(3) - (3)].e)); } break; case 134: -/* Line 1464 of yacc.c */ -#line 489 "camp.y" - { (yyval.e) = new binaryExp((yyvsp[(2) - (3)].ps).pos, (yyvsp[(1) - (3)].e), (yyvsp[(2) - (3)].ps).sym, (yyvsp[(3) - (3)].e)); ;} +/* Line 1806 of yacc.c */ +#line 493 "camp.y" + { (yyval.e) = new binaryExp((yyvsp[(2) - (3)].ps).pos, (yyvsp[(1) - (3)].e), (yyvsp[(2) - (3)].ps).sym, (yyvsp[(3) - (3)].e)); } break; case 135: -/* Line 1464 of yacc.c */ -#line 491 "camp.y" - { (yyval.e) = new newRecordExp((yyvsp[(1) - (2)].pos), (yyvsp[(2) - (2)].t)); ;} +/* Line 1806 of yacc.c */ +#line 494 "camp.y" + { (yyval.e) = new binaryExp((yyvsp[(2) - (3)].ps).pos, (yyvsp[(1) - (3)].e), (yyvsp[(2) - (3)].ps).sym, (yyvsp[(3) - (3)].e)); } break; case 136: -/* Line 1464 of yacc.c */ -#line 493 "camp.y" - { (yyval.e) = new newArrayExp((yyvsp[(1) - (3)].pos), (yyvsp[(2) - (3)].t), (yyvsp[(3) - (3)].elist), 0, 0); ;} +/* Line 1806 of yacc.c */ +#line 495 "camp.y" + { (yyval.e) = new binaryExp((yyvsp[(2) - (3)].ps).pos, (yyvsp[(1) - (3)].e), (yyvsp[(2) - (3)].ps).sym, (yyvsp[(3) - (3)].e)); } break; case 137: -/* Line 1464 of yacc.c */ -#line 495 "camp.y" - { (yyval.e) = new newArrayExp((yyvsp[(1) - (4)].pos), (yyvsp[(2) - (4)].t), (yyvsp[(3) - (4)].elist), (yyvsp[(4) - (4)].dim), 0); ;} +/* Line 1806 of yacc.c */ +#line 497 "camp.y" + { (yyval.e) = new newRecordExp((yyvsp[(1) - (2)].pos), (yyvsp[(2) - (2)].t)); } break; case 138: -/* Line 1464 of yacc.c */ -#line 497 "camp.y" - { (yyval.e) = new newArrayExp((yyvsp[(1) - (3)].pos), (yyvsp[(2) - (3)].t), 0, (yyvsp[(3) - (3)].dim), 0); ;} +/* Line 1806 of yacc.c */ +#line 499 "camp.y" + { (yyval.e) = new newArrayExp((yyvsp[(1) - (3)].pos), (yyvsp[(2) - (3)].t), (yyvsp[(3) - (3)].elist), 0, 0); } break; case 139: -/* Line 1464 of yacc.c */ -#line 499 "camp.y" - { (yyval.e) = new newArrayExp((yyvsp[(1) - (4)].pos), (yyvsp[(2) - (4)].t), 0, (yyvsp[(3) - (4)].dim), (yyvsp[(4) - (4)].ai)); ;} +/* Line 1806 of yacc.c */ +#line 501 "camp.y" + { (yyval.e) = new newArrayExp((yyvsp[(1) - (4)].pos), (yyvsp[(2) - (4)].t), (yyvsp[(3) - (4)].elist), (yyvsp[(4) - (4)].dim), 0); } break; case 140: -/* Line 1464 of yacc.c */ -#line 501 "camp.y" - { (yyval.e) = new newFunctionExp((yyvsp[(1) - (5)].pos), (yyvsp[(2) - (5)].t), new formals((yyvsp[(3) - (5)].pos)), (yyvsp[(5) - (5)].s)); ;} +/* Line 1806 of yacc.c */ +#line 503 "camp.y" + { (yyval.e) = new newArrayExp((yyvsp[(1) - (3)].pos), (yyvsp[(2) - (3)].t), 0, (yyvsp[(3) - (3)].dim), 0); } break; case 141: -/* Line 1464 of yacc.c */ -#line 503 "camp.y" - { (yyval.e) = new newFunctionExp((yyvsp[(1) - (6)].pos), - new arrayTy((yyvsp[(2) - (6)].t)->getPos(), (yyvsp[(2) - (6)].t), (yyvsp[(3) - (6)].dim)), - new formals((yyvsp[(4) - (6)].pos)), - (yyvsp[(6) - (6)].s)); ;} +/* Line 1806 of yacc.c */ +#line 505 "camp.y" + { (yyval.e) = new newArrayExp((yyvsp[(1) - (4)].pos), (yyvsp[(2) - (4)].t), 0, (yyvsp[(3) - (4)].dim), (yyvsp[(4) - (4)].ai)); } break; case 142: -/* Line 1464 of yacc.c */ -#line 508 "camp.y" - { (yyval.e) = new newFunctionExp((yyvsp[(1) - (6)].pos), (yyvsp[(2) - (6)].t), (yyvsp[(4) - (6)].fls), (yyvsp[(6) - (6)].s)); ;} +/* Line 1806 of yacc.c */ +#line 507 "camp.y" + { (yyval.e) = new newFunctionExp((yyvsp[(1) - (5)].pos), (yyvsp[(2) - (5)].t), new formals((yyvsp[(3) - (5)].pos)), (yyvsp[(5) - (5)].s)); } break; case 143: -/* Line 1464 of yacc.c */ -#line 510 "camp.y" - { (yyval.e) = new newFunctionExp((yyvsp[(1) - (7)].pos), - new arrayTy((yyvsp[(2) - (7)].t)->getPos(), (yyvsp[(2) - (7)].t), (yyvsp[(3) - (7)].dim)), - (yyvsp[(5) - (7)].fls), - (yyvsp[(7) - (7)].s)); ;} +/* Line 1806 of yacc.c */ +#line 509 "camp.y" + { (yyval.e) = new newFunctionExp((yyvsp[(1) - (6)].pos), + new arrayTy((yyvsp[(2) - (6)].t)->getPos(), (yyvsp[(2) - (6)].t), (yyvsp[(3) - (6)].dim)), + new formals((yyvsp[(4) - (6)].pos)), + (yyvsp[(6) - (6)].s)); } break; case 144: -/* Line 1464 of yacc.c */ -#line 515 "camp.y" - { (yyval.e) = new conditionalExp((yyvsp[(2) - (5)].pos), (yyvsp[(1) - (5)].e), (yyvsp[(3) - (5)].e), (yyvsp[(5) - (5)].e)); ;} +/* Line 1806 of yacc.c */ +#line 514 "camp.y" + { (yyval.e) = new newFunctionExp((yyvsp[(1) - (6)].pos), (yyvsp[(2) - (6)].t), (yyvsp[(4) - (6)].fls), (yyvsp[(6) - (6)].s)); } break; case 145: -/* Line 1464 of yacc.c */ +/* Line 1806 of yacc.c */ #line 516 "camp.y" - { (yyval.e) = new assignExp((yyvsp[(2) - (3)].pos), (yyvsp[(1) - (3)].e), (yyvsp[(3) - (3)].e)); ;} + { (yyval.e) = new newFunctionExp((yyvsp[(1) - (7)].pos), + new arrayTy((yyvsp[(2) - (7)].t)->getPos(), (yyvsp[(2) - (7)].t), (yyvsp[(3) - (7)].dim)), + (yyvsp[(5) - (7)].fls), + (yyvsp[(7) - (7)].s)); } break; case 146: -/* Line 1464 of yacc.c */ -#line 519 "camp.y" - { (yyval.e) = new pairExp((yyvsp[(1) - (5)].pos), (yyvsp[(2) - (5)].e), (yyvsp[(4) - (5)].e)); ;} +/* Line 1806 of yacc.c */ +#line 521 "camp.y" + { (yyval.e) = new conditionalExp((yyvsp[(2) - (5)].pos), (yyvsp[(1) - (5)].e), (yyvsp[(3) - (5)].e), (yyvsp[(5) - (5)].e)); } break; case 147: -/* Line 1464 of yacc.c */ -#line 521 "camp.y" - { (yyval.e) = new tripleExp((yyvsp[(1) - (7)].pos), (yyvsp[(2) - (7)].e), (yyvsp[(4) - (7)].e), (yyvsp[(6) - (7)].e)); ;} +/* Line 1806 of yacc.c */ +#line 522 "camp.y" + { (yyval.e) = new assignExp((yyvsp[(2) - (3)].pos), (yyvsp[(1) - (3)].e), (yyvsp[(3) - (3)].e)); } break; case 148: -/* Line 1464 of yacc.c */ +/* Line 1806 of yacc.c */ #line 523 "camp.y" - { (yyval.e) = new transformExp((yyvsp[(1) - (13)].pos), (yyvsp[(2) - (13)].e), (yyvsp[(4) - (13)].e), (yyvsp[(6) - (13)].e), (yyvsp[(8) - (13)].e), (yyvsp[(10) - (13)].e), (yyvsp[(12) - (13)].e)); ;} + { (yyval.e) = new callExp((yyvsp[(1) - (3)].pos), new nameExp((yyvsp[(1) - (3)].pos), SYM_TUPLE), (yyvsp[(2) - (3)].alist)); } break; case 149: -/* Line 1464 of yacc.c */ +/* Line 1806 of yacc.c */ #line 525 "camp.y" - { (yyvsp[(2) - (3)].j)->pushFront((yyvsp[(1) - (3)].e)); (yyvsp[(2) - (3)].j)->pushBack((yyvsp[(3) - (3)].e)); (yyval.e) = (yyvsp[(2) - (3)].j); ;} + { (yyvsp[(2) - (3)].j)->pushFront((yyvsp[(1) - (3)].e)); (yyvsp[(2) - (3)].j)->pushBack((yyvsp[(3) - (3)].e)); (yyval.e) = (yyvsp[(2) - (3)].j); } break; case 150: -/* Line 1464 of yacc.c */ +/* Line 1806 of yacc.c */ #line 527 "camp.y" { (yyvsp[(2) - (2)].se)->setSide(camp::OUT); joinExp *jexp = new joinExp((yyvsp[(2) - (2)].se)->getPos(), SYM_DOTS); (yyval.e)=jexp; - jexp->pushBack((yyvsp[(1) - (2)].e)); jexp->pushBack((yyvsp[(2) - (2)].se)); ;} + jexp->pushBack((yyvsp[(1) - (2)].e)); jexp->pushBack((yyvsp[(2) - (2)].se)); } break; case 151: -/* Line 1464 of yacc.c */ +/* Line 1806 of yacc.c */ #line 533 "camp.y" - { (yyval.e) = new prefixExp((yyvsp[(1) - (2)].ps).pos, (yyvsp[(2) - (2)].e), SYM_PLUS); ;} + { (yyval.e) = new prefixExp((yyvsp[(1) - (2)].ps).pos, (yyvsp[(2) - (2)].e), SYM_PLUS); } break; case 152: -/* Line 1464 of yacc.c */ +/* Line 1806 of yacc.c */ #line 535 "camp.y" - { (yyval.e) = new prefixExp((yyvsp[(1) - (2)].ps).pos, (yyvsp[(2) - (2)].e), SYM_MINUS); ;} + { (yyval.e) = new prefixExp((yyvsp[(1) - (2)].ps).pos, (yyvsp[(2) - (2)].e), SYM_MINUS); } break; case 153: -/* Line 1464 of yacc.c */ +/* Line 1806 of yacc.c */ #line 538 "camp.y" - { (yyval.e) = new postfixExp((yyvsp[(2) - (2)].ps).pos, (yyvsp[(1) - (2)].e), SYM_PLUS); ;} + { (yyval.e) = new postfixExp((yyvsp[(2) - (2)].ps).pos, (yyvsp[(1) - (2)].e), SYM_PLUS); } break; case 154: -/* Line 1464 of yacc.c */ +/* Line 1806 of yacc.c */ #line 539 "camp.y" - { (yyval.e) = new selfExp((yyvsp[(2) - (3)].ps).pos, (yyvsp[(1) - (3)].e), (yyvsp[(2) - (3)].ps).sym, (yyvsp[(3) - (3)].e)); ;} + { (yyval.e) = new selfExp((yyvsp[(2) - (3)].ps).pos, (yyvsp[(1) - (3)].e), (yyvsp[(2) - (3)].ps).sym, (yyvsp[(3) - (3)].e)); } break; case 155: -/* Line 1464 of yacc.c */ +/* Line 1806 of yacc.c */ #line 541 "camp.y" - { (yyval.e) = new quoteExp((yyvsp[(1) - (4)].pos), (yyvsp[(3) - (4)].b)); ;} + { (yyval.e) = new quoteExp((yyvsp[(1) - (4)].pos), (yyvsp[(3) - (4)].b)); } break; case 156: -/* Line 1464 of yacc.c */ +/* Line 1806 of yacc.c */ #line 547 "camp.y" - { (yyval.j) = new joinExp((yyvsp[(1) - (1)].ps).pos,(yyvsp[(1) - (1)].ps).sym); ;} + { (yyval.j) = new joinExp((yyvsp[(1) - (1)].ps).pos,(yyvsp[(1) - (1)].ps).sym); } break; case 157: -/* Line 1464 of yacc.c */ +/* Line 1806 of yacc.c */ #line 549 "camp.y" - { (yyval.j) = (yyvsp[(1) - (1)].j); ;} + { (yyval.j) = (yyvsp[(1) - (1)].j); } break; case 158: -/* Line 1464 of yacc.c */ +/* Line 1806 of yacc.c */ #line 551 "camp.y" { (yyvsp[(1) - (2)].se)->setSide(camp::OUT); - (yyval.j) = (yyvsp[(2) - (2)].j); (yyval.j)->pushFront((yyvsp[(1) - (2)].se)); ;} + (yyval.j) = (yyvsp[(2) - (2)].j); (yyval.j)->pushFront((yyvsp[(1) - (2)].se)); } break; case 159: -/* Line 1464 of yacc.c */ +/* Line 1806 of yacc.c */ #line 554 "camp.y" { (yyvsp[(2) - (2)].se)->setSide(camp::IN); - (yyval.j) = (yyvsp[(1) - (2)].j); (yyval.j)->pushBack((yyvsp[(2) - (2)].se)); ;} + (yyval.j) = (yyvsp[(1) - (2)].j); (yyval.j)->pushBack((yyvsp[(2) - (2)].se)); } break; case 160: -/* Line 1464 of yacc.c */ +/* Line 1806 of yacc.c */ #line 557 "camp.y" { (yyvsp[(1) - (3)].se)->setSide(camp::OUT); (yyvsp[(3) - (3)].se)->setSide(camp::IN); - (yyval.j) = (yyvsp[(2) - (3)].j); (yyval.j)->pushFront((yyvsp[(1) - (3)].se)); (yyval.j)->pushBack((yyvsp[(3) - (3)].se)); ;} + (yyval.j) = (yyvsp[(2) - (3)].j); (yyval.j)->pushFront((yyvsp[(1) - (3)].se)); (yyval.j)->pushBack((yyvsp[(3) - (3)].se)); } break; case 161: -/* Line 1464 of yacc.c */ +/* Line 1806 of yacc.c */ #line 562 "camp.y" - { (yyval.se) = new specExp((yyvsp[(2) - (4)].ps).pos, (yyvsp[(2) - (4)].ps).sym, (yyvsp[(3) - (4)].e)); ;} + { (yyval.se) = new specExp((yyvsp[(2) - (4)].ps).pos, (yyvsp[(2) - (4)].ps).sym, (yyvsp[(3) - (4)].e)); } break; case 162: -/* Line 1464 of yacc.c */ +/* Line 1806 of yacc.c */ #line 563 "camp.y" - { (yyval.se) = new specExp((yyvsp[(1) - (3)].pos), symbol::opTrans("spec"), (yyvsp[(2) - (3)].e)); ;} + { (yyval.se) = new specExp((yyvsp[(1) - (3)].pos), symbol::opTrans("spec"), (yyvsp[(2) - (3)].e)); } break; case 163: -/* Line 1464 of yacc.c */ +/* Line 1806 of yacc.c */ #line 565 "camp.y" { (yyval.se) = new specExp((yyvsp[(1) - (5)].pos), symbol::opTrans("spec"), - new pairExp((yyvsp[(3) - (5)].pos), (yyvsp[(2) - (5)].e), (yyvsp[(4) - (5)].e))); ;} + new pairExp((yyvsp[(3) - (5)].pos), (yyvsp[(2) - (5)].e), (yyvsp[(4) - (5)].e))); } break; case 164: -/* Line 1464 of yacc.c */ +/* Line 1806 of yacc.c */ #line 568 "camp.y" { (yyval.se) = new specExp((yyvsp[(1) - (7)].pos), symbol::opTrans("spec"), - new tripleExp((yyvsp[(3) - (7)].pos), (yyvsp[(2) - (7)].e), (yyvsp[(4) - (7)].e), (yyvsp[(6) - (7)].e))); ;} + new tripleExp((yyvsp[(3) - (7)].pos), (yyvsp[(2) - (7)].e), (yyvsp[(4) - (7)].e), (yyvsp[(6) - (7)].e))); } break; case 165: -/* Line 1464 of yacc.c */ +/* Line 1806 of yacc.c */ #line 573 "camp.y" - { (yyval.j) = new joinExp((yyvsp[(1) - (1)].ps).pos, (yyvsp[(1) - (1)].ps).sym); ;} + { (yyval.j) = new joinExp((yyvsp[(1) - (1)].ps).pos, (yyvsp[(1) - (1)].ps).sym); } break; case 166: -/* Line 1464 of yacc.c */ +/* Line 1806 of yacc.c */ #line 575 "camp.y" - { (yyval.j) = new joinExp((yyvsp[(1) - (3)].ps).pos, (yyvsp[(1) - (3)].ps).sym); (yyval.j)->pushBack((yyvsp[(2) - (3)].e)); ;} + { (yyval.j) = new joinExp((yyvsp[(1) - (3)].ps).pos, (yyvsp[(1) - (3)].ps).sym); (yyval.j)->pushBack((yyvsp[(2) - (3)].e)); } break; case 167: -/* Line 1464 of yacc.c */ +/* Line 1806 of yacc.c */ #line 577 "camp.y" - { (yyval.j) = new joinExp((yyvsp[(1) - (3)].ps).pos, (yyvsp[(1) - (3)].ps).sym); (yyval.j)->pushBack((yyvsp[(2) - (3)].e)); ;} + { (yyval.j) = new joinExp((yyvsp[(1) - (3)].ps).pos, (yyvsp[(1) - (3)].ps).sym); (yyval.j)->pushBack((yyvsp[(2) - (3)].e)); } break; case 168: -/* Line 1464 of yacc.c */ +/* Line 1806 of yacc.c */ #line 578 "camp.y" - { (yyval.j) = new joinExp((yyvsp[(1) - (1)].ps).pos, (yyvsp[(1) - (1)].ps).sym); ;} + { (yyval.j) = new joinExp((yyvsp[(1) - (1)].ps).pos, (yyvsp[(1) - (1)].ps).sym); } break; case 169: -/* Line 1464 of yacc.c */ +/* Line 1806 of yacc.c */ #line 579 "camp.y" - { (yyval.j) = new joinExp((yyvsp[(1) - (1)].ps).pos, (yyvsp[(1) - (1)].ps).sym); ;} + { (yyval.j) = new joinExp((yyvsp[(1) - (1)].ps).pos, (yyvsp[(1) - (1)].ps).sym); } break; case 170: -/* Line 1464 of yacc.c */ +/* Line 1806 of yacc.c */ #line 583 "camp.y" { (yyval.e) = new binaryExp((yyvsp[(1) - (2)].ps).pos, (yyvsp[(2) - (2)].e), (yyvsp[(1) - (2)].ps).sym, - new booleanExp((yyvsp[(1) - (2)].ps).pos, false)); ;} + new booleanExp((yyvsp[(1) - (2)].ps).pos, false)); } break; case 171: -/* Line 1464 of yacc.c */ +/* Line 1806 of yacc.c */ #line 586 "camp.y" { (yyval.e) = new ternaryExp((yyvsp[(1) - (4)].ps).pos, (yyvsp[(2) - (4)].e), (yyvsp[(1) - (4)].ps).sym, (yyvsp[(4) - (4)].e), - new booleanExp((yyvsp[(1) - (4)].ps).pos, false)); ;} + new booleanExp((yyvsp[(1) - (4)].ps).pos, false)); } break; case 172: -/* Line 1464 of yacc.c */ +/* Line 1806 of yacc.c */ #line 589 "camp.y" { (yyval.e) = new binaryExp((yyvsp[(1) - (3)].ps).pos, (yyvsp[(3) - (3)].e), (yyvsp[(1) - (3)].ps).sym, - new booleanExp((yyvsp[(2) - (3)].ps).pos, true)); ;} + new booleanExp((yyvsp[(2) - (3)].ps).pos, true)); } break; case 173: -/* Line 1464 of yacc.c */ +/* Line 1806 of yacc.c */ #line 592 "camp.y" { (yyval.e) = new ternaryExp((yyvsp[(1) - (5)].ps).pos, (yyvsp[(3) - (5)].e), (yyvsp[(1) - (5)].ps).sym, (yyvsp[(5) - (5)].e), - new booleanExp((yyvsp[(2) - (5)].ps).pos, true)); ;} + new booleanExp((yyvsp[(2) - (5)].ps).pos, true)); } break; case 174: -/* Line 1464 of yacc.c */ +/* Line 1806 of yacc.c */ #line 597 "camp.y" - { (yyval.e) = new unaryExp((yyvsp[(1) - (2)].ps).pos, (yyvsp[(2) - (2)].e), (yyvsp[(1) - (2)].ps).sym); ;} + { (yyval.e) = new unaryExp((yyvsp[(1) - (2)].ps).pos, (yyvsp[(2) - (2)].e), (yyvsp[(1) - (2)].ps).sym); } break; case 175: -/* Line 1464 of yacc.c */ +/* Line 1806 of yacc.c */ #line 599 "camp.y" - { (yyval.e) = new binaryExp((yyvsp[(1) - (4)].ps).pos, (yyvsp[(2) - (4)].e), (yyvsp[(1) - (4)].ps).sym, (yyvsp[(4) - (4)].e)); ;} + { (yyval.e) = new binaryExp((yyvsp[(1) - (4)].ps).pos, (yyvsp[(2) - (4)].e), (yyvsp[(1) - (4)].ps).sym, (yyvsp[(4) - (4)].e)); } break; case 176: -/* Line 1464 of yacc.c */ +/* Line 1806 of yacc.c */ #line 603 "camp.y" - { (yyval.s) = new emptyStm((yyvsp[(1) - (1)].pos)); ;} + { (yyval.s) = new emptyStm((yyvsp[(1) - (1)].pos)); } break; case 177: -/* Line 1464 of yacc.c */ +/* Line 1806 of yacc.c */ #line 604 "camp.y" - { (yyval.s) = (yyvsp[(1) - (1)].s); ;} + { (yyval.s) = (yyvsp[(1) - (1)].s); } break; case 178: -/* Line 1464 of yacc.c */ +/* Line 1806 of yacc.c */ #line 605 "camp.y" - { (yyval.s) = (yyvsp[(1) - (2)].s); ;} + { (yyval.s) = (yyvsp[(1) - (2)].s); } break; case 179: -/* Line 1464 of yacc.c */ +/* Line 1806 of yacc.c */ #line 607 "camp.y" - { (yyval.s) = new ifStm((yyvsp[(1) - (5)].pos), (yyvsp[(3) - (5)].e), (yyvsp[(5) - (5)].s)); ;} + { (yyval.s) = new ifStm((yyvsp[(1) - (5)].pos), (yyvsp[(3) - (5)].e), (yyvsp[(5) - (5)].s)); } break; case 180: -/* Line 1464 of yacc.c */ +/* Line 1806 of yacc.c */ #line 609 "camp.y" - { (yyval.s) = new ifStm((yyvsp[(1) - (7)].pos), (yyvsp[(3) - (7)].e), (yyvsp[(5) - (7)].s), (yyvsp[(7) - (7)].s)); ;} + { (yyval.s) = new ifStm((yyvsp[(1) - (7)].pos), (yyvsp[(3) - (7)].e), (yyvsp[(5) - (7)].s), (yyvsp[(7) - (7)].s)); } break; case 181: -/* Line 1464 of yacc.c */ +/* Line 1806 of yacc.c */ #line 611 "camp.y" - { (yyval.s) = new whileStm((yyvsp[(1) - (5)].pos), (yyvsp[(3) - (5)].e), (yyvsp[(5) - (5)].s)); ;} + { (yyval.s) = new whileStm((yyvsp[(1) - (5)].pos), (yyvsp[(3) - (5)].e), (yyvsp[(5) - (5)].s)); } break; case 182: -/* Line 1464 of yacc.c */ +/* Line 1806 of yacc.c */ #line 613 "camp.y" - { (yyval.s) = new doStm((yyvsp[(1) - (7)].pos), (yyvsp[(2) - (7)].s), (yyvsp[(5) - (7)].e)); ;} + { (yyval.s) = new doStm((yyvsp[(1) - (7)].pos), (yyvsp[(2) - (7)].s), (yyvsp[(5) - (7)].e)); } break; case 183: -/* Line 1464 of yacc.c */ +/* Line 1806 of yacc.c */ #line 615 "camp.y" - { (yyval.s) = new forStm((yyvsp[(1) - (9)].pos), (yyvsp[(3) - (9)].run), (yyvsp[(5) - (9)].e), (yyvsp[(7) - (9)].sel), (yyvsp[(9) - (9)].s)); ;} + { (yyval.s) = new forStm((yyvsp[(1) - (9)].pos), (yyvsp[(3) - (9)].run), (yyvsp[(5) - (9)].e), (yyvsp[(7) - (9)].sel), (yyvsp[(9) - (9)].s)); } break; case 184: -/* Line 1464 of yacc.c */ +/* Line 1806 of yacc.c */ #line 617 "camp.y" - { (yyval.s) = new extendedForStm((yyvsp[(1) - (8)].pos), (yyvsp[(3) - (8)].t), (yyvsp[(4) - (8)].ps).sym, (yyvsp[(6) - (8)].e), (yyvsp[(8) - (8)].s)); ;} + { (yyval.s) = new extendedForStm((yyvsp[(1) - (8)].pos), (yyvsp[(3) - (8)].t), (yyvsp[(4) - (8)].ps).sym, (yyvsp[(6) - (8)].e), (yyvsp[(8) - (8)].s)); } break; case 185: -/* Line 1464 of yacc.c */ +/* Line 1806 of yacc.c */ #line 618 "camp.y" - { (yyval.s) = new breakStm((yyvsp[(1) - (2)].pos)); ;} + { (yyval.s) = new breakStm((yyvsp[(1) - (2)].pos)); } break; case 186: -/* Line 1464 of yacc.c */ +/* Line 1806 of yacc.c */ #line 619 "camp.y" - { (yyval.s) = new continueStm((yyvsp[(1) - (2)].pos)); ;} + { (yyval.s) = new continueStm((yyvsp[(1) - (2)].pos)); } break; case 187: -/* Line 1464 of yacc.c */ +/* Line 1806 of yacc.c */ #line 620 "camp.y" - { (yyval.s) = new returnStm((yyvsp[(1) - (2)].pos)); ;} + { (yyval.s) = new returnStm((yyvsp[(1) - (2)].pos)); } break; case 188: -/* Line 1464 of yacc.c */ +/* Line 1806 of yacc.c */ #line 621 "camp.y" - { (yyval.s) = new returnStm((yyvsp[(1) - (3)].pos), (yyvsp[(2) - (3)].e)); ;} + { (yyval.s) = new returnStm((yyvsp[(1) - (3)].pos), (yyvsp[(2) - (3)].e)); } break; case 189: -/* Line 1464 of yacc.c */ +/* Line 1806 of yacc.c */ #line 625 "camp.y" - { (yyval.s) = new expStm((yyvsp[(1) - (1)].e)->getPos(), (yyvsp[(1) - (1)].e)); ;} + { (yyval.s) = new expStm((yyvsp[(1) - (1)].e)->getPos(), (yyvsp[(1) - (1)].e)); } break; case 190: -/* Line 1464 of yacc.c */ +/* Line 1806 of yacc.c */ #line 629 "camp.y" - { (yyval.s) = new blockStm((yyvsp[(1) - (1)].b)->getPos(), (yyvsp[(1) - (1)].b)); ;} + { (yyval.s) = new blockStm((yyvsp[(1) - (1)].b)->getPos(), (yyvsp[(1) - (1)].b)); } break; case 191: -/* Line 1464 of yacc.c */ +/* Line 1806 of yacc.c */ #line 633 "camp.y" - { (yyval.run) = 0; ;} + { (yyval.run) = 0; } break; case 192: -/* Line 1464 of yacc.c */ +/* Line 1806 of yacc.c */ #line 634 "camp.y" - { (yyval.run) = (yyvsp[(1) - (1)].sel); ;} + { (yyval.run) = (yyvsp[(1) - (1)].sel); } break; case 193: -/* Line 1464 of yacc.c */ +/* Line 1806 of yacc.c */ #line 635 "camp.y" - { (yyval.run) = (yyvsp[(1) - (1)].vd); ;} + { (yyval.run) = (yyvsp[(1) - (1)].vd); } break; case 194: -/* Line 1464 of yacc.c */ +/* Line 1806 of yacc.c */ #line 639 "camp.y" - { (yyval.e) = 0; ;} + { (yyval.e) = 0; } break; case 195: -/* Line 1464 of yacc.c */ +/* Line 1806 of yacc.c */ #line 640 "camp.y" - { (yyval.e) = (yyvsp[(1) - (1)].e); ;} + { (yyval.e) = (yyvsp[(1) - (1)].e); } break; case 196: -/* Line 1464 of yacc.c */ +/* Line 1806 of yacc.c */ #line 644 "camp.y" - { (yyval.sel) = 0; ;} + { (yyval.sel) = 0; } break; case 197: -/* Line 1464 of yacc.c */ +/* Line 1806 of yacc.c */ #line 645 "camp.y" - { (yyval.sel) = (yyvsp[(1) - (1)].sel); ;} + { (yyval.sel) = (yyvsp[(1) - (1)].sel); } break; case 198: -/* Line 1464 of yacc.c */ +/* Line 1806 of yacc.c */ #line 649 "camp.y" - { (yyval.sel) = new stmExpList((yyvsp[(1) - (1)].s)->getPos()); (yyval.sel)->add((yyvsp[(1) - (1)].s)); ;} + { (yyval.sel) = new stmExpList((yyvsp[(1) - (1)].s)->getPos()); (yyval.sel)->add((yyvsp[(1) - (1)].s)); } break; case 199: -/* Line 1464 of yacc.c */ +/* Line 1806 of yacc.c */ #line 651 "camp.y" - { (yyval.sel) = (yyvsp[(1) - (3)].sel); (yyval.sel)->add((yyvsp[(3) - (3)].s)); ;} + { (yyval.sel) = (yyvsp[(1) - (3)].sel); (yyval.sel)->add((yyvsp[(3) - (3)].s)); } break; -/* Line 1464 of yacc.c */ -#line 3621 "camp.tab.c" +/* Line 1806 of yacc.c */ +#line 3590 "camp.tab.c" default: break; } + /* User semantic actions sometimes alter yychar, and that requires + that yytoken be updated with the new translation. We take the + approach of translating immediately before every use of yytoken. + One alternative is translating here after every semantic action, + but that translation would be missed if the semantic action invokes + YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or + if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an + incorrect destructor might then be invoked immediately. In the + case of YYERROR or YYBACKUP, subsequent parser actions might lead + to an incorrect destructor call or verbose syntax error message + before the lookahead is translated. */ YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); YYPOPSTACK (yylen); @@ -3647,6 +3627,10 @@ yyreduce: | yyerrlab -- here on detecting error | `------------------------------------*/ yyerrlab: + /* Make sure we have latest lookahead translation. See comments at + user semantic actions for why this is necessary. */ + yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar); + /* If not already recovering from an error, report this error. */ if (!yyerrstatus) { @@ -3654,37 +3638,36 @@ yyerrlab: #if ! YYERROR_VERBOSE yyerror (YY_("syntax error")); #else +# define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \ + yyssp, yytoken) { - YYSIZE_T yysize = yysyntax_error (0, yystate, yychar); - if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM) - { - YYSIZE_T yyalloc = 2 * yysize; - if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM)) - yyalloc = YYSTACK_ALLOC_MAXIMUM; - if (yymsg != yymsgbuf) - YYSTACK_FREE (yymsg); - yymsg = (char *) YYSTACK_ALLOC (yyalloc); - if (yymsg) - yymsg_alloc = yyalloc; - else - { - yymsg = yymsgbuf; - yymsg_alloc = sizeof yymsgbuf; - } - } - - if (0 < yysize && yysize <= yymsg_alloc) - { - (void) yysyntax_error (yymsg, yystate, yychar); - yyerror (yymsg); - } - else - { - yyerror (YY_("syntax error")); - if (yysize != 0) - goto yyexhaustedlab; - } + char const *yymsgp = YY_("syntax error"); + int yysyntax_error_status; + yysyntax_error_status = YYSYNTAX_ERROR; + if (yysyntax_error_status == 0) + yymsgp = yymsg; + else if (yysyntax_error_status == 1) + { + if (yymsg != yymsgbuf) + YYSTACK_FREE (yymsg); + yymsg = (char *) YYSTACK_ALLOC (yymsg_alloc); + if (!yymsg) + { + yymsg = yymsgbuf; + yymsg_alloc = sizeof yymsgbuf; + yysyntax_error_status = 2; + } + else + { + yysyntax_error_status = YYSYNTAX_ERROR; + yymsgp = yymsg; + } + } + yyerror (yymsgp); + if (yysyntax_error_status == 2) + goto yyexhaustedlab; } +# undef YYSYNTAX_ERROR #endif } @@ -3743,7 +3726,7 @@ yyerrlab1: for (;;) { yyn = yypact[yystate]; - if (yyn != YYPACT_NINF) + if (!yypact_value_is_default (yyn)) { yyn += YYTERROR; if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) @@ -3802,8 +3785,13 @@ yyexhaustedlab: yyreturn: if (yychar != YYEMPTY) - yydestruct ("Cleanup: discarding lookahead", - yytoken, &yylval); + { + /* Make sure we have latest lookahead translation. See comments at + user semantic actions for why this is necessary. */ + yytoken = YYTRANSLATE (yychar); + yydestruct ("Cleanup: discarding lookahead", + yytoken, &yylval); + } /* Do not reclaim the symbols of the rule which action triggered this YYABORT or YYACCEPT. */ YYPOPSTACK (yylen); diff --git a/Build/source/utils/asymptote/camp.tab.h b/Build/source/utils/asymptote/camp.tab.h index 50a6b1966f5..79c827add98 100644 --- a/Build/source/utils/asymptote/camp.tab.h +++ b/Build/source/utils/asymptote/camp.tab.h @@ -1,9 +1,8 @@ -/* A Bison parser, made by GNU Bison 2.4.3. */ +/* A Bison parser, made by GNU Bison 2.5. */ -/* Skeleton interface for Bison's Yacc-like parsers in C +/* Bison interface for Yacc-like parsers in C - Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006, - 2009, 2010 Free Software Foundation, Inc. + Copyright (C) 1984, 1989-1990, 2000-2011 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -103,7 +102,7 @@ typedef union YYSTYPE { -/* Line 1685 of yacc.c */ +/* Line 2068 of yacc.c */ #line 60 "camp.y" position pos; @@ -153,8 +152,8 @@ typedef union YYSTYPE -/* Line 1685 of yacc.c */ -#line 158 "camp.tab.h" +/* Line 2068 of yacc.c */ +#line 157 "camp.tab.h" } YYSTYPE; # define YYSTYPE_IS_TRIVIAL 1 # define yystype YYSTYPE /* obsolescent; will be withdrawn */ diff --git a/Build/source/utils/asymptote/camp.y b/Build/source/utils/asymptote/camp.y index 26d5a834e2a..33691100edb 100644 --- a/Build/source/utils/asymptote/camp.y +++ b/Build/source/utils/asymptote/camp.y @@ -169,7 +169,7 @@ using mem::string; %type <e> tension controls %type <se> dir %type <elist> dimexps -%type <alist> arglist +%type <alist> arglist tuple %type <s> stm stmexp blockstm %type <run> forinit %type <sel> forupdate stmexplist @@ -452,6 +452,12 @@ arglist: { $$ = $1; $$->addRest($3); } ; +/* A list of two or more expressions, separated by commas. */ +tuple: + exp ',' exp { $$ = new arglist(); $$->add($1); $$->add($3); } +| tuple ',' exp { $$ = $1; $$->add($3); } +; + exp: name { $$ = new nameExp($1->getPos(), $1); } | value { $$ = $1; } @@ -514,13 +520,7 @@ exp: | exp '?' exp ':' exp { $$ = new conditionalExp($2, $1, $3, $5); } | exp ASSIGN exp { $$ = new assignExp($2, $1, $3); } -// Camp stuff -| '(' exp ',' exp ')' - { $$ = new pairExp($1, $2, $4); } -| '(' exp ',' exp ',' exp ')' - { $$ = new tripleExp($1, $2, $4, $6); } -| '(' exp ',' exp ',' exp ',' exp ',' exp ',' exp ')' - { $$ = new transformExp($1, $2, $4, $6, $8, $10, $12); } +| '(' tuple ')' { $$ = new callExp($1, new nameExp($1, SYM_TUPLE), $2); } | exp join exp %prec JOIN_PREC { $2->pushFront($1); $2->pushBack($3); $$ = $2; } | exp dir %prec DIRTAG diff --git a/Build/source/utils/asymptote/common.h b/Build/source/utils/asymptote/common.h index d9b26a24e3f..5d41285f79e 100644 --- a/Build/source/utils/asymptote/common.h +++ b/Build/source/utils/asymptote/common.h @@ -7,6 +7,8 @@ #ifndef COMMON_H #define COMMON_H +#undef NDEBUG + #include <iostream> #include <climits> @@ -21,12 +23,12 @@ #include "config.h" #endif -#if defined(HAVE_LIBGLU) && \ +#if !defined(FOR_SHARED) && defined(HAVE_LIBGLU) && \ ((defined(HAVE_LIBGL) && defined(HAVE_LIBGLUT)) || defined(HAVE_LIBOSMESA)) #define HAVE_GL #endif -#ifdef HAVE_LIBPTHREAD +#ifdef HAVE_PTHREAD #include <pthread.h> #endif diff --git a/Build/source/utils/asymptote/config.guess b/Build/source/utils/asymptote/config.guess new file mode 100644 index 00000000000..d622a44e551 --- /dev/null +++ b/Build/source/utils/asymptote/config.guess @@ -0,0 +1,1530 @@ +#! /bin/sh +# Attempt to guess a canonical system name. +# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, +# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, +# 2011, 2012 Free Software Foundation, Inc. + +timestamp='2012-02-10' + +# This file is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, see <http://www.gnu.org/licenses/>. +# +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + + +# Originally written by Per Bothner. Please send patches (context +# diff format) to <config-patches@gnu.org> and include a ChangeLog +# entry. +# +# This script attempts to guess a canonical system name similar to +# config.sub. If it succeeds, it prints the system name on stdout, and +# exits with 0. Otherwise, it exits with 1. +# +# You can get the latest version of this script from: +# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD + +me=`echo "$0" | sed -e 's,.*/,,'` + +usage="\ +Usage: $0 [OPTION] + +Output the configuration name of the system \`$me' is run on. + +Operation modes: + -h, --help print this help, then exit + -t, --time-stamp print date of last modification, then exit + -v, --version print version number, then exit + +Report bugs and patches to <config-patches@gnu.org>." + +version="\ +GNU config.guess ($timestamp) + +Originally written by Per Bothner. +Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, +2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 +Free Software Foundation, Inc. + +This is free software; see the source for copying conditions. There is NO +warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." + +help=" +Try \`$me --help' for more information." + +# Parse command line +while test $# -gt 0 ; do + case $1 in + --time-stamp | --time* | -t ) + echo "$timestamp" ; exit ;; + --version | -v ) + echo "$version" ; exit ;; + --help | --h* | -h ) + echo "$usage"; exit ;; + -- ) # Stop option processing + shift; break ;; + - ) # Use stdin as input. + break ;; + -* ) + echo "$me: invalid option $1$help" >&2 + exit 1 ;; + * ) + break ;; + esac +done + +if test $# != 0; then + echo "$me: too many arguments$help" >&2 + exit 1 +fi + +trap 'exit 1' 1 2 15 + +# CC_FOR_BUILD -- compiler used by this script. Note that the use of a +# compiler to aid in system detection is discouraged as it requires +# temporary files to be created and, as you can see below, it is a +# headache to deal with in a portable fashion. + +# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still +# use `HOST_CC' if defined, but it is deprecated. + +# Portable tmp directory creation inspired by the Autoconf team. + +set_cc_for_build=' +trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; +trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; +: ${TMPDIR=/tmp} ; + { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || + { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || + { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } || + { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; +dummy=$tmp/dummy ; +tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ; +case $CC_FOR_BUILD,$HOST_CC,$CC in + ,,) echo "int x;" > $dummy.c ; + for c in cc gcc c89 c99 ; do + if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then + CC_FOR_BUILD="$c"; break ; + fi ; + done ; + if test x"$CC_FOR_BUILD" = x ; then + CC_FOR_BUILD=no_compiler_found ; + fi + ;; + ,,*) CC_FOR_BUILD=$CC ;; + ,*,*) CC_FOR_BUILD=$HOST_CC ;; +esac ; set_cc_for_build= ;' + +# This is needed to find uname on a Pyramid OSx when run in the BSD universe. +# (ghazi@noc.rutgers.edu 1994-08-24) +if (test -f /.attbin/uname) >/dev/null 2>&1 ; then + PATH=$PATH:/.attbin ; export PATH +fi + +UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown +UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown +UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown +UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown + +# Note: order is significant - the case branches are not exclusive. + +case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in + *:NetBSD:*:*) + # NetBSD (nbsd) targets should (where applicable) match one or + # more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*, + # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently + # switched to ELF, *-*-netbsd* would select the old + # object file format. This provides both forward + # compatibility and a consistent mechanism for selecting the + # object file format. + # + # Note: NetBSD doesn't particularly care about the vendor + # portion of the name. We always set it to "unknown". + sysctl="sysctl -n hw.machine_arch" + UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \ + /usr/sbin/$sysctl 2>/dev/null || echo unknown)` + case "${UNAME_MACHINE_ARCH}" in + armeb) machine=armeb-unknown ;; + arm*) machine=arm-unknown ;; + sh3el) machine=shl-unknown ;; + sh3eb) machine=sh-unknown ;; + sh5el) machine=sh5le-unknown ;; + *) machine=${UNAME_MACHINE_ARCH}-unknown ;; + esac + # The Operating System including object format, if it has switched + # to ELF recently, or will in the future. + case "${UNAME_MACHINE_ARCH}" in + arm*|i386|m68k|ns32k|sh3*|sparc|vax) + eval $set_cc_for_build + if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ + | grep -q __ELF__ + then + # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). + # Return netbsd for either. FIX? + os=netbsd + else + os=netbsdelf + fi + ;; + *) + os=netbsd + ;; + esac + # The OS release + # Debian GNU/NetBSD machines have a different userland, and + # thus, need a distinct triplet. However, they do not need + # kernel version information, so it can be replaced with a + # suitable tag, in the style of linux-gnu. + case "${UNAME_VERSION}" in + Debian*) + release='-gnu' + ;; + *) + release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` + ;; + esac + # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: + # contains redundant information, the shorter form: + # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. + echo "${machine}-${os}${release}" + exit ;; + *:OpenBSD:*:*) + UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` + echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE} + exit ;; + *:ekkoBSD:*:*) + echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} + exit ;; + *:SolidBSD:*:*) + echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE} + exit ;; + macppc:MirBSD:*:*) + echo powerpc-unknown-mirbsd${UNAME_RELEASE} + exit ;; + *:MirBSD:*:*) + echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} + exit ;; + alpha:OSF1:*:*) + case $UNAME_RELEASE in + *4.0) + UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` + ;; + *5.*) + UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` + ;; + esac + # According to Compaq, /usr/sbin/psrinfo has been available on + # OSF/1 and Tru64 systems produced since 1995. I hope that + # covers most systems running today. This code pipes the CPU + # types through head -n 1, so we only detect the type of CPU 0. + ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` + case "$ALPHA_CPU_TYPE" in + "EV4 (21064)") + UNAME_MACHINE="alpha" ;; + "EV4.5 (21064)") + UNAME_MACHINE="alpha" ;; + "LCA4 (21066/21068)") + UNAME_MACHINE="alpha" ;; + "EV5 (21164)") + UNAME_MACHINE="alphaev5" ;; + "EV5.6 (21164A)") + UNAME_MACHINE="alphaev56" ;; + "EV5.6 (21164PC)") + UNAME_MACHINE="alphapca56" ;; + "EV5.7 (21164PC)") + UNAME_MACHINE="alphapca57" ;; + "EV6 (21264)") + UNAME_MACHINE="alphaev6" ;; + "EV6.7 (21264A)") + UNAME_MACHINE="alphaev67" ;; + "EV6.8CB (21264C)") + UNAME_MACHINE="alphaev68" ;; + "EV6.8AL (21264B)") + UNAME_MACHINE="alphaev68" ;; + "EV6.8CX (21264D)") + UNAME_MACHINE="alphaev68" ;; + "EV6.9A (21264/EV69A)") + UNAME_MACHINE="alphaev69" ;; + "EV7 (21364)") + UNAME_MACHINE="alphaev7" ;; + "EV7.9 (21364A)") + UNAME_MACHINE="alphaev79" ;; + esac + # A Pn.n version is a patched version. + # A Vn.n version is a released version. + # A Tn.n version is a released field test version. + # A Xn.n version is an unreleased experimental baselevel. + # 1.2 uses "1.2" for uname -r. + echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + # Reset EXIT trap before exiting to avoid spurious non-zero exit code. + exitcode=$? + trap '' 0 + exit $exitcode ;; + Alpha\ *:Windows_NT*:*) + # How do we know it's Interix rather than the generic POSIX subsystem? + # Should we change UNAME_MACHINE based on the output of uname instead + # of the specific Alpha model? + echo alpha-pc-interix + exit ;; + 21064:Windows_NT:50:3) + echo alpha-dec-winnt3.5 + exit ;; + Amiga*:UNIX_System_V:4.0:*) + echo m68k-unknown-sysv4 + exit ;; + *:[Aa]miga[Oo][Ss]:*:*) + echo ${UNAME_MACHINE}-unknown-amigaos + exit ;; + *:[Mm]orph[Oo][Ss]:*:*) + echo ${UNAME_MACHINE}-unknown-morphos + exit ;; + *:OS/390:*:*) + echo i370-ibm-openedition + exit ;; + *:z/VM:*:*) + echo s390-ibm-zvmoe + exit ;; + *:OS400:*:*) + echo powerpc-ibm-os400 + exit ;; + arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) + echo arm-acorn-riscix${UNAME_RELEASE} + exit ;; + arm:riscos:*:*|arm:RISCOS:*:*) + echo arm-unknown-riscos + exit ;; + SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) + echo hppa1.1-hitachi-hiuxmpp + exit ;; + Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) + # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. + if test "`(/bin/universe) 2>/dev/null`" = att ; then + echo pyramid-pyramid-sysv3 + else + echo pyramid-pyramid-bsd + fi + exit ;; + NILE*:*:*:dcosx) + echo pyramid-pyramid-svr4 + exit ;; + DRS?6000:unix:4.0:6*) + echo sparc-icl-nx6 + exit ;; + DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) + case `/usr/bin/uname -p` in + sparc) echo sparc-icl-nx7; exit ;; + esac ;; + s390x:SunOS:*:*) + echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + sun4H:SunOS:5.*:*) + echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) + echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*) + echo i386-pc-auroraux${UNAME_RELEASE} + exit ;; + i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) + eval $set_cc_for_build + SUN_ARCH="i386" + # If there is a compiler, see if it is configured for 64-bit objects. + # Note that the Sun cc does not turn __LP64__ into 1 like gcc does. + # This test works for both compilers. + if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then + if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \ + (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ + grep IS_64BIT_ARCH >/dev/null + then + SUN_ARCH="x86_64" + fi + fi + echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + sun4*:SunOS:6*:*) + # According to config.sub, this is the proper way to canonicalize + # SunOS6. Hard to guess exactly what SunOS6 will be like, but + # it's likely to be more like Solaris than SunOS4. + echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + sun4*:SunOS:*:*) + case "`/usr/bin/arch -k`" in + Series*|S4*) + UNAME_RELEASE=`uname -v` + ;; + esac + # Japanese Language versions have a version number like `4.1.3-JL'. + echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` + exit ;; + sun3*:SunOS:*:*) + echo m68k-sun-sunos${UNAME_RELEASE} + exit ;; + sun*:*:4.2BSD:*) + UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` + test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 + case "`/bin/arch`" in + sun3) + echo m68k-sun-sunos${UNAME_RELEASE} + ;; + sun4) + echo sparc-sun-sunos${UNAME_RELEASE} + ;; + esac + exit ;; + aushp:SunOS:*:*) + echo sparc-auspex-sunos${UNAME_RELEASE} + exit ;; + # The situation for MiNT is a little confusing. The machine name + # can be virtually everything (everything which is not + # "atarist" or "atariste" at least should have a processor + # > m68000). The system name ranges from "MiNT" over "FreeMiNT" + # to the lowercase version "mint" (or "freemint"). Finally + # the system name "TOS" denotes a system which is actually not + # MiNT. But MiNT is downward compatible to TOS, so this should + # be no problem. + atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) + echo m68k-atari-mint${UNAME_RELEASE} + exit ;; + atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) + echo m68k-atari-mint${UNAME_RELEASE} + exit ;; + *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) + echo m68k-atari-mint${UNAME_RELEASE} + exit ;; + milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) + echo m68k-milan-mint${UNAME_RELEASE} + exit ;; + hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) + echo m68k-hades-mint${UNAME_RELEASE} + exit ;; + *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) + echo m68k-unknown-mint${UNAME_RELEASE} + exit ;; + m68k:machten:*:*) + echo m68k-apple-machten${UNAME_RELEASE} + exit ;; + powerpc:machten:*:*) + echo powerpc-apple-machten${UNAME_RELEASE} + exit ;; + RISC*:Mach:*:*) + echo mips-dec-mach_bsd4.3 + exit ;; + RISC*:ULTRIX:*:*) + echo mips-dec-ultrix${UNAME_RELEASE} + exit ;; + VAX*:ULTRIX*:*:*) + echo vax-dec-ultrix${UNAME_RELEASE} + exit ;; + 2020:CLIX:*:* | 2430:CLIX:*:*) + echo clipper-intergraph-clix${UNAME_RELEASE} + exit ;; + mips:*:*:UMIPS | mips:*:*:RISCos) + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c +#ifdef __cplusplus +#include <stdio.h> /* for printf() prototype */ + int main (int argc, char *argv[]) { +#else + int main (argc, argv) int argc; char *argv[]; { +#endif + #if defined (host_mips) && defined (MIPSEB) + #if defined (SYSTYPE_SYSV) + printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); + #endif + #if defined (SYSTYPE_SVR4) + printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); + #endif + #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) + printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); + #endif + #endif + exit (-1); + } +EOF + $CC_FOR_BUILD -o $dummy $dummy.c && + dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` && + SYSTEM_NAME=`$dummy $dummyarg` && + { echo "$SYSTEM_NAME"; exit; } + echo mips-mips-riscos${UNAME_RELEASE} + exit ;; + Motorola:PowerMAX_OS:*:*) + echo powerpc-motorola-powermax + exit ;; + Motorola:*:4.3:PL8-*) + echo powerpc-harris-powermax + exit ;; + Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) + echo powerpc-harris-powermax + exit ;; + Night_Hawk:Power_UNIX:*:*) + echo powerpc-harris-powerunix + exit ;; + m88k:CX/UX:7*:*) + echo m88k-harris-cxux7 + exit ;; + m88k:*:4*:R4*) + echo m88k-motorola-sysv4 + exit ;; + m88k:*:3*:R3*) + echo m88k-motorola-sysv3 + exit ;; + AViiON:dgux:*:*) + # DG/UX returns AViiON for all architectures + UNAME_PROCESSOR=`/usr/bin/uname -p` + if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] + then + if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ + [ ${TARGET_BINARY_INTERFACE}x = x ] + then + echo m88k-dg-dgux${UNAME_RELEASE} + else + echo m88k-dg-dguxbcs${UNAME_RELEASE} + fi + else + echo i586-dg-dgux${UNAME_RELEASE} + fi + exit ;; + M88*:DolphinOS:*:*) # DolphinOS (SVR3) + echo m88k-dolphin-sysv3 + exit ;; + M88*:*:R3*:*) + # Delta 88k system running SVR3 + echo m88k-motorola-sysv3 + exit ;; + XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) + echo m88k-tektronix-sysv3 + exit ;; + Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) + echo m68k-tektronix-bsd + exit ;; + *:IRIX*:*:*) + echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` + exit ;; + ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. + echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id + exit ;; # Note that: echo "'`uname -s`'" gives 'AIX ' + i*86:AIX:*:*) + echo i386-ibm-aix + exit ;; + ia64:AIX:*:*) + if [ -x /usr/bin/oslevel ] ; then + IBM_REV=`/usr/bin/oslevel` + else + IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} + fi + echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} + exit ;; + *:AIX:2:3) + if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #include <sys/systemcfg.h> + + main() + { + if (!__power_pc()) + exit(1); + puts("powerpc-ibm-aix3.2.5"); + exit(0); + } +EOF + if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` + then + echo "$SYSTEM_NAME" + else + echo rs6000-ibm-aix3.2.5 + fi + elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then + echo rs6000-ibm-aix3.2.4 + else + echo rs6000-ibm-aix3.2 + fi + exit ;; + *:AIX:*:[4567]) + IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` + if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then + IBM_ARCH=rs6000 + else + IBM_ARCH=powerpc + fi + if [ -x /usr/bin/oslevel ] ; then + IBM_REV=`/usr/bin/oslevel` + else + IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} + fi + echo ${IBM_ARCH}-ibm-aix${IBM_REV} + exit ;; + *:AIX:*:*) + echo rs6000-ibm-aix + exit ;; + ibmrt:4.4BSD:*|romp-ibm:BSD:*) + echo romp-ibm-bsd4.4 + exit ;; + ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and + echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to + exit ;; # report: romp-ibm BSD 4.3 + *:BOSX:*:*) + echo rs6000-bull-bosx + exit ;; + DPX/2?00:B.O.S.:*:*) + echo m68k-bull-sysv3 + exit ;; + 9000/[34]??:4.3bsd:1.*:*) + echo m68k-hp-bsd + exit ;; + hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) + echo m68k-hp-bsd4.4 + exit ;; + 9000/[34678]??:HP-UX:*:*) + HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` + case "${UNAME_MACHINE}" in + 9000/31? ) HP_ARCH=m68000 ;; + 9000/[34]?? ) HP_ARCH=m68k ;; + 9000/[678][0-9][0-9]) + if [ -x /usr/bin/getconf ]; then + sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` + sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` + case "${sc_cpu_version}" in + 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 + 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 + 532) # CPU_PA_RISC2_0 + case "${sc_kernel_bits}" in + 32) HP_ARCH="hppa2.0n" ;; + 64) HP_ARCH="hppa2.0w" ;; + '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20 + esac ;; + esac + fi + if [ "${HP_ARCH}" = "" ]; then + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + + #define _HPUX_SOURCE + #include <stdlib.h> + #include <unistd.h> + + int main () + { + #if defined(_SC_KERNEL_BITS) + long bits = sysconf(_SC_KERNEL_BITS); + #endif + long cpu = sysconf (_SC_CPU_VERSION); + + switch (cpu) + { + case CPU_PA_RISC1_0: puts ("hppa1.0"); break; + case CPU_PA_RISC1_1: puts ("hppa1.1"); break; + case CPU_PA_RISC2_0: + #if defined(_SC_KERNEL_BITS) + switch (bits) + { + case 64: puts ("hppa2.0w"); break; + case 32: puts ("hppa2.0n"); break; + default: puts ("hppa2.0"); break; + } break; + #else /* !defined(_SC_KERNEL_BITS) */ + puts ("hppa2.0"); break; + #endif + default: puts ("hppa1.0"); break; + } + exit (0); + } +EOF + (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` + test -z "$HP_ARCH" && HP_ARCH=hppa + fi ;; + esac + if [ ${HP_ARCH} = "hppa2.0w" ] + then + eval $set_cc_for_build + + # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating + # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler + # generating 64-bit code. GNU and HP use different nomenclature: + # + # $ CC_FOR_BUILD=cc ./config.guess + # => hppa2.0w-hp-hpux11.23 + # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess + # => hppa64-hp-hpux11.23 + + if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | + grep -q __LP64__ + then + HP_ARCH="hppa2.0w" + else + HP_ARCH="hppa64" + fi + fi + echo ${HP_ARCH}-hp-hpux${HPUX_REV} + exit ;; + ia64:HP-UX:*:*) + HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` + echo ia64-hp-hpux${HPUX_REV} + exit ;; + 3050*:HI-UX:*:*) + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #include <unistd.h> + int + main () + { + long cpu = sysconf (_SC_CPU_VERSION); + /* The order matters, because CPU_IS_HP_MC68K erroneously returns + true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct + results, however. */ + if (CPU_IS_PA_RISC (cpu)) + { + switch (cpu) + { + case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; + case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; + case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; + default: puts ("hppa-hitachi-hiuxwe2"); break; + } + } + else if (CPU_IS_HP_MC68K (cpu)) + puts ("m68k-hitachi-hiuxwe2"); + else puts ("unknown-hitachi-hiuxwe2"); + exit (0); + } +EOF + $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` && + { echo "$SYSTEM_NAME"; exit; } + echo unknown-hitachi-hiuxwe2 + exit ;; + 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) + echo hppa1.1-hp-bsd + exit ;; + 9000/8??:4.3bsd:*:*) + echo hppa1.0-hp-bsd + exit ;; + *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) + echo hppa1.0-hp-mpeix + exit ;; + hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) + echo hppa1.1-hp-osf + exit ;; + hp8??:OSF1:*:*) + echo hppa1.0-hp-osf + exit ;; + i*86:OSF1:*:*) + if [ -x /usr/sbin/sysversion ] ; then + echo ${UNAME_MACHINE}-unknown-osf1mk + else + echo ${UNAME_MACHINE}-unknown-osf1 + fi + exit ;; + parisc*:Lites*:*:*) + echo hppa1.1-hp-lites + exit ;; + C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) + echo c1-convex-bsd + exit ;; + C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) + if getsysinfo -f scalar_acc + then echo c32-convex-bsd + else echo c2-convex-bsd + fi + exit ;; + C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) + echo c34-convex-bsd + exit ;; + C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) + echo c38-convex-bsd + exit ;; + C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) + echo c4-convex-bsd + exit ;; + CRAY*Y-MP:*:*:*) + echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit ;; + CRAY*[A-Z]90:*:*:*) + echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ + | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ + -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ + -e 's/\.[^.]*$/.X/' + exit ;; + CRAY*TS:*:*:*) + echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit ;; + CRAY*T3E:*:*:*) + echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit ;; + CRAY*SV1:*:*:*) + echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit ;; + *:UNICOS/mp:*:*) + echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit ;; + F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) + FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` + FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` + echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" + exit ;; + 5000:UNIX_System_V:4.*:*) + FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` + FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'` + echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" + exit ;; + i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) + echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} + exit ;; + sparc*:BSD/OS:*:*) + echo sparc-unknown-bsdi${UNAME_RELEASE} + exit ;; + *:BSD/OS:*:*) + echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} + exit ;; + *:FreeBSD:*:*) + UNAME_PROCESSOR=`/usr/bin/uname -p` + case ${UNAME_PROCESSOR} in + amd64) + echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; + *) + echo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; + esac + exit ;; + i*:CYGWIN*:*) + echo ${UNAME_MACHINE}-pc-cygwin + exit ;; + *:MINGW*:*) + echo ${UNAME_MACHINE}-pc-mingw32 + exit ;; + i*:MSYS*:*) + echo ${UNAME_MACHINE}-pc-msys + exit ;; + i*:windows32*:*) + # uname -m includes "-pc" on this system. + echo ${UNAME_MACHINE}-mingw32 + exit ;; + i*:PW*:*) + echo ${UNAME_MACHINE}-pc-pw32 + exit ;; + *:Interix*:*) + case ${UNAME_MACHINE} in + x86) + echo i586-pc-interix${UNAME_RELEASE} + exit ;; + authenticamd | genuineintel | EM64T) + echo x86_64-unknown-interix${UNAME_RELEASE} + exit ;; + IA64) + echo ia64-unknown-interix${UNAME_RELEASE} + exit ;; + esac ;; + [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) + echo i${UNAME_MACHINE}-pc-mks + exit ;; + 8664:Windows_NT:*) + echo x86_64-pc-mks + exit ;; + i*:Windows_NT*:* | Pentium*:Windows_NT*:*) + # How do we know it's Interix rather than the generic POSIX subsystem? + # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we + # UNAME_MACHINE based on the output of uname instead of i386? + echo i586-pc-interix + exit ;; + i*:UWIN*:*) + echo ${UNAME_MACHINE}-pc-uwin + exit ;; + amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) + echo x86_64-unknown-cygwin + exit ;; + p*:CYGWIN*:*) + echo powerpcle-unknown-cygwin + exit ;; + prep*:SunOS:5.*:*) + echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + *:GNU:*:*) + # the GNU system + echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` + exit ;; + *:GNU/*:*:*) + # other systems with GNU libc and userland + echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu + exit ;; + i*86:Minix:*:*) + echo ${UNAME_MACHINE}-pc-minix + exit ;; + aarch64:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + aarch64_be:Linux:*:*) + UNAME_MACHINE=aarch64_be + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + alpha:Linux:*:*) + case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in + EV5) UNAME_MACHINE=alphaev5 ;; + EV56) UNAME_MACHINE=alphaev56 ;; + PCA56) UNAME_MACHINE=alphapca56 ;; + PCA57) UNAME_MACHINE=alphapca56 ;; + EV6) UNAME_MACHINE=alphaev6 ;; + EV67) UNAME_MACHINE=alphaev67 ;; + EV68*) UNAME_MACHINE=alphaev68 ;; + esac + objdump --private-headers /bin/sh | grep -q ld.so.1 + if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi + echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} + exit ;; + arm*:Linux:*:*) + eval $set_cc_for_build + if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ + | grep -q __ARM_EABI__ + then + echo ${UNAME_MACHINE}-unknown-linux-gnu + else + if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ + | grep -q __ARM_PCS_VFP + then + echo ${UNAME_MACHINE}-unknown-linux-gnueabi + else + echo ${UNAME_MACHINE}-unknown-linux-gnueabihf + fi + fi + exit ;; + avr32*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + cris:Linux:*:*) + echo ${UNAME_MACHINE}-axis-linux-gnu + exit ;; + crisv32:Linux:*:*) + echo ${UNAME_MACHINE}-axis-linux-gnu + exit ;; + frv:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + hexagon:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + i*86:Linux:*:*) + LIBC=gnu + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #ifdef __dietlibc__ + LIBC=dietlibc + #endif +EOF + eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'` + echo "${UNAME_MACHINE}-pc-linux-${LIBC}" + exit ;; + ia64:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + m32r*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + m68*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + mips:Linux:*:* | mips64:Linux:*:*) + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #undef CPU + #undef ${UNAME_MACHINE} + #undef ${UNAME_MACHINE}el + #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) + CPU=${UNAME_MACHINE}el + #else + #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) + CPU=${UNAME_MACHINE} + #else + CPU= + #endif + #endif +EOF + eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'` + test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } + ;; + or32:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + padre:Linux:*:*) + echo sparc-unknown-linux-gnu + exit ;; + parisc64:Linux:*:* | hppa64:Linux:*:*) + echo hppa64-unknown-linux-gnu + exit ;; + parisc:Linux:*:* | hppa:Linux:*:*) + # Look for CPU level + case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in + PA7*) echo hppa1.1-unknown-linux-gnu ;; + PA8*) echo hppa2.0-unknown-linux-gnu ;; + *) echo hppa-unknown-linux-gnu ;; + esac + exit ;; + ppc64:Linux:*:*) + echo powerpc64-unknown-linux-gnu + exit ;; + ppc:Linux:*:*) + echo powerpc-unknown-linux-gnu + exit ;; + s390:Linux:*:* | s390x:Linux:*:*) + echo ${UNAME_MACHINE}-ibm-linux + exit ;; + sh64*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + sh*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + sparc:Linux:*:* | sparc64:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + tile*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + vax:Linux:*:*) + echo ${UNAME_MACHINE}-dec-linux-gnu + exit ;; + x86_64:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + xtensa*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + i*86:DYNIX/ptx:4*:*) + # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. + # earlier versions are messed up and put the nodename in both + # sysname and nodename. + echo i386-sequent-sysv4 + exit ;; + i*86:UNIX_SV:4.2MP:2.*) + # Unixware is an offshoot of SVR4, but it has its own version + # number series starting with 2... + # I am not positive that other SVR4 systems won't match this, + # I just have to hope. -- rms. + # Use sysv4.2uw... so that sysv4* matches it. + echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} + exit ;; + i*86:OS/2:*:*) + # If we were able to find `uname', then EMX Unix compatibility + # is probably installed. + echo ${UNAME_MACHINE}-pc-os2-emx + exit ;; + i*86:XTS-300:*:STOP) + echo ${UNAME_MACHINE}-unknown-stop + exit ;; + i*86:atheos:*:*) + echo ${UNAME_MACHINE}-unknown-atheos + exit ;; + i*86:syllable:*:*) + echo ${UNAME_MACHINE}-pc-syllable + exit ;; + i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*) + echo i386-unknown-lynxos${UNAME_RELEASE} + exit ;; + i*86:*DOS:*:*) + echo ${UNAME_MACHINE}-pc-msdosdjgpp + exit ;; + i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) + UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` + if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then + echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} + else + echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} + fi + exit ;; + i*86:*:5:[678]*) + # UnixWare 7.x, OpenUNIX and OpenServer 6. + case `/bin/uname -X | grep "^Machine"` in + *486*) UNAME_MACHINE=i486 ;; + *Pentium) UNAME_MACHINE=i586 ;; + *Pent*|*Celeron) UNAME_MACHINE=i686 ;; + esac + echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} + exit ;; + i*86:*:3.2:*) + if test -f /usr/options/cb.name; then + UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name` + echo ${UNAME_MACHINE}-pc-isc$UNAME_REL + elif /bin/uname -X 2>/dev/null >/dev/null ; then + UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` + (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 + (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ + && UNAME_MACHINE=i586 + (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ + && UNAME_MACHINE=i686 + (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ + && UNAME_MACHINE=i686 + echo ${UNAME_MACHINE}-pc-sco$UNAME_REL + else + echo ${UNAME_MACHINE}-pc-sysv32 + fi + exit ;; + pc:*:*:*) + # Left here for compatibility: + # uname -m prints for DJGPP always 'pc', but it prints nothing about + # the processor, so we play safe by assuming i586. + # Note: whatever this is, it MUST be the same as what config.sub + # prints for the "djgpp" host, or else GDB configury will decide that + # this is a cross-build. + echo i586-pc-msdosdjgpp + exit ;; + Intel:Mach:3*:*) + echo i386-pc-mach3 + exit ;; + paragon:*:*:*) + echo i860-intel-osf1 + exit ;; + i860:*:4.*:*) # i860-SVR4 + if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then + echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 + else # Add other i860-SVR4 vendors below as they are discovered. + echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 + fi + exit ;; + mini*:CTIX:SYS*5:*) + # "miniframe" + echo m68010-convergent-sysv + exit ;; + mc68k:UNIX:SYSTEM5:3.51m) + echo m68k-convergent-sysv + exit ;; + M680?0:D-NIX:5.3:*) + echo m68k-diab-dnix + exit ;; + M68*:*:R3V[5678]*:*) + test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;; + 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0) + OS_REL='' + test -r /etc/.relid \ + && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` + /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ + && { echo i486-ncr-sysv4.3${OS_REL}; exit; } + /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ + && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; + 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) + /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ + && { echo i486-ncr-sysv4; exit; } ;; + NCR*:*:4.2:* | MPRAS*:*:4.2:*) + OS_REL='.3' + test -r /etc/.relid \ + && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` + /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ + && { echo i486-ncr-sysv4.3${OS_REL}; exit; } + /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ + && { echo i586-ncr-sysv4.3${OS_REL}; exit; } + /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \ + && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; + m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) + echo m68k-unknown-lynxos${UNAME_RELEASE} + exit ;; + mc68030:UNIX_System_V:4.*:*) + echo m68k-atari-sysv4 + exit ;; + TSUNAMI:LynxOS:2.*:*) + echo sparc-unknown-lynxos${UNAME_RELEASE} + exit ;; + rs6000:LynxOS:2.*:*) + echo rs6000-unknown-lynxos${UNAME_RELEASE} + exit ;; + PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*) + echo powerpc-unknown-lynxos${UNAME_RELEASE} + exit ;; + SM[BE]S:UNIX_SV:*:*) + echo mips-dde-sysv${UNAME_RELEASE} + exit ;; + RM*:ReliantUNIX-*:*:*) + echo mips-sni-sysv4 + exit ;; + RM*:SINIX-*:*:*) + echo mips-sni-sysv4 + exit ;; + *:SINIX-*:*:*) + if uname -p 2>/dev/null >/dev/null ; then + UNAME_MACHINE=`(uname -p) 2>/dev/null` + echo ${UNAME_MACHINE}-sni-sysv4 + else + echo ns32k-sni-sysv + fi + exit ;; + PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort + # says <Richard.M.Bartel@ccMail.Census.GOV> + echo i586-unisys-sysv4 + exit ;; + *:UNIX_System_V:4*:FTX*) + # From Gerald Hewes <hewes@openmarket.com>. + # How about differentiating between stratus architectures? -djm + echo hppa1.1-stratus-sysv4 + exit ;; + *:*:*:FTX*) + # From seanf@swdc.stratus.com. + echo i860-stratus-sysv4 + exit ;; + i*86:VOS:*:*) + # From Paul.Green@stratus.com. + echo ${UNAME_MACHINE}-stratus-vos + exit ;; + *:VOS:*:*) + # From Paul.Green@stratus.com. + echo hppa1.1-stratus-vos + exit ;; + mc68*:A/UX:*:*) + echo m68k-apple-aux${UNAME_RELEASE} + exit ;; + news*:NEWS-OS:6*:*) + echo mips-sony-newsos6 + exit ;; + R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) + if [ -d /usr/nec ]; then + echo mips-nec-sysv${UNAME_RELEASE} + else + echo mips-unknown-sysv${UNAME_RELEASE} + fi + exit ;; + BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. + echo powerpc-be-beos + exit ;; + BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. + echo powerpc-apple-beos + exit ;; + BePC:BeOS:*:*) # BeOS running on Intel PC compatible. + echo i586-pc-beos + exit ;; + BePC:Haiku:*:*) # Haiku running on Intel PC compatible. + echo i586-pc-haiku + exit ;; + SX-4:SUPER-UX:*:*) + echo sx4-nec-superux${UNAME_RELEASE} + exit ;; + SX-5:SUPER-UX:*:*) + echo sx5-nec-superux${UNAME_RELEASE} + exit ;; + SX-6:SUPER-UX:*:*) + echo sx6-nec-superux${UNAME_RELEASE} + exit ;; + SX-7:SUPER-UX:*:*) + echo sx7-nec-superux${UNAME_RELEASE} + exit ;; + SX-8:SUPER-UX:*:*) + echo sx8-nec-superux${UNAME_RELEASE} + exit ;; + SX-8R:SUPER-UX:*:*) + echo sx8r-nec-superux${UNAME_RELEASE} + exit ;; + Power*:Rhapsody:*:*) + echo powerpc-apple-rhapsody${UNAME_RELEASE} + exit ;; + *:Rhapsody:*:*) + echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} + exit ;; + *:Darwin:*:*) + UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown + case $UNAME_PROCESSOR in + i386) + eval $set_cc_for_build + if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then + if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ + (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ + grep IS_64BIT_ARCH >/dev/null + then + UNAME_PROCESSOR="x86_64" + fi + fi ;; + unknown) UNAME_PROCESSOR=powerpc ;; + esac + echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} + exit ;; + *:procnto*:*:* | *:QNX:[0123456789]*:*) + UNAME_PROCESSOR=`uname -p` + if test "$UNAME_PROCESSOR" = "x86"; then + UNAME_PROCESSOR=i386 + UNAME_MACHINE=pc + fi + echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE} + exit ;; + *:QNX:*:4*) + echo i386-pc-qnx + exit ;; + NEO-?:NONSTOP_KERNEL:*:*) + echo neo-tandem-nsk${UNAME_RELEASE} + exit ;; + NSE-?:NONSTOP_KERNEL:*:*) + echo nse-tandem-nsk${UNAME_RELEASE} + exit ;; + NSR-?:NONSTOP_KERNEL:*:*) + echo nsr-tandem-nsk${UNAME_RELEASE} + exit ;; + *:NonStop-UX:*:*) + echo mips-compaq-nonstopux + exit ;; + BS2000:POSIX*:*:*) + echo bs2000-siemens-sysv + exit ;; + DS/*:UNIX_System_V:*:*) + echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} + exit ;; + *:Plan9:*:*) + # "uname -m" is not consistent, so use $cputype instead. 386 + # is converted to i386 for consistency with other x86 + # operating systems. + if test "$cputype" = "386"; then + UNAME_MACHINE=i386 + else + UNAME_MACHINE="$cputype" + fi + echo ${UNAME_MACHINE}-unknown-plan9 + exit ;; + *:TOPS-10:*:*) + echo pdp10-unknown-tops10 + exit ;; + *:TENEX:*:*) + echo pdp10-unknown-tenex + exit ;; + KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) + echo pdp10-dec-tops20 + exit ;; + XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) + echo pdp10-xkl-tops20 + exit ;; + *:TOPS-20:*:*) + echo pdp10-unknown-tops20 + exit ;; + *:ITS:*:*) + echo pdp10-unknown-its + exit ;; + SEI:*:*:SEIUX) + echo mips-sei-seiux${UNAME_RELEASE} + exit ;; + *:DragonFly:*:*) + echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` + exit ;; + *:*VMS:*:*) + UNAME_MACHINE=`(uname -p) 2>/dev/null` + case "${UNAME_MACHINE}" in + A*) echo alpha-dec-vms ; exit ;; + I*) echo ia64-dec-vms ; exit ;; + V*) echo vax-dec-vms ; exit ;; + esac ;; + *:XENIX:*:SysV) + echo i386-pc-xenix + exit ;; + i*86:skyos:*:*) + echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//' + exit ;; + i*86:rdos:*:*) + echo ${UNAME_MACHINE}-pc-rdos + exit ;; + i*86:AROS:*:*) + echo ${UNAME_MACHINE}-pc-aros + exit ;; + x86_64:VMkernel:*:*) + echo ${UNAME_MACHINE}-unknown-esx + exit ;; +esac + +#echo '(No uname command or uname output not recognized.)' 1>&2 +#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2 + +eval $set_cc_for_build +cat >$dummy.c <<EOF +#ifdef _SEQUENT_ +# include <sys/types.h> +# include <sys/utsname.h> +#endif +main () +{ +#if defined (sony) +#if defined (MIPSEB) + /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, + I don't know.... */ + printf ("mips-sony-bsd\n"); exit (0); +#else +#include <sys/param.h> + printf ("m68k-sony-newsos%s\n", +#ifdef NEWSOS4 + "4" +#else + "" +#endif + ); exit (0); +#endif +#endif + +#if defined (__arm) && defined (__acorn) && defined (__unix) + printf ("arm-acorn-riscix\n"); exit (0); +#endif + +#if defined (hp300) && !defined (hpux) + printf ("m68k-hp-bsd\n"); exit (0); +#endif + +#if defined (NeXT) +#if !defined (__ARCHITECTURE__) +#define __ARCHITECTURE__ "m68k" +#endif + int version; + version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; + if (version < 4) + printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); + else + printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); + exit (0); +#endif + +#if defined (MULTIMAX) || defined (n16) +#if defined (UMAXV) + printf ("ns32k-encore-sysv\n"); exit (0); +#else +#if defined (CMU) + printf ("ns32k-encore-mach\n"); exit (0); +#else + printf ("ns32k-encore-bsd\n"); exit (0); +#endif +#endif +#endif + +#if defined (__386BSD__) + printf ("i386-pc-bsd\n"); exit (0); +#endif + +#if defined (sequent) +#if defined (i386) + printf ("i386-sequent-dynix\n"); exit (0); +#endif +#if defined (ns32000) + printf ("ns32k-sequent-dynix\n"); exit (0); +#endif +#endif + +#if defined (_SEQUENT_) + struct utsname un; + + uname(&un); + + if (strncmp(un.version, "V2", 2) == 0) { + printf ("i386-sequent-ptx2\n"); exit (0); + } + if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ + printf ("i386-sequent-ptx1\n"); exit (0); + } + printf ("i386-sequent-ptx\n"); exit (0); + +#endif + +#if defined (vax) +# if !defined (ultrix) +# include <sys/param.h> +# if defined (BSD) +# if BSD == 43 + printf ("vax-dec-bsd4.3\n"); exit (0); +# else +# if BSD == 199006 + printf ("vax-dec-bsd4.3reno\n"); exit (0); +# else + printf ("vax-dec-bsd\n"); exit (0); +# endif +# endif +# else + printf ("vax-dec-bsd\n"); exit (0); +# endif +# else + printf ("vax-dec-ultrix\n"); exit (0); +# endif +#endif + +#if defined (alliant) && defined (i860) + printf ("i860-alliant-bsd\n"); exit (0); +#endif + + exit (1); +} +EOF + +$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` && + { echo "$SYSTEM_NAME"; exit; } + +# Apollos put the system type in the environment. + +test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; } + +# Convex versions that predate uname can use getsysinfo(1) + +if [ -x /usr/convex/getsysinfo ] +then + case `getsysinfo -f cpu_type` in + c1*) + echo c1-convex-bsd + exit ;; + c2*) + if getsysinfo -f scalar_acc + then echo c32-convex-bsd + else echo c2-convex-bsd + fi + exit ;; + c34*) + echo c34-convex-bsd + exit ;; + c38*) + echo c38-convex-bsd + exit ;; + c4*) + echo c4-convex-bsd + exit ;; + esac +fi + +cat >&2 <<EOF +$0: unable to guess system type + +This script, last modified $timestamp, has failed to recognize +the operating system you are using. It is advised that you +download the most up to date version of the config scripts from + + http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD +and + http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD + +If the version you run ($0) is already up to date, please +send the following data and any information you think might be +pertinent to <config-patches@gnu.org> in order to provide the needed +information to handle your system. + +config.guess timestamp = $timestamp + +uname -m = `(uname -m) 2>/dev/null || echo unknown` +uname -r = `(uname -r) 2>/dev/null || echo unknown` +uname -s = `(uname -s) 2>/dev/null || echo unknown` +uname -v = `(uname -v) 2>/dev/null || echo unknown` + +/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` +/bin/uname -X = `(/bin/uname -X) 2>/dev/null` + +hostinfo = `(hostinfo) 2>/dev/null` +/bin/universe = `(/bin/universe) 2>/dev/null` +/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` +/bin/arch = `(/bin/arch) 2>/dev/null` +/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` +/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` + +UNAME_MACHINE = ${UNAME_MACHINE} +UNAME_RELEASE = ${UNAME_RELEASE} +UNAME_SYSTEM = ${UNAME_SYSTEM} +UNAME_VERSION = ${UNAME_VERSION} +EOF + +exit 1 + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "timestamp='" +# time-stamp-format: "%:y-%02m-%02d" +# time-stamp-end: "'" +# End: diff --git a/Build/source/utils/asymptote/config.h.in b/Build/source/utils/asymptote/config.h.in index f5df1ca19cd..e59e301b2f6 100644 --- a/Build/source/utils/asymptote/config.h.in +++ b/Build/source/utils/asymptote/config.h.in @@ -66,9 +66,6 @@ /* Define to 1 if you have the `OSMesa' library (-lOSMesa). */ #undef HAVE_LIBOSMESA -/* Define to 1 if you have the `pthread' library (-lpthread). */ -#undef HAVE_LIBPTHREAD - /* Define to 1 if you have the `readline' library (-lreadline). */ #undef HAVE_LIBREADLINE @@ -105,6 +102,12 @@ /* Define to 1 if you have the `pow' function. */ #undef HAVE_POW +/* Define if you have POSIX threads libraries and header files. */ +#undef HAVE_PTHREAD + +/* Have PTHREAD_PRIO_INHERIT. */ +#undef HAVE_PTHREAD_PRIO_INHERIT + /* Define to 1 if the system has the type `ptrdiff_t'. */ #undef HAVE_PTRDIFF_T @@ -183,6 +186,10 @@ /* Define to the version of this package. */ #undef PACKAGE_VERSION +/* Define to necessary symbol if this constant uses a non-standard name on + your system. */ +#undef PTHREAD_CREATE_JOINABLE + /* Define as the return type of signal handlers (`int' or `void'). */ #undef RETSIGTYPE diff --git a/Build/source/utils/asymptote/config.sub b/Build/source/utils/asymptote/config.sub new file mode 100644 index 00000000000..6205f8423d6 --- /dev/null +++ b/Build/source/utils/asymptote/config.sub @@ -0,0 +1,1782 @@ +#! /bin/sh +# Configuration validation subroutine script. +# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, +# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, +# 2011, 2012 Free Software Foundation, Inc. + +timestamp='2012-04-18' + +# This file is (in principle) common to ALL GNU software. +# The presence of a machine in this file suggests that SOME GNU software +# can handle that machine. It does not imply ALL GNU software can. +# +# This file is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, see <http://www.gnu.org/licenses/>. +# +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + + +# Please send patches to <config-patches@gnu.org>. Submit a context +# diff and a properly formatted GNU ChangeLog entry. +# +# Configuration subroutine to validate and canonicalize a configuration type. +# Supply the specified configuration type as an argument. +# If it is invalid, we print an error message on stderr and exit with code 1. +# Otherwise, we print the canonical config type on stdout and succeed. + +# You can get the latest version of this script from: +# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD + +# This file is supposed to be the same for all GNU packages +# and recognize all the CPU types, system types and aliases +# that are meaningful with *any* GNU software. +# Each package is responsible for reporting which valid configurations +# it does not support. The user should be able to distinguish +# a failure to support a valid configuration from a meaningless +# configuration. + +# The goal of this file is to map all the various variations of a given +# machine specification into a single specification in the form: +# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM +# or in some cases, the newer four-part form: +# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM +# It is wrong to echo any other type of specification. + +me=`echo "$0" | sed -e 's,.*/,,'` + +usage="\ +Usage: $0 [OPTION] CPU-MFR-OPSYS + $0 [OPTION] ALIAS + +Canonicalize a configuration name. + +Operation modes: + -h, --help print this help, then exit + -t, --time-stamp print date of last modification, then exit + -v, --version print version number, then exit + +Report bugs and patches to <config-patches@gnu.org>." + +version="\ +GNU config.sub ($timestamp) + +Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, +2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 +Free Software Foundation, Inc. + +This is free software; see the source for copying conditions. There is NO +warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." + +help=" +Try \`$me --help' for more information." + +# Parse command line +while test $# -gt 0 ; do + case $1 in + --time-stamp | --time* | -t ) + echo "$timestamp" ; exit ;; + --version | -v ) + echo "$version" ; exit ;; + --help | --h* | -h ) + echo "$usage"; exit ;; + -- ) # Stop option processing + shift; break ;; + - ) # Use stdin as input. + break ;; + -* ) + echo "$me: invalid option $1$help" + exit 1 ;; + + *local*) + # First pass through any local machine types. + echo $1 + exit ;; + + * ) + break ;; + esac +done + +case $# in + 0) echo "$me: missing argument$help" >&2 + exit 1;; + 1) ;; + *) echo "$me: too many arguments$help" >&2 + exit 1;; +esac + +# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). +# Here we must recognize all the valid KERNEL-OS combinations. +maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` +case $maybe_os in + nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \ + linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \ + knetbsd*-gnu* | netbsd*-gnu* | \ + kopensolaris*-gnu* | \ + storm-chaos* | os2-emx* | rtmk-nova*) + os=-$maybe_os + basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` + ;; + android-linux) + os=-linux-android + basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown + ;; + *) + basic_machine=`echo $1 | sed 's/-[^-]*$//'` + if [ $basic_machine != $1 ] + then os=`echo $1 | sed 's/.*-/-/'` + else os=; fi + ;; +esac + +### Let's recognize common machines as not being operating systems so +### that things like config.sub decstation-3100 work. We also +### recognize some manufacturers as not being operating systems, so we +### can provide default operating systems below. +case $os in + -sun*os*) + # Prevent following clause from handling this invalid input. + ;; + -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ + -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ + -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ + -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ + -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ + -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ + -apple | -axis | -knuth | -cray | -microblaze) + os= + basic_machine=$1 + ;; + -bluegene*) + os=-cnk + ;; + -sim | -cisco | -oki | -wec | -winbond) + os= + basic_machine=$1 + ;; + -scout) + ;; + -wrs) + os=-vxworks + basic_machine=$1 + ;; + -chorusos*) + os=-chorusos + basic_machine=$1 + ;; + -chorusrdb) + os=-chorusrdb + basic_machine=$1 + ;; + -hiux*) + os=-hiuxwe2 + ;; + -sco6) + os=-sco5v6 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco5) + os=-sco3.2v5 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco4) + os=-sco3.2v4 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco3.2.[4-9]*) + os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco3.2v[4-9]*) + # Don't forget version if it is 3.2v4 or newer. + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco5v6*) + # Don't forget version if it is 3.2v4 or newer. + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco*) + os=-sco3.2v2 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -udk*) + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -isc) + os=-isc2.2 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -clix*) + basic_machine=clipper-intergraph + ;; + -isc*) + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -lynx*178) + os=-lynxos178 + ;; + -lynx*5) + os=-lynxos5 + ;; + -lynx*) + os=-lynxos + ;; + -ptx*) + basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` + ;; + -windowsnt*) + os=`echo $os | sed -e 's/windowsnt/winnt/'` + ;; + -psos*) + os=-psos + ;; + -mint | -mint[0-9]*) + basic_machine=m68k-atari + os=-mint + ;; +esac + +# Decode aliases for certain CPU-COMPANY combinations. +case $basic_machine in + # Recognize the basic CPU types without company name. + # Some are omitted here because they have special meanings below. + 1750a | 580 \ + | a29k \ + | aarch64 | aarch64_be \ + | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ + | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ + | am33_2.0 \ + | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \ + | be32 | be64 \ + | bfin \ + | c4x | clipper \ + | d10v | d30v | dlx | dsp16xx \ + | epiphany \ + | fido | fr30 | frv \ + | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ + | hexagon \ + | i370 | i860 | i960 | ia64 \ + | ip2k | iq2000 \ + | le32 | le64 \ + | lm32 \ + | m32c | m32r | m32rle | m68000 | m68k | m88k \ + | maxq | mb | microblaze | mcore | mep | metag \ + | mips | mipsbe | mipseb | mipsel | mipsle \ + | mips16 \ + | mips64 | mips64el \ + | mips64octeon | mips64octeonel \ + | mips64orion | mips64orionel \ + | mips64r5900 | mips64r5900el \ + | mips64vr | mips64vrel \ + | mips64vr4100 | mips64vr4100el \ + | mips64vr4300 | mips64vr4300el \ + | mips64vr5000 | mips64vr5000el \ + | mips64vr5900 | mips64vr5900el \ + | mipsisa32 | mipsisa32el \ + | mipsisa32r2 | mipsisa32r2el \ + | mipsisa64 | mipsisa64el \ + | mipsisa64r2 | mipsisa64r2el \ + | mipsisa64sb1 | mipsisa64sb1el \ + | mipsisa64sr71k | mipsisa64sr71kel \ + | mipstx39 | mipstx39el \ + | mn10200 | mn10300 \ + | moxie \ + | mt \ + | msp430 \ + | nds32 | nds32le | nds32be \ + | nios | nios2 \ + | ns16k | ns32k \ + | open8 \ + | or32 \ + | pdp10 | pdp11 | pj | pjl \ + | powerpc | powerpc64 | powerpc64le | powerpcle \ + | pyramid \ + | rl78 | rx \ + | score \ + | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ + | sh64 | sh64le \ + | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ + | sparcv8 | sparcv9 | sparcv9b | sparcv9v \ + | spu \ + | tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \ + | ubicom32 \ + | v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \ + | we32k \ + | x86 | xc16x | xstormy16 | xtensa \ + | z8k | z80) + basic_machine=$basic_machine-unknown + ;; + c54x) + basic_machine=tic54x-unknown + ;; + c55x) + basic_machine=tic55x-unknown + ;; + c6x) + basic_machine=tic6x-unknown + ;; + m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | picochip) + basic_machine=$basic_machine-unknown + os=-none + ;; + m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) + ;; + ms1) + basic_machine=mt-unknown + ;; + + strongarm | thumb | xscale) + basic_machine=arm-unknown + ;; + xgate) + basic_machine=$basic_machine-unknown + os=-none + ;; + xscaleeb) + basic_machine=armeb-unknown + ;; + + xscaleel) + basic_machine=armel-unknown + ;; + + # We use `pc' rather than `unknown' + # because (1) that's what they normally are, and + # (2) the word "unknown" tends to confuse beginning users. + i*86 | x86_64) + basic_machine=$basic_machine-pc + ;; + # Object if more than one company name word. + *-*-*) + echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 + exit 1 + ;; + # Recognize the basic CPU types with company name. + 580-* \ + | a29k-* \ + | aarch64-* | aarch64_be-* \ + | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ + | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ + | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \ + | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ + | avr-* | avr32-* \ + | be32-* | be64-* \ + | bfin-* | bs2000-* \ + | c[123]* | c30-* | [cjt]90-* | c4x-* \ + | clipper-* | craynv-* | cydra-* \ + | d10v-* | d30v-* | dlx-* \ + | elxsi-* \ + | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \ + | h8300-* | h8500-* \ + | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ + | hexagon-* \ + | i*86-* | i860-* | i960-* | ia64-* \ + | ip2k-* | iq2000-* \ + | le32-* | le64-* \ + | lm32-* \ + | m32c-* | m32r-* | m32rle-* \ + | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ + | m88110-* | m88k-* | maxq-* | mcore-* | metag-* | microblaze-* \ + | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ + | mips16-* \ + | mips64-* | mips64el-* \ + | mips64octeon-* | mips64octeonel-* \ + | mips64orion-* | mips64orionel-* \ + | mips64r5900-* | mips64r5900el-* \ + | mips64vr-* | mips64vrel-* \ + | mips64vr4100-* | mips64vr4100el-* \ + | mips64vr4300-* | mips64vr4300el-* \ + | mips64vr5000-* | mips64vr5000el-* \ + | mips64vr5900-* | mips64vr5900el-* \ + | mipsisa32-* | mipsisa32el-* \ + | mipsisa32r2-* | mipsisa32r2el-* \ + | mipsisa64-* | mipsisa64el-* \ + | mipsisa64r2-* | mipsisa64r2el-* \ + | mipsisa64sb1-* | mipsisa64sb1el-* \ + | mipsisa64sr71k-* | mipsisa64sr71kel-* \ + | mipstx39-* | mipstx39el-* \ + | mmix-* \ + | mt-* \ + | msp430-* \ + | nds32-* | nds32le-* | nds32be-* \ + | nios-* | nios2-* \ + | none-* | np1-* | ns16k-* | ns32k-* \ + | open8-* \ + | orion-* \ + | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ + | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \ + | pyramid-* \ + | rl78-* | romp-* | rs6000-* | rx-* \ + | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ + | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ + | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ + | sparclite-* \ + | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx?-* \ + | tahoe-* \ + | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ + | tile*-* \ + | tron-* \ + | ubicom32-* \ + | v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \ + | vax-* \ + | we32k-* \ + | x86-* | x86_64-* | xc16x-* | xps100-* \ + | xstormy16-* | xtensa*-* \ + | ymp-* \ + | z8k-* | z80-*) + ;; + # Recognize the basic CPU types without company name, with glob match. + xtensa*) + basic_machine=$basic_machine-unknown + ;; + # Recognize the various machine names and aliases which stand + # for a CPU type and a company and sometimes even an OS. + 386bsd) + basic_machine=i386-unknown + os=-bsd + ;; + 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) + basic_machine=m68000-att + ;; + 3b*) + basic_machine=we32k-att + ;; + a29khif) + basic_machine=a29k-amd + os=-udi + ;; + abacus) + basic_machine=abacus-unknown + ;; + adobe68k) + basic_machine=m68010-adobe + os=-scout + ;; + alliant | fx80) + basic_machine=fx80-alliant + ;; + altos | altos3068) + basic_machine=m68k-altos + ;; + am29k) + basic_machine=a29k-none + os=-bsd + ;; + amd64) + basic_machine=x86_64-pc + ;; + amd64-*) + basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + amdahl) + basic_machine=580-amdahl + os=-sysv + ;; + amiga | amiga-*) + basic_machine=m68k-unknown + ;; + amigaos | amigados) + basic_machine=m68k-unknown + os=-amigaos + ;; + amigaunix | amix) + basic_machine=m68k-unknown + os=-sysv4 + ;; + apollo68) + basic_machine=m68k-apollo + os=-sysv + ;; + apollo68bsd) + basic_machine=m68k-apollo + os=-bsd + ;; + aros) + basic_machine=i386-pc + os=-aros + ;; + aux) + basic_machine=m68k-apple + os=-aux + ;; + balance) + basic_machine=ns32k-sequent + os=-dynix + ;; + blackfin) + basic_machine=bfin-unknown + os=-linux + ;; + blackfin-*) + basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'` + os=-linux + ;; + bluegene*) + basic_machine=powerpc-ibm + os=-cnk + ;; + c54x-*) + basic_machine=tic54x-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + c55x-*) + basic_machine=tic55x-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + c6x-*) + basic_machine=tic6x-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + c90) + basic_machine=c90-cray + os=-unicos + ;; + cegcc) + basic_machine=arm-unknown + os=-cegcc + ;; + convex-c1) + basic_machine=c1-convex + os=-bsd + ;; + convex-c2) + basic_machine=c2-convex + os=-bsd + ;; + convex-c32) + basic_machine=c32-convex + os=-bsd + ;; + convex-c34) + basic_machine=c34-convex + os=-bsd + ;; + convex-c38) + basic_machine=c38-convex + os=-bsd + ;; + cray | j90) + basic_machine=j90-cray + os=-unicos + ;; + craynv) + basic_machine=craynv-cray + os=-unicosmp + ;; + cr16 | cr16-*) + basic_machine=cr16-unknown + os=-elf + ;; + crds | unos) + basic_machine=m68k-crds + ;; + crisv32 | crisv32-* | etraxfs*) + basic_machine=crisv32-axis + ;; + cris | cris-* | etrax*) + basic_machine=cris-axis + ;; + crx) + basic_machine=crx-unknown + os=-elf + ;; + da30 | da30-*) + basic_machine=m68k-da30 + ;; + decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) + basic_machine=mips-dec + ;; + decsystem10* | dec10*) + basic_machine=pdp10-dec + os=-tops10 + ;; + decsystem20* | dec20*) + basic_machine=pdp10-dec + os=-tops20 + ;; + delta | 3300 | motorola-3300 | motorola-delta \ + | 3300-motorola | delta-motorola) + basic_machine=m68k-motorola + ;; + delta88) + basic_machine=m88k-motorola + os=-sysv3 + ;; + dicos) + basic_machine=i686-pc + os=-dicos + ;; + djgpp) + basic_machine=i586-pc + os=-msdosdjgpp + ;; + dpx20 | dpx20-*) + basic_machine=rs6000-bull + os=-bosx + ;; + dpx2* | dpx2*-bull) + basic_machine=m68k-bull + os=-sysv3 + ;; + ebmon29k) + basic_machine=a29k-amd + os=-ebmon + ;; + elxsi) + basic_machine=elxsi-elxsi + os=-bsd + ;; + encore | umax | mmax) + basic_machine=ns32k-encore + ;; + es1800 | OSE68k | ose68k | ose | OSE) + basic_machine=m68k-ericsson + os=-ose + ;; + fx2800) + basic_machine=i860-alliant + ;; + genix) + basic_machine=ns32k-ns + ;; + gmicro) + basic_machine=tron-gmicro + os=-sysv + ;; + go32) + basic_machine=i386-pc + os=-go32 + ;; + h3050r* | hiux*) + basic_machine=hppa1.1-hitachi + os=-hiuxwe2 + ;; + h8300hms) + basic_machine=h8300-hitachi + os=-hms + ;; + h8300xray) + basic_machine=h8300-hitachi + os=-xray + ;; + h8500hms) + basic_machine=h8500-hitachi + os=-hms + ;; + harris) + basic_machine=m88k-harris + os=-sysv3 + ;; + hp300-*) + basic_machine=m68k-hp + ;; + hp300bsd) + basic_machine=m68k-hp + os=-bsd + ;; + hp300hpux) + basic_machine=m68k-hp + os=-hpux + ;; + hp3k9[0-9][0-9] | hp9[0-9][0-9]) + basic_machine=hppa1.0-hp + ;; + hp9k2[0-9][0-9] | hp9k31[0-9]) + basic_machine=m68000-hp + ;; + hp9k3[2-9][0-9]) + basic_machine=m68k-hp + ;; + hp9k6[0-9][0-9] | hp6[0-9][0-9]) + basic_machine=hppa1.0-hp + ;; + hp9k7[0-79][0-9] | hp7[0-79][0-9]) + basic_machine=hppa1.1-hp + ;; + hp9k78[0-9] | hp78[0-9]) + # FIXME: really hppa2.0-hp + basic_machine=hppa1.1-hp + ;; + hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) + # FIXME: really hppa2.0-hp + basic_machine=hppa1.1-hp + ;; + hp9k8[0-9][13679] | hp8[0-9][13679]) + basic_machine=hppa1.1-hp + ;; + hp9k8[0-9][0-9] | hp8[0-9][0-9]) + basic_machine=hppa1.0-hp + ;; + hppa-next) + os=-nextstep3 + ;; + hppaosf) + basic_machine=hppa1.1-hp + os=-osf + ;; + hppro) + basic_machine=hppa1.1-hp + os=-proelf + ;; + i370-ibm* | ibm*) + basic_machine=i370-ibm + ;; + i*86v32) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-sysv32 + ;; + i*86v4*) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-sysv4 + ;; + i*86v) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-sysv + ;; + i*86sol2) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-solaris2 + ;; + i386mach) + basic_machine=i386-mach + os=-mach + ;; + i386-vsta | vsta) + basic_machine=i386-unknown + os=-vsta + ;; + iris | iris4d) + basic_machine=mips-sgi + case $os in + -irix*) + ;; + *) + os=-irix4 + ;; + esac + ;; + isi68 | isi) + basic_machine=m68k-isi + os=-sysv + ;; + m68knommu) + basic_machine=m68k-unknown + os=-linux + ;; + m68knommu-*) + basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'` + os=-linux + ;; + m88k-omron*) + basic_machine=m88k-omron + ;; + magnum | m3230) + basic_machine=mips-mips + os=-sysv + ;; + merlin) + basic_machine=ns32k-utek + os=-sysv + ;; + microblaze) + basic_machine=microblaze-xilinx + ;; + mingw32) + basic_machine=i386-pc + os=-mingw32 + ;; + mingw32ce) + basic_machine=arm-unknown + os=-mingw32ce + ;; + miniframe) + basic_machine=m68000-convergent + ;; + *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) + basic_machine=m68k-atari + os=-mint + ;; + mips3*-*) + basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` + ;; + mips3*) + basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown + ;; + monitor) + basic_machine=m68k-rom68k + os=-coff + ;; + morphos) + basic_machine=powerpc-unknown + os=-morphos + ;; + msdos) + basic_machine=i386-pc + os=-msdos + ;; + ms1-*) + basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'` + ;; + msys) + basic_machine=i386-pc + os=-msys + ;; + mvs) + basic_machine=i370-ibm + os=-mvs + ;; + nacl) + basic_machine=le32-unknown + os=-nacl + ;; + ncr3000) + basic_machine=i486-ncr + os=-sysv4 + ;; + netbsd386) + basic_machine=i386-unknown + os=-netbsd + ;; + netwinder) + basic_machine=armv4l-rebel + os=-linux + ;; + news | news700 | news800 | news900) + basic_machine=m68k-sony + os=-newsos + ;; + news1000) + basic_machine=m68030-sony + os=-newsos + ;; + news-3600 | risc-news) + basic_machine=mips-sony + os=-newsos + ;; + necv70) + basic_machine=v70-nec + os=-sysv + ;; + next | m*-next ) + basic_machine=m68k-next + case $os in + -nextstep* ) + ;; + -ns2*) + os=-nextstep2 + ;; + *) + os=-nextstep3 + ;; + esac + ;; + nh3000) + basic_machine=m68k-harris + os=-cxux + ;; + nh[45]000) + basic_machine=m88k-harris + os=-cxux + ;; + nindy960) + basic_machine=i960-intel + os=-nindy + ;; + mon960) + basic_machine=i960-intel + os=-mon960 + ;; + nonstopux) + basic_machine=mips-compaq + os=-nonstopux + ;; + np1) + basic_machine=np1-gould + ;; + neo-tandem) + basic_machine=neo-tandem + ;; + nse-tandem) + basic_machine=nse-tandem + ;; + nsr-tandem) + basic_machine=nsr-tandem + ;; + op50n-* | op60c-*) + basic_machine=hppa1.1-oki + os=-proelf + ;; + openrisc | openrisc-*) + basic_machine=or32-unknown + ;; + os400) + basic_machine=powerpc-ibm + os=-os400 + ;; + OSE68000 | ose68000) + basic_machine=m68000-ericsson + os=-ose + ;; + os68k) + basic_machine=m68k-none + os=-os68k + ;; + pa-hitachi) + basic_machine=hppa1.1-hitachi + os=-hiuxwe2 + ;; + paragon) + basic_machine=i860-intel + os=-osf + ;; + parisc) + basic_machine=hppa-unknown + os=-linux + ;; + parisc-*) + basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'` + os=-linux + ;; + pbd) + basic_machine=sparc-tti + ;; + pbb) + basic_machine=m68k-tti + ;; + pc532 | pc532-*) + basic_machine=ns32k-pc532 + ;; + pc98) + basic_machine=i386-pc + ;; + pc98-*) + basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pentium | p5 | k5 | k6 | nexgen | viac3) + basic_machine=i586-pc + ;; + pentiumpro | p6 | 6x86 | athlon | athlon_*) + basic_machine=i686-pc + ;; + pentiumii | pentium2 | pentiumiii | pentium3) + basic_machine=i686-pc + ;; + pentium4) + basic_machine=i786-pc + ;; + pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) + basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pentiumpro-* | p6-* | 6x86-* | athlon-*) + basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*) + basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pentium4-*) + basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pn) + basic_machine=pn-gould + ;; + power) basic_machine=power-ibm + ;; + ppc | ppcbe) basic_machine=powerpc-unknown + ;; + ppc-* | ppcbe-*) + basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ppcle | powerpclittle | ppc-le | powerpc-little) + basic_machine=powerpcle-unknown + ;; + ppcle-* | powerpclittle-*) + basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ppc64) basic_machine=powerpc64-unknown + ;; + ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ppc64le | powerpc64little | ppc64-le | powerpc64-little) + basic_machine=powerpc64le-unknown + ;; + ppc64le-* | powerpc64little-*) + basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ps2) + basic_machine=i386-ibm + ;; + pw32) + basic_machine=i586-unknown + os=-pw32 + ;; + rdos) + basic_machine=i386-pc + os=-rdos + ;; + rom68k) + basic_machine=m68k-rom68k + os=-coff + ;; + rm[46]00) + basic_machine=mips-siemens + ;; + rtpc | rtpc-*) + basic_machine=romp-ibm + ;; + s390 | s390-*) + basic_machine=s390-ibm + ;; + s390x | s390x-*) + basic_machine=s390x-ibm + ;; + sa29200) + basic_machine=a29k-amd + os=-udi + ;; + sb1) + basic_machine=mipsisa64sb1-unknown + ;; + sb1el) + basic_machine=mipsisa64sb1el-unknown + ;; + sde) + basic_machine=mipsisa32-sde + os=-elf + ;; + sei) + basic_machine=mips-sei + os=-seiux + ;; + sequent) + basic_machine=i386-sequent + ;; + sh) + basic_machine=sh-hitachi + os=-hms + ;; + sh5el) + basic_machine=sh5le-unknown + ;; + sh64) + basic_machine=sh64-unknown + ;; + sparclite-wrs | simso-wrs) + basic_machine=sparclite-wrs + os=-vxworks + ;; + sps7) + basic_machine=m68k-bull + os=-sysv2 + ;; + spur) + basic_machine=spur-unknown + ;; + st2000) + basic_machine=m68k-tandem + ;; + stratus) + basic_machine=i860-stratus + os=-sysv4 + ;; + strongarm-* | thumb-*) + basic_machine=arm-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + sun2) + basic_machine=m68000-sun + ;; + sun2os3) + basic_machine=m68000-sun + os=-sunos3 + ;; + sun2os4) + basic_machine=m68000-sun + os=-sunos4 + ;; + sun3os3) + basic_machine=m68k-sun + os=-sunos3 + ;; + sun3os4) + basic_machine=m68k-sun + os=-sunos4 + ;; + sun4os3) + basic_machine=sparc-sun + os=-sunos3 + ;; + sun4os4) + basic_machine=sparc-sun + os=-sunos4 + ;; + sun4sol2) + basic_machine=sparc-sun + os=-solaris2 + ;; + sun3 | sun3-*) + basic_machine=m68k-sun + ;; + sun4) + basic_machine=sparc-sun + ;; + sun386 | sun386i | roadrunner) + basic_machine=i386-sun + ;; + sv1) + basic_machine=sv1-cray + os=-unicos + ;; + symmetry) + basic_machine=i386-sequent + os=-dynix + ;; + t3e) + basic_machine=alphaev5-cray + os=-unicos + ;; + t90) + basic_machine=t90-cray + os=-unicos + ;; + tile*) + basic_machine=$basic_machine-unknown + os=-linux-gnu + ;; + tx39) + basic_machine=mipstx39-unknown + ;; + tx39el) + basic_machine=mipstx39el-unknown + ;; + toad1) + basic_machine=pdp10-xkl + os=-tops20 + ;; + tower | tower-32) + basic_machine=m68k-ncr + ;; + tpf) + basic_machine=s390x-ibm + os=-tpf + ;; + udi29k) + basic_machine=a29k-amd + os=-udi + ;; + ultra3) + basic_machine=a29k-nyu + os=-sym1 + ;; + v810 | necv810) + basic_machine=v810-nec + os=-none + ;; + vaxv) + basic_machine=vax-dec + os=-sysv + ;; + vms) + basic_machine=vax-dec + os=-vms + ;; + vpp*|vx|vx-*) + basic_machine=f301-fujitsu + ;; + vxworks960) + basic_machine=i960-wrs + os=-vxworks + ;; + vxworks68) + basic_machine=m68k-wrs + os=-vxworks + ;; + vxworks29k) + basic_machine=a29k-wrs + os=-vxworks + ;; + w65*) + basic_machine=w65-wdc + os=-none + ;; + w89k-*) + basic_machine=hppa1.1-winbond + os=-proelf + ;; + xbox) + basic_machine=i686-pc + os=-mingw32 + ;; + xps | xps100) + basic_machine=xps100-honeywell + ;; + xscale-* | xscalee[bl]-*) + basic_machine=`echo $basic_machine | sed 's/^xscale/arm/'` + ;; + ymp) + basic_machine=ymp-cray + os=-unicos + ;; + z8k-*-coff) + basic_machine=z8k-unknown + os=-sim + ;; + z80-*-coff) + basic_machine=z80-unknown + os=-sim + ;; + none) + basic_machine=none-none + os=-none + ;; + +# Here we handle the default manufacturer of certain CPU types. It is in +# some cases the only manufacturer, in others, it is the most popular. + w89k) + basic_machine=hppa1.1-winbond + ;; + op50n) + basic_machine=hppa1.1-oki + ;; + op60c) + basic_machine=hppa1.1-oki + ;; + romp) + basic_machine=romp-ibm + ;; + mmix) + basic_machine=mmix-knuth + ;; + rs6000) + basic_machine=rs6000-ibm + ;; + vax) + basic_machine=vax-dec + ;; + pdp10) + # there are many clones, so DEC is not a safe bet + basic_machine=pdp10-unknown + ;; + pdp11) + basic_machine=pdp11-dec + ;; + we32k) + basic_machine=we32k-att + ;; + sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele) + basic_machine=sh-unknown + ;; + sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v) + basic_machine=sparc-sun + ;; + cydra) + basic_machine=cydra-cydrome + ;; + orion) + basic_machine=orion-highlevel + ;; + orion105) + basic_machine=clipper-highlevel + ;; + mac | mpw | mac-mpw) + basic_machine=m68k-apple + ;; + pmac | pmac-mpw) + basic_machine=powerpc-apple + ;; + *-unknown) + # Make sure to match an already-canonicalized machine name. + ;; + *) + echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 + exit 1 + ;; +esac + +# Here we canonicalize certain aliases for manufacturers. +case $basic_machine in + *-digital*) + basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'` + ;; + *-commodore*) + basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` + ;; + *) + ;; +esac + +# Decode manufacturer-specific aliases for certain operating systems. + +if [ x"$os" != x"" ] +then +case $os in + # First match some system type aliases + # that might get confused with valid system types. + # -solaris* is a basic system type, with this one exception. + -auroraux) + os=-auroraux + ;; + -solaris1 | -solaris1.*) + os=`echo $os | sed -e 's|solaris1|sunos4|'` + ;; + -solaris) + os=-solaris2 + ;; + -svr4*) + os=-sysv4 + ;; + -unixware*) + os=-sysv4.2uw + ;; + -gnu/linux*) + os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` + ;; + # First accept the basic system types. + # The portable systems comes first. + # Each alternative MUST END IN A *, to match a version number. + # -sysv* is not here because it comes later, after sysvr4. + -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ + | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\ + | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \ + | -sym* | -kopensolaris* \ + | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ + | -aos* | -aros* \ + | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ + | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ + | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \ + | -openbsd* | -solidbsd* \ + | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ + | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ + | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ + | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ + | -chorusos* | -chorusrdb* | -cegcc* \ + | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ + | -mingw32* | -linux-gnu* | -linux-android* \ + | -linux-newlib* | -linux-uclibc* \ + | -uxpv* | -beos* | -mpeix* | -udk* \ + | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ + | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ + | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ + | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ + | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ + | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ + | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es*) + # Remember, each alternative MUST END IN *, to match a version number. + ;; + -qnx*) + case $basic_machine in + x86-* | i*86-*) + ;; + *) + os=-nto$os + ;; + esac + ;; + -nto-qnx*) + ;; + -nto*) + os=`echo $os | sed -e 's|nto|nto-qnx|'` + ;; + -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ + | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \ + | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) + ;; + -mac*) + os=`echo $os | sed -e 's|mac|macos|'` + ;; + -linux-dietlibc) + os=-linux-dietlibc + ;; + -linux*) + os=`echo $os | sed -e 's|linux|linux-gnu|'` + ;; + -sunos5*) + os=`echo $os | sed -e 's|sunos5|solaris2|'` + ;; + -sunos6*) + os=`echo $os | sed -e 's|sunos6|solaris3|'` + ;; + -opened*) + os=-openedition + ;; + -os400*) + os=-os400 + ;; + -wince*) + os=-wince + ;; + -osfrose*) + os=-osfrose + ;; + -osf*) + os=-osf + ;; + -utek*) + os=-bsd + ;; + -dynix*) + os=-bsd + ;; + -acis*) + os=-aos + ;; + -atheos*) + os=-atheos + ;; + -syllable*) + os=-syllable + ;; + -386bsd) + os=-bsd + ;; + -ctix* | -uts*) + os=-sysv + ;; + -nova*) + os=-rtmk-nova + ;; + -ns2 ) + os=-nextstep2 + ;; + -nsk*) + os=-nsk + ;; + # Preserve the version number of sinix5. + -sinix5.*) + os=`echo $os | sed -e 's|sinix|sysv|'` + ;; + -sinix*) + os=-sysv4 + ;; + -tpf*) + os=-tpf + ;; + -triton*) + os=-sysv3 + ;; + -oss*) + os=-sysv3 + ;; + -svr4) + os=-sysv4 + ;; + -svr3) + os=-sysv3 + ;; + -sysvr4) + os=-sysv4 + ;; + # This must come after -sysvr4. + -sysv*) + ;; + -ose*) + os=-ose + ;; + -es1800*) + os=-ose + ;; + -xenix) + os=-xenix + ;; + -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) + os=-mint + ;; + -aros*) + os=-aros + ;; + -kaos*) + os=-kaos + ;; + -zvmoe) + os=-zvmoe + ;; + -dicos*) + os=-dicos + ;; + -nacl*) + ;; + -none) + ;; + *) + # Get rid of the `-' at the beginning of $os. + os=`echo $os | sed 's/[^-]*-//'` + echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2 + exit 1 + ;; +esac +else + +# Here we handle the default operating systems that come with various machines. +# The value should be what the vendor currently ships out the door with their +# machine or put another way, the most popular os provided with the machine. + +# Note that if you're going to try to match "-MANUFACTURER" here (say, +# "-sun"), then you have to tell the case statement up towards the top +# that MANUFACTURER isn't an operating system. Otherwise, code above +# will signal an error saying that MANUFACTURER isn't an operating +# system, and we'll never get to this point. + +case $basic_machine in + score-*) + os=-elf + ;; + spu-*) + os=-elf + ;; + *-acorn) + os=-riscix1.2 + ;; + arm*-rebel) + os=-linux + ;; + arm*-semi) + os=-aout + ;; + c4x-* | tic4x-*) + os=-coff + ;; + hexagon-*) + os=-elf + ;; + tic54x-*) + os=-coff + ;; + tic55x-*) + os=-coff + ;; + tic6x-*) + os=-coff + ;; + # This must come before the *-dec entry. + pdp10-*) + os=-tops20 + ;; + pdp11-*) + os=-none + ;; + *-dec | vax-*) + os=-ultrix4.2 + ;; + m68*-apollo) + os=-domain + ;; + i386-sun) + os=-sunos4.0.2 + ;; + m68000-sun) + os=-sunos3 + ;; + m68*-cisco) + os=-aout + ;; + mep-*) + os=-elf + ;; + mips*-cisco) + os=-elf + ;; + mips*-*) + os=-elf + ;; + or32-*) + os=-coff + ;; + *-tti) # must be before sparc entry or we get the wrong os. + os=-sysv3 + ;; + sparc-* | *-sun) + os=-sunos4.1.1 + ;; + *-be) + os=-beos + ;; + *-haiku) + os=-haiku + ;; + *-ibm) + os=-aix + ;; + *-knuth) + os=-mmixware + ;; + *-wec) + os=-proelf + ;; + *-winbond) + os=-proelf + ;; + *-oki) + os=-proelf + ;; + *-hp) + os=-hpux + ;; + *-hitachi) + os=-hiux + ;; + i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) + os=-sysv + ;; + *-cbm) + os=-amigaos + ;; + *-dg) + os=-dgux + ;; + *-dolphin) + os=-sysv3 + ;; + m68k-ccur) + os=-rtu + ;; + m88k-omron*) + os=-luna + ;; + *-next ) + os=-nextstep + ;; + *-sequent) + os=-ptx + ;; + *-crds) + os=-unos + ;; + *-ns) + os=-genix + ;; + i370-*) + os=-mvs + ;; + *-next) + os=-nextstep3 + ;; + *-gould) + os=-sysv + ;; + *-highlevel) + os=-bsd + ;; + *-encore) + os=-bsd + ;; + *-sgi) + os=-irix + ;; + *-siemens) + os=-sysv4 + ;; + *-masscomp) + os=-rtu + ;; + f30[01]-fujitsu | f700-fujitsu) + os=-uxpv + ;; + *-rom68k) + os=-coff + ;; + *-*bug) + os=-coff + ;; + *-apple) + os=-macos + ;; + *-atari*) + os=-mint + ;; + *) + os=-none + ;; +esac +fi + +# Here we handle the case where we know the os, and the CPU type, but not the +# manufacturer. We pick the logical manufacturer. +vendor=unknown +case $basic_machine in + *-unknown) + case $os in + -riscix*) + vendor=acorn + ;; + -sunos*) + vendor=sun + ;; + -cnk*|-aix*) + vendor=ibm + ;; + -beos*) + vendor=be + ;; + -hpux*) + vendor=hp + ;; + -mpeix*) + vendor=hp + ;; + -hiux*) + vendor=hitachi + ;; + -unos*) + vendor=crds + ;; + -dgux*) + vendor=dg + ;; + -luna*) + vendor=omron + ;; + -genix*) + vendor=ns + ;; + -mvs* | -opened*) + vendor=ibm + ;; + -os400*) + vendor=ibm + ;; + -ptx*) + vendor=sequent + ;; + -tpf*) + vendor=ibm + ;; + -vxsim* | -vxworks* | -windiss*) + vendor=wrs + ;; + -aux*) + vendor=apple + ;; + -hms*) + vendor=hitachi + ;; + -mpw* | -macos*) + vendor=apple + ;; + -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) + vendor=atari + ;; + -vos*) + vendor=stratus + ;; + esac + basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` + ;; +esac + +echo $basic_machine$os +exit + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "timestamp='" +# time-stamp-format: "%:y-%02m-%02d" +# time-stamp-end: "'" +# End: diff --git a/Build/source/utils/asymptote/configure b/Build/source/utils/asymptote/configure index 19569694ab1..a7d6ebe3bac 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.66 for Asymptote 2.13. +# Generated by GNU Autoconf 2.68 for Asymptote 2.16. # # Report bugs to <http://sourceforge.net/projects/asymptote>. # @@ -91,6 +91,7 @@ fi IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. +as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -216,11 +217,18 @@ IFS=$as_save_IFS # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. + # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV export CONFIG_SHELL - exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"} + case $- in # (((( + *v*x* | *x*v* ) as_opts=-vx ;; + *v* ) as_opts=-v ;; + *x* ) as_opts=-x ;; + * ) as_opts= ;; + esac + exec "$CONFIG_SHELL" $as_opts "$as_myself" ${1+"$@"} fi if test x$as_have_required = xno; then : @@ -552,8 +560,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='Asymptote' PACKAGE_TARNAME='asymptote' -PACKAGE_VERSION='2.13' -PACKAGE_STRING='Asymptote 2.13' +PACKAGE_VERSION='2.16' +PACKAGE_STRING='Asymptote 2.16' PACKAGE_BUGREPORT='http://sourceforge.net/projects/asymptote' PACKAGE_URL='' @@ -596,6 +604,18 @@ ac_includes_default="\ ac_unique_file="absyn.cc" ac_subst_vars='LTLIBOBJS LIBOBJS +PTHREAD_CFLAGS +PTHREAD_LIBS +PTHREAD_CC +ax_pthread_config +host_os +host_vendor +host_cpu +host +build_os +build_vendor +build_cpu +build OPTIONS INCL GCPPLIB @@ -763,8 +783,9 @@ do fi case $ac_option in - *=*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; - *) ac_optarg=yes ;; + *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; + *=) ac_optarg= ;; + *) ac_optarg=yes ;; esac # Accept the important Cygnus configure options, so we can diagnose typos. @@ -1104,7 +1125,7 @@ Try \`$0 --help' for more information" $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 - : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option} + : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" ;; esac @@ -1242,7 +1263,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.13 to adapt to many kinds of systems. +\`configure' configures Asymptote 2.16 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1298,12 +1319,16 @@ Fine tuning of the installation directories: _ACEOF cat <<\_ACEOF + +System types: + --build=BUILD configure for building on BUILD [guessed] + --host=HOST cross-compile to build programs to run on HOST [BUILD] _ACEOF fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of Asymptote 2.13:";; + short | recursive ) echo "Configuration of Asymptote 2.16:";; esac cat <<\_ACEOF @@ -1341,8 +1366,9 @@ Some influential environment variables: CPP C preprocessor CXX C++ compiler command CXXFLAGS C++ compiler flags - YACC The `Yet Another C Compiler' implementation to use. Defaults to - the first program found out of: `bison -y', `byacc', `yacc'. + YACC The `Yet Another Compiler Compiler' implementation to use. + Defaults to the first program found out of: `bison -y', `byacc', + `yacc'. YFLAGS The list of arguments that will be passed by default to $YACC. This script will default YFLAGS to the empty string to avoid a default value of `-d' given by some make applications. @@ -1414,8 +1440,8 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -Asymptote configure 2.13 -generated by GNU Autoconf 2.66 +Asymptote configure 2.16 +generated by GNU Autoconf 2.68 Copyright (C) 2010 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation @@ -1461,7 +1487,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi - eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_compile @@ -1503,7 +1529,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=$ac_status fi rm -rf conftest.dSYM conftest_ipa8_conftest.oo - eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_run @@ -1529,7 +1555,7 @@ $as_echo "$ac_try_echo"; } >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } >/dev/null && { + test $ac_status = 0; } > conftest.i && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then : @@ -1540,7 +1566,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi - eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_cpp @@ -1554,7 +1580,7 @@ ac_fn_c_check_header_compile () as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } -if eval "test \"\${$3+set}\"" = set; then : +if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -1572,7 +1598,7 @@ fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } - eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_header_compile @@ -1609,7 +1635,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi - eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_cxx_try_compile @@ -1655,7 +1681,7 @@ fi # interfere with the next link command; also delete a directory that is # left behind by Apple's compiler. We do this before executing the actions. rm -rf conftest.dSYM conftest_ipa8_conftest.oo - eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_cxx_try_link @@ -1681,7 +1707,7 @@ $as_echo "$ac_try_echo"; } >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } >/dev/null && { + test $ac_status = 0; } > conftest.i && { test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || test ! -s conftest.err }; then : @@ -1692,7 +1718,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi - eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_cxx_try_cpp @@ -1705,10 +1731,10 @@ fi ac_fn_cxx_check_header_mongrel () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - if eval "test \"\${$3+set}\"" = set; then : + if eval \${$3+:} false; then : { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } -if eval "test \"\${$3+set}\"" = set; then : +if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 fi eval ac_res=\$$3 @@ -1744,7 +1770,7 @@ if ac_fn_cxx_try_cpp "$LINENO"; then : else ac_header_preproc=no fi -rm -f conftest.err conftest.$ac_ext +rm -f conftest.err conftest.i conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5 $as_echo "$ac_header_preproc" >&6; } @@ -1775,7 +1801,7 @@ $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } -if eval "test \"\${$3+set}\"" = set; then : +if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else eval "$3=\$ac_header_compiler" @@ -1784,7 +1810,7 @@ eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } fi - eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_cxx_check_header_mongrel @@ -1796,7 +1822,7 @@ ac_fn_cxx_check_func () as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } -if eval "test \"\${$3+set}\"" = set; then : +if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -1851,10 +1877,56 @@ fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } - eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_cxx_check_func +# ac_fn_c_try_link LINENO +# ----------------------- +# Try to link conftest.$ac_ext, and return whether this succeeded. +ac_fn_c_try_link () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + rm -f conftest.$ac_objext conftest$ac_exeext + if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information + # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would + # interfere with the next link command; also delete a directory that is + # left behind by Apple's compiler. We do this before executing the actions. + rm -rf conftest.dSYM conftest_ipa8_conftest.oo + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_c_try_link + # ac_fn_cxx_check_type LINENO TYPE VAR INCLUDES # --------------------------------------------- # Tests whether TYPE exists after having included INCLUDES, setting cache @@ -1864,7 +1936,7 @@ ac_fn_cxx_check_type () as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } -if eval "test \"\${$3+set}\"" = set; then : +if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else eval "$3=no" @@ -1905,7 +1977,7 @@ fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } - eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_cxx_check_type @@ -1946,7 +2018,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=$ac_status fi rm -rf conftest.dSYM conftest_ipa8_conftest.oo - eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_cxx_try_run @@ -1954,8 +2026,8 @@ 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.13, which was -generated by GNU Autoconf 2.66. Invocation command line was +It was created by Asymptote $as_me 2.16, which was +generated by GNU Autoconf 2.68. Invocation command line was $ $0 $@ @@ -2304,8 +2376,114 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu VERSION=$PACKAGE_VERSION +# =========================================================================== +# http://www.gnu.org/software/autoconf-archive/ax_pthread.html +# =========================================================================== +# +# SYNOPSIS +# +# AX_PTHREAD([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]]) +# +# DESCRIPTION +# +# This macro figures out how to build C programs using POSIX threads. It +# sets the PTHREAD_LIBS output variable to the threads library and linker +# flags, and the PTHREAD_CFLAGS output variable to any special C compiler +# flags that are needed. (The user can also force certain compiler +# flags/libs to be tested by setting these environment variables.) +# +# Also sets PTHREAD_CC to any special C compiler that is needed for +# multi-threaded programs (defaults to the value of CC otherwise). (This +# is necessary on AIX to use the special cc_r compiler alias.) +# +# NOTE: You are assumed to not only compile your program with these flags, +# but also link it with them as well. e.g. you should link with +# $PTHREAD_CC $CFLAGS $PTHREAD_CFLAGS $LDFLAGS ... $PTHREAD_LIBS $LIBS +# +# If you are only building threads programs, you may wish to use these +# variables in your default LIBS, CFLAGS, and CC: +# +# LIBS="$PTHREAD_LIBS $LIBS" +# CFLAGS="$CFLAGS $PTHREAD_CFLAGS" +# CC="$PTHREAD_CC" +# +# In addition, if the PTHREAD_CREATE_JOINABLE thread-attribute constant +# has a nonstandard name, defines PTHREAD_CREATE_JOINABLE to that name +# (e.g. PTHREAD_CREATE_UNDETACHED on AIX). +# +# Also HAVE_PTHREAD_PRIO_INHERIT is defined if pthread is found and the +# PTHREAD_PRIO_INHERIT symbol is defined when compiling with +# PTHREAD_CFLAGS. +# +# ACTION-IF-FOUND is a list of shell commands to run if a threads library +# is found, and ACTION-IF-NOT-FOUND is a list of commands to run it if it +# is not found. If ACTION-IF-FOUND is not specified, the default action +# will define HAVE_PTHREAD. +# +# Please let the authors know if this macro fails on any platform, or if +# you have any other suggestions or comments. This macro was based on work +# by SGJ on autoconf scripts for FFTW (http://www.fftw.org/) (with help +# from M. Frigo), as well as ac_pthread and hb_pthread macros posted by +# Alejandro Forero Cuervo to the autoconf macro repository. We are also +# grateful for the helpful feedback of numerous users. +# +# Updated for Autoconf 2.68 by Daniel Richard G. +# +# LICENSE +# +# Copyright (c) 2008 Steven G. Johnson <stevenj@alum.mit.edu> +# Copyright (c) 2011 Daniel Richard G. <skunk@iSKUNK.ORG> +# +# This program is free software: you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by the +# Free Software Foundation, either version 3 of the License, or (at your +# option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General +# Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program. If not, see <http://www.gnu.org/licenses/>. +# +# As a special exception, the respective Autoconf Macro's copyright owner +# gives unlimited permission to copy, distribute and modify the configure +# scripts that are the output of Autoconf when processing the Macro. You +# need not follow the terms of the GNU General Public License when using +# or distributing such scripts, even though portions of the text of the +# Macro appear in them. The GNU General Public License (GPL) does govern +# all other use of the material that constitutes the Autoconf Macro. +# +# This special exception to the GPL applies to versions of the Autoconf +# Macro released by the Autoconf Archive. When you make and distribute a +# modified version of the Autoconf Macro, you may extend this special +# exception to the GPL to apply to your modified version as well. + +#serial 18 + +# This is what autoupdate's m4 run will expand. It fires +# the warning (with _au_warn_XXX), outputs it into the +# updated configure.ac (with AC_DIAGNOSE), and then outputs +# the replacement expansion. + + +# This is an auxiliary macro that is also run when +# autoupdate runs m4. It simply calls m4_warning, but +# we need a wrapper so that each warning is emitted only +# once. We break the quoting in m4_warning's argument in +# order to expand this macro's arguments, not AU_DEFUN's. + -test "$CFLAGS" || CFLAGS="-g -O3" +# Finally, this is the expansion that is picked up by +# autoconf. It tells the user to run autoupdate, and +# then outputs the replacement expansion. We do not care +# about autoupdate's warning because that contains +# information on what to do *after* running autoupdate. + + + +test "$CFLAGS" || CFLAGS="-g -O3 -ansi" ac_ext=c ac_cpp='$CPP $CPPFLAGS' @@ -2317,7 +2495,7 @@ if test -n "$ac_tool_prefix"; then set dummy ${ac_tool_prefix}gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_CC+set}" = set; then : +if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then @@ -2357,7 +2535,7 @@ if test -z "$ac_cv_prog_CC"; then set dummy gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_ac_ct_CC+set}" = set; then : +if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then @@ -2410,7 +2588,7 @@ if test -z "$CC"; then set dummy ${ac_tool_prefix}cc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_CC+set}" = set; then : +if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then @@ -2450,7 +2628,7 @@ if test -z "$CC"; then set dummy cc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_CC+set}" = set; then : +if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then @@ -2509,7 +2687,7 @@ if test -z "$CC"; then set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_CC+set}" = set; then : +if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then @@ -2553,7 +2731,7 @@ do set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_ac_ct_CC+set}" = set; then : +if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then @@ -2836,7 +3014,7 @@ rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out ac_clean_files=$ac_clean_files_save { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 $as_echo_n "checking for suffix of object files... " >&6; } -if test "${ac_cv_objext+set}" = set; then : +if ${ac_cv_objext+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -2887,7 +3065,7 @@ OBJEXT=$ac_cv_objext ac_objext=$OBJEXT { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 $as_echo_n "checking whether we are using the GNU C compiler... " >&6; } -if test "${ac_cv_c_compiler_gnu+set}" = set; then : +if ${ac_cv_c_compiler_gnu+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -2924,7 +3102,7 @@ ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 $as_echo_n "checking whether $CC accepts -g... " >&6; } -if test "${ac_cv_prog_cc_g+set}" = set; then : +if ${ac_cv_prog_cc_g+:} false; then : $as_echo_n "(cached) " >&6 else ac_save_c_werror_flag=$ac_c_werror_flag @@ -3002,7 +3180,7 @@ else fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 $as_echo_n "checking for $CC option to accept ISO C89... " >&6; } -if test "${ac_cv_prog_cc_c89+set}" = set; then : +if ${ac_cv_prog_cc_c89+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_prog_cc_c89=no @@ -3110,7 +3288,7 @@ if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then - if test "${ac_cv_prog_CPP+set}" = set; then : + if ${ac_cv_prog_CPP+:} false; then : $as_echo_n "(cached) " >&6 else # Double quotes because CPP needs to be expanded @@ -3140,7 +3318,7 @@ else # Broken: fails on valid input. continue fi -rm -f conftest.err conftest.$ac_ext +rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. @@ -3156,11 +3334,11 @@ else ac_preproc_ok=: break fi -rm -f conftest.err conftest.$ac_ext +rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. -rm -f conftest.err conftest.$ac_ext +rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : break fi @@ -3199,7 +3377,7 @@ else # Broken: fails on valid input. continue fi -rm -f conftest.err conftest.$ac_ext +rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. @@ -3215,11 +3393,11 @@ else ac_preproc_ok=: break fi -rm -f conftest.err conftest.$ac_ext +rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. -rm -f conftest.err conftest.$ac_ext +rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else @@ -3238,7 +3416,7 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 $as_echo_n "checking for grep that handles long lines and -e... " >&6; } -if test "${ac_cv_path_GREP+set}" = set; then : +if ${ac_cv_path_GREP+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$GREP"; then @@ -3301,7 +3479,7 @@ $as_echo "$ac_cv_path_GREP" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 $as_echo_n "checking for egrep... " >&6; } -if test "${ac_cv_path_EGREP+set}" = set; then : +if ${ac_cv_path_EGREP+:} false; then : $as_echo_n "(cached) " >&6 else if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 @@ -3368,7 +3546,7 @@ $as_echo "$ac_cv_path_EGREP" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 $as_echo_n "checking for ANSI C header files... " >&6; } -if test "${ac_cv_header_stdc+set}" = set; then : +if ${ac_cv_header_stdc+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -3497,7 +3675,7 @@ done { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether byte ordering is bigendian" >&5 $as_echo_n "checking whether byte ordering is bigendian... " >&6; } -if test "${ac_cv_c_bigendian+set}" = set; then : +if ${ac_cv_c_bigendian+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_c_bigendian=unknown @@ -3739,7 +3917,7 @@ else set dummy kpsewhich; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_kpsewhich+set}" = set; then : +if ${ac_cv_prog_kpsewhich+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$kpsewhich"; then @@ -3779,7 +3957,7 @@ else as_ac_File=`$as_echo "ac_cv_file_$latexdir/base/latex.ltx" | $as_tr_sh` { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $latexdir/base/latex.ltx" >&5 $as_echo_n "checking for $latexdir/base/latex.ltx... " >&6; } -if eval "test \"\${$as_ac_File+set}\"" = set; then : +if eval \${$as_ac_File+:} false; then : $as_echo_n "(cached) " >&6 else test "$cross_compiling" = yes && @@ -3800,7 +3978,7 @@ else as_ac_File=`$as_echo "ac_cv_file_$latexdir/base/latex.ltx" | $as_tr_sh` { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $latexdir/base/latex.ltx" >&5 $as_echo_n "checking for $latexdir/base/latex.ltx... " >&6; } -if eval "test \"\${$as_ac_File+set}\"" = set; then : +if eval \${$as_ac_File+:} false; then : $as_echo_n "(cached) " >&6 else test "$cross_compiling" = yes && @@ -3838,7 +4016,7 @@ else set dummy kpsewhich; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_kpsewhich+set}" = set; then : +if ${ac_cv_prog_kpsewhich+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$kpsewhich"; then @@ -3886,7 +4064,7 @@ do set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_TEXI2DVI+set}" = set; then : +if ${ac_cv_prog_TEXI2DVI+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$TEXI2DVI"; then @@ -3998,7 +4176,7 @@ if test -z "$CXX"; then set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_CXX+set}" = set; then : +if ${ac_cv_prog_CXX+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CXX"; then @@ -4042,7 +4220,7 @@ do set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_ac_ct_CXX+set}" = set; then : +if ${ac_cv_prog_ac_ct_CXX+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CXX"; then @@ -4120,7 +4298,7 @@ done { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C++ compiler" >&5 $as_echo_n "checking whether we are using the GNU C++ compiler... " >&6; } -if test "${ac_cv_cxx_compiler_gnu+set}" = set; then : +if ${ac_cv_cxx_compiler_gnu+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -4157,7 +4335,7 @@ ac_test_CXXFLAGS=${CXXFLAGS+set} ac_save_CXXFLAGS=$CXXFLAGS { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CXX accepts -g" >&5 $as_echo_n "checking whether $CXX accepts -g... " >&6; } -if test "${ac_cv_prog_cxx_g+set}" = set; then : +if ${ac_cv_prog_cxx_g+:} false; then : $as_echo_n "(cached) " >&6 else ac_save_cxx_werror_flag=$ac_cxx_werror_flag @@ -4246,7 +4424,7 @@ do set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_LEX+set}" = set; then : +if ${ac_cv_prog_LEX+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$LEX"; then @@ -4316,7 +4494,7 @@ $as_echo "$ac_try_echo"; } >&5 test $ac_status = 0; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking lex output file root" >&5 $as_echo_n "checking lex output file root... " >&6; } -if test "${ac_cv_prog_lex_root+set}" = set; then : +if ${ac_cv_prog_lex_root+:} false; then : $as_echo_n "(cached) " >&6 else @@ -4335,7 +4513,7 @@ LEX_OUTPUT_ROOT=$ac_cv_prog_lex_root if test -z "${LEXLIB+set}"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking lex library" >&5 $as_echo_n "checking lex library... " >&6; } -if test "${ac_cv_lib_lex+set}" = set; then : +if ${ac_cv_lib_lex+:} false; then : $as_echo_n "(cached) " >&6 else @@ -4365,7 +4543,7 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether yytext is a pointer" >&5 $as_echo_n "checking whether yytext is a pointer... " >&6; } -if test "${ac_cv_prog_lex_yytext_pointer+set}" = set; then : +if ${ac_cv_prog_lex_yytext_pointer+:} false; then : $as_echo_n "(cached) " >&6 else # POSIX says lex can declare yytext either as a pointer or an array; the @@ -4376,7 +4554,8 @@ ac_save_LIBS=$LIBS LIBS="$LEXLIB $ac_save_LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#define YYTEXT_POINTER 1 + + #define YYTEXT_POINTER 1 `cat $LEX_OUTPUT_ROOT.c` _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : @@ -4413,7 +4592,7 @@ if test -z "$CXX"; then set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_CXX+set}" = set; then : +if ${ac_cv_prog_CXX+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CXX"; then @@ -4457,7 +4636,7 @@ do set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_ac_ct_CXX+set}" = set; then : +if ${ac_cv_prog_ac_ct_CXX+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CXX"; then @@ -4535,7 +4714,7 @@ done { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C++ compiler" >&5 $as_echo_n "checking whether we are using the GNU C++ compiler... " >&6; } -if test "${ac_cv_cxx_compiler_gnu+set}" = set; then : +if ${ac_cv_cxx_compiler_gnu+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -4572,7 +4751,7 @@ ac_test_CXXFLAGS=${CXXFLAGS+set} ac_save_CXXFLAGS=$CXXFLAGS { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CXX accepts -g" >&5 $as_echo_n "checking whether $CXX accepts -g... " >&6; } -if test "${ac_cv_prog_cxx_g+set}" = set; then : +if ${ac_cv_prog_cxx_g+:} false; then : $as_echo_n "(cached) " >&6 else ac_save_cxx_werror_flag=$ac_cxx_werror_flag @@ -4700,7 +4879,7 @@ ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 $as_echo_n "checking for a BSD-compatible install... " >&6; } if test -z "$INSTALL"; then -if test "${ac_cv_path_install+set}" = set; then : +if ${ac_cv_path_install+:} false; then : $as_echo_n "(cached) " >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -4786,7 +4965,7 @@ if test -n "$ac_tool_prefix"; then set dummy ${ac_tool_prefix}gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_CC+set}" = set; then : +if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then @@ -4826,7 +5005,7 @@ if test -z "$ac_cv_prog_CC"; then set dummy gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_ac_ct_CC+set}" = set; then : +if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then @@ -4879,7 +5058,7 @@ if test -z "$CC"; then set dummy ${ac_tool_prefix}cc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_CC+set}" = set; then : +if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then @@ -4919,7 +5098,7 @@ if test -z "$CC"; then set dummy cc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_CC+set}" = set; then : +if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then @@ -4978,7 +5157,7 @@ if test -z "$CC"; then set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_CC+set}" = set; then : +if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then @@ -5022,7 +5201,7 @@ do set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_ac_ct_CC+set}" = set; then : +if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then @@ -5106,7 +5285,7 @@ done { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 $as_echo_n "checking whether we are using the GNU C compiler... " >&6; } -if test "${ac_cv_c_compiler_gnu+set}" = set; then : +if ${ac_cv_c_compiler_gnu+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -5143,7 +5322,7 @@ ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 $as_echo_n "checking whether $CC accepts -g... " >&6; } -if test "${ac_cv_prog_cc_g+set}" = set; then : +if ${ac_cv_prog_cc_g+:} false; then : $as_echo_n "(cached) " >&6 else ac_save_c_werror_flag=$ac_c_werror_flag @@ -5221,7 +5400,7 @@ else fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 $as_echo_n "checking for $CC option to accept ISO C89... " >&6; } -if test "${ac_cv_prog_cc_c89+set}" = set; then : +if ${ac_cv_prog_cc_c89+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_prog_cc_c89=no @@ -5320,7 +5499,7 @@ ac_compiler_gnu=$ac_cv_cxx_compiler_gnu $as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } set x ${MAKE-make} ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` -if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\"" = set; then : +if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then : $as_echo_n "(cached) " >&6 else cat >conftest.make <<\_ACEOF @@ -5353,7 +5532,7 @@ do set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_YACC+set}" = set; then : +if ${ac_cv_prog_YACC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$YACC"; then @@ -5393,10 +5572,13 @@ test -n "$YACC" || YACC="yacc" if test "$GXX" = yes ; then ac_gcc_version=`echo __GNUC__ | $CC -E - | grep -v ^\#` + ac_clang=`echo __clang__ | $CC -E - | grep -v ^\#` if test "$ac_gcc_version" -lt 4; then CFLAGS=$CFLAGS" -finline-limit=400" else - CFLAGS=$CFLAGS" --no-var-tracking" + if test "$ac_clang" != 1; then + CFLAGS=$CFLAGS" -fno-var-tracking" + fi fi fi @@ -5408,7 +5590,7 @@ ac_compiler_gnu=$ac_cv_cxx_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C++ preprocessor" >&5 $as_echo_n "checking how to run the C++ preprocessor... " >&6; } if test -z "$CXXCPP"; then - if test "${ac_cv_prog_CXXCPP+set}" = set; then : + if ${ac_cv_prog_CXXCPP+:} false; then : $as_echo_n "(cached) " >&6 else # Double quotes because CXXCPP needs to be expanded @@ -5438,7 +5620,7 @@ else # Broken: fails on valid input. continue fi -rm -f conftest.err conftest.$ac_ext +rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. @@ -5454,11 +5636,11 @@ else ac_preproc_ok=: break fi -rm -f conftest.err conftest.$ac_ext +rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. -rm -f conftest.err conftest.$ac_ext +rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : break fi @@ -5497,7 +5679,7 @@ else # Broken: fails on valid input. continue fi -rm -f conftest.err conftest.$ac_ext +rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. @@ -5513,11 +5695,11 @@ else ac_preproc_ok=: break fi -rm -f conftest.err conftest.$ac_ext +rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. -rm -f conftest.err conftest.$ac_ext +rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else @@ -5535,11 +5717,11 @@ ac_compiler_gnu=$ac_cv_cxx_compiler_gnu ac_fn_cxx_check_header_mongrel "$LINENO" "tr1/unordered_map" "ac_cv_header_tr1_unordered_map" "$ac_includes_default" -if test "x$ac_cv_header_tr1_unordered_map" = x""yes; then : +if test "x$ac_cv_header_tr1_unordered_map" = xyes; then : else ac_fn_cxx_check_header_mongrel "$LINENO" "ext/hash_map" "ac_cv_header_ext_hash_map" "$ac_includes_default" -if test "x$ac_cv_header_ext_hash_map" = x""yes; then : +if test "x$ac_cv_header_ext_hash_map" = xyes; then : else OPTIONS=$OPTIONS"-DNOHASH " @@ -5550,12 +5732,12 @@ fi -GCVERSION=gc-7.1 +GCVERSION=gc-7.2b as_ac_File=`$as_echo "ac_cv_file_$GCVERSION.tar.gz" | $as_tr_sh` { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $GCVERSION.tar.gz" >&5 $as_echo_n "checking for $GCVERSION.tar.gz... " >&6; } -if eval "test \"\${$as_ac_File+set}\"" = set; then : +if eval \${$as_ac_File+:} false; then : $as_echo_n "(cached) " >&6 else test "$cross_compiling" = yes && @@ -5606,10 +5788,10 @@ if test "x$ac_cv_use_gc" != "xno" ; then CPPFLAGS_SAVE=$CPPFLAGS CPPFLAGS=$CPPFLAGS" $INCL" ac_fn_cxx_check_header_mongrel "$LINENO" "gc.h" "ac_cv_header_gc_h" "$ac_includes_default" -if test "x$ac_cv_header_gc_h" = x""yes; then : +if test "x$ac_cv_header_gc_h" = xyes; then : { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GC_malloc in -lgc" >&5 $as_echo_n "checking for GC_malloc in -lgc... " >&6; } -if test "${ac_cv_lib_gc_GC_malloc+set}" = set; then : +if ${ac_cv_lib_gc_GC_malloc+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS @@ -5643,7 +5825,7 @@ LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_gc_GC_malloc" >&5 $as_echo "$ac_cv_lib_gc_GC_malloc" >&6; } -if test "x$ac_cv_lib_gc_GC_malloc" = x""yes; then : +if test "x$ac_cv_lib_gc_GC_malloc" = xyes; then : LIBS=$LIBS"-lgc " { $as_echo "$as_me:${as_lineno-$LINENO}: enabling system $GCNAME" >&5 @@ -5710,13 +5892,13 @@ $as_echo "$as_me: *** Enabling GC backtrace debugging; remember to make gc-clean fi -if test "$OSTYPE" = "cygwin"; then +if test "$OSTYPE" = "msdos"; then INCL=$INCL" -I/usr/include/tirpc" -CPPFLAGS=$CPPFLAGS" $INCL" +CPPFLAGS=$CPPFLAGS" -D__MSDOS__ $INCL" fi ac_fn_cxx_check_func "$LINENO" "getopt_long_only" "ac_cv_func_getopt_long_only" -if test "x$ac_cv_func_getopt_long_only" = x""yes; then : +if test "x$ac_cv_func_getopt_long_only" = xyes; then : $as_echo "#define HAVE_GNU_GETOPT_H 1" >>confdefs.h @@ -5736,7 +5918,7 @@ fi # Checks for libraries. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for setupterm in -lncurses" >&5 $as_echo_n "checking for setupterm in -lncurses... " >&6; } -if test "${ac_cv_lib_ncurses_setupterm+set}" = set; then : +if ${ac_cv_lib_ncurses_setupterm+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS @@ -5770,14 +5952,14 @@ LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ncurses_setupterm" >&5 $as_echo "$ac_cv_lib_ncurses_setupterm" >&6; } -if test "x$ac_cv_lib_ncurses_setupterm" = x""yes; then : +if test "x$ac_cv_lib_ncurses_setupterm" = xyes; then : $as_echo "#define HAVE_LIBCURSES 1" >>confdefs.h LIBS=$LIBS"-lncurses " else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for setupterm in -lcurses" >&5 $as_echo_n "checking for setupterm in -lcurses... " >&6; } -if test "${ac_cv_lib_curses_setupterm+set}" = set; then : +if ${ac_cv_lib_curses_setupterm+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS @@ -5811,7 +5993,7 @@ LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_curses_setupterm" >&5 $as_echo "$ac_cv_lib_curses_setupterm" >&6; } -if test "x$ac_cv_lib_curses_setupterm" = x""yes; then : +if test "x$ac_cv_lib_curses_setupterm" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBCURSES 1 _ACEOF @@ -5824,7 +6006,7 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sqrt in -lm" >&5 $as_echo_n "checking for sqrt in -lm... " >&6; } -if test "${ac_cv_lib_m_sqrt+set}" = set; then : +if ${ac_cv_lib_m_sqrt+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS @@ -5858,7 +6040,7 @@ LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_sqrt" >&5 $as_echo "$ac_cv_lib_m_sqrt" >&6; } -if test "x$ac_cv_lib_m_sqrt" = x""yes; then : +if test "x$ac_cv_lib_m_sqrt" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBM 1 _ACEOF @@ -5871,7 +6053,7 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for deflate in -lz" >&5 $as_echo_n "checking for deflate in -lz... " >&6; } -if test "${ac_cv_lib_z_deflate+set}" = set; then : +if ${ac_cv_lib_z_deflate+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS @@ -5905,7 +6087,7 @@ LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_z_deflate" >&5 $as_echo "$ac_cv_lib_z_deflate" >&6; } -if test "x$ac_cv_lib_z_deflate" = x""yes; then : +if test "x$ac_cv_lib_z_deflate" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBZ 1 _ACEOF @@ -5916,14 +6098,102 @@ else as_fn_error $? "*** Please install libz on your system ***" "$LINENO" 5 fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_create in -lpthread" >&5 -$as_echo_n "checking for pthread_create in -lpthread... " >&6; } -if test "${ac_cv_lib_pthread_pthread_create+set}" = set; then : +# Make sure we can run config.sub. +$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || + as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5 + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5 +$as_echo_n "checking build system type... " >&6; } +if ${ac_cv_build+:} false; then : $as_echo_n "(cached) " >&6 else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lpthread $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext + ac_build_alias=$build_alias +test "x$ac_build_alias" = x && + ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` +test "x$ac_build_alias" = x && + as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5 +ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || + as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5 + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5 +$as_echo "$ac_cv_build" >&6; } +case $ac_cv_build in +*-*-*) ;; +*) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;; +esac +build=$ac_cv_build +ac_save_IFS=$IFS; IFS='-' +set x $ac_cv_build +shift +build_cpu=$1 +build_vendor=$2 +shift; shift +# Remember, the first character of IFS is used to create $*, +# except with old shells: +build_os=$* +IFS=$ac_save_IFS +case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5 +$as_echo_n "checking host system type... " >&6; } +if ${ac_cv_host+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test "x$host_alias" = x; then + ac_cv_host=$ac_cv_build +else + ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || + as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5 +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5 +$as_echo "$ac_cv_host" >&6; } +case $ac_cv_host in +*-*-*) ;; +*) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;; +esac +host=$ac_cv_host +ac_save_IFS=$IFS; IFS='-' +set x $ac_cv_host +shift +host_cpu=$1 +host_vendor=$2 +shift; shift +# Remember, the first character of IFS is used to create $*, +# except with old shells: +host_os=$* +IFS=$ac_save_IFS +case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac + + + + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +ax_pthread_ok=no + +# We used to check for pthread.h first, but this fails if pthread.h +# requires special compiler flags (e.g. on True64 or Sequent). +# It gets checked for in the link test anyway. + +# First of all, check if the user has set any of the PTHREAD_LIBS, +# etcetera environment variables, and if threads linking works using +# them: +if test x"$PTHREAD_LIBS$PTHREAD_CFLAGS" != x; then + save_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS $PTHREAD_CFLAGS" + save_LIBS="$LIBS" + LIBS="$PTHREAD_LIBS $LIBS" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_join in LIBS=$PTHREAD_LIBS with CFLAGS=$PTHREAD_CFLAGS" >&5 +$as_echo_n "checking for pthread_join in LIBS=$PTHREAD_LIBS with CFLAGS=$PTHREAD_CFLAGS... " >&6; } + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. @@ -5932,38 +6202,372 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext #ifdef __cplusplus extern "C" #endif -char pthread_create (); +char pthread_join (); int main () { -return pthread_create (); +return pthread_join (); ; return 0; } _ACEOF -if ac_fn_cxx_try_link "$LINENO"; then : - ac_cv_lib_pthread_pthread_create=yes +if ac_fn_c_try_link "$LINENO"; then : + ax_pthread_ok=yes +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_pthread_ok" >&5 +$as_echo "$ax_pthread_ok" >&6; } + if test x"$ax_pthread_ok" = xno; then + PTHREAD_LIBS="" + PTHREAD_CFLAGS="" + fi + LIBS="$save_LIBS" + CFLAGS="$save_CFLAGS" +fi + +# We must check for the threads library under a number of different +# names; the ordering is very important because some systems +# (e.g. DEC) have both -lpthread and -lpthreads, where one of the +# libraries is broken (non-POSIX). + +# Create a list of thread flags to try. Items starting with a "-" are +# C compiler flags, and other items are library names, except for "none" +# which indicates that we try without any flags at all, and "pthread-config" +# which is a program returning the flags for the Pth emulation library. + +ax_pthread_flags="pthreads none -Kthread -kthread lthread -pthread -pthreads -mthreads pthread --thread-safe -mt pthread-config" + +# The ordering *is* (sometimes) important. Some notes on the +# individual items follow: + +# pthreads: AIX (must check this before -lpthread) +# none: in case threads are in libc; should be tried before -Kthread and +# other compiler flags to prevent continual compiler warnings +# -Kthread: Sequent (threads in libc, but -Kthread needed for pthread.h) +# -kthread: FreeBSD kernel threads (preferred to -pthread since SMP-able) +# lthread: LinuxThreads port on FreeBSD (also preferred to -pthread) +# -pthread: Linux/gcc (kernel threads), BSD/gcc (userland threads) +# -pthreads: Solaris/gcc +# -mthreads: Mingw32/gcc, Lynx/gcc +# -mt: Sun Workshop C (may only link SunOS threads [-lthread], but it +# doesn't hurt to check since this sometimes defines pthreads too; +# also defines -D_REENTRANT) +# ... -mt is also the pthreads flag for HP/aCC +# pthread: Linux, etcetera +# --thread-safe: KAI C++ +# pthread-config: use pthread-config program (for GNU Pth library) + +case ${host_os} in + solaris*) + + # On Solaris (at least, for some versions), libc contains stubbed + # (non-functional) versions of the pthreads routines, so link-based + # tests will erroneously succeed. (We need to link with -pthreads/-mt/ + # -lpthread.) (The stubs are missing pthread_cleanup_push, or rather + # a function called by this macro, so we could check for that, but + # who knows whether they'll stub that too in a future libc.) So, + # we'll just look for -pthreads and -lpthread first: + + ax_pthread_flags="-pthreads pthread -mt -pthread $ax_pthread_flags" + ;; + + darwin*) + ax_pthread_flags="-pthread $ax_pthread_flags" + ;; +esac + +if test x"$ax_pthread_ok" = xno; then +for flag in $ax_pthread_flags; do + + case $flag in + none) + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether pthreads work without any flags" >&5 +$as_echo_n "checking whether pthreads work without any flags... " >&6; } + ;; + + -*) + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether pthreads work with $flag" >&5 +$as_echo_n "checking whether pthreads work with $flag... " >&6; } + PTHREAD_CFLAGS="$flag" + ;; + + pthread-config) + # Extract the first word of "pthread-config", so it can be a program name with args. +set dummy pthread-config; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ax_pthread_config+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ax_pthread_config"; then + ac_cv_prog_ax_pthread_config="$ax_pthread_config" # Let the user override the test. else - ac_cv_lib_pthread_pthread_create=no +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ax_pthread_config="yes" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + test -z "$ac_cv_prog_ax_pthread_config" && ac_cv_prog_ax_pthread_config="no" +fi +fi +ax_pthread_config=$ac_cv_prog_ax_pthread_config +if test -n "$ax_pthread_config"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_pthread_config" >&5 +$as_echo "$ax_pthread_config" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + if test x"$ax_pthread_config" = xno; then continue; fi + PTHREAD_CFLAGS="`pthread-config --cflags`" + PTHREAD_LIBS="`pthread-config --ldflags` `pthread-config --libs`" + ;; + + *) + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for the pthreads library -l$flag" >&5 +$as_echo_n "checking for the pthreads library -l$flag... " >&6; } + PTHREAD_LIBS="-l$flag" + ;; + esac + + save_LIBS="$LIBS" + save_CFLAGS="$CFLAGS" + LIBS="$PTHREAD_LIBS $LIBS" + CFLAGS="$CFLAGS $PTHREAD_CFLAGS" + + # Check for various functions. We must include pthread.h, + # since some functions may be macros. (On the Sequent, we + # need a special flag -Kthread to make this header compile.) + # We check for pthread_join because it is in -lpthread on IRIX + # while pthread_create is in libc. We check for pthread_attr_init + # due to DEC craziness with -lpthreads. We check for + # pthread_cleanup_push because it is one of the few pthread + # functions on Solaris that doesn't have a non-functional libc stub. + # We try pthread_create on general principles. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <pthread.h> + static void routine(void *a) { a = 0; } + static void *start_routine(void *a) { return a; } +int +main () +{ +pthread_t th; pthread_attr_t attr; + pthread_create(&th, 0, start_routine, 0); + pthread_join(th, 0); + pthread_attr_init(&attr); + pthread_cleanup_push(routine, 0); + pthread_cleanup_pop(0) /* ; */ + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ax_pthread_ok=yes fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS + + LIBS="$save_LIBS" + CFLAGS="$save_CFLAGS" + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_pthread_ok" >&5 +$as_echo "$ax_pthread_ok" >&6; } + if test "x$ax_pthread_ok" = xyes; then + break; + fi + + PTHREAD_LIBS="" + PTHREAD_CFLAGS="" +done fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread_pthread_create" >&5 -$as_echo "$ac_cv_lib_pthread_pthread_create" >&6; } -if test "x$ac_cv_lib_pthread_pthread_create" = x""yes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_LIBPTHREAD 1 + +# Various other checks: +if test "x$ax_pthread_ok" = xyes; then + save_LIBS="$LIBS" + LIBS="$PTHREAD_LIBS $LIBS" + save_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS $PTHREAD_CFLAGS" + + # Detect AIX lossage: JOINABLE attribute is called UNDETACHED. + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for joinable pthread attribute" >&5 +$as_echo_n "checking for joinable pthread attribute... " >&6; } + attr_name=unknown + for attr in PTHREAD_CREATE_JOINABLE PTHREAD_CREATE_UNDETACHED; do + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <pthread.h> +int +main () +{ +int attr = $attr; return attr /* ; */ + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + attr_name=$attr; break +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + done + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $attr_name" >&5 +$as_echo "$attr_name" >&6; } + if test "$attr_name" != PTHREAD_CREATE_JOINABLE; then + +cat >>confdefs.h <<_ACEOF +#define PTHREAD_CREATE_JOINABLE $attr_name +_ACEOF + + fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if more special flags are required for pthreads" >&5 +$as_echo_n "checking if more special flags are required for pthreads... " >&6; } + flag=no + case ${host_os} in + aix* | freebsd* | darwin*) flag="-D_THREAD_SAFE";; + osf* | hpux*) flag="-D_REENTRANT";; + solaris*) + if test "$GCC" = "yes"; then + flag="-D_REENTRANT" + else + flag="-mt -D_REENTRANT" + fi + ;; + esac + { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${flag}" >&5 +$as_echo "${flag}" >&6; } + if test "x$flag" != xno; then + PTHREAD_CFLAGS="$flag $PTHREAD_CFLAGS" + fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for PTHREAD_PRIO_INHERIT" >&5 +$as_echo_n "checking for PTHREAD_PRIO_INHERIT... " >&6; } +if ${ax_cv_PTHREAD_PRIO_INHERIT+:} false; then : + $as_echo_n "(cached) " >&6 +else + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include <pthread.h> +int +main () +{ +int i = PTHREAD_PRIO_INHERIT; + ; + return 0; +} _ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ax_cv_PTHREAD_PRIO_INHERIT=yes +else + ax_cv_PTHREAD_PRIO_INHERIT=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_PTHREAD_PRIO_INHERIT" >&5 +$as_echo "$ax_cv_PTHREAD_PRIO_INHERIT" >&6; } + if test "x$ax_cv_PTHREAD_PRIO_INHERIT" = "xyes"; then : - LIBS="-lpthread $LIBS" +$as_echo "#define HAVE_PTHREAD_PRIO_INHERIT 1" >>confdefs.h fi + LIBS="$save_LIBS" + CFLAGS="$save_CFLAGS" + + # More AIX lossage: must compile with xlc_r or cc_r + if test x"$GCC" != xyes; then + for ac_prog in xlc_r cc_r +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_PTHREAD_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$PTHREAD_CC"; then + ac_cv_prog_PTHREAD_CC="$PTHREAD_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_PTHREAD_CC="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +PTHREAD_CC=$ac_cv_prog_PTHREAD_CC +if test -n "$PTHREAD_CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PTHREAD_CC" >&5 +$as_echo "$PTHREAD_CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$PTHREAD_CC" && break +done +test -n "$PTHREAD_CC" || PTHREAD_CC="${CC}" + + else + PTHREAD_CC=$CC + fi +else + PTHREAD_CC="$CC" +fi + + + + + +# Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND: +if test x"$ax_pthread_ok" = xyes; then + +$as_echo "#define HAVE_PTHREAD 1" >>confdefs.h + + : +else + ax_pthread_ok=no + +fi +ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for stackoverflow_install_handler in -lsigsegv" >&5 $as_echo_n "checking for stackoverflow_install_handler in -lsigsegv... " >&6; } -if test "${ac_cv_lib_sigsegv_stackoverflow_install_handler+set}" = set; then : +if ${ac_cv_lib_sigsegv_stackoverflow_install_handler+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS @@ -5997,7 +6601,7 @@ LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_sigsegv_stackoverflow_install_handler" >&5 $as_echo "$ac_cv_lib_sigsegv_stackoverflow_install_handler" >&6; } -if test "x$ac_cv_lib_sigsegv_stackoverflow_install_handler" = x""yes; then : +if test "x$ac_cv_lib_sigsegv_stackoverflow_install_handler" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBSIGSEGV 1 _ACEOF @@ -6008,7 +6612,7 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sched_yield in -lrt" >&5 $as_echo_n "checking for sched_yield in -lrt... " >&6; } -if test "${ac_cv_lib_rt_sched_yield+set}" = set; then : +if ${ac_cv_lib_rt_sched_yield+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS @@ -6042,7 +6646,7 @@ LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_rt_sched_yield" >&5 $as_echo "$ac_cv_lib_rt_sched_yield" >&6; } -if test "x$ac_cv_lib_rt_sched_yield" = x""yes; then : +if test "x$ac_cv_lib_rt_sched_yield" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBRT 1 _ACEOF @@ -6081,7 +6685,7 @@ _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: checking for rl_completion_matches in -lreadline" >&5 $as_echo_n "checking for rl_completion_matches in -lreadline... " >&6; } -if test "${ac_cv_lib_readline_rl_completion_matches+set}" = set; then : +if ${ac_cv_lib_readline_rl_completion_matches+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS @@ -6115,7 +6719,7 @@ LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_readline_rl_completion_matches" >&5 $as_echo "$ac_cv_lib_readline_rl_completion_matches" >&6; } -if test "x$ac_cv_lib_readline_rl_completion_matches" = x""yes; then : +if test "x$ac_cv_lib_readline_rl_completion_matches" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBREADLINE 1 _ACEOF @@ -6134,7 +6738,7 @@ fi # Checks for header files. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sys/wait.h that is POSIX.1 compatible" >&5 $as_echo_n "checking for sys/wait.h that is POSIX.1 compatible... " >&6; } -if test "${ac_cv_header_sys_wait_h+set}" = set; then : +if ${ac_cv_header_sys_wait_h+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -6202,7 +6806,7 @@ done for ac_header in fpu_control.h do : ac_fn_cxx_check_header_mongrel "$LINENO" "fpu_control.h" "ac_cv_header_fpu_control_h" "$ac_includes_default" -if test "x$ac_cv_header_fpu_control_h" = x""yes; then : +if test "x$ac_cv_header_fpu_control_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_FPU_CONTROL_H 1 _ACEOF @@ -6226,7 +6830,7 @@ _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing xdrstdio_create" >&5 $as_echo_n "checking for library containing xdrstdio_create... " >&6; } -if test "${ac_cv_search_xdrstdio_create+set}" = set; then : +if ${ac_cv_search_xdrstdio_create+:} false; then : $as_echo_n "(cached) " >&6 else ac_func_search_save_LIBS=$LIBS @@ -6260,11 +6864,11 @@ for ac_lib in '' nsl rpc; do fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext - if test "${ac_cv_search_xdrstdio_create+set}" = set; then : + if ${ac_cv_search_xdrstdio_create+:} false; then : break fi done -if test "${ac_cv_search_xdrstdio_create+set}" = set; then : +if ${ac_cv_search_xdrstdio_create+:} false; then : else ac_cv_search_xdrstdio_create=no @@ -6297,10 +6901,10 @@ fi if test "x$enable_gsl" != "xno"; then ac_fn_cxx_check_header_mongrel "$LINENO" "gsl/gsl_sf.h" "ac_cv_header_gsl_gsl_sf_h" "$ac_includes_default" -if test "x$ac_cv_header_gsl_gsl_sf_h" = x""yes; then : +if test "x$ac_cv_header_gsl_gsl_sf_h" = xyes; then : { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gsl_sf_debye_6 in -lgsl" >&5 $as_echo_n "checking for gsl_sf_debye_6 in -lgsl... " >&6; } -if test "${ac_cv_lib_gsl_gsl_sf_debye_6+set}" = set; then : +if ${ac_cv_lib_gsl_gsl_sf_debye_6+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS @@ -6334,7 +6938,7 @@ LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_gsl_gsl_sf_debye_6" >&5 $as_echo "$ac_cv_lib_gsl_gsl_sf_debye_6" >&6; } -if test "x$ac_cv_lib_gsl_gsl_sf_debye_6" = x""yes; then : +if test "x$ac_cv_lib_gsl_gsl_sf_debye_6" = xyes; then : $as_echo "#define HAVE_LIBGSL 1" >>confdefs.h LIBS=$LIBS"-lgsl -lgslcblas " @@ -6359,10 +6963,10 @@ fi if test "x$enable_fftw" != "xno"; then ac_fn_cxx_check_header_mongrel "$LINENO" "fftw3.h" "ac_cv_header_fftw3_h" "$ac_includes_default" -if test "x$ac_cv_header_fftw3_h" = x""yes; then : +if test "x$ac_cv_header_fftw3_h" = xyes; then : { $as_echo "$as_me:${as_lineno-$LINENO}: checking for fftw_execute in -lfftw3" >&5 $as_echo_n "checking for fftw_execute in -lfftw3... " >&6; } -if test "${ac_cv_lib_fftw3_fftw_execute+set}" = set; then : +if ${ac_cv_lib_fftw3_fftw_execute+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS @@ -6396,7 +7000,7 @@ LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fftw3_fftw_execute" >&5 $as_echo "$ac_cv_lib_fftw3_fftw_execute" >&6; } -if test "x$ac_cv_lib_fftw3_fftw_execute" = x""yes; then : +if test "x$ac_cv_lib_fftw3_fftw_execute" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBFFTW3 1 _ACEOF @@ -6434,10 +7038,10 @@ fi if test "x$enable_gl" != "xno"; then case "$OSTYPE" in - cygwin) + msdos) if test "x$enable_offscreen" != "xyes"; then ac_fn_cxx_check_header_mongrel "$LINENO" "GL/gl.h" "ac_cv_header_GL_gl_h" "$ac_includes_default" -if test "x$ac_cv_header_GL_gl_h" = x""yes; then : +if test "x$ac_cv_header_GL_gl_h" = xyes; then : $as_echo "#define HAVE_LIBGL 1" >>confdefs.h @@ -6451,7 +7055,7 @@ fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gluNewNurbsRenderer in -lGLU" >&5 $as_echo_n "checking for gluNewNurbsRenderer in -lGLU... " >&6; } -if test "${ac_cv_lib_GLU_gluNewNurbsRenderer+set}" = set; then : +if ${ac_cv_lib_GLU_gluNewNurbsRenderer+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS @@ -6485,7 +7089,7 @@ LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_GLU_gluNewNurbsRenderer" >&5 $as_echo "$ac_cv_lib_GLU_gluNewNurbsRenderer" >&6; } -if test "x$ac_cv_lib_GLU_gluNewNurbsRenderer" = x""yes; then : +if test "x$ac_cv_lib_GLU_gluNewNurbsRenderer" = xyes; then : $as_echo "#define HAVE_LIBGLU 1" >>confdefs.h LIBS=$LIBS"-lglu32 " @@ -6495,7 +7099,7 @@ $as_echo "$as_me: *** Could not find libglu32: will compile without OpenGL suppo fi ac_fn_cxx_check_header_mongrel "$LINENO" "GL/glut.h" "ac_cv_header_GL_glut_h" "$ac_includes_default" -if test "x$ac_cv_header_GL_glut_h" = x""yes; then : +if test "x$ac_cv_header_GL_glut_h" = xyes; then : $as_echo "#define HAVE_LIBGLUT 1" >>confdefs.h @@ -6510,7 +7114,7 @@ fi darwin*) if test "x$enable_offscreen" != "xyes"; then ac_fn_cxx_check_header_mongrel "$LINENO" "OpenGL/gl.h" "ac_cv_header_OpenGL_gl_h" "$ac_includes_default" -if test "x$ac_cv_header_OpenGL_gl_h" = x""yes; then : +if test "x$ac_cv_header_OpenGL_gl_h" = xyes; then : $as_echo "#define HAVE_LIBGL 1" >>confdefs.h @@ -6519,7 +7123,7 @@ fi fi ac_fn_cxx_check_header_mongrel "$LINENO" "OpenGL/glu.h" "ac_cv_header_OpenGL_glu_h" "$ac_includes_default" -if test "x$ac_cv_header_OpenGL_glu_h" = x""yes; then : +if test "x$ac_cv_header_OpenGL_glu_h" = xyes; then : $as_echo "#define HAVE_LIBGLU 1" >>confdefs.h @@ -6527,7 +7131,7 @@ fi ac_fn_cxx_check_header_mongrel "$LINENO" "GLUT/glut.h" "ac_cv_header_GLUT_glut_h" "$ac_includes_default" -if test "x$ac_cv_header_GLUT_glut_h" = x""yes; then : +if test "x$ac_cv_header_GLUT_glut_h" = xyes; then : $as_echo "#define HAVE_LIBGLUT 1" >>confdefs.h @@ -6568,7 +7172,7 @@ fi *) if test "x$enable_offscreen" != "xyes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for glDepthMask in -lGL" >&5 $as_echo_n "checking for glDepthMask in -lGL... " >&6; } -if test "${ac_cv_lib_GL_glDepthMask+set}" = set; then : +if ${ac_cv_lib_GL_glDepthMask+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS @@ -6602,7 +7206,7 @@ LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_GL_glDepthMask" >&5 $as_echo "$ac_cv_lib_GL_glDepthMask" >&6; } -if test "x$ac_cv_lib_GL_glDepthMask" = x""yes; then : +if test "x$ac_cv_lib_GL_glDepthMask" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBGL 1 _ACEOF @@ -6614,7 +7218,7 @@ fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gluNewNurbsRenderer in -lGLU" >&5 $as_echo_n "checking for gluNewNurbsRenderer in -lGLU... " >&6; } -if test "${ac_cv_lib_GLU_gluNewNurbsRenderer+set}" = set; then : +if ${ac_cv_lib_GLU_gluNewNurbsRenderer+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS @@ -6648,7 +7252,7 @@ LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_GLU_gluNewNurbsRenderer" >&5 $as_echo "$ac_cv_lib_GLU_gluNewNurbsRenderer" >&6; } -if test "x$ac_cv_lib_GLU_gluNewNurbsRenderer" = x""yes; then : +if test "x$ac_cv_lib_GLU_gluNewNurbsRenderer" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBGLU 1 _ACEOF @@ -6662,7 +7266,7 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for glutMainLoop in -lglut" >&5 $as_echo_n "checking for glutMainLoop in -lglut... " >&6; } -if test "${ac_cv_lib_glut_glutMainLoop+set}" = set; then : +if ${ac_cv_lib_glut_glutMainLoop+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS @@ -6696,7 +7300,7 @@ LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_glut_glutMainLoop" >&5 $as_echo "$ac_cv_lib_glut_glutMainLoop" >&6; } -if test "x$ac_cv_lib_glut_glutMainLoop" = x""yes; then : +if test "x$ac_cv_lib_glut_glutMainLoop" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBGLUT 1 _ACEOF @@ -6712,7 +7316,7 @@ esac if test "x$enable_offscreen" == "xyes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for OSMesaCreateContext in -lOSMesa" >&5 $as_echo_n "checking for OSMesaCreateContext in -lOSMesa... " >&6; } -if test "${ac_cv_lib_OSMesa_OSMesaCreateContext+set}" = set; then : +if ${ac_cv_lib_OSMesa_OSMesaCreateContext+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS @@ -6746,7 +7350,7 @@ LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_OSMesa_OSMesaCreateContext" >&5 $as_echo "$ac_cv_lib_OSMesa_OSMesaCreateContext" >&6; } -if test "x$ac_cv_lib_OSMesa_OSMesaCreateContext" = x""yes; then : +if test "x$ac_cv_lib_OSMesa_OSMesaCreateContext" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBOSMESA 1 _ACEOF @@ -6763,7 +7367,7 @@ fi # Checks for typedefs, structures, and compiler characteristics. ac_fn_cxx_check_type "$LINENO" "pid_t" "ac_cv_type_pid_t" "$ac_includes_default" -if test "x$ac_cv_type_pid_t" = x""yes; then : +if test "x$ac_cv_type_pid_t" = xyes; then : else @@ -6774,7 +7378,7 @@ _ACEOF fi ac_fn_cxx_check_type "$LINENO" "size_t" "ac_cv_type_size_t" "$ac_includes_default" -if test "x$ac_cv_type_size_t" = x""yes; then : +if test "x$ac_cv_type_size_t" = xyes; then : else @@ -6785,7 +7389,7 @@ _ACEOF fi ac_fn_cxx_check_type "$LINENO" "ptrdiff_t" "ac_cv_type_ptrdiff_t" "$ac_includes_default" -if test "x$ac_cv_type_ptrdiff_t" = x""yes; then : +if test "x$ac_cv_type_ptrdiff_t" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_PTRDIFF_T 1 @@ -6795,7 +7399,7 @@ _ACEOF fi ac_fn_cxx_check_type "$LINENO" "long long" "ac_cv_type_long_long" "$ac_includes_default" -if test "x$ac_cv_type_long_long" = x""yes; then : +if test "x$ac_cv_type_long_long" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LONG_LONG 1 @@ -6805,7 +7409,7 @@ _ACEOF fi ac_fn_cxx_check_type "$LINENO" "long" "ac_cv_type_long" "$ac_includes_default" -if test "x$ac_cv_type_long" = x""yes; then : +if test "x$ac_cv_type_long" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LONG 1 @@ -6816,7 +7420,7 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for an ANSI C-conforming const" >&5 $as_echo_n "checking for an ANSI C-conforming const... " >&6; } -if test "${ac_cv_c_const+set}" = set; then : +if ${ac_cv_c_const+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -6896,7 +7500,7 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for inline" >&5 $as_echo_n "checking for inline... " >&6; } -if test "${ac_cv_c_inline+set}" = set; then : +if ${ac_cv_c_inline+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_c_inline=no @@ -6938,7 +7542,7 @@ esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking return type of signal handlers" >&5 $as_echo_n "checking return type of signal handlers... " >&6; } -if test "${ac_cv_type_signal+set}" = set; then : +if ${ac_cv_type_signal+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -6976,7 +7580,7 @@ _ACEOF for ac_header in vfork.h do : ac_fn_cxx_check_header_mongrel "$LINENO" "vfork.h" "ac_cv_header_vfork_h" "$ac_includes_default" -if test "x$ac_cv_header_vfork_h" = x""yes; then : +if test "x$ac_cv_header_vfork_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_VFORK_H 1 _ACEOF @@ -7000,7 +7604,7 @@ done if test "x$ac_cv_func_fork" = xyes; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working fork" >&5 $as_echo_n "checking for working fork... " >&6; } -if test "${ac_cv_func_fork_works+set}" = set; then : +if ${ac_cv_func_fork_works+:} false; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : @@ -7053,7 +7657,7 @@ ac_cv_func_vfork_works=$ac_cv_func_vfork if test "x$ac_cv_func_vfork" = xyes; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working vfork" >&5 $as_echo_n "checking for working vfork... " >&6; } -if test "${ac_cv_func_vfork_works+set}" = set; then : +if ${ac_cv_func_vfork_works+:} false; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : @@ -7201,7 +7805,7 @@ done for ac_func in strftime do : ac_fn_cxx_check_func "$LINENO" "strftime" "ac_cv_func_strftime" -if test "x$ac_cv_func_strftime" = x""yes; then : +if test "x$ac_cv_func_strftime" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_STRFTIME 1 _ACEOF @@ -7210,7 +7814,7 @@ else # strftime is in -lintl on SCO UNIX. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for strftime in -lintl" >&5 $as_echo_n "checking for strftime in -lintl... " >&6; } -if test "${ac_cv_lib_intl_strftime+set}" = set; then : +if ${ac_cv_lib_intl_strftime+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS @@ -7244,7 +7848,7 @@ LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_intl_strftime" >&5 $as_echo "$ac_cv_lib_intl_strftime" >&6; } -if test "x$ac_cv_lib_intl_strftime" = x""yes; then : +if test "x$ac_cv_lib_intl_strftime" = xyes; then : $as_echo "#define HAVE_STRFTIME 1" >>confdefs.h LIBS="-lintl $LIBS" @@ -7257,7 +7861,7 @@ done for ac_func in strptime do : ac_fn_cxx_check_func "$LINENO" "strptime" "ac_cv_func_strptime" -if test "x$ac_cv_func_strptime" = x""yes; then : +if test "x$ac_cv_func_strptime" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_STRPTIME 1 _ACEOF @@ -7268,7 +7872,7 @@ done { $as_echo "$as_me:${as_lineno-$LINENO}: checking for error_at_line" >&5 $as_echo_n "checking for error_at_line... " >&6; } -if test "${ac_cv_lib_error_at_line+set}" = set; then : +if ${ac_cv_lib_error_at_line+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -7303,7 +7907,7 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _LARGEFILE_SOURCE value needed for large files" >&5 $as_echo_n "checking for _LARGEFILE_SOURCE value needed for large files... " >&6; } -if test "${ac_cv_sys_largefile_source+set}" = set; then : +if ${ac_cv_sys_largefile_source+:} false; then : $as_echo_n "(cached) " >&6 else while :; do @@ -7439,10 +8043,21 @@ $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; :end' >>confcache if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then - test "x$cache_file" != "x/dev/null" && + if test "x$cache_file" != "x/dev/null"; then { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 $as_echo "$as_me: updating cache $cache_file" >&6;} - cat confcache >$cache_file + if test ! -f "$cache_file" || test -h "$cache_file"; then + cat confcache >"$cache_file" + else + case $cache_file in #( + */* | ?:*) + mv -f confcache "$cache_file"$$ && + mv -f "$cache_file"$$ "$cache_file" ;; #( + *) + mv -f confcache "$cache_file" ;; + esac + fi + fi else { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 $as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} @@ -7475,7 +8090,7 @@ LTLIBOBJS=$ac_ltlibobjs -: ${CONFIG_STATUS=./config.status} +: "${CONFIG_STATUS=./config.status}" ac_write_fail=0 ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" @@ -7576,6 +8191,7 @@ fi IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. +as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -7882,8 +8498,8 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=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.13, which was -generated by GNU Autoconf 2.66. Invocation command line was +This file was extended by Asymptote $as_me 2.16, which was +generated by GNU Autoconf 2.68. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS @@ -7944,8 +8560,8 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -Asymptote config.status 2.13 -configured by $0, generated by GNU Autoconf 2.66, +Asymptote config.status 2.16 +configured by $0, generated by GNU Autoconf 2.68, with options \\"\$ac_cs_config\\" Copyright (C) 2010 Free Software Foundation, Inc. @@ -7964,11 +8580,16 @@ ac_need_defaults=: while test $# != 0 do case $1 in - --*=*) + --*=?*) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` ac_shift=: ;; + --*=) + ac_option=`expr "X$1" : 'X\([^=]*\)='` + ac_optarg= + ac_shift=: + ;; *) ac_option=$1 ac_optarg=$2 @@ -7990,6 +8611,7 @@ do $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; + '') as_fn_error $? "missing file argument" ;; esac as_fn_append CONFIG_FILES " '$ac_optarg'" ac_need_defaults=false;; @@ -8087,9 +8709,10 @@ fi # after its creation but before its name has been assigned to `$tmp'. $debug || { - tmp= + tmp= ac_tmp= trap 'exit_status=$? - { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status + : "${ac_tmp:=$tmp}" + { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status ' 0 trap 'as_fn_exit 1' 1 2 13 15 } @@ -8097,12 +8720,13 @@ $debug || { tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && - test -n "$tmp" && test -d "$tmp" + test -d "$tmp" } || { tmp=./conf$$-$RANDOM (umask 077 && mkdir "$tmp") } || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 +ac_tmp=$tmp # Set up the scripts for CONFIG_FILES section. # No need to generate them if there are no CONFIG_FILES. @@ -8124,7 +8748,7 @@ else ac_cs_awk_cr=$ac_cr fi -echo 'BEGIN {' >"$tmp/subs1.awk" && +echo 'BEGIN {' >"$ac_tmp/subs1.awk" && _ACEOF @@ -8152,7 +8776,7 @@ done rm -f conf$$subs.sh cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -cat >>"\$tmp/subs1.awk" <<\\_ACAWK && +cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK && _ACEOF sed -n ' h @@ -8200,7 +8824,7 @@ t delim rm -f conf$$subs.awk cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 _ACAWK -cat >>"\$tmp/subs1.awk" <<_ACAWK && +cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && for (key in S) S_is_set[key] = 1 FS = "" @@ -8232,7 +8856,7 @@ if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" else cat -fi < "$tmp/subs1.awk" > "$tmp/subs.awk" \ +fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 _ACEOF @@ -8266,7 +8890,7 @@ fi # test -n "$CONFIG_FILES" # No need to generate them if there are no CONFIG_HEADERS. # This happens for instance with `./config.status Makefile'. if test -n "$CONFIG_HEADERS"; then -cat >"$tmp/defines.awk" <<\_ACAWK || +cat >"$ac_tmp/defines.awk" <<\_ACAWK || BEGIN { _ACEOF @@ -8278,8 +8902,8 @@ _ACEOF # handling of long lines. ac_delim='%!_!# ' for ac_last_try in false false :; do - ac_t=`sed -n "/$ac_delim/p" confdefs.h` - if test -z "$ac_t"; then + ac_tt=`sed -n "/$ac_delim/p" confdefs.h` + if test -z "$ac_tt"; then break elif $ac_last_try; then as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5 @@ -8399,7 +9023,7 @@ do for ac_f do case $ac_f in - -) ac_f="$tmp/stdin";; + -) ac_f="$ac_tmp/stdin";; *) # Look for the file first in the build tree, then in the source tree # (if the path is not absolute). The absolute path cannot be DOS-style, # because $ac_f cannot contain `:'. @@ -8434,7 +9058,7 @@ $as_echo "$as_me: creating $ac_file" >&6;} esac case $ac_tag in - *:-:* | *:-) cat >"$tmp/stdin" \ + *:-:* | *:-) cat >"$ac_tmp/stdin" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; esac ;; @@ -8565,21 +9189,22 @@ s&@abs_top_builddir@&$ac_abs_top_builddir&;t t s&@INSTALL@&$ac_INSTALL&;t t $ac_datarootdir_hack " -eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$tmp/subs.awk" >$tmp/out \ - || as_fn_error $? "could not create $ac_file" "$LINENO" 5 +eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ + >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && - { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } && - { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } && + { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && + { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ + "$ac_tmp/out"`; test -z "$ac_out"; } && { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&5 $as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&2;} - rm -f "$tmp/stdin" + rm -f "$ac_tmp/stdin" case $ac_file in - -) cat "$tmp/out" && rm -f "$tmp/out";; - *) rm -f "$ac_file" && mv "$tmp/out" "$ac_file";; + -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; + *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; esac \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; @@ -8590,20 +9215,20 @@ which seems to be undefined. Please make sure it is defined" >&2;} if test x"$ac_file" != x-; then { $as_echo "/* $configure_input */" \ - && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs" - } >"$tmp/config.h" \ + && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" + } >"$ac_tmp/config.h" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 - if diff "$ac_file" "$tmp/config.h" >/dev/null 2>&1; then + if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 $as_echo "$as_me: $ac_file is unchanged" >&6;} else rm -f "$ac_file" - mv "$tmp/config.h" "$ac_file" \ + mv "$ac_tmp/config.h" "$ac_file" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 fi else $as_echo "/* $configure_input */" \ - && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs" \ + && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \ || as_fn_error $? "could not create -" "$LINENO" 5 fi ;; @@ -8652,7 +9277,7 @@ if test "x$GCDIR" != "x" ; then as_ac_File=`$as_echo "ac_cv_file_$GCDIR.tar.gz" | $as_tr_sh` { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $GCDIR.tar.gz" >&5 $as_echo_n "checking for $GCDIR.tar.gz... " >&6; } -if eval "test \"\${$as_ac_File+set}\"" = set; then : +if eval \${$as_ac_File+:} false; then : $as_echo_n "(cached) " >&6 else test "$cross_compiling" = yes && diff --git a/Build/source/utils/asymptote/configure.ac b/Build/source/utils/asymptote/configure.ac index 1dc70088baf..e438112730e 100644 --- a/Build/source/utils/asymptote/configure.ac +++ b/Build/source/utils/asymptote/configure.ac @@ -3,11 +3,12 @@ # this file. AC_PREREQ(2) -AC_INIT([Asymptote],[2.13],[http://sourceforge.net/projects/asymptote]) +AC_INIT([Asymptote],[2.16],[http://sourceforge.net/projects/asymptote]) VERSION=$PACKAGE_VERSION AC_SUBST(VERSION) +m4_include([ax_pthread.m4]) -test "$CFLAGS" || CFLAGS="-g -O3" +test "$CFLAGS" || CFLAGS="-g -O3 -ansi" AC_C_BIGENDIAN @@ -104,17 +105,20 @@ AC_PROG_YACC if test "$GXX" = yes ; then ac_gcc_version=`echo __GNUC__ | $CC -E - | grep -v ^\#` + ac_clang=`echo __clang__ | $CC -E - | grep -v ^\#` if test "$ac_gcc_version" -lt 4; then CFLAGS=$CFLAGS" -finline-limit=400" else - CFLAGS=$CFLAGS" --no-var-tracking" + if test "$ac_clang" != 1; then + CFLAGS=$CFLAGS" -fno-var-tracking" + fi fi fi AC_CHECK_HEADER(tr1/unordered_map,, [AC_CHECK_HEADER(ext/hash_map,,OPTIONS=$OPTIONS"-DNOHASH ")]) -GCVERSION=gc-7.1 +GCVERSION=gc-7.2b AC_CHECK_FILE($GCVERSION.tar.gz, ac_cv_use_gc=$GCVERSION, @@ -197,9 +201,9 @@ AC_ARG_ENABLE(gc-full-debug, fi ]) -if test "$OSTYPE" = "cygwin"; then +if test "$OSTYPE" = "msdos"; then INCL=$INCL" -I/usr/include/tirpc" -CPPFLAGS=$CPPFLAGS" $INCL" +CPPFLAGS=$CPPFLAGS" -D__MSDOS__ $INCL" fi AC_CHECK_FUNC(getopt_long_only, AC_DEFINE(HAVE_GNU_GETOPT_H, 1, @@ -222,7 +226,7 @@ AC_CHECK_LIB([m], [sqrt],, AC_MSG_ERROR([*** Please install libm on your system ***])) AC_CHECK_LIB([z], [deflate],, AC_MSG_ERROR([*** Please install libz on your system ***])) -AC_CHECK_LIB([pthread], [pthread_create]) +AX_PTHREAD AC_CHECK_LIB([sigsegv], [stackoverflow_install_handler]) AC_CHECK_LIB([rt], [sched_yield]) @@ -287,7 +291,7 @@ AC_ARG_ENABLE(offscreen, if test "x$enable_gl" != "xno"; then case "$OSTYPE" in - cygwin) + msdos) if test "x$enable_offscreen" != "xyes"; then AC_CHECK_HEADER(GL/gl.h, [AC_DEFINE(HAVE_LIBGL, 1, diff --git a/Build/source/utils/asymptote/dec.cc b/Build/source/utils/asymptote/dec.cc index 10154609576..dc15b9d24d6 100644 --- a/Build/source/utils/asymptote/dec.cc +++ b/Build/source/utils/asymptote/dec.cc @@ -201,6 +201,28 @@ bool block::returns() { return true; return false; } + +vardec *block::asVardec() +{ + vardec *var = 0; + for (list<runnable *>::iterator p=stms.begin(); + p != stms.end(); + ++p) + { + vardec *v = dynamic_cast<vardec *>(*p); + if (v) { + if (var) + // Multiple vardecs. + return 0; + var = v; + } + else if (!dynamic_cast<emptyStm *>(*p)) + // Failure due to another runnable in the block. + return 0; + } + + return var; +} void dec::prettyprint(ostream &out, Int indent) @@ -570,6 +592,23 @@ void vardec::transAsTypedefField(coenv &e, record *r) decs->transAsTypedefField(e, base->transAsTyEntry(e, r), r); } +symbol vardec::singleName() +{ + decid *did = decs->singleEntry(); + if (!did) + return symbol::nullsym; + return did->getStart()->getName(); +} + +types::ty *vardec::singleGetType(coenv &e) +{ + decid *did = decs->singleEntry(); + if (!did) + return 0; + return did->getStart()->getType(base->trans(e), e); +} + + // Helper class for imports. This essentially evaluates to the run::loadModule // function. However, that function returns different types of records // depending on the filename given to it, so we cannot add it to the diff --git a/Build/source/utils/asymptote/dec.h b/Build/source/utils/asymptote/dec.h index e17c5fd114d..5b7f0756cc7 100644 --- a/Build/source/utils/asymptote/dec.h +++ b/Build/source/utils/asymptote/dec.h @@ -26,13 +26,13 @@ class access; namespace types { class ty; -class formal; -class signature; -class function; +struct formal; +struct signature; +struct function; } namespace vm { -class lambda; +struct lambda; } namespace absyntax { @@ -43,6 +43,8 @@ using trans::varEntry; using trans::access; using sym::symbol; +class vardec; + class ty : public absyn { public: ty(position pos) @@ -216,6 +218,10 @@ public: types::record *transAsFile(genv& ge, symbol id); + // If the block can be interpreted as a single vardec, return that vardec + // (otherwise 0). + vardec *asVardec(); + // A block is guaranteed to return iff one of the runnables is guaranteed to // return. // This is conservative in that @@ -352,6 +358,8 @@ public: // Translate, but add the names in as types rather than variables. virtual void transAsTypedefField(coenv &e, trans::tyEntry *base, record *r); + + decidstart *getStart() { return start; } }; class decidlist : public absyn { @@ -373,6 +381,15 @@ public: // Translate, but add the names in as types rather than variables. virtual void transAsTypedefField(coenv &e, trans::tyEntry *base, record *r); + + // If the list consists of a single entry, return it. + decid *singleEntry() + { + if (decs.size() == 1) + return decs.front(); + else + return 0; + } }; class dec : public runnable { @@ -413,6 +430,14 @@ public: // Translate, but add the names in as types rather than variables. virtual void transAsTypedefField(coenv &e, record *r); + + // If the vardec encodes a single declaration, return the name of that + // declaration (otherwise nullsym). + symbol singleName(); + + // If the vardec encodes a single declaration, return the type of that + // declaration (otherwise 0). + types::ty *singleGetType(coenv& e); }; struct idpair : public absyn { diff --git a/Build/source/utils/asymptote/doc/CAD.pdf b/Build/source/utils/asymptote/doc/CAD.pdf Binary files differindex af88c9c9895..bb61b12dd4d 100644 --- a/Build/source/utils/asymptote/doc/CAD.pdf +++ b/Build/source/utils/asymptote/doc/CAD.pdf diff --git a/Build/source/utils/asymptote/doc/FAQ/asy-faq.info b/Build/source/utils/asymptote/doc/FAQ/asy-faq.info index 379b772757c..ce35b88fc2b 100644 --- a/Build/source/utils/asymptote/doc/FAQ/asy-faq.info +++ b/Build/source/utils/asymptote/doc/FAQ/asy-faq.info @@ -10,7 +10,7 @@ END-INFO-DIR-ENTRY File: asy-faq.info, Node: Top, Next: Question 1.1, Up: (dir) ASYMPTOTE FREQUENTLY ASKED QUESTIONS - 19 Jun 2011 + 30 May 2012 This is the list of Frequently Asked Questions about Asymptote (asy). diff --git a/Build/source/utils/asymptote/doc/FAQ/install-sh b/Build/source/utils/asymptote/doc/FAQ/install-sh index 377bb8687ff..6781b987bdb 100755 --- a/Build/source/utils/asymptote/doc/FAQ/install-sh +++ b/Build/source/utils/asymptote/doc/FAQ/install-sh @@ -1,7 +1,7 @@ #!/bin/sh # install - install a program, script, or datafile -scriptversion=2011-11-20.07; # UTC +scriptversion=2009-04-28.21; # UTC # This originates from X11R5 (mit/util/scripts/install.sh), which was # later released in X11R6 (xc/config/util/install.sh) with the @@ -35,7 +35,7 @@ scriptversion=2011-11-20.07; # UTC # FSF changes to this file are in the public domain. # # Calling this script install-sh is preferred over install.sh, to prevent -# 'make' implicit rules from creating a file called install from it +# `make' implicit rules from creating a file called install from it # when there is no Makefile. # # This script is compatible with the BSD install script, but was written @@ -156,10 +156,6 @@ while test $# -ne 0; do -s) stripcmd=$stripprog;; -t) dst_arg=$2 - # Protect names problematic for 'test' and other utilities. - case $dst_arg in - -* | [=\(\)!]) dst_arg=./$dst_arg;; - esac shift;; -T) no_target_directory=true;; @@ -190,10 +186,6 @@ if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then fi shift # arg dst_arg=$arg - # Protect names problematic for 'test' and other utilities. - case $dst_arg in - -* | [=\(\)!]) dst_arg=./$dst_arg;; - esac done fi @@ -202,17 +194,13 @@ if test $# -eq 0; then echo "$0: no input file specified." >&2 exit 1 fi - # It's OK to call 'install-sh -d' without argument. + # It's OK to call `install-sh -d' without argument. # This can happen when creating conditional directories. exit 0 fi if test -z "$dir_arg"; then - do_exit='(exit $ret); exit $ret' - trap "ret=129; $do_exit" 1 - trap "ret=130; $do_exit" 2 - trap "ret=141; $do_exit" 13 - trap "ret=143; $do_exit" 15 + trap '(exit $?); exit' 1 2 13 15 # Set umask so as not to create temps with too-generous modes. # However, 'strip' requires both read and write access to temps. @@ -240,9 +228,9 @@ fi for src do - # Protect names problematic for 'test' and other utilities. + # Protect names starting with `-'. case $src in - -* | [=\(\)!]) src=./$src;; + -*) src=./$src;; esac if test -n "$dir_arg"; then @@ -264,7 +252,12 @@ do echo "$0: no destination specified." >&2 exit 1 fi + dst=$dst_arg + # Protect names starting with `-'. + case $dst in + -*) dst=./$dst;; + esac # If destination is a directory, append the input filename; won't work # if double slashes aren't ignored. @@ -354,7 +347,7 @@ do if test -z "$dir_arg" || { # Check for POSIX incompatibilities with -m. # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or - # other-writable bit of parent directory when it shouldn't. + # other-writeable bit of parent directory when it shouldn't. # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. ls_ld_tmpdir=`ls -ld "$tmpdir"` case $ls_ld_tmpdir in @@ -392,7 +385,7 @@ do case $dstdir in /*) prefix='/';; - [-=\(\)!]*) prefix='./';; + -*) prefix='./';; *) prefix='';; esac @@ -410,7 +403,7 @@ do for d do - test X"$d" = X && continue + test -z "$d" && continue prefix=$prefix$d if test -d "$prefix"; then diff --git a/Build/source/utils/asymptote/doc/Makefile.in b/Build/source/utils/asymptote/doc/Makefile.in index c93e4f57f46..0a924bafa82 100644 --- a/Build/source/utils/asymptote/doc/Makefile.in +++ b/Build/source/utils/asymptote/doc/Makefile.in @@ -2,7 +2,8 @@ MANFILES = asy.1 xasy.1x ASYFILES = $(filter-out $(wildcard latexusage-*.asy),$(wildcard *.asy)) SOURCE = asymptote.texi version.texi options ASY = ../asy -dir ../base -config "" -render=0 -DOCFILES = asymptote.pdf asy-latex.pdf CAD.pdf TeXShopAndAsymptote.pdf +DOCFILES = asymptote.pdf asy-latex.pdf CAD.pdf TeXShopAndAsymptote.pdf \ + asyRefCard.pdf docdir = $(DESTDIR)@docdir@ infodir = $(DESTDIR)@infodir@ @@ -25,7 +26,9 @@ dvi: doc asymptote.dvi doc: $(DOCFILES) asy.1 faq latexusage.eps cd png && $(MAKE) all -man: $(DOCFILES) asy.1 +manpage: $(MANFILES) + +man: $(DOCFILES) manpage cd png && $(MAKE) asymptote.info faq: @@ -55,7 +58,9 @@ options: ../settings.cc $(ASY) -h 2>&1 | grep -iv Asymptote > options asy.1: options asy.1.begin asy.1.end - cat options | grep \^- | sed -e "s/-\(.*\) \([a-zA-Z0-9].*\)/.TP\n.B -\1\n\2\./" | sed -e "/^.B/ s/-/\\\\-/g" | cat asy.1.begin - asy.1.end > asy.1 + cat options | grep \^- | \ + sed -e "s/-\(.*\) \([a-zA-Z0-9].*\)/.TP\n.B -\1\n\2\./" | \ + sed -e "/^.B/ s/-/\\\\-/g" | cat asy.1.begin - asy.1.end > asy.1 asymptote.dvi: $(SOURCE) $(ASYFILES:.asy=.eps) latexusage.pdf ln -sf asymptote.texi asymptote_.texi @@ -76,11 +81,17 @@ TeXShopAndAsymptote.pdf: TeXShopAndAsymptote.tex latex TeXShopAndAsymptote dvipdf TeXShopAndAsymptote +asyRefCard.pdf: asyRefCard.tex + tex asyRefCard + dvipdf asyRefCard + clean: FORCE -rm -f asy-latex.{aux,idx,ins,log,toc} -rm -f $(ASYFILES:.asy=.pdf) - -rm -f *.eps latexusage.{dvi,eps,pdf,log,aux,*.eps} latexusage-* latexusage.pre - -rm -f {asymptote,asymptote_}.{aux,cp,cps,dvi,fn,info,ky,log,pg,toc,tp,vr} + -rm -f *.eps latexusage.{dvi,eps,pdf,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} -rm -f options asy.1 @@ -100,7 +111,7 @@ install-prebuilt: install-man options cd png && $(MAKE) install cd FAQ && $(MAKE) install-prebuilt -install-all: $(DOCFILES) asy.1 faq latexusage.eps install-man +install-all: $(DOCFILES) $(MANFILES) faq latexusage.eps install-man cd png && $(MAKE) install-all cd FAQ && $(MAKE) install-info diff --git a/Build/source/utils/asymptote/doc/TeXShopAndAsymptote.pdf b/Build/source/utils/asymptote/doc/TeXShopAndAsymptote.pdf Binary files differindex 669f1660b2f..61dfa38cc71 100755 --- a/Build/source/utils/asymptote/doc/TeXShopAndAsymptote.pdf +++ b/Build/source/utils/asymptote/doc/TeXShopAndAsymptote.pdf diff --git a/Build/source/utils/asymptote/doc/asy-latex.dtx b/Build/source/utils/asymptote/doc/asy-latex.dtx index 3cb386cd6b4..1e9c795303f 100644 --- a/Build/source/utils/asymptote/doc/asy-latex.dtx +++ b/Build/source/utils/asymptote/doc/asy-latex.dtx @@ -38,7 +38,7 @@ Licence: GPL2+ %</driver> %<pkg>\ProvidesPackage{asymptote} %<*pkg> - [2011/05/15 v1.24 Asymptote style file for LaTeX] + [2011/11/29 v1.26 Asymptote style file for LaTeX] %</pkg> % %<*driver> @@ -129,11 +129,11 @@ Licence: GPL2+ % addition to locally setting \texttt{inline} and \texttt{attach}, the % following options may also be used: % \begin{description} -% \item[height] Height of the figure % \item[width] Width of the figure +% \item[height] Height of the figure % \item[keepAspect] Maintain aspect ratio [default true] -% \item[viewportheight] Viewport height for 3D figures % \item[viewportwidth] Viewport width for 3D figures +% \item[viewportheight] Viewport height for 3D figures % \end{description} % These may also be set globally using the \cmd\asysetup\ command. % @@ -230,6 +230,7 @@ Licence: GPL2+ % % \begin{macro}{\CatchFileDef} % Used for \cmd\asyinclude. +% Note that the fallback definition is not as robust as the one provided by catchfile. % \begin{macrocode} \IfFileExists{catchfile.sty}{ \RequirePackage{catchfile} @@ -240,12 +241,12 @@ Licence: GPL2+ \ENDCATCHFILEMARKER \noexpand }% - \long\def\@tempa##1\ENDCATCHFILEMARKER{% + \long\def\@tempa####1\ENDCATCHFILEMARKER{% \endgroup - \def#1{##1}% + \def##1{####1}% }% - #3% - \expandafter\@tempa\@@input #2\relax + ##3% + \expandafter\@tempa\@@input ##2\relax } } % \end{macrocode} @@ -526,11 +527,7 @@ Licence: GPL2+ \fi % \end{macrocode} % Setting \verb|viewportsize=()|. Same logic as for \verb|size()|. -% Note that \cs{ASYviewportwidth} varies according to \cs{ASYattach}, -% by default, so it needs to be fully expanded before checking if it equals -% zero. % \begin{macrocode} - \edef\ASYviewportwidth{\ASYviewportwidth}% locally "freeze" viewportwidth \ifx\ASYviewportwidth\@empty \ifx\ASYviewportheight\@empty % write nothing! @@ -619,25 +616,25 @@ Licence: GPL2+ \immediate\write\AsyPreStream{% \noexpand\InputIfFileExists{% \ASYprefix\noexpand\jobname-\the\c@asy.pre}{}{}% - } + }% \asy@write@graphic@header \IfFileExists{#2.asy}{% \CatchFileDef\@tempa{#2.asy}{% \let\do\@makeother \dospecials \endlinechar=10\relax - } - }{ + }% + }{% \IfFileExists{#2}{% \CatchFileDef\@tempa{#2}{% \let\do\@makeother \dospecials \endlinechar=10\relax - } - }{ + }% + }{% \PackageWarning{asymptote}{file #2 not found}% - } - } + }% + }% \immediate\write\AsyStream{\unexpanded\expandafter{\@tempa}}% \asy@finalise@stream \asy@input@graphic @@ -649,7 +646,7 @@ Licence: GPL2+ \newcommand{\ASYanimategraphics}[5][]{% \IfFileExists{_#3.pdf}{% \animategraphics[{#1}]{#2}{_#3}{#4}{#5}% - }{} + }{}% } % \end{macrocode} % @@ -676,10 +673,7 @@ Licence: GPL2+ {\ASYkeepAspecttrue} {\ASYkeepAspectfalse}% } -\def\ASYviewportwidth{\ASYdefaultviewportwidth} -\def\ASYdefaultviewportwidth{% - \ifASYattach \@empty \else \the\linewidth \fi -} +\def\ASYviewportwidth{} \define@key{ASYkeys}{viewportwidth}{% \edef\ASYviewportwidth{\the\dimexpr#1\relax}% } diff --git a/Build/source/utils/asymptote/doc/asy-latex.pdf b/Build/source/utils/asymptote/doc/asy-latex.pdf Binary files differindex c028d584dd5..272cb138084 100755 --- a/Build/source/utils/asymptote/doc/asy-latex.pdf +++ b/Build/source/utils/asymptote/doc/asy-latex.pdf diff --git a/Build/source/utils/asymptote/doc/asyRefCard.pdf b/Build/source/utils/asymptote/doc/asyRefCard.pdf Binary files differnew file mode 100644 index 00000000000..bed262c88fd --- /dev/null +++ b/Build/source/utils/asymptote/doc/asyRefCard.pdf diff --git a/Build/source/utils/asymptote/doc/asyRefCard.tex b/Build/source/utils/asymptote/doc/asyRefCard.tex new file mode 100644 index 00000000000..e058b857d58 --- /dev/null +++ b/Build/source/utils/asymptote/doc/asyRefCard.tex @@ -0,0 +1,556 @@ +% Reference Card for Asymptote + +% Copyright (c) 2011 John C. Bowman. May be freely distributed. +% Thanks to Stephen Gildea for the multicolumn macro package +% and Joseph H. Silverman for the C Reference card. + +%**start of header +\newcount\columnsperpage + +\overfullrule=0pt + +% This file can be printed with 1, 2, or 3 columns per page (see below). +% [For 2 or 3 columns, you'll need 6 and 8 point fonts.] +% Specify how many you want here. Nothing else needs to be changed. + +\columnsperpage=2 + +% This reference card is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +% This file is intended to be processed by plain TeX (TeX82). +% +% The final reference card has six columns, three on each side. +% This file can be used to produce it in any of three ways: +% 1 column per page +% produces six separate pages, each of which needs to be reduced to 80%. +% This gives the best resolution. +% 2 columns per page +% produces three already-reduced pages. +% You will still need to cut and paste. +% 3 columns per page +% produces two pages which must be printed sideways to make a +% ready-to-use 8.5 x 11 inch reference card. +% For this you need a dvi device driver that can print sideways. +% Which mode to use is controlled by setting \columnsperpage above. +% +% (reference card macros due to Stephen Gildea) +% + +\def\versionnumber{0.0} % Version of this reference card +\def\year{2011} +\def\month{August} +\def\version{\month\ \year\ v\versionnumber} + +\def\shortcopyrightnotice{\vskip .5ex plus 2 fill + \centerline{\small \copyright\ \year\ John C. Bowman + Permissions on back. v\versionnumber}} + +\def\copyrightnotice{ +\vskip 1ex plus 100 fill\begingroup\small +\centerline{\version. Copyright \copyright\ \year\ John C. Bowman} + +Permission is granted to make and distribute copies of +this card provided the copyright notice and this permission notice +are preserved on all copies. +\endgroup} + +% make \bye not \outer so that the \def\bye in the \else clause below +% can be scanned without complaint. +\def\bye{\par\vfill\supereject\end} + +\newdimen\intercolumnskip +\newbox\columna +\newbox\columnb + +\def\ncolumns{\the\columnsperpage} + +\message{[\ncolumns\space + column\if 1\ncolumns\else s\fi\space per page]} + +\def\scaledmag#1{ scaled \magstep #1} + +% This multi-way format was designed by Stephen Gildea +% October 1986. +\if 1\ncolumns + \hsize 4in + \vsize 10in + \voffset -.7in + \font\titlefont=\fontname\tenbf \scaledmag3 + \font\headingfont=\fontname\tenbf \scaledmag2 + \font\headingfonttt=\fontname\tentt \scaledmag2 + \font\smallfont=\fontname\sevenrm + \font\smallsy=\fontname\sevensy + + \footline{\hss\folio} + \def\makefootline{\baselineskip10pt\hsize6.5in\line{\the\footline}} +\else + \hsize 3.2in + \vsize 7.95in + \hoffset -.75in + \voffset -.745in + \font\titlefont=cmbx10 \scaledmag2 + \font\headingfont=cmbx10 \scaledmag1 + \font\headingfonttt=cmtt10 \scaledmag1 + \font\smallfont=cmr6 + \font\smallsy=cmsy6 + \font\eightrm=cmr8 + \font\eightbf=cmbx8 + \font\eightit=cmti8 + \font\eighttt=cmtt8 + \font\eightsy=cmsy8 + \font\eightsl=cmsl8 + \font\eighti=cmmi8 + \font\eightex=cmex10 at 8pt + \textfont0=\eightrm + \textfont1=\eighti + \textfont2=\eightsy + \textfont3=\eightex + \def\rm{\fam0 \eightrm} + \def\bf{\eightbf} + \def\it{\eightit} + \def\tt{\eighttt} + \def\sl{\eightsl} + \normalbaselineskip=.8\normalbaselineskip + \normallineskip=.8\normallineskip + \normallineskiplimit=.8\normallineskiplimit + \normalbaselines\rm %make definitions take effect + + \if 2\ncolumns + \let\maxcolumn=b + \footline{\hss\rm\folio\hss} + \def\makefootline{\vskip 2in \hsize=6.86in\line{\the\footline}} + \else \if 3\ncolumns + \let\maxcolumn=c + \nopagenumbers + \else + \errhelp{You must set \columnsperpage equal to 1, 2, or 3.} + \errmessage{Illegal number of columns per page} + \fi\fi + + \intercolumnskip=.46in + \def\abc{a} + \output={% + % This next line is useful when designing the layout. + %\immediate\write16{Column \folio\abc\space starts with \firstmark} + \if \maxcolumn\abc \multicolumnformat \global\def\abc{a} + \else\if a\abc + \global\setbox\columna\columnbox \global\def\abc{b} + %% in case we never use \columnb (two-column mode) + \global\setbox\columnb\hbox to -\intercolumnskip{} + \else + \global\setbox\columnb\columnbox \global\def\abc{c}\fi\fi} + \def\multicolumnformat{\shipout\vbox{\makeheadline + \hbox{\box\columna\hskip\intercolumnskip + \box\columnb\hskip\intercolumnskip\columnbox} + \makefootline}\advancepageno} + \def\columnbox{\leftline{\pagebody}} + + \def\bye{\par\vfill\supereject + \if a\abc \else\null\vfill\eject\fi + \if a\abc \else\null\vfill\eject\fi + \end} +\fi + +% we won't be using math mode much, so redefine some of the characters +% we might want to talk about +\catcode`\^=12 +%\catcode`\_=12 +\catcode`\~=12 + +\chardef\\=`\\ +\chardef\{=`\{ +\chardef\}=`\} +\chardef\underscore=`\_ + +\hyphenation{} + +\parindent 0pt +\parskip .85ex plus .35ex minus .5ex + +\def\small{\smallfont\textfont2=\smallsy\baselineskip=.8\baselineskip} + +\outer\def\newcolumn{\vfill\eject} + +\outer\def\title#1{{\titlefont\centerline{#1}}\vskip 1ex plus .5ex} + +\outer\def\section#1{\par\filbreak + \vskip .5ex minus .1ex {\headingfont #1}\mark{#1}% + \vskip .3ex minus .1ex} + +\outer\def\librarysection#1#2{\par\filbreak + \vskip .5ex minus .1ex {\headingfont #1}\quad{\headingfonttt<#2>}\mark{#1}% + \vskip .3ex minus .1ex} + + +\newdimen\keyindent + +\def\beginindentedkeys{\keyindent=1em} +\def\endindentedkeys{\keyindent=0em} +\def\begindoubleindentedkeys{\keyindent=2em} +\def\enddoubleindentedkeys{\keyindent=1em} +\endindentedkeys + +\def\paralign{\vskip\parskip\halign} + +\def\<#1>{$\langle${\rm #1}$\rangle$} + +\def\kbd#1{{\tt#1}\null} %\null so not an abbrev even if period follows + +\def\beginexample{\par\vskip1\jot +\hrule width.5\hsize +\vskip1\jot +\begingroup\parindent=2em + \obeylines\obeyspaces\parskip0pt\tt} +{\obeyspaces\global\let =\ } +\def\endexample{\endgroup} + +\def\Example{\qquad{\sl Example\/}.\enspace\ignorespaces} + +\def\key#1#2{\leavevmode\hbox to \hsize{\vtop + {\hsize=.75\hsize\rightskip=1em + \hskip\keyindent\relax#1}\kbd{#2}\hfil}} + +\newbox\metaxbox +\setbox\metaxbox\hbox{\kbd{M-x }} +\newdimen\metaxwidth +\metaxwidth=\wd\metaxbox + +\def\metax#1#2{\leavevmode\hbox to \hsize{\hbox to .75\hsize + {\hskip\keyindent\relax#1\hfil}% + \hskip -\metaxwidth minus 1fil + \kbd{#2}\hfil}} + +\def\threecol#1#2#3{\hskip\keyindent\relax#1\hfil&\kbd{#2}\quad + &\kbd{#3}\quad\cr} + +% Define Italic Names +\def\makedef#1 {% +\expandafter\edef\csname#1\endcsname{\hbox{\it#1\/}}} +\makedef array +\makedef arg +\makedef const +\makedef dim +\makedef expr +\makedef filename +\makedef fnc +\makedef format +\makedef member +\makedef name +\makedef statement +\makedef statements +\makedef string +\makedef type +\makedef value +\makedef var + +%**end of header + + +\title{Asymptote Reference Card} + +\section{Program structure/functions} +\halign{\tt#\hfil&\qquad#\hfil\cr +import "\filename"&import module\cr +import "\filename" as name&import filename as module name\cr +include "\filename"&include verbatim text from file\cr +\type\ \fnc(\type,\dots);&optional function declaration\cr +\type\ \name;&variable declaration\cr +\type\ \fnc(\type\ \arg,\dots) \{&function definition\cr +\quad\statements\cr +\quad return \value;\cr +\}\cr +} + +\section{Data types/declarations} +\key{boolean (true or false)}{bool} +\key{tri-state boolean (true, default, or false)}{bool3} +\key{integer}{int} +\key{float (double precision)}{real} +\key{ordered pair (complex number)}{pair} +\key{character string}{string} +\key{fixed piecewise cubic Bezier spline}{path} +\key{unresolved piecewise cubic Bezier spline}{guide} +\key{color, line type/width/cap, font, fill rule}{pen} +\key{label with position, alignment, pen attributes}{Label} +\key{drawing canvas}{picture} +\key{affine transform}{transform} +\key{constant (unchanging) value}{const} +\key{allocate in higher scope}{static} +\key{no value}{void} +\key{inhibit implicit argument casting}{explicit} +\key{structure}{struct} +\key{create name by data type}{typedef \type\ \name} + +\section{3D data types (import three;)} +\key{ordered triple}{triple} +\key{3D path}{path3} +\key{3D guide}{guide3} +\key{3D affine transform}{transform3} + +\section{Constants} +\key{exponential form}{6.02e23} +\key{\TeX\ string constant}{"abc\dots de"} +\key{\TeX\ strings: special characters}{\\\\, \\"} +\key{C strings: constant}{'abc\dots de'} +\key{C strings: special characters}{\\\\, \\" \\' \\?} +\key{C strings: newline, cr, tab, backspace}{\\n \\r \\t \\b} +\key{C strings: octal, hexadecimal bytes}{\\0-\\377 \\x0-\\xFF} + +\section{Operators} +\key{arithmetic operations}{+ - * /} +\key{modulus (remainder)}{\%} +\key{comparisons}{== != > >= < <=} +\key{not}{!} +\key{and or (conditional evaluation of RHS)}{\&\& ||} +\key{and or xor}{\& | ^} +\key{cast expression to type}{(\type) \expr} +\key{increment decrement prefix operators}{++ --} +\key{assignment operators}{+= -= *= /= \%=} +\key{conditional expression}{\expr$_1$\ {?}\ \expr$_2$\ {:}\ \expr$_3$} +\key{structure member operator}{\name.\member} +\key{expression evaluation separator}{,} + +\section{Flow control} +\key{statement terminator}{;} +\key{block delimeters}{\{\quad\}} +\key{comment delimeters}{/*\quad*/} +\key{comment to end of line delimiter}{//} +\key{exit from \kbd{while}/\kbd{do}/\kbd{for}}{break;} +\key{next iteration of \kbd{while}/\kbd{do}/\kbd{for}}{continue;} +\key{return value from function}{return \expr;} +\key{terminate execution}{exit();} +\key{abort execution with error message}{abort(string);} +\metax{{\bf Flow constructions} ({\tt if/while/for/do})\hidewidth}{} +\beginexample +if(\expr)\ \statement +else if(\expr)\ \statement +else \statement +\endexample +\beginexample +while(\expr) +\quad\statement +\endexample +\beginexample +for(\expr$_1$; \expr$_2$; \expr$_3$) +\quad\statement +\endexample +\beginexample +for(\type var : \array) +\quad\statement +\endexample +\beginexample +do \statement +\quad while(\expr); +\endexample + +\section{Arrays} +\metax{array}{\type[]\ \name} +\metax{array element i}{\name[i]} +\metax{anonymous array}{new \type[\dim]} +\metax{array containing n deep copies of x}{array(n,x)} +\metax{length}{\name.length} +\metax{cyclic flag}{\name.cyclic} +\metax{pop element {\tt x}}{\name.pop()} +\metax{push element {\tt x}}{\name.push(x)} +\metax{append array {\tt a}}{\name.append(a)} +\metax{insert rest arguments at index {\tt i}}{\name.insert(i,\dots)} +\metax{delete element at index {\tt i}}{\name.delete(i)} +\metax{delete elements with indices in [{\tt i},{\tt j}]}{\name.delete(i,j)} +\metax{delete all elements}{\name.delete()} +\metax{test whether element n is initialized}{\name.initialized(n)} +\metax{array of indices of initialized elements}{\name.keys} +\metax{complement of int array in {\tt \{0,\dots,n-1\}}}{complement(a,n)} +\metax{deep copy of array {\tt a}}{copy(a)} +\metax{array {\tt \{0,1,\dots,n-1\}}}{sequence(n)} +\metax{array {\tt \{n,n+1,\dots,m\}}}{sequence(n,m)} +\metax{array {\tt \{n-1,n-2,\dots,0\}}}{reverse(n)} +\metax{array {\tt \{f(0),f(1),\dots,f(n-1)\}}}{sequence(f,n)} +\metax{array obtained by applying {\tt f} to array {\tt a}}{map(f,a)} +\metax{uniform partition of [{\tt a},{\tt b}] into n intervals}{uniform(a,b,n)} +\metax{concat specified 1D arrays}{concat(a,b,\dots)} +\metax{return sorted array}{sort(a)} +\metax{return array sorted using ordering {\tt less}}{sort(a,{\tt less})} +\metax{search sorted array {\tt a} for key}{search(a,key)} +\metax{index of first true value of bool array {\tt a}}{find(a)} +\metax{index of nth true value of bool array {\tt a}}{find(a,n)} + +\section{Initialization} +\key{initialize variable}{\type\ \name=\value;} +\key{initialize array}{\type[]\ \name=\{\dots\};} + +\section{path connectors} +\key{straight segment}{--} +\key{Bezi\'er segment with implicit control points}{..} +\key{Bezi\'er segment with explicit control points}{..controls c0 and c1..} +\key{concatenate}{\&} +\key{lift pen}{^^} +\key{..tension atleast 1..}{::} +\key{..tension atleast infinity..}{---} + +\section{Labels} +\key{implicit cast of string {\tt s} to Label}{s} +\key{Label {\tt s} with relative position and alignment}{Label(s,real,pair)} +\key{Label {\tt s} with absolute position and alignment}{Label(s,pair,pair)} +\key{Label {\tt s} with specified pen}{Label(s,pen)} + +\section{draw commands} +\key{draw path with current pen}{draw(path)} +\key{draw path with pen}{draw(path,pen)} +\key{draw labeled path}{draw(Label,path)} +\key{draw arrow with pen}{draw(path,pen,Arrow)} +\key{draw path on picture}{draw(picture,path)} + +\section{fill commands} +\key{fill path with current pen}{fill(path)} +\key{fill path with pen}{fill(path,pen)} +\key{fill path on picture}{fill(picture,path)} + +\section{label commands} +\key{label a pair with optional alignment z}{label(Label,pair,{\tt z})} +\key{label a path with optional alignment z}{label(Label,path,{\tt z})} +\key{add label to picture}{label(picture,Label)} + +\section{clip commands} +\key{clip to path}{clip(path)} +\key{clip to path with fill rule}{clip(path,pen)} +\key{clip picture to path}{clip(picture,path)} + +\section{pens} +\key{Grayscale pen from value in [0,1]}{gray(g)} +\key{RGB pen from values in [0,1]}{rgb(r,g,b)} +\key{CMYK pen from values in [0,1]}{cmyk(r,g,b)} +\key{RGB pen from heximdecimal string]}{rgb(string)} +\key{heximdecimal string from rgb pen]}{hex(pen)} +\key{hsv pen from values in [0,1]}{hsv(h,s,v)} +\key{invisible pen}{invisible} +\key{default pen}{defaultpen} +\key{current pen}{currentpen} +\key{solid pen}{solid} +\key{dotted pen}{dotted} +\key{wide dotted current pen}{Dotted} +\key{wide dotted pen}{Dotted(pen)} +\key{dashed pen}{dashed} +\key{long dashed pen}{longdashed} +\key{dash dotted pen}{dashdotted} +\key{long dash dotted pen}{longdashdotted} +\key{PostScript butt line cap}{squarecap} +\key{PostScript round line cap}{roundcap} +\key{PostScript projecting square line cap}{extendcap} +\key{miter join}{miterjoin} +\key{round join}{roundjoin} +\key{bevel join}{beveljoin} +\key{pen with miter limit}{miterlimit(real)} +\key{zero-winding fill rule}{zerowinding} +\key{even-odd fill rule}{evenodd} +\key{align to character bounding box (default)}{nobasealign} +\key{align to \TeX\ baseline}{basealign} +\key{pen with font size (pt)}{fontsize(real)} +\key{LaTeX pen from encoding,family,series,shape}{font(strings)} +\key{\TeX\ pen}{font(string)} +\key{scaled \TeX\ pen}{font(string,real)} +\key{PostScript font from strings}{Courier(series,shape)} +\key{pen with opacity in [0,1]}{opacity(real)} +\key{construct pen nib from polygonal path}{makepen(path)} +\key{pen mixing operator}{+} + +\section{path operations} +\key{number of segments in path {\tt p}}{length(p)} +\key{number of nodes in path {\tt p}}{size(p)} +\key{is path {\tt p} cyclic?}{cyclic(p)} +\key{is segment {\tt i} of path {\tt p} straight?}{straight(p,i)} +\key{is path {\tt p} straight?}{piecewisestraight(p)} +\key{coordinates of path {\tt p} at time {\tt t}}{point(p,t)} +\key{direction of path {\tt p} at time {\tt t}}{dir(p,t)} +\key{direction of path {\tt p} at {\tt length(p)}}{dir(p)} +\key{unit(dir(p)+dir(q))}{dir(p,q)} +\key{acceleration of path {\tt p} at time {\tt t}}{accel(p,t)} +\key{radius of curvature of path {\tt p} at time {\tt t}}{radius(p,t)} +\key{precontrol point of path {\tt p} at time {\tt t}}{precontrol(p,t)} +\key{postcontrol point of path {\tt p} at time {\tt t}}{postcontrol(p,t)} +\key{arclength of path {\tt p}}{arclength(p)} +\key{time at which {\tt arclength(p)=L}}{arctime(p,L)} +\key{point on path {\tt p} at arclength {\tt L}}{arcpoint(p,L)} +\key{first value {\tt t} at which {\tt dir(p,t)=z}}{dir(p,z)} +\key{time {\tt t} at relative fraction {\tt l} of {\tt arclength(p)}}{reltime(p,l)} +\key{point at relative fraction {\tt l} of {\tt arclength(p)}}{relpoint(p,l)} +\key{point midway along arclength of {\tt p}}{midpoint(p)} +\key{path running backwards along {\tt p}}{reverse(p)} +\key{subpath of {\tt p} between times {\tt a} and {\tt b}}{subpath(p,a,b)} +\key{times for one intersection of paths {\tt p} and {\tt q}}{intersect(p,q)} +\key{times at which {\tt p} reaches minimal extents}{mintimes(p)} +\key{times at which {\tt p} reaches maximal extents}{maxtimes(p)} +\key{intersection times of paths {\tt p} and {\tt q}}{intersections(p,q)} +\key{intersection times of paths {\tt p} and {\tt a--b}}{intersections(p,a,b)} +\key{intersection times of path {\tt p} crossing $x=${\tt x}}{times(p,x)} +\key{intersection times of path {\tt p} crossing $y=${\tt z.y}}{times(p,z)} +\key{intersection point of paths {\tt p} and {\tt q}}{intersectionpoint(p,q)} +\key{intersection points of {\tt p} and {\tt q}}{intersectionpoints(p,q)} +\key{intersection of extension of {\tt P--Q} and {\tt p--q}}{extension(P,Q,p,q)} +\key{lower left point of bounding box of path {\tt p}}{min(p)} +\key{upper right point of bounding box of path {\tt p}}{max(p)} +\key{subpaths of {\tt p} split by $n$th cut of {\tt knife}}{cut(p,knife,n)} +\key{winding number of path {\tt p} about pair {\tt z}}{windingnumber(p,z)} +\key{pair {\tt z} lies within path {\tt p}?}{interior(p,z)} +\key{pair {\tt z} lies within or on path {\tt p}?}{inside(p,z)} +\key{path surrounding region bounded by paths}{buildcycle(\dots)} +\key{path filled by \tt{draw(g,p)}}{strokepath(g,p)} +\key{unit square with lower-left vertex at origin}{unitsquare} +\key{unit circle centered at origin}{unitcircle} +\key{circle of radius {\tt r} about {\tt c}}{circle(c,r)} +\key{arc of radius {\tt r} about {\tt c} from angle {\tt a} to {\tt b}}{arc(c,r,a,b)} +\key{unit {\tt n}-sided polygon}{polygon(n)} +\key{unit {\tt n}-point cyclic cross}{cross(n)} + +\section{pictures} +\key{add picture {\tt pic} to currentpicture}{add(pic)} +\key{add picture {\tt pic} about pair {\tt z}}{add(pic,z)} + +\section{affine transforms} +\key{identity transform}{identity()} +\key{shift by values}{shift(real,real)} +\key{shift by pair}{shift(pair)} +\key{scale by {\tt x} in the $x$ direction}{xscale(x)} +\key{scale by {\tt y} in the $y$ direction}{yscale(y)} +\key{scale by {\tt x} in both directions}{scale(x)} +\key{scale by real values {\tt x} and {\tt y}}{scale(x,y)} +\key{map $(x,y) \rightarrow (x+${\tt s}$y,y)$}{slant(s)} +\key{rotate by real {\tt angle} in degrees about pair {\tt z}}{rotate(angle,z=(0,0))} +\key{reflect about line from {\tt P--Q}}{reflect(P,Q)} + +\section{string operations} +\key{concatenate operator}{+} +\key{string length}{length(string)} +\key{position $\ge$ {\tt pos} of first occurence of {\tt t} in {\tt s}}{find({\tt s},{\tt t},pos=0)} +\key{position $\le$ {\tt pos} of last occurence of {\tt t} in {\tt s}}{rfind({\tt s},{\tt t},pos=-1)} +\key{string with {\tt t} inserted in {\tt s} at {\tt pos}}{insert({\tt s},{\tt pos},{\tt t})} +\key{string {\tt s} with {\tt n} characters at {\tt pos} erased}{erase({\tt s},{\tt pos},{\tt n})} +\key{substring of string {\tt s} of length {\tt n} at {\tt pos}}{substr({\tt s},{\tt pos},{\tt n})} +\key{string {\tt s} reversed}{reverse({\tt s})} +\key{string {\tt s} with {\tt before} changed to {\tt after}}{replace({\tt s},{\tt before},{\tt after})} +\key{string {\tt s} translated via {\tt \{\{before,after\},\dots\}}}{replace({\tt +s},string [][] table)} +\key{format {\tt x} using C-style format string {\tt s} }{format({\tt s},x)} +\key{casts hexidecimal string to an integer}{hex(s)} +\key{casts {\tt x} to string using precision {\tt digits}}{string(x,digits=realDigits)} +\key{current time formatted by {\tt format}}{time(format="\%a \%b \%d \%T \%Z \%Y")} +\key{time in seconds of string {\tt t} using {\tt format}}{seconds(t,format)} +\key{string corresponding to {\tt seconds} using {\tt format}}{time(seconds,format)} +\key{split {\tt s} into strings separated by {\tt delimiter}}{split(s,delimiter="")} + +%%%%%%%%%%%%%%%%%%%%%%%%%% END LIBRARIES %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +% This goes at the bottom of the last page (column 6) +%\copyrightnotice +% + +\bye + +% Local variables: +% compile-command: "tex AsyRefCard" +% End: + + + + diff --git a/Build/source/utils/asymptote/doc/asymptote.pdf b/Build/source/utils/asymptote/doc/asymptote.pdf Binary files differindex 03e6987937e..914215456fb 100644 --- a/Build/source/utils/asymptote/doc/asymptote.pdf +++ b/Build/source/utils/asymptote/doc/asymptote.pdf diff --git a/Build/source/utils/asymptote/doc/asymptote.sty b/Build/source/utils/asymptote/doc/asymptote.sty index 6518baba61f..4433f6d607e 100644 --- a/Build/source/utils/asymptote/doc/asymptote.sty +++ b/Build/source/utils/asymptote/doc/asymptote.sty @@ -17,7 +17,7 @@ %% Licence: GPL2+ %% \ProvidesPackage{asymptote} - [2011/05/15 v1.24 Asymptote style file for LaTeX] + [2011/11/29 v1.26 Asymptote style file for LaTeX] \def\Asymptote{{\tt Asymptote}} \InputIfFileExists{\jobname.pre}{}{} \newbox\ASYbox @@ -58,12 +58,12 @@ \ENDCATCHFILEMARKER \noexpand }% - \long\def\@tempa##1\ENDCATCHFILEMARKER{% + \long\def\@tempa####1\ENDCATCHFILEMARKER{% \endgroup - \def#1{##1}% + \def##1{####1}% }% - #3% - \expandafter\@tempa\@@input #2\relax + ##3% + \expandafter\@tempa\@@input ##2\relax } } \newif\if@asy@attachfile@loaded @@ -252,7 +252,6 @@ \immediate\write\AsyStream{size(\ASYwidth,\ASYheight,\asy@expand@keepAspect);}% \fi \fi - \edef\ASYviewportwidth{\ASYviewportwidth}% locally "freeze" viewportwidth \ifx\ASYviewportwidth\@empty \ifx\ASYviewportheight\@empty % write nothing! @@ -329,25 +328,25 @@ \immediate\write\AsyPreStream{% \noexpand\InputIfFileExists{% \ASYprefix\noexpand\jobname-\the\c@asy.pre}{}{}% - } + }% \asy@write@graphic@header \IfFileExists{#2.asy}{% \CatchFileDef\@tempa{#2.asy}{% \let\do\@makeother \dospecials \endlinechar=10\relax - } - }{ + }% + }{% \IfFileExists{#2}{% \CatchFileDef\@tempa{#2}{% \let\do\@makeother \dospecials \endlinechar=10\relax - } - }{ + }% + }{% \PackageWarning{asymptote}{file #2 not found}% - } - } + }% + }% \immediate\write\AsyStream{\unexpanded\expandafter{\@tempa}}% \asy@finalise@stream \asy@input@graphic @@ -356,7 +355,7 @@ \newcommand{\ASYanimategraphics}[5][]{% \IfFileExists{_#3.pdf}{% \animategraphics[{#1}]{#2}{_#3}{#4}{#5}% - }{} + }{}% } \newcommand\asysetup[1]{\setkeys{ASYkeys}{#1}} \define@key{ASYkeys}{dir}{% @@ -375,10 +374,7 @@ {\ASYkeepAspecttrue} {\ASYkeepAspectfalse}% } -\def\ASYviewportwidth{\ASYdefaultviewportwidth} -\def\ASYdefaultviewportwidth{% - \ifASYattach \@empty \else \the\linewidth \fi -} +\def\ASYviewportwidth{} \define@key{ASYkeys}{viewportwidth}{% \edef\ASYviewportwidth{\the\dimexpr#1\relax}% } diff --git a/Build/source/utils/asymptote/doc/asymptote.texi b/Build/source/utils/asymptote/doc/asymptote.texi index 3174459ac55..8f87a2eae0e 100644 --- a/Build/source/utils/asymptote/doc/asymptote.texi +++ b/Build/source/utils/asymptote/doc/asymptote.texi @@ -255,6 +255,12 @@ Links to many external resources, including an excellent user-written @quotation @url{http://asymptote.sourceforge.net/links.html}. @end quotation +@cindex reference +@cindex quick reference +A quick reference card for @code{Asymptote} is available at +@quotation +@url{http://asymptote.sourceforge.net/asyRefCard.pdf}. +@end quotation @node Installation @chapter Installation @@ -549,7 +555,8 @@ The current directory; @item @cindex @code{dir} A list of one or more directories specified by the configuration -variable @code{dir} (separated by @code{:} under UNIX and +variable @code{dir} or environment variable @code{ASYMPTOTE_DIR} +(separated by @code{:} under UNIX and @code{;} under @code{MSDOS}); @item @cindex @code{.asy} @@ -577,7 +584,7 @@ cd asymptote-x.xx @end verbatim By default the system version of the Boehm garbage collector will be used; if it is old we recommend first putting -@url{http://www.hpl.hp.com/personal/Hans_Boehm/gc/gc_source/gc-7.1.tar.gz} +@url{http://www.hpl.hp.com/personal/Hans_Boehm/gc/gc_source/gc-7.2b.tar.gz} in the @code{Asymptote} source directory. @cindex @code{freeglut} @@ -587,7 +594,7 @@ in the @code{Asymptote} source directory. @anchor{multisampling} @noindent If your graphics card supports multisampling, we recommend using version -@code{2.6.0} (or later) of @code{freeglut} to support antialiasing in +@code{2.6.0} 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 @@ -1393,7 +1400,7 @@ picture clipping, see the first example in @ref{LaTeX usage}. @section label @verbatim void label(picture pic=currentpicture, Label L, pair position, - align align=NoAlign, pen p=nullpen, filltype filltype=NoFill) + align align=NoAlign, pen p=currentpen, filltype filltype=NoFill) @end verbatim Draw Label @code{L} on picture @code{pic} using pen @code{p}. If @@ -1405,8 +1412,6 @@ the @code{PostScript} offset @code{align*labelmargin(p)}. The constant @code{Align} can be used to align the bottom-left corner of the label at @code{position}. @cindex @code{nullpen} -If @code{p} is @code{nullpen}, the pen specified within the -Label, which defaults to @code{currentpen}, will be used. @cindex @code{Label} @anchor{Label} The Label @code{L} can either be a string or the structure obtained by calling @@ -1427,6 +1432,7 @@ For example, @code{rotate(45)*xscale(2)*L} first scales @code{L} in the @math{x} direction and then rotates it counterclockwise by 45 degrees. The final position of a Label can also be shifted by a @code{PostScript} coordinate translation: @code{shift(10,0)*L}. +An explicit pen specified within the Label overrides other pen arguments. The @code{embed} argument determines how the Label should transform with the embedding picture: @table @code @@ -1455,7 +1461,7 @@ shift, rotate, slant, reflect, and scale with embedding picture. To add a label to a path, use @verbatim void label(picture pic=currentpicture, Label L, path g, align align=NoAlign, - pen p=nullpen, filltype filltype=NoFill); + pen p=currentpen, filltype filltype=NoFill); @end verbatim @cindex @code{Relative} By default the label will be positioned at the midpoint of the path. @@ -1794,12 +1800,18 @@ maximum value is @code{intMax}. @cindex @code{realMax} @cindex @code{realEpsilon} @cindex @code{realDigits} +@cindex @code{mask} +@cindex @code{inf} +@cindex @code{isnan} a real number; this should be set to the highest-precision native floating-point type on the architecture. The implicit initializer for reals is @code{0.0}. Real numbers have precision @code{realEpsilon}, with @code{realDigits} significant digits. The smallest positive real number is @code{realMin} and the largest -positive real number is @code{realMax}. +positive real number is @code{realMax}. +The variable @code{inf} and function @code{bool isnan(real x)} +are useful when floating-point exceptions are masked with +the @code{-mask} command-line option (the default in interactive mode). @item pair @cindex @code{pair} @@ -2070,24 +2082,30 @@ delimited by @code{delimiter} (an empty delimiter signifies a space, but with duplicate delimiters discarded); @anchor{format} -@item string format(string s, int n) +@item string format(string s, int n, string locale="") @cindex @code{format} returns a string containing @code{n} formatted according to the C-style -format string @code{s} using the current locale; +format string @code{s} using locale @code{locale} (or the current locale if an +empty string is specified); -@item string format(string s=defaultformat, real x, string locale="") +@item string format(string s=defaultformat, string s=defaultseparator, real x, string locale="") returns a string containing @code{x} formatted according to the C-style format string @code{s} using locale @code{locale} (or the current locale if an empty string is specified), following the behaviour of the C function @code{fprintf}), except that only one data field is allowed, trailing zeros are removed by default (unless @code{#} is specified), and (if the format string specifies math mode) @TeX{} is used to typeset -scientific notation; +scientific notation using the @code{defaultseparator="\!\times\!";}; @cindex @code{hex} @cindex @code{hexidecimal} @item int hex(string s); -casts a hexidecimal string @code{s} to an integer. +casts a hexidecimal string @code{s} to an integer; + +@cindex @code{ascii} +@cindex @code{ascii} +@item int ascii(string s); +returns the ASCII code for the first character of string @code{s}; @cindex @code{string} @item string string(real x, int digits=realDigits) @@ -2096,7 +2114,7 @@ casts @code{x} to a string using precision @code{digits} and the C locale; @cindex @code{locale} @item string locale(string s="") sets the locale to the given string, if nonempty, and returns the -current locale. +current locale; @item string time(string format="%a %b %d %T %Z %Y") @cindex @code{time} @@ -2144,6 +2162,17 @@ locale. For example, to return the date corresponding to 24 hours ago: time(seconds()-24*60*60); @end verbatim +@cindex @code{system} +@item int system(string s) +@item int system(string[] s) +if the setting @code{safe} is false, call the arbitrary system command @code{s}; + +@cindex @code{asy} +@item void asy(string format, bool overwrite=false ... string[] s) +conditionally process each file name in array @code{s} in a new environment, +using format @code{format}, overwriting the output file only if +@code{overwrite} is true; + @cindex @code{abort} @item void abort(string s="") aborts execution (with a non-zero return code in batch mode); if string @@ -2315,8 +2344,8 @@ cubic spline parameter @code{t-floor(t)} (@pxref{Bezier curves}). @item pair dir(path p) returns dir(p,length(p)). -@item pair dir(path p, path g) -returns unit(dir(p)+dir(g)). +@item pair dir(path p, path q) +returns unit(dir(p)+dir(q)). @cindex @code{accel} @item pair accel(path p, int t, int sign=0); @@ -2352,13 +2381,16 @@ returns the effective postcontrol point of @code{p} at parameter @code{t}. returns the length (in user coordinates) of the piecewise linear or cubic curve that path @code{p} represents. -@anchor{arctime} @cindex @code{arctime} @item real arctime(path p, real L); returns the path "time", a real number between 0 and the length of the path in the sense of @code{point(path p, real t)}, at which the cumulative arclength (measured from the beginning of the path) equals @code{L}. +@cindex @code{arcpoint} +@item real arcpoint(path p, real L); +returns @code{point(p,arctime(p,L))}. + @cindex @code{dirtime} @item real dirtime(path p, pair z); returns the first "time", a real number between 0 and the length of @@ -2805,8 +2837,8 @@ pen dashed=linetype(new real[] {8,8}); pen longdashed=linetype(new real[] {24,8}); pen dashdotted=linetype(new real[] {8,8,0,8}); pen longdashdotted=linetype(new real[] {24,8,0,8}); -pen Dotted=dotted+1.0; -pen Dotted(pen p=currentpen) {return dotted+2*linewidth(p);} +pen Dotted(pen p=currentpen) {return linetype(new real[] {0,3})+2*linewidth(p);} +pen Dotted=Dotted(); @end verbatim @sp 1 @center @image{linetype} @@ -2829,11 +2861,11 @@ The line type of a pen can be determined with the functions @code{pen linewidth(real)}. The default line width is 0.5 bp; this value may be changed with @code{defaultpen(pen)}. The line width of a pen is returned by @code{real linewidth(pen p=currentpen)}. -For convenience, in the module @code{plain} we define +For convenience, in the module @code{plain_pens} we define @verbatim -static void defaultpen(real w) {defaultpen(linewidth(w));} -static pen operator +(pen p, real w) {return p+linewidth(w);} -static pen operator +(real w, pen p) {return linewidth(w)+p;} +void defaultpen(real w) {defaultpen(linewidth(w));} +pen operator +(pen p, real w) {return p+linewidth(w);} +pen operator +(real w, pen p) {return linewidth(w)+p;} @end verbatim so that one may set the line width like this: @verbatim @@ -3622,8 +3654,11 @@ that can be used for importing @code{LaTeX} packages. value) files and portable @acronym{XDR} (External Data Representation) binary files. +@cindex @code{input} An input file must first be opened with -@code{input(string name, bool check=true, string comment="#")}; +@verbatim +input(string name="", bool check=true, string comment="#", string mode=""); +@end verbatim reading is then done by assignment: @cindex open @cindex @code{input} @@ -3665,7 +3700,7 @@ comment character as an ordinary character) and return it as a string. @cindex append A file named @code{name} can be open for output with @verbatim -file output(string name, bool update=false); +file output(string name="", bool update=false, string comment="#", string mode=""); @end verbatim @noindent If @code{update=false}, any existing data in the file will be erased @@ -3727,23 +3762,21 @@ write(fout,"List: ",1,2,3); // Writes "List: 1 2 3" @noindent @cindex binary format -@cindex @code{xinput} -@cindex @code{xoutput} -@cindex @code{binput} -@cindex @code{boutput} @cindex single precision @cindex double precision @cindex @code{singlereal} @cindex @code{singleint} @cindex @code{signedint} -A file may also be opened with @code{xinput} or @code{xoutput}, instead of -@code{input} or @code{output}, to read or write +@cindex @code{mode} +@cindex @code{binary} +@cindex @code{xdr} +A file may be opened with @code{mode="xdr"}, to read or write double precision (64-bit) reals and single precision (32-bit) integers in Sun Microsystem's @acronym{XDR} (External Data Representation) portable binary format (available on all @code{UNIX} platforms). -Alternatively, a file may also be opened with @code{binput} or -@code{boutput} to read or write double precision reals and single +Alternatively, a file may also be opened with @code{mode="binary"} +to read or write double precision reals and single precision integers in the native (nonportable) machine binary format. The virtual member functions @code{file singlereal(bool b=true)} and @code{file singleint(bool b=true)} @@ -3870,10 +3903,6 @@ int animate(string args="", string file="", string format=""); call the @code{ImageMagick} commands @code{convert} and @code{animate}, respectively, with the arguments @code{args} and the file name constructed from the strings @code{file} and @code{format}. -@cindex @code{system} -If the setting @code{safe} is false, then the functions -@code{int system(string s)} and @code{int system(string[] s)} can be -used to call the arbitrary system command @code{s}. @node Variable initializers @section Variable initializers @@ -4316,7 +4345,7 @@ not @cindex @code{?} @cindex conditional @verbatim -bool positive=(pi >= 0) ? true : false; +bool positive=(pi > 0) ? true : false; @end verbatim @cindex @code{interp} @@ -4919,6 +4948,7 @@ also defined. @cindex @code{F} @cindex @code{E} @cindex @code{P} +@cindex @code{sndncn} @cindex @code{Ei} @cindex @code{Si} @cindex @code{Ci} @@ -4936,6 +4966,7 @@ defines the airy functions @code{Ai(real)}, @code{J(real, real)}, @code{Y(real, real)}, @code{I(real, real)}, @code{K(real, real)}, @code{zero_J(real, int)}, the elliptic functions @code{F(real, real)}, @code{E(real, real)}, and @code{P(real, real)}, +the Jacobi elliptic functions @code{real[] sndncn(real,real)}, the exponential/trigonometric integrals @code{Ei}, @code{Si}, and @code{Ci}, the Legendre polynomials @code{Pl(int, real)}, and the Riemann zeta function @code{zeta(real)}. For example, to compute the sine integral @@ -5179,19 +5210,11 @@ searches an array @code{a} sorted in ascending order such that element @cindex @code{copy} @item T[] copy(T[] a) -returns a copy of the array @code{a}; - -@cindex @code{copy} -@item T[][] copy(T[][] a) -returns a copy of the array @code{a}; - -@cindex @code{copy} -@item T[][][] copy(T[][][] a) -returns a copy of the array @code{a}; +returns a deep copy of the array @code{a}; @cindex @code{concat} @item T[] concat(... T[][] a) -returns a new array formed by concatenating the arrays given as arguments; +returns a new array formed by concatenating the given one-dimensional arrays given as arguments; @cindex @code{alias} @item bool alias(T[] a, T[] b) @@ -5817,7 +5840,8 @@ code s=quote { eval(s,true); // Outputs 1 @end verbatim -To include the contents of a file @code{graph} verbatim (as if the +@cindex @code{include} +To include the contents of an existing file @code{graph} verbatim (as if the contents of the file were inserted at that point), use one of the forms: @verbatim include graph; @@ -5978,6 +6002,7 @@ and enclose your @code{Asymptote} code within a @code{\begin@{asy@}...\end@{asy@}} environment. As with the @code{LaTeX} @code{comment} environment, the @code{\end@{asy@}} command must appear on a line by itself, with no trailing commands/comments. +A blank line is not allowed after @code{\begin@{asy@}}. The sample @code{LaTeX} file below, named @code{latexusage.tex}, can be run as follows: @@ -6006,8 +6031,8 @@ An even better method for processing a @code{LaTeX} file with embedded @url{http://www.ctan.org/tex-archive/support/latexmk/} @end quotation @noindent -after putting the rules -@verbatiminclude latexmkrc +after putting the contents of +@url{http://asymptote.svn.sourceforge.net/viewvc/asymptote/trunk/asymptote/doc/latexmkrc} @noindent in a file @code{latexmkrc} in the same directory. The command @verbatim @@ -6017,6 +6042,14 @@ latexmk -pdf latexusage 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. +To store the figures in a separate directory named @code{asy}, one can define +@verbatim +\def\asydir{asy} +@end verbatim +in @code{latexusage.tex} and put the contents of +@url{http://asymptote.svn.sourceforge.net/viewvc/asymptote/trunk/asymptote/doc/latexmkrc_asydir} +in a file @code{latexmkrc} in the same directory. +@noindent External @code{Asymptote} code in @code{filename.asy} should be included with @cindex @code{asyinclude} @verbatim @@ -6040,9 +6073,8 @@ environments. 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 +(or older @code{attachfile}) @code{LaTeX} package. +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, @@ -6384,7 +6416,7 @@ sharp corners of paths, as illustrated in the example file @code{roundpath.asy}. @cindex animation @cindex @code{ImageMagick} This module allows one to generate animations, as illustrated by the -files @code{wheel.asy}, @code{wavelet.asy}, and @code{cube.asy} in +files @code{wheel.asy}, @code{wavepacket.asy}, and @code{cube.asy} in the @code{animations} subdirectory of the examples directory. These animations use the @code{ImageMagick} @code{convert} program to merge multiple images into a @acronym{GIF} or @acronym{MPEG} @@ -7060,17 +7092,17 @@ void ytick(picture pic=currentpicture, Label L="", real y, void tick(picture pic=currentpicture, pair z, pair dir, real size=Ticksize, pen p=currentpen); void labelx(picture pic=currentpicture, Label L="", explicit pair z, - align align=S, string format="", pen p=nullpen); + align align=S, string format="", pen p=currentpen); void labelx(picture pic=currentpicture, Label L="", real x, - align align=S, string format="", pen p=nullpen); + align align=S, string format="", pen p=currentpen); void labelx(picture pic=currentpicture, Label L, string format="", explicit pen p=currentpen); void labely(picture pic=currentpicture, Label L="", explicit pair z, - align align=W, string format="", pen p=nullpen); + align align=W, string format="", pen p=currentpen); void labely(picture pic=currentpicture, Label L="", real y, - align align=W, string format="", pen p=nullpen); + align align=W, string format="", pen p=currentpen); void labely(picture pic=currentpicture, Label L, - string format="", explicit pen p=nullpen); + string format="", explicit pen p=currentpen); @end verbatim @end itemize @@ -8001,6 +8033,15 @@ This is equivalent to orthographic((x,y,z),up,target,zoom,viewportshift,showtarget,center) @end verbatim +The routine +@cindex @code{camera} +@verbatim +triple camera(real alpha, real beta); +@end verbatim +can be used to compute the camera position with the @math{x} axis below +the horizontal at angle @code{alpha}, the @math{y} axis below the horizontal +at angle @code{beta}, and the @math{z} axis up. + @cindex @code{autoadjust} @item perspective(triple camera, triple up=Z, triple target=O, @*@ @ @ @ @ @ @ @ @ @ @ @ real zoom=1, real angle=0, pair viewportshift=0, @*@ @ @ @ @ @ @ @ @ @ @ @ bool showtarget=true, bool autoadjust=true, @*@ @ @ @ @ @ @ @ @ @ @ @ bool center=autoadjust) @cindex @code{perspective} @@ -9243,12 +9284,12 @@ and @code{tk-devel} packages. Pictures are deconstructed into the @acronym{PNG} image format, which supports full alpha channel transparency. Under @code{Microsoft Windows}, -this requires @code{Python 2.6.2} and the @code{Python Imaging Library}: +this requires @code{Python 2.7.3} and the @code{Python Imaging Library}: @quotation -@url{http://www.python.org/ftp/python/2.6.2/python-2.6.2.msi} +@url{http://www.python.org/ftp/python/2.7.3/python-2.7.3.msi} @end quotation @quotation -@url{http://effbot.org/downloads/PIL-1.1.7.win32-py2.6.exe}. +@url{http://effbot.org/downloads/PIL-1.1.7.win32-py2.7.exe}. @end quotation @noindent On @code{UNIX} systems, place @@ -9493,7 +9534,7 @@ Mark Henning, Steve Melenchuk, Martin Wiebusch, and Stefan Knorr. @c LocalWords: latexusage tex bbox PostScript subdirectory gcc emacs ASYDIR @c LocalWords: documentclass usepackage subpath shipout sqrt xN Mx bw AcroRd @c LocalWords: xscale xaxis yaxis BeginBar GIF postprocessing fpu de rpair xy -@c LocalWords: nomask noplain ImageMagick defaultfontsize defaultlinewidth cd +@c LocalWords: ImageMagick defaultfontsize defaultlinewidth cd asymptote Hy @c LocalWords: startup natively xasy tkinter VxN yingyang currentpicture toc @c LocalWords: MetaPost MetaFont Hammerlindl Healy texinfo autoload setq setf @c LocalWords: printindex setfilename settitle dircategory direntry titlepage @@ -9506,8 +9547,8 @@ Mark Henning, Steve Melenchuk, Martin Wiebusch, and Stefan Knorr. @c LocalWords: dirtime currentpen colorspaces grayscale cmyk defaultpen x cx @c LocalWords: linetype longdashed dashdotted longdashdotted linewidth y XP @c LocalWords: fontsize defaultfilename keepAspect IgnoreAspect ise flushleft -@c LocalWords: src dest XDR txt getc fout stdin stdout endl xinput eof js prc -@c LocalWords: xoutput Microsystem's eol exponentials postfix sayhi th Ubuntu +@c LocalWords: src dest XDR txt getc fout stdin stdout endl eof js prc +@c LocalWords: Microsystem's eol exponentials postfix sayhi th Ubuntu @c LocalWords: sqr intop addby libm asin acos atan sinh tanh asinh acosh cbrt @c LocalWords: atanh fabs hypot fmod ceil srand dereferenced alice pete sqrtx @c LocalWords: eval fft csv runtime nonalphanumeric labely LeftTicks NoTicks @@ -9592,7 +9633,7 @@ Mark Henning, Steve Melenchuk, Martin Wiebusch, and Stefan Knorr. @c LocalWords: labelpath intersectionpoints PSTricks pstextpath curvedlabel @c LocalWords: LeftJustified RightJustified tickmodifier gunzip gmake IRIX dv @c LocalWords: texcommand RET SITEDIR filegraph pathmarkers POSIX binput AOB -@c LocalWords: boutput nonportable markinterval stickframe circlebarframe tix +@c LocalWords: nonportable markinterval stickframe circlebarframe tix @c LocalWords: crossframe tildeframe markangle StickIntervalMarker gswin expm @c LocalWords: CrossIntervalMarker CircleBarIntervalMarker Ghostscript syzygy @c LocalWords: TildeIntervalMarker autoimport calculateTransform bitwise tk @@ -9637,9 +9678,14 @@ Mark Henning, Steve Melenchuk, Martin Wiebusch, and Stefan Knorr. @c LocalWords: rotateY rotateZ wheelup zoomin wheeldown zoomout TeXLive pnorm @c LocalWords: viewportshift signedint signedness psview multiplatform nowarn @c LocalWords: singlereal singleint writeoverloaded dvisvg reddash lexorder -@c LocalWords: bigdiagonal autobillboard dvisvgm maxtiles hyperrefOptions +@c LocalWords: bigdiagonal autobillboard dvisvgm maxtiles hyperrefOptions xdr @c LocalWords: setpagesize pdfborder controlsystem OmitTickInterval SixViews @c LocalWords: OmitTickIntervals tickmodifiers autorotated SixViewsUS latexmk @c LocalWords: ThreeViewsUS ThreeViewsFR SixViewsFR ThreeViews partialsum @c LocalWords: defaultrender Vidiassov latexmkrc mktemp DOSendl DOSnewl perl -@c LocalWords: filename asyinclude latemk penfunctionimage +@c LocalWords: filename asyinclude latemk penfunctionimage Affine decrement +@c LocalWords: affine Redisplay redisplay isnan radians defaultseparator Jens +@c LocalWords: ascii piecewise arcpoint spacings tilings sndncn resizing +@c LocalWords: differentiable vectorization vectorized asydir normals quartic +@c LocalWords: wavepacket kerned parametrized specular hyperboloid Bourke's +@c LocalWords: Michail diff --git a/Build/source/utils/asymptote/doc/install-sh b/Build/source/utils/asymptote/doc/install-sh index 377bb8687ff..6781b987bdb 100755 --- a/Build/source/utils/asymptote/doc/install-sh +++ b/Build/source/utils/asymptote/doc/install-sh @@ -1,7 +1,7 @@ #!/bin/sh # install - install a program, script, or datafile -scriptversion=2011-11-20.07; # UTC +scriptversion=2009-04-28.21; # UTC # This originates from X11R5 (mit/util/scripts/install.sh), which was # later released in X11R6 (xc/config/util/install.sh) with the @@ -35,7 +35,7 @@ scriptversion=2011-11-20.07; # UTC # FSF changes to this file are in the public domain. # # Calling this script install-sh is preferred over install.sh, to prevent -# 'make' implicit rules from creating a file called install from it +# `make' implicit rules from creating a file called install from it # when there is no Makefile. # # This script is compatible with the BSD install script, but was written @@ -156,10 +156,6 @@ while test $# -ne 0; do -s) stripcmd=$stripprog;; -t) dst_arg=$2 - # Protect names problematic for 'test' and other utilities. - case $dst_arg in - -* | [=\(\)!]) dst_arg=./$dst_arg;; - esac shift;; -T) no_target_directory=true;; @@ -190,10 +186,6 @@ if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then fi shift # arg dst_arg=$arg - # Protect names problematic for 'test' and other utilities. - case $dst_arg in - -* | [=\(\)!]) dst_arg=./$dst_arg;; - esac done fi @@ -202,17 +194,13 @@ if test $# -eq 0; then echo "$0: no input file specified." >&2 exit 1 fi - # It's OK to call 'install-sh -d' without argument. + # It's OK to call `install-sh -d' without argument. # This can happen when creating conditional directories. exit 0 fi if test -z "$dir_arg"; then - do_exit='(exit $ret); exit $ret' - trap "ret=129; $do_exit" 1 - trap "ret=130; $do_exit" 2 - trap "ret=141; $do_exit" 13 - trap "ret=143; $do_exit" 15 + trap '(exit $?); exit' 1 2 13 15 # Set umask so as not to create temps with too-generous modes. # However, 'strip' requires both read and write access to temps. @@ -240,9 +228,9 @@ fi for src do - # Protect names problematic for 'test' and other utilities. + # Protect names starting with `-'. case $src in - -* | [=\(\)!]) src=./$src;; + -*) src=./$src;; esac if test -n "$dir_arg"; then @@ -264,7 +252,12 @@ do echo "$0: no destination specified." >&2 exit 1 fi + dst=$dst_arg + # Protect names starting with `-'. + case $dst in + -*) dst=./$dst;; + esac # If destination is a directory, append the input filename; won't work # if double slashes aren't ignored. @@ -354,7 +347,7 @@ do if test -z "$dir_arg" || { # Check for POSIX incompatibilities with -m. # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or - # other-writable bit of parent directory when it shouldn't. + # other-writeable bit of parent directory when it shouldn't. # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. ls_ld_tmpdir=`ls -ld "$tmpdir"` case $ls_ld_tmpdir in @@ -392,7 +385,7 @@ do case $dstdir in /*) prefix='/';; - [-=\(\)!]*) prefix='./';; + -*) prefix='./';; *) prefix='';; esac @@ -410,7 +403,7 @@ do for d do - test X"$d" = X && continue + test -z "$d" && continue prefix=$prefix$d if test -d "$prefix"; then diff --git a/Build/source/utils/asymptote/doc/latexusage.tex b/Build/source/utils/asymptote/doc/latexusage.tex index f3c858348b9..910cef5bf10 100644 --- a/Build/source/utils/asymptote/doc/latexusage.tex +++ b/Build/source/utils/asymptote/doc/latexusage.tex @@ -84,7 +84,7 @@ renderer. To support {\tt latexmk}, 3D figures should specify attachments; this requires the \verb+attach=true+ option as well as the \verb+attachfile2+ \LaTeX\ package. \begin{center} -\begin{asy}[height=4cm,inline=true,attach=false] +\begin{asy}[height=4cm,inline=true,attach=false,viewportwidth=\linewidth] currentprojection=orthographic(5,4,2); draw(unitcube,blue); label("$V-E+F=2$",(0,1,0.5),3Y,blue+fontsize(17pt)); diff --git a/Build/source/utils/asymptote/doc/png/asymptote.info b/Build/source/utils/asymptote/doc/png/asymptote.info index 3bc2bee2a7f..ee7d4f40b51 100644 --- a/Build/source/utils/asymptote/doc/png/asymptote.info +++ b/Build/source/utils/asymptote/doc/png/asymptote.info @@ -1,7 +1,7 @@ This is asymptote.info, produced by makeinfo version 4.13 from ../asymptote.texi. -This file documents `Asymptote', version 2.13. +This file documents `Asymptote', version 2.16. `http://asymptote.sourceforge.net' @@ -23,7 +23,7 @@ File: asymptote.info, Node: Top, Next: Description, Up: (dir) Asymptote ********* -This file documents `Asymptote', version 2.13. +This file documents `Asymptote', version 2.16. `http://asymptote.sourceforge.net' @@ -237,6 +237,9 @@ output, including animations, are available at `Asymptote' tutorial can be found at `http://asymptote.sourceforge.net/links.html'. + A quick reference card for `Asymptote' is available at + + `http://asymptote.sourceforge.net/asyRefCard.pdf'. File: asymptote.info, Node: Installation, Next: Tutorial, Prev: Description, Up: Top @@ -471,7 +474,8 @@ following paths, in the order listed: 1. The current directory; 2. A list of one or more directories specified by the configuration - variable `dir' (separated by `:' under UNIX and `;' under `MSDOS'); + variable `dir' or environment variable `ASYMPTOTE_DIR' (separated + by `:' under UNIX and `;' under `MSDOS'); 3. The directory specified by the environment variable `ASYMPTOTE_HOME'; if this variable is not set, the directory @@ -495,14 +499,14 @@ tar -xf asymptote-x.xx.src.tar cd asymptote-x.xx By default the system version of the Boehm garbage collector will be used; if it is old we recommend first putting -`http://www.hpl.hp.com/personal/Hans_Boehm/gc/gc_source/gc-7.1.tar.gz' +`http://www.hpl.hp.com/personal/Hans_Boehm/gc/gc_source/gc-7.2b.tar.gz' in the `Asymptote' source directory. If your graphics card supports multisampling, we recommend using version -`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 +`2.6.0' 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 `http://prdownloads.sourceforge.net/freeglut/freeglut-2.6.0.tar.gz' and type (as the root user): @@ -1108,17 +1112,15 @@ File: asymptote.info, Node: label, Prev: clip, Up: Drawing commands ========= void label(picture pic=currentpicture, Label L, pair position, - align align=NoAlign, pen p=nullpen, filltype filltype=NoFill) + align align=NoAlign, pen p=currentpen, filltype filltype=NoFill) Draw Label `L' on picture `pic' using pen `p'. If `align' is `NoAlign', the label will be centered at user coordinate `position'; otherwise it will be aligned in the direction of `align' and displaced from `position' by the `PostScript' offset `align*labelmargin(p)'. The constant `Align' can be used to align the bottom-left corner of the -label at `position'. If `p' is `nullpen', the pen specified within the -Label, which defaults to `currentpen', will be used. The Label `L' can -either be a string or the structure obtained by calling one of the -functions +label at `position'. The Label `L' can either be a string or the +structure obtained by calling one of the functions Label Label(string s="", pair position, align align=NoAlign, pen p=nullpen, embed embed=Rotate, filltype filltype=NoFill); Label Label(string s="", align align=NoAlign, @@ -1132,8 +1134,9 @@ multiplying it on the left by an affine transform (*note Transforms::). For example, `rotate(45)*xscale(2)*L' first scales `L' in the x direction and then rotates it counterclockwise by 45 degrees. The final position of a Label can also be shifted by a `PostScript' coordinate -translation: `shift(10,0)*L'. The `embed' argument determines how the -Label should transform with the embedding picture: +translation: `shift(10,0)*L'. An explicit pen specified within the +Label overrides other pen arguments. The `embed' argument determines +how the Label should transform with the embedding picture: `Shift' only shift with embedding picture; @@ -1152,7 +1155,7 @@ Label should transform with the embedding picture: To add a label to a path, use void label(picture pic=currentpicture, Label L, path g, align align=NoAlign, - pen p=nullpen, filltype filltype=NoFill); + pen p=currentpen, filltype filltype=NoFill); By default the label will be positioned at the midpoint of the path. An alternative label position (in the sense of `point(path p, real t)') may be specified as a real value for `position' in constructing the @@ -1425,7 +1428,9 @@ user-defined types): for reals is `0.0'. Real numbers have precision `realEpsilon', with `realDigits' significant digits. The smallest positive real number is `realMin' and the largest positive real number is - `realMax'. + `realMax'. The variable `inf' and function `bool isnan(real x)' + are useful when floating-point exceptions are masked with the + `-mask' command-line option (the default in interactive mode). `pair' complex number, that is, an ordered pair of real components @@ -1653,11 +1658,12 @@ user-defined types): substrings delimited by `delimiter' (an empty delimiter signifies a space, but with duplicate delimiters discarded); - `string format(string s, int n)' + `string format(string s, int n, string locale="")' returns a string containing `n' formatted according to the - C-style format string `s' using the current locale; + C-style format string `s' using locale `locale' (or the + current locale if an empty string is specified); - `string format(string s=defaultformat, real x, string locale="")' + `string format(string s=defaultformat, string s=defaultseparator, real x, string locale="")' returns a string containing `x' formatted according to the C-style format string `s' using locale `locale' (or the current locale if an empty string is specified), following @@ -1665,10 +1671,13 @@ user-defined types): one data field is allowed, trailing zeros are removed by default (unless `#' is specified), and (if the format string specifies math mode) TeX is used to typeset scientific - notation; + notation using the `defaultseparator="\!\times\!";'; `int hex(string s);' - casts a hexidecimal string `s' to an integer. + casts a hexidecimal string `s' to an integer; + + `int ascii(string s);' + returns the ASCII code for the first character of string `s'; `string string(real x, int digits=realDigits)' casts `x' to a string using precision `digits' and the C @@ -1676,7 +1685,7 @@ user-defined types): `string locale(string s="")' sets the locale to the given string, if nonempty, and returns - the current locale. + the current locale; `string time(string format="%a %b %d %T %Z %Y")' returns the current time formatted by the ANSI C routine @@ -1709,6 +1718,17 @@ user-defined types): current locale. For example, to return the date corresponding to 24 hours ago: time(seconds()-24*60*60); + `int system(string s)' + + `int system(string[] s)' + if the setting `safe' is false, call the arbitrary system + command `s'; + + `void asy(string format, bool overwrite=false ... string[] s)' + conditionally process each file name in array `s' in a new + environment, using format `format', overwriting the output + file only if `overwrite' is true; + `void abort(string s="")' aborts execution (with a non-zero return code in batch mode); if string `s' is nonempty, a diagnostic message constructed @@ -1847,8 +1867,8 @@ File: asymptote.info, Node: Paths and guides, Next: Pens, Prev: Data types, `pair dir(path p)' returns dir(p,length(p)). - `pair dir(path p, path g)' - returns unit(dir(p)+dir(g)). + `pair dir(path p, path q)' + returns unit(dir(p)+dir(q)). `pair accel(path p, int t, int sign=0);' If `sign < 0', return the acceleration of the incoming path @@ -1887,6 +1907,9 @@ File: asymptote.info, Node: Paths and guides, Next: Pens, Prev: Data types, at which the cumulative arclength (measured from the beginning of the path) equals `L'. + `real arcpoint(path p, real L);' + returns `point(p,arctime(p,L))'. + `real dirtime(path p, pair z);' returns the first "time", a real number between 0 and the length of the path in the sense of `point(path, real)', at @@ -2250,8 +2273,8 @@ number, until it saturates with one or more color components equal to 1. pen longdashed=linetype(new real[] {24,8}); pen dashdotted=linetype(new real[] {8,8,0,8}); pen longdashdotted=linetype(new real[] {24,8,0,8}); - pen Dotted=dotted+1.0; - pen Dotted(pen p=currentpen) {return dotted+2*linewidth(p);} + pen Dotted(pen p=currentpen) {return linetype(new real[] {0,3})+2*linewidth(p);} + pen Dotted=Dotted(); @@ -2264,9 +2287,9 @@ number, until it saturates with one or more color components equal to 1. linewidth(real)'. The default line width is 0.5 bp; this value may be changed with `defaultpen(pen)'. The line width of a pen is returned by `real linewidth(pen p=currentpen)'. For convenience, - in the module `plain' we define static void defaultpen(real w) {defaultpen(linewidth(w));} - static pen operator +(pen p, real w) {return p+linewidth(w);} - static pen operator +(real w, pen p) {return linewidth(w)+p;} + in the module `plain_pens' we define void defaultpen(real w) {defaultpen(linewidth(w));} + pen operator +(pen p, real w) {return p+linewidth(w);} + pen operator +(real w, pen p) {return linewidth(w)+p;} so that one may set the line width like this: defaultpen(2); pen p=red+0.5; @@ -2862,8 +2885,9 @@ File: asymptote.info, Node: Files, Next: Variable initializers, Prev: Frames value) files and portable XDR (External Data Representation) binary files. - An input file must first be opened with `input(string name, bool -check=true, string comment="#")'; reading is then done by assignment: + An input file must first be opened with +input(string name="", bool check=true, string comment="#", string mode=""); + reading is then done by assignment: file fin=input("test.txt"); real a=fin; @@ -2888,7 +2912,7 @@ including a newline. In addition, `Asymptote' provides the function character as an ordinary character) and return it as a string. A file named `name' can be open for output with -file output(string name, bool update=false); +file output(string name="", bool update=false, string comment="#", string mode=""); If `update=false', any existing data in the file will be erased and only write operations can be used on the file. If `update=true', any existing data will be preserved, the position will be set to the @@ -2926,19 +2950,18 @@ file fout=output("test.txt"); write(fout,1); // Writes "1" write(fout); // Writes a new line write(fout,"List: ",1,2,3); // Writes "List: 1 2 3" - A file may also be opened with `xinput' or `xoutput', instead of -`input' or `output', to read or write double precision (64-bit) reals -and single precision (32-bit) integers in Sun Microsystem's XDR -(External Data Representation) portable binary format (available on all -`UNIX' platforms). Alternatively, a file may also be opened with -`binput' or `boutput' to read or write double precision reals and single -precision integers in the native (nonportable) machine binary format. -The virtual member functions `file singlereal(bool b=true)' and `file -singleint(bool b=true)' be used to change the precision of real and -integer I/O operations, respectively, for an XDR or binary file `f'. -Similarly, the function `file signedint(bool b=true)' can be used to -modify the signedness of integer reads and writes for an XDR or binary -file `f'. + A file may be opened with `mode="xdr"', to read or write double +precision (64-bit) reals and single precision (32-bit) integers in Sun +Microsystem's XDR (External Data Representation) portable binary format +(available on all `UNIX' platforms). Alternatively, a file may also be +opened with `mode="binary"' to read or write double precision reals and +single precision integers in the native (nonportable) machine binary +format. The virtual member functions `file singlereal(bool b=true)' +and `file singleint(bool b=true)' be used to change the precision of +real and integer I/O operations, respectively, for an XDR or binary +file `f'. Similarly, the function `file signedint(bool b=true)' can be +used to modify the signedness of integer reads and writes for an XDR or +binary file `f'. The virtual members `name', `mode', `singlereal', `singleint', and `signedint' may be used to query the respective parameters for a given @@ -3011,9 +3034,7 @@ int convert(string args="", string file="", string format=""); int animate(string args="", string file="", string format=""); call the `ImageMagick' commands `convert' and `animate', respectively, with the arguments `args' and the file name constructed from the -strings `file' and `format'. If the setting `safe' is false, then the -functions `int system(string s)' and `int system(string[] s)' can be -used to call the arbitrary system command `s'. +strings `file' and `format'. File: asymptote.info, Node: Variable initializers, Next: Structures, Prev: Files, Up: Programming @@ -3398,7 +3419,7 @@ the type of the result: not `Asymptote' also supports the C-like conditional syntax: -bool positive=(pi >= 0) ? true : false; +bool positive=(pi > 0) ? true : false; The function `T interp(T a, T b, real t)' returns `(1-t)*a+t*b' for nonintegral built-in arithmetic types `T'. If `a' and `b' are pens, @@ -3831,8 +3852,9 @@ module `gsl' that defines the airy functions `Ai(real)', `Bi(real)', `i_scaled(int, real)', `k_scaled(int, real)', `J(real, real)', `Y(real, real)', `I(real, real)', `K(real, real)', `zero_J(real, int)', the elliptic functions `F(real, real)', `E(real, real)', and `P(real, -real)', the exponential/trigonometric integrals `Ei', `Si', and `Ci', -the Legendre polynomials `Pl(int, real)', and the Riemann zeta function +real)', the Jacobi elliptic functions `real[] sndncn(real,real)', the +exponential/trigonometric integrals `Ei', `Si', and `Ci', the Legendre +polynomials `Pl(int, real)', and the Riemann zeta function `zeta(real)'. For example, to compute the sine integral `Si' of 1.0: import gsl; write(Si(1.0)); @@ -4035,17 +4057,11 @@ of type `T[]'. `i' precedes element `j' if `less(i,j)' is true; `T[] copy(T[] a)' - returns a copy of the array `a'; - -`T[][] copy(T[][] a)' - returns a copy of the array `a'; - -`T[][][] copy(T[][][] a)' - returns a copy of the array `a'; + returns a deep copy of the array `a'; `T[] concat(... T[][] a)' - returns a new array formed by concatenating the arrays given as - arguments; + returns a new array formed by concatenating the given + one-dimensional arrays given as arguments; `bool alias(T[] a, T[] b)' returns `true' if the arrays `a' and `b' are identical; @@ -4535,8 +4551,9 @@ code s=quote { }; eval(s,true); // Outputs 1 - To include the contents of a file `graph' verbatim (as if the -contents of the file were inserted at that point), use one of the forms: + To include the contents of an existing file `graph' verbatim (as if +the contents of the file were inserted at that point), use one of the +forms: include graph; `include "/usr/local/share/asymptote/graph.asy";' @@ -4672,7 +4689,8 @@ 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 trailing commands/comments. +with no trailing commands/comments. A blank line is not allowed after +`\begin{asy}'. The sample `LaTeX' file below, named `latexusage.tex', can be run as follows: @@ -4691,18 +4709,19 @@ pdflatex latexusage `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"); + after putting the contents of +`http://asymptote.svn.sourceforge.net/viewvc/asymptote/trunk/asymptote/doc/latexmkrc' 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. External -`Asymptote' code in `filename.asy' should be included with +process, this method also tends to use less memory. To store the +figures in a separate directory named `asy', one can define +\def\asydir{asy} + in `latexusage.tex' and put the contents of +`http://asymptote.svn.sourceforge.net/viewvc/asymptote/trunk/asymptote/doc/latexmkrc_asydir' +in a file `latexmkrc' in the same directory. External `Asymptote' code +in `filename.asy' should be included with \asyinclude[<options>]{<filename.asy>} so that `latexmk' will recognize when the code is changed. Note that `latemk' requires `perl', available from `http://www.perl.org/'. @@ -4712,10 +4731,9 @@ process, this method also tends to use less memory. External the `asy' and `asyinclude' environments. 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 +the `attachfile2' (or older `attachfile') `LaTeX' package. 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 @@ -4817,7 +4835,7 @@ renderer. To support {\tt latexmk}, 3D figures should specify attachments; this requires the \verb+attach=true+ option as well as the \verb+attachfile2+ \LaTeX\ package. \begin{center} -\begin{asy}[height=4cm,inline=true,attach=false] +\begin{asy}[height=4cm,inline=true,attach=false,viewportwidth=\linewidth] currentprojection=orthographic(5,4,2); draw(unitcube,blue); label("$V-E+F=2$",(0,1,0.5),3Y,blue+fontsize(17pt)); @@ -5182,7 +5200,7 @@ File: asymptote.info, Node: animation, Next: embed, Prev: roundedpath, Up: B ================ This module allows one to generate animations, as illustrated by the -files `wheel.asy', `wavelet.asy', and `cube.asy' in the `animations' +files `wheel.asy', `wavepacket.asy', and `cube.asy' in the `animations' subdirectory of the examples directory. These animations use the `ImageMagick' `convert' program to merge multiple images into a GIF or MPEG movie. @@ -5734,17 +5752,17 @@ following routines: void tick(picture pic=currentpicture, pair z, pair dir, real size=Ticksize, pen p=currentpen); void labelx(picture pic=currentpicture, Label L="", explicit pair z, - align align=S, string format="", pen p=nullpen); + align align=S, string format="", pen p=currentpen); void labelx(picture pic=currentpicture, Label L="", real x, - align align=S, string format="", pen p=nullpen); + align align=S, string format="", pen p=currentpen); void labelx(picture pic=currentpicture, Label L, string format="", explicit pen p=currentpen); void labely(picture pic=currentpicture, Label L="", explicit pair z, - align align=W, string format="", pen p=nullpen); + align align=W, string format="", pen p=currentpen); void labely(picture pic=currentpicture, Label L="", real y, - align align=W, string format="", pen p=nullpen); + align align=W, string format="", pen p=currentpen); void labely(picture pic=currentpicture, Label L, - string format="", explicit pen p=nullpen); + string format="", explicit pen p=currentpen); Here are some simple examples of two-dimensional graphs: @@ -6972,6 +6990,11 @@ These projections to two dimensions are predefined: bool center=false)' This is equivalent to orthographic((x,y,z),up,target,zoom,viewportshift,showtarget,center) + The routine triple camera(real alpha, real beta); + can be used to compute the camera position with the x axis below + the horizontal at angle `alpha', the y axis below the horizontal + at angle `beta', and the z axis up. + `perspective(triple camera, triple up=Z, triple target=O, real zoom=1, real angle=0, pair viewportshift=0, bool showtarget=true, bool autoadjust=true, @@ -8241,11 +8264,11 @@ packages. Pictures are deconstructed into the PNG image format, which supports full alpha channel transparency. Under `Microsoft Windows', this -requires `Python 2.6.2' and the `Python Imaging Library': +requires `Python 2.7.3' and the `Python Imaging Library': - `http://www.python.org/ftp/python/2.6.2/python-2.6.2.msi' + `http://www.python.org/ftp/python/2.7.3/python-2.7.3.msi' - `http://effbot.org/downloads/PIL-1.1.7.win32-py2.6.exe'. + `http://effbot.org/downloads/PIL-1.1.7.win32-py2.7.exe'. On `UNIX' systems, place `http://effbot.org/downloads/Imaging-1.1.7.tar.gz' in the `Asymptote' source directory, and type (as the root user): @@ -8475,7 +8498,7 @@ Index * -V <1>: Tutorial. (line 19) * -V: Configuring. (line 6) * ..: Tutorial. (line 127) -* .asy: Search paths. (line 13) +* .asy: Search paths. (line 14) * /: Arithmetic & logical. (line 20) * /=: Self & prefix operators. @@ -8483,7 +8506,7 @@ Index * 2D graphs: graph. (line 6) * 3D graphs: graph3. (line 6) * 3D grids: grid3. (line 6) -* 3D PostScript: three. (line 576) +* 3D PostScript: three. (line 581) * 3D rendering: Compiling from UNIX source. (line 16) * :: Arithmetic & logical. @@ -8508,11 +8531,11 @@ Index (line 6) * ^^: Tutorial. (line 134) * a4: Configuring. (line 61) -* abort: Data types. (line 322) +* abort: Data types. (line 339) * abs <1>: Mathematical functions. (line 35) -* abs: Data types. (line 60) -* accel <1>: three. (line 502) +* abs: Data types. (line 62) +* accel <1>: three. (line 507) * accel: Paths and guides. (line 115) * access: Import. (line 6) * acknowledgments: Credits. (line 6) @@ -8524,7 +8547,7 @@ Index (line 6) * add <1>: three. (line 271) * add: Frames and pictures. (line 196) -* addViews: three. (line 388) +* addViews: three. (line 393) * adjust: Pens. (line 115) * Ai: Mathematical functions. (line 48) @@ -8532,16 +8555,16 @@ Index (line 48) * Airy: Mathematical functions. (line 48) -* alias <1>: Arrays. (line 187) +* alias <1>: Arrays. (line 181) * alias: Structures. (line 52) * align: Options. (line 168) * Align: label. (line 12) -* all: Arrays. (line 335) +* all: Arrays. (line 329) * Allow: Pens. (line 327) * AND: Arithmetic & logical. (line 80) * and: Bezier curves. (line 56) -* angle: Data types. (line 68) +* angle: Data types. (line 70) * animate <1>: animation. (line 12) * animate <2>: Files. (line 154) * animate: Configuring. (line 67) @@ -8552,17 +8575,18 @@ Index * antialiasing: Compiling from UNIX source. (line 16) * append <1>: Arrays. (line 39) -* append: Files. (line 35) +* append: Files. (line 36) * arc: three. (line 283) * Arc: Paths and guides. (line 32) * arc: Paths and guides. (line 22) * ArcArrow: draw. (line 26) -* ArcArrow3: three. (line 543) +* ArcArrow3: three. (line 548) * ArcArrows: draw. (line 26) -* ArcArrows3: three. (line 543) -* arclength <1>: three. (line 502) +* ArcArrows3: three. (line 548) +* arclength <1>: three. (line 507) * arclength: Paths and guides. (line 142) -* arctime <1>: three. (line 502) +* arcpoint: Paths and guides. (line 152) +* arctime <1>: three. (line 507) * arctime: Paths and guides. (line 146) * arguments: Default arguments. (line 6) * arithmetic operators: Arithmetic & logical. @@ -8570,15 +8594,16 @@ Index * array: Arrays. (line 122) * array iteration: Programming. (line 33) * arrays: Arrays. (line 6) -* arrow: label. (line 72) +* arrow: label. (line 71) * Arrow: draw. (line 26) * arrow: Drawing commands. (line 31) * arrow keys: Tutorial. (line 37) -* Arrow3: three. (line 543) +* Arrow3: three. (line 548) * Arrows: draw. (line 26) * arrows: draw. (line 26) -* Arrows3: three. (line 543) +* Arrows3: three. (line 548) * as: Import. (line 68) +* ascii: Data types. (line 286) * aSin: Mathematical functions. (line 20) * asin: Mathematical functions. @@ -8586,12 +8611,13 @@ Index * asinh: Mathematical functions. (line 6) * Aspect: Frames and pictures. (line 54) -* assert: Data types. (line 327) +* assert: Data types. (line 344) * assignment: Programming. (line 8) -* asy: Import. (line 102) +* asy <1>: Import. (line 102) +* asy: Data types. (line 334) * asy-mode: Editing modes. (line 6) * asy.vim: Editing modes. (line 33) -* asyinclude: LaTeX usage. (line 44) +* asyinclude: LaTeX usage. (line 46) * asymptote.sty: LaTeX usage. (line 6) * asymptote.xml: Editing modes. (line 49) * ASYMPTOTE_CONFIG: Options. (line 115) @@ -8605,41 +8631,41 @@ Index (line 6) * atleast: Bezier curves. (line 56) * attach <1>: graph. (line 415) -* attach: LaTeX usage. (line 49) -* autoadjust: three. (line 354) +* attach: LaTeX usage. (line 51) +* autoadjust: three. (line 359) * autoimport: Options. (line 111) * automatic scaling: graph. (line 682) * axialshade: fill. (line 43) * axis <1>: graph3. (line 66) * axis: graph. (line 880) -* azimuth: Data types. (line 124) +* azimuth: Data types. (line 126) * babel: babel. (line 6) * background color: Frames and pictures. (line 168) -* BackView: three. (line 381) +* BackView: three. (line 386) * Bar: draw. (line 19) -* Bar3: three. (line 543) +* Bar3: three. (line 548) * Bars: draw. (line 19) -* Bars3: three. (line 543) +* Bars3: three. (line 548) * barsize: draw. (line 19) * base modules: Base modules. (line 6) * basealign: Pens. (line 168) -* baseline: label. (line 92) +* baseline: label. (line 91) * batch mode: Tutorial. (line 6) -* beep: Data types. (line 340) +* beep: Data types. (line 357) * BeginArcArrow: draw. (line 26) -* BeginArcArrow3: three. (line 543) +* BeginArcArrow3: three. (line 548) * BeginArrow: draw. (line 26) -* BeginArrow3: three. (line 543) +* BeginArrow3: three. (line 548) * BeginBar: draw. (line 19) -* BeginBar3: three. (line 543) +* BeginBar3: three. (line 548) * BeginDotMargin: draw. (line 42) -* BeginDotMargin3: three. (line 559) +* BeginDotMargin3: three. (line 564) * BeginMargin: draw. (line 42) -* BeginMargin3: three. (line 559) +* BeginMargin3: three. (line 564) * BeginPenMargin: draw. (line 42) -* BeginPenMargin2: three. (line 559) -* BeginPenMargin3: three. (line 559) -* BeginPoint: label. (line 57) +* BeginPenMargin2: three. (line 564) +* BeginPenMargin3: three. (line 564) +* BeginPoint: label. (line 56) * Bessel: Mathematical functions. (line 48) * bevel: flowchart. (line 75) @@ -8650,12 +8676,12 @@ Index (line 48) * Bi_deriv: Mathematical functions. (line 48) -* Billboard: three. (line 472) -* binary format: Files. (line 74) +* Billboard: three. (line 477) +* binary: Files. (line 75) +* binary format: Files. (line 75) * binary operators: Arithmetic & logical. (line 6) * binarytree: binarytree. (line 6) -* binput: Files. (line 74) * black stripes: three. (line 210) * Blank: draw. (line 26) * block.bottom: flowchart. (line 19) @@ -8675,10 +8701,9 @@ Index (line 6) * Bottom: graph. (line 134) * BottomTop: graph. (line 140) -* BottomView: three. (line 381) +* BottomView: three. (line 386) * bounding box: Frames and pictures. (line 168) * Bounds: graph3. (line 20) -* boutput: Files. (line 74) * box <1>: three. (line 305) * box: Frames and pictures. (line 22) * bp: Tutorial. (line 26) @@ -8687,22 +8712,23 @@ Index * brick: Pens. (line 251) * broken axis: graph. (line 783) * bug reports: Help. (line 23) -* buildcycle: Paths and guides. (line 255) +* buildcycle: Paths and guides. (line 258) * Button-1: GUI. (line 6) * Button-2: GUI. (line 6) * BWRainbow: palette. (line 15) * BWRainbow2: palette. (line 18) -* C string: Data types. (line 189) +* C string: Data types. (line 191) * CAD: CAD. (line 6) * calculateTransform: Frames and pictures. (line 107) +* camera: three. (line 354) * casts: Casts. (line 6) * cbrt: Mathematical functions. (line 6) -* cd: Files. (line 24) +* cd: Files. (line 25) * ceil: Mathematical functions. (line 26) * center: three. (line 338) -* Center: label. (line 62) +* Center: label. (line 61) * checker: Pens. (line 251) * Chinese: unicode. (line 12) * choose: Mathematical functions. @@ -8724,23 +8750,23 @@ Index * cm: Tutorial. (line 63) * cmd: Configuring. (line 34) * cmyk: Pens. (line 34) -* colatitude: Data types. (line 129) +* colatitude: Data types. (line 131) * color: Pens. (line 23) * coloredNodes: tube. (line 25) * coloredpath: tube. (line 18) * coloredSegments: tube. (line 25) * colorless: Pens. (line 54) * colors: Pens. (line 51) -* comma: Files. (line 60) -* comma-separated-value mode: Arrays. (line 368) +* comma: Files. (line 61) +* comma-separated-value mode: Arrays. (line 362) * command-line options <1>: Options. (line 6) * command-line options: Configuring. (line 83) -* comment character: Files. (line 15) +* comment character: Files. (line 16) * compass directions: Tutorial. (line 106) * Compiling from UNIX source: Compiling from UNIX source. (line 6) * complement: Arrays. (line 150) -* concat: Arrays. (line 183) +* concat: Arrays. (line 177) * conditional <1>: Arithmetic & logical. (line 73) * conditional: Programming. (line 8) @@ -8748,7 +8774,7 @@ Index * configuration file <1>: Options. (line 115) * configuration file: Configuring. (line 23) * configuring: Configuring. (line 6) -* conj: Data types. (line 57) +* conj: Data types. (line 59) * constructors: Structures. (line 91) * context: Options. (line 143) * continue <1>: Debugger. (line 31) @@ -8757,7 +8783,7 @@ Index * contour3: contour3. (line 6) * controls <1>: three. (line 6) * controls: Bezier curves. (line 45) -* controlSpecifier: Paths and guides. (line 379) +* controlSpecifier: Paths and guides. (line 382) * convert <1>: Options. (line 143) * convert <2>: animation. (line 6) * convert <3>: Files. (line 154) @@ -8775,33 +8801,33 @@ Index * crop: graph. (line 636) * cropping graphs: graph. (line 636) * cross <1>: graph. (line 484) -* cross: Data types. (line 167) +* cross: Data types. (line 169) * crossframe: markers. (line 23) * crosshatch: Pens. (line 267) -* csv: Arrays. (line 368) +* csv: Arrays. (line 362) * CTZ: Arithmetic & logical. (line 80) -* cubicroots: Arrays. (line 324) +* cubicroots: Arrays. (line 318) * curl <1>: three. (line 6) * curl: Bezier curves. (line 63) -* curlSpecifier: Paths and guides. (line 391) +* curlSpecifier: Paths and guides. (line 394) * currentpen: Pens. (line 6) -* currentprojection: three. (line 378) +* currentprojection: three. (line 383) * curve: slopefield. (line 20) * custom axis types: graph. (line 144) * custom mark routine: graph. (line 576) * custom tick locations: graph. (line 249) -* cut: Paths and guides. (line 237) +* cut: Paths and guides. (line 240) * cycle <1>: three. (line 6) * cycle: Tutorial. (line 75) -* cyclic <1>: three. (line 502) +* cyclic <1>: three. (line 507) * cyclic <2>: Arrays. (line 39) * cyclic: Paths and guides. (line 74) * Cyrillic: unicode. (line 7) * dashdotted: Pens. (line 95) * dashed: Pens. (line 95) * data types: Data types. (line 6) -* date: Data types. (line 292) +* date: Data types. (line 298) * Debian: UNIX binary distributions. (line 19) * debugger: Debugger. (line 6) @@ -8810,7 +8836,7 @@ Index * default arguments: Default arguments. (line 6) * defaultformat: graph. (line 175) * DefaultHead: draw. (line 26) -* DefaultHead3: three. (line 543) +* DefaultHead3: three. (line 548) * defaultpen: Pens. (line 46) * defaultrender: three. (line 47) * deferred drawing: simplex. (line 6) @@ -8818,35 +8844,35 @@ Index (line 17) * degrees <1>: Mathematical functions. (line 17) -* degrees: Data types. (line 73) +* degrees: Data types. (line 75) * delete <1>: Arrays. (line 39) * delete: Files. (line 149) * description: Description. (line 6) -* diagonal: Arrays. (line 309) +* diagonal: Arrays. (line 303) * diamond: flowchart. (line 57) -* dimension: Arrays. (line 373) -* dir <1>: three. (line 502) +* dimension: Arrays. (line 367) +* dir <1>: three. (line 507) * dir <2>: Paths and guides. (line 98) -* dir <3>: Data types. (line 85) +* dir <3>: Data types. (line 87) * dir: Search paths. (line 10) * direction specifier: Bezier curves. (line 6) -* directory: Files. (line 24) -* dirSpecifier: Paths and guides. (line 373) -* dirtime: Paths and guides. (line 152) +* directory: Files. (line 25) +* dirSpecifier: Paths and guides. (line 376) +* dirtime: Paths and guides. (line 155) * display: Configuring. (line 67) * do: Programming. (line 29) -* DOSendl: Files. (line 60) -* DOSnewl: Files. (line 60) -* dot <1>: Arrays. (line 265) -* dot <2>: Data types. (line 98) +* DOSendl: Files. (line 61) +* DOSnewl: Files. (line 61) +* dot <1>: Arrays. (line 259) +* dot <2>: Data types. (line 100) * dot: draw. (line 83) * DotMargin: draw. (line 42) -* DotMargin3: three. (line 559) +* DotMargin3: three. (line 564) * DotMargins: draw. (line 42) -* DotMargins3: three. (line 559) +* DotMargins3: three. (line 564) * dotted: Pens. (line 95) * double deferred drawing: three. (line 256) -* double precision: Files. (line 74) +* double precision: Files. (line 75) * Draw: Frames and pictures. (line 147) * draw: draw. (line 110) * Draw: draw. (line 26) @@ -8870,39 +8896,39 @@ Index * else: Programming. (line 8) * emacs: Editing modes. (line 6) * embed: embed. (line 6) -* Embedded: three. (line 472) +* Embedded: three. (line 477) * empty: Frames and pictures. (line 7) * EndArcArrow: draw. (line 26) -* EndArcArrow3: three. (line 543) +* EndArcArrow3: three. (line 548) * EndArrow: draw. (line 26) -* EndArrow3: three. (line 543) +* EndArrow3: three. (line 548) * EndBar: draw. (line 19) -* EndBar3: three. (line 543) +* EndBar3: three. (line 548) * EndDotMargin: draw. (line 42) -* EndDotMargin3: three. (line 559) -* endl: Files. (line 60) +* EndDotMargin3: three. (line 564) +* endl: Files. (line 61) * EndMargin: draw. (line 42) -* EndMargin3: three. (line 559) +* EndMargin3: three. (line 564) * EndPenMargin: draw. (line 42) -* EndPenMargin2: three. (line 559) -* EndPenMargin3: three. (line 559) -* EndPoint: label. (line 57) +* EndPenMargin2: three. (line 564) +* EndPenMargin3: three. (line 564) +* EndPoint: label. (line 56) * envelope: Frames and pictures. (line 22) * environment variables: Configuring. (line 87) -* eof <1>: Arrays. (line 350) +* eof <1>: Arrays. (line 344) * eof: Files. (line 92) -* eol <1>: Arrays. (line 350) +* eol <1>: Arrays. (line 344) * eol: Files. (line 92) * EPS <1>: Options. (line 143) -* EPS: label. (line 80) +* EPS: label. (line 79) * erase <1>: Frames and pictures. (line 7) -* erase <2>: Data types. (line 239) +* erase <2>: Data types. (line 241) * erase: Tutorial. (line 37) * erf: Mathematical functions. (line 6) * erfc: Mathematical functions. (line 6) -* error: Files. (line 15) +* error: Files. (line 16) * error bars: graph. (line 532) * errorbars: graph. (line 484) * eval: Import. (line 98) @@ -8910,10 +8936,10 @@ Index * evenodd: Tutorial. (line 148) * exit <1>: Debugger. (line 57) * exit <2>: Interactive mode. (line 59) -* exit: Data types. (line 331) +* exit: Data types. (line 348) * exp: Mathematical functions. (line 6) -* expi: Data types. (line 81) +* expi: Data types. (line 83) * explicit: Casts. (line 6) * explicit casts: Casts. (line 21) * expm1: Mathematical functions. @@ -8922,21 +8948,21 @@ Index (line 48) * extendcap: Pens. (line 129) * extension <1>: MetaPost. (line 10) -* extension: Paths and guides. (line 232) +* extension: Paths and guides. (line 235) * external: embed. (line 28) -* extrude: three. (line 496) +* extrude: three. (line 501) * F: Mathematical functions. (line 48) * fabs: Mathematical functions. (line 6) -* face: three. (line 584) +* face: three. (line 589) * factorial: Mathematical functions. (line 39) * Fedora: UNIX binary distributions. (line 15) * feynman: feynman. (line 6) * fft <1>: math. (line 26) -* fft: Arrays. (line 252) +* fft: Arrays. (line 246) * FFTW: Compiling from UNIX source. (line 58) * file <1>: Debugger. (line 45) @@ -8951,15 +8977,15 @@ Index * filloutside: fill. (line 27) * fillrule: Pens. (line 152) * find <1>: Arrays. (line 159) -* find: Data types. (line 224) -* firstcut: Paths and guides. (line 247) +* find: Data types. (line 226) +* firstcut: Paths and guides. (line 250) * fit: Frames and pictures. (line 103) * fit3: three. (line 269) * fixedscaling: Frames and pictures. (line 74) * floor: Mathematical functions. (line 26) * flowchart: flowchart. (line 6) -* flush: Files. (line 60) +* flush: Files. (line 61) * fmod: Mathematical functions. (line 6) * font: Pens. (line 192) @@ -8968,13 +8994,13 @@ Index * fontsize: Pens. (line 178) * for: Programming. (line 8) * format <1>: Options. (line 143) -* format: Data types. (line 267) +* format: Data types. (line 269) * forum: Help. (line 6) * frame: Frames and pictures. (line 7) * freeglut: Compiling from UNIX source. (line 16) * from: Import. (line 17) -* FrontView: three. (line 381) +* FrontView: three. (line 386) * function declarations: Functions. (line 67) * function shading: fill. (line 96) * Function shading: fill. (line 96) @@ -8987,7 +9013,7 @@ Index * Gaussrand: Mathematical functions. (line 39) * geometry: geometry. (line 6) -* getc: Files. (line 29) +* getc: Files. (line 30) * getpair: Files. (line 117) * getreal: Files. (line 117) * getstring: Files. (line 117) @@ -9001,7 +9027,7 @@ Index * gradient shading: fill. (line 32) * graph: graph. (line 6) * graph3: graph3. (line 6) -* graphic: label. (line 80) +* graphic: label. (line 79) * graphical user interface: GUI. (line 6) * gray: Pens. (line 25) * Grayscale: palette. (line 9) @@ -9018,27 +9044,27 @@ Index * GUI: GUI. (line 6) * GUI installation: GUI installation. (line 6) * GUI usage: GUI usage. (line 6) -* guide: Paths and guides. (line 300) +* guide: Paths and guides. (line 303) * guide3: three. (line 6) * hatch: Pens. (line 267) -* height: LaTeX usage. (line 49) +* height: LaTeX usage. (line 51) * help <1>: Debugger. (line 30) * help <2>: Help. (line 6) * help: Interactive mode. (line 44) * Hermite: graph. (line 37) * Hermite(splinetype splinetype: graph. (line 37) * hex <1>: Pens. (line 60) -* hex: Data types. (line 280) +* hex: Data types. (line 283) * hexidecimal <1>: Pens. (line 59) -* hexidecimal: Data types. (line 280) -* hidden surface removal: three. (line 584) +* hexidecimal: Data types. (line 283) +* hidden surface removal: three. (line 589) * histogram: Mathematical functions. (line 39) * history <1>: Interactive mode. (line 59) * history: Files. (line 142) * historylines: Interactive mode. (line 64) * HookHead: draw. (line 26) -* HookHead3: three. (line 543) +* HookHead3: three. (line 548) * Horizontal: flowchart. (line 81) * hyperrefOptions: Options. (line 130) * hypot: Mathematical functions. @@ -9048,11 +9074,11 @@ Index * i_scaled: Mathematical functions. (line 48) * iconic: three. (line 210) -* identity <1>: Arrays. (line 306) +* identity <1>: Arrays. (line 300) * identity <2>: Mathematical functions. (line 6) * identity: Transforms. (line 24) -* identity4: three. (line 432) +* identity4: three. (line 437) * if: Programming. (line 8) * IgnoreAspect: Frames and pictures. (line 58) * image: palette. (line 34) @@ -9065,47 +9091,50 @@ Index * implicit scaling: Implicit scaling. (line 6) * import: Import. (line 46) * inches: Tutorial. (line 63) -* including images: label. (line 80) +* include: Import. (line 127) +* including images: label. (line 79) * increasing: math. (line 59) +* inf: Data types. (line 33) * inheritance: Structures. (line 181) * initialized: Arrays. (line 39) * initializers: Variable initializers. (line 6) -* inline: LaTeX usage. (line 49) +* inline: LaTeX usage. (line 51) * InOutTicks: graph3. (line 34) * input <1>: Interactive mode. (line 48) -* input: Files. (line 11) +* input: Files. (line 10) * insert <1>: Arrays. (line 39) -* insert: Data types. (line 235) -* inside: Paths and guides. (line 279) +* insert: Data types. (line 237) +* inside: Paths and guides. (line 282) * inst: Debugger. (line 36) * installation: Installation. (line 6) * int: Data types. (line 28) * integer division: Arithmetic & logical. (line 6) * interactive mode: Interactive mode. (line 6) -* interior: Paths and guides. (line 275) +* interior: Paths and guides. (line 278) * international characters: unicode. (line 6) * interp: Arithmetic & logical. (line 76) * interpolate: interpolate. (line 6) -* intersect <1>: three. (line 502) +* intersect <1>: three. (line 507) * intersect <2>: math. (line 13) -* intersect: Paths and guides. (line 181) -* intersectionpoint <1>: three. (line 502) +* intersect: Paths and guides. (line 184) +* intersectionpoint <1>: three. (line 507) * intersectionpoint <2>: math. (line 17) -* intersectionpoint: Paths and guides. (line 224) -* intersectionpoints <1>: three. (line 502) -* intersectionpoints: Paths and guides. (line 228) -* intersections <1>: three. (line 502) -* intersections: Paths and guides. (line 192) +* intersectionpoint: Paths and guides. (line 227) +* intersectionpoints <1>: three. (line 507) +* intersectionpoints: Paths and guides. (line 231) +* intersections <1>: three. (line 507) +* intersections: Paths and guides. (line 195) * InTicks: graph3. (line 34) * intMax: Data types. (line 28) * intMin: Data types. (line 28) -* inverse <1>: Arrays. (line 312) +* inverse <1>: Arrays. (line 306) * inverse: Transforms. (line 16) -* invert: three. (line 422) +* invert: three. (line 427) * invisible: Pens. (line 39) +* isnan: Data types. (line 33) * J: Mathematical functions. (line 6) * Japanese: unicode. (line 12) @@ -9115,7 +9144,7 @@ Index (line 48) * Kate: Editing modes. (line 49) * KDE editor: Editing modes. (line 49) -* keepAspect <1>: LaTeX usage. (line 49) +* keepAspect <1>: LaTeX usage. (line 51) * keepAspect: Frames and pictures. (line 54) * keyboard bindings:: three. (line 169) * keys: Arrays. (line 39) @@ -9123,9 +9152,9 @@ Index * keyword-only: Named arguments. (line 37) * keywords: Named arguments. (line 6) * Korean: unicode. (line 12) -* label: three. (line 466) +* label: three. (line 471) * Label <1>: graph. (line 342) -* Label: label. (line 15) +* Label: label. (line 14) * label: clip. (line 16) * Label: draw. (line 98) * labelpath: labelpath. (line 6) @@ -9133,32 +9162,32 @@ Index * labelx: graph. (line 342) * labely: graph. (line 342) * Landscape: Frames and pictures. (line 95) -* lastcut: Paths and guides. (line 251) +* lastcut: Paths and guides. (line 254) * lasy-mode: Editing modes. (line 6) * latex: Options. (line 143) * LaTeX fonts: Pens. (line 192) * LaTeX usage: LaTeX usage. (line 6) -* latexmk: LaTeX usage. (line 29) +* latexmk: LaTeX usage. (line 30) * latin1: latin1. (line 6) -* latitude: Data types. (line 134) +* latitude: Data types. (line 136) * latticeshade: fill. (line 32) * layer: Drawing commands. (line 16) * leastsquares <1>: graph. (line 902) * leastsquares: stats. (line 6) * Left: graph. (line 284) * LeftRight: graph. (line 290) -* LeftSide: label. (line 62) +* LeftSide: label. (line 61) * LeftTicks: graph. (line 161) -* LeftView: three. (line 381) +* LeftView: three. (line 386) * legend <1>: graph. (line 431) * legend <2>: draw. (line 64) * legend: Drawing commands. (line 31) * Legendre: Mathematical functions. (line 48) -* length <1>: three. (line 502) +* length <1>: three. (line 507) * length <2>: Arrays. (line 39) * length <3>: Paths and guides. (line 65) -* length: Data types. (line 60) +* length: Data types. (line 62) * letter: Configuring. (line 61) * lexorder: math. (line 68) * libm routines: Mathematical functions. @@ -9166,15 +9195,15 @@ Index * libsigsegv <1>: Help. (line 33) * libsigsegv: Functions. (line 88) * limits: graph. (line 636) -* line: Arrays. (line 350) -* line mode: Arrays. (line 350) +* line: Arrays. (line 344) +* line mode: Arrays. (line 344) * Linear: graph. (line 682) * linecap: Pens. (line 129) * linejoin: Pens. (line 138) * lineskip: Pens. (line 178) * linetype: Pens. (line 115) * linewidth: Pens. (line 119) -* locale: Data types. (line 287) +* locale: Data types. (line 293) * Log: graph. (line 682) * log: Mathematical functions. (line 6) @@ -9189,59 +9218,60 @@ Index (line 6) * longdashdotted: Pens. (line 95) * longdashed: Pens. (line 95) -* longitude: Data types. (line 139) +* longitude: Data types. (line 141) * loop: Programming. (line 8) * MacOS X binary distributions: MacOS X binary distributions. (line 6) * makepen: Pens. (line 300) * map: Arrays. (line 141) * Margin: draw. (line 42) -* Margin3: three. (line 559) +* Margin3: three. (line 564) * margins: three. (line 262) * Margins: draw. (line 42) -* Margins3: three. (line 559) +* Margins3: three. (line 564) * mark: graph. (line 484) * markangle: markers. (line 38) * marker: graph. (line 484) * markers: markers. (line 6) * marknodes: graph. (line 484) * markuniform: graph. (line 484) +* mask: Data types. (line 33) * math: math. (line 6) * mathematical functions: Mathematical functions. (line 6) -* max <1>: three. (line 502) -* max <2>: Arrays. (line 231) +* max <1>: three. (line 507) +* max <2>: Arrays. (line 225) * max <3>: Frames and pictures. (line 7) -* max: Paths and guides. (line 264) -* maxbound: Data types. (line 104) +* max: Paths and guides. (line 267) +* maxbound: Data types. (line 106) * maxtile: three. (line 210) -* maxtimes: Paths and guides. (line 219) +* maxtimes: Paths and guides. (line 222) * maxviewport: three. (line 210) * MetaPost: MetaPost. (line 6) * MetaPost ... : Bezier curves. (line 67) -* MetaPost cutafter: Paths and guides. (line 252) -* MetaPost cutbefore: Paths and guides. (line 248) +* MetaPost cutafter: Paths and guides. (line 255) +* MetaPost cutbefore: Paths and guides. (line 251) * MetaPost pickup: Pens. (line 6) * MetaPost whatever: MetaPost. (line 10) * Microsoft Windows: Microsoft Windows. (line 6) * MidArcArrow: draw. (line 26) -* MidArcArrow3: three. (line 543) +* MidArcArrow3: three. (line 548) * MidArrow: draw. (line 26) -* MidArrow3: three. (line 543) -* midpoint: Paths and guides. (line 166) -* MidPoint: label. (line 57) -* min <1>: three. (line 502) -* min <2>: Arrays. (line 224) +* MidArrow3: three. (line 548) +* midpoint: Paths and guides. (line 169) +* MidPoint: label. (line 56) +* min <1>: three. (line 507) +* min <2>: Arrays. (line 218) * min <3>: Frames and pictures. (line 7) -* min: Paths and guides. (line 260) -* minbound: Data types. (line 101) -* minipage: label. (line 119) -* mintimes: Paths and guides. (line 214) +* min: Paths and guides. (line 263) +* minbound: Data types. (line 103) +* minipage: label. (line 118) +* mintimes: Paths and guides. (line 217) * miterjoin: Pens. (line 138) * miterlimit: Pens. (line 147) -* mktemp: Files. (line 43) +* mktemp: Files. (line 44) * mm: Tutorial. (line 63) -* mode: Files. (line 88) +* mode: Files. (line 75) * monotonic: graph. (line 37) * mouse: GUI. (line 6) * mouse bindings: three. (line 137) @@ -9257,19 +9287,19 @@ Index * new <1>: Arrays. (line 109) * new: Structures. (line 6) * newframe: Frames and pictures. (line 7) -* newl: Files. (line 60) +* newl: Files. (line 61) * newton: Mathematical functions. - (line 65) + (line 66) * next: Debugger. (line 42) * NFSS: Pens. (line 192) * nobasealign: Pens. (line 168) * NoFill <1>: Frames and pictures. (line 141) * NoFill: draw. (line 26) * NoMargin: draw. (line 42) -* NoMargin3: three. (line 559) -* none: Files. (line 60) +* NoMargin3: three. (line 564) +* none: Files. (line 61) * None: draw. (line 19) -* normal: three. (line 488) +* normal: three. (line 493) * nosafe: Options. (line 163) * NOT: Arithmetic & logical. (line 80) @@ -9279,7 +9309,7 @@ Index * null: Structures. (line 6) * nullpen <1>: Frames and pictures. (line 127) * nullpen: label. (line 14) -* NURBS: three. (line 358) +* NURBS: three. (line 363) * O: three. (line 274) * obj: obj. (line 9) * oblique: three. (line 319) @@ -9293,7 +9323,7 @@ Index * OmitTickInterval: graph. (line 239) * OmitTickIntervals: graph. (line 239) * opacity: Pens. (line 222) -* open: Files. (line 11) +* open: Files. (line 12) * OpenGL: three. (line 127) * operator: User-defined operators. (line 6) @@ -9314,17 +9344,17 @@ Index * outformat: three. (line 127) * outprefix: Frames and pictures. (line 83) * output <1>: Options. (line 143) -* output: Files. (line 35) +* output: Files. (line 36) * OutTicks: graph3. (line 34) * overloading functions: Functions. (line 44) * overwrite: Pens. (line 324) * P: Mathematical functions. (line 48) -* pack: label. (line 102) +* pack: label. (line 101) * packing: Rest arguments. (line 30) -* pair <1>: Data types. (line 41) +* pair <1>: Data types. (line 43) * pair: Tutorial. (line 51) -* pairs: Arrays. (line 248) +* pairs: Arrays. (line 242) * paperheight: Configuring. (line 61) * papertype: Configuring. (line 61) * paperwidth: Configuring. (line 61) @@ -9347,33 +9377,33 @@ Index * pdfviewerOptions: Options. (line 130) * pen: Pens. (line 6) * PenMargin: draw. (line 42) -* PenMargin2: three. (line 559) -* PenMargin3: three. (line 559) +* PenMargin2: three. (line 564) +* PenMargin3: three. (line 564) * PenMargins: draw. (line 42) -* PenMargins2: three. (line 559) -* PenMargins3: three. (line 559) +* PenMargins2: three. (line 564) +* PenMargins3: three. (line 564) * periodic: graph. (line 37) -* perl: LaTeX usage. (line 29) +* perl: LaTeX usage. (line 30) * perpendicular: geometry. (line 6) -* perspective: three. (line 358) +* perspective: three. (line 363) * picture: Frames and pictures. (line 35) * picture alignment: Frames and pictures. (line 209) * piecewisestraight: Paths and guides. (line 81) -* pixel: three. (line 566) +* pixel: three. (line 571) * Pl: Mathematical functions. (line 48) * plain: plain. (line 6) * planar: three. (line 89) * plane: three. (line 301) -* planeproject: three. (line 485) -* point <1>: three. (line 502) +* planeproject: three. (line 490) +* point <1>: three. (line 507) * point: Paths and guides. (line 84) -* polar: Data types. (line 119) +* polar: Data types. (line 121) * polargraph: graph. (line 90) * polygon: graph. (line 484) * pop: Arrays. (line 39) * Portrait: Frames and pictures. (line 95) -* postcontrol <1>: three. (line 502) +* postcontrol <1>: three. (line 507) * postcontrol: Paths and guides. (line 135) * postfix operators: Self & prefix operators. (line 19) @@ -9384,7 +9414,7 @@ Index (line 6) * prc: three. (line 231) * precision: Files. (line 92) -* precontrol <1>: three. (line 502) +* precontrol <1>: three. (line 507) * precontrol: Paths and guides. (line 128) * prefix operators: Self & prefix operators. (line 6) @@ -9399,8 +9429,9 @@ Index * public: Structures. (line 6) * push: Arrays. (line 39) * Python usage: Interactive mode. (line 80) -* quadraticroots: Arrays. (line 315) +* quadraticroots: Arrays. (line 309) * quarticroots: math. (line 22) +* quick reference: Description. (line 80) * quit <1>: Debugger. (line 54) * quit <2>: Interactive mode. (line 59) * quit: Tutorial. (line 37) @@ -9412,56 +9443,57 @@ Index * RadialShadeDraw: Frames and pictures. (line 163) * radians: Mathematical functions. (line 17) -* radius <1>: three. (line 502) +* radius <1>: three. (line 507) * radius: Paths and guides. (line 124) * Rainbow: palette. (line 12) * rand: Mathematical functions. (line 39) * randMax: Mathematical functions. (line 39) -* read: Arrays. (line 391) -* reading: Files. (line 11) -* reading string arrays: Arrays. (line 360) +* read: Arrays. (line 385) +* reading: Files. (line 12) +* reading string arrays: Arrays. (line 354) * readline: Files. (line 134) * real: Data types. (line 33) * realDigits: Data types. (line 33) * realEpsilon: Data types. (line 33) * realMax: Data types. (line 33) * realMin: Data types. (line 33) -* realmult: Data types. (line 95) +* realmult: Data types. (line 97) * rectangle: flowchart. (line 37) * recursion: Functions. (line 88) +* reference: Description. (line 80) * reflect: Transforms. (line 51) -* Relative: label. (line 52) -* relpoint: Paths and guides. (line 162) -* reltime: Paths and guides. (line 158) +* Relative: label. (line 51) +* relpoint: Paths and guides. (line 165) +* reltime: Paths and guides. (line 161) * remainder: Mathematical functions. (line 6) * rename: Files. (line 151) * render <1>: Options. (line 143) * render: three. (line 47) -* replace: Data types. (line 252) +* replace: Data types. (line 254) * resetdefaultpen: Pens. (line 353) * rest arguments: Rest arguments. (line 6) * restore: Frames and pictures. (line 265) * restricted: Structures. (line 6) * return: Debugger. (line 48) -* reverse <1>: three. (line 502) +* reverse <1>: three. (line 507) * reverse <2>: Arrays. (line 146) -* reverse <3>: Paths and guides. (line 169) -* reverse: Data types. (line 248) +* reverse <3>: Paths and guides. (line 172) +* reverse: Data types. (line 250) * rewind: Files. (line 92) -* rfind: Data types. (line 229) +* rfind: Data types. (line 231) * rgb: Pens. (line 30) * Riemann zeta function: Mathematical functions. (line 48) * Right: graph. (line 287) -* RightSide: label. (line 62) +* RightSide: label. (line 61) * RightTicks: graph. (line 161) -* RightView: three. (line 381) -* rotate: three. (line 453) -* Rotate: label. (line 37) -* Rotate(pair z): label. (line 40) +* RightView: three. (line 386) +* rotate: three. (line 458) +* Rotate: label. (line 36) +* Rotate(pair z): label. (line 39) * round: Mathematical functions. (line 26) * roundcap: Pens. (line 129) @@ -9476,13 +9508,13 @@ Index * safe: Options. (line 163) * save: Frames and pictures. (line 262) * saveline: Files. (line 134) -* scale: three. (line 452) +* scale: three. (line 457) * Scale: graph. (line 698) * scale <1>: graph. (line 682) * scale <2>: Transforms. (line 39) * scale: Pens. (line 115) -* Scale: label. (line 46) -* scale3: three. (line 449) +* Scale: label. (line 45) +* scale3: three. (line 454) * scaled graph: graph. (line 663) * scientific graph: graph. (line 396) * scroll: Files. (line 108) @@ -9492,7 +9524,7 @@ Index * secondary axis: graph. (line 813) * secondaryX: graph. (line 813) * secondaryY: graph. (line 813) -* seconds: Data types. (line 300) +* seconds: Data types. (line 306) * seek: Files. (line 92) * seekeof: Files. (line 92) * segment: math. (line 50) @@ -9505,51 +9537,53 @@ Index * sgn: Mathematical functions. (line 26) * shading: fill. (line 32) -* shift <1>: three. (line 437) +* shift <1>: three. (line 442) * shift: Transforms. (line 27) -* Shift: label. (line 34) +* Shift: label. (line 33) * shiftless: Transforms. (line 53) * shipout: Frames and pictures. (line 83) * showtarget: three. (line 338) * Si: Mathematical functions. (line 48) -* signedint: Files. (line 74) +* signedint: Files. (line 75) * SimpleHead: draw. (line 26) * simplex: simplex. (line 6) * simpson: Mathematical functions. - (line 81) + (line 82) * Sin: Mathematical functions. (line 20) * sin: Mathematical functions. (line 6) -* single precision: Files. (line 74) -* singleint: Files. (line 74) -* singlereal: Files. (line 74) +* single precision: Files. (line 75) +* singleint: Files. (line 75) +* singlereal: Files. (line 75) * sinh: Mathematical functions. (line 6) -* SixViews: three. (line 396) -* SixViewsFR: three. (line 396) -* SixViewsUS: three. (line 396) +* SixViews: three. (line 401) +* SixViewsFR: three. (line 401) +* SixViewsUS: three. (line 401) * size <1>: Options. (line 143) -* size <2>: three. (line 502) +* size <2>: three. (line 507) * size <3>: Frames and pictures. (line 43) * size: Paths and guides. (line 70) * size3: three. (line 259) * slant: Transforms. (line 45) -* Slant: label. (line 43) -* sleep: Data types. (line 334) -* slice: Paths and guides. (line 237) +* Slant: label. (line 42) +* sleep: Data types. (line 351) +* slice: Paths and guides. (line 240) * slices: Slices. (line 6) * slide: slide. (line 6) * slope: math. (line 44) * slopefield: slopefield. (line 6) +* sndncn: Mathematical functions. + (line 48) * solid: Pens. (line 95) * solids: solids. (line 9) -* solve: Arrays. (line 284) -* sort: Arrays. (line 190) +* solve: Arrays. (line 278) +* sort: Arrays. (line 184) * Spline <1>: graph3. (line 100) * Spline: graph. (line 34) -* split: Data types. (line 261) +* split: Data types. (line 263) * sqrt: Mathematical functions. (line 6) * squarecap: Pens. (line 129) @@ -9559,27 +9593,27 @@ Index * stack overflow: Functions. (line 88) * static: Static. (line 6) * stats: stats. (line 6) -* stdin: Files. (line 47) -* stdout: Files. (line 47) +* stdin: Files. (line 48) +* stdout: Files. (line 48) * step: Debugger. (line 39) * stickframe: markers. (line 16) * stop: Debugger. (line 10) -* straight: three. (line 502) +* straight: three. (line 507) * Straight: graph. (line 31) * straight: Paths and guides. (line 77) -* strftime: Data types. (line 292) -* string: Data types. (line 179) +* strftime: Data types. (line 298) +* string: Data types. (line 181) * stroke: fill. (line 36) -* strokepath: Paths and guides. (line 294) -* strptime: Data types. (line 300) +* strokepath: Paths and guides. (line 297) +* strptime: Data types. (line 306) * struct: Structures. (line 6) * structures: Structures. (line 6) -* subpath <1>: three. (line 502) -* subpath: Paths and guides. (line 172) +* subpath <1>: three. (line 507) +* subpath: Paths and guides. (line 175) * subpictures: Frames and pictures. (line 103) -* substr: Data types. (line 244) +* substr: Data types. (line 246) * Subversion: Subversion. (line 6) -* sum: Arrays. (line 219) +* sum: Arrays. (line 213) * superpath: Tutorial. (line 134) * Suppress: Pens. (line 331) * SuppressQuiet: Pens. (line 335) @@ -9588,9 +9622,9 @@ Index * SVG: Options. (line 143) * SVN: Subversion. (line 6) * system <1>: Options. (line 163) -* system: Files. (line 159) +* system: Data types. (line 328) * syzygy: syzygy. (line 6) -* tab: Files. (line 60) +* tab: Files. (line 61) * tab completion: Tutorial. (line 37) * Tan: Mathematical functions. (line 20) @@ -9602,17 +9636,17 @@ Index * tell: Files. (line 92) * tension <1>: three. (line 6) * tension: Bezier curves. (line 56) -* tensionSpecifier: Paths and guides. (line 385) +* tensionSpecifier: Paths and guides. (line 388) * tensor product shading: fill. (line 74) * tensorshade: fill. (line 74) * tex <1>: Options. (line 143) * tex: Frames and pictures. (line 278) * TeX fonts: Pens. (line 201) -* TeX string: Data types. (line 179) +* TeX string: Data types. (line 181) * texcommand: Configuring. (line 67) * TeXHead: draw. (line 26) -* TeXHead3: three. (line 543) -* texpath <1>: label. (line 116) +* TeXHead3: three. (line 548) +* texpath <1>: label. (line 115) * texpath: Configuring. (line 67) * texpreamble: Frames and pictures. (line 286) * texreset: Frames and pictures. (line 289) @@ -9623,9 +9657,9 @@ Index * thin: three. (line 110) * this: Structures. (line 6) * three: three. (line 6) -* ThreeViews: three. (line 396) -* ThreeViewsFR: three. (line 396) -* ThreeViewsUS: three. (line 396) +* ThreeViews: three. (line 401) +* ThreeViewsFR: three. (line 401) +* ThreeViewsUS: three. (line 401) * tick: graph. (line 342) * Ticks: graph. (line 161) * ticks: graph. (line 161) @@ -9633,35 +9667,35 @@ Index * tile: Pens. (line 251) * tilings: Pens. (line 238) * time <1>: math. (line 30) -* time: Data types. (line 292) -* times: Paths and guides. (line 206) +* time: Data types. (line 298) +* times: Paths and guides. (line 209) * Top: graph. (line 137) -* TopView: three. (line 381) +* TopView: three. (line 386) * trace: Debugger. (line 51) * trailingzero: graph. (line 175) -* transform <1>: three. (line 477) +* transform <1>: three. (line 482) * transform: Transforms. (line 6) -* transform3: three. (line 432) +* transform3: three. (line 437) * transparency: Pens. (line 222) -* transpose: Arrays. (line 211) +* transpose: Arrays. (line 205) * tree: tree. (line 9) * trembling: trembling. (line 6) * triangle: geometry. (line 6) * triangulate: contour. (line 157) -* tridiagonal: Arrays. (line 272) +* tridiagonal: Arrays. (line 266) * trigonometric integrals: Mathematical functions. (line 48) -* triple: Data types. (line 108) +* triple: Data types. (line 110) * TrueMargin: draw. (line 42) -* TrueMargin3: three. (line 559) +* TrueMargin3: three. (line 564) * tube <1>: tube. (line 6) * tube: three. (line 110) * tutorial: Tutorial. (line 6) * type1cm: Pens. (line 178) * typedef <1>: Functions. (line 36) -* typedef: Data types. (line 344) +* typedef: Data types. (line 361) * U3D: embed. (line 38) -* undefined: Paths and guides. (line 268) +* undefined: Paths and guides. (line 271) * UnFill: Frames and pictures. (line 152) * unfill: fill. (line 106) * UnFill: draw. (line 26) @@ -9669,7 +9703,7 @@ Index * uniform: Arrays. (line 155) * Uninstall: Uninstall. (line 6) * unique: math. (line 64) -* unit: Data types. (line 78) +* unit: Data types. (line 80) * unitbox <1>: three. (line 307) * unitbox: Tutorial. (line 155) * unitcircle <1>: three. (line 274) @@ -9683,13 +9717,13 @@ Index * unpacking: Rest arguments. (line 39) * unravel: Import. (line 30) * up: three. (line 338) -* update: Files. (line 35) +* update: Files. (line 36) * UpsideDown: Frames and pictures. (line 95) * usepackage: Frames and pictures. (line 291) * user coordinates: Tutorial. (line 86) * user-defined operators: User-defined operators. (line 6) -* usleep: Data types. (line 337) +* usleep: Data types. (line 354) * value: math. (line 38) * var: Variable initializers. (line 63) @@ -9697,46 +9731,45 @@ Index (line 6) * vectorfield: graph. (line 975) * vectorfield3: graph3. (line 159) -* vectorization: Arrays. (line 329) +* vectorization: Arrays. (line 323) * verbatim: Frames and pictures. (line 271) * vertex-dependent colors: three. (line 81) * Vertical: flowchart. (line 81) -* viewportheight: LaTeX usage. (line 49) +* viewportheight: LaTeX usage. (line 51) * viewportmargin: three. (line 262) * viewportsize: three. (line 262) -* viewportwidth: LaTeX usage. (line 49) +* viewportwidth: LaTeX usage. (line 51) * views: three. (line 231) * vim: Editing modes. (line 33) * virtual functions: Structures. (line 181) * void: Data types. (line 10) * W: Tutorial. (line 106) -* whatever: Paths and guides. (line 232) +* whatever: Paths and guides. (line 235) * Wheel: palette. (line 22) * wheel mouse: GUI. (line 6) * while: Programming. (line 29) -* white-space string delimiter mode: Arrays. (line 360) -* width: LaTeX usage. (line 49) -* windingnumber: Paths and guides. (line 268) -* word: Arrays. (line 360) -* write <1>: Arrays. (line 400) -* write: Files. (line 52) +* white-space string delimiter mode: Arrays. (line 354) +* width: LaTeX usage. (line 51) +* windingnumber: Paths and guides. (line 271) +* word: Arrays. (line 354) +* write <1>: Arrays. (line 394) +* write: Files. (line 53) * X: three. (line 274) * xasy: GUI. (line 6) * xaxis3: graph3. (line 7) +* xdr: Files. (line 75) * xelatex <1>: Options. (line 143) * xelatex: embed. (line 10) * xequals: graph. (line 294) * XEquals: graph. (line 280) -* xinput: Files. (line 74) * xlimits: graph. (line 636) * XOR: Arithmetic & logical. (line 80) -* xoutput: Files. (line 74) -* xpart: Data types. (line 89) +* xpart: Data types. (line 91) * xscale: Transforms. (line 33) -* xscale3: three. (line 440) +* xscale3: three. (line 445) * xtick: graph. (line 342) -* XY: three. (line 462) +* XY: three. (line 467) * XYEquals: graph3. (line 20) * XYZero: graph3. (line 20) * XZEquals: graph3. (line 20) @@ -9749,12 +9782,12 @@ Index * yequals: graph. (line 294) * YEquals: graph. (line 130) * ylimits: graph. (line 636) -* ypart: Data types. (line 92) +* ypart: Data types. (line 94) * yscale: Transforms. (line 36) -* yscale3: three. (line 443) +* yscale3: three. (line 448) * ytick: graph. (line 342) -* YX: three. (line 477) -* YZ: three. (line 477) +* YX: three. (line 482) +* YZ: three. (line 482) * YZEquals: graph3. (line 20) * YZero: graph. (line 125) * YZZero: graph3. (line 20) @@ -9773,10 +9806,10 @@ Index * zerowinding: Pens. (line 152) * zeta: Mathematical functions. (line 48) -* zpart: Data types. (line 161) -* zscale3: three. (line 446) -* ZX: three. (line 477) -* ZY: three. (line 477) +* zpart: Data types. (line 163) +* zscale3: three. (line 451) +* ZX: three. (line 482) +* ZY: three. (line 482) * |: Arithmetic & logical. (line 62) * ||: Arithmetic & logical. @@ -9787,145 +9820,144 @@ Index Tag Table: Node: Top575 Node: Description6834 -Node: Installation10335 -Node: UNIX binary distributions11388 -Node: MacOS X binary distributions12494 -Node: Microsoft Windows13378 -Ref: psview14088 -Node: Configuring15020 -Node: Search paths19234 -Node: Compiling from UNIX source20031 -Ref: multisampling20620 -Node: Editing modes23026 -Node: Subversion25458 -Node: Uninstall25921 -Node: Tutorial26271 -Ref: unitcircle30569 -Node: Drawing commands32505 -Node: draw34216 -Ref: arrows35364 -Node: fill40607 -Ref: gradient shading41651 -Node: clip45879 -Node: label46471 -Ref: Label47170 -Node: Bezier curves52895 -Node: Programming56472 -Ref: array iteration57286 -Node: Data types58367 -Ref: format67375 -Node: Paths and guides70978 -Ref: circle71232 -Ref: arctime76720 -Ref: extension80575 -Node: Pens87258 -Ref: fillrule94624 -Ref: basealign95521 -Ref: transparency98347 -Ref: makepen101790 -Ref: overwrite102628 -Node: Transforms103838 -Node: Frames and pictures105629 -Ref: envelope106770 -Ref: size107853 -Ref: unitsize108840 -Ref: shipout109900 -Ref: filltype112233 -Ref: add115370 -Ref: add about116316 -Ref: tex119254 -Node: Files120128 -Ref: cd121093 -Ref: scroll125778 -Node: Variable initializers128851 -Node: Structures131576 -Node: Operators139020 -Node: Arithmetic & logical139334 -Node: Self & prefix operators141308 -Node: User-defined operators142096 -Node: Implicit scaling143007 -Node: Functions143570 -Ref: stack overflow146323 -Node: Default arguments146887 -Node: Named arguments147626 -Node: Rest arguments150197 -Node: Mathematical functions153318 -Node: Arrays157925 -Ref: sort165013 -Ref: tridiagonal167417 -Ref: solve168645 -Node: Slices172838 -Node: Casts176728 -Node: Import178693 -Node: Static183920 -Node: LaTeX usage186814 -Node: Base modules193031 -Node: plain195531 -Node: simplex196183 -Node: math196456 -Node: interpolate199161 -Node: geometry199440 -Node: trembling200034 -Node: stats200385 -Node: patterns200645 -Node: markers200881 -Node: tree202664 -Node: binarytree202852 -Node: drawtree203441 -Node: syzygy203645 -Node: feynman203919 -Node: roundedpath204194 -Node: animation204477 -Ref: animate204894 -Node: embed206033 -Node: slide207636 -Node: MetaPost207976 -Node: unicode208692 -Node: latin1209580 -Node: babel209948 -Node: labelpath210177 -Node: labelpath3210997 -Node: annotate211308 -Node: CAD211779 -Node: graph212089 -Ref: ticks219218 -Ref: pathmarkers232497 -Ref: marker232962 -Ref: markuniform233313 -Ref: errorbars235104 -Ref: automatic scaling239160 -Node: palette249806 -Ref: images249924 -Ref: image254096 -Ref: logimage254574 -Ref: penimage255635 -Ref: penfunctionimage255856 -Node: three256580 -Ref: PostScript3D281322 -Node: obj283014 -Node: graph3283266 -Ref: GaussianSurface288391 -Node: grid3289495 -Node: solids290235 -Node: tube291183 -Node: flowchart293418 -Node: contour297987 -Node: contour3303112 -Node: slopefield303419 -Node: ode304856 -Node: Options305116 -Ref: configuration file311104 -Ref: settings311104 -Ref: convert312305 -Node: Interactive mode315272 -Ref: history317425 -Node: GUI318730 -Node: GUI installation319233 -Node: GUI usage320363 -Node: PostScript to Asymptote321266 -Node: Help322022 -Node: Debugger323758 -Node: Credits325543 -Node: Index326475 +Node: Installation10450 +Node: UNIX binary distributions11503 +Node: MacOS X binary distributions12609 +Node: Microsoft Windows13493 +Ref: psview14203 +Node: Configuring15135 +Node: Search paths19349 +Node: Compiling from UNIX source20191 +Ref: multisampling20781 +Node: Editing modes23176 +Node: Subversion25608 +Node: Uninstall26071 +Node: Tutorial26421 +Ref: unitcircle30719 +Node: Drawing commands32655 +Node: draw34366 +Ref: arrows35514 +Node: fill40757 +Ref: gradient shading41801 +Node: clip46029 +Node: label46621 +Ref: Label47219 +Node: Bezier curves53022 +Node: Programming56599 +Ref: array iteration57413 +Node: Data types58494 +Ref: format67691 +Node: Paths and guides71944 +Ref: circle72198 +Ref: extension81622 +Node: Pens88305 +Ref: fillrule95673 +Ref: basealign96570 +Ref: transparency99396 +Ref: makepen102839 +Ref: overwrite103677 +Node: Transforms104887 +Node: Frames and pictures106678 +Ref: envelope107819 +Ref: size108902 +Ref: unitsize109889 +Ref: shipout110949 +Ref: filltype113282 +Ref: add116419 +Ref: add about117365 +Ref: tex120303 +Node: Files121177 +Ref: cd122160 +Ref: scroll126834 +Node: Variable initializers129749 +Node: Structures132474 +Node: Operators139918 +Node: Arithmetic & logical140232 +Node: Self & prefix operators142205 +Node: User-defined operators142993 +Node: Implicit scaling143904 +Node: Functions144467 +Ref: stack overflow147220 +Node: Default arguments147784 +Node: Named arguments148523 +Node: Rest arguments151094 +Node: Mathematical functions154215 +Node: Arrays158880 +Ref: sort165869 +Ref: tridiagonal168273 +Ref: solve169501 +Node: Slices173694 +Node: Casts177584 +Node: Import179549 +Node: Static184786 +Node: LaTeX usage187680 +Node: Base modules194092 +Node: plain196592 +Node: simplex197244 +Node: math197517 +Node: interpolate200222 +Node: geometry200501 +Node: trembling201095 +Node: stats201446 +Node: patterns201706 +Node: markers201942 +Node: tree203725 +Node: binarytree203913 +Node: drawtree204502 +Node: syzygy204706 +Node: feynman204980 +Node: roundedpath205255 +Node: animation205538 +Ref: animate205958 +Node: embed207097 +Node: slide208700 +Node: MetaPost209040 +Node: unicode209756 +Node: latin1210644 +Node: babel211012 +Node: labelpath211241 +Node: labelpath3212061 +Node: annotate212372 +Node: CAD212843 +Node: graph213153 +Ref: ticks220282 +Ref: pathmarkers233576 +Ref: marker234041 +Ref: markuniform234392 +Ref: errorbars236183 +Ref: automatic scaling240239 +Node: palette250885 +Ref: images251003 +Ref: image255175 +Ref: logimage255653 +Ref: penimage256714 +Ref: penfunctionimage256935 +Node: three257659 +Ref: PostScript3D282639 +Node: obj284331 +Node: graph3284583 +Ref: GaussianSurface289708 +Node: grid3290812 +Node: solids291552 +Node: tube292500 +Node: flowchart294735 +Node: contour299304 +Node: contour3304429 +Node: slopefield304736 +Node: ode306173 +Node: Options306433 +Ref: configuration file312421 +Ref: settings312421 +Ref: convert313622 +Node: Interactive mode316589 +Ref: history318742 +Node: GUI320047 +Node: GUI installation320550 +Node: GUI usage321680 +Node: PostScript to Asymptote322583 +Node: Help323339 +Node: Debugger325075 +Node: Credits326860 +Node: Index327792 End Tag Table diff --git a/Build/source/utils/asymptote/drawelement.h b/Build/source/utils/asymptote/drawelement.h index 27eecdc488a..618da860ee4 100644 --- a/Build/source/utils/asymptote/drawelement.h +++ b/Build/source/utils/asymptote/drawelement.h @@ -18,12 +18,7 @@ #include "texfile.h" #include "prcfile.h" #include "glrender.h" - -namespace run { -template<class T> -extern void copyArrayC(T* &dest, const vm::array *a, size_t dim, - GCPlacement placement); -} +#include "arrayop.h" namespace camp { @@ -196,7 +191,7 @@ public: b += p.bounds(); } - virtual void writepath(psfile *out) { + virtual void writepath(psfile *out,bool) { out->write(p); } diff --git a/Build/source/utils/asymptote/drawfill.cc b/Build/source/utils/asymptote/drawfill.cc index 0353ae2c405..9dc1dbc8767 100644 --- a/Build/source/utils/asymptote/drawfill.cc +++ b/Build/source/utils/asymptote/drawfill.cc @@ -150,7 +150,8 @@ bool drawFunctionShade::write(texfile *out, const bbox& box) out->write(shift(pair(-Hoffset,-box.bottom))*matrix(bpath.Min(),bpath.Max())); out->verbatimline("]"); out->verbatim("/Domain [0 1 0 1]"); - out->verbatimline("/ColorSpace /Device"+ColorDeviceSuffix[colorspace]); + out->verbatim("/ColorSpace /Device"); + out->verbatimline(ColorDeviceSuffix[colorspace]); out->verbatimline("/Function \\lastobj\\space 0 R >> >>}\\ASYbox"); out->verbatimline("\\pdfrefxform\\the\\pdflastxform"); diff --git a/Build/source/utils/asymptote/drawimage.h b/Build/source/utils/asymptote/drawimage.h index 09cf1aaf6ba..e73e00e01a1 100644 --- a/Build/source/utils/asymptote/drawimage.h +++ b/Build/source/utils/asymptote/drawimage.h @@ -79,14 +79,13 @@ public: }; class drawFunctionImage : public drawImage { - vm::array image; vm::stack *Stack; vm::callable *f; Int width, height; public: drawFunctionImage(vm::stack *Stack, vm::callable *f, Int width, Int height, const transform& t, bool antialias) - : drawImage(t,antialias), image(image), Stack(Stack), f(f), + : drawImage(t,antialias), Stack(Stack), f(f), width(width), height(height) {} virtual ~drawFunctionImage() {} diff --git a/Build/source/utils/asymptote/drawlabel.cc b/Build/source/utils/asymptote/drawlabel.cc index c9cb8636e82..5f009e1087f 100644 --- a/Build/source/utils/asymptote/drawlabel.cc +++ b/Build/source/utils/asymptote/drawlabel.cc @@ -17,7 +17,6 @@ using namespace settings; namespace camp { string texready=string("(Please type a command or say `\\end')\n*"); -pen drawElement::lastpen; void drawLabel::labelwarning(const char *action) { diff --git a/Build/source/utils/asymptote/drawpath3.h b/Build/source/utils/asymptote/drawpath3.h index ef49ba74bc4..721cf177ca1 100644 --- a/Build/source/utils/asymptote/drawpath3.h +++ b/Build/source/utils/asymptote/drawpath3.h @@ -28,7 +28,7 @@ public: Min(g.min()), Max(g.max()) {} drawPath3(const vm::array& t, const drawPath3 *s) : - g(camp::transformed(t,s->g)), center(center), straight(s->straight), + g(camp::transformed(t,s->g)), straight(s->straight), color(s->color), invisible(s->invisible), interaction(s->interaction), Min(g.min()), Max(g.max()) { center=run::operator *(t,s->center); diff --git a/Build/source/utils/asymptote/drawsurface.cc b/Build/source/utils/asymptote/drawsurface.cc index dcf05c509fc..bc9705e58b0 100644 --- a/Build/source/utils/asymptote/drawsurface.cc +++ b/Build/source/utils/asymptote/drawsurface.cc @@ -222,8 +222,8 @@ void drawSurface::render(GLUnurbs *nurb, double size2, static GLfloat v1[16]; static GLfloat v2[16]; - bool havebillboard=interaction == BILLBOARD; - + bool havebillboard=interaction == BILLBOARD && + !settings::getSetting<bool>("offscreen"); triple m,M; if(perspective || !havebillboard) { initMatrix(v1,v2); diff --git a/Build/source/utils/asymptote/errormsg.cc b/Build/source/utils/asymptote/errormsg.cc index 249e26dfb1a..a2b62c7fadd 100644 --- a/Build/source/utils/asymptote/errormsg.cc +++ b/Build/source/utils/asymptote/errormsg.cc @@ -10,6 +10,7 @@ #include "errormsg.h" +errorstream em; position nullPos; static nullPosInitializer nullPosInit; diff --git a/Build/source/utils/asymptote/errors b/Build/source/utils/asymptote/errors index 8e84f4d4d9e..d9b46b6ed9c 100644 --- a/Build/source/utils/asymptote/errors +++ b/Build/source/utils/asymptote/errors @@ -1,6 +1,6 @@ -errortest.asy: 476.34: argument after rest argument +errortest.asy: 476.34: unnamed argument after rest argument errortest.asy: 477.37: additional rest argument -errortest.asy: 478.28: argument after rest argument +errortest.asy: 478.28: unnamed argument after rest argument errortest.asy: 479.31: additional rest argument errortest.asy: 482.22: normal parameter after rest parameter errortest.asy: 483.22: normal parameter after rest parameter @@ -155,7 +155,3 @@ 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 errortest.asy: 470.7: array expression cannot be used as an address -errortest.asy: 476.4: cannot call -'int f(string s=<default> ... int[] a)' -with parameters -'(int, int, int, string ... int[])' diff --git a/Build/source/utils/asymptote/examples/animations/earthmoon.asy b/Build/source/utils/asymptote/examples/animations/earthmoon.asy index 08c578d86d2..efca043b8bc 100644 --- a/Build/source/utils/asymptote/examples/animations/earthmoon.asy +++ b/Build/source/utils/asymptote/examples/animations/earthmoon.asy @@ -62,7 +62,7 @@ draw(pic,shift(cst,0,0)*scale3(Rtl/2)*unitsphere,yellow); surface terre=scale3(Rtl/5)*unitsphere; surface lune=scale3(Rl)*unitsphere; -int n=100; +int n=50; real step=2pi/n; for(int i=0; i < n; ++i) { diff --git a/Build/source/utils/asymptote/examples/animations/sphere.asy b/Build/source/utils/asymptote/examples/animations/sphere.asy index 56c5f73e3b6..125cecc5566 100644 --- a/Build/source/utils/asymptote/examples/animations/sphere.asy +++ b/Build/source/utils/asymptote/examples/animations/sphere.asy @@ -22,11 +22,7 @@ for(int i=0; i < nbpts; ++i) { transform3 t=rotate(angle,(0,0,0),(1,0.25,0.25)); revolution r=sphere(O,3); draw(surface(r),lightgrey); -skeleton s; -r.transverse(s,reltime(r.g,0.5)); -r.longitudinal(s); -draw(s.transverse.back,linetype("8 8",8)); -draw(s.transverse.front); +draw(r,backpen=linetype("8 8",8)); animation A; diff --git a/Build/source/utils/asymptote/examples/animations/wheel.asy b/Build/source/utils/asymptote/examples/animations/wheel.asy index 2ea45f75613..6620d590850 100644 --- a/Build/source/utils/asymptote/examples/animations/wheel.asy +++ b/Build/source/utils/asymptote/examples/animations/wheel.asy @@ -1,4 +1,9 @@ import graph; + +// Uncomment the following 2 lines to support pdf animations: +// usepackage("animate"); +// settings.tex="pdflatex"; + import animation; size(0,200); @@ -24,6 +29,8 @@ guide wheel(guide g=nullpath, real a, real b, int n) real t1=0; real t2=t1+2*pi; +animation a; + draw(circle((0,0),1)); draw(wheel(t1,t2,100),linetype("0 2")); yequals(Label("$y=-1$",1.0),-1,extend=true,linetype("4 4")); @@ -34,8 +41,6 @@ pair z2=wheelpoint(t2); dot(z1); dot(z2); -animation a; - int n=10; real dt=(t2-t1)/n; for(int i=0; i <= n; ++i) { @@ -49,5 +54,10 @@ for(int i=0; i <= n; ++i) { restore(); } -// Produce the final merged gif. +erase(); + +// Merge the images into a gif animation. a.movie(BBox(0.25cm),loops=10,delay=250); + +// Merge the images into a pdf animation. +// label(a.pdf(BBox(0.25cm),delay=250,"controls",multipage=false)); diff --git a/Build/source/utils/asymptote/examples/electromagnetic.asy b/Build/source/utils/asymptote/examples/electromagnetic.asy index 058c7c5c574..d229f76b748 100644 --- a/Build/source/utils/asymptote/examples/electromagnetic.asy +++ b/Build/source/utils/asymptote/examples/electromagnetic.asy @@ -33,15 +33,15 @@ picture q=secondaryX(new void(picture p) { scale(p,LogLeft,Linear); xlimits(p,lambda(fmax),lambda(fmin)); ylimits(p,0,1); - xaxis(p,Label("\nano\metre",1),Top,LeftTicks(DefaultLogFormat,n=10)); + xaxis(p,Label("\nano\metre",1,0.01N),Top,LeftTicks(DefaultLogFormat,n=10)); }); add(q,above=true); margin margin=PenMargin(0,0); -draw("radio",Scale((10,1))--Scale((5e12,1)),N,Arrow); -draw("infrared",Scale((1e12,1.5))--Scale(shift(0,1.5)*ir),Arrows,margin); -draw("UV",Scale(shift(0,1.5)*uv)--Scale((1e17,1.5)),Arrows,margin); -draw("x-rays",Scale((1e16,1))--Scale((1e21,1)),N,Arrows); -draw("$\gamma$-rays",Scale((fmax,1.5))--Scale((2e18,1.5)),Arrow); +draw("radio",Scale((10,1))--Scale((5e12,1)),S,Arrow); +draw("infrared",Scale((1e12,1.75))--Scale(shift(0,1.75)*ir),LeftSide,Arrows,margin); +draw("UV",Scale(shift(0,1.75)*uv)--Scale((1e17,1.76)),LeftSide,Arrows,margin); +draw("x-rays",Scale((1e16,1))--Scale((1e21,1)),RightSide,Arrows); +draw("$\gamma$-rays",Scale((fmax,1.75))--Scale((2e18,1.75)),Arrow); diff --git a/Build/source/utils/asymptote/examples/hyperboloid.asy b/Build/source/utils/asymptote/examples/hyperboloid.asy index 0cf6da08c40..22f3b3d80b0 100644 --- a/Build/source/utils/asymptote/examples/hyperboloid.asy +++ b/Build/source/utils/asymptote/examples/hyperboloid.asy @@ -2,7 +2,7 @@ size(200); import solids; currentprojection=perspective(4,4,3); -revolution hyperboloid=revolution(new real(real x) {return sqrt(1+x*x);}, - -2,2,20,operator..,X); +revolution hyperboloid=revolution(graph(new triple(real z) { + return (sqrt(1+z*z),0,z);},-2,2,20,operator ..),axis=Z); draw(surface(hyperboloid),green,render(compression=Low,merge=true)); draw(hyperboloid,6,blue,longitudinalpen=nullpen); diff --git a/Build/source/utils/asymptote/examples/hyperboloidsilhouette.asy b/Build/source/utils/asymptote/examples/hyperboloidsilhouette.asy index 1187208a670..1bb265de622 100644 --- a/Build/source/utils/asymptote/examples/hyperboloidsilhouette.asy +++ b/Build/source/utils/asymptote/examples/hyperboloidsilhouette.asy @@ -4,6 +4,6 @@ settings.render=0; settings.prc=false; currentprojection=perspective(4,4,3); -revolution hyperboloid=revolution(new real(real x) {return sqrt(1+x*x);}, - -2,2,20,operator..,X); +revolution hyperboloid=revolution(graph(new triple(real z) { + return (sqrt(1+z*z),0,z);},-2,2,20,operator ..),axis=Z); draw(hyperboloid.silhouette(64),blue); diff --git a/Build/source/utils/asymptote/examples/pseudosphere.asy b/Build/source/utils/asymptote/examples/pseudosphere.asy new file mode 100644 index 00000000000..a740381ef0e --- /dev/null +++ b/Build/source/utils/asymptote/examples/pseudosphere.asy @@ -0,0 +1,33 @@ +// Pseudosphere: +// x = a sin(u) cos(v); +// y = a sin(u) sin(v); +// z = a (ln(tg(u/2))+cos(u)); + +import three; +import solids; +import graph3; +import palette; + +triple pseudosphere(real x) { + return (sin(x),0,cos(x)+log(tan(x/2))); +} + +size(20cm,IgnoreAspect); +currentprojection=orthographic(160,40,100); +currentlight=(50,50,50); + +path3 G=graph(pseudosphere,0.5pi,0.965pi,10,Spline); + +revolution r=revolution(O,G,Z); + +draw(r,1,longitudinalpen=nullpen); +surface s=surface(r); +s.colors(palette(s.map(zpart),Gradient(cyan+white+opacity(0.9), + magenta+white+opacity(0.9)))); +draw(s); + +draw(r,6,backpen=linetype("10 10",10),longitudinalpen=nullpen); + +int n=10; +for(int i=0; i < n; ++i) + draw(rotate(i*360/n,O,Z)*G); diff --git a/Build/source/utils/asymptote/examples/ring.asy b/Build/source/utils/asymptote/examples/ring.asy index 6963d42d23f..5fec60d4c0b 100644 --- a/Build/source/utils/asymptote/examples/ring.asy +++ b/Build/source/utils/asymptote/examples/ring.asy @@ -1,5 +1,4 @@ size(0,100); -path unitcircle=E..N..W..S..cycle; path g=scale(2)*unitcircle; label("$a \le r \le b$"); radialshade(unitcircle^^g,yellow+evenodd,(0,0),1.0,yellow+brown,(0,0),2); diff --git a/Build/source/utils/asymptote/examples/splitpatch.asy b/Build/source/utils/asymptote/examples/splitpatch.asy index f1f5b6b98ba..2e9fae66431 100644 --- a/Build/source/utils/asymptote/examples/splitpatch.asy +++ b/Build/source/utils/asymptote/examples/splitpatch.asy @@ -2,6 +2,64 @@ import three; size(300); +// A structure to subdivide two intersecting patches about their intersection. +struct split +{ + surface[] S=sequence(new surface(int i) {return new surface;},1); + surface[] T=sequence(new surface(int i) {return new surface;},1); + + struct tree { + tree[] tree=new tree[2]; + } + // Default subdivision depth. + int n=20; + + // Subdivide p and q to depth n if they overlap. + void write(tree pt, tree qt, triple[][] p, triple[][] q, int depth=n) { + --depth; + triple[][][] Split(triple[][] P)=depth % 2 == 0 ? hsplit : vsplit; + triple[][][] P=Split(p); + triple[][][] Q=Split(q); + + for(int i=0; i < 2; ++i) { + triple[][] Pi=P[i]; + for(int j=0; j < 2; ++j) { + triple[][] Qj=Q[j]; + if(overlap(Pi,Qj)) { + if(!pt.tree.initialized(i)) + pt.tree[i]=new tree; + if(!qt.tree.initialized(j)) + qt.tree[j]=new tree; + if(depth > 0) + write(pt.tree[i],qt.tree[j],Pi,Qj,depth); + } + } + } + } + + // Output the subpatches of p from subdivision. + void read(surface[] S, tree t, triple[][] p, int depth=n) { + --depth; + triple[][][] Split(triple[][] P)=depth % 2 == 0 ? hsplit : vsplit; + triple[][][] P=Split(p); + + for(int i=0; i < 2; ++i) { + if(t.tree.initialized(i)) + read(S,t.tree[i],P[i],depth); + else { + S[0].push(patch(P[i])); + } + } + } + + void operator init(triple[][] p, triple[][] q, int depth=n) { + tree ptrunk,qtrunk; + write(ptrunk,qtrunk,p,q,depth); + read(T,ptrunk,p,depth); + read(S,qtrunk,q,depth); + } +} + currentprojection=orthographic(0,0,1); triple[][] A={ @@ -18,11 +76,12 @@ triple[][] B={ {(0.5,0,2),(0.5,1,2),(0.5,2,2),(0.5,3,2)} }; -split S=split(A,B,10); -//write(S.T.length); +split S=split(B,A); defaultrender.merge=true; -for(int i=0; i < S.T.length; ++i) - draw(surface(patch(S.T[i])),Pen(i)); -draw(surface(patch(B)),blue); +for(int i=0; i < S.S[0].s.length; ++i) + draw(surface(S.S[0].s[i]),Pen(i)); + +for(int i=0; i < S.T[0].s.length; ++i) + draw(surface(S.T[0].s[i]),Pen(i)); diff --git a/Build/source/utils/asymptote/exp.h b/Build/source/utils/asymptote/exp.h index 38a72cba7f5..af24523b6df 100644 --- a/Build/source/utils/asymptote/exp.h +++ b/Build/source/utils/asymptote/exp.h @@ -21,7 +21,7 @@ namespace trans { class coenv; class coder; -class label_t; +struct label_t; typedef label_t *label; class application; @@ -661,11 +661,18 @@ struct argument { class arglist : public gc { public: typedef mem::vector<argument> argvector; + argvector args; argument rest; + // As the language allows named arguments after rest arguments, store the + // index of the rest argument in order to ensure proper left-to-right + // execution. + static const size_t DUMMY_REST_POSITION = 9999; + size_t restPosition; + arglist() - : args(), rest() {} + : args(), rest(), restPosition(DUMMY_REST_POSITION) {} virtual ~arglist() {} @@ -679,11 +686,10 @@ public: } virtual void add(argument a) { - if (rest.val) { - // TODO: Handle keyword arguments after rest with proper left-to-right - // ordering. + if (rest.val && !a.name) { em.error(a.val->getPos()); - em << "argument after rest argument"; + em << "unnamed argument after rest argument"; + return; } args.push_back(a); } @@ -697,8 +703,13 @@ public: if (rest.val) { em.error(a.val->getPos()); em << "additional rest argument"; + return; } + rest = a; + + assert(restPosition == DUMMY_REST_POSITION); + restPosition = size(); } virtual void prettyprint(ostream &out, Int indent); diff --git a/Build/source/utils/asymptote/fileio.cc b/Build/source/utils/asymptote/fileio.cc index 13a2e2b27ff..913ad95c17e 100644 --- a/Build/source/utils/asymptote/fileio.cc +++ b/Build/source/utils/asymptote/fileio.cc @@ -10,6 +10,8 @@ namespace camp { +FILE *pipeout=NULL; + string tab="\t"; string newline="\n"; diff --git a/Build/source/utils/asymptote/fileio.h b/Build/source/utils/asymptote/fileio.h index 6cc87c4ca0d..5638047a0c2 100644 --- a/Build/source/utils/asymptote/fileio.h +++ b/Build/source/utils/asymptote/fileio.h @@ -39,12 +39,27 @@ extern string tab; extern string newline; enum Mode {NOMODE,INPUT,OUTPUT,UPDATE,BINPUT,BOUTPUT,BUPDATE,XINPUT,XOUTPUT, - XUPDATE}; + XUPDATE,OPIPE}; -static const string FileModes[]={"none", - "input","output","ouptut(update=false)", - "binput","boutput","boutput(update=false)", - "xinput","xoutput","xoutput(update=false)"}; +static const string FileModes[]= +{"none","input","output","output(update)", + "input(binary)","output(binary)","output(binary,update)", + "input(xdr)","output(xdr)","output(xdr,update)","output(pipe)"}; + +extern FILE *pipeout; + +inline void openpipeout() +{ + int fd=settings::getSetting<Int>("outpipe"); + if(!pipeout) { + if(fd >= 0) pipeout=fdopen(intcast(fd),"w"); + } + if(!pipeout) { + ostringstream buf; + buf << "Cannot open outpipe " << fd; + reportError(buf); + } +} class file : public gc { protected: @@ -113,7 +128,7 @@ public: void Check() { if(error()) { ostringstream buf; - buf << "Cannot open file \"" << name << "\"."; + buf << "Cannot open file \"" << name << "\""; reportError(buf); } } @@ -124,8 +139,8 @@ public: if(closed) { ostringstream buf; buf << "I/O operation attempted on "; - if(name != "") buf << "closed file \'" << name << "\'."; - else buf << "null file."; + if(name != "") buf << "closed file \'" << name << "\'"; + else buf << "null file"; reportError(buf); } return true; @@ -149,7 +164,7 @@ public: void unsupported(const char *rw, const char *type) { ostringstream buf; buf << rw << " of type " << type << " not supported in " << FileMode() - << " mode."; + << " mode"; reportError(buf); } @@ -232,6 +247,86 @@ public: bool SignedInt() {return signedint;} }; +class opipe : public file { +public: + opipe(const string& name) : file(name,false,OPIPE) {} + + void open() { + openpipeout(); + } + + bool text() {return true;} + bool eof() {return pipeout ? feof(pipeout) : true;} + bool error() {return pipeout ? ferror(pipeout) : true;} + void clear() {if(pipeout) clearerr(pipeout);} + void flush() {if(pipeout) fflush(pipeout);} + + void seek(Int pos, bool begin=true) { + if(!standard && pipeout) { + clear(); + fseek(pipeout,pos,begin ? SEEK_SET : SEEK_END); + } + } + + size_t tell() { + return pipeout ? ftell(pipeout) : 0; + } + + void write(const string& val) { + fprintf(pipeout,"%s",val.c_str()); + } + + void write(bool val) { + ostringstream s; + s << val; + write(s.str()); + } + + void write(Int val) { + ostringstream s; + s << val; + write(s.str()); + } + void write(double val) { + ostringstream s; + s << val; + write(s.str()); + } + void write(const pair& val) { + ostringstream s; + s << val; + write(s.str()); + } + void write(const triple& val) { + ostringstream s; + s << val; + write(s.str()); + } + + void write(const pen &val) { + ostringstream s; + s << val; + write(s.str()); + } + + void write(guide *val) { + ostringstream s; + s << *val; + write(s.str()); + } + + void write(const transform& val) { + ostringstream s; + s << val; + write(s.str()); + } + + void writeline() { + fprintf(pipeout,"\n"); + if(errorstream::interrupt) throw interrupted(); + } +}; + class ifile : public file { protected: istream *stream; @@ -443,7 +538,7 @@ public: } } void Read(char& val) {iread(val);} - void Read(string& val) {iread(val);} + void Read(string& val) {char c; iread(c); val=c;} void Read(double& val) { if(singlereal) {float fval; iread(fval); val=fval;} diff --git a/Build/source/utils/asymptote/genv.cc b/Build/source/utils/asymptote/genv.cc index ba0aea10d2f..396cf63d366 100644 --- a/Build/source/utils/asymptote/genv.cc +++ b/Build/source/utils/asymptote/genv.cc @@ -33,6 +33,8 @@ using namespace types; using settings::getSetting; using settings::Setting; +// Dynamic loading of external libraries. +types::record *transExternalModule(trans::genv& ge, string filename, symbol id); namespace trans { @@ -57,7 +59,19 @@ genv::genv() #endif } +bool endswith(string suffix, string str) +{ + return std::equal(suffix.rbegin(), suffix.rend(), str.rbegin()); +} + record *genv::loadModule(symbol id, string filename) { + // Hackish way to load an external library. +#if 0 + if (endswith(".so", filename)) { + return transExternalModule(*this, filename, id); + } +#endif + // Get the abstract syntax tree. absyntax::file *ast = parser::parseFile(filename,"Loading"); diff --git a/Build/source/utils/asymptote/glrender.cc b/Build/source/utils/asymptote/glrender.cc index d80c52505a0..bc5a333f0d4 100644 --- a/Build/source/utils/asymptote/glrender.cc +++ b/Build/source/utils/asymptote/glrender.cc @@ -14,7 +14,7 @@ #ifdef HAVE_GL #ifdef HAVE_LIBGLUT -#ifdef __CYGWIN__ +#ifdef __MSDOS__ #ifndef FGAPI #define FGAPI GLUTAPI #endif @@ -151,7 +151,7 @@ OSMesaContext ctx; unsigned char *osmesa_buffer; #endif -#ifdef HAVE_LIBPTHREAD +#ifdef HAVE_PTHREAD pthread_t mainthread; pthread_cond_t initSignal=PTHREAD_COND_INITIALIZER; @@ -287,7 +287,7 @@ void setProjection() void drawscene(double Width, double Height) { -#ifdef HAVE_LIBPTHREAD +#ifdef HAVE_PTHREAD static bool first=true; if(glthread && first && !getSetting<bool>("offscreen")) { wait(initSignal,initLock); @@ -385,7 +385,7 @@ void Export() glutPostRedisplay(); #endif -#ifdef HAVE_LIBPTHREAD +#ifdef HAVE_PTHREAD if(glthread && readyAfterExport && !offscreen) { readyAfterExport=false; endwait(readySignal,readyLock); @@ -433,7 +433,7 @@ void quit() Setting("interrupt")=true; home(); Animate=getSetting<bool>("autoplay"); -#ifdef HAVE_LIBPTHREAD +#ifdef HAVE_PTHREAD if(!interact::interactive || animating) endwait(readySignal,readyLock); #endif @@ -559,7 +559,7 @@ void fullscreen(bool reposition=true) Width=screenWidth; Height=screenHeight; reshape0(Width,Height); -#ifdef __CYGWIN__ +#ifdef __MSDOS__ glutFullScreen(); #else if(reposition) @@ -666,7 +666,9 @@ void screen() void nextframe(int) { glFinish(); +#ifdef HAVE_PTHREAD endwait(readySignal,readyLock); +#endif double framedelay=getSetting<double>("framedelay"); if(framedelay > 0) usleep((unsigned int) (1000.0*framedelay+0.5)); @@ -681,7 +683,7 @@ void display() } drawscene(Width,Height); glutSwapBuffers(); -#ifdef HAVE_LIBPTHREAD +#ifdef HAVE_PTHREAD if(glthread && Animate) { queueExport=false; double delay=1.0/getSetting<double>("framerate"); @@ -927,7 +929,7 @@ string action(int button, int mod) Mod=nMods; } - if(Button >= 0 && Button < nButtons) { + if(Button < nButtons) { array *left=getSetting<array *>("leftbutton"); array *middle=getSetting<array *>("middlebutton"); array *right=getSetting<array *>("rightbutton"); @@ -936,7 +938,7 @@ string action(int button, int mod) array *Buttons[]={left,middle,right,wheelup,wheeldown}; array *a=Buttons[button]; size_t size=checkArray(a); - if(Mod >= 0 && Mod < size) + if(Mod < size) return read<string>(a,Mod); } return ""; @@ -1356,10 +1358,12 @@ void glrender(const string& prefix, const picture *pic, const string& format, { bool offscreen=getSetting<bool>("offscreen"); -#ifndef __CYGWIN__ +#ifndef __MSDOS__ Iconify=getSetting<bool>("iconify"); #endif +#ifdef HAVE_PTHREAD static bool initializedView=false; +#endif width=max(width,1.0); height=max(height,1.0); @@ -1485,7 +1489,7 @@ void glrender(const string& prefix, const picture *pic, const string& format, size_t nbuttons=sizeof(buttons)/sizeof(int); #endif -#ifdef HAVE_LIBPTHREAD +#ifdef HAVE_PTHREAD if(glthread && initializedView && !offscreen) { if(!View) readyAfterExport=queueExport=true; @@ -1621,7 +1625,9 @@ void glrender(const string& prefix, const picture *pic, const string& format, if(View && !offscreen) { #ifdef HAVE_LIBGLUT +#ifdef HAVE_PTHREAD initializedView=true; +#endif glutReshapeFunc(reshape); glutDisplayFunc(display); glutKeyboardFunc(keyboard); @@ -1654,7 +1660,9 @@ void glrender(const string& prefix, const picture *pic, const string& format, if(glthread && !offscreen) { if(havewindow) { readyAfterExport=true; +#ifdef HAVE_PTHREAD pthread_kill(mainthread,SIGUSR1); +#endif } else { initialized=true; readyAfterExport=true; diff --git a/Build/source/utils/asymptote/gsl.cc b/Build/source/utils/asymptote/gsl.cc index 0eb8c2590ba..cfb6a5a3785 100644 --- a/Build/source/utils/asymptote/gsl.cc +++ b/Build/source/utils/asymptote/gsl.cc @@ -48,6 +48,7 @@ using types::realArray; using types::stringArray; using vm::stack; +using vm::array; using vm::pop; using vm::error; using run::copyArrayC; @@ -558,21 +559,21 @@ void GSLrngInit(stack *s) void GSLrngList(stack *s) { - vm::array* a = new vm::array(0); + array* a = new array(0); const gsl_rng_type **t; for(t=GSLrngFirstType; *t!=0; ++t) { a->push(string((*t)->name)); } - s->push<vm::array*>(a); + s->push<array*>(a); checkGSLerror(); } void GSLrngSet(stack *s) { - unsigned long int i = unsignedcast(pop<Int>(s,-1)); + Int i=pop<Int>(s,-1); checkGSLrng(); - if(i<0) gsl_rng_set(GSLrng,gsl_rng_default_seed); - else gsl_rng_set(GSLrng,i); + if(i < 0) gsl_rng_set(GSLrng,gsl_rng_default_seed); + else gsl_rng_set(GSLrng,unsignedcast(i)); checkGSLerror(); } @@ -873,21 +874,21 @@ void GSLrng_dir(stack *s) checkGSLrng(); double* p = new double[n]; gsl_ran_dir_nd(GSLrng,n,p); - s->push<vm::array*>(copyCArray(n,p)); + s->push<array*>(copyCArray(n,p)); delete[] p; checkGSLerror(); } void GSLrng_dirichlet(stack *s) { - vm::array* alpha = pop<vm::array*>(s); + array* alpha = pop<array*>(s); size_t K = checkArray(alpha); checkGSLrng(); double* calpha; copyArrayC(calpha,alpha); double* ctheta = new double[K]; gsl_ran_dirichlet(GSLrng,K,calpha,ctheta); - s->push<vm::array*>(copyCArray(K,ctheta)); + s->push<array*>(copyCArray(K,ctheta)); delete[] ctheta; delete[] calpha; checkGSLerror(); @@ -895,8 +896,8 @@ void GSLrng_dirichlet(stack *s) void GSLpdf_dirichlet(stack *s) { - vm::array* theta = pop<vm::array*>(s); - vm::array* alpha = pop<vm::array*>(s); + array* theta = pop<array*>(s); + array* alpha = pop<array*>(s); size_t K = checkArray(alpha); if(checkArray(theta) != K) error(GSLinvalid); @@ -912,7 +913,7 @@ void GSLpdf_dirichlet(stack *s) void GSLrng_multinomial(stack *s) { - vm::array* p = pop<vm::array*>(s); + array* p = pop<array*>(s); unsigned int N = unsignedcast(pop<Int>(s)); size_t K = checkArray(p); checkGSLrng(); @@ -920,7 +921,7 @@ void GSLrng_multinomial(stack *s) copyArrayC(cp,p); unsigned int* cn = new unsigned int[K]; gsl_ran_multinomial(GSLrng,K,N,cp,cn); - s->push<vm::array*>(copyCArray(K,cn)); + s->push<array*>(copyCArray(K,cn)); delete[] cn; delete[] cp; checkGSLerror(); @@ -928,8 +929,8 @@ void GSLrng_multinomial(stack *s) void GSLpdf_multinomial(stack *s) { - vm::array* n = pop<vm::array*>(s); - vm::array* p = pop<vm::array*>(s); + array* n = pop<array*>(s); + array* p = pop<array*>(s); size_t K = checkArray(p); if(K != checkArray(n)) error(GSLinvalid); double* cp; @@ -942,6 +943,19 @@ void GSLpdf_multinomial(stack *s) checkGSLerror(); } +void GSLsf_elljac_e(stack *s) +{ + double m = pop<double>(s); + double u = pop<double>(s); + double sn,cn,dn; + gsl_sf_elljac_e(u,m,&sn,&cn,&dn); + array *result=new array(3); + (*result)[0]=sn; + (*result)[1]=cn; + (*result)[2]=dn; + s->push(result); +} + // Handle GSL errors gracefully. void GSLerrorhandler(const char *reason, const char *, int, int) { @@ -1080,9 +1094,6 @@ void gen_rungsl_venv(venv &ve) addGSLDOUBLE3Func<gsl_sf_ellint_RF>(SYM(RF),SYM(x),SYM(y),SYM(z)); addGSLDOUBLE4Func<gsl_sf_ellint_RJ>(SYM(RJ),SYM(x),SYM(y),SYM(z),SYM(p)); - // Elliptic functions (Jacobi) - // to be implemented - // Error functions addGSLRealFunc<gsl_sf_erf>(SYM(erf)); addGSLRealFunc<gsl_sf_erfc>(SYM(erfc)); @@ -1395,6 +1406,10 @@ void gen_rungsl_venv(venv &ve) addFunc(GSLModule->e.ve,GSLrng_dir3d,primTriple(),SYM(rng_dir3d)); addFunc(GSLModule->e.ve,GSLrng_dir,realArray(),SYM(rng_dir), formal(primInt(),SYM(n))); + + // Elliptic functions (Jacobi) + addFunc(GSLModule->e.ve,GSLsf_elljac_e,realArray(),SYM(sncndn), + formal(primReal(),SYM(u)),formal(primReal(),SYM(m))); // Dirirchlet distribution addFunc(GSLModule->e.ve,GSLrng_dirichlet,realArray(),SYM(rng_dirichlet), diff --git a/Build/source/utils/asymptote/impdatum.cc b/Build/source/utils/asymptote/impdatum.cc new file mode 100644 index 00000000000..9d0be54f156 --- /dev/null +++ b/Build/source/utils/asymptote/impdatum.cc @@ -0,0 +1,615 @@ +#include <cstring> + +#include "stack.h" +#include "env.h" +#include "exp.h" +#include "stm.h" +#include "refaccess.h" + +using std::strlen; + +using namespace absyntax; +using namespace trans; + +using vm::item; +using vm::get; + + +#include "policy.h" + +coenv &coenvInOngoingProcess(); +void runInOngoingProcess(absyntax::runnable *r); + +void runExp(absyntax::exp *e) +{ + absyntax::expStm s(nullPos, e); + runInOngoingProcess(&s); +} + +class ImpDatum; +class ImpArguments; + +ImpDatum *datumError(const char *msg); + +// Expression used for non-item datums. +class errorExp : public absyntax::exp { +public: + errorExp() : exp(nullPos) {} + + void prettyprint(ostream &out, Int indent) + { + absyntax::prettyname(out, "errorExp", indent); + } + + void complain() { + em.error(nullPos); em << "cannot use datum as expression"; + } + + types::ty *getType(coenv &) { return types::primError(); } + types::ty *trans(coenv &e) { complain(); return getType(e); } + + void transAsType(coenv &e, types::ty *target) { complain(); } +}; + +// Abstract base class for Datum types. +class ImpDatum { +public: + virtual operator handle_typ() { return (handle_typ)(this); } + + virtual int_typ toInt() { + datumError("cannot convert to integer"); + + // Return a weird value that will hopefully be noticed. + return -777777; + } + + virtual bool toBool() { + datumError("cannot convert to bool"); + return false; + } + + virtual double toDouble() { + datumError("cannot convert to double"); + return -777e77; + } + + virtual string_typ toString() { + datumError("cannot convert to string"); + + string_typ s = { "XXXXX", 5 }; + return s; + } + + virtual absyntax::exp *getExp() { + datumError("invalid use of datum"); + return new errorExp; + } + + // How to access a field of the datum. + virtual absyntax::exp *getFieldExp(symbol id) { + assert(id); + return new fieldExp(nullPos, this->getExp(), id); + } + + virtual ImpDatum *getField(const char *name); + + virtual ImpDatum *getCell(ImpDatum *index) { + return datumError("cannot index datatype"); + } + + virtual void addField(const char *name, ImpDatum *init) + { + datumError("cannot set field of datatype"); + } + +}; + +// An ever-growing list of handles, used to avoid garbage collecting the data. +// TODO: Implement effective releaseHandle. +mem::vector<handle_typ> handles; + +handle_typ wrap(ImpDatum *d) +{ + handle_typ h = (handle_typ)(d); + handles.push_back(h); + return h; +} + +ImpDatum *unwrap(handle_typ handle) +{ + assert(handle != 0); + return (ImpDatum *)(handle); +} + +class ErrorDatum : public ImpDatum { +}; + +error_callback_typ errorCallback = 0; + +ImpDatum *datumError(const char *msg) +{ + static ErrorDatum ed; + + if (errorCallback) { + string_typ s = { msg, strlen(msg) }; + errorCallback(s); + } + else { + cerr << msg << '\n'; + } + + return &ed; +} + +handle_typ imp_copyHandle(handle_typ handle) +{ + //cout << "+"; + // For now, don't do anything. + return handle; +} + +void imp_releaseHandle() +{ + //cout << "-"; + // Do nothing, for now. +} + +// A datum representing a value in Asymptote. Both the runtime representation +// of the value and its type are stored. +class ItemDatum : public ImpDatum { + item i; + types::ty *t; + +public: + // Every itemDatum has a fixed (non-overloaded) type, t + ItemDatum(types::ty *t) : t(t) { + assert(t); + assert(t->isNotOverloaded()); + assert(t->isNotError()); + } + + // An expression that can be used to get and set the datum. + // The value should only be set once, when the datum is created, and not + // changed. + absyntax::exp *getExp() { + // It may be faster to create this once on start, but then the datum will + // require more space. For now, we create the access and expression on + // demand. + return new varEntryExp(nullPos, t, new itemRefAccess(&i)); + } + + int_typ toInt() { + // TODO: Decide if we want to use casting. + if (t->kind == types::ty_Int) + return static_cast<int_typ>(get<Int>(i)); + else + return ImpDatum::toInt(); + } + + bool toBool() { + if (t->kind == types::ty_boolean) + return get<bool>(i); + else + return ImpDatum::toBool(); + } + + double toDouble() { + if (t->kind == types::ty_real) + return get<double>(i); + else + return ImpDatum::toDouble(); + } + + string_typ toString() { + if (t->kind == types::ty_string) { + // TODO: Fix for strings containing NUL. + string *s = get<string *>(i); + string_typ st = { s->c_str(), s->length() }; + return st; + } + else + return ImpDatum::toString(); + } +}; + +ItemDatum *ItemDatumFromExp(types::ty *t, absyntax::exp *e) +{ + ItemDatum *d = new ItemDatum(t); + assignExp ae(nullPos, d->getExp(), e); + runExp(&ae); + + return d; +} + +ItemDatum *ItemDatumFromInt(int_typ x) +{ + intExp ie(nullPos, static_cast<Int>(x)); + return ItemDatumFromExp(types::primInt(), &ie); +} + +ItemDatum *ItemDatumFromBool(bool x) +{ + booleanExp be(nullPos, x); + return ItemDatumFromExp(types::primBoolean(), &be); +} + +ItemDatum *ItemDatumFromDouble(double x) +{ + realExp re(nullPos, x); + return ItemDatumFromExp(types::primReal(), &re); +} + +ItemDatum *ItemDatumFromString(string_typ x) +{ + mem::string s(x.buf, (size_t)x.length); + stringExp se(nullPos, s); + return ItemDatumFromExp(types::primString(), &se); +} + + +// If the interface is asked to return a field which is overloaded, a handle +// to and OverloadedDatum is returned. No evaluation actually occurs. The +// datum simply consists of the containing datum and the name of the field +// requested. Subsequent use of the datum will resolve the overloading (or +// report an error). +class OverloadedDatum : public ImpDatum { + ImpDatum *parent; + symbol id; + +public: + OverloadedDatum(ImpDatum *parent, symbol id) : parent(parent), id(id) + { + assert(parent); + assert(id); + } + + absyntax::exp *getExp() { + return parent->getFieldExp(id); + return new fieldExp(nullPos, parent->getExp(), id); + } +}; + +ImpDatum *ImpDatum::getField(const char *name) +{ + coenv &e = coenvInOngoingProcess(); + symbol id = symbol::trans(name); + + absyntax::exp *ex = getFieldExp(id); + + types::ty *t = ex->getType(e); + if (t->isError()) + return datumError("no field of that name"); + + if (t->isOverloaded()) + return new OverloadedDatum(this, id); + + // Create a new datum and assign the variable to it. + ItemDatum *d = new ItemDatum(t); + assignExp ae(nullPos, d->getExp(), ex); + runExp(&ae); + + return d; +} + +handle_typ imp_handleFromInt(int_typ x) +{ + return wrap(ItemDatumFromInt(x)); +} + +handle_typ imp_handleFromBool(int_typ x) +{ + if (x != 0 && x != 1) + return wrap(datumError("invalid boolean value")); + + return wrap(ItemDatumFromBool(x == 1)); +} + +handle_typ imp_handleFromDouble(double x) +{ + return wrap(ItemDatumFromDouble(x)); +} + +int_typ imp_IntFromHandle(handle_typ handle) +{ + return unwrap(handle)->toInt(); +} + +int_typ imp_boolFromHandle(handle_typ handle) +{ + return unwrap(handle)->toBool() ? 1 : 0; +} + +double imp_doubleFromHandle(handle_typ handle) +{ + return unwrap(handle)->toDouble(); +} + + +handle_typ imp_handleFromString(string_typ x) +{ + return wrap(ItemDatumFromString(x)); +} + +string_typ imp_stringFromHandle(handle_typ handle) +{ + return unwrap(handle)->toString(); +} + +handle_typ imp_getField(handle_typ handle, const char *name) +{ + return wrap(unwrap(handle)->getField(name)); +} + +handle_typ imp_getCell(handle_typ handle, handle_typ index) +{ + return wrap(unwrap(handle)->getCell(unwrap(index))); +} + +void imp_addField(handle_typ handle, const char *name, handle_typ init) +{ + unwrap(handle)->addField(name, unwrap(init)); +} + +class ImpArguments /* TODO: gc visible but not collected */ { + arglist args; +public: + + ImpArguments() {} + + void add(const char *name, ImpDatum *arg, arg_rest_option isRest) + { + assert(isRest == NORMAL_ARG); // TODO: Implement rest. + symbol id = (name && name[0]) ? symbol::trans(name) : symbol::nullsym; + + args.add(arg->getExp(), id); + } + + arglist *getArgs() { return &args; } +}; + +arguments_typ wrapArgs(ImpArguments *args) +{ + return (arguments_typ)(args); +} +ImpArguments *unwrapArgs(arguments_typ args) +{ + return (ImpArguments *)(args); +} + +arguments_typ imp_newArguments() +{ + return wrapArgs(new ImpArguments); +} + +void imp_releaseArguments(arguments_typ args) +{ + // For now, do nothing. +} + +void imp_addArgument(arguments_typ args, const char *name, handle_typ handle, + arg_rest_option isRest) +{ + unwrapArgs(args)->add(name, unwrap(handle), isRest); +} + +ImpDatum *callDatum(ImpDatum *callee, ImpArguments *args) +{ + coenv &e = coenvInOngoingProcess(); + + callExp callex(nullPos, callee->getExp(), args->getArgs()); + + types::ty *t = callex.getType(e); + if (t->isError()) { + // Run for errors. + runExp(&callex); em.sync(); + return datumError("invalid call"); + } + + assert(t->isNotOverloaded()); // Calls are never overloaded. + + if (t->kind == types::ty_void) { + // Execute the call and return 0 to indicate void. + runExp(&callex); + return 0; + } + else + return ItemDatumFromExp(t, &callex); +} + +handle_typ imp_call(handle_typ callee, arguments_typ args) +{ + return wrap(callDatum(unwrap(callee), unwrapArgs(args))); +} + +class GlobalsDatum : public ImpDatum { + typedef std::map<const char*, ImpDatum *> gmap; + gmap base; + + virtual absyntax::exp *getFieldExp(symbol id) + { + // Fields of the globals datum are global variables. Use the unqualified + // name. + return new nameExp(nullPos, id); + } + + virtual void addField(const char *name, ImpDatum *init) { + datumError("addField not yet re-implemented"); + } +}; + +class ImpState { + //ImpArguments *params; + + ImpDatum *retval; +public: + ImpState() : retval(0) {} + + ImpDatum *globals() { + return new GlobalsDatum(); + } + + int_typ numParams() { + /*if (params) + return params->val.size(); + else */ { + datumError("parameters accessed outside of function"); + return 0; + } + } + + ImpDatum *getParam(int_typ index) { + /*if (params) { + if (index >= 0 && index < static_cast<int_typ>(params->val.size())) + return params->val[index]; + else + return datumError("invalid index for parameter"); + } + else */ { + return datumError("parameters accessed outside of function"); + } + } + + void setReturnValue(ImpDatum *retval) + { + /*if (params) { + if (this->retval) + datumError("return value set more than once"); + else + this->retval = retval; + } + else */ { + datumError("return value set outside of function"); + } + } + + ImpDatum *getReturnValue() + { + return retval; + } +}; + +state_typ wrapState(ImpState *s) +{ + return (state_typ)(s); +} +ImpState *unwrapState(state_typ s) +{ + return (ImpState *)(s); +} + + +handle_typ imp_globals(state_typ state) +{ + return wrap(unwrapState(state)->globals()); +} + +int_typ imp_numParams(state_typ state) +{ + return unwrapState(state)->numParams(); +} + +handle_typ imp_getParam(state_typ state, int_typ index) +{ + return wrap(unwrapState(state)->getParam(index)); +} + +void imp_setReturnValue(state_typ state, handle_typ handle) +{ + unwrapState(state)->setReturnValue(unwrap(handle)); +} + +state_typ cheatState() +{ + return wrapState(new ImpState()); +} + +#if 0 +class FunctionDatum : public ImpDatum { + function_typ f; + void *data; + +public: + FunctionDatum(function_typ f, void *data) : f(f), data(data) {} + + ImpDatum *call(ImpArguments *args) { + ImpState state(args); + + // Call the function. + f(wrapState(&state),data); + + if (state.getReturnValue()) + return state.getReturnValue(); + else + // TODO: Decide on datum for void return. + return 0; + } +}; +#endif + +handle_typ imp_handleFromFunction(const char *signature, + function_typ f, void *data) +{ + // TODO: Re-implement. + return 0; //wrap(new FunctionDatum(f, data)); +} + +void imp_setErrorCallback(error_callback_typ callback) +{ + errorCallback = callback; +} + +extern policy_typ imp_policy; +policy_typ imp_policy = +{ + /* version = */ 101, + imp_copyHandle, + imp_releaseHandle, + imp_handleFromInt, + imp_handleFromBool, + imp_handleFromDouble, + imp_handleFromString, + imp_handleFromFunction, + imp_IntFromHandle, + imp_boolFromHandle, + imp_doubleFromHandle, + imp_stringFromHandle, + imp_getField, + imp_getCell, + imp_addField, + imp_newArguments, + imp_releaseArguments, + imp_addArgument, + imp_call, + imp_globals, + imp_numParams, + imp_getParam, + imp_setReturnValue, + imp_setErrorCallback, +}; + +// Defined in process.cc +void init(bool resetpath=true); + +extern "C" { + +policy_typ *_asy_getPolicy() +{ + return &imp_policy; +} + +state_typ _asy_getState() +{ + static state_typ state = cheatState(); + + // TODO: Make sure this runs once. + char buf[] = "asymptote.so"; + char *argv [] = { buf }; + settings::setOptions(1,argv); + + // Ensures uptodate is not used. + init(); + + return state; +} + +} diff --git a/Build/source/utils/asymptote/install-sh b/Build/source/utils/asymptote/install-sh index 377bb8687ff..6781b987bdb 100755 --- a/Build/source/utils/asymptote/install-sh +++ b/Build/source/utils/asymptote/install-sh @@ -1,7 +1,7 @@ #!/bin/sh # install - install a program, script, or datafile -scriptversion=2011-11-20.07; # UTC +scriptversion=2009-04-28.21; # UTC # This originates from X11R5 (mit/util/scripts/install.sh), which was # later released in X11R6 (xc/config/util/install.sh) with the @@ -35,7 +35,7 @@ scriptversion=2011-11-20.07; # UTC # FSF changes to this file are in the public domain. # # Calling this script install-sh is preferred over install.sh, to prevent -# 'make' implicit rules from creating a file called install from it +# `make' implicit rules from creating a file called install from it # when there is no Makefile. # # This script is compatible with the BSD install script, but was written @@ -156,10 +156,6 @@ while test $# -ne 0; do -s) stripcmd=$stripprog;; -t) dst_arg=$2 - # Protect names problematic for 'test' and other utilities. - case $dst_arg in - -* | [=\(\)!]) dst_arg=./$dst_arg;; - esac shift;; -T) no_target_directory=true;; @@ -190,10 +186,6 @@ if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then fi shift # arg dst_arg=$arg - # Protect names problematic for 'test' and other utilities. - case $dst_arg in - -* | [=\(\)!]) dst_arg=./$dst_arg;; - esac done fi @@ -202,17 +194,13 @@ if test $# -eq 0; then echo "$0: no input file specified." >&2 exit 1 fi - # It's OK to call 'install-sh -d' without argument. + # It's OK to call `install-sh -d' without argument. # This can happen when creating conditional directories. exit 0 fi if test -z "$dir_arg"; then - do_exit='(exit $ret); exit $ret' - trap "ret=129; $do_exit" 1 - trap "ret=130; $do_exit" 2 - trap "ret=141; $do_exit" 13 - trap "ret=143; $do_exit" 15 + trap '(exit $?); exit' 1 2 13 15 # Set umask so as not to create temps with too-generous modes. # However, 'strip' requires both read and write access to temps. @@ -240,9 +228,9 @@ fi for src do - # Protect names problematic for 'test' and other utilities. + # Protect names starting with `-'. case $src in - -* | [=\(\)!]) src=./$src;; + -*) src=./$src;; esac if test -n "$dir_arg"; then @@ -264,7 +252,12 @@ do echo "$0: no destination specified." >&2 exit 1 fi + dst=$dst_arg + # Protect names starting with `-'. + case $dst in + -*) dst=./$dst;; + esac # If destination is a directory, append the input filename; won't work # if double slashes aren't ignored. @@ -354,7 +347,7 @@ do if test -z "$dir_arg" || { # Check for POSIX incompatibilities with -m. # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or - # other-writable bit of parent directory when it shouldn't. + # other-writeable bit of parent directory when it shouldn't. # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. ls_ld_tmpdir=`ls -ld "$tmpdir"` case $ls_ld_tmpdir in @@ -392,7 +385,7 @@ do case $dstdir in /*) prefix='/';; - [-=\(\)!]*) prefix='./';; + -*) prefix='./';; *) prefix='';; esac @@ -410,7 +403,7 @@ do for d do - test X"$d" = X && continue + test -z "$d" && continue prefix=$prefix$d if test -d "$prefix"; then diff --git a/Build/source/utils/asymptote/interact.cc b/Build/source/utils/asymptote/interact.cc index dd0bfd68a20..7f30b7034bc 100644 --- a/Build/source/utils/asymptote/interact.cc +++ b/Build/source/utils/asymptote/interact.cc @@ -72,7 +72,7 @@ void init_completion() { char *(*Readline)(const char *prompt); -char *verbatimreadline(const char *prompt) +char *readverbatimline(const char *prompt) { if(!cin.good()) {cin.clear(); return NULL;} cout << prompt; @@ -81,14 +81,34 @@ char *verbatimreadline(const char *prompt) return StrdupMalloc(s); } +FILE *fin=NULL; + +char *readpipeline(const char *prompt) +{ + const int max_size=256; + static char buf[max_size]; + ostringstream s; + do { + if(fgets(buf,max_size-1,fin) == NULL) break; + s << buf; + } while(buf[strlen(buf)-1] != '\n'); + return StrdupMalloc(s.str()); +} + void pre_readline() { + int fd=intcast(settings::getSetting<Int>("inpipe")); + if(fd >= 0) { + if(!fin) fin=fdopen(fd,"r"); + Readline=readpipeline; + } else { #if defined(HAVE_LIBREADLINE) && defined(HAVE_LIBCURSES) - if(tty) { - Readline=readline; - } else + if(tty) { + Readline=readline; + } else #endif - Readline=verbatimreadline; + Readline=readverbatimline; + } } void init_interactive() diff --git a/Build/source/utils/asymptote/lex.yy.cc b/Build/source/utils/asymptote/lex.yy.cc index b3c2d642faf..da266207e7b 100644 --- a/Build/source/utils/asymptote/lex.yy.cc +++ b/Build/source/utils/asymptote/lex.yy.cc @@ -767,20 +767,20 @@ int yy_flex_debug = 1; static yyconst flex_int16_t yy_rule_linenum[122] = { 0, - 205, 206, 208, 214, 218, 219, 229, 230, 231, 232, - 236, 237, 247, 248, 249, 250, 251, 252, 253, 254, - 255, 256, 261, 266, 272, 278, 286, 289, 290, 291, - 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, - 302, 304, 305, 306, 307, 308, 309, 310, 311, 312, - 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, - 323, 324, 325, 326, 327, 328, 329, 330, 332, 333, - 334, 335, 336, 337, 339, 340, 341, 342, 343, 345, - 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, - 356, 357, 358, 359, 360, 361, 362, 364, 365, 366, - - 367, 368, 371, 378, 385, 387, 389, 391, 393, 396, - 398, 399, 405, 409, 413, 417, 420, 424, 425, 426, - 430 + 212, 213, 215, 221, 225, 226, 236, 237, 238, 239, + 243, 244, 254, 255, 256, 257, 258, 259, 260, 261, + 262, 263, 268, 273, 279, 285, 293, 296, 297, 298, + 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, + 309, 311, 312, 313, 314, 315, 316, 317, 318, 319, + 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, + 330, 331, 332, 333, 334, 335, 336, 337, 339, 340, + 341, 342, 343, 344, 346, 347, 348, 349, 350, 352, + 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, + 363, 364, 365, 366, 367, 368, 369, 371, 372, 373, + + 374, 375, 378, 385, 392, 394, 396, 398, 400, 403, + 405, 406, 412, 416, 420, 424, 427, 431, 432, 433, + 437 } ; /* The intent behind this definition is that it'll catch @@ -821,6 +821,8 @@ using mem::string; #include "opsymbols.h" +#define YY_NO_INPUT + static void yyunput(int, char *); void (*unused)(int,char *) = yyunput; @@ -897,6 +899,11 @@ void savesymbol(symbol name) #define DEFSYMBOL(name) \ savesymbol(name) + /* Extra symbols can be added by EXTRASYMBOL */ +#define EXTRASYMBOL(chars, codename) /* blank */ + +EXTRASYMBOL(tuple, SYM_TUPLE); + void makesymbol() { assert(strlen(yytext) == (size_t)yyleng); @@ -985,7 +992,7 @@ void getstring(void) -#line 989 "lex.yy.cc" +#line 996 "lex.yy.cc" #define INITIAL 0 #define lexcomment 1 @@ -1232,10 +1239,10 @@ YY_DECL register int yy_act; /* %% [7.0] user's declarations go here */ -#line 202 "camp.l" +#line 209 "camp.l" -#line 1239 "lex.yy.cc" +#line 1246 "lex.yy.cc" if ( !(yy_init) ) { @@ -1351,23 +1358,23 @@ do_action: /* This label is used only to access EOF actions. */ case 1: YY_RULE_SETUP -#line 205 "camp.l" +#line 212 "camp.l" {adjust(); /*commentDepth++;*/} YY_BREAK case 2: YY_RULE_SETUP -#line 206 "camp.l" +#line 213 "camp.l" {adjust(); /*commentDepth--;*/ /*if (commentDepth == 0)*/ BEGIN INITIAL; } YY_BREAK case 3: /* rule 3 can match eol */ YY_RULE_SETUP -#line 208 "camp.l" +#line 215 "camp.l" {adjust(); newline(); continue; } YY_BREAK case YY_STATE_EOF(lexcomment): -#line 209 "camp.l" +#line 216 "camp.l" {adjust(); setEOF("comment not terminated"); BEGIN INITIAL; @@ -1376,7 +1383,7 @@ case YY_STATE_EOF(lexcomment): YY_BREAK case 4: YY_RULE_SETUP -#line 214 "camp.l" +#line 221 "camp.l" {adjust(); continue; } YY_BREAK @@ -1387,19 +1394,19 @@ case 5: (yy_c_buf_p) = yy_cp = yy_bp + 1; YY_DO_BEFORE_ACTION; /* set up yytext again */ YY_RULE_SETUP -#line 218 "camp.l" +#line 225 "camp.l" {adjust(); BEGIN INITIAL;} YY_BREAK case 6: YY_RULE_SETUP -#line 219 "camp.l" +#line 226 "camp.l" {adjust(); BEGIN INITIAL; getstring(); return STRING; } YY_BREAK case YY_STATE_EOF(texstring): -#line 223 "camp.l" +#line 230 "camp.l" {adjust(); setEOF("string not terminated"); BEGIN INITIAL; @@ -1410,22 +1417,22 @@ case YY_STATE_EOF(texstring): case 7: /* rule 7 can match eol */ YY_RULE_SETUP -#line 229 "camp.l" +#line 236 "camp.l" {adjust(); newline(); append('\n'); continue; } YY_BREAK case 8: YY_RULE_SETUP -#line 230 "camp.l" +#line 237 "camp.l" {adjust(); append('\\'); append('\\'); continue; } YY_BREAK case 9: YY_RULE_SETUP -#line 231 "camp.l" +#line 238 "camp.l" {adjust(); append('\"'); continue; } YY_BREAK case 10: YY_RULE_SETUP -#line 232 "camp.l" +#line 239 "camp.l" {adjust(); append(*yytext); } YY_BREAK @@ -1436,19 +1443,19 @@ case 11: (yy_c_buf_p) = yy_cp = yy_bp + 1; YY_DO_BEFORE_ACTION; /* set up yytext again */ YY_RULE_SETUP -#line 236 "camp.l" +#line 243 "camp.l" {adjust(); BEGIN INITIAL;} YY_BREAK case 12: YY_RULE_SETUP -#line 237 "camp.l" +#line 244 "camp.l" {adjust(); BEGIN INITIAL; getstring(); return STRING; } YY_BREAK case YY_STATE_EOF(cstring): -#line 241 "camp.l" +#line 248 "camp.l" {adjust(); setEOF("string not terminated"); BEGIN INITIAL; @@ -1459,52 +1466,52 @@ case YY_STATE_EOF(cstring): case 13: /* rule 13 can match eol */ YY_RULE_SETUP -#line 247 "camp.l" +#line 254 "camp.l" {adjust(); newline(); append('\n'); continue; } YY_BREAK case 14: YY_RULE_SETUP -#line 248 "camp.l" +#line 255 "camp.l" {adjust(); append(yytext[1]); continue; } YY_BREAK case 15: YY_RULE_SETUP -#line 249 "camp.l" +#line 256 "camp.l" {adjust(); append('\a'); continue; } YY_BREAK case 16: YY_RULE_SETUP -#line 250 "camp.l" +#line 257 "camp.l" {adjust(); append('\b'); continue; } YY_BREAK case 17: YY_RULE_SETUP -#line 251 "camp.l" +#line 258 "camp.l" {adjust(); append('\f'); continue; } YY_BREAK case 18: YY_RULE_SETUP -#line 252 "camp.l" +#line 259 "camp.l" {adjust(); append('\n'); continue; } YY_BREAK case 19: YY_RULE_SETUP -#line 253 "camp.l" +#line 260 "camp.l" {adjust(); append('\r'); continue; } YY_BREAK case 20: YY_RULE_SETUP -#line 254 "camp.l" +#line 261 "camp.l" {adjust(); append('\t'); continue; } YY_BREAK case 21: YY_RULE_SETUP -#line 255 "camp.l" +#line 262 "camp.l" {adjust(); append('\v'); continue; } YY_BREAK case 22: YY_RULE_SETUP -#line 256 "camp.l" +#line 263 "camp.l" {adjust(); char x=(char)(yytext[1]-'0'); append(x); @@ -1513,7 +1520,7 @@ YY_RULE_SETUP YY_BREAK case 23: YY_RULE_SETUP -#line 261 "camp.l" +#line 268 "camp.l" {adjust(); char x=(char)((yytext[1]-'0')*8+yytext[2]-'0'); append(x); @@ -1522,7 +1529,7 @@ YY_RULE_SETUP YY_BREAK case 24: YY_RULE_SETUP -#line 266 "camp.l" +#line 273 "camp.l" {adjust(); char x=(char)((yytext[1]-'0')*64+(yytext[2]-'0')*8 +yytext[3]-'0'); @@ -1532,7 +1539,7 @@ YY_RULE_SETUP YY_BREAK case 25: YY_RULE_SETUP -#line 272 "camp.l" +#line 279 "camp.l" {adjust(); char x=(char) (yytext[2] <= '9' ? yytext[2]-'0' : 10+yytext[2]-'A'); @@ -1542,7 +1549,7 @@ YY_RULE_SETUP YY_BREAK case 26: YY_RULE_SETUP -#line 278 "camp.l" +#line 285 "camp.l" {adjust(); char x=(char) ((yytext[2] <= '9' ? yytext[2]-'0' : 10+yytext[2]-'A')*16 @@ -1554,390 +1561,390 @@ YY_RULE_SETUP YY_BREAK case 27: YY_RULE_SETUP -#line 286 "camp.l" +#line 293 "camp.l" {adjust(); append(*yytext); } YY_BREAK case 28: YY_RULE_SETUP -#line 289 "camp.l" +#line 296 "camp.l" {adjust(); continue;} YY_BREAK case 29: /* rule 29 can match eol */ YY_RULE_SETUP -#line 290 "camp.l" +#line 297 "camp.l" {adjust(); newline(); continue;} YY_BREAK case 30: YY_RULE_SETUP -#line 291 "camp.l" +#line 298 "camp.l" {adjust(); continue;} YY_BREAK case 31: YY_RULE_SETUP -#line 292 "camp.l" +#line 299 "camp.l" {adjust(); return ','; } YY_BREAK case 32: YY_RULE_SETUP -#line 293 "camp.l" +#line 300 "camp.l" {adjust(); return ':'; } YY_BREAK case 33: YY_RULE_SETUP -#line 294 "camp.l" +#line 301 "camp.l" {adjust(); return ';'; } YY_BREAK case 34: YY_RULE_SETUP -#line 295 "camp.l" +#line 302 "camp.l" {adjust(); return '('; } YY_BREAK case 35: YY_RULE_SETUP -#line 296 "camp.l" +#line 303 "camp.l" {adjust(); return ')'; } YY_BREAK case 36: YY_RULE_SETUP -#line 297 "camp.l" +#line 304 "camp.l" {adjust(); return '['; } YY_BREAK case 37: YY_RULE_SETUP -#line 298 "camp.l" +#line 305 "camp.l" {adjust(); return ']'; } YY_BREAK case 38: YY_RULE_SETUP -#line 299 "camp.l" +#line 306 "camp.l" {adjust(); return '{'; } YY_BREAK case 39: YY_RULE_SETUP -#line 300 "camp.l" +#line 307 "camp.l" {adjust(); return '}'; } YY_BREAK case 40: YY_RULE_SETUP -#line 301 "camp.l" +#line 308 "camp.l" {adjust(); return '.'; } YY_BREAK case 41: YY_RULE_SETUP -#line 302 "camp.l" +#line 309 "camp.l" {adjust(); return ELLIPSIS; } YY_BREAK case 42: YY_RULE_SETUP -#line 304 "camp.l" +#line 311 "camp.l" {DEFSYMBOL(SYM_PLUS); return '+'; } YY_BREAK case 43: YY_RULE_SETUP -#line 305 "camp.l" +#line 312 "camp.l" {DEFSYMBOL(SYM_MINUS); return '-'; } YY_BREAK case 44: YY_RULE_SETUP -#line 306 "camp.l" +#line 313 "camp.l" {DEFSYMBOL(SYM_TIMES); return '*'; } YY_BREAK case 45: YY_RULE_SETUP -#line 307 "camp.l" +#line 314 "camp.l" {DEFSYMBOL(SYM_DIVIDE); return '/'; } YY_BREAK case 46: YY_RULE_SETUP -#line 308 "camp.l" +#line 315 "camp.l" {DEFSYMBOL(SYM_MOD); return '%'; } YY_BREAK case 47: YY_RULE_SETUP -#line 309 "camp.l" +#line 316 "camp.l" {DEFSYMBOL(SYM_CARET); return '^'; } YY_BREAK case 48: YY_RULE_SETUP -#line 310 "camp.l" +#line 317 "camp.l" {savesymbol(SYM_CARET); return '^'; } YY_BREAK case 49: YY_RULE_SETUP -#line 311 "camp.l" +#line 318 "camp.l" {adjust(); return '?'; } YY_BREAK case 50: YY_RULE_SETUP -#line 312 "camp.l" +#line 319 "camp.l" {adjust(); return ASSIGN; } YY_BREAK case 51: YY_RULE_SETUP -#line 313 "camp.l" +#line 320 "camp.l" {DEFSYMBOL(SYM_EQ); return EQ; } YY_BREAK case 52: YY_RULE_SETUP -#line 314 "camp.l" +#line 321 "camp.l" {DEFSYMBOL(SYM_NEQ); return NEQ; } YY_BREAK case 53: YY_RULE_SETUP -#line 315 "camp.l" +#line 322 "camp.l" {DEFSYMBOL(SYM_LT); return LT; } YY_BREAK case 54: YY_RULE_SETUP -#line 316 "camp.l" +#line 323 "camp.l" {DEFSYMBOL(SYM_LE); return LE; } YY_BREAK case 55: YY_RULE_SETUP -#line 317 "camp.l" +#line 324 "camp.l" {DEFSYMBOL(SYM_GT); return GT; } YY_BREAK case 56: YY_RULE_SETUP -#line 318 "camp.l" +#line 325 "camp.l" {DEFSYMBOL(SYM_GE); return GE; } YY_BREAK case 57: YY_RULE_SETUP -#line 319 "camp.l" +#line 326 "camp.l" {DEFSYMBOL(SYM_CAND); return CAND; } YY_BREAK case 58: YY_RULE_SETUP -#line 320 "camp.l" +#line 327 "camp.l" {DEFSYMBOL(SYM_COR); return COR; } YY_BREAK case 59: YY_RULE_SETUP -#line 321 "camp.l" +#line 328 "camp.l" {DEFSYMBOL(SYM_LOGNOT); return LOGNOT; } YY_BREAK case 60: YY_RULE_SETUP -#line 322 "camp.l" +#line 329 "camp.l" {DEFSYMBOL(SYM_CARETS); return CARETS; } YY_BREAK case 61: YY_RULE_SETUP -#line 323 "camp.l" +#line 330 "camp.l" {DEFSYMBOL(SYM_COLONS); return COLONS; } YY_BREAK case 62: YY_RULE_SETUP -#line 324 "camp.l" +#line 331 "camp.l" {DEFSYMBOL(SYM_INCR); return INCR; } YY_BREAK case 63: YY_RULE_SETUP -#line 325 "camp.l" +#line 332 "camp.l" {DEFSYMBOL(SYM_DOTS); return DOTS; } YY_BREAK case 64: YY_RULE_SETUP -#line 326 "camp.l" +#line 333 "camp.l" {DEFSYMBOL(SYM_DASHES); return DASHES; } YY_BREAK case 65: YY_RULE_SETUP -#line 327 "camp.l" +#line 334 "camp.l" {DEFSYMBOL(SYM_LONGDASH); return LONGDASH; } YY_BREAK case 66: YY_RULE_SETUP -#line 328 "camp.l" +#line 335 "camp.l" {DEFSYMBOL(SYM_AMPERSAND); return AMPERSAND; } YY_BREAK case 67: YY_RULE_SETUP -#line 329 "camp.l" +#line 336 "camp.l" {DEFSYMBOL(SYM_BAR); return BAR; } YY_BREAK case 68: YY_RULE_SETUP -#line 330 "camp.l" +#line 337 "camp.l" {makeopsymbol(); return OPERATOR; } YY_BREAK case 69: YY_RULE_SETUP -#line 332 "camp.l" +#line 339 "camp.l" {savesymbol(SYM_PLUS); return SELFOP; } YY_BREAK case 70: YY_RULE_SETUP -#line 333 "camp.l" +#line 340 "camp.l" {savesymbol(SYM_MINUS); return SELFOP; } YY_BREAK case 71: YY_RULE_SETUP -#line 334 "camp.l" +#line 341 "camp.l" {savesymbol(SYM_TIMES); return SELFOP; } YY_BREAK case 72: YY_RULE_SETUP -#line 335 "camp.l" +#line 342 "camp.l" {savesymbol(SYM_DIVIDE); return SELFOP; } YY_BREAK case 73: YY_RULE_SETUP -#line 336 "camp.l" +#line 343 "camp.l" {savesymbol(SYM_MOD); return SELFOP; } YY_BREAK case 74: YY_RULE_SETUP -#line 337 "camp.l" +#line 344 "camp.l" {savesymbol(SYM_CARET); return SELFOP; } YY_BREAK case 75: YY_RULE_SETUP -#line 339 "camp.l" +#line 346 "camp.l" {adjust(); return AND; } YY_BREAK case 76: YY_RULE_SETUP -#line 340 "camp.l" +#line 347 "camp.l" {DEFSYMBOL(SYM_CONTROLS); return CONTROLS; } YY_BREAK case 77: YY_RULE_SETUP -#line 341 "camp.l" +#line 348 "camp.l" {DEFSYMBOL(SYM_TENSION); return TENSION; } YY_BREAK case 78: YY_RULE_SETUP -#line 342 "camp.l" +#line 349 "camp.l" {DEFSYMBOL(SYM_ATLEAST); return ATLEAST; } YY_BREAK case 79: YY_RULE_SETUP -#line 343 "camp.l" +#line 350 "camp.l" {DEFSYMBOL(SYM_CURL); return CURL; } YY_BREAK case 80: YY_RULE_SETUP -#line 345 "camp.l" +#line 352 "camp.l" {adjust(); return IF; } YY_BREAK case 81: YY_RULE_SETUP -#line 346 "camp.l" +#line 353 "camp.l" {adjust(); return ELSE; } YY_BREAK case 82: YY_RULE_SETUP -#line 347 "camp.l" +#line 354 "camp.l" {adjust(); return WHILE; } YY_BREAK case 83: YY_RULE_SETUP -#line 348 "camp.l" +#line 355 "camp.l" {adjust(); return FOR; } YY_BREAK case 84: YY_RULE_SETUP -#line 349 "camp.l" +#line 356 "camp.l" {adjust(); return DO; } YY_BREAK case 85: YY_RULE_SETUP -#line 350 "camp.l" +#line 357 "camp.l" {adjust(); return RETURN_; } YY_BREAK case 86: YY_RULE_SETUP -#line 351 "camp.l" +#line 358 "camp.l" {adjust(); return BREAK; } YY_BREAK case 87: YY_RULE_SETUP -#line 352 "camp.l" +#line 359 "camp.l" {adjust(); return CONTINUE; } YY_BREAK case 88: YY_RULE_SETUP -#line 353 "camp.l" +#line 360 "camp.l" {adjust(); return STRUCT; } YY_BREAK case 89: YY_RULE_SETUP -#line 354 "camp.l" +#line 361 "camp.l" {adjust(); return TYPEDEF; } YY_BREAK case 90: YY_RULE_SETUP -#line 355 "camp.l" +#line 362 "camp.l" {adjust(); return NEW; } YY_BREAK case 91: YY_RULE_SETUP -#line 356 "camp.l" +#line 363 "camp.l" {adjust(); return ACCESS; } YY_BREAK case 92: YY_RULE_SETUP -#line 357 "camp.l" +#line 364 "camp.l" {adjust(); return IMPORT; } YY_BREAK case 93: YY_RULE_SETUP -#line 358 "camp.l" +#line 365 "camp.l" {adjust(); return UNRAVEL; } YY_BREAK case 94: YY_RULE_SETUP -#line 359 "camp.l" +#line 366 "camp.l" {adjust(); return FROM; } YY_BREAK case 95: YY_RULE_SETUP -#line 360 "camp.l" +#line 367 "camp.l" {adjust(); return INCLUDE; } YY_BREAK case 96: YY_RULE_SETUP -#line 361 "camp.l" +#line 368 "camp.l" {adjust(); return QUOTE; } YY_BREAK case 97: YY_RULE_SETUP -#line 362 "camp.l" +#line 369 "camp.l" {adjust(); makemod(trans::EXPLICIT_STATIC); return MODIFIER; } YY_BREAK case 98: YY_RULE_SETUP -#line 364 "camp.l" +#line 371 "camp.l" {adjust(); makeperm(trans::PUBLIC); return PERM; } YY_BREAK case 99: YY_RULE_SETUP -#line 365 "camp.l" +#line 372 "camp.l" {adjust(); makeperm(trans::PRIVATE); return PERM; } YY_BREAK case 100: YY_RULE_SETUP -#line 366 "camp.l" +#line 373 "camp.l" {adjust(); makeperm(trans::RESTRICTED); return PERM; } YY_BREAK case 101: YY_RULE_SETUP -#line 367 "camp.l" +#line 374 "camp.l" {adjust(); return THIS; } YY_BREAK case 102: YY_RULE_SETUP -#line 368 "camp.l" +#line 375 "camp.l" {adjust(); return EXPLICIT; } YY_BREAK case 103: YY_RULE_SETUP -#line 371 "camp.l" +#line 378 "camp.l" try { adjust(); yylval.e= new intExp(here(), lexical::cast<Int>(yytext)); } catch (lexical::bad_cast&) { @@ -1948,7 +1955,7 @@ try { YY_BREAK case 104: YY_RULE_SETUP -#line 378 "camp.l" +#line 385 "camp.l" try { adjust(); yylval.e= new realExp(here(), lexical::cast<double>(yytext)); } catch (lexical::bad_cast&) { @@ -1959,53 +1966,53 @@ try { YY_BREAK case 105: YY_RULE_SETUP -#line 385 "camp.l" +#line 392 "camp.l" { adjust(); yylval.e= new booleanExp(here(), true); return LIT; } YY_BREAK case 106: YY_RULE_SETUP -#line 387 "camp.l" +#line 394 "camp.l" { adjust(); yylval.e= new booleanExp(here(), false); return LIT; } YY_BREAK case 107: YY_RULE_SETUP -#line 389 "camp.l" +#line 396 "camp.l" { adjust(); yylval.e= new nullExp(here()); return LIT; } YY_BREAK case 108: YY_RULE_SETUP -#line 391 "camp.l" +#line 398 "camp.l" { adjust(); yylval.e= new cycleExp(here()); return LIT; } YY_BREAK case 109: YY_RULE_SETUP -#line 393 "camp.l" +#line 400 "camp.l" { adjust(); yylval.e= new newPictureExp(here()); return LIT; } YY_BREAK case 110: YY_RULE_SETUP -#line 396 "camp.l" +#line 403 "camp.l" {adjust(); BEGIN opname; } YY_BREAK case 111: YY_RULE_SETUP -#line 398 "camp.l" +#line 405 "camp.l" {adjust(); continue;} YY_BREAK case 112: /* rule 112 can match eol */ YY_RULE_SETUP -#line 399 "camp.l" +#line 406 "camp.l" {adjust(); newline(); continue;} YY_BREAK case YY_STATE_EOF(opname): -#line 400 "camp.l" +#line 407 "camp.l" {adjust(); setEOF("missing operator name"); BEGIN INITIAL; @@ -2014,7 +2021,7 @@ case YY_STATE_EOF(opname): YY_BREAK case 113: YY_RULE_SETUP -#line 405 "camp.l" +#line 412 "camp.l" { savesymbol(SYM_CARET); BEGIN INITIAL; return ID; @@ -2022,7 +2029,7 @@ YY_RULE_SETUP YY_BREAK case 114: YY_RULE_SETUP -#line 409 "camp.l" +#line 416 "camp.l" { makeopsymbol(); BEGIN INITIAL; @@ -2030,7 +2037,7 @@ YY_RULE_SETUP YY_BREAK case 115: YY_RULE_SETUP -#line 413 "camp.l" +#line 420 "camp.l" { makeopsymbol(); BEGIN INITIAL; @@ -2038,40 +2045,40 @@ YY_RULE_SETUP YY_BREAK case 116: YY_RULE_SETUP -#line 417 "camp.l" +#line 424 "camp.l" {} YY_BREAK case 117: YY_RULE_SETUP -#line 420 "camp.l" +#line 427 "camp.l" { makesymbol(); return ID; } YY_BREAK case 118: YY_RULE_SETUP -#line 424 "camp.l" +#line 431 "camp.l" {adjust(); /*commentDepth = 1;*/ BEGIN lexcomment; } YY_BREAK case 119: YY_RULE_SETUP -#line 425 "camp.l" +#line 432 "camp.l" {startstring(); BEGIN texstring; } YY_BREAK case 120: YY_RULE_SETUP -#line 426 "camp.l" +#line 433 "camp.l" {startstring(); BEGIN cstring; } YY_BREAK case YY_STATE_EOF(INITIAL): case YY_STATE_EOF(lexformat): -#line 428 "camp.l" +#line 435 "camp.l" { setEOF("unexpected end of input"); yyterminate(); } YY_BREAK case 121: YY_RULE_SETUP -#line 430 "camp.l" +#line 437 "camp.l" {adjust(); error(); em << "invalid token"; @@ -2081,10 +2088,10 @@ YY_RULE_SETUP YY_BREAK case 122: YY_RULE_SETUP -#line 436 "camp.l" +#line 443 "camp.l" ECHO; YY_BREAK -#line 2088 "lex.yy.cc" +#line 2095 "lex.yy.cc" case YY_END_OF_BUFFER: { @@ -3217,4 +3224,4 @@ void yyfree (void * ptr ) /* %ok-for-header */ -#line 436 "camp.l" +#line 443 "camp.l" diff --git a/Build/source/utils/asymptote/lnkX64IconFix.nsh b/Build/source/utils/asymptote/lnkX64IconFix.nsh new file mode 100644 index 00000000000..d1a4c9f3118 --- /dev/null +++ b/Build/source/utils/asymptote/lnkX64IconFix.nsh @@ -0,0 +1,74 @@ +/******************************************************************************
+ WORKAROUND - lnkX64IconFix
+ This snippet was developed to address an issue with Windows
+ x64 incorrectly redirecting the shortcuts icon from $PROGRAMFILES32
+ to $PROGRAMFILES64.
+
+ See Forum post: http://forums.winamp.com/newreply.php?do=postreply&t=327806
+
+ Example:
+ CreateShortcut "$SMPROGRAMS\My App\My App.lnk" "$INSTDIR\My App.exe" "" "$INSTDIR\My App.exe"
+ ${lnkX64IconFix} "$SMPROGRAMS\My App\My App.lnk"
+
+ Original Code by Anders [http://forums.winamp.com/member.php?u=70852]
+ ******************************************************************************/
+!ifndef ___lnkX64IconFix___
+ !verbose push
+ !verbose 0
+
+ !include "LogicLib.nsh"
+ !include "x64.nsh"
+
+ !define ___lnkX64IconFix___
+ !define lnkX64IconFix `!insertmacro _lnkX64IconFix`
+ !macro _lnkX64IconFix _lnkPath
+ !verbose push
+ !verbose 0
+ ${If} ${RunningX64}
+ DetailPrint "WORKAROUND: 64bit OS Detected, Attempting to apply lnkX64IconFix"
+ Push "${_lnkPath}"
+ Call lnkX64IconFix
+ ${EndIf}
+ !verbose pop
+ !macroend
+
+ Function lnkX64IconFix ; _lnkPath
+ Exch $5
+ Push $0
+ Push $1
+ Push $2
+ Push $3
+ Push $4
+ System::Call 'OLE32::CoCreateInstance(g "{00021401-0000-0000-c000-000000000046}",i 0,i 1,g "{000214ee-0000-0000-c000-000000000046}",*i.r1)i'
+ ${If} $1 <> 0
+ System::Call '$1->0(g "{0000010b-0000-0000-C000-000000000046}",*i.r2)'
+ ${If} $2 <> 0
+ System::Call '$2->5(w r5,i 2)i.r0'
+ ${If} $0 = 0
+ System::Call '$1->0(g "{45e2b4ae-b1c3-11d0-b92f-00a0c90312e1}",*i.r3)i.r0'
+ ${If} $3 <> 0
+ System::Call '$3->5(i 0xA0000007)i.r0'
+ System::Call '$3->6(*i.r4)i.r0'
+ ${If} $0 = 0
+ IntOp $4 $4 & 0xffffBFFF
+ System::Call '$3->7(ir4)i.r0'
+ ${If} $0 = 0
+ System::Call '$2->6(i0,i0)'
+ DetailPrint "WORKAROUND: lnkX64IconFix Applied successfully"
+ ${EndIf}
+ ${EndIf}
+ System::Call $3->2()
+ ${EndIf}
+ ${EndIf}
+ System::Call $2->2()
+ ${EndIf}
+ System::Call $1->2()
+ ${EndIf}
+ Pop $4
+ Pop $3
+ Pop $2
+ Pop $1
+ Pop $0
+ FunctionEnd
+ !verbose pop
+!endif
diff --git a/Build/source/utils/asymptote/locate.cc b/Build/source/utils/asymptote/locate.cc index 98e2ff79ff4..7c6381e6b39 100644 --- a/Build/source/utils/asymptote/locate.cc +++ b/Build/source/utils/asymptote/locate.cc @@ -70,7 +70,7 @@ string locateFile(string id) for (file_list_t::iterator leaf = filenames.begin(); leaf != filenames.end(); ++leaf) { -#ifdef __CYGWIN__ +#ifdef __MSDOS__ size_t p; while ((p=leaf->find('\\')) < string::npos) (*leaf)[p]='/'; diff --git a/Build/source/utils/asymptote/main.cc b/Build/source/utils/asymptote/main.cc index c437a06e530..e38f7c28e10 100644 --- a/Build/source/utils/asymptote/main.cc +++ b/Build/source/utils/asymptote/main.cc @@ -27,10 +27,6 @@ #include "common.h" -#ifdef __CYGWIN__ -#define NOMINMAX -#endif - #ifdef HAVE_LIBSIGSEGV #include <sigsegv.h> #endif @@ -46,7 +42,6 @@ using namespace settings; -errorstream em; using interact::interactive; namespace run { @@ -108,20 +103,6 @@ void interruptHandler(int) em.Interrupt(true); } -// Run the config file. -void doConfig(string file) -{ - bool autoplain=getSetting<bool>("autoplain"); - bool listvariables=getSetting<bool>("listvariables"); - if(autoplain) Setting("autoplain")=false; // Turn off for speed. - if(listvariables) Setting("listvariables")=false; - - runFile(file); - - if(autoplain) Setting("autoplain")=true; - if(listvariables) Setting("listvariables")=true; -} - struct Args { int argc; @@ -189,13 +170,17 @@ int main(int argc, char *argv[]) Args args(argc,argv); #ifdef HAVE_GL gl::glthread=getSetting<bool>("threads"); -#if HAVE_LIBPTHREAD +#if HAVE_PTHREAD if(gl::glthread) { pthread_t thread; try { if(pthread_create(&thread,NULL,asymain,&args) == 0) { gl::mainthread=pthread_self(); + sigset_t set; + sigemptyset(&set); + sigaddset(&set, SIGCHLD); + pthread_sigmask(SIG_BLOCK, &set, NULL); while(true) { camp::glrenderWrapper(); gl::initialize=true; diff --git a/Build/source/utils/asymptote/opsymbols.pl b/Build/source/utils/asymptote/opsymbols.pl index 6ff3c9d1ecd..06491ad1c69 100755 --- a/Build/source/utils/asymptote/opsymbols.pl +++ b/Build/source/utils/asymptote/opsymbols.pl @@ -39,4 +39,12 @@ while (<lexer>) { if (m/^(\w+)\s*{\s*DEFSYMBOL\((\w+)\);/) { add($1, $2); } + if (m/^\s*EXTRASYMBOL\(\s*(\w+)\s*,\s*(\w+)\s*\)/) { + add($1, $2); + } } + +print header <<END + +/* This file is automatically generated. */ +END diff --git a/Build/source/utils/asymptote/path.cc b/Build/source/utils/asymptote/path.cc index 338c48d7d41..eb5c57ad2d0 100644 --- a/Build/source/utils/asymptote/path.cc +++ b/Build/source/utils/asymptote/path.cc @@ -59,39 +59,42 @@ quadraticroots::quadraticroots(double a, double b, double c) distinct=quadraticroots::NONE; roots=0; } - } else if(b == 0.0) { - double x=-c/a; - if(x >= 0.0) { - distinct=quadraticroots::TWO; - roots=2; - t2=sqrt(x); - t1=-t2; - } else { - distinct=quadraticroots::NONE; - roots=0; - } } else { double factor=0.5*b/a; - double x=-2.0*c/(b*factor); - if(x > -1.0) { - distinct=quadraticroots::TWO; - roots=2; - double r2=factor*sqrt1pxm1(x); - double r1=-r2-2.0*factor; - if(r1 <= r2) { - t1=r1; - t2=r2; + double denom=b*factor; + if(denom == 0.0) { + double x=-c/a; + if(x >= 0.0) { + distinct=quadraticroots::TWO; + roots=2; + t2=sqrt(x); + t1=-t2; } else { - t1=r2; - t2=r1; + distinct=quadraticroots::NONE; + roots=0; } - } else if(x == -1.0) { - distinct=quadraticroots::ONE; - roots=2; - t1=t2=-factor; } else { - distinct=quadraticroots::NONE; - roots=0; + double x=-2.0*c/denom; + if(x > -1.0) { + distinct=quadraticroots::TWO; + roots=2; + double r2=factor*sqrt1pxm1(x); + double r1=-r2-2.0*factor; + if(r1 <= r2) { + t1=r1; + t2=r2; + } else { + t1=r2; + t2=r1; + } + } else if(x == -1.0) { + distinct=quadraticroots::ONE; + roots=2; + t1=t2=-factor; + } else { + distinct=quadraticroots::NONE; + roots=0; + } } } } @@ -110,12 +113,13 @@ Quadraticroots::Quadraticroots(pair a, pair b, pair c) roots=0; } else { roots=2; - if(b == 0.0) { + pair factor=0.5*b/a; + pair denom=b*factor; + if(denom == 0.0) { z1=Sqrt(-c/a); z2=-z1; } else { - pair factor=0.5*b/a; - z1=factor*sqrt1pxm1(-2.0*c/(b*factor)); + z1=factor*sqrt1pxm1(-2.0*c/denom); z2=-z1-2.0*factor; } } diff --git a/Build/source/utils/asymptote/pen.cc b/Build/source/utils/asymptote/pen.cc new file mode 100644 index 00000000000..492bd322eea --- /dev/null +++ b/Build/source/utils/asymptote/pen.cc @@ -0,0 +1,49 @@ +/***** + * pen.cc + * John Bowman + * + *****/ + +#include "pen.h" +#include "drawelement.h" + +namespace camp { + +const double tex2ps=72.0/72.27; +const double ps2tex=1.0/tex2ps; + +const char* DEFPAT="<default>"; +const char* DEFLATEXFONT="\\usefont{\\ASYencoding}{\\ASYfamily}{\\ASYseries}{\\ASYshape}"; +const char* DEFCONTEXTFONT="modern"; +const char* DEFTEXFONT="cmr12"; +const double DEFWIDTH=-1; +const Int DEFCAP=-1; +const Int DEFJOIN=-1; +const double DEFMITER=0; +const transform nullTransform=transform(0.0,0.0,0.0,0.0,0.0,0.0); + +const char* PSCap[]={"butt","round","square"}; +const char* Cap[]={"square","round","extended"}; +const Int nCap=sizeof(Cap)/sizeof(char*); +const char* Join[]={"miter","round","bevel"}; +const Int nJoin=sizeof(Join)/sizeof(char*); +const char* OverwriteTag[]={"Allow","Suppress","SupressQuiet", + "Move","MoveQuiet"}; +const Int nOverwrite=sizeof(OverwriteTag)/sizeof(char*); +const char* FillRuleTag[]={"ZeroWinding","EvenOdd"}; +const Int nFill=sizeof(FillRuleTag)/sizeof(char*); +const char* BaseLineTag[]={"NoAlign","Align"}; +const Int nBaseLine=sizeof(BaseLineTag)/sizeof(char*); + +const char* ColorDeviceSuffix[]={"","","Gray","RGB","CMYK",""}; +const unsigned nColorSpace=sizeof(ColorDeviceSuffix)/sizeof(char*); +const char* BlendMode[]={"Compatible","Normal","Multiply","Screen", + "Overlay","SoftLight","HardLight", + "ColorDodge","ColorBurn","Darken", + "Lighten","Difference","Exclusion", + "Hue","Saturation","Color","Luminosity"}; +const Int nBlendMode=sizeof(BlendMode)/sizeof(char*); + +pen drawElement::lastpen; + +} diff --git a/Build/source/utils/asymptote/pen.h b/Build/source/utils/asymptote/pen.h index 4ba01d62891..591ff0daf9f 100644 --- a/Build/source/utils/asymptote/pen.h +++ b/Build/source/utils/asymptote/pen.h @@ -18,56 +18,8 @@ namespace camp { -static const double tex2ps=72.0/72.27; -static const double ps2tex=1.0/tex2ps; - -static const string DEFPAT="<default>"; -static const string DEFLATEXFONT="\\usefont{\\ASYencoding}{\\ASYfamily}{\\ASYseries}{\\ASYshape}"; -static const string DEFCONTEXTFONT="modern"; -static const string DEFTEXFONT="cmr12"; -static const double DEFWIDTH=-1; -static const Int DEFCAP=-1; -static const Int DEFJOIN=-1; -static const double DEFMITER=0; - -static const struct invisiblepen_t {} invisiblepen={}; -static const struct setlinewidth_t {} setlinewidth={}; -static const struct setfont_t {} setfont={}; -static const struct setfontsize_t {} setfontsize={}; -static const struct setpattern_t {} setpattern={}; -static const struct setlinecap_t {} setlinecap={}; -static const struct setlinejoin_t {} setlinejoin={}; -static const struct setmiterlimit_t {} setmiterlimit={}; -static const struct setoverwrite_t {} setoverwrite={}; -static const struct initialpen_t {} initialpen={}; -static const struct resolvepen_t {} resolvepen={}; - -static const string PSCap[]={"butt","round","square"}; -static const string Cap[]={"square","round","extended"}; -static const string Join[]={"miter","round","bevel"}; -const Int nCap=sizeof(Cap)/sizeof(string); -const Int nJoin=sizeof(Join)/sizeof(string); - -enum overwrite_t {DEFWRITE=-1,ALLOW,SUPPRESS,SUPPRESSQUIET,MOVE,MOVEQUIET}; -static const string OverwriteTag[]={"Allow","Suppress","SupressQuiet", - "Move","MoveQuiet"}; -const Int nOverwrite=sizeof(OverwriteTag)/sizeof(string); - -enum FillRule {DEFFILL=-1,ZEROWINDING,EVENODD}; -static const string FillRuleTag[]={"ZeroWinding","EvenOdd"}; - -const Int nFill=sizeof(FillRuleTag)/sizeof(string); - -enum BaseLine {DEFBASE=-1,NOBASEALIGN,BASEALIGN}; -static const string BaseLineTag[]={"NoAlign","Align"}; -const Int nBaseLine=sizeof(BaseLineTag)/sizeof(string); - -enum ColorSpace {DEFCOLOR=0,INVISIBLE,GRAYSCALE,RGB,CMYK,PATTERN}; -extern const size_t ColorComponents[]; -static const string ColorDeviceSuffix[]={"","","Gray","RGB","CMYK",""}; -const unsigned nColorSpace=sizeof(ColorDeviceSuffix)/sizeof(string); - - +extern const double tex2ps; +extern const double ps2tex; class LineType { @@ -78,12 +30,12 @@ public: bool adjust; // Adjust the line type values to fit the arclength? bool isdefault; + LineType() : offset(0.0), scale(true), adjust(true), isdefault(true) {} + LineType(vm::array pattern, double offset, bool scale, bool adjust) : pattern(pattern), offset(offset), scale(scale), adjust(adjust), isdefault(false) {} - LineType() : offset(0.0), scale(true), adjust(true), isdefault(true) {} - void Scale(double factor) { size_t n=pattern.size(); for(size_t i=0; i < n; i++) @@ -92,7 +44,50 @@ public: } }; -static const LineType DEFLINE; +extern const char* DEFPAT; +extern const char* DEFLATEXFONT; +extern const char* DEFCONTEXTFONT; +extern const char* DEFTEXFONT; +extern const double DEFWIDTH; +extern const Int DEFCAP; +extern const Int DEFJOIN; +extern const double DEFMITER; +extern const transform nullTransform; + +static const struct invisiblepen_t {} invisiblepen={}; +static const struct setlinewidth_t {} setlinewidth={}; +static const struct setfont_t {} setfont={}; +static const struct setfontsize_t {} setfontsize={}; +static const struct setpattern_t {} setpattern={}; +static const struct setlinecap_t {} setlinecap={}; +static const struct setlinejoin_t {} setlinejoin={}; +static const struct setmiterlimit_t {} setmiterlimit={}; +static const struct setoverwrite_t {} setoverwrite={}; +static const struct initialpen_t {} initialpen={}; +static const struct resolvepen_t {} resolvepen={}; + +extern const char* PSCap[]; +extern const char* Cap[]; +extern const Int nCap; +extern const char* Join[]; +extern const Int nJoin; + +enum overwrite_t {DEFWRITE=-1,ALLOW,SUPPRESS,SUPPRESSQUIET,MOVE,MOVEQUIET}; +extern const char* OverwriteTag[]; +extern const Int nOverwrite; + +enum FillRule {DEFFILL=-1,ZEROWINDING,EVENODD}; +extern const char* FillRuleTag[]; +extern const Int nFill; + +enum BaseLine {DEFBASE=-1,NOBASEALIGN,BASEALIGN}; +extern const char* BaseLineTag[]; +extern const Int nBaseLine; + +enum ColorSpace {DEFCOLOR=0,INVISIBLE,GRAYSCALE,RGB,CMYK,PATTERN}; +extern const size_t ColorComponents[]; +extern const char* ColorDeviceSuffix[]; +extern const unsigned nColorSpace; inline bool operator == (const vm::array& a, const vm::array& b) { @@ -128,25 +123,22 @@ class Transparency public: string blend; double opacity; - Transparency(string blend, double opacity) : - blend(blend), opacity(opacity) {} -}; + bool isdefault; -static const Transparency DEFTRANSP("Compatible",1.0); + Transparency() : + blend("Compatible"), opacity(1.0), isdefault(true) {} -inline bool operator == (Transparency a, Transparency b) { + Transparency(const string& blend, double opacity) : + blend(blend), opacity(opacity), isdefault(false) {} +}; + +inline bool operator == (const Transparency& a, const Transparency& b) { return a.blend == b.blend && a.opacity == b.opacity; } -static const string BlendMode[]={"Compatible","Normal","Multiply","Screen", - "Overlay","SoftLight","HardLight", - "ColorDodge","ColorBurn","Darken", - "Lighten","Difference","Exclusion", - "Hue","Saturation","Color","Luminosity"}; -const Int nBlendMode=sizeof(BlendMode)/sizeof(string); +extern const char* BlendMode[]; +extern const Int nBlendMode; -static const transform nullTransform=transform(0.0,0.0,0.0,0.0,0.0,0.0); - // Map [0,1] to [0,255] inline unsigned int byte(double r) { @@ -220,11 +212,11 @@ public: } pen() : - line(DEFLINE), linewidth(DEFWIDTH), P(nullpath), + line(), linewidth(DEFWIDTH), P(nullpath), font(""), fontsize(0.0), lineskip(0.0), color(DEFCOLOR), r(0), g(0), b(0), grey(0), pattern(DEFPAT), fillrule(DEFFILL), baseline(DEFBASE), - transparency(DEFTRANSP), + transparency(), linecap(DEFCAP), linejoin(DEFJOIN), miterlimit(DEFMITER), overwrite(DEFWRITE), t(nullTransform) {} @@ -244,29 +236,29 @@ public: overwrite(overwrite), t(t) {} pen(invisiblepen_t) : - line(DEFLINE), linewidth(DEFWIDTH), P(nullpath), + line(), linewidth(DEFWIDTH), P(nullpath), font(""), fontsize(0.0), lineskip(0.0), color(INVISIBLE), r(0), g(0), b(0), grey(0), pattern(DEFPAT), fillrule(DEFFILL), baseline(DEFBASE), - transparency(DEFTRANSP), + transparency(), linecap(DEFCAP), linejoin(DEFJOIN), miterlimit(DEFMITER), overwrite(DEFWRITE), t(nullTransform) {} pen(setlinewidth_t, double linewidth) : - line(DEFLINE), linewidth(linewidth), P(nullpath), + line(), linewidth(linewidth), P(nullpath), font(""), fontsize(0.0), lineskip(0.0), color(DEFCOLOR), r(0), g(0), b(0), grey(0), pattern(DEFPAT), fillrule(DEFFILL), baseline(DEFBASE), - transparency(DEFTRANSP), + transparency(), linecap(DEFCAP), linejoin(DEFJOIN), miterlimit(DEFMITER), overwrite(DEFWRITE), t(nullTransform) {} pen(path P) : - line(DEFLINE), linewidth(DEFWIDTH), P(P), + line(), linewidth(DEFWIDTH), P(P), font(""), fontsize(0.0), lineskip(0.0), color(DEFCOLOR), r(0), g(0), b(0), grey(0), pattern(DEFPAT), fillrule(DEFFILL), baseline(DEFBASE), - transparency(DEFTRANSP), + transparency(), linecap(DEFCAP), linejoin(DEFJOIN), miterlimit(DEFMITER), overwrite(DEFWRITE), t(nullTransform) {} @@ -275,57 +267,57 @@ public: font(""), fontsize(0.0), lineskip(0.0), color(DEFCOLOR), r(0), g(0), b(0), grey(0), pattern(DEFPAT), fillrule(DEFFILL), baseline(DEFBASE), - transparency(DEFTRANSP), + transparency(), linecap(DEFCAP), linejoin(DEFJOIN), miterlimit(DEFMITER), overwrite(DEFWRITE), t(nullTransform) {} pen(setfont_t, string font) : - line(DEFLINE), linewidth(DEFWIDTH), P(nullpath), + line(), linewidth(DEFWIDTH), P(nullpath), font(font), fontsize(0.0), lineskip(0.0), color(DEFCOLOR), r(0), g(0), b(0), grey(0), pattern(DEFPAT), fillrule(DEFFILL), baseline(DEFBASE), - transparency(DEFTRANSP), + transparency(), linecap(DEFCAP), linejoin(DEFJOIN), miterlimit(DEFMITER), overwrite(DEFWRITE), t(nullTransform) {} pen(setfontsize_t, double fontsize, double lineskip) : - line(DEFLINE), linewidth(DEFWIDTH), P(nullpath), + line(), linewidth(DEFWIDTH), P(nullpath), font(""), fontsize(fontsize), lineskip(lineskip), color(DEFCOLOR), r(0), g(0), b(0), grey(0), pattern(DEFPAT), fillrule(DEFFILL), baseline(DEFBASE), - transparency(DEFTRANSP), + transparency(), linecap(DEFCAP), linejoin(DEFJOIN), miterlimit(DEFMITER), overwrite(DEFWRITE), t(nullTransform) {} pen(setpattern_t, const string& pattern) : - line(DEFLINE), linewidth(DEFWIDTH), P(nullpath), + line(), linewidth(DEFWIDTH), P(nullpath), font(""), fontsize(0.0), lineskip(0.0), color(PATTERN), r(0), g(0), b(0), grey(0), pattern(pattern), fillrule(DEFFILL), baseline(DEFBASE), - transparency(DEFTRANSP), + transparency(), linecap(DEFCAP), linejoin(DEFJOIN), miterlimit(DEFMITER), overwrite(DEFWRITE), t(nullTransform) {} pen(FillRule fillrule) : - line(DEFLINE), linewidth(DEFWIDTH), P(nullpath), + line(), linewidth(DEFWIDTH), P(nullpath), font(""), fontsize(0.0), lineskip(0.0), color(DEFCOLOR), r(0), g(0), b(0), grey(0), pattern(DEFPAT), fillrule(fillrule), baseline(DEFBASE), - transparency(DEFTRANSP), + transparency(), linecap(DEFCAP), linejoin(DEFJOIN), miterlimit(DEFMITER), overwrite(DEFWRITE), t(nullTransform) {} pen(BaseLine baseline) : - line(DEFLINE), linewidth(DEFWIDTH), P(nullpath), + line(), linewidth(DEFWIDTH), P(nullpath), font(""), fontsize(0.0), lineskip(0.0), color(DEFCOLOR), r(0), g(0), b(0), grey(0), pattern(DEFPAT), fillrule(DEFFILL), baseline(baseline), - transparency(DEFTRANSP), + transparency(), linecap(DEFCAP), linejoin(DEFJOIN), miterlimit(DEFMITER), overwrite(DEFWRITE), t(nullTransform) {} pen(const Transparency& transparency) : - line(DEFLINE), linewidth(DEFWIDTH), P(nullpath), + line(), linewidth(DEFWIDTH), P(nullpath), font(""), fontsize(0.0), lineskip(0.0), color(DEFCOLOR), r(0), g(0), b(0), grey(0), pattern(DEFPAT), fillrule(DEFFILL), baseline(DEFBASE), @@ -334,67 +326,67 @@ public: overwrite(DEFWRITE), t(nullTransform) {} pen(setlinecap_t, Int linecap) : - line(DEFLINE), linewidth(DEFWIDTH), P(nullpath), + line(), linewidth(DEFWIDTH), P(nullpath), font(""), fontsize(0.0), lineskip(0.0), color(DEFCOLOR), r(0), g(0), b(0), grey(0), pattern(DEFPAT), fillrule(DEFFILL), baseline(DEFBASE), - transparency(DEFTRANSP), + transparency(), linecap(linecap), linejoin(DEFJOIN), miterlimit(DEFMITER), overwrite(DEFWRITE), t(nullTransform) {} pen(setlinejoin_t, Int linejoin) : - line(DEFLINE), linewidth(DEFWIDTH), P(nullpath), + line(), linewidth(DEFWIDTH), P(nullpath), font(""), fontsize(0.0), lineskip(0.0), color(DEFCOLOR), r(0), g(0), b(0), grey(0), pattern(DEFPAT), fillrule(DEFFILL), baseline(DEFBASE), - transparency(DEFTRANSP), + transparency(), linecap(DEFCAP), linejoin(linejoin), miterlimit(DEFMITER), overwrite(DEFWRITE), t(nullTransform) {} pen(setmiterlimit_t, double miterlimit) : - line(DEFLINE), linewidth(DEFWIDTH), P(nullpath), + line(), linewidth(DEFWIDTH), P(nullpath), font(""), fontsize(0.0), lineskip(0.0), color(DEFCOLOR), r(0), g(0), b(0), grey(0), pattern(DEFPAT), fillrule(DEFFILL), baseline(DEFBASE), - transparency(DEFTRANSP), + transparency(), linecap(DEFCAP), linejoin(DEFJOIN), miterlimit(miterlimit), overwrite(DEFWRITE), t(nullTransform) {} pen(setoverwrite_t, overwrite_t overwrite) : - line(DEFLINE), linewidth(DEFWIDTH), P(nullpath), + line(), linewidth(DEFWIDTH), P(nullpath), font(""), fontsize(0.0), lineskip(0.0), color(DEFCOLOR), r(0), g(0), b(0), grey(0), pattern(DEFPAT), fillrule(DEFFILL), baseline(DEFBASE), - transparency(DEFTRANSP), + transparency(), linecap(DEFCAP), linejoin(DEFJOIN), miterlimit(DEFMITER), overwrite(overwrite), t(nullTransform) {} explicit pen(double grey) : - line(DEFLINE), linewidth(DEFWIDTH), P(nullpath), + line(), linewidth(DEFWIDTH), P(nullpath), font(""), fontsize(0.0), lineskip(0.0), color(GRAYSCALE), r(0.0), g(0.0), b(0.0), grey(pos0(grey)), pattern(DEFPAT), fillrule(DEFFILL), baseline(DEFBASE), - transparency(DEFTRANSP), + transparency(), linecap(DEFCAP), linejoin(DEFJOIN), miterlimit(DEFMITER), overwrite(DEFWRITE), t(nullTransform) {greyrange();} pen(double r, double g, double b) : - line(DEFLINE), linewidth(DEFWIDTH), P(nullpath), + line(), linewidth(DEFWIDTH), P(nullpath), font(""), fontsize(0.0), lineskip(0.0), color(RGB), r(pos0(r)), g(pos0(g)), b(pos0(b)), grey(0.0), pattern(DEFPAT), fillrule(DEFFILL), baseline(DEFBASE), - transparency(DEFTRANSP), + transparency(), linecap(DEFCAP), linejoin(DEFJOIN), miterlimit(DEFMITER), overwrite(DEFWRITE), t(nullTransform) {rgbrange();} pen(double c, double m, double y, double k) : - line(DEFLINE), linewidth(DEFWIDTH), P(nullpath), + line(), linewidth(DEFWIDTH), P(nullpath), font(""), fontsize(0.0), lineskip(0.0), color(CMYK), r(pos0(c)), g(pos0(m)), b(pos0(y)), grey(pos0(k)), pattern(DEFPAT), fillrule(DEFFILL), baseline(DEFBASE), - transparency(DEFTRANSP), + transparency(), linecap(DEFCAP), linejoin(DEFJOIN), miterlimit(DEFMITER), overwrite(DEFWRITE), t(nullTransform) {cmykrange();} @@ -415,15 +407,15 @@ public: return pen(LineType(vm::array(0),0.0,true,true),0.5,nullpath,"", 12.0*tex2ps,12.0*1.2*tex2ps,GRAYSCALE, 0.0,0.0,0.0,0.0,"",ZEROWINDING,NOBASEALIGN, - DEFTRANSP,1,1,10.0,ALLOW,identity); + Transparency(),1,1,10.0,ALLOW,identity); } pen(initialpen_t) : - line(DEFLINE), linewidth(-2.0), P(nullpath), + line(), linewidth(-2.0), P(nullpath), font("<invalid>"), fontsize(-1.0), lineskip(-1.0), color(INVISIBLE), r(0.0), g(0.0), b(0.0), grey(0.0), pattern(DEFPAT), fillrule(DEFFILL), baseline(NOBASEALIGN), - transparency(DEFTRANSP),linecap(-2), linejoin(-2), miterlimit(-1.0), + transparency(),linecap(-2), linejoin(-2), miterlimit(-1.0), overwrite(DEFWRITE), t(nullTransform) {} double width() const { @@ -502,16 +494,16 @@ public: } Transparency transp() const { - return transparency == DEFTRANSP ? defaultpen().transparency : transparency; + return transparency.isdefault ? defaultpen().transparency : transparency; } string blend() const { - return transparency == DEFTRANSP ? defaultpen().transparency.blend : + return transparency.isdefault ? defaultpen().transparency.blend : transparency.blend; } double opacity() const { - return transparency == DEFTRANSP ? defaultpen().transparency.opacity : + return transparency.isdefault ? defaultpen().transparency.opacity : transparency.opacity; } @@ -747,7 +739,7 @@ public: if(P.color == PATTERN && P.pattern.empty()) P.color=DEFCOLOR; ColorSpace colorspace=(ColorSpace) max((Int) P.color,(Int) Q.color); - if(!(p.transparency == DEFTRANSP && q.transparency == DEFTRANSP)) + if(!(p.transparency.isdefault && q.transparency.isdefault)) P.transparency.opacity=max(p.opacity(),q.opacity()); switch(colorspace) { @@ -801,7 +793,7 @@ public: q.pattern == DEFPAT ? p.pattern : q.pattern, q.fillrule == DEFFILL ? p.fillrule : q.fillrule, q.baseline == DEFBASE ? p.baseline : q.baseline, - q.transparency == DEFTRANSP ? p.transparency : q.transparency, + q.transparency.isdefault ? p.transparency : q.transparency, q.linecap == DEFCAP ? p.linecap : q.linecap, q.linejoin == DEFJOIN ? p.linejoin : q.linejoin, q.miterlimit == DEFMITER ? p.miterlimit : q.miterlimit, @@ -914,7 +906,7 @@ public: out << ", fillrule=" << FillRuleTag[p.fillrule]; if(p.baseline != DEFBASE) out << ", baseline=" << BaseLineTag[p.baseline]; - if(!(p.transparency == DEFTRANSP)) { + if(!p.transparency.isdefault) { out << ", opacity=" << p.transparency.opacity; out << ", blend=" << p.transparency.blend; } diff --git a/Build/source/utils/asymptote/picture.cc b/Build/source/utils/asymptote/picture.cc index c11e6e93ae0..9a77cd4d592 100644 --- a/Build/source/utils/asymptote/picture.cc +++ b/Build/source/utils/asymptote/picture.cc @@ -248,7 +248,7 @@ void texinit() name=stripExt(name).substr(0,pos); unlink((name+".aux").c_str()); cmd.push_back("-jobname="+name.substr(0,pos)); -#ifdef __CYGWIN__ +#ifdef __MSDOS__ cmd.push_back("NUL"); // For MikTeX #endif } @@ -966,7 +966,7 @@ Communicate com; void glrenderWrapper() { #ifdef HAVE_GL -#ifdef HAVE_LIBPTHREAD +#ifdef HAVE_PTHREAD wait(initSignal,initLock); endwait(initSignal,initLock); #endif @@ -1012,13 +1012,15 @@ bool picture::shipout3(const string& prefix, const string& format, #ifdef HAVE_GL bool View=settings::view() && view; static int oldpid=0; +#ifdef HAVE_PTHREAD bool animating=getSetting<bool>("animating"); bool Wait=!interact::interactive || !View || animating; #endif +#endif -#ifdef HAVE_LIBGLUT +#if defined(HAVE_LIBGLUT) && defined(HAVE_GL) if(glthread && !offscreen) { -#ifdef HAVE_LIBPTHREAD +#ifdef HAVE_PTHREAD if(gl::initialize) { gl::initialize=false; com.prefix=prefix; @@ -1074,7 +1076,7 @@ bool picture::shipout3(const string& prefix, const string& format, glrender(prefix,this,outputformat,width,height,angle,zoom,m,M,shift,t, background,nlights,lights,diffuse,ambient,specular,viewportlighting, View,oldpid); -#ifdef HAVE_LIBPTHREAD +#ifdef HAVE_PTHREAD if(glthread && !offscreen && Wait) { pthread_cond_wait(&readySignal,&readyLock); pthread_mutex_unlock(&readyLock); diff --git a/Build/source/utils/asymptote/pipestream.h b/Build/source/utils/asymptote/pipestream.h index 20cc6d321b2..dbf73989d7f 100644 --- a/Build/source/utils/asymptote/pipestream.h +++ b/Build/source/utils/asymptote/pipestream.h @@ -194,7 +194,8 @@ public: while(b >= prompt) { if(a < buf) return false; if(*a != *b) return false; - if(*a == '\n' && *(a-1) == '\r') --a; // Handle MSDOS incompatibility + // Handle MSDOS incompatibility: + if(a > buf && *a == '\n' && *(a-1) == '\r') --a; --a; --b; } return true; diff --git a/Build/source/utils/asymptote/policy.h b/Build/source/utils/asymptote/policy.h new file mode 100644 index 00000000000..6898c7410d8 --- /dev/null +++ b/Build/source/utils/asymptote/policy.h @@ -0,0 +1,83 @@ +/***** + * policy.h + * Andy Hammerlindl 2011/09/03 + * + * Defines a low-level C interface for interacting with the interpreter and + * its datatypes. + *****/ + +// TODO: Wrap in namespace. + +typedef long long int_typ; + +typedef struct {} handle_base_typ; +typedef handle_base_typ *handle_typ; +typedef struct {} arguments_base_typ; +typedef arguments_base_typ *arguments_typ; +typedef struct {} state_base_typ; +typedef state_base_typ *state_typ; + +typedef void (*function_typ)(state_typ, void *); + +typedef struct { + const char *buf; + int_typ length; +} string_typ; + +typedef void (*error_callback_typ)(string_typ); + +typedef long arg_rest_option; +#define NORMAL_ARG 45000 +#define REST_ARG 45001 + +typedef struct { + int_typ version; + + handle_typ (*copyHandle)(handle_typ handle); + void (*releaseHandle)(); + + handle_typ (*handleFromInt)(int_typ x); + // For bool, O is false, 1 is true, and no other value is allowed. + handle_typ (*handleFromBool)(int_typ x); + handle_typ (*handleFromDouble)(double x); + handle_typ (*handleFromString)(string_typ x); + handle_typ (*handleFromFunction)(const char *signature, + function_typ f, void *data); + + int_typ (*IntFromHandle)(handle_typ handle); + int_typ (*boolFromHandle)(handle_typ handle); + double (*doubleFromHandle)(handle_typ handle); + // TODO: Note that a pointer and length are returned, but the pointer is + // valid for a limited time only. + string_typ (*stringFromHandle)(handle_typ handle); + +#if 0 + bool (*handleIsOverloaded)(handle_typ handle); + handle_typ (*signatureless)(handle_typ handle); +#endif + + handle_typ (*getField)(handle_typ handle, const char *name); + handle_typ (*getCell)(handle_typ handle, handle_typ index); + + // Adds a field to a datum (possibly a module) and sets it to an initial + // value. + // TODO: Change name to sig. + void (*addField)(handle_typ handle, + const char *name, handle_typ init); + + arguments_typ (*newArguments)(); + void (*releaseArguments)(arguments_typ args); + void (*addArgument)(arguments_typ args, const char *name, handle_typ handle, + arg_rest_option at); + handle_typ (*call)(handle_typ callee, arguments_typ args); + + handle_typ (*globals)(state_typ state); + int_typ (*numParams)(state_typ state); + handle_typ (*getParam)(state_typ state, int_typ index); + void (*setReturnValue)(state_typ state, handle_typ handle); + + // Allows the user sets an error callback, which is called on any error. + void (*setErrorCallback)(error_callback_typ callback); +} policy_typ; + + diff --git a/Build/source/utils/asymptote/prc/oPRCFile.cc b/Build/source/utils/asymptote/prc/oPRCFile.cc index cc4c302209f..b8014544d4a 100644 --- a/Build/source/utils/asymptote/prc/oPRCFile.cc +++ b/Build/source/utils/asymptote/prc/oPRCFile.cc @@ -1099,7 +1099,7 @@ uint32_t oPRCFile::addMaterial(const PRCmaterial &material) else style->color_material_index = material_index; const uint32_t style_index = addStyle(style); - materialMap.insert(make_pair(material,style_index)).first; + materialMap.insert(make_pair(material,style_index)); return style_index; } diff --git a/Build/source/utils/asymptote/prc/writePRC.cc b/Build/source/utils/asymptote/prc/writePRC.cc index ecc6179b36c..9fbbc41013b 100644 --- a/Build/source/utils/asymptote/prc/writePRC.cc +++ b/Build/source/utils/asymptote/prc/writePRC.cc @@ -29,7 +29,7 @@ #include <fstream> #include <sstream> -#ifndef __GNUC__ +#if !defined(__GNUC__) || defined(__clang__) #include <vector> #endif @@ -1292,7 +1292,7 @@ void PRCCompressedFace::serializeCompressedNurbs(PRCbitStream &pbs, double brep const uint32_t number_of_control_point_in_u = degree_in_u + 1; const uint32_t number_of_control_point_in_v = degree_in_v + 1; -#ifdef __GNUC__ +#if defined(__GNUC__) && !defined(__clang__) PRCVector3d P[number_of_control_point_in_u][number_of_control_point_in_v]; #else vector<vector<PRCVector3d> > P(number_of_control_point_in_u, vector<PRCVector3d>(number_of_control_point_in_v)); @@ -1300,7 +1300,7 @@ void PRCCompressedFace::serializeCompressedNurbs(PRCbitStream &pbs, double brep for(uint32_t i=0;i<number_of_control_point_in_u;i++) for(uint32_t j=0;j<number_of_control_point_in_v;j++) P[i][j] = control_point[i*number_of_control_point_in_v+j]; -#ifdef __GNUC__ +#if defined(__GNUC__) && !defined(__clang__) itriple compressed_control_point[number_of_control_point_in_u][number_of_control_point_in_v]; uint32_t control_point_type[number_of_control_point_in_u][number_of_control_point_in_v]; #else diff --git a/Build/source/utils/asymptote/process.cc b/Build/source/utils/asymptote/process.cc index 474b2f3d752..2718e40abe5 100644 --- a/Build/source/utils/asymptote/process.cc +++ b/Build/source/utils/asymptote/process.cc @@ -59,6 +59,26 @@ using absyntax::block; mem::stack<processDataStruct *> processDataStack; +// Exception-safe way to push and pop the process data. +class withProcessData { + // Do not let this object be dynamically allocated. + void *operator new(size_t); + + processDataStruct *pd_ptr; +public: + + withProcessData(processDataStruct *pd_ptr) : pd_ptr(pd_ptr) + { + processDataStack.push(pd_ptr); + } + + ~withProcessData() + { + assert(processDataStack.top() == pd_ptr); + processDataStack.pop(); + } +}; + processDataStruct &processData() { assert(!processDataStack.empty()); return *processDataStack.top(); @@ -70,16 +90,16 @@ processDataStruct &processData() { // ensures that the data is popped even if an exception is thrown. class penv { genv *_ge; - processDataStruct pd; + processDataStruct _pd; // Do not let this object be dynamically allocated. void *operator new(size_t); public: - penv() : _ge(0), pd() { + penv() : _ge(0), _pd() { // Push the processData first, as it needs to be on the stack before genv // is initialized. - processDataStack.push(&pd); + processDataStack.push(&_pd); _ge = new genv; } @@ -89,6 +109,8 @@ public: } genv &ge() { return *_ge; } + + processDataStruct *pd() { return &_pd; } }; @@ -216,6 +238,7 @@ public: } catch(std::bad_alloc&) { outOfMemory(); } catch(quit) { + // Exception to quit running the current code. Nothing more to do. } catch(handled_error) { em.statusError(); } @@ -289,7 +312,7 @@ public: } } - void doRun(transMode tm=TRANS_NORMAL) { + void doExec(transMode tm=TRANS_NORMAL) { // Don't prepare an environment to run the code if there isn't any code. if (getTree()) icore::doRun(false,tm); @@ -320,6 +343,15 @@ public: } }; +void printGreeting(bool interactive) { + if(!getSetting<bool>("quiet")) { + cout << "Welcome to " << PROGRAM << " version " << VERSION << SVN_REVISION; + if(interactive) + cout << " (to view the manual, type help)"; + cout << endl; + } +} + class ifile : public itree { string filename; string outname; @@ -351,6 +383,7 @@ public: } void process(bool purge=false) { + if(verbose > 1) printGreeting(false); try { init(); } catch(handled_error) { @@ -368,13 +401,6 @@ public: } }; -void printGreeting() { - if(!getSetting<bool>("quiet")) - cout << "Welcome to " << PROGRAM << " version " << VERSION << SVN_REVISION - << " (to view the manual, type help)" << endl; -} - - // Add a semi-colon terminator, if one is not there. string terminateLine(const string line) { return (!line.empty() && *(line.rbegin())!=';') ? (line+";") : line; @@ -561,9 +587,6 @@ class iprompt : public icore { // Code ran at start-up. string startline; - // Used for handling quit abbreviation (q). - protoenv *einteractive; - void postRun(coenv &, istack &) { } @@ -618,11 +641,11 @@ class iprompt : public icore { // and return true if they can handle the command. If false is returned, the // line is treated as a normal line of code. // commands is a map of command names to methods which implement the commands. - typedef bool (iprompt::*command)(commandLine); + typedef bool (iprompt::*command)(coenv &, istack &, commandLine); typedef mem::map<CONST string, command> commandMap; commandMap commands; - bool exit(commandLine cl) { + bool exit(coenv &, istack &, commandLine cl) { if (cl.simple()) { // Don't store exit commands in the history file. interact::deleteLastLine(); @@ -632,12 +655,12 @@ class iprompt : public icore { else return false; } - bool q(commandLine cl) { - if(einteractive->ve.getType(symbol::trans("q"))) return false; - return exit(cl); + bool q(coenv &e, istack &s, commandLine cl) { + if(e.e.ve.getType(symbol::trans("q"))) return false; + return exit(e,s,cl); } - bool reset(commandLine cl) { + bool reset(coenv &, istack &, commandLine cl) { if (cl.simple()) { running=false; restart=true; @@ -648,7 +671,7 @@ class iprompt : public icore { else return false; } - bool help(commandLine cl) { + bool help(coenv &, istack &, commandLine cl) { if (cl.simple()) { popupHelp(); return true; @@ -656,16 +679,15 @@ class iprompt : public icore { else return false; } - bool erase(commandLine cl) { - running=false; - restart=true; - if (cl.simple()) - startline="erase()"; - else startline=cl.line; - return true; + bool erase(coenv &e, istack &s, commandLine cl) { + if (cl.simple()) { + runLine(e,s,"erase();"); + return true; + } + else return false; } - bool input(commandLine cl) { + bool input(coenv &, istack &, commandLine cl) { running=false; restart=true; startline="include "+cl.rest; @@ -689,14 +711,14 @@ class iprompt : public icore { #undef ADDCOMMAND } - bool handleCommand(string line) { + bool handleCommand(coenv &e, istack &s, string line) { commandLine cl(line); if (cl.word != "") { commandMap::iterator p=commands.find(cl.word); if (p != commands.end()) { // Execute the command. command &com=p->second; - return (this->*com)(cl); + return (this->*com)(e,s,cl); } else return false; @@ -808,7 +830,6 @@ public: void run(coenv &e, istack &s, transMode=TRANS_NORMAL) { running=true; interact::setCompleter(new trans::envCompleter(e.e)); - einteractive=&(e.e); runStartCode(e, s); @@ -817,15 +838,15 @@ public: string line=getline(false); // Check if it is a special command. - if (handleCommand(line)) + if (handleCommand(e,s,line)) continue; else runLine(e, s, line); } } - void process() { - printGreeting(); + void process(bool purge=false) { + printGreeting(true); interact::init_interactive(); try { setPath("",true); @@ -860,13 +881,13 @@ void processPrompt() { } void runCode(absyntax::block *code) { - icode(code).doRun(); + icode(code).doExec(); } void runString(const string& s, bool interactiveWrite) { - istring(s).doRun(interactiveWrite ? TRANS_INTERACTIVE : TRANS_NORMAL); + istring(s).doExec(interactiveWrite ? TRANS_INTERACTIVE : TRANS_NORMAL); } void runFile(const string& filename) { - ifile(filename).doRun(); + ifile(filename).doExec(); } void runPrompt() { iprompt().doRun(); @@ -894,3 +915,71 @@ void doUnrestrictedList() { e.e.list(0); } +// Environment class used by external programs linking to the shared library. +class fullenv : public gc { + penv pe; + env base_env; + coder base_coder; + coenv e; + + vm::interactiveStack s; + +public: + fullenv() : + pe(), base_env(pe.ge()), base_coder(nullPos, "fullenv"), + e(base_coder, base_env), s() + { + s.setInitMap(pe.ge().getInitMap()); + s.setEnvironment(&e); + + // TODO: Add way to not run autoplain. + runAutoplain(e, s); + } + + coenv &getCoenv() + { + return e; + } + + void runRunnable(runnable *r) + { + assert(!em.errors()); // TODO: Decide how to handle prior errors. + + try { + { withProcessData token(pe.pd()); + ::runRunnable(r, e, s, TRANS_INTERACTIVE); + } + } catch(std::bad_alloc&) { + // TODO: give calling application useful message. + cerr << "out of memory" << endl; + } catch (quit) { + // I'm not sure whether this counts as successfully running the code or + // not. + cerr << "quit exception" << endl; + } catch (handled_error) { + // Normally, this is the result of an error that changes the return code + // of the free-standing asymptote program. + // An error should probably be reported to the application calling the + // asymptote library. + cerr << "handled error" << endl; + } + + em.clear(); + } +}; + +fullenv &getFullEnv() +{ + static fullenv fe; + return fe; +} + +coenv &coenvInOngoingProcess() +{ + return getFullEnv().getCoenv(); +} + +void runInOngoingProcess(runnable *r) +{ + getFullEnv().runRunnable(r); +} diff --git a/Build/source/utils/asymptote/process.h b/Build/source/utils/asymptote/process.h index 42974ff5cf2..514e81feacc 100644 --- a/Build/source/utils/asymptote/process.h +++ b/Build/source/utils/asymptote/process.h @@ -107,7 +107,7 @@ struct processDataStruct { atUpdateFunction=NULL; atBreakpointFunction=NULL; defaultpen=camp::pen::initialpen(); - currentpen=camp::pen(camp::DEFLINE); + currentpen=camp::pen(); } }; diff --git a/Build/source/utils/asymptote/program.cc b/Build/source/utils/asymptote/program.cc index 746b9721da5..8da4d48b523 100644 --- a/Build/source/utils/asymptote/program.cc +++ b/Build/source/utils/asymptote/program.cc @@ -40,14 +40,32 @@ string lookupBltin(bltin b) { ostream& operator<< (ostream& out, const item& i) { + if (i.empty()) + return out << "empty"; + + if (isdefault(i)) + return out << "default"; + #if COMPACT - out << "<item>"; + // TODO: Try to guess the type from the value. + Int n = get<Int>(i); + double x = get<double>(i); + void *p = get<void *>(i); + + if (n == BoolTruthValue) + return out << "true"; + if (n == BoolFalseValue) + return out << "false"; + + if (abs(n) < 1000000) + return out << n; + + if (fabs(x) < 1e30 and fabs(x) > 1e-30) + return out << x; + + return out << "<item " << p << ">"; #else // TODO: Make a data structure mapping typeids to print functions. - if (i.empty()) - out << "empty"; - else if (isdefault(i)) - out << "default"; else if (i.type() == typeid(Int)) out << "Int, value = " << get<Int>(i); else if (i.type() == typeid(double)) @@ -58,7 +76,7 @@ ostream& operator<< (ostream& out, const item& i) out << *(get<callable *>(i)); else if (i.type() == typeid(frame)) { out << "frame"; -#ifdef DEBUG_FRAME +# ifdef DEBUG_FRAME { frame *f = get<frame *>(i); if (f) @@ -66,7 +84,7 @@ ostream& operator<< (ostream& out, const item& i) else out << " <null>"; } -#endif +# endif } else out << "type " << demangle(i.type().name()); diff --git a/Build/source/utils/asymptote/program.h b/Build/source/utils/asymptote/program.h index 84fea7461e0..7e15d2098b9 100644 --- a/Build/source/utils/asymptote/program.h +++ b/Build/source/utils/asymptote/program.h @@ -12,7 +12,7 @@ #include "inst.h" namespace vm { -class inst; +struct inst; class program : public gc { public: diff --git a/Build/source/utils/asymptote/psfile.cc b/Build/source/utils/asymptote/psfile.cc index c2f0f24982e..97e6a803e61 100644 --- a/Build/source/utils/asymptote/psfile.cc +++ b/Build/source/utils/asymptote/psfile.cc @@ -122,7 +122,7 @@ void psfile::close() if(out) { out->flush(); if(!filename.empty()) { -#ifdef __CYGWIN__ +#ifdef __MSDOS__ chmod(filename.c_str(),~settings::mask & 0777); #endif if(!out->good()) diff --git a/Build/source/utils/asymptote/record.h b/Build/source/utils/asymptote/record.h index 6a285e2afc6..2b260f4b83d 100644 --- a/Build/source/utils/asymptote/record.h +++ b/Build/source/utils/asymptote/record.h @@ -24,7 +24,7 @@ using trans::tyEntry; namespace types { -struct record : public ty { +class record : public ty { // The base name of this type. symbol name; diff --git a/Build/source/utils/asymptote/runarray.cc b/Build/source/utils/asymptote/runarray.cc index 0d8e5040c6f..5841f70fa68 100644 --- a/Build/source/utils/asymptote/runarray.cc +++ b/Build/source/utils/asymptote/runarray.cc @@ -180,27 +180,6 @@ array *copyArray2(array *a) return c; } -array *copyArray3(array *a) -{ - size_t size=checkArray(a); - array *c=new array(size); - for(size_t i=0; i < size; i++) { - array *ai=read<array*>(a,i); - size_t aisize=checkArray(ai); - array *ci=new array(aisize); - (*c)[i]=ci; - for(size_t j=0; j < aisize; j++) { - array *aij=read<array*>(ai,j); - size_t aijsize=checkArray(aij); - array *cij=new array(aijsize); - (*ci)[j]=cij; - for(size_t k=0; k < aijsize; k++) - (*cij)[k]=(*aij)[k]; - } - } - return c; -} - double *copyTripleArray2Components(array *a, bool square, size_t dim2, GCPlacement placement) { @@ -491,10 +470,10 @@ void integeroverflow(size_t i) #endif namespace run { // Create an empty array. -#line 446 "runarray.in" +#line 425 "runarray.in" void emptyArray(stack *Stack) { -#line 447 "runarray.in" +#line 426 "runarray.in" {Stack->push<array*>(new array(0)); return;} } @@ -503,11 +482,11 @@ void emptyArray(stack *Stack) // is popped off the stack, followed by each dimension in reverse order. // The array itself is technically a one dimensional array of one // dimension arrays and so on. -#line 456 "runarray.in" +#line 435 "runarray.in" void newDeepArray(stack *Stack) { Int depth=vm::pop<Int>(Stack); -#line 457 "runarray.in" +#line 436 "runarray.in" assert(depth > 0); Int *dims = new Int[depth]; @@ -526,11 +505,11 @@ void newDeepArray(stack *Stack) // Creates an array with elements already specified. First, the number // of elements is popped off the stack, followed by each element in // reverse order. -#line 476 "runarray.in" +#line 455 "runarray.in" void newInitializedArray(stack *Stack) { Int n=vm::pop<Int>(Stack); -#line 477 "runarray.in" +#line 456 "runarray.in" assert(n >= 0); array *a = new array(n); @@ -543,12 +522,12 @@ void newInitializedArray(stack *Stack) // Similar to newInitializedArray, but after the n elements, append another // array to it. -#line 490 "runarray.in" +#line 469 "runarray.in" void newAppendedArray(stack *Stack) { Int n=vm::pop<Int>(Stack); array* tail=vm::pop<array*>(Stack); -#line 491 "runarray.in" +#line 470 "runarray.in" assert(n >= 0); array *a = new array(n); @@ -565,27 +544,43 @@ void newAppendedArray(stack *Stack) // typeDepth is the true depth of the array determined at compile-time when the // operations for the array type are added. This typeDepth argument is // automatically pushed on the stack and is not visible to the user. -#line 508 "runarray.in" -void copyArray(stack *Stack) +#line 487 "runarray.in" +void copyArrayValue(stack *Stack) { Int typeDepth=vm::pop<Int>(Stack); Int depth=vm::pop<Int>(Stack,Int_MAX); item value=vm::pop(Stack); Int n=vm::pop<Int>(Stack); -#line 509 "runarray.in" +#line 488 "runarray.in" if(n < 0) error("cannot create a negative length array"); if(depth < 0) error("cannot copy to a negative depth"); if(depth > typeDepth) depth=typeDepth; {Stack->push<array*>(new array((size_t) n, value, depth)); return;} } +// Deep copy of array. +// typeDepth is the true depth of the array determined at compile-time when the +// operations for the array type are added. This typeDepth argument is +// automatically pushed on the stack and is not visible to the user. +#line 499 "runarray.in" +void copyArray(stack *Stack) +{ + Int typeDepth=vm::pop<Int>(Stack); + Int depth=vm::pop<Int>(Stack,Int_MAX); + array * a=vm::pop<array *>(Stack); +#line 500 "runarray.in" + if(depth < 0) error("cannot copy to a negative depth"); + if(depth > typeDepth) depth=typeDepth; + {Stack->push<array*>(a->copyToDepth(depth)); return;} +} + // Read an element from an array. Checks for initialization & bounds. -#line 517 "runarray.in" +#line 507 "runarray.in" void arrayRead(stack *Stack) { Int n=vm::pop<Int>(Stack); array * a=vm::pop<array *>(Stack); -#line 518 "runarray.in" +#line 508 "runarray.in" item& i=arrayRead(a,n); if (i.empty()) { ostringstream buf; @@ -596,37 +591,37 @@ void arrayRead(stack *Stack) } // Slice a substring from an array. -#line 529 "runarray.in" +#line 519 "runarray.in" void arraySliceRead(stack *Stack) { Int right=vm::pop<Int>(Stack); Int left=vm::pop<Int>(Stack); array * a=vm::pop<array *>(Stack); -#line 530 "runarray.in" +#line 520 "runarray.in" checkArray(a); {Stack->push(a->slice(left, right)); return;} } // Slice a substring from an array. This implements the cases a[i:] and a[:] // where the endpoint is not given, and assumed to be the length of the array. -#line 537 "runarray.in" +#line 527 "runarray.in" void arraySliceReadToEnd(stack *Stack) { Int left=vm::pop<Int>(Stack); array * a=vm::pop<array *>(Stack); -#line 538 "runarray.in" +#line 528 "runarray.in" size_t len=checkArray(a); {Stack->push(a->slice(left, (Int)len)); return;} } // Read an element from an array of arrays. Check bounds and initialize // as necessary. -#line 545 "runarray.in" +#line 535 "runarray.in" void arrayArrayRead(stack *Stack) { Int n=vm::pop<Int>(Stack); array * a=vm::pop<array *>(Stack); -#line 546 "runarray.in" +#line 536 "runarray.in" item& i=arrayRead(a,n); if (i.empty()) i=new array(0); {Stack->push(i); return;} @@ -634,13 +629,13 @@ void arrayArrayRead(stack *Stack) // Write an element to an array. Increase size if necessary. // TODO: Add arrayWriteAndPop -#line 554 "runarray.in" +#line 544 "runarray.in" void arrayWrite(stack *Stack) { item value=vm::pop(Stack); Int n=vm::pop<Int>(Stack); array * a=vm::pop<array *>(Stack); -#line 555 "runarray.in" +#line 545 "runarray.in" size_t len=checkArray(a); bool cyclic=a->cyclic(); if(cyclic && len > 0) n=imod(n,len); @@ -654,27 +649,27 @@ void arrayWrite(stack *Stack) {Stack->push(value); return;} } -#line 569 "runarray.in" +#line 559 "runarray.in" void arraySliceWrite(stack *Stack) { array * src=vm::pop<array *>(Stack); Int right=vm::pop<Int>(Stack); Int left=vm::pop<Int>(Stack); array * dest=vm::pop<array *>(Stack); -#line 570 "runarray.in" +#line 560 "runarray.in" checkArray(src); checkArray(dest); dest->setSlice(left, right, src); {Stack->push<array*>(src); return;} } -#line 577 "runarray.in" +#line 567 "runarray.in" void arraySliceWriteToEnd(stack *Stack) { array * src=vm::pop<array *>(Stack); Int left=vm::pop<Int>(Stack); array * dest=vm::pop<array *>(Stack); -#line 578 "runarray.in" +#line 568 "runarray.in" checkArray(src); size_t len=checkArray(dest); dest->setSlice(left, (Int) len, src); @@ -682,20 +677,20 @@ void arraySliceWriteToEnd(stack *Stack) } // Returns the length of an array. -#line 586 "runarray.in" +#line 576 "runarray.in" void arrayLength(stack *Stack) { array * a=vm::pop<array *>(Stack); -#line 587 "runarray.in" +#line 577 "runarray.in" {Stack->push<Int>((Int) checkArray(a)); return;} } // Returns an array of integers representing the keys of the array. -#line 592 "runarray.in" +#line 582 "runarray.in" void arrayKeys(stack *Stack) { array * a=vm::pop<array *>(Stack); -#line 593 "runarray.in" +#line 583 "runarray.in" size_t size=checkArray(a); array *keys=new array(); @@ -709,33 +704,33 @@ void arrayKeys(stack *Stack) } // Return the cyclic flag for an array. -#line 607 "runarray.in" +#line 597 "runarray.in" void arrayCyclicFlag(stack *Stack) { array * a=vm::pop<array *>(Stack); -#line 608 "runarray.in" +#line 598 "runarray.in" checkArray(a); {Stack->push<bool>(a->cyclic()); return;} } -#line 613 "runarray.in" +#line 603 "runarray.in" void arraySetCyclicFlag(stack *Stack) { array * a=vm::pop<array *>(Stack); bool b=vm::pop<bool>(Stack); -#line 614 "runarray.in" +#line 604 "runarray.in" checkArray(a); a->cyclic(b); {Stack->push<bool>(b); return;} } // Check to see if an array element is initialized. -#line 621 "runarray.in" +#line 611 "runarray.in" void arrayInitializedHelper(stack *Stack) { array * a=vm::pop<array *>(Stack); Int n=vm::pop<Int>(Stack); -#line 622 "runarray.in" +#line 612 "runarray.in" size_t len=checkArray(a); bool cyclic=a->cyclic(); if(cyclic && len > 0) n=imod(n,len); @@ -745,62 +740,62 @@ void arrayInitializedHelper(stack *Stack) } // Returns the initialize method for an array. -#line 632 "runarray.in" +#line 622 "runarray.in" void arrayInitialized(stack *Stack) { array * a=vm::pop<array *>(Stack); -#line 633 "runarray.in" +#line 623 "runarray.in" {Stack->push<callable*>(new thunk(new bfunc(arrayInitializedHelper),a)); return;} } // The helper function for the cyclic method that sets the cyclic flag. -#line 638 "runarray.in" +#line 628 "runarray.in" void arrayCyclicHelper(stack *Stack) { array * a=vm::pop<array *>(Stack); bool b=vm::pop<bool>(Stack); -#line 639 "runarray.in" +#line 629 "runarray.in" checkArray(a); a->cyclic(b); } // Set the cyclic flag for an array. -#line 645 "runarray.in" +#line 635 "runarray.in" void arrayCyclic(stack *Stack) { array * a=vm::pop<array *>(Stack); -#line 646 "runarray.in" +#line 636 "runarray.in" {Stack->push<callable*>(new thunk(new bfunc(arrayCyclicHelper),a)); return;} } // The helper function for the push method that does the actual operation. -#line 651 "runarray.in" +#line 641 "runarray.in" void arrayPushHelper(stack *Stack) { array * a=vm::pop<array *>(Stack); item x=vm::pop(Stack); -#line 652 "runarray.in" +#line 642 "runarray.in" checkArray(a); a->push(x); {Stack->push(x); return;} } // Returns the push method for an array. -#line 659 "runarray.in" +#line 649 "runarray.in" void arrayPush(stack *Stack) { array * a=vm::pop<array *>(Stack); -#line 660 "runarray.in" +#line 650 "runarray.in" {Stack->push<callable*>(new thunk(new bfunc(arrayPushHelper),a)); return;} } // The helper function for the append method that appends b to a. -#line 665 "runarray.in" +#line 655 "runarray.in" void arrayAppendHelper(stack *Stack) { array * a=vm::pop<array *>(Stack); array * b=vm::pop<array *>(Stack); -#line 666 "runarray.in" +#line 656 "runarray.in" checkArray(a); size_t size=checkArray(b); for(size_t i=0; i < size; i++) @@ -808,20 +803,20 @@ void arrayAppendHelper(stack *Stack) } // Returns the append method for an array. -#line 674 "runarray.in" +#line 664 "runarray.in" void arrayAppend(stack *Stack) { array * a=vm::pop<array *>(Stack); -#line 675 "runarray.in" +#line 665 "runarray.in" {Stack->push<callable*>(new thunk(new bfunc(arrayAppendHelper),a)); return;} } // The helper function for the pop method. -#line 680 "runarray.in" +#line 670 "runarray.in" void arrayPopHelper(stack *Stack) { array * a=vm::pop<array *>(Stack); -#line 681 "runarray.in" +#line 671 "runarray.in" size_t asize=checkArray(a); if(asize == 0) error("cannot pop element from empty array"); @@ -829,22 +824,22 @@ void arrayPopHelper(stack *Stack) } // Returns the pop method for an array. -#line 689 "runarray.in" +#line 679 "runarray.in" void arrayPop(stack *Stack) { array * a=vm::pop<array *>(Stack); -#line 690 "runarray.in" +#line 680 "runarray.in" {Stack->push<callable*>(new thunk(new bfunc(arrayPopHelper),a)); return;} } // The helper function for the insert method. -#line 695 "runarray.in" +#line 685 "runarray.in" void arrayInsertHelper(stack *Stack) { array * a=vm::pop<array *>(Stack); array * x=vm::pop<array *>(Stack); Int i=vm::pop<Int>(Stack); -#line 696 "runarray.in" +#line 686 "runarray.in" size_t asize=checkArray(a); checkArray(x); if(a->cyclic() && asize > 0) i=imod(i,asize); @@ -854,39 +849,39 @@ void arrayInsertHelper(stack *Stack) } // Returns the insert method for an array. -#line 706 "runarray.in" +#line 696 "runarray.in" void arrayInsert(stack *Stack) { array * a=vm::pop<array *>(Stack); -#line 707 "runarray.in" +#line 697 "runarray.in" {Stack->push<callable*>(new thunk(new bfunc(arrayInsertHelper),a)); return;} } // Returns the delete method for an array. -#line 712 "runarray.in" +#line 702 "runarray.in" void arrayDelete(stack *Stack) { array * a=vm::pop<array *>(Stack); -#line 713 "runarray.in" +#line 703 "runarray.in" {Stack->push<callable*>(new thunk(new bfunc(arrayDeleteHelper),a)); return;} } -#line 717 "runarray.in" +#line 707 "runarray.in" void arrayAlias(stack *Stack) { array * b=vm::pop<array *>(Stack); array * a=vm::pop<array *>(Stack); -#line 718 "runarray.in" +#line 708 "runarray.in" {Stack->push<bool>(a==b); return;} } // Return array formed by indexing array a with elements of integer array b -#line 723 "runarray.in" +#line 713 "runarray.in" void arrayIntArray(stack *Stack) { array * b=vm::pop<array *>(Stack); array * a=vm::pop<array *>(Stack); -#line 724 "runarray.in" +#line 714 "runarray.in" size_t asize=checkArray(a); size_t bsize=checkArray(b); array *r=new array(bsize); @@ -904,13 +899,13 @@ void arrayIntArray(stack *Stack) // returns the complement of the integer array a in {0,2,...,n-1}, // so that b[complement(a,b.length)] yields the complement of b[a]. -#line 742 "runarray.in" +#line 732 "runarray.in" // Intarray* complement(Intarray *a, Int n); -void gen_runarray31(stack *Stack) +void gen_runarray32(stack *Stack) { Int n=vm::pop<Int>(Stack); Intarray * a=vm::pop<Intarray *>(Stack); -#line 743 "runarray.in" +#line 733 "runarray.in" size_t asize=checkArray(a); array *r=new array(0); bool *keep=new bool[n]; @@ -927,12 +922,12 @@ void gen_runarray31(stack *Stack) } // Generate the sequence {f(i) : i=0,1,...n-1} given a function f and integer n -#line 760 "runarray.in" +#line 750 "runarray.in" void arraySequence(stack *Stack) { Int n=vm::pop<Int>(Stack); callable * f=vm::pop<callable *>(Stack); -#line 761 "runarray.in" +#line 751 "runarray.in" if(n < 0) n=0; array *a=new array(n); for(Int i=0; i < n; ++i) { @@ -944,12 +939,12 @@ void arraySequence(stack *Stack) } // Return the array {0,1,...n-1} -#line 773 "runarray.in" +#line 763 "runarray.in" // Intarray* sequence(Int n); -void gen_runarray33(stack *Stack) +void gen_runarray34(stack *Stack) { Int n=vm::pop<Int>(Stack); -#line 774 "runarray.in" +#line 764 "runarray.in" if(n < 0) n=0; array *a=new array(n); for(Int i=0; i < n; ++i) { @@ -959,12 +954,12 @@ void gen_runarray33(stack *Stack) } // Apply a function to each element of an array -#line 784 "runarray.in" +#line 774 "runarray.in" void arrayFunction(stack *Stack) { array * a=vm::pop<array *>(Stack); callable * f=vm::pop<callable *>(Stack); -#line 785 "runarray.in" +#line 775 "runarray.in" size_t size=checkArray(a); array *b=new array(size); for(size_t i=0; i < size; ++i) { @@ -975,12 +970,12 @@ void arrayFunction(stack *Stack) {Stack->push<array*>(b); return;} } -#line 796 "runarray.in" +#line 786 "runarray.in" void arraySort(stack *Stack) { callable * less=vm::pop<callable *>(Stack); array * a=vm::pop<array *>(Stack); -#line 797 "runarray.in" +#line 787 "runarray.in" array *c=copyArray(a); compareFunc=less; FuncStack=Stack; @@ -988,13 +983,13 @@ void arraySort(stack *Stack) {Stack->push<array*>(c); return;} } -#line 805 "runarray.in" +#line 795 "runarray.in" void arraySearch(stack *Stack) { callable * less=vm::pop<callable *>(Stack); item key=vm::pop(Stack); array * a=vm::pop<array *>(Stack); -#line 806 "runarray.in" +#line 796 "runarray.in" size_t size=a->size(); compareFunc=less; FuncStack=Stack; @@ -1012,12 +1007,12 @@ void arraySearch(stack *Stack) {Stack->push<Int>(0); return;} } -#line 824 "runarray.in" +#line 814 "runarray.in" // bool all(boolarray *a); -void gen_runarray37(stack *Stack) +void gen_runarray38(stack *Stack) { boolarray * a=vm::pop<boolarray *>(Stack); -#line 825 "runarray.in" +#line 815 "runarray.in" size_t size=checkArray(a); bool c=true; for(size_t i=0; i < size; i++) @@ -1025,12 +1020,12 @@ void gen_runarray37(stack *Stack) {Stack->push<bool>(c); return;} } -#line 833 "runarray.in" +#line 823 "runarray.in" // boolarray* !(boolarray* a); -void gen_runarray38(stack *Stack) +void gen_runarray39(stack *Stack) { boolarray* a=vm::pop<boolarray*>(Stack); -#line 834 "runarray.in" +#line 824 "runarray.in" size_t size=checkArray(a); array *c=new array(size); for(size_t i=0; i < size; i++) @@ -1038,12 +1033,12 @@ void gen_runarray38(stack *Stack) {Stack->push<boolarray*>(c); return;} } -#line 842 "runarray.in" +#line 832 "runarray.in" // Int sum(boolarray *a); -void gen_runarray39(stack *Stack) +void gen_runarray40(stack *Stack) { boolarray * a=vm::pop<boolarray *>(Stack); -#line 843 "runarray.in" +#line 833 "runarray.in" size_t size=checkArray(a); Int sum=0; for(size_t i=0; i < size; i++) @@ -1051,19 +1046,11 @@ void gen_runarray39(stack *Stack) {Stack->push<Int>(sum); return;} } -#line 851 "runarray.in" -void arrayCopy(stack *Stack) -{ - array * a=vm::pop<array *>(Stack); -#line 852 "runarray.in" - {Stack->push<array*>(copyArray(a)); return;} -} - -#line 856 "runarray.in" +#line 841 "runarray.in" void arrayConcat(stack *Stack) { array * a=vm::pop<array *>(Stack); -#line 857 "runarray.in" +#line 842 "runarray.in" // a is an array of arrays to be concatenated together. // The signature is // T[] concat(... T[][] a); @@ -1090,27 +1077,11 @@ void arrayConcat(stack *Stack) {Stack->push<array*>(result); return;} } -#line 884 "runarray.in" -void array2Copy(stack *Stack) -{ - array * a=vm::pop<array *>(Stack); -#line 885 "runarray.in" - {Stack->push<array*>(copyArray2(a)); return;} -} - -#line 889 "runarray.in" -void array3Copy(stack *Stack) -{ - array * a=vm::pop<array *>(Stack); -#line 890 "runarray.in" - {Stack->push<array*>(copyArray3(a)); return;} -} - -#line 894 "runarray.in" +#line 869 "runarray.in" void array2Transpose(stack *Stack) { array * a=vm::pop<array *>(Stack); -#line 895 "runarray.in" +#line 870 "runarray.in" size_t asize=checkArray(a); array *c=new array(0); for(size_t i=0; i < asize; i++) { @@ -1137,12 +1108,12 @@ void array2Transpose(stack *Stack) // permutation (021 or 120, etc; original is 012). // Transpose by sending respective members to the permutated locations: // return the array obtained by putting a[i][j][k] into position perm{ijk}. -#line 922 "runarray.in" +#line 897 "runarray.in" void array3Transpose(stack *Stack) { array * perm=vm::pop<array *>(Stack); array * a=vm::pop<array *>(Stack); -#line 923 "runarray.in" +#line 898 "runarray.in" const size_t DIM=3; if(checkArray(perm) != DIM) { @@ -1226,13 +1197,13 @@ void array3Transpose(stack *Stack) // In a boolean array, find the index of the nth true value or -1 if not found // If n is negative, search backwards. -#line 1007 "runarray.in" +#line 982 "runarray.in" // Int find(boolarray *a, Int n=1); -void gen_runarray46(stack *Stack) +void gen_runarray44(stack *Stack) { Int n=vm::pop<Int>(Stack,1); boolarray * a=vm::pop<boolarray *>(Stack); -#line 1008 "runarray.in" +#line 983 "runarray.in" size_t size=checkArray(a); Int j=-1; if(n > 0) @@ -1250,13 +1221,13 @@ void gen_runarray46(stack *Stack) // construct vector obtained by replacing those elements of b for which the // corresponding elements of a are false by the corresponding element of c. -#line 1026 "runarray.in" +#line 1001 "runarray.in" void arrayConditional(stack *Stack) { array * c=vm::pop<array *>(Stack); array * b=vm::pop<array *>(Stack); array * a=vm::pop<array *>(Stack); -#line 1027 "runarray.in" +#line 1002 "runarray.in" size_t size=checkArray(a); array *r=new array(size); if(b && c) { @@ -1280,22 +1251,22 @@ void arrayConditional(stack *Stack) } // Return an n x n identity matrix. -#line 1051 "runarray.in" +#line 1026 "runarray.in" // realarray2* identity(Int n); -void gen_runarray48(stack *Stack) +void gen_runarray46(stack *Stack) { Int n=vm::pop<Int>(Stack); -#line 1052 "runarray.in" +#line 1027 "runarray.in" {Stack->push<realarray2*>(Identity(n)); return;} } // Return the inverse of an n x n matrix a using Gauss-Jordan elimination. -#line 1057 "runarray.in" +#line 1032 "runarray.in" // realarray2* inverse(realarray2 *a); -void gen_runarray49(stack *Stack) +void gen_runarray47(stack *Stack) { realarray2 * a=vm::pop<realarray2 *>(Stack); -#line 1058 "runarray.in" +#line 1033 "runarray.in" a=copyArray2(a); size_t n=checkArray(a); checkSquare(a); @@ -1388,14 +1359,14 @@ void gen_runarray49(stack *Stack) // Solve the linear equation ax=b by LU decomposition, returning the // solution x, where a is an n x n matrix and b is an array of length n. // If no solution exists, return an empty array. -#line 1151 "runarray.in" +#line 1126 "runarray.in" // realarray* solve(realarray2 *a, realarray *b, bool warn=true); -void gen_runarray50(stack *Stack) +void gen_runarray48(stack *Stack) { bool warn=vm::pop<bool>(Stack,true); realarray * b=vm::pop<realarray *>(Stack); realarray2 * a=vm::pop<realarray2 *>(Stack); -#line 1152 "runarray.in" +#line 1127 "runarray.in" size_t n=checkArray(a); if(n == 0) {Stack->push<realarray*>(new array(0)); return;} @@ -1447,14 +1418,14 @@ void gen_runarray50(stack *Stack) // Solve the linear equation ax=b by LU decomposition, returning the // solution x, where a is an n x n matrix and b is an n x m matrix. // If no solution exists, return an empty array. -#line 1204 "runarray.in" +#line 1179 "runarray.in" // realarray2* solve(realarray2 *a, realarray2 *b, bool warn=true); -void gen_runarray51(stack *Stack) +void gen_runarray49(stack *Stack) { bool warn=vm::pop<bool>(Stack,true); realarray2 * b=vm::pop<realarray2 *>(Stack); realarray2 * a=vm::pop<realarray2 *>(Stack); -#line 1205 "runarray.in" +#line 1180 "runarray.in" size_t n=checkArray(a); if(n == 0) {Stack->push<realarray2*>(new array(0)); return;} @@ -1516,12 +1487,12 @@ void gen_runarray51(stack *Stack) } // Compute the determinant of an n x n matrix. -#line 1267 "runarray.in" +#line 1242 "runarray.in" // real determinant(realarray2 *a); -void gen_runarray52(stack *Stack) +void gen_runarray50(stack *Stack) { realarray2 * a=vm::pop<realarray2 *>(Stack); -#line 1268 "runarray.in" +#line 1243 "runarray.in" real *A; copyArray2C(A,a); size_t n=checkArray(a); @@ -1536,13 +1507,13 @@ void gen_runarray52(stack *Stack) {Stack->push<real>(det); return;} } -#line 1283 "runarray.in" +#line 1258 "runarray.in" // realarray* *(realarray2 *a, realarray *b); -void gen_runarray53(stack *Stack) +void gen_runarray51(stack *Stack) { realarray * b=vm::pop<realarray *>(Stack); realarray2 * a=vm::pop<realarray2 *>(Stack); -#line 1284 "runarray.in" +#line 1259 "runarray.in" size_t n=checkArray(a); size_t m=checkArray(b); array *c=new array(n); @@ -1560,13 +1531,13 @@ void gen_runarray53(stack *Stack) {Stack->push<realarray*>(c); return;} } -#line 1302 "runarray.in" +#line 1277 "runarray.in" // realarray* *(realarray *a, realarray2 *b); -void gen_runarray54(stack *Stack) +void gen_runarray52(stack *Stack) { realarray2 * b=vm::pop<realarray2 *>(Stack); realarray * a=vm::pop<realarray *>(Stack); -#line 1303 "runarray.in" +#line 1278 "runarray.in" size_t n=checkArray(a); if(n != checkArray(b)) error(incommensurate); real *A; @@ -1594,53 +1565,53 @@ void gen_runarray54(stack *Stack) {Stack->push<realarray*>(c); return;} } -#line 1331 "runarray.in" +#line 1306 "runarray.in" // Intarray2* *(Intarray2 *a, Intarray2 *b); -void gen_runarray55(stack *Stack) +void gen_runarray53(stack *Stack) { Intarray2 * b=vm::pop<Intarray2 *>(Stack); Intarray2 * a=vm::pop<Intarray2 *>(Stack); -#line 1332 "runarray.in" +#line 1307 "runarray.in" {Stack->push<Intarray2*>(mult<Int>(a,b)); return;} } -#line 1336 "runarray.in" +#line 1311 "runarray.in" // realarray2* *(realarray2 *a, realarray2 *b); -void gen_runarray56(stack *Stack) +void gen_runarray54(stack *Stack) { realarray2 * b=vm::pop<realarray2 *>(Stack); realarray2 * a=vm::pop<realarray2 *>(Stack); -#line 1337 "runarray.in" +#line 1312 "runarray.in" {Stack->push<realarray2*>(mult<real>(a,b)); return;} } -#line 1341 "runarray.in" +#line 1316 "runarray.in" // pairarray2* *(pairarray2 *a, pairarray2 *b); -void gen_runarray57(stack *Stack) +void gen_runarray55(stack *Stack) { pairarray2 * b=vm::pop<pairarray2 *>(Stack); pairarray2 * a=vm::pop<pairarray2 *>(Stack); -#line 1342 "runarray.in" +#line 1317 "runarray.in" {Stack->push<pairarray2*>(mult<pair>(a,b)); return;} } -#line 1346 "runarray.in" +#line 1321 "runarray.in" // triple *(realarray2 *t, triple v); -void gen_runarray58(stack *Stack) +void gen_runarray56(stack *Stack) { triple v=vm::pop<triple>(Stack); realarray2 * t=vm::pop<realarray2 *>(Stack); -#line 1347 "runarray.in" +#line 1322 "runarray.in" {Stack->push<triple>(*t*v); return;} } -#line 1351 "runarray.in" +#line 1326 "runarray.in" // pair project(triple v, realarray2 *t); -void gen_runarray59(stack *Stack) +void gen_runarray57(stack *Stack) { realarray2 * t=vm::pop<realarray2 *>(Stack); triple v=vm::pop<triple>(Stack); -#line 1352 "runarray.in" +#line 1327 "runarray.in" size_t n=checkArray(t); if(n != 4) error(incommensurate); array *t0=read<array*>(t,0); @@ -1665,13 +1636,13 @@ void gen_runarray59(stack *Stack) } // Compute the dot product of vectors a and b. -#line 1377 "runarray.in" +#line 1352 "runarray.in" // real dot(realarray *a, realarray *b); -void gen_runarray60(stack *Stack) +void gen_runarray58(stack *Stack) { realarray * b=vm::pop<realarray *>(Stack); realarray * a=vm::pop<realarray *>(Stack); -#line 1378 "runarray.in" +#line 1353 "runarray.in" size_t n=checkArrays(a,b); real sum=0.0; for(size_t i=0; i < n; ++i) @@ -1680,13 +1651,13 @@ void gen_runarray60(stack *Stack) } // Compute the complex dot product of vectors a and b. -#line 1387 "runarray.in" +#line 1362 "runarray.in" // pair dot(pairarray *a, pairarray *b); -void gen_runarray61(stack *Stack) +void gen_runarray59(stack *Stack) { pairarray * b=vm::pop<pairarray *>(Stack); pairarray * a=vm::pop<pairarray *>(Stack); -#line 1388 "runarray.in" +#line 1363 "runarray.in" size_t n=checkArrays(a,b); pair sum=zero; for(size_t i=0; i < n; ++i) @@ -1701,15 +1672,15 @@ void gen_runarray61(stack *Stack) // [ a[2] b[2] c[2] ] // [ ... ] // [ c[n-1] a[n-1] b[n-1] ] -#line 1403 "runarray.in" +#line 1378 "runarray.in" // realarray* tridiagonal(realarray *a, realarray *b, realarray *c, realarray *f); -void gen_runarray62(stack *Stack) +void gen_runarray60(stack *Stack) { realarray * f=vm::pop<realarray *>(Stack); realarray * c=vm::pop<realarray *>(Stack); realarray * b=vm::pop<realarray *>(Stack); realarray * a=vm::pop<realarray *>(Stack); -#line 1404 "runarray.in" +#line 1379 "runarray.in" size_t n=checkArrays(a,b); checkEqual(n,checkArray(c)); checkEqual(n,checkArray(f)); @@ -1806,16 +1777,16 @@ void gen_runarray62(stack *Stack) } // Root solve by Newton-Raphson -#line 1501 "runarray.in" +#line 1476 "runarray.in" // real newton(Int iterations=100, callableReal *f, callableReal *fprime, real x, bool verbose=false); -void gen_runarray63(stack *Stack) +void gen_runarray61(stack *Stack) { bool verbose=vm::pop<bool>(Stack,false); real x=vm::pop<real>(Stack); callableReal * fprime=vm::pop<callableReal *>(Stack); callableReal * f=vm::pop<callableReal *>(Stack); Int iterations=vm::pop<Int>(Stack,100); -#line 1503 "runarray.in" +#line 1478 "runarray.in" static const real fuzz=1000.0*DBL_EPSILON; Int i=0; size_t oldPrec=0; @@ -1861,9 +1832,9 @@ void gen_runarray63(stack *Stack) // Root solve by Newton-Raphson bisection // cf. routine rtsafe (Press et al., Numerical Recipes, 1991). -#line 1549 "runarray.in" +#line 1524 "runarray.in" // real newton(Int iterations=100, callableReal *f, callableReal *fprime, real x1, real x2, bool verbose=false); -void gen_runarray64(stack *Stack) +void gen_runarray62(stack *Stack) { bool verbose=vm::pop<bool>(Stack,false); real x2=vm::pop<real>(Stack); @@ -1871,7 +1842,7 @@ void gen_runarray64(stack *Stack) callableReal * fprime=vm::pop<callableReal *>(Stack); callableReal * f=vm::pop<callableReal *>(Stack); Int iterations=vm::pop<Int>(Stack,100); -#line 1551 "runarray.in" +#line 1526 "runarray.in" static const real fuzz=1000.0*DBL_EPSILON; size_t oldPrec=0; if(verbose) @@ -1949,16 +1920,16 @@ void gen_runarray64(stack *Stack) {Stack->push<real>((j == iterations) ? DBL_MAX : x); return;} } -#line 1629 "runarray.in" +#line 1604 "runarray.in" // real simpson(callableReal *f, real a, real b, real acc=DBL_EPSILON, real dxmax=0); -void gen_runarray65(stack *Stack) +void gen_runarray63(stack *Stack) { real dxmax=vm::pop<real>(Stack,0); real acc=vm::pop<real>(Stack,DBL_EPSILON); real b=vm::pop<real>(Stack); real a=vm::pop<real>(Stack); callableReal * f=vm::pop<callableReal *>(Stack); -#line 1631 "runarray.in" +#line 1606 "runarray.in" real integral; if(dxmax <= 0) dxmax=fabs(b-a); Func=f; @@ -1969,13 +1940,13 @@ void gen_runarray65(stack *Stack) } // Compute the fast Fourier transform of a pair array -#line 1642 "runarray.in" +#line 1617 "runarray.in" // pairarray* fft(pairarray *a, Int sign=1); -void gen_runarray66(stack *Stack) +void gen_runarray64(stack *Stack) { Int sign=vm::pop<Int>(Stack,1); pairarray * a=vm::pop<pairarray *>(Stack); -#line 1643 "runarray.in" +#line 1618 "runarray.in" unsigned n=(unsigned) checkArray(a); #ifdef HAVE_LIBFFTW3 array *c=new array(n); @@ -2004,12 +1975,12 @@ void gen_runarray66(stack *Stack) {Stack->push<pairarray*>(c); return;} } -#line 1672 "runarray.in" +#line 1647 "runarray.in" // Intarray2* triangulate(pairarray *z); -void gen_runarray67(stack *Stack) +void gen_runarray65(stack *Stack) { pairarray * z=vm::pop<pairarray *>(Stack); -#line 1673 "runarray.in" +#line 1648 "runarray.in" size_t nv=checkArray(z); // Call robust version of Gilles Dumoulin's port of Paul Bourke's // triangulation code. @@ -2043,12 +2014,12 @@ void gen_runarray67(stack *Stack) {Stack->push<Intarray2*>(t); return;} } -#line 1707 "runarray.in" +#line 1682 "runarray.in" // real norm(realarray *a); -void gen_runarray68(stack *Stack) +void gen_runarray66(stack *Stack) { realarray * a=vm::pop<realarray *>(Stack); -#line 1708 "runarray.in" +#line 1683 "runarray.in" size_t n=checkArray(a); real M=0.0; for(size_t i=0; i < n; ++i) { @@ -2058,12 +2029,12 @@ void gen_runarray68(stack *Stack) {Stack->push<real>(M); return;} } -#line 1718 "runarray.in" +#line 1693 "runarray.in" // real norm(realarray2 *a); -void gen_runarray69(stack *Stack) +void gen_runarray67(stack *Stack) { realarray2 * a=vm::pop<realarray2 *>(Stack); -#line 1719 "runarray.in" +#line 1694 "runarray.in" size_t n=checkArray(a); real M=0.0; for(size_t i=0; i < n; ++i) { @@ -2077,12 +2048,12 @@ void gen_runarray69(stack *Stack) {Stack->push<real>(M); return;} } -#line 1733 "runarray.in" +#line 1708 "runarray.in" // real norm(triplearray2 *a); -void gen_runarray70(stack *Stack) +void gen_runarray68(stack *Stack) { triplearray2 * a=vm::pop<triplearray2 *>(Stack); -#line 1734 "runarray.in" +#line 1709 "runarray.in" size_t n=checkArray(a); real M=0.0; for(size_t i=0; i < n; ++i) { @@ -2096,12 +2067,12 @@ void gen_runarray70(stack *Stack) {Stack->push<real>(sqrt(M)); return;} } -#line 1748 "runarray.in" +#line 1723 "runarray.in" // real change2(triplearray2 *a); -void gen_runarray71(stack *Stack) +void gen_runarray69(stack *Stack) { triplearray2 * a=vm::pop<triplearray2 *>(Stack); -#line 1749 "runarray.in" +#line 1724 "runarray.in" size_t n=checkArray(a); if(n == 0) {Stack->push<real>(0.0); return;} @@ -2122,13 +2093,13 @@ void gen_runarray71(stack *Stack) {Stack->push<real>(M); return;} } -#line 1770 "runarray.in" +#line 1745 "runarray.in" // triple minbezier(triplearray2 *P, triple b); -void gen_runarray72(stack *Stack) +void gen_runarray70(stack *Stack) { triple b=vm::pop<triple>(Stack); triplearray2 * P=vm::pop<triplearray2 *>(Stack); -#line 1771 "runarray.in" +#line 1746 "runarray.in" real *A=copyTripleArray2Components(P,true,4); b=triple(bound(A,::min,b.getx(),sqrtFuzz*norm(A,16)), bound(A+16,::min,b.gety(),sqrtFuzz*norm(A+16,16)), @@ -2137,13 +2108,13 @@ void gen_runarray72(stack *Stack) {Stack->push<triple>(b); return;} } -#line 1780 "runarray.in" +#line 1755 "runarray.in" // triple maxbezier(triplearray2 *P, triple b); -void gen_runarray73(stack *Stack) +void gen_runarray71(stack *Stack) { triple b=vm::pop<triple>(Stack); triplearray2 * P=vm::pop<triplearray2 *>(Stack); -#line 1781 "runarray.in" +#line 1756 "runarray.in" real *A=copyTripleArray2Components(P,true,4); b=triple(bound(A,::max,b.getx(),sqrtFuzz*norm(A,16)), bound(A+16,::max,b.gety(),sqrtFuzz*norm(A+16,16)), @@ -2152,13 +2123,13 @@ void gen_runarray73(stack *Stack) {Stack->push<triple>(b); return;} } -#line 1790 "runarray.in" +#line 1765 "runarray.in" // pair minratio(triplearray2 *P, pair b); -void gen_runarray74(stack *Stack) +void gen_runarray72(stack *Stack) { pair b=vm::pop<pair>(Stack); triplearray2 * P=vm::pop<triplearray2 *>(Stack); -#line 1791 "runarray.in" +#line 1766 "runarray.in" triple *A; copyArray2C(A,P,true,4); real fuzz=sqrtFuzz*norm(A,16); @@ -2168,13 +2139,13 @@ void gen_runarray74(stack *Stack) {Stack->push<pair>(b); return;} } -#line 1801 "runarray.in" +#line 1776 "runarray.in" // pair maxratio(triplearray2 *P, pair b); -void gen_runarray75(stack *Stack) +void gen_runarray73(stack *Stack) { pair b=vm::pop<pair>(Stack); triplearray2 * P=vm::pop<triplearray2 *>(Stack); -#line 1802 "runarray.in" +#line 1777 "runarray.in" triple *A; copyArray2C(A,P,true,4); real fuzz=sqrtFuzz*norm(A,16); @@ -2184,11 +2155,11 @@ void gen_runarray75(stack *Stack) {Stack->push<pair>(b); return;} } -#line 1812 "runarray.in" +#line 1787 "runarray.in" // realarray* _projection(); -void gen_runarray76(stack *Stack) +void gen_runarray74(stack *Stack) { -#line 1813 "runarray.in" +#line 1788 "runarray.in" #ifdef HAVE_GL array *a=new array(14); gl::projection P=gl::camera(); @@ -2225,160 +2196,156 @@ namespace trans { void gen_runarray_venv(venv &ve) { -#line 445 "runarray.in" +#line 424 "runarray.in" REGISTER_BLTIN(run::emptyArray,"emptyArray"); -#line 451 "runarray.in" +#line 430 "runarray.in" REGISTER_BLTIN(run::newDeepArray,"newDeepArray"); -#line 473 "runarray.in" +#line 452 "runarray.in" REGISTER_BLTIN(run::newInitializedArray,"newInitializedArray"); -#line 488 "runarray.in" +#line 467 "runarray.in" REGISTER_BLTIN(run::newAppendedArray,"newAppendedArray"); -#line 504 "runarray.in" +#line 483 "runarray.in" + REGISTER_BLTIN(run::copyArrayValue,"copyArrayValue"); +#line 495 "runarray.in" REGISTER_BLTIN(run::copyArray,"copyArray"); -#line 516 "runarray.in" +#line 506 "runarray.in" REGISTER_BLTIN(run::arrayRead,"arrayRead"); -#line 528 "runarray.in" +#line 518 "runarray.in" REGISTER_BLTIN(run::arraySliceRead,"arraySliceRead"); -#line 535 "runarray.in" +#line 525 "runarray.in" REGISTER_BLTIN(run::arraySliceReadToEnd,"arraySliceReadToEnd"); -#line 543 "runarray.in" +#line 533 "runarray.in" REGISTER_BLTIN(run::arrayArrayRead,"arrayArrayRead"); -#line 552 "runarray.in" +#line 542 "runarray.in" REGISTER_BLTIN(run::arrayWrite,"arrayWrite"); -#line 569 "runarray.in" +#line 559 "runarray.in" REGISTER_BLTIN(run::arraySliceWrite,"arraySliceWrite"); -#line 577 "runarray.in" +#line 567 "runarray.in" REGISTER_BLTIN(run::arraySliceWriteToEnd,"arraySliceWriteToEnd"); -#line 585 "runarray.in" +#line 575 "runarray.in" REGISTER_BLTIN(run::arrayLength,"arrayLength"); -#line 591 "runarray.in" +#line 581 "runarray.in" REGISTER_BLTIN(run::arrayKeys,"arrayKeys"); -#line 606 "runarray.in" +#line 596 "runarray.in" REGISTER_BLTIN(run::arrayCyclicFlag,"arrayCyclicFlag"); -#line 613 "runarray.in" +#line 603 "runarray.in" REGISTER_BLTIN(run::arraySetCyclicFlag,"arraySetCyclicFlag"); -#line 620 "runarray.in" +#line 610 "runarray.in" REGISTER_BLTIN(run::arrayInitializedHelper,"arrayInitializedHelper"); -#line 631 "runarray.in" +#line 621 "runarray.in" REGISTER_BLTIN(run::arrayInitialized,"arrayInitialized"); -#line 637 "runarray.in" +#line 627 "runarray.in" REGISTER_BLTIN(run::arrayCyclicHelper,"arrayCyclicHelper"); -#line 644 "runarray.in" +#line 634 "runarray.in" REGISTER_BLTIN(run::arrayCyclic,"arrayCyclic"); -#line 650 "runarray.in" +#line 640 "runarray.in" REGISTER_BLTIN(run::arrayPushHelper,"arrayPushHelper"); -#line 658 "runarray.in" +#line 648 "runarray.in" REGISTER_BLTIN(run::arrayPush,"arrayPush"); -#line 664 "runarray.in" +#line 654 "runarray.in" REGISTER_BLTIN(run::arrayAppendHelper,"arrayAppendHelper"); -#line 673 "runarray.in" +#line 663 "runarray.in" REGISTER_BLTIN(run::arrayAppend,"arrayAppend"); -#line 679 "runarray.in" +#line 669 "runarray.in" REGISTER_BLTIN(run::arrayPopHelper,"arrayPopHelper"); -#line 688 "runarray.in" +#line 678 "runarray.in" REGISTER_BLTIN(run::arrayPop,"arrayPop"); -#line 694 "runarray.in" +#line 684 "runarray.in" REGISTER_BLTIN(run::arrayInsertHelper,"arrayInsertHelper"); -#line 705 "runarray.in" +#line 695 "runarray.in" REGISTER_BLTIN(run::arrayInsert,"arrayInsert"); -#line 711 "runarray.in" +#line 701 "runarray.in" REGISTER_BLTIN(run::arrayDelete,"arrayDelete"); -#line 717 "runarray.in" +#line 707 "runarray.in" REGISTER_BLTIN(run::arrayAlias,"arrayAlias"); -#line 722 "runarray.in" +#line 712 "runarray.in" REGISTER_BLTIN(run::arrayIntArray,"arrayIntArray"); -#line 740 "runarray.in" - addFunc(ve, run::gen_runarray31, IntArray(), SYM(complement), formal(IntArray(), SYM(a), false, false), formal(primInt(), SYM(n), false, false)); -#line 759 "runarray.in" +#line 730 "runarray.in" + addFunc(ve, run::gen_runarray32, IntArray(), SYM(complement), formal(IntArray(), SYM(a), false, false), formal(primInt(), SYM(n), false, false)); +#line 749 "runarray.in" REGISTER_BLTIN(run::arraySequence,"arraySequence"); -#line 772 "runarray.in" - addFunc(ve, run::gen_runarray33, IntArray(), SYM(sequence), formal(primInt(), SYM(n), false, false)); -#line 783 "runarray.in" +#line 762 "runarray.in" + addFunc(ve, run::gen_runarray34, IntArray(), SYM(sequence), formal(primInt(), SYM(n), false, false)); +#line 773 "runarray.in" REGISTER_BLTIN(run::arrayFunction,"arrayFunction"); -#line 796 "runarray.in" +#line 786 "runarray.in" REGISTER_BLTIN(run::arraySort,"arraySort"); -#line 805 "runarray.in" +#line 795 "runarray.in" REGISTER_BLTIN(run::arraySearch,"arraySearch"); -#line 824 "runarray.in" - addFunc(ve, run::gen_runarray37, primBoolean(), SYM(all), formal(booleanArray(), SYM(a), false, false)); -#line 833 "runarray.in" - addFunc(ve, run::gen_runarray38, booleanArray(), SYM_LOGNOT, formal(booleanArray(), SYM(a), false, false)); -#line 842 "runarray.in" - addFunc(ve, run::gen_runarray39, primInt(), SYM(sum), formal(booleanArray(), SYM(a), false, false)); -#line 851 "runarray.in" - REGISTER_BLTIN(run::arrayCopy,"arrayCopy"); -#line 856 "runarray.in" +#line 814 "runarray.in" + addFunc(ve, run::gen_runarray38, primBoolean(), SYM(all), formal(booleanArray(), SYM(a), false, false)); +#line 823 "runarray.in" + addFunc(ve, run::gen_runarray39, booleanArray(), SYM_LOGNOT, formal(booleanArray(), SYM(a), false, false)); +#line 832 "runarray.in" + addFunc(ve, run::gen_runarray40, primInt(), SYM(sum), formal(booleanArray(), SYM(a), false, false)); +#line 841 "runarray.in" REGISTER_BLTIN(run::arrayConcat,"arrayConcat"); -#line 884 "runarray.in" - REGISTER_BLTIN(run::array2Copy,"array2Copy"); -#line 889 "runarray.in" - REGISTER_BLTIN(run::array3Copy,"array3Copy"); -#line 894 "runarray.in" +#line 869 "runarray.in" REGISTER_BLTIN(run::array2Transpose,"array2Transpose"); -#line 918 "runarray.in" +#line 893 "runarray.in" REGISTER_BLTIN(run::array3Transpose,"array3Transpose"); -#line 1005 "runarray.in" - addFunc(ve, run::gen_runarray46, primInt(), SYM(find), formal(booleanArray(), SYM(a), false, false), formal(primInt(), SYM(n), true, false)); -#line 1024 "runarray.in" +#line 980 "runarray.in" + addFunc(ve, run::gen_runarray44, primInt(), SYM(find), formal(booleanArray(), SYM(a), false, false), formal(primInt(), SYM(n), true, false)); +#line 999 "runarray.in" REGISTER_BLTIN(run::arrayConditional,"arrayConditional"); -#line 1050 "runarray.in" - addFunc(ve, run::gen_runarray48, realArray2(), SYM(identity), formal(primInt(), SYM(n), false, false)); -#line 1056 "runarray.in" - addFunc(ve, run::gen_runarray49, realArray2(), SYM(inverse), formal(realArray2(), SYM(a), false, false)); -#line 1148 "runarray.in" - addFunc(ve, run::gen_runarray50, realArray(), SYM(solve), formal(realArray2(), SYM(a), false, false), formal(realArray(), SYM(b), false, false), formal(primBoolean(), SYM(warn), true, false)); -#line 1201 "runarray.in" - addFunc(ve, run::gen_runarray51, realArray2(), SYM(solve), formal(realArray2(), SYM(a), false, false), formal(realArray2(), SYM(b), false, false), formal(primBoolean(), SYM(warn), true, false)); -#line 1266 "runarray.in" - addFunc(ve, run::gen_runarray52, primReal(), SYM(determinant), formal(realArray2(), SYM(a), false, false)); -#line 1283 "runarray.in" - addFunc(ve, run::gen_runarray53, realArray(), SYM_TIMES, formal(realArray2(), SYM(a), false, false), formal(realArray(), SYM(b), false, false)); -#line 1302 "runarray.in" - addFunc(ve, run::gen_runarray54, realArray(), SYM_TIMES, formal(realArray(), SYM(a), false, false), formal(realArray2(), SYM(b), false, false)); -#line 1331 "runarray.in" - addFunc(ve, run::gen_runarray55, IntArray2(), SYM_TIMES, formal(IntArray2(), SYM(a), false, false), formal(IntArray2(), SYM(b), false, false)); -#line 1336 "runarray.in" - addFunc(ve, run::gen_runarray56, realArray2(), SYM_TIMES, formal(realArray2(), SYM(a), false, false), formal(realArray2(), SYM(b), false, false)); -#line 1341 "runarray.in" - addFunc(ve, run::gen_runarray57, pairArray2(), SYM_TIMES, formal(pairArray2(), SYM(a), false, false), formal(pairArray2(), SYM(b), false, false)); -#line 1346 "runarray.in" - addFunc(ve, run::gen_runarray58, primTriple(), SYM_TIMES, formal(realArray2(), SYM(t), false, false), formal(primTriple(), SYM(v), false, false)); +#line 1025 "runarray.in" + addFunc(ve, run::gen_runarray46, realArray2(), SYM(identity), formal(primInt(), SYM(n), false, false)); +#line 1031 "runarray.in" + addFunc(ve, run::gen_runarray47, realArray2(), SYM(inverse), formal(realArray2(), SYM(a), false, false)); +#line 1123 "runarray.in" + addFunc(ve, run::gen_runarray48, realArray(), SYM(solve), formal(realArray2(), SYM(a), false, false), formal(realArray(), SYM(b), false, false), formal(primBoolean(), SYM(warn), true, false)); +#line 1176 "runarray.in" + addFunc(ve, run::gen_runarray49, realArray2(), SYM(solve), formal(realArray2(), SYM(a), false, false), formal(realArray2(), SYM(b), false, false), formal(primBoolean(), SYM(warn), true, false)); +#line 1241 "runarray.in" + addFunc(ve, run::gen_runarray50, primReal(), SYM(determinant), formal(realArray2(), SYM(a), false, false)); +#line 1258 "runarray.in" + addFunc(ve, run::gen_runarray51, realArray(), SYM_TIMES, formal(realArray2(), SYM(a), false, false), formal(realArray(), SYM(b), false, false)); +#line 1277 "runarray.in" + addFunc(ve, run::gen_runarray52, realArray(), SYM_TIMES, formal(realArray(), SYM(a), false, false), formal(realArray2(), SYM(b), false, false)); +#line 1306 "runarray.in" + addFunc(ve, run::gen_runarray53, IntArray2(), SYM_TIMES, formal(IntArray2(), SYM(a), false, false), formal(IntArray2(), SYM(b), false, false)); +#line 1311 "runarray.in" + addFunc(ve, run::gen_runarray54, realArray2(), SYM_TIMES, formal(realArray2(), SYM(a), false, false), formal(realArray2(), SYM(b), false, false)); +#line 1316 "runarray.in" + addFunc(ve, run::gen_runarray55, pairArray2(), SYM_TIMES, formal(pairArray2(), SYM(a), false, false), formal(pairArray2(), SYM(b), false, false)); +#line 1321 "runarray.in" + addFunc(ve, run::gen_runarray56, primTriple(), SYM_TIMES, formal(realArray2(), SYM(t), false, false), formal(primTriple(), SYM(v), false, false)); +#line 1326 "runarray.in" + addFunc(ve, run::gen_runarray57, primPair(), SYM(project), formal(primTriple(), SYM(v), false, false), formal(realArray2(), SYM(t), false, false)); #line 1351 "runarray.in" - addFunc(ve, run::gen_runarray59, primPair(), SYM(project), formal(primTriple(), SYM(v), false, false), formal(realArray2(), SYM(t), false, false)); -#line 1376 "runarray.in" - addFunc(ve, run::gen_runarray60, primReal(), SYM(dot), formal(realArray(), SYM(a), false, false), formal(realArray(), SYM(b), false, false)); -#line 1386 "runarray.in" - addFunc(ve, run::gen_runarray61, primPair(), SYM(dot), formal(pairArray(), SYM(a), false, false), formal(pairArray(), SYM(b), false, false)); -#line 1396 "runarray.in" - addFunc(ve, run::gen_runarray62, realArray(), SYM(tridiagonal), formal(realArray(), SYM(a), false, false), formal(realArray(), SYM(b), false, false), formal(realArray(), SYM(c), false, false), formal(realArray(), SYM(f), false, false)); -#line 1500 "runarray.in" - addFunc(ve, run::gen_runarray63, primReal(), SYM(newton), formal(primInt(), SYM(iterations), true, false), formal(realRealFunction(), SYM(f), false, false), formal(realRealFunction(), SYM(fprime), false, false), formal(primReal(), SYM(x), false, false), formal(primBoolean(), SYM(verbose), true, false)); -#line 1547 "runarray.in" - addFunc(ve, run::gen_runarray64, primReal(), SYM(newton), formal(primInt(), SYM(iterations), true, false), formal(realRealFunction(), SYM(f), false, false), formal(realRealFunction(), SYM(fprime), false, false), formal(primReal(), SYM(x1), false, false), formal(primReal(), SYM(x2), false, false), formal(primBoolean(), SYM(verbose), true, false)); -#line 1629 "runarray.in" - addFunc(ve, run::gen_runarray65, primReal(), SYM(simpson), formal(realRealFunction(), SYM(f), false, false), formal(primReal(), SYM(a), false, false), formal(primReal(), SYM(b), false, false), formal(primReal(), SYM(acc), true, false), formal(primReal(), SYM(dxmax), true, false)); -#line 1641 "runarray.in" - addFunc(ve, run::gen_runarray66, pairArray(), SYM(fft), formal(pairArray(), SYM(a), false, false), formal(primInt(), SYM(sign), true, false)); -#line 1672 "runarray.in" - addFunc(ve, run::gen_runarray67, IntArray2(), SYM(triangulate), formal(pairArray(), SYM(z), false, false)); -#line 1707 "runarray.in" - addFunc(ve, run::gen_runarray68, primReal(), SYM(norm), formal(realArray(), SYM(a), false, false)); -#line 1718 "runarray.in" - addFunc(ve, run::gen_runarray69, primReal(), SYM(norm), formal(realArray2(), SYM(a), false, false)); -#line 1733 "runarray.in" - addFunc(ve, run::gen_runarray70, primReal(), SYM(norm), formal(tripleArray2(), SYM(a), false, false)); -#line 1748 "runarray.in" - addFunc(ve, run::gen_runarray71, primReal(), SYM(change2), formal(tripleArray2(), SYM(a), false, false)); -#line 1770 "runarray.in" - addFunc(ve, run::gen_runarray72, primTriple(), SYM(minbezier), formal(tripleArray2(), SYM(p), false, false), formal(primTriple(), SYM(b), false, false)); -#line 1780 "runarray.in" - addFunc(ve, run::gen_runarray73, primTriple(), SYM(maxbezier), formal(tripleArray2(), SYM(p), false, false), formal(primTriple(), SYM(b), false, false)); -#line 1790 "runarray.in" - addFunc(ve, run::gen_runarray74, primPair(), SYM(minratio), formal(tripleArray2(), SYM(p), false, false), formal(primPair(), SYM(b), false, false)); -#line 1801 "runarray.in" - addFunc(ve, run::gen_runarray75, primPair(), SYM(maxratio), formal(tripleArray2(), SYM(p), false, false), formal(primPair(), SYM(b), false, false)); -#line 1812 "runarray.in" - addFunc(ve, run::gen_runarray76, realArray(), SYM(_projection)); + addFunc(ve, run::gen_runarray58, primReal(), SYM(dot), formal(realArray(), SYM(a), false, false), formal(realArray(), SYM(b), false, false)); +#line 1361 "runarray.in" + addFunc(ve, run::gen_runarray59, primPair(), SYM(dot), formal(pairArray(), SYM(a), false, false), formal(pairArray(), SYM(b), false, false)); +#line 1371 "runarray.in" + addFunc(ve, run::gen_runarray60, realArray(), SYM(tridiagonal), formal(realArray(), SYM(a), false, false), formal(realArray(), SYM(b), false, false), formal(realArray(), SYM(c), false, false), formal(realArray(), SYM(f), false, false)); +#line 1475 "runarray.in" + addFunc(ve, run::gen_runarray61, primReal(), SYM(newton), formal(primInt(), SYM(iterations), true, false), formal(realRealFunction(), SYM(f), false, false), formal(realRealFunction(), SYM(fprime), false, false), formal(primReal(), SYM(x), false, false), formal(primBoolean(), SYM(verbose), true, false)); +#line 1522 "runarray.in" + addFunc(ve, run::gen_runarray62, primReal(), SYM(newton), formal(primInt(), SYM(iterations), true, false), formal(realRealFunction(), SYM(f), false, false), formal(realRealFunction(), SYM(fprime), false, false), formal(primReal(), SYM(x1), false, false), formal(primReal(), SYM(x2), false, false), formal(primBoolean(), SYM(verbose), true, false)); +#line 1604 "runarray.in" + addFunc(ve, run::gen_runarray63, primReal(), SYM(simpson), formal(realRealFunction(), SYM(f), false, false), formal(primReal(), SYM(a), false, false), formal(primReal(), SYM(b), false, false), formal(primReal(), SYM(acc), true, false), formal(primReal(), SYM(dxmax), true, false)); +#line 1616 "runarray.in" + addFunc(ve, run::gen_runarray64, pairArray(), SYM(fft), formal(pairArray(), SYM(a), false, false), formal(primInt(), SYM(sign), true, false)); +#line 1647 "runarray.in" + addFunc(ve, run::gen_runarray65, IntArray2(), SYM(triangulate), formal(pairArray(), SYM(z), false, false)); +#line 1682 "runarray.in" + addFunc(ve, run::gen_runarray66, primReal(), SYM(norm), formal(realArray(), SYM(a), false, false)); +#line 1693 "runarray.in" + addFunc(ve, run::gen_runarray67, primReal(), SYM(norm), formal(realArray2(), SYM(a), false, false)); +#line 1708 "runarray.in" + addFunc(ve, run::gen_runarray68, primReal(), SYM(norm), formal(tripleArray2(), SYM(a), false, false)); +#line 1723 "runarray.in" + addFunc(ve, run::gen_runarray69, primReal(), SYM(change2), formal(tripleArray2(), SYM(a), false, false)); +#line 1745 "runarray.in" + addFunc(ve, run::gen_runarray70, primTriple(), SYM(minbezier), formal(tripleArray2(), SYM(p), false, false), formal(primTriple(), SYM(b), false, false)); +#line 1755 "runarray.in" + addFunc(ve, run::gen_runarray71, primTriple(), SYM(maxbezier), formal(tripleArray2(), SYM(p), false, false), formal(primTriple(), SYM(b), false, false)); +#line 1765 "runarray.in" + addFunc(ve, run::gen_runarray72, primPair(), SYM(minratio), formal(tripleArray2(), SYM(p), false, false), formal(primPair(), SYM(b), false, false)); +#line 1776 "runarray.in" + addFunc(ve, run::gen_runarray73, primPair(), SYM(maxratio), formal(tripleArray2(), SYM(p), false, false), formal(primPair(), SYM(b), false, false)); +#line 1787 "runarray.in" + addFunc(ve, run::gen_runarray74, realArray(), SYM(_projection)); } } // namespace trans diff --git a/Build/source/utils/asymptote/runarray.h b/Build/source/utils/asymptote/runarray.h index aeaad2aa63b..0a1baf72677 100644 --- a/Build/source/utils/asymptote/runarray.h +++ b/Build/source/utils/asymptote/runarray.h @@ -7,6 +7,7 @@ void emptyArray(vm::stack *); void newDeepArray(vm::stack *); void newInitializedArray(vm::stack *); void newAppendedArray(vm::stack *); +void copyArrayValue(vm::stack *); void copyArray(vm::stack *); void arrayRead(vm::stack *); void arraySliceRead(vm::stack *); @@ -38,10 +39,7 @@ void arraySequence(vm::stack *); void arrayFunction(vm::stack *); void arraySort(vm::stack *); void arraySearch(vm::stack *); -void arrayCopy(vm::stack *); void arrayConcat(vm::stack *); -void array2Copy(vm::stack *); -void array3Copy(vm::stack *); void array2Transpose(vm::stack *); void array3Transpose(vm::stack *); void arrayConditional(vm::stack *); diff --git a/Build/source/utils/asymptote/runarray.in b/Build/source/utils/asymptote/runarray.in index e05810b8f27..dcaa5b08104 100644 --- a/Build/source/utils/asymptote/runarray.in +++ b/Build/source/utils/asymptote/runarray.in @@ -138,27 +138,6 @@ array *copyArray2(array *a) return c; } -array *copyArray3(array *a) -{ - size_t size=checkArray(a); - array *c=new array(size); - for(size_t i=0; i < size; i++) { - array *ai=read<array*>(a,i); - size_t aisize=checkArray(ai); - array *ci=new array(aisize); - (*c)[i]=ci; - for(size_t j=0; j < aisize; j++) { - array *aij=read<array*>(ai,j); - size_t aijsize=checkArray(aij); - array *cij=new array(aijsize); - (*ci)[j]=cij; - for(size_t k=0; k < aijsize; k++) - (*cij)[k]=(*aij)[k]; - } - } - return c; -} - double *copyTripleArray2Components(array *a, bool square, size_t dim2, GCPlacement placement) { @@ -505,7 +484,7 @@ array* :newAppendedArray(array* tail, Int n) // typeDepth is the true depth of the array determined at compile-time when the // operations for the array type are added. This typeDepth argument is // automatically pushed on the stack and is not visible to the user. -array* :copyArray(Int n, item value, Int depth=Int_MAX, Int typeDepth) +array* :copyArrayValue(Int n, item value, Int depth=Int_MAX, Int typeDepth) { if(n < 0) error("cannot create a negative length array"); if(depth < 0) error("cannot copy to a negative depth"); @@ -513,6 +492,17 @@ array* :copyArray(Int n, item value, Int depth=Int_MAX, Int typeDepth) return new array((size_t) n, value, depth); } +// Deep copy of array. +// typeDepth is the true depth of the array determined at compile-time when the +// operations for the array type are added. This typeDepth argument is +// automatically pushed on the stack and is not visible to the user. +array* :copyArray(array *a, Int depth=Int_MAX, Int typeDepth) +{ + if(depth < 0) error("cannot copy to a negative depth"); + if(depth > typeDepth) depth=typeDepth; + return a->copyToDepth(depth); +} + // Read an element from an array. Checks for initialization & bounds. item :arrayRead(array *a, Int n) { @@ -848,11 +838,6 @@ Int sum(boolarray *a) return sum; } -array* :arrayCopy(array *a) -{ - return copyArray(a); -} - array* :arrayConcat(array *a) { // a is an array of arrays to be concatenated together. @@ -881,16 +866,6 @@ array* :arrayConcat(array *a) return result; } -array* :array2Copy(array *a) -{ - return copyArray2(a); -} - -array* :array3Copy(array *a) -{ - return copyArray3(a); -} - array* :array2Transpose(array *a) { size_t asize=checkArray(a); diff --git a/Build/source/utils/asymptote/runfile.cc b/Build/source/utils/asymptote/runfile.cc index 776a131647c..98303cf52f3 100644 --- a/Build/source/utils/asymptote/runfile.cc +++ b/Build/source/utils/asymptote/runfile.cc @@ -112,177 +112,153 @@ void nullFile(stack *Stack) } #line 43 "runfile.in" -// file* input(string name, bool check=true, string comment=commentchar); +// file* input(string name=emptystring, bool check=true, string comment=commentchar, string mode=emptystring); void gen_runfile3(stack *Stack) { + string mode=vm::pop<string>(Stack,emptystring); string comment=vm::pop<string>(Stack,commentchar); bool check=vm::pop<bool>(Stack,true); - string name=vm::pop<string>(Stack); -#line 44 "runfile.in" - char c=comment.empty() ? (char) 0 : comment[0]; - file *f=new ifile(name,c,check); - f->open(); - {Stack->push<file*>(f); return;} -} - -#line 51 "runfile.in" -// file* output(string name, bool update=false, string comment=commentchar); -void gen_runfile4(stack *Stack) -{ - string comment=vm::pop<string>(Stack,commentchar); - bool update=vm::pop<bool>(Stack,false); - string name=vm::pop<string>(Stack); -#line 52 "runfile.in" + string name=vm::pop<string>(Stack,emptystring); +#line 45 "runfile.in" file *f; - if(update) { - char c=comment.empty() ? (char) 0 : comment[0]; - f=new iofile(name,c); - } else f=new ofile(name); - f->open(); - if(update) f->seek(0,false); - {Stack->push<file*>(f); return;} -} - -#line 63 "runfile.in" -// file* xinput(string name, bool check=true); -void gen_runfile5(stack *Stack) -{ - bool check=vm::pop<bool>(Stack,true); - string name=vm::pop<string>(Stack); -#line 64 "runfile.in" + if(mode == "binary") { + f=new ibfile(name,check); + } else if(mode == "xdr") { #ifdef HAVE_RPC_RPC_H - file *f=new ixfile(name,check); - f->open(); - {Stack->push<file*>(f); return;} + f=new ixfile(name,check); #else ostringstream buf; buf << name << ": XDR read support not enabled"; error(buf); - unused(&check); // Suppress unused variable warning -#endif -} - -#line 77 "runfile.in" -// file* xoutput(string name, bool update=false); -void gen_runfile6(stack *Stack) -{ - bool update=vm::pop<bool>(Stack,false); - string name=vm::pop<string>(Stack); -#line 78 "runfile.in" -#ifdef HAVE_RPC_RPC_H - file *f; - if(update) - f=new ioxfile(name); - else f=new oxfile(name); - f->open(); - if(update) f->seek(0,false); - {Stack->push<file*>(f); return;} -#else - ostringstream buf; - buf << name << ": XDR write support not enabled"; - error(buf); - unused(&update); // Suppress unused variable warning #endif -} - -#line 95 "runfile.in" -// file* binput(string name, bool check=true); -void gen_runfile7(stack *Stack) -{ - bool check=vm::pop<bool>(Stack,true); - string name=vm::pop<string>(Stack); -#line 96 "runfile.in" - file *f=new ibfile(name,check); + } else if(mode == "") { + char c=comment.empty() ? (char) 0 : comment[0]; + f=new ifile(name,c,check); + } else { + f=NULL; + ostringstream buf; + buf << name << ": invalid file mode '" << mode << "'"; + error(buf); + } + f->open(); {Stack->push<file*>(f); return;} } -#line 102 "runfile.in" -// file* boutput(string name, bool update=false); -void gen_runfile8(stack *Stack) +#line 71 "runfile.in" +// file* output(string name=emptystring, bool update=false, string comment=commentchar, string mode=emptystring); +void gen_runfile4(stack *Stack) { + string mode=vm::pop<string>(Stack,emptystring); + string comment=vm::pop<string>(Stack,commentchar); bool update=vm::pop<bool>(Stack,false); - string name=vm::pop<string>(Stack); -#line 103 "runfile.in" + string name=vm::pop<string>(Stack,emptystring); +#line 73 "runfile.in" file *f; - if(update) f=new iobfile(name); - else f=new obfile(name); + if(mode == "pipe") { + f=new opipe(name); + } else if(mode == "binary") { + if(update) f=new iobfile(name); + else f=new obfile(name); + } else if(mode == "xdr") { +#ifdef HAVE_RPC_RPC_H + if(update) + f=new ioxfile(name); + else f=new oxfile(name); +#else + ostringstream buf; + buf << name << ": XDR write support not enabled"; + error(buf); +#endif + } else if(mode == "") { + if(update) { + char c=comment.empty() ? (char) 0 : comment[0]; + f=new iofile(name,c); + } else f=new ofile(name); + } else { + f=NULL; + ostringstream buf; + buf << name << ": invalid file mode '" << mode << "'"; + error(buf); + } + f->open(); if(update) f->seek(0,false); + {Stack->push<file*>(f); return;} } -#line 112 "runfile.in" +#line 108 "runfile.in" // bool eof(file *f); -void gen_runfile9(stack *Stack) +void gen_runfile5(stack *Stack) { file * f=vm::pop<file *>(Stack); -#line 113 "runfile.in" +#line 109 "runfile.in" {Stack->push<bool>(f->eof()); return;} } -#line 117 "runfile.in" +#line 113 "runfile.in" // bool eol(file *f); -void gen_runfile10(stack *Stack) +void gen_runfile6(stack *Stack) { file * f=vm::pop<file *>(Stack); -#line 118 "runfile.in" +#line 114 "runfile.in" {Stack->push<bool>(f->eol()); return;} } -#line 122 "runfile.in" +#line 118 "runfile.in" // bool error(file *f); -void gen_runfile11(stack *Stack) +void gen_runfile7(stack *Stack) { file * f=vm::pop<file *>(Stack); -#line 123 "runfile.in" +#line 119 "runfile.in" {Stack->push<bool>(f->error()); return;} } -#line 127 "runfile.in" +#line 123 "runfile.in" // void clear(file *f); -void gen_runfile12(stack *Stack) +void gen_runfile8(stack *Stack) { file * f=vm::pop<file *>(Stack); -#line 128 "runfile.in" +#line 124 "runfile.in" f->clear(); } -#line 132 "runfile.in" +#line 128 "runfile.in" // void close(file *f); -void gen_runfile13(stack *Stack) +void gen_runfile9(stack *Stack) { file * f=vm::pop<file *>(Stack); -#line 133 "runfile.in" +#line 129 "runfile.in" f->close(); } -#line 137 "runfile.in" +#line 133 "runfile.in" // Int precision(file *f=NULL, Int digits=0); -void gen_runfile14(stack *Stack) +void gen_runfile10(stack *Stack) { Int digits=vm::pop<Int>(Stack,0); file * f=vm::pop<file *>(Stack,NULL); -#line 138 "runfile.in" +#line 134 "runfile.in" if(f == 0) f=&camp::Stdout; {Stack->push<Int>(f->precision(digits)); return;} } -#line 143 "runfile.in" +#line 139 "runfile.in" // void flush(file *f); -void gen_runfile15(stack *Stack) +void gen_runfile11(stack *Stack) { file * f=vm::pop<file *>(Stack); -#line 144 "runfile.in" +#line 140 "runfile.in" f->flush(); } -#line 148 "runfile.in" +#line 144 "runfile.in" // string getc(file *f); -void gen_runfile16(stack *Stack) +void gen_runfile12(stack *Stack) { file * f=vm::pop<file *>(Stack); -#line 149 "runfile.in" +#line 145 "runfile.in" char c=0; if(f->isOpen()) f->read(c); static char str[1]; @@ -290,76 +266,76 @@ void gen_runfile16(stack *Stack) {Stack->push<string>(string(str)); return;} } -#line 157 "runfile.in" +#line 153 "runfile.in" // Int tell(file *f); -void gen_runfile17(stack *Stack) +void gen_runfile13(stack *Stack) { file * f=vm::pop<file *>(Stack); -#line 158 "runfile.in" +#line 154 "runfile.in" {Stack->push<Int>(f->tell()); return;} } -#line 162 "runfile.in" +#line 158 "runfile.in" // void seek(file *f, Int pos); -void gen_runfile18(stack *Stack) +void gen_runfile14(stack *Stack) { Int pos=vm::pop<Int>(Stack); file * f=vm::pop<file *>(Stack); -#line 163 "runfile.in" +#line 159 "runfile.in" f->seek(pos,pos >= 0); } -#line 167 "runfile.in" +#line 163 "runfile.in" // void seekeof(file *f); -void gen_runfile19(stack *Stack) +void gen_runfile15(stack *Stack) { file * f=vm::pop<file *>(Stack); -#line 168 "runfile.in" +#line 164 "runfile.in" f->seek(0,false); } -#line 172 "runfile.in" +#line 168 "runfile.in" void namePart(stack *Stack) { file f=vm::pop<file>(Stack); -#line 173 "runfile.in" +#line 169 "runfile.in" {Stack->push<string>(f.filename()); return;} } -#line 177 "runfile.in" +#line 173 "runfile.in" void modePart(stack *Stack) { file f=vm::pop<file>(Stack); -#line 178 "runfile.in" +#line 174 "runfile.in" {Stack->push<string>(f.FileMode()); return;} } // Set file dimensions -#line 183 "runfile.in" +#line 179 "runfile.in" void dimensionSetHelper(stack *Stack) { file * f=vm::pop<file *>(Stack); Int nz=vm::pop<Int>(Stack,-1); Int ny=vm::pop<Int>(Stack,-1); Int nx=vm::pop<Int>(Stack,-1); -#line 184 "runfile.in" +#line 180 "runfile.in" f->dimension(nx,ny,nz); {Stack->push<file*>(f); return;} } -#line 189 "runfile.in" +#line 185 "runfile.in" void dimensionSet(stack *Stack) { file * f=vm::pop<file *>(Stack); -#line 190 "runfile.in" +#line 186 "runfile.in" {Stack->push<callable*>(new thunk(new bfunc(dimensionSetHelper),f)); return;} } -#line 194 "runfile.in" +#line 190 "runfile.in" void dimensionPart(stack *Stack) { file f=vm::pop<file>(Stack); -#line 195 "runfile.in" +#line 191 "runfile.in" array *a=new array(3); (*a)[0]=f.Nx(); (*a)[1]=f.Ny(); @@ -368,174 +344,174 @@ void dimensionPart(stack *Stack) } // Set file f to read arrays in line-at-a-time mode -#line 204 "runfile.in" +#line 200 "runfile.in" void lineSetHelper(stack *Stack) { file * f=vm::pop<file *>(Stack); bool b=vm::pop<bool>(Stack,true); -#line 205 "runfile.in" +#line 201 "runfile.in" f->LineMode(b); {Stack->push<file*>(f); return;} } -#line 210 "runfile.in" +#line 206 "runfile.in" void lineSet(stack *Stack) { file * f=vm::pop<file *>(Stack); -#line 211 "runfile.in" +#line 207 "runfile.in" {Stack->push<callable*>(new thunk(new bfunc(lineSetHelper),f)); return;} } -#line 215 "runfile.in" +#line 211 "runfile.in" void linePart(stack *Stack) { file f=vm::pop<file>(Stack); -#line 216 "runfile.in" +#line 212 "runfile.in" {Stack->push<bool>(f.LineMode()); return;} } // Set file to read comma-separated values -#line 221 "runfile.in" +#line 217 "runfile.in" void csvSetHelper(stack *Stack) { file * f=vm::pop<file *>(Stack); bool b=vm::pop<bool>(Stack,true); -#line 222 "runfile.in" +#line 218 "runfile.in" f->CSVMode(b); {Stack->push<file*>(f); return;} } -#line 227 "runfile.in" +#line 223 "runfile.in" void csvSet(stack *Stack) { file * f=vm::pop<file *>(Stack); -#line 228 "runfile.in" +#line 224 "runfile.in" {Stack->push<callable*>(new thunk(new bfunc(csvSetHelper),f)); return;} } -#line 232 "runfile.in" +#line 228 "runfile.in" void csvPart(stack *Stack) { file f=vm::pop<file>(Stack); -#line 233 "runfile.in" +#line 229 "runfile.in" {Stack->push<bool>(f.CSVMode()); return;} } // Set file to read whitespace-separated values -#line 238 "runfile.in" +#line 234 "runfile.in" void wordSetHelper(stack *Stack) { file * f=vm::pop<file *>(Stack); bool b=vm::pop<bool>(Stack,true); -#line 239 "runfile.in" +#line 235 "runfile.in" f->WordMode(b); {Stack->push<file*>(f); return;} } -#line 244 "runfile.in" +#line 240 "runfile.in" void wordSet(stack *Stack) { file * f=vm::pop<file *>(Stack); -#line 245 "runfile.in" +#line 241 "runfile.in" {Stack->push<callable*>(new thunk(new bfunc(wordSetHelper),f)); return;} } -#line 249 "runfile.in" +#line 245 "runfile.in" void wordPart(stack *Stack) { file f=vm::pop<file>(Stack); -#line 250 "runfile.in" +#line 246 "runfile.in" {Stack->push<bool>(f.WordMode()); return;} } // Set file to read/write single precision real XDR values. -#line 255 "runfile.in" +#line 251 "runfile.in" void singlerealSetHelper(stack *Stack) { file * f=vm::pop<file *>(Stack); bool b=vm::pop<bool>(Stack,true); -#line 256 "runfile.in" +#line 252 "runfile.in" f->SingleReal(b); {Stack->push<file*>(f); return;} } -#line 261 "runfile.in" +#line 257 "runfile.in" void singlerealSet(stack *Stack) { file * f=vm::pop<file *>(Stack); -#line 262 "runfile.in" +#line 258 "runfile.in" {Stack->push<callable*>(new thunk(new bfunc(singlerealSetHelper),f)); return;} } -#line 266 "runfile.in" +#line 262 "runfile.in" void singlerealPart(stack *Stack) { file f=vm::pop<file>(Stack); -#line 267 "runfile.in" +#line 263 "runfile.in" {Stack->push<bool>(f.SingleReal()); return;} } // Set file to read/write single precision int XDR values. -#line 272 "runfile.in" +#line 268 "runfile.in" void singleintSetHelper(stack *Stack) { file * f=vm::pop<file *>(Stack); bool b=vm::pop<bool>(Stack,true); -#line 273 "runfile.in" +#line 269 "runfile.in" f->SingleInt(b); {Stack->push<file*>(f); return;} } -#line 278 "runfile.in" +#line 274 "runfile.in" void singleintSet(stack *Stack) { file * f=vm::pop<file *>(Stack); -#line 279 "runfile.in" +#line 275 "runfile.in" {Stack->push<callable*>(new thunk(new bfunc(singleintSetHelper),f)); return;} } -#line 283 "runfile.in" +#line 279 "runfile.in" void singleintPart(stack *Stack) { file f=vm::pop<file>(Stack); -#line 284 "runfile.in" +#line 280 "runfile.in" {Stack->push<bool>(f.SingleInt()); return;} } // Set file to read/write signed int XDR values. -#line 289 "runfile.in" +#line 285 "runfile.in" void signedintSetHelper(stack *Stack) { file * f=vm::pop<file *>(Stack); bool b=vm::pop<bool>(Stack,true); -#line 290 "runfile.in" +#line 286 "runfile.in" f->SignedInt(b); {Stack->push<file*>(f); return;} } -#line 295 "runfile.in" +#line 291 "runfile.in" void signedintSet(stack *Stack) { file * f=vm::pop<file *>(Stack); -#line 296 "runfile.in" +#line 292 "runfile.in" {Stack->push<callable*>(new thunk(new bfunc(signedintSetHelper),f)); return;} } -#line 300 "runfile.in" +#line 296 "runfile.in" void signedintPart(stack *Stack) { file f=vm::pop<file>(Stack); -#line 301 "runfile.in" +#line 297 "runfile.in" {Stack->push<bool>(f.SignedInt()); return;} } // Set file to read an arrayi (i int sizes followed by an i-dimensional array) -#line 306 "runfile.in" +#line 302 "runfile.in" void readSetHelper(stack *Stack) { file * f=vm::pop<file *>(Stack); Int i=vm::pop<Int>(Stack); -#line 307 "runfile.in" +#line 303 "runfile.in" switch(i) { case 1: f->dimension(-2); @@ -556,21 +532,21 @@ void readSetHelper(stack *Stack) {Stack->push<file*>(f); return;} } -#line 328 "runfile.in" +#line 324 "runfile.in" void readSet(stack *Stack) { file * f=vm::pop<file *>(Stack); -#line 329 "runfile.in" +#line 325 "runfile.in" {Stack->push<callable*>(new thunk(new bfunc(readSetHelper),f)); return;} } // Delete file named s. -#line 334 "runfile.in" +#line 330 "runfile.in" // Int delete(string s); -void gen_runfile45(stack *Stack) +void gen_runfile41(stack *Stack) { string s=vm::pop<string>(Stack); -#line 335 "runfile.in" +#line 331 "runfile.in" s=outpath(s); Int rc=unlink(s.c_str()); if(rc == 0 && verbose > 0) @@ -579,13 +555,13 @@ void gen_runfile45(stack *Stack) } // Rename file "from" to file "to". -#line 344 "runfile.in" +#line 340 "runfile.in" // Int rename(string from, string to); -void gen_runfile46(stack *Stack) +void gen_runfile42(stack *Stack) { string to=vm::pop<string>(Stack); string from=vm::pop<string>(Stack); -#line 345 "runfile.in" +#line 341 "runfile.in" from=outpath(from); to=outpath(to); Int rc=rename(from.c_str(),to.c_str()); @@ -595,12 +571,12 @@ void gen_runfile46(stack *Stack) } // Create a unique temporary file name. -#line 355 "runfile.in" +#line 351 "runfile.in" // string mktemp(string s); -void gen_runfile47(stack *Stack) +void gen_runfile43(stack *Stack) { string s=vm::pop<string>(Stack); -#line 356 "runfile.in" +#line 352 "runfile.in" char *S=Strdup(s+"XXXXXX"); int fd=mkstemp(S); if(fd < 0) { @@ -624,95 +600,87 @@ void gen_runfile_venv(venv &ve) #line 38 "runfile.in" REGISTER_BLTIN(run::nullFile,"nullFile"); #line 43 "runfile.in" - addFunc(ve, run::gen_runfile3, primFile(), SYM(input), formal(primString() , SYM(name), false, false), formal(primBoolean(), SYM(check), true, false), formal(primString() , SYM(comment), true, false)); -#line 51 "runfile.in" - addFunc(ve, run::gen_runfile4, primFile(), SYM(output), formal(primString() , SYM(name), false, false), formal(primBoolean(), SYM(update), true, false), formal(primString() , SYM(comment), true, false)); -#line 63 "runfile.in" - addFunc(ve, run::gen_runfile5, primFile(), SYM(xinput), formal(primString() , SYM(name), false, false), formal(primBoolean(), SYM(check), true, false)); -#line 77 "runfile.in" - addFunc(ve, run::gen_runfile6, primFile(), SYM(xoutput), formal(primString() , SYM(name), false, false), formal(primBoolean(), SYM(update), true, false)); -#line 95 "runfile.in" - addFunc(ve, run::gen_runfile7, primFile(), SYM(binput), formal(primString() , SYM(name), false, false), formal(primBoolean(), SYM(check), true, false)); -#line 102 "runfile.in" - addFunc(ve, run::gen_runfile8, primFile(), SYM(boutput), formal(primString() , SYM(name), false, false), formal(primBoolean(), SYM(update), true, false)); -#line 112 "runfile.in" - addFunc(ve, run::gen_runfile9, primBoolean(), SYM(eof), formal(primFile(), SYM(f), false, false)); -#line 117 "runfile.in" - addFunc(ve, run::gen_runfile10, primBoolean(), SYM(eol), formal(primFile(), SYM(f), false, false)); -#line 122 "runfile.in" - addFunc(ve, run::gen_runfile11, primBoolean(), SYM(error), formal(primFile(), SYM(f), false, false)); -#line 127 "runfile.in" - addFunc(ve, run::gen_runfile12, primVoid(), SYM(clear), formal(primFile(), SYM(f), false, false)); -#line 132 "runfile.in" - addFunc(ve, run::gen_runfile13, primVoid(), SYM(close), formal(primFile(), SYM(f), false, false)); -#line 137 "runfile.in" - addFunc(ve, run::gen_runfile14, primInt(), SYM(precision), formal(primFile(), SYM(f), true, false), formal(primInt(), SYM(digits), true, false)); -#line 143 "runfile.in" - addFunc(ve, run::gen_runfile15, primVoid(), SYM(flush), formal(primFile(), SYM(f), false, false)); -#line 148 "runfile.in" - addFunc(ve, run::gen_runfile16, primString() , SYM(getc), formal(primFile(), SYM(f), false, false)); -#line 157 "runfile.in" - addFunc(ve, run::gen_runfile17, primInt(), SYM(tell), formal(primFile(), SYM(f), false, false)); -#line 162 "runfile.in" - addFunc(ve, run::gen_runfile18, primVoid(), SYM(seek), formal(primFile(), SYM(f), false, false), formal(primInt(), SYM(pos), false, false)); -#line 167 "runfile.in" - addFunc(ve, run::gen_runfile19, primVoid(), SYM(seekeof), formal(primFile(), SYM(f), false, false)); -#line 172 "runfile.in" + addFunc(ve, run::gen_runfile3, primFile(), SYM(input), formal(primString() , SYM(name), true, false), formal(primBoolean(), SYM(check), true, false), formal(primString() , SYM(comment), true, false), formal(primString() , SYM(mode), true, false)); +#line 71 "runfile.in" + addFunc(ve, run::gen_runfile4, primFile(), SYM(output), formal(primString() , SYM(name), true, false), formal(primBoolean(), SYM(update), true, false), formal(primString() , SYM(comment), true, false), formal(primString() , SYM(mode), true, false)); +#line 108 "runfile.in" + addFunc(ve, run::gen_runfile5, primBoolean(), SYM(eof), formal(primFile(), SYM(f), false, false)); +#line 113 "runfile.in" + addFunc(ve, run::gen_runfile6, primBoolean(), SYM(eol), formal(primFile(), SYM(f), false, false)); +#line 118 "runfile.in" + addFunc(ve, run::gen_runfile7, primBoolean(), SYM(error), formal(primFile(), SYM(f), false, false)); +#line 123 "runfile.in" + addFunc(ve, run::gen_runfile8, primVoid(), SYM(clear), formal(primFile(), SYM(f), false, false)); +#line 128 "runfile.in" + addFunc(ve, run::gen_runfile9, primVoid(), SYM(close), formal(primFile(), SYM(f), false, false)); +#line 133 "runfile.in" + addFunc(ve, run::gen_runfile10, primInt(), SYM(precision), formal(primFile(), SYM(f), true, false), formal(primInt(), SYM(digits), true, false)); +#line 139 "runfile.in" + addFunc(ve, run::gen_runfile11, primVoid(), SYM(flush), formal(primFile(), SYM(f), false, false)); +#line 144 "runfile.in" + addFunc(ve, run::gen_runfile12, primString() , SYM(getc), formal(primFile(), SYM(f), false, false)); +#line 153 "runfile.in" + addFunc(ve, run::gen_runfile13, primInt(), SYM(tell), formal(primFile(), SYM(f), false, false)); +#line 158 "runfile.in" + addFunc(ve, run::gen_runfile14, primVoid(), SYM(seek), formal(primFile(), SYM(f), false, false), formal(primInt(), SYM(pos), false, false)); +#line 163 "runfile.in" + addFunc(ve, run::gen_runfile15, primVoid(), SYM(seekeof), formal(primFile(), SYM(f), false, false)); +#line 168 "runfile.in" REGISTER_BLTIN(run::namePart,"namePart"); -#line 177 "runfile.in" +#line 173 "runfile.in" REGISTER_BLTIN(run::modePart,"modePart"); -#line 182 "runfile.in" +#line 178 "runfile.in" REGISTER_BLTIN(run::dimensionSetHelper,"dimensionSetHelper"); -#line 189 "runfile.in" +#line 185 "runfile.in" REGISTER_BLTIN(run::dimensionSet,"dimensionSet"); -#line 194 "runfile.in" +#line 190 "runfile.in" REGISTER_BLTIN(run::dimensionPart,"dimensionPart"); -#line 203 "runfile.in" +#line 199 "runfile.in" REGISTER_BLTIN(run::lineSetHelper,"lineSetHelper"); -#line 210 "runfile.in" +#line 206 "runfile.in" REGISTER_BLTIN(run::lineSet,"lineSet"); -#line 215 "runfile.in" +#line 211 "runfile.in" REGISTER_BLTIN(run::linePart,"linePart"); -#line 220 "runfile.in" +#line 216 "runfile.in" REGISTER_BLTIN(run::csvSetHelper,"csvSetHelper"); -#line 227 "runfile.in" +#line 223 "runfile.in" REGISTER_BLTIN(run::csvSet,"csvSet"); -#line 232 "runfile.in" +#line 228 "runfile.in" REGISTER_BLTIN(run::csvPart,"csvPart"); -#line 237 "runfile.in" +#line 233 "runfile.in" REGISTER_BLTIN(run::wordSetHelper,"wordSetHelper"); -#line 244 "runfile.in" +#line 240 "runfile.in" REGISTER_BLTIN(run::wordSet,"wordSet"); -#line 249 "runfile.in" +#line 245 "runfile.in" REGISTER_BLTIN(run::wordPart,"wordPart"); -#line 254 "runfile.in" +#line 250 "runfile.in" REGISTER_BLTIN(run::singlerealSetHelper,"singlerealSetHelper"); -#line 261 "runfile.in" +#line 257 "runfile.in" REGISTER_BLTIN(run::singlerealSet,"singlerealSet"); -#line 266 "runfile.in" +#line 262 "runfile.in" REGISTER_BLTIN(run::singlerealPart,"singlerealPart"); -#line 271 "runfile.in" +#line 267 "runfile.in" REGISTER_BLTIN(run::singleintSetHelper,"singleintSetHelper"); -#line 278 "runfile.in" +#line 274 "runfile.in" REGISTER_BLTIN(run::singleintSet,"singleintSet"); -#line 283 "runfile.in" +#line 279 "runfile.in" REGISTER_BLTIN(run::singleintPart,"singleintPart"); -#line 288 "runfile.in" +#line 284 "runfile.in" REGISTER_BLTIN(run::signedintSetHelper,"signedintSetHelper"); -#line 295 "runfile.in" +#line 291 "runfile.in" REGISTER_BLTIN(run::signedintSet,"signedintSet"); -#line 300 "runfile.in" +#line 296 "runfile.in" REGISTER_BLTIN(run::signedintPart,"signedintPart"); -#line 305 "runfile.in" +#line 301 "runfile.in" REGISTER_BLTIN(run::readSetHelper,"readSetHelper"); -#line 328 "runfile.in" +#line 324 "runfile.in" REGISTER_BLTIN(run::readSet,"readSet"); -#line 333 "runfile.in" - addFunc(ve, run::gen_runfile45, primInt(), SYM(delete), formal(primString() , SYM(s), false, false)); -#line 343 "runfile.in" - addFunc(ve, run::gen_runfile46, primInt(), SYM(rename), formal(primString() , SYM(from), false, false), formal(primString() , SYM(to), false, false)); -#line 354 "runfile.in" - addFunc(ve, run::gen_runfile47, primString() , SYM(mktemp), formal(primString() , SYM(s), false, false)); +#line 329 "runfile.in" + addFunc(ve, run::gen_runfile41, primInt(), SYM(delete), formal(primString() , SYM(s), false, false)); +#line 339 "runfile.in" + addFunc(ve, run::gen_runfile42, primInt(), SYM(rename), formal(primString() , SYM(from), false, false), formal(primString() , SYM(to), false, false)); +#line 350 "runfile.in" + addFunc(ve, run::gen_runfile43, primString() , SYM(mktemp), formal(primString() , SYM(s), false, false)); } } // namespace trans diff --git a/Build/source/utils/asymptote/runfile.in b/Build/source/utils/asymptote/runfile.in index bde9407ff64..584b97f1394 100644 --- a/Build/source/utils/asymptote/runfile.in +++ b/Build/source/utils/asymptote/runfile.in @@ -40,72 +40,68 @@ file* :nullFile() return &camp::nullfile; } -file* input(string name, bool check=true, string comment=commentchar) -{ - char c=comment.empty() ? (char) 0 : comment[0]; - file *f=new ifile(name,c,check); - f->open(); - return f; -} - -file* output(string name, bool update=false, string comment=commentchar) +file* input(string name=emptystring, bool check=true, + string comment=commentchar, string mode=emptystring) { file *f; - if(update) { - char c=comment.empty() ? (char) 0 : comment[0]; - f=new iofile(name,c); - } else f=new ofile(name); - f->open(); - if(update) f->seek(0,false); - return f; -} - -file* xinput(string name, bool check=true) -{ + if(mode == "binary") { + f=new ibfile(name,check); + } else if(mode == "xdr") { #ifdef HAVE_RPC_RPC_H - file *f=new ixfile(name,check); - f->open(); - return f; + f=new ixfile(name,check); #else ostringstream buf; buf << name << ": XDR read support not enabled"; error(buf); - unused(&check); // Suppress unused variable warning -#endif -} - -file* xoutput(string name, bool update=false) -{ -#ifdef HAVE_RPC_RPC_H - file *f; - if(update) - f=new ioxfile(name); - else f=new oxfile(name); - f->open(); - if(update) f->seek(0,false); - return f; -#else - ostringstream buf; - buf << name << ": XDR write support not enabled"; - error(buf); - unused(&update); // Suppress unused variable warning #endif -} - -file* binput(string name, bool check=true) -{ - file *f=new ibfile(name,check); + } else if(mode == "") { + char c=comment.empty() ? (char) 0 : comment[0]; + f=new ifile(name,c,check); + } else { + f=NULL; + ostringstream buf; + buf << name << ": invalid file mode '" << mode << "'"; + error(buf); + } + f->open(); return f; } -file* boutput(string name, bool update=false) +file* output(string name=emptystring, bool update=false, + string comment=commentchar, string mode=emptystring) { file *f; - if(update) f=new iobfile(name); - else f=new obfile(name); + if(mode == "pipe") { + f=new opipe(name); + } else if(mode == "binary") { + if(update) f=new iobfile(name); + else f=new obfile(name); + } else if(mode == "xdr") { +#ifdef HAVE_RPC_RPC_H + if(update) + f=new ioxfile(name); + else f=new oxfile(name); +#else + ostringstream buf; + buf << name << ": XDR write support not enabled"; + error(buf); +#endif + } else if(mode == "") { + if(update) { + char c=comment.empty() ? (char) 0 : comment[0]; + f=new iofile(name,c); + } else f=new ofile(name); + } else { + f=NULL; + ostringstream buf; + buf << name << ": invalid file mode '" << mode << "'"; + error(buf); + } + f->open(); if(update) f->seek(0,false); + return f; } diff --git a/Build/source/utils/asymptote/runhistory.cc b/Build/source/utils/asymptote/runhistory.cc index 6b38e49f4a9..19d354f1a95 100644 --- a/Build/source/utils/asymptote/runhistory.cc +++ b/Build/source/utils/asymptote/runhistory.cc @@ -222,7 +222,7 @@ void gen_runhistory2(stack *Stack) string name=vm::pop<string>(Stack,emptystring); string prompt=vm::pop<string>(Stack,emptystring); #line 153 "runhistory.in" - if(!(isatty(STDIN_FILENO) || getSetting<bool>("interactive"))) + if(!(isatty(STDIN_FILENO) || getSetting<Int>("inpipe") >= 0)) {Stack->push<string>(emptystring); return;} #if defined(HAVE_LIBREADLINE) && defined(HAVE_LIBCURSES) init_readline(tabcompletion); diff --git a/Build/source/utils/asymptote/runhistory.in b/Build/source/utils/asymptote/runhistory.in index b4bbb1e39dc..e2f502f8f3e 100644 --- a/Build/source/utils/asymptote/runhistory.in +++ b/Build/source/utils/asymptote/runhistory.in @@ -151,7 +151,7 @@ stringarray* history(Int n=0) string readline(string prompt=emptystring, string name=emptystring, bool tabcompletion=false) { - if(!(isatty(STDIN_FILENO) || getSetting<bool>("interactive"))) + if(!(isatty(STDIN_FILENO) || getSetting<Int>("inpipe") >= 0)) return emptystring; #if defined(HAVE_LIBREADLINE) && defined(HAVE_LIBCURSES) init_readline(tabcompletion); diff --git a/Build/source/utils/asymptote/runlabel.cc b/Build/source/utils/asymptote/runlabel.cc index be5d7b45856..210c65c5885 100644 --- a/Build/source/utils/asymptote/runlabel.cc +++ b/Build/source/utils/asymptote/runlabel.cc @@ -141,7 +141,7 @@ array *readpath(const string& psname, bool keep, cmd.push_back("-q"); cmd.push_back("-dBATCH"); if(safe) cmd.push_back("-dSAFER"); -#ifdef __CYGWIN__ +#ifdef __MSDOS__ const string null="NUL"; #else const string null="/dev/null"; diff --git a/Build/source/utils/asymptote/runlabel.in b/Build/source/utils/asymptote/runlabel.in index 9f573eec787..0fa707bfdaa 100644 --- a/Build/source/utils/asymptote/runlabel.in +++ b/Build/source/utils/asymptote/runlabel.in @@ -97,7 +97,7 @@ array *readpath(const string& psname, bool keep, cmd.push_back("-q"); cmd.push_back("-dBATCH"); if(safe) cmd.push_back("-dSAFER"); -#ifdef __CYGWIN__ +#ifdef __MSDOS__ const string null="NUL"; #else const string null="/dev/null"; diff --git a/Build/source/utils/asymptote/runpath.cc b/Build/source/utils/asymptote/runpath.cc index 87b10b02d8a..d6873fffb32 100644 --- a/Build/source/utils/asymptote/runpath.cc +++ b/Build/source/utils/asymptote/runpath.cc @@ -345,13 +345,13 @@ void gen_runpath23(stack *Stack) } #line 172 "runpath.in" -// real arctime(path p, real dval); +// real arctime(path p, real L); void gen_runpath24(stack *Stack) { - real dval=vm::pop<real>(Stack); + real L=vm::pop<real>(Stack); path p=vm::pop<path>(Stack); #line 173 "runpath.in" - {Stack->push<real>(p.arctime(dval)); return;} + {Stack->push<real>(p.arctime(L)); return;} } #line 177 "runpath.in" @@ -784,7 +784,7 @@ void gen_runpath_venv(venv &ve) #line 167 "runpath.in" addFunc(ve, run::gen_runpath23, primReal(), SYM(arclength), formal(primPath(), SYM(p), false, false)); #line 172 "runpath.in" - addFunc(ve, run::gen_runpath24, primReal(), SYM(arctime), formal(primPath(), SYM(p), false, false), formal(primReal(), SYM(dval), false, false)); + addFunc(ve, run::gen_runpath24, primReal(), SYM(arctime), formal(primPath(), SYM(p), false, false), formal(primReal(), SYM(l), false, false)); #line 177 "runpath.in" addFunc(ve, run::gen_runpath25, primReal(), SYM(dirtime), formal(primPath(), SYM(p), false, false), formal(primPair(), SYM(z), false, false)); #line 182 "runpath.in" diff --git a/Build/source/utils/asymptote/runpath.in b/Build/source/utils/asymptote/runpath.in index 042dcdca97d..b8a8d8c204a 100644 --- a/Build/source/utils/asymptote/runpath.in +++ b/Build/source/utils/asymptote/runpath.in @@ -169,9 +169,9 @@ real arclength(path p) return p.arclength(); } -real arctime(path p, real dval) +real arctime(path p, real L) { - return p.arctime(dval); + return p.arctime(L); } real dirtime(path p, pair z) diff --git a/Build/source/utils/asymptote/runpicture.cc b/Build/source/utils/asymptote/runpicture.cc index 8607eac935e..60896b54031 100644 --- a/Build/source/utils/asymptote/runpicture.cc +++ b/Build/source/utils/asymptote/runpicture.cc @@ -806,8 +806,10 @@ void gen_runpicture45(stack *Stack) static long arg_max=sysconf(_SC_ARG_MAX); const unsigned maxargs=::min(arg_max/(prefix.size()+xformat.size()+25ul), 256ul); - - cout << maxargs << newl; + openpipeout(); + + fprintf(pipeout,"%d\n",maxargs); + fflush(pipeout); string preformat=nativeformat(); const string Done="Done"; @@ -852,7 +854,8 @@ void gen_runpicture45(stack *Stack) transform t=pop<transform>(Stack); assert(*p); if((*p)->endgroup()) { - cout << Error << endl; + fprintf(pipeout,"%s\n",Error.c_str()); + fflush(pipeout); error(nobegin); } if((*p)->begingroup()) { @@ -867,7 +870,8 @@ void gen_runpicture45(stack *Stack) if((*p)->endgroup()) { if(level) --level; else { - cout << Error << endl; + fprintf(pipeout,"%s\n",Error.c_str()); + fflush(pipeout); error(nobegin); } } @@ -888,7 +892,8 @@ void gen_runpicture45(stack *Stack) b=group->bounds(); b *= magnification; - cout << b << newl; + fprintf(pipeout,"%g %g %g %g\n",b.left,b.right,b.bottom,b.top); + fflush(pipeout); ++n; ++p; ++arg; @@ -897,11 +902,12 @@ void gen_runpicture45(stack *Stack) if(p == f->nodes.end() || arg >= maxargs) { arg=0; ++batch; - cout.flush(); + fflush(pipeout); int status=System(cmd,0,true,converter,hint); if(status) { - cout << Error << endl; + fprintf(pipeout,"%s\n",Error.c_str()); + fflush(pipeout); error("deconstruct failed"); } } @@ -913,7 +919,8 @@ void gen_runpicture45(stack *Stack) unlink(p->c_str()); } - cout << Done << endl; + fprintf(pipeout,"%s\n",Done.c_str()); + fflush(pipeout); } } @@ -921,7 +928,7 @@ void gen_runpicture45(stack *Stack) // Three-dimensional picture and surface operations // Bezier curve -#line 601 "runpicture.in" +#line 608 "runpicture.in" // void _draw(picture *f, path3 g, triple center=Zero, pen p, Int interaction=0); void gen_runpicture46(stack *Stack) { @@ -930,13 +937,13 @@ void gen_runpicture46(stack *Stack) triple center=vm::pop<triple>(Stack,Zero); path3 g=vm::pop<path3>(Stack); picture * f=vm::pop<picture *>(Stack); -#line 602 "runpicture.in" +#line 609 "runpicture.in" if(g.size() > 0) f->append(new drawPath3(g,center,p,(Interaction) intcast(interaction))); } // Bezier patch -#line 608 "runpicture.in" +#line 615 "runpicture.in" // void draw(picture *f, triplearray2 *P, triple center, bool straight, penarray *p, real opacity, real shininess, real PRCshininess, triple normal, penarray *colors, bool lighton, Int interaction, bool prc=true); void gen_runpicture47(stack *Stack) { @@ -953,14 +960,14 @@ void gen_runpicture47(stack *Stack) triple center=vm::pop<triple>(Stack); triplearray2 * P=vm::pop<triplearray2 *>(Stack); picture * f=vm::pop<picture *>(Stack); -#line 612 "runpicture.in" +#line 619 "runpicture.in" f->append(new drawSurface(*P,center,straight,*p,opacity,shininess, PRCshininess,normal,*colors,lighton, (Interaction) intcast(interaction),prc)); } // General NURBS curve -#line 619 "runpicture.in" +#line 626 "runpicture.in" // void draw(picture *f, triplearray *P, realarray *knot, realarray *weights=emptyarray, pen p); void gen_runpicture48(stack *Stack) { @@ -969,12 +976,12 @@ void gen_runpicture48(stack *Stack) realarray * knot=vm::pop<realarray *>(Stack); triplearray * P=vm::pop<triplearray *>(Stack); picture * f=vm::pop<picture *>(Stack); -#line 621 "runpicture.in" +#line 628 "runpicture.in" f->append(new drawNurbsPath3(*P,knot,weights,p)); } // General NURBS surface -#line 626 "runpicture.in" +#line 633 "runpicture.in" // void draw(picture *f, triplearray2 *P, realarray *uknot, realarray *vknot, realarray2 *weights=emptyarray, penarray *p, real opacity, real shininess, real PRCshininess, penarray *colors, bool lighton); void gen_runpicture49(stack *Stack) { @@ -989,13 +996,13 @@ void gen_runpicture49(stack *Stack) realarray * uknot=vm::pop<realarray *>(Stack); triplearray2 * P=vm::pop<triplearray2 *>(Stack); picture * f=vm::pop<picture *>(Stack); -#line 629 "runpicture.in" +#line 636 "runpicture.in" f->append(new drawNurbs(*P,uknot,vknot,weights,*p,opacity,shininess, PRCshininess,*colors,lighton)); } // PRC unit sphere -#line 635 "runpicture.in" +#line 642 "runpicture.in" // void drawPRCsphere(picture *f, realarray2 *t, bool half=false, penarray *p, real opacity, real shininess, Int type); void gen_runpicture50(stack *Stack) { @@ -1006,12 +1013,12 @@ void gen_runpicture50(stack *Stack) bool half=vm::pop<bool>(Stack,false); realarray2 * t=vm::pop<realarray2 *>(Stack); picture * f=vm::pop<picture *>(Stack); -#line 637 "runpicture.in" +#line 644 "runpicture.in" f->append(new drawSphere(*t,half,*p,opacity,shininess,intcast(type))); } // PRC unit cylinder -#line 642 "runpicture.in" +#line 649 "runpicture.in" // void drawPRCcylinder(picture *f, realarray2 *t, penarray *p, real opacity, real shininess); void gen_runpicture51(stack *Stack) { @@ -1020,12 +1027,12 @@ void gen_runpicture51(stack *Stack) penarray * p=vm::pop<penarray *>(Stack); realarray2 * t=vm::pop<realarray2 *>(Stack); picture * f=vm::pop<picture *>(Stack); -#line 644 "runpicture.in" +#line 651 "runpicture.in" f->append(new drawCylinder(*t,*p,opacity,shininess)); } // PRC unit disk -#line 649 "runpicture.in" +#line 656 "runpicture.in" // void drawPRCdisk(picture *f, realarray2 *t, penarray *p, real opacity, real shininess); void gen_runpicture52(stack *Stack) { @@ -1034,12 +1041,12 @@ void gen_runpicture52(stack *Stack) penarray * p=vm::pop<penarray *>(Stack); realarray2 * t=vm::pop<realarray2 *>(Stack); picture * f=vm::pop<picture *>(Stack); -#line 651 "runpicture.in" +#line 658 "runpicture.in" f->append(new drawDisk(*t,*p,opacity,shininess)); } // General PRC tube -#line 656 "runpicture.in" +#line 663 "runpicture.in" // void drawPRCtube(picture *f, path3 center, path3 g, penarray *p, real opacity, real shininess); void gen_runpicture53(stack *Stack) { @@ -1049,12 +1056,12 @@ void gen_runpicture53(stack *Stack) path3 g=vm::pop<path3>(Stack); path3 center=vm::pop<path3>(Stack); picture * f=vm::pop<picture *>(Stack); -#line 658 "runpicture.in" +#line 665 "runpicture.in" f->append(new drawTube(center,g,*p,opacity,shininess)); } // Draw pixel -#line 663 "runpicture.in" +#line 670 "runpicture.in" // void drawpixel(picture *f, triple v, pen p, real width=1.0); void gen_runpicture54(stack *Stack) { @@ -1062,62 +1069,62 @@ void gen_runpicture54(stack *Stack) pen p=vm::pop<pen>(Stack); triple v=vm::pop<triple>(Stack); picture * f=vm::pop<picture *>(Stack); -#line 664 "runpicture.in" +#line 671 "runpicture.in" f->append(new drawPixel(v,p,width)); } -#line 668 "runpicture.in" +#line 675 "runpicture.in" // triple min3(picture *f); void gen_runpicture55(stack *Stack) { picture * f=vm::pop<picture *>(Stack); -#line 669 "runpicture.in" +#line 676 "runpicture.in" {Stack->push<triple>(f->bounds3().Min()); return;} } -#line 673 "runpicture.in" +#line 680 "runpicture.in" // triple max3(picture *f); void gen_runpicture56(stack *Stack) { picture * f=vm::pop<picture *>(Stack); -#line 674 "runpicture.in" +#line 681 "runpicture.in" {Stack->push<triple>(f->bounds3().Max()); return;} } -#line 678 "runpicture.in" +#line 685 "runpicture.in" // triple size3(picture *f); void gen_runpicture57(stack *Stack) { picture * f=vm::pop<picture *>(Stack); -#line 679 "runpicture.in" +#line 686 "runpicture.in" bbox3 b=f->bounds3(); {Stack->push<triple>(b.Max()-b.Min()); return;} } -#line 684 "runpicture.in" +#line 691 "runpicture.in" // pair minratio(picture *f); void gen_runpicture58(stack *Stack) { picture * f=vm::pop<picture *>(Stack); -#line 685 "runpicture.in" +#line 692 "runpicture.in" {Stack->push<pair>(f->ratio(::min)); return;} } -#line 689 "runpicture.in" +#line 696 "runpicture.in" // pair maxratio(picture *f); void gen_runpicture59(stack *Stack) { picture * f=vm::pop<picture *>(Stack); -#line 690 "runpicture.in" +#line 697 "runpicture.in" {Stack->push<pair>(f->ratio(::max)); return;} } -#line 694 "runpicture.in" +#line 701 "runpicture.in" // bool is3D(picture *f); void gen_runpicture60(stack *Stack) { picture * f=vm::pop<picture *>(Stack); -#line 695 "runpicture.in" +#line 702 "runpicture.in" {Stack->push<bool>(f->have3D()); return;} } @@ -1219,35 +1226,35 @@ void gen_runpicture_venv(venv &ve) addFunc(ve, run::gen_runpicture44, primVoid(), SYM(shipout3), formal(primString() , SYM(prefix), false, false), formal(primPicture(), SYM(f), false, false), formal(IntArray(), SYM(index), false, false), formal(tripleArray(), SYM(center), false, false)); #line 474 "runpicture.in" addFunc(ve, run::gen_runpicture45, primVoid(), SYM(deconstruct), formal(primPicture(), SYM(f), false, false), formal(primPicture(), SYM(preamble), true, false), formal(primReal(), SYM(magnification), true, false), formal(transformFunction(), SYM(xform), false, false)); -#line 597 "runpicture.in" +#line 604 "runpicture.in" addFunc(ve, run::gen_runpicture46, primVoid(), SYM(_draw), formal(primPicture(), SYM(f), false, false), formal(primPath3(), SYM(g), false, false), formal(primTriple(), SYM(center), true, false), formal(primPen(), SYM(p), false, false), formal(primInt(), SYM(interaction), true, false)); -#line 607 "runpicture.in" +#line 614 "runpicture.in" addFunc(ve, run::gen_runpicture47, primVoid(), SYM(draw), formal(primPicture(), SYM(f), false, false), formal(tripleArray2(), SYM(p), false, false), formal(primTriple(), SYM(center), false, false), formal(primBoolean(), SYM(straight), false, false), formal(penArray() , SYM(p), false, false), formal(primReal(), SYM(opacity), false, false), formal(primReal(), SYM(shininess), false, false), formal(primReal(), SYM(prcshininess), false, false), formal(primTriple(), SYM(normal), false, false), formal(penArray() , SYM(colors), false, false), formal(primBoolean(), SYM(lighton), false, false), formal(primInt(), SYM(interaction), false, false), formal(primBoolean(), SYM(prc), true, false)); -#line 618 "runpicture.in" - addFunc(ve, run::gen_runpicture48, primVoid(), SYM(draw), formal(primPicture(), SYM(f), false, false), formal(tripleArray(), SYM(p), false, false), formal(realArray(), SYM(knot), false, false), formal(realArray(), SYM(weights), true, false), formal(primPen(), SYM(p), false, false)); #line 625 "runpicture.in" + addFunc(ve, run::gen_runpicture48, primVoid(), SYM(draw), formal(primPicture(), SYM(f), false, false), formal(tripleArray(), SYM(p), false, false), formal(realArray(), SYM(knot), false, false), formal(realArray(), SYM(weights), true, false), formal(primPen(), SYM(p), false, false)); +#line 632 "runpicture.in" addFunc(ve, run::gen_runpicture49, primVoid(), SYM(draw), formal(primPicture(), SYM(f), false, false), formal(tripleArray2(), SYM(p), false, false), formal(realArray(), SYM(uknot), false, false), formal(realArray(), SYM(vknot), false, false), formal(realArray2(), SYM(weights), true, false), formal(penArray() , SYM(p), false, false), formal(primReal(), SYM(opacity), false, false), formal(primReal(), SYM(shininess), false, false), formal(primReal(), SYM(prcshininess), false, false), formal(penArray() , SYM(colors), false, false), formal(primBoolean(), SYM(lighton), false, false)); -#line 634 "runpicture.in" - addFunc(ve, run::gen_runpicture50, primVoid(), SYM(drawPRCsphere), formal(primPicture(), SYM(f), false, false), formal(realArray2(), SYM(t), false, false), formal(primBoolean(), SYM(half), true, false), formal(penArray() , SYM(p), false, false), formal(primReal(), SYM(opacity), false, false), formal(primReal(), SYM(shininess), false, false), formal(primInt(), SYM(type), false, false)); #line 641 "runpicture.in" - addFunc(ve, run::gen_runpicture51, primVoid(), SYM(drawPRCcylinder), formal(primPicture(), SYM(f), false, false), formal(realArray2(), SYM(t), false, false), formal(penArray() , SYM(p), false, false), formal(primReal(), SYM(opacity), false, false), formal(primReal(), SYM(shininess), false, false)); + addFunc(ve, run::gen_runpicture50, primVoid(), SYM(drawPRCsphere), formal(primPicture(), SYM(f), false, false), formal(realArray2(), SYM(t), false, false), formal(primBoolean(), SYM(half), true, false), formal(penArray() , SYM(p), false, false), formal(primReal(), SYM(opacity), false, false), formal(primReal(), SYM(shininess), false, false), formal(primInt(), SYM(type), false, false)); #line 648 "runpicture.in" - addFunc(ve, run::gen_runpicture52, primVoid(), SYM(drawPRCdisk), formal(primPicture(), SYM(f), false, false), formal(realArray2(), SYM(t), false, false), formal(penArray() , SYM(p), false, false), formal(primReal(), SYM(opacity), false, false), formal(primReal(), SYM(shininess), false, false)); + addFunc(ve, run::gen_runpicture51, primVoid(), SYM(drawPRCcylinder), formal(primPicture(), SYM(f), false, false), formal(realArray2(), SYM(t), false, false), formal(penArray() , SYM(p), false, false), formal(primReal(), SYM(opacity), false, false), formal(primReal(), SYM(shininess), false, false)); #line 655 "runpicture.in" - addFunc(ve, run::gen_runpicture53, primVoid(), SYM(drawPRCtube), formal(primPicture(), SYM(f), false, false), formal(primPath3(), SYM(center), false, false), formal(primPath3(), SYM(g), false, false), formal(penArray() , SYM(p), false, false), formal(primReal(), SYM(opacity), false, false), formal(primReal(), SYM(shininess), false, false)); + addFunc(ve, run::gen_runpicture52, primVoid(), SYM(drawPRCdisk), formal(primPicture(), SYM(f), false, false), formal(realArray2(), SYM(t), false, false), formal(penArray() , SYM(p), false, false), formal(primReal(), SYM(opacity), false, false), formal(primReal(), SYM(shininess), false, false)); #line 662 "runpicture.in" + addFunc(ve, run::gen_runpicture53, primVoid(), SYM(drawPRCtube), formal(primPicture(), SYM(f), false, false), formal(primPath3(), SYM(center), false, false), formal(primPath3(), SYM(g), false, false), formal(penArray() , SYM(p), false, false), formal(primReal(), SYM(opacity), false, false), formal(primReal(), SYM(shininess), false, false)); +#line 669 "runpicture.in" addFunc(ve, run::gen_runpicture54, primVoid(), SYM(drawpixel), formal(primPicture(), SYM(f), false, false), formal(primTriple(), SYM(v), false, false), formal(primPen(), SYM(p), false, false), formal(primReal(), SYM(width), true, false)); -#line 668 "runpicture.in" +#line 675 "runpicture.in" addFunc(ve, run::gen_runpicture55, primTriple(), SYM(min3), formal(primPicture(), SYM(f), false, false)); -#line 673 "runpicture.in" +#line 680 "runpicture.in" addFunc(ve, run::gen_runpicture56, primTriple(), SYM(max3), formal(primPicture(), SYM(f), false, false)); -#line 678 "runpicture.in" +#line 685 "runpicture.in" addFunc(ve, run::gen_runpicture57, primTriple(), SYM(size3), formal(primPicture(), SYM(f), false, false)); -#line 684 "runpicture.in" +#line 691 "runpicture.in" addFunc(ve, run::gen_runpicture58, primPair(), SYM(minratio), formal(primPicture(), SYM(f), false, false)); -#line 689 "runpicture.in" +#line 696 "runpicture.in" addFunc(ve, run::gen_runpicture59, primPair(), SYM(maxratio), formal(primPicture(), SYM(f), false, false)); -#line 694 "runpicture.in" +#line 701 "runpicture.in" addFunc(ve, run::gen_runpicture60, primBoolean(), SYM(is3D), formal(primPicture(), SYM(f), false, false)); } diff --git a/Build/source/utils/asymptote/runpicture.in b/Build/source/utils/asymptote/runpicture.in index 1624baf04d8..cfbe9cbf2b2 100644 --- a/Build/source/utils/asymptote/runpicture.in +++ b/Build/source/utils/asymptote/runpicture.in @@ -483,8 +483,10 @@ void deconstruct(picture *f, picture *preamble=NULL, real magnification=1, static long arg_max=sysconf(_SC_ARG_MAX); const unsigned maxargs=::min(arg_max/(prefix.size()+xformat.size()+25ul), 256ul); - - cout << maxargs << newl; + openpipeout(); + + fprintf(pipeout,"%d\n",maxargs); + fflush(pipeout); string preformat=nativeformat(); const string Done="Done"; @@ -529,7 +531,8 @@ void deconstruct(picture *f, picture *preamble=NULL, real magnification=1, transform t=pop<transform>(Stack); assert(*p); if((*p)->endgroup()) { - cout << Error << endl; + fprintf(pipeout,"%s\n",Error.c_str()); + fflush(pipeout); error(nobegin); } if((*p)->begingroup()) { @@ -544,7 +547,8 @@ void deconstruct(picture *f, picture *preamble=NULL, real magnification=1, if((*p)->endgroup()) { if(level) --level; else { - cout << Error << endl; + fprintf(pipeout,"%s\n",Error.c_str()); + fflush(pipeout); error(nobegin); } } @@ -565,7 +569,8 @@ void deconstruct(picture *f, picture *preamble=NULL, real magnification=1, b=group->bounds(); b *= magnification; - cout << b << newl; + fprintf(pipeout,"%g %g %g %g\n",b.left,b.right,b.bottom,b.top); + fflush(pipeout); ++n; ++p; ++arg; @@ -574,11 +579,12 @@ void deconstruct(picture *f, picture *preamble=NULL, real magnification=1, if(p == f->nodes.end() || arg >= maxargs) { arg=0; ++batch; - cout.flush(); + fflush(pipeout); int status=System(cmd,0,true,converter,hint); if(status) { - cout << Error << endl; + fprintf(pipeout,"%s\n",Error.c_str()); + fflush(pipeout); error("deconstruct failed"); } } @@ -590,7 +596,8 @@ void deconstruct(picture *f, picture *preamble=NULL, real magnification=1, unlink(p->c_str()); } - cout << Done << endl; + fprintf(pipeout,"%s\n",Done.c_str()); + fflush(pipeout); } } diff --git a/Build/source/utils/asymptote/runstring.cc b/Build/source/utils/asymptote/runstring.cc index d2240bc3fe7..193b2419322 100644 --- a/Build/source/utils/asymptote/runstring.cc +++ b/Build/source/utils/asymptote/runstring.cc @@ -313,9 +313,10 @@ void gen_runstring10(stack *Stack) } #line 204 "runstring.in" -// string format(string *format, Int x); +// string format(string *format, Int x, string locale=emptystring); void gen_runstring11(stack *Stack) { + string locale=vm::pop<string>(Stack,emptystring); Int x=vm::pop<Int>(Stack); string * format=vm::pop<string *>(Stack); #line 205 "runstring.in" @@ -325,21 +326,36 @@ void gen_runstring11(stack *Stack) Int size=snprintf(NULL,0,f,x)+1; if(size < 1) size=255; // Workaround for non-C99 compliant systems. + const char *oldlocale=NULL; + + if(!locale.empty()) { + oldlocale=setlocale(LC_ALL,NULL); + if(oldlocale) oldlocale=StrdupNoGC(oldlocale); + setlocale(LC_ALL,locale.c_str()); + } + char *buf=new char[size]; snprintf(buf,size,f,x); + + if(oldlocale) { + setlocale(LC_ALL,oldlocale); + delete[] oldlocale; + } + string s=string(buf); delete[] buf; {Stack->push<string>(s); return;} } -#line 219 "runstring.in" -// string format(string *format, real x, string locale=emptystring); +#line 233 "runstring.in" +// string format(string *format, string separator, real x, string locale=emptystring); void gen_runstring12(stack *Stack) { string locale=vm::pop<string>(Stack,emptystring); real x=vm::pop<real>(Stack); + string separator=vm::pop<string>(Stack); string * format=vm::pop<string *>(Stack); -#line 220 "runstring.in" +#line 235 "runstring.in" bool tex=getSetting<string>("tex") != "none"; bool texify=false; ostringstream out; @@ -398,7 +414,7 @@ void gen_runstring12(stack *Stack) char *q=buf; // beginning of formatted number - if(*q == ' ') { + if(*q == ' ' && texify) { out << phantom; q++; } @@ -416,13 +432,14 @@ void gen_runstring12(stack *Stack) } if(zero) { q++; - if(plus || space) out << phantom; + if((plus || space) && texify) out << phantom; } } const char *r=p=q; bool dp=false; - while(*r != 0 && (isdigit(*r) || *r == decimal || *r == '+' || *r == '-')) { + while(*r != 0 && (isspace(*r) || isdigit(*r) || *r == decimal \ + || *r == '+' || *r == '-')) { if(*r == decimal) dp=true; r++; } @@ -441,7 +458,7 @@ void gen_runstring12(stack *Stack) while(*q != 0) { if(texify && (*q == 'E' || *q == 'e') && (*(q+1) == '+' || *(q+1) == '-')) { - if(!zero) out << "\\!\\times\\!10^{"; + if(!zero) out << separator << "10^{"; bool plus=(*(q+1) == '+'); q++; if(plus) q++; @@ -463,12 +480,12 @@ void gen_runstring12(stack *Stack) {Stack->push<string>(out.str()); return;} } -#line 344 "runstring.in" +#line 360 "runstring.in" // Int hex(string s); void gen_runstring13(stack *Stack) { string s=vm::pop<string>(Stack); -#line 345 "runstring.in" +#line 361 "runstring.in" istringstream is(s); is.setf(std::ios::hex,std::ios::basefield); Int value; @@ -478,36 +495,45 @@ void gen_runstring13(stack *Stack) error(buf); } -#line 355 "runstring.in" -// string string(Int x); +#line 371 "runstring.in" +// Int ascii(string s); void gen_runstring14(stack *Stack) { + string s=vm::pop<string>(Stack); +#line 372 "runstring.in" + {Stack->push<Int>(s.empty() ? -1 : (unsigned char) s[0]); return;} +} + +#line 376 "runstring.in" +// string string(Int x); +void gen_runstring15(stack *Stack) +{ Int x=vm::pop<Int>(Stack); -#line 356 "runstring.in" +#line 377 "runstring.in" ostringstream buf; buf << x; {Stack->push<string>(buf.str()); return;} } -#line 362 "runstring.in" +#line 383 "runstring.in" // string string(real x, Int digits=DBL_DIG); -void gen_runstring15(stack *Stack) +void gen_runstring16(stack *Stack) { Int digits=vm::pop<Int>(Stack,DBL_DIG); real x=vm::pop<real>(Stack); -#line 363 "runstring.in" +#line 384 "runstring.in" ostringstream buf; buf.precision(digits); buf << x; {Stack->push<string>(buf.str()); return;} } -#line 370 "runstring.in" +#line 391 "runstring.in" // string time(string format=defaulttimeformat); -void gen_runstring16(stack *Stack) +void gen_runstring17(stack *Stack) { string format=vm::pop<string>(Stack,defaulttimeformat); -#line 371 "runstring.in" +#line 392 "runstring.in" #ifdef HAVE_STRFTIME const time_t bintime=time(NULL); if(!strftime(Time,nTime,format.c_str(),localtime(&bintime))) {Stack->push<string>(""); return;} @@ -517,13 +543,13 @@ void gen_runstring16(stack *Stack) #endif } -#line 381 "runstring.in" +#line 402 "runstring.in" // string time(Int seconds, string format=defaulttimeformat); -void gen_runstring17(stack *Stack) +void gen_runstring18(stack *Stack) { string format=vm::pop<string>(Stack,defaulttimeformat); Int seconds=vm::pop<Int>(Stack); -#line 382 "runstring.in" +#line 403 "runstring.in" #ifdef HAVE_STRFTIME const time_t bintime=seconds; if(!strftime(Time,nTime,format.c_str(),localtime(&bintime))) {Stack->push<string>(""); return;} @@ -535,13 +561,13 @@ void gen_runstring17(stack *Stack) #endif } -#line 394 "runstring.in" +#line 415 "runstring.in" // Int seconds(string t=emptystring, string format=emptystring); -void gen_runstring18(stack *Stack) +void gen_runstring19(stack *Stack) { string format=vm::pop<string>(Stack,emptystring); string t=vm::pop<string>(Stack,emptystring); -#line 395 "runstring.in" +#line 416 "runstring.in" #if defined(HAVE_STRPTIME) const time_t bintime=time(NULL); tm tm=*localtime(&bintime); @@ -581,21 +607,23 @@ void gen_runstring_venv(venv &ve) #line 174 "runstring.in" addFunc(ve, run::gen_runstring10, primString() , SYM(replace), formal(primString(), SYM(s), false, false), formal(stringArray2(), SYM(translate), false, false)); #line 204 "runstring.in" - addFunc(ve, run::gen_runstring11, primString() , SYM(format), formal(primString(), SYM(format), false, false), formal(primInt(), SYM(x), false, false)); -#line 219 "runstring.in" - addFunc(ve, run::gen_runstring12, primString() , SYM(format), formal(primString(), SYM(format), false, false), formal(primReal(), SYM(x), false, false), formal(primString() , SYM(locale), true, false)); -#line 344 "runstring.in" + addFunc(ve, run::gen_runstring11, primString() , SYM(format), formal(primString(), SYM(format), false, false), formal(primInt(), SYM(x), false, false), formal(primString() , SYM(locale), true, false)); +#line 233 "runstring.in" + addFunc(ve, run::gen_runstring12, primString() , SYM(format), formal(primString(), SYM(format), false, false), formal(primString() , SYM(separator), false, false), formal(primReal(), SYM(x), false, false), formal(primString() , SYM(locale), true, false)); +#line 360 "runstring.in" addFunc(ve, run::gen_runstring13, primInt(), SYM(hex), formal(primString() , SYM(s), false, false)); -#line 355 "runstring.in" - addFunc(ve, run::gen_runstring14, primString() , SYM(string), formal(primInt(), SYM(x), false, false)); -#line 362 "runstring.in" - addFunc(ve, run::gen_runstring15, primString() , SYM(string), formal(primReal(), SYM(x), false, false), formal(primInt(), SYM(digits), true, false)); -#line 370 "runstring.in" - addFunc(ve, run::gen_runstring16, primString() , SYM(time), formal(primString() , SYM(format), true, false)); -#line 381 "runstring.in" - addFunc(ve, run::gen_runstring17, primString() , SYM(time), formal(primInt(), SYM(seconds), false, false), formal(primString() , SYM(format), true, false)); -#line 394 "runstring.in" - addFunc(ve, run::gen_runstring18, primInt(), SYM(seconds), formal(primString() , SYM(t), true, false), formal(primString() , SYM(format), true, false)); +#line 371 "runstring.in" + addFunc(ve, run::gen_runstring14, primInt(), SYM(ascii), formal(primString() , SYM(s), false, false)); +#line 376 "runstring.in" + addFunc(ve, run::gen_runstring15, primString() , SYM(string), formal(primInt(), SYM(x), false, false)); +#line 383 "runstring.in" + addFunc(ve, run::gen_runstring16, primString() , SYM(string), formal(primReal(), SYM(x), false, false), formal(primInt(), SYM(digits), true, false)); +#line 391 "runstring.in" + addFunc(ve, run::gen_runstring17, primString() , SYM(time), formal(primString() , SYM(format), true, false)); +#line 402 "runstring.in" + addFunc(ve, run::gen_runstring18, primString() , SYM(time), formal(primInt(), SYM(seconds), false, false), formal(primString() , SYM(format), true, false)); +#line 415 "runstring.in" + addFunc(ve, run::gen_runstring19, primInt(), SYM(seconds), formal(primString() , SYM(t), true, false), formal(primString() , SYM(format), true, false)); } } // namespace trans diff --git a/Build/source/utils/asymptote/runstring.in b/Build/source/utils/asymptote/runstring.in index e0018ded82c..4c6c1db1d85 100644 --- a/Build/source/utils/asymptote/runstring.in +++ b/Build/source/utils/asymptote/runstring.in @@ -201,7 +201,7 @@ string replace(string *S, stringarray2 *translate) return buf.str(); } -string format(string *format, Int x) +string format(string *format, Int x, string locale=emptystring) { const char *f=format->c_str(); @@ -209,14 +209,29 @@ string format(string *format, Int x) Int size=snprintf(NULL,0,f,x)+1; if(size < 1) size=255; // Workaround for non-C99 compliant systems. + const char *oldlocale=NULL; + + if(!locale.empty()) { + oldlocale=setlocale(LC_ALL,NULL); + if(oldlocale) oldlocale=StrdupNoGC(oldlocale); + setlocale(LC_ALL,locale.c_str()); + } + char *buf=new char[size]; snprintf(buf,size,f,x); + + if(oldlocale) { + setlocale(LC_ALL,oldlocale); + delete[] oldlocale; + } + string s=string(buf); delete[] buf; return s; } -string format(string *format, real x, string locale=emptystring) +string format(string *format, string separator, real x, + string locale=emptystring) { bool tex=getSetting<string>("tex") != "none"; bool texify=false; @@ -276,7 +291,7 @@ string format(string *format, real x, string locale=emptystring) char *q=buf; // beginning of formatted number - if(*q == ' ') { + if(*q == ' ' && texify) { out << phantom; q++; } @@ -294,13 +309,14 @@ string format(string *format, real x, string locale=emptystring) } if(zero) { q++; - if(plus || space) out << phantom; + if((plus || space) && texify) out << phantom; } } const char *r=p=q; bool dp=false; - while(*r != 0 && (isdigit(*r) || *r == decimal || *r == '+' || *r == '-')) { + while(*r != 0 && (isspace(*r) || isdigit(*r) || *r == decimal \ + || *r == '+' || *r == '-')) { if(*r == decimal) dp=true; r++; } @@ -319,7 +335,7 @@ string format(string *format, real x, string locale=emptystring) while(*q != 0) { if(texify && (*q == 'E' || *q == 'e') && (*(q+1) == '+' || *(q+1) == '-')) { - if(!zero) out << "\\!\\times\\!10^{"; + if(!zero) out << separator << "10^{"; bool plus=(*(q+1) == '+'); q++; if(plus) q++; @@ -352,6 +368,11 @@ Int hex(string s) error(buf); } +Int ascii(string s) +{ + return s.empty() ? -1 : (unsigned char) s[0]; +} + string string(Int x) { ostringstream buf; diff --git a/Build/source/utils/asymptote/runsystem.cc b/Build/source/utils/asymptote/runsystem.cc index 9cc29f0dd9e..a731c603c14 100644 --- a/Build/source/utils/asymptote/runsystem.cc +++ b/Build/source/utils/asymptote/runsystem.cc @@ -125,8 +125,7 @@ string convertname(string name, const string& format) { if(name.empty()) return buildname(outname(),format,""); - else - name=outpath(name); + name=outpath(name); return format.empty() ? name : format+":"+name; } @@ -162,143 +161,143 @@ void exitFunction(stack *Stack) #endif namespace run { -#line 108 "runsystem.in" +#line 107 "runsystem.in" // string outname(); void gen_runsystem0(stack *Stack) { -#line 109 "runsystem.in" +#line 108 "runsystem.in" {Stack->push<string>(outname()); return;} } -#line 113 "runsystem.in" +#line 112 "runsystem.in" // void atupdate(callable *f); void gen_runsystem1(stack *Stack) { callable * f=vm::pop<callable *>(Stack); -#line 114 "runsystem.in" +#line 113 "runsystem.in" processData().atUpdateFunction=f; } -#line 118 "runsystem.in" +#line 117 "runsystem.in" // callable* atupdate(); void gen_runsystem2(stack *Stack) { -#line 119 "runsystem.in" +#line 118 "runsystem.in" {Stack->push<callable*>(processData().atUpdateFunction); return;} } -#line 123 "runsystem.in" +#line 122 "runsystem.in" // void atexit(callable *f); void gen_runsystem3(stack *Stack) { callable * f=vm::pop<callable *>(Stack); -#line 124 "runsystem.in" +#line 123 "runsystem.in" processData().atExitFunction=f; } -#line 128 "runsystem.in" +#line 127 "runsystem.in" // callable* atexit(); void gen_runsystem4(stack *Stack) { -#line 129 "runsystem.in" +#line 128 "runsystem.in" {Stack->push<callable*>(processData().atExitFunction); return;} } -#line 133 "runsystem.in" +#line 132 "runsystem.in" // void atbreakpoint(callableBp *f); void gen_runsystem5(stack *Stack) { callableBp * f=vm::pop<callableBp *>(Stack); -#line 134 "runsystem.in" +#line 133 "runsystem.in" processData().atBreakpointFunction=f; } -#line 138 "runsystem.in" +#line 137 "runsystem.in" // void breakpoint(runnable *s=NULL); void gen_runsystem6(stack *Stack) { runnable * s=vm::pop<runnable *>(Stack,NULL); -#line 139 "runsystem.in" +#line 138 "runsystem.in" breakpoint(Stack,s); } -#line 143 "runsystem.in" +#line 142 "runsystem.in" // string locatefile(string file); void gen_runsystem7(stack *Stack) { string file=vm::pop<string>(Stack); -#line 144 "runsystem.in" +#line 143 "runsystem.in" {Stack->push<string>(locateFile(file)); return;} } -#line 148 "runsystem.in" +#line 147 "runsystem.in" // void stop(string file, Int line, runnable *s=NULL); void gen_runsystem8(stack *Stack) { runnable * s=vm::pop<runnable *>(Stack,NULL); Int line=vm::pop<Int>(Stack); string file=vm::pop<string>(Stack); -#line 149 "runsystem.in" +#line 148 "runsystem.in" file=locateFile(file); clear(file,line); cout << "setting breakpoint at " << file << ": " << line << endl; bplist.push_back(bpinfo(file,line,s)); } -#line 156 "runsystem.in" +#line 155 "runsystem.in" // void breakpoints(); void gen_runsystem9(stack *) { -#line 157 "runsystem.in" +#line 156 "runsystem.in" for(mem::list<bpinfo>::iterator p=bplist.begin(); p != bplist.end(); ++p) cout << p->f.name() << ": " << p->f.line() << endl; } -#line 162 "runsystem.in" +#line 161 "runsystem.in" // void clear(string file, Int line); void gen_runsystem10(stack *Stack) { Int line=vm::pop<Int>(Stack); string file=vm::pop<string>(Stack); -#line 163 "runsystem.in" +#line 162 "runsystem.in" file=locateFile(file); clear(file,line,true); } -#line 168 "runsystem.in" +#line 167 "runsystem.in" // void clear(); void gen_runsystem11(stack *) { -#line 169 "runsystem.in" +#line 168 "runsystem.in" bplist.clear(); } -#line 173 "runsystem.in" +#line 172 "runsystem.in" // void warn(string s); void gen_runsystem12(stack *Stack) { string s=vm::pop<string>(Stack); -#line 174 "runsystem.in" +#line 173 "runsystem.in" Warn(s); } -#line 178 "runsystem.in" +#line 177 "runsystem.in" // void nowarn(string s); void gen_runsystem13(stack *Stack) { string s=vm::pop<string>(Stack); -#line 179 "runsystem.in" +#line 178 "runsystem.in" noWarn(s); } -#line 183 "runsystem.in" +#line 182 "runsystem.in" // void warning(string s, string t, bool position=false); void gen_runsystem14(stack *Stack) { bool position=vm::pop<bool>(Stack,false); string t=vm::pop<string>(Stack); string s=vm::pop<string>(Stack); -#line 184 "runsystem.in" +#line 183 "runsystem.in" if(settings::warn(s)) { em.warning(position ? getPos() : nullPos,s); em << t; @@ -306,44 +305,44 @@ void gen_runsystem14(stack *Stack) } // Strip directory from string -#line 192 "runsystem.in" +#line 191 "runsystem.in" // string stripdirectory(string *s); void gen_runsystem15(stack *Stack) { string * s=vm::pop<string *>(Stack); -#line 193 "runsystem.in" +#line 192 "runsystem.in" {Stack->push<string>(stripDir(*s)); return;} } // Strip directory from string -#line 198 "runsystem.in" +#line 197 "runsystem.in" // string stripfile(string *s); void gen_runsystem16(stack *Stack) { string * s=vm::pop<string *>(Stack); -#line 199 "runsystem.in" +#line 198 "runsystem.in" {Stack->push<string>(stripFile(*s)); return;} } // Strip file extension from string -#line 204 "runsystem.in" +#line 203 "runsystem.in" // string stripextension(string *s); void gen_runsystem17(stack *Stack) { string * s=vm::pop<string *>(Stack); -#line 205 "runsystem.in" +#line 204 "runsystem.in" {Stack->push<string>(stripExt(*s)); return;} } // Call ImageMagick convert. -#line 210 "runsystem.in" +#line 209 "runsystem.in" // Int convert(string args=emptystring, string file=emptystring, string format=emptystring); void gen_runsystem18(stack *Stack) { string format=vm::pop<string>(Stack,emptystring); string file=vm::pop<string>(Stack,emptystring); string args=vm::pop<string>(Stack,emptystring); -#line 212 "runsystem.in" +#line 211 "runsystem.in" string name=convertname(file,format); mem::vector<string> cmd; cmd.push_back(getSetting<string>("convert")); @@ -369,15 +368,15 @@ void gen_runsystem18(stack *Stack) } // Call ImageMagick animate. -#line 238 "runsystem.in" +#line 237 "runsystem.in" // Int animate(string args=emptystring, string file=emptystring, string format=emptystring); void gen_runsystem19(stack *Stack) { string format=vm::pop<string>(Stack,emptystring); string file=vm::pop<string>(Stack,emptystring); string args=vm::pop<string>(Stack,emptystring); -#line 240 "runsystem.in" -#ifndef __CYGWIN__ +#line 239 "runsystem.in" +#ifndef __MSDOS__ string name=convertname(file,format); if(view()) { mem::vector<string> cmd; @@ -390,12 +389,12 @@ void gen_runsystem19(stack *Stack) {Stack->push<Int>(0); return;} } -#line 254 "runsystem.in" +#line 253 "runsystem.in" // void purge(Int divisor=0); void gen_runsystem20(stack *Stack) { Int divisor=vm::pop<Int>(Stack,0); -#line 255 "runsystem.in" +#line 254 "runsystem.in" purge(divisor); } @@ -405,47 +404,47 @@ namespace trans { void gen_runsystem_venv(venv &ve) { -#line 108 "runsystem.in" +#line 107 "runsystem.in" addFunc(ve, run::gen_runsystem0, primString() , SYM(outname)); -#line 113 "runsystem.in" +#line 112 "runsystem.in" addFunc(ve, run::gen_runsystem1, primVoid(), SYM(atupdate), formal(voidFunction(), SYM(f), false, false)); -#line 118 "runsystem.in" +#line 117 "runsystem.in" addFunc(ve, run::gen_runsystem2, voidFunction(), SYM(atupdate)); -#line 123 "runsystem.in" +#line 122 "runsystem.in" addFunc(ve, run::gen_runsystem3, primVoid(), SYM(atexit), formal(voidFunction(), SYM(f), false, false)); -#line 128 "runsystem.in" +#line 127 "runsystem.in" addFunc(ve, run::gen_runsystem4, voidFunction(), SYM(atexit)); -#line 133 "runsystem.in" +#line 132 "runsystem.in" addFunc(ve, run::gen_runsystem5, primVoid(), SYM(atbreakpoint), formal(breakpointFunction(), SYM(f), false, false)); -#line 138 "runsystem.in" +#line 137 "runsystem.in" addFunc(ve, run::gen_runsystem6, primVoid(), SYM(breakpoint), formal(primCode(), SYM(s), true, false)); -#line 143 "runsystem.in" +#line 142 "runsystem.in" addFunc(ve, run::gen_runsystem7, primString() , SYM(locatefile), formal(primString() , SYM(file), false, false)); -#line 148 "runsystem.in" +#line 147 "runsystem.in" addFunc(ve, run::gen_runsystem8, primVoid(), SYM(stop), formal(primString() , SYM(file), false, false), formal(primInt(), SYM(line), false, false), formal(primCode(), SYM(s), true, false)); -#line 156 "runsystem.in" +#line 155 "runsystem.in" addFunc(ve, run::gen_runsystem9, primVoid(), SYM(breakpoints)); -#line 162 "runsystem.in" +#line 161 "runsystem.in" addFunc(ve, run::gen_runsystem10, primVoid(), SYM(clear), formal(primString() , SYM(file), false, false), formal(primInt(), SYM(line), false, false)); -#line 168 "runsystem.in" +#line 167 "runsystem.in" addFunc(ve, run::gen_runsystem11, primVoid(), SYM(clear)); -#line 173 "runsystem.in" +#line 172 "runsystem.in" addFunc(ve, run::gen_runsystem12, primVoid(), SYM(warn), formal(primString() , SYM(s), false, false)); -#line 178 "runsystem.in" +#line 177 "runsystem.in" addFunc(ve, run::gen_runsystem13, primVoid(), SYM(nowarn), formal(primString() , SYM(s), false, false)); -#line 183 "runsystem.in" +#line 182 "runsystem.in" addFunc(ve, run::gen_runsystem14, primVoid(), SYM(warning), formal(primString() , SYM(s), false, false), formal(primString() , SYM(t), false, false), formal(primBoolean(), SYM(position), true, false)); -#line 191 "runsystem.in" +#line 190 "runsystem.in" addFunc(ve, run::gen_runsystem15, primString() , SYM(stripdirectory), formal(primString(), SYM(s), false, false)); -#line 197 "runsystem.in" +#line 196 "runsystem.in" addFunc(ve, run::gen_runsystem16, primString() , SYM(stripfile), formal(primString(), SYM(s), false, false)); -#line 203 "runsystem.in" +#line 202 "runsystem.in" addFunc(ve, run::gen_runsystem17, primString() , SYM(stripextension), formal(primString(), SYM(s), false, false)); -#line 209 "runsystem.in" +#line 208 "runsystem.in" addFunc(ve, run::gen_runsystem18, primInt(), SYM(convert), formal(primString() , SYM(args), true, false), formal(primString() , SYM(file), true, false), formal(primString() , SYM(format), true, false)); -#line 237 "runsystem.in" +#line 236 "runsystem.in" addFunc(ve, run::gen_runsystem19, primInt(), SYM(animate), formal(primString() , SYM(args), true, false), formal(primString() , SYM(file), true, false), formal(primString() , SYM(format), true, false)); -#line 254 "runsystem.in" +#line 253 "runsystem.in" addFunc(ve, run::gen_runsystem20, primVoid(), SYM(purge), formal(primInt(), SYM(divisor), true, false)); } diff --git a/Build/source/utils/asymptote/runsystem.in b/Build/source/utils/asymptote/runsystem.in index 5fba04870b7..faa862dd0bb 100644 --- a/Build/source/utils/asymptote/runsystem.in +++ b/Build/source/utils/asymptote/runsystem.in @@ -74,8 +74,7 @@ string convertname(string name, const string& format) { if(name.empty()) return buildname(outname(),format,""); - else - name=outpath(name); + name=outpath(name); return format.empty() ? name : format+":"+name; } @@ -238,7 +237,7 @@ Int convert(string args=emptystring, string file=emptystring, Int animate(string args=emptystring, string file=emptystring, string format=emptystring) { -#ifndef __CYGWIN__ +#ifndef __MSDOS__ string name=convertname(file,format); if(view()) { mem::vector<string> cmd; diff --git a/Build/source/utils/asymptote/runtime.cc b/Build/source/utils/asymptote/runtime.cc index e71103fd8d1..ac97f0dc39f 100644 --- a/Build/source/utils/asymptote/runtime.cc +++ b/Build/source/utils/asymptote/runtime.cc @@ -105,6 +105,10 @@ function *realRealFunction(); #include "process.h" #include "arrayop.h" +#ifdef __APPLE__ +extern "C" int isnan(double); +#endif + #if defined(USEGC) && defined(GC_DEBUG) && defined(GC_BACKTRACE) extern "C" { void *GC_generate_random_valid_address(void); @@ -243,45 +247,54 @@ void unused(void *) namespace run { // Initializers -#line 220 "runtime.in" +#line 224 "runtime.in" void IntZero(stack *Stack) { -#line 221 "runtime.in" +#line 225 "runtime.in" {Stack->push<Int>(0); return;} } -#line 226 "runtime.in" +#line 230 "runtime.in" void realZero(stack *Stack) { -#line 227 "runtime.in" +#line 231 "runtime.in" {Stack->push<real>(0.0); return;} } -#line 231 "runtime.in" +#line 235 "runtime.in" void boolFalse(stack *Stack) { -#line 232 "runtime.in" +#line 236 "runtime.in" {Stack->push<bool>(false); return;} } -#line 236 "runtime.in" +#line 240 "runtime.in" +// bool isnan(real x); +void gen_runtime3(stack *Stack) +{ + real x=vm::pop<real>(Stack); +#line 241 "runtime.in" + {Stack->push<bool>(isnan(x)); return;} +} + +#line 245 "runtime.in" void pushNullArray(stack *Stack) { -#line 237 "runtime.in" +#line 246 "runtime.in" {Stack->push<array*>(0); return;} } -#line 241 "runtime.in" +#line 250 "runtime.in" void pushNullRecord(stack *Stack) { -#line 242 "runtime.in" +#line 251 "runtime.in" {Stack->push<frame*>(0); return;} } -#line 246 "runtime.in" +#line 255 "runtime.in" void pushNullFunction(stack *Stack) { -#line 247 "runtime.in" +#line 256 "runtime.in" {Stack->push(nullfunc::instance()); return;} } @@ -290,248 +303,248 @@ void pushNullFunction(stack *Stack) // Put the default value token on the stack (in place of an argument when // making a function call). -#line 256 "runtime.in" +#line 265 "runtime.in" void pushDefault(stack *Stack) { -#line 257 "runtime.in" +#line 266 "runtime.in" {Stack->push(Default); return;} } // Test if the value on the stack is the default value token. -#line 263 "runtime.in" +#line 272 "runtime.in" void isDefault(stack *Stack) { item i=vm::pop(Stack); -#line 264 "runtime.in" +#line 273 "runtime.in" {Stack->push<bool>(isdefault(i)); return;} } // Casts -#line 270 "runtime.in" +#line 279 "runtime.in" void pairToGuide(stack *Stack) { pair z=vm::pop<pair>(Stack); -#line 271 "runtime.in" +#line 280 "runtime.in" {Stack->push<guide*>(new pairguide(z)); return;} } -#line 276 "runtime.in" +#line 285 "runtime.in" void pathToGuide(stack *Stack) { path p=vm::pop<path>(Stack); -#line 277 "runtime.in" +#line 286 "runtime.in" {Stack->push<guide*>(new pathguide(p)); return;} } -#line 281 "runtime.in" +#line 290 "runtime.in" void guideToPath(stack *Stack) { guide * g=vm::pop<guide *>(Stack); -#line 282 "runtime.in" +#line 291 "runtime.in" {Stack->push<path>(g->solve()); return;} } // Pen operations -#line 288 "runtime.in" +#line 297 "runtime.in" void newPen(stack *Stack) { -#line 289 "runtime.in" +#line 298 "runtime.in" {Stack->push<pen>(pen()); return;} } -#line 294 "runtime.in" +#line 303 "runtime.in" // bool ==(pen a, pen b); -void gen_runtime12(stack *Stack) +void gen_runtime13(stack *Stack) { pen b=vm::pop<pen>(Stack); pen a=vm::pop<pen>(Stack); -#line 295 "runtime.in" +#line 304 "runtime.in" {Stack->push<bool>(a == b); return;} } -#line 299 "runtime.in" +#line 308 "runtime.in" // bool !=(pen a, pen b); -void gen_runtime13(stack *Stack) +void gen_runtime14(stack *Stack) { pen b=vm::pop<pen>(Stack); pen a=vm::pop<pen>(Stack); -#line 300 "runtime.in" +#line 309 "runtime.in" {Stack->push<bool>(a != b); return;} } -#line 304 "runtime.in" +#line 313 "runtime.in" // pen +(pen a, pen b); -void gen_runtime14(stack *Stack) +void gen_runtime15(stack *Stack) { pen b=vm::pop<pen>(Stack); pen a=vm::pop<pen>(Stack); -#line 305 "runtime.in" +#line 314 "runtime.in" {Stack->push<pen>(a+b); return;} } -#line 309 "runtime.in" +#line 318 "runtime.in" // pen *(real a, pen b); -void gen_runtime15(stack *Stack) +void gen_runtime16(stack *Stack) { pen b=vm::pop<pen>(Stack); real a=vm::pop<real>(Stack); -#line 310 "runtime.in" +#line 319 "runtime.in" {Stack->push<pen>(a*b); return;} } -#line 314 "runtime.in" +#line 323 "runtime.in" // pen *(pen a, real b); -void gen_runtime16(stack *Stack) +void gen_runtime17(stack *Stack) { real b=vm::pop<real>(Stack); pen a=vm::pop<pen>(Stack); -#line 315 "runtime.in" +#line 324 "runtime.in" {Stack->push<pen>(b*a); return;} } -#line 319 "runtime.in" +#line 328 "runtime.in" // pair max(pen p); -void gen_runtime17(stack *Stack) +void gen_runtime18(stack *Stack) { pen p=vm::pop<pen>(Stack); -#line 320 "runtime.in" +#line 329 "runtime.in" {Stack->push<pair>(p.bounds().Max()); return;} } -#line 324 "runtime.in" +#line 333 "runtime.in" // pair min(pen p); -void gen_runtime18(stack *Stack) +void gen_runtime19(stack *Stack) { pen p=vm::pop<pen>(Stack); -#line 325 "runtime.in" +#line 334 "runtime.in" {Stack->push<pair>(p.bounds().Min()); return;} } // Reset the meaning of pen default attributes. -#line 330 "runtime.in" +#line 339 "runtime.in" // void resetdefaultpen(); -void gen_runtime19(stack *) +void gen_runtime20(stack *) { -#line 331 "runtime.in" +#line 340 "runtime.in" processData().defaultpen=camp::pen::initialpen(); } -#line 335 "runtime.in" +#line 344 "runtime.in" // void defaultpen(pen p); -void gen_runtime20(stack *Stack) +void gen_runtime21(stack *Stack) { pen p=vm::pop<pen>(Stack); -#line 336 "runtime.in" +#line 345 "runtime.in" processData().defaultpen=pen(resolvepen,p); } -#line 340 "runtime.in" +#line 349 "runtime.in" // pen defaultpen(); -void gen_runtime21(stack *Stack) +void gen_runtime22(stack *Stack) { -#line 341 "runtime.in" +#line 350 "runtime.in" {Stack->push<pen>(processData().defaultpen); return;} } -#line 345 "runtime.in" +#line 354 "runtime.in" // bool invisible(pen p); -void gen_runtime22(stack *Stack) +void gen_runtime23(stack *Stack) { pen p=vm::pop<pen>(Stack); -#line 346 "runtime.in" +#line 355 "runtime.in" {Stack->push<bool>(p.invisible()); return;} } -#line 350 "runtime.in" +#line 359 "runtime.in" // pen invisible(); -void gen_runtime23(stack *Stack) +void gen_runtime24(stack *Stack) { -#line 351 "runtime.in" +#line 360 "runtime.in" {Stack->push<pen>(pen(invisiblepen)); return;} } -#line 355 "runtime.in" +#line 364 "runtime.in" // pen gray(pen p); -void gen_runtime24(stack *Stack) +void gen_runtime25(stack *Stack) { pen p=vm::pop<pen>(Stack); -#line 356 "runtime.in" +#line 365 "runtime.in" p.togrey(); {Stack->push<pen>(p); return;} } -#line 361 "runtime.in" +#line 370 "runtime.in" // pen rgb(pen p); -void gen_runtime25(stack *Stack) +void gen_runtime26(stack *Stack) { pen p=vm::pop<pen>(Stack); -#line 362 "runtime.in" +#line 371 "runtime.in" p.torgb(); {Stack->push<pen>(p); return;} } -#line 367 "runtime.in" +#line 376 "runtime.in" // pen cmyk(pen p); -void gen_runtime26(stack *Stack) +void gen_runtime27(stack *Stack) { pen p=vm::pop<pen>(Stack); -#line 368 "runtime.in" +#line 377 "runtime.in" p.tocmyk(); {Stack->push<pen>(p); return;} } -#line 373 "runtime.in" +#line 382 "runtime.in" // pen interp(pen a, pen b, real t); -void gen_runtime27(stack *Stack) +void gen_runtime28(stack *Stack) { real t=vm::pop<real>(Stack); pen b=vm::pop<pen>(Stack); pen a=vm::pop<pen>(Stack); -#line 374 "runtime.in" +#line 383 "runtime.in" {Stack->push<pen>(interpolate(a,b,t)); return;} } -#line 378 "runtime.in" +#line 387 "runtime.in" // pen rgb(real r, real g, real b); -void gen_runtime28(stack *Stack) +void gen_runtime29(stack *Stack) { real b=vm::pop<real>(Stack); real g=vm::pop<real>(Stack); real r=vm::pop<real>(Stack); -#line 379 "runtime.in" +#line 388 "runtime.in" {Stack->push<pen>(pen(r,g,b)); return;} } -#line 383 "runtime.in" +#line 392 "runtime.in" // pen cmyk(real c, real m, real y, real k); -void gen_runtime29(stack *Stack) +void gen_runtime30(stack *Stack) { real k=vm::pop<real>(Stack); real y=vm::pop<real>(Stack); real m=vm::pop<real>(Stack); real c=vm::pop<real>(Stack); -#line 384 "runtime.in" +#line 393 "runtime.in" {Stack->push<pen>(pen(c,m,y,k)); return;} } -#line 388 "runtime.in" +#line 397 "runtime.in" // pen gray(real gray); -void gen_runtime30(stack *Stack) +void gen_runtime31(stack *Stack) { real gray=vm::pop<real>(Stack); -#line 389 "runtime.in" +#line 398 "runtime.in" {Stack->push<pen>(pen(gray)); return;} } -#line 393 "runtime.in" +#line 402 "runtime.in" // realarray* colors(pen p); -void gen_runtime31(stack *Stack) +void gen_runtime32(stack *Stack) { pen p=vm::pop<pen>(Stack); -#line 394 "runtime.in" +#line 403 "runtime.in" size_t n=ColorComponents[p.colorspace()]; array *a=new array(n); @@ -558,78 +571,78 @@ void gen_runtime31(stack *Stack) {Stack->push<realarray*>(a); return;} } -#line 421 "runtime.in" +#line 430 "runtime.in" // string hex(pen p); -void gen_runtime32(stack *Stack) +void gen_runtime33(stack *Stack) { pen p=vm::pop<pen>(Stack); -#line 422 "runtime.in" +#line 431 "runtime.in" {Stack->push<string>(p.hex()); return;} } -#line 426 "runtime.in" +#line 435 "runtime.in" // Int byte(real x); -void gen_runtime33(stack *Stack) +void gen_runtime34(stack *Stack) { real x=vm::pop<real>(Stack); -#line 427 "runtime.in" +#line 436 "runtime.in" {Stack->push<Int>(byte(x)); return;} } -#line 431 "runtime.in" +#line 440 "runtime.in" // string colorspace(pen p); -void gen_runtime34(stack *Stack) +void gen_runtime35(stack *Stack) { pen p=vm::pop<pen>(Stack); -#line 432 "runtime.in" +#line 441 "runtime.in" string s=ColorDeviceSuffix[p.colorspace()]; std::transform(s.begin(),s.end(),s.begin(),tolower); {Stack->push<string>(s); return;} } -#line 438 "runtime.in" +#line 447 "runtime.in" // pen pattern(string *s); -void gen_runtime35(stack *Stack) +void gen_runtime36(stack *Stack) { string * s=vm::pop<string *>(Stack); -#line 439 "runtime.in" +#line 448 "runtime.in" {Stack->push<pen>(pen(setpattern,*s)); return;} } -#line 443 "runtime.in" +#line 452 "runtime.in" // string pattern(pen p); -void gen_runtime36(stack *Stack) +void gen_runtime37(stack *Stack) { pen p=vm::pop<pen>(Stack); -#line 444 "runtime.in" +#line 453 "runtime.in" {Stack->push<string>(p.fillpattern()); return;} } -#line 448 "runtime.in" +#line 457 "runtime.in" // pen fillrule(Int n); -void gen_runtime37(stack *Stack) +void gen_runtime38(stack *Stack) { Int n=vm::pop<Int>(Stack); -#line 449 "runtime.in" +#line 458 "runtime.in" {Stack->push<pen>(pen(n >= 0 && n < nFill ? (FillRule) n : DEFFILL)); return;} } -#line 453 "runtime.in" +#line 462 "runtime.in" // Int fillrule(pen p); -void gen_runtime38(stack *Stack) +void gen_runtime39(stack *Stack) { pen p=vm::pop<pen>(Stack); -#line 454 "runtime.in" +#line 463 "runtime.in" {Stack->push<Int>(p.Fillrule()); return;} } -#line 458 "runtime.in" +#line 467 "runtime.in" // pen opacity(real opacity=1.0, string blend=defaulttransparency); -void gen_runtime39(stack *Stack) +void gen_runtime40(stack *Stack) { string blend=vm::pop<string>(Stack,defaulttransparency); real opacity=vm::pop<real>(Stack,1.0); -#line 459 "runtime.in" +#line 468 "runtime.in" for(Int i=0; i < nBlendMode; ++i) if(blend == BlendMode[i]) {Stack->push<pen>(pen(Transparency(blend,opacity))); return;} @@ -638,33 +651,33 @@ void gen_runtime39(stack *Stack) error(buf); } -#line 468 "runtime.in" +#line 477 "runtime.in" // real opacity(pen p); -void gen_runtime40(stack *Stack) +void gen_runtime41(stack *Stack) { pen p=vm::pop<pen>(Stack); -#line 469 "runtime.in" +#line 478 "runtime.in" {Stack->push<real>(p.opacity()); return;} } -#line 473 "runtime.in" +#line 482 "runtime.in" // string blend(pen p); -void gen_runtime41(stack *Stack) +void gen_runtime42(stack *Stack) { pen p=vm::pop<pen>(Stack); -#line 474 "runtime.in" +#line 483 "runtime.in" {Stack->push<string>(p.blend()); return;} } -#line 478 "runtime.in" +#line 487 "runtime.in" // pen linetype(realarray *pattern, real offset=0, bool scale=true, bool adjust=true); -void gen_runtime42(stack *Stack) +void gen_runtime43(stack *Stack) { bool adjust=vm::pop<bool>(Stack,true); bool scale=vm::pop<bool>(Stack,true); real offset=vm::pop<real>(Stack,0); realarray * pattern=vm::pop<realarray *>(Stack); -#line 480 "runtime.in" +#line 489 "runtime.in" size_t size=checkArray(pattern); array *a=new array(size); for(size_t i=0; i < size; ++i) @@ -673,272 +686,272 @@ void gen_runtime42(stack *Stack) {Stack->push<pen>(pen(LineType(*a,offset,scale,adjust))); return;} } -#line 489 "runtime.in" +#line 498 "runtime.in" // realarray* linetype(pen p=CURRENTPEN); -void gen_runtime43(stack *Stack) +void gen_runtime44(stack *Stack) { pen p=vm::pop<pen>(Stack,CURRENTPEN); -#line 490 "runtime.in" +#line 499 "runtime.in" array a=p.linetype()->pattern; {Stack->push<realarray*>(copyArray(&a)); return;} } -#line 495 "runtime.in" +#line 504 "runtime.in" // real offset(pen p); -void gen_runtime44(stack *Stack) +void gen_runtime45(stack *Stack) { pen p=vm::pop<pen>(Stack); -#line 496 "runtime.in" +#line 505 "runtime.in" {Stack->push<real>(p.linetype()->offset); return;} } -#line 500 "runtime.in" +#line 509 "runtime.in" // bool scale(pen p); -void gen_runtime45(stack *Stack) +void gen_runtime46(stack *Stack) { pen p=vm::pop<pen>(Stack); -#line 501 "runtime.in" +#line 510 "runtime.in" {Stack->push<bool>(p.linetype()->scale); return;} } -#line 505 "runtime.in" +#line 514 "runtime.in" // bool adjust(pen p); -void gen_runtime46(stack *Stack) +void gen_runtime47(stack *Stack) { pen p=vm::pop<pen>(Stack); -#line 506 "runtime.in" +#line 515 "runtime.in" {Stack->push<bool>(p.linetype()->adjust); return;} } -#line 510 "runtime.in" +#line 519 "runtime.in" // pen adjust(pen p, real arclength, bool cyclic); -void gen_runtime47(stack *Stack) +void gen_runtime48(stack *Stack) { bool cyclic=vm::pop<bool>(Stack); real arclength=vm::pop<real>(Stack); pen p=vm::pop<pen>(Stack); -#line 511 "runtime.in" +#line 520 "runtime.in" {Stack->push<pen>(adjustdash(p,arclength,cyclic)); return;} } -#line 515 "runtime.in" +#line 524 "runtime.in" // pen linecap(Int n); -void gen_runtime48(stack *Stack) +void gen_runtime49(stack *Stack) { Int n=vm::pop<Int>(Stack); -#line 516 "runtime.in" +#line 525 "runtime.in" {Stack->push<pen>(pen(setlinecap,n >= 0 && n < nCap ? n : DEFCAP)); return;} } -#line 520 "runtime.in" +#line 529 "runtime.in" // Int linecap(pen p=CURRENTPEN); -void gen_runtime49(stack *Stack) +void gen_runtime50(stack *Stack) { pen p=vm::pop<pen>(Stack,CURRENTPEN); -#line 521 "runtime.in" +#line 530 "runtime.in" {Stack->push<Int>(p.cap()); return;} } -#line 525 "runtime.in" +#line 534 "runtime.in" // pen linejoin(Int n); -void gen_runtime50(stack *Stack) +void gen_runtime51(stack *Stack) { Int n=vm::pop<Int>(Stack); -#line 526 "runtime.in" +#line 535 "runtime.in" {Stack->push<pen>(pen(setlinejoin,n >= 0 && n < nJoin ? n : DEFJOIN)); return;} } -#line 530 "runtime.in" +#line 539 "runtime.in" // Int linejoin(pen p=CURRENTPEN); -void gen_runtime51(stack *Stack) +void gen_runtime52(stack *Stack) { pen p=vm::pop<pen>(Stack,CURRENTPEN); -#line 531 "runtime.in" +#line 540 "runtime.in" {Stack->push<Int>(p.join()); return;} } -#line 535 "runtime.in" +#line 544 "runtime.in" // pen miterlimit(real x); -void gen_runtime52(stack *Stack) +void gen_runtime53(stack *Stack) { real x=vm::pop<real>(Stack); -#line 536 "runtime.in" +#line 545 "runtime.in" {Stack->push<pen>(pen(setmiterlimit,x >= 1.0 ? x : DEFJOIN)); return;} } -#line 540 "runtime.in" +#line 549 "runtime.in" // real miterlimit(pen p=CURRENTPEN); -void gen_runtime53(stack *Stack) +void gen_runtime54(stack *Stack) { pen p=vm::pop<pen>(Stack,CURRENTPEN); -#line 541 "runtime.in" +#line 550 "runtime.in" {Stack->push<real>(p.miter()); return;} } -#line 545 "runtime.in" +#line 554 "runtime.in" // pen linewidth(real x); -void gen_runtime54(stack *Stack) +void gen_runtime55(stack *Stack) { real x=vm::pop<real>(Stack); -#line 546 "runtime.in" +#line 555 "runtime.in" {Stack->push<pen>(pen(setlinewidth,x >= 0.0 ? x : DEFWIDTH)); return;} } -#line 550 "runtime.in" +#line 559 "runtime.in" // real linewidth(pen p=CURRENTPEN); -void gen_runtime55(stack *Stack) +void gen_runtime56(stack *Stack) { pen p=vm::pop<pen>(Stack,CURRENTPEN); -#line 551 "runtime.in" +#line 560 "runtime.in" {Stack->push<real>(p.width()); return;} } -#line 555 "runtime.in" +#line 564 "runtime.in" // pen fontcommand(string *s); -void gen_runtime56(stack *Stack) +void gen_runtime57(stack *Stack) { string * s=vm::pop<string *>(Stack); -#line 556 "runtime.in" +#line 565 "runtime.in" {Stack->push<pen>(pen(setfont,*s)); return;} } -#line 560 "runtime.in" +#line 569 "runtime.in" // string font(pen p=CURRENTPEN); -void gen_runtime57(stack *Stack) +void gen_runtime58(stack *Stack) { pen p=vm::pop<pen>(Stack,CURRENTPEN); -#line 561 "runtime.in" +#line 570 "runtime.in" {Stack->push<string>(p.Font()); return;} } -#line 565 "runtime.in" +#line 574 "runtime.in" // pen fontsize(real size, real lineskip); -void gen_runtime58(stack *Stack) +void gen_runtime59(stack *Stack) { real lineskip=vm::pop<real>(Stack); real size=vm::pop<real>(Stack); -#line 566 "runtime.in" +#line 575 "runtime.in" {Stack->push<pen>(pen(setfontsize,size > 0.0 ? size : 0.0, lineskip > 0.0 ? lineskip : 0.0)); return;} } -#line 571 "runtime.in" +#line 580 "runtime.in" // real fontsize(pen p=CURRENTPEN); -void gen_runtime59(stack *Stack) +void gen_runtime60(stack *Stack) { pen p=vm::pop<pen>(Stack,CURRENTPEN); -#line 572 "runtime.in" +#line 581 "runtime.in" {Stack->push<real>(p.size()); return;} } -#line 576 "runtime.in" +#line 585 "runtime.in" // real lineskip(pen p=CURRENTPEN); -void gen_runtime60(stack *Stack) +void gen_runtime61(stack *Stack) { pen p=vm::pop<pen>(Stack,CURRENTPEN); -#line 577 "runtime.in" +#line 586 "runtime.in" {Stack->push<real>(p.Lineskip()); return;} } -#line 581 "runtime.in" +#line 590 "runtime.in" // pen overwrite(Int n); -void gen_runtime61(stack *Stack) +void gen_runtime62(stack *Stack) { Int n=vm::pop<Int>(Stack); -#line 582 "runtime.in" +#line 591 "runtime.in" {Stack->push<pen>(pen(setoverwrite,n >= 0 && n < nOverwrite ? (overwrite_t) n : DEFWRITE)); return;} } -#line 587 "runtime.in" +#line 596 "runtime.in" // Int overwrite(pen p=CURRENTPEN); -void gen_runtime62(stack *Stack) +void gen_runtime63(stack *Stack) { pen p=vm::pop<pen>(Stack,CURRENTPEN); -#line 588 "runtime.in" +#line 597 "runtime.in" {Stack->push<Int>(p.Overwrite()); return;} } -#line 592 "runtime.in" +#line 601 "runtime.in" // pen basealign(Int n); -void gen_runtime63(stack *Stack) +void gen_runtime64(stack *Stack) { Int n=vm::pop<Int>(Stack); -#line 593 "runtime.in" +#line 602 "runtime.in" {Stack->push<pen>(pen(n >= 0 && n < nBaseLine ? (BaseLine) n : DEFBASE)); return;} } -#line 597 "runtime.in" +#line 606 "runtime.in" // Int basealign(pen p=CURRENTPEN); -void gen_runtime64(stack *Stack) +void gen_runtime65(stack *Stack) { pen p=vm::pop<pen>(Stack,CURRENTPEN); -#line 598 "runtime.in" +#line 607 "runtime.in" {Stack->push<Int>(p.Baseline()); return;} } -#line 602 "runtime.in" +#line 611 "runtime.in" // transform transform(pen p); -void gen_runtime65(stack *Stack) +void gen_runtime66(stack *Stack) { pen p=vm::pop<pen>(Stack); -#line 603 "runtime.in" +#line 612 "runtime.in" {Stack->push<transform>(p.getTransform()); return;} } -#line 607 "runtime.in" +#line 616 "runtime.in" // path nib(pen p); -void gen_runtime66(stack *Stack) +void gen_runtime67(stack *Stack) { pen p=vm::pop<pen>(Stack); -#line 608 "runtime.in" +#line 617 "runtime.in" {Stack->push<path>(p.Path()); return;} } -#line 612 "runtime.in" +#line 621 "runtime.in" // pen makepen(path p); -void gen_runtime67(stack *Stack) +void gen_runtime68(stack *Stack) { path p=vm::pop<path>(Stack); -#line 613 "runtime.in" +#line 622 "runtime.in" {Stack->push<pen>(pen(p)); return;} } -#line 617 "runtime.in" +#line 626 "runtime.in" // pen colorless(pen p); -void gen_runtime68(stack *Stack) +void gen_runtime69(stack *Stack) { pen p=vm::pop<pen>(Stack); -#line 618 "runtime.in" +#line 627 "runtime.in" p.colorless(); {Stack->push<pen>(p); return;} } // Interactive mode -#line 624 "runtime.in" +#line 633 "runtime.in" // bool interactive(); -void gen_runtime69(stack *Stack) +void gen_runtime70(stack *Stack) { -#line 625 "runtime.in" +#line 634 "runtime.in" {Stack->push<bool>(interact::interactive); return;} } -#line 630 "runtime.in" +#line 639 "runtime.in" // bool uptodate(); -void gen_runtime70(stack *Stack) +void gen_runtime71(stack *Stack) { -#line 631 "runtime.in" +#line 640 "runtime.in" {Stack->push<bool>(interact::uptodate); return;} } // System commands -#line 637 "runtime.in" +#line 646 "runtime.in" // Int system(stringarray *s); -void gen_runtime71(stack *Stack) +void gen_runtime72(stack *Stack) { stringarray * s=vm::pop<stringarray *>(Stack); -#line 638 "runtime.in" +#line 647 "runtime.in" if(safe) error("system() call disabled; override with option -nosafe"); size_t size=checkArray(s); if(size == 0) {Stack->push<Int>(0); return;} @@ -948,57 +961,57 @@ void gen_runtime71(stack *Stack) {Stack->push<Int>(System(cmd)); return;} } -#line 649 "runtime.in" +#line 658 "runtime.in" // bool view(); -void gen_runtime72(stack *Stack) +void gen_runtime73(stack *Stack) { -#line 650 "runtime.in" +#line 659 "runtime.in" {Stack->push<bool>(view()); return;} } -#line 654 "runtime.in" +#line 663 "runtime.in" // string asydir(); -void gen_runtime73(stack *Stack) +void gen_runtime74(stack *Stack) { -#line 655 "runtime.in" +#line 664 "runtime.in" {Stack->push<string>(systemDir); return;} } -#line 659 "runtime.in" +#line 668 "runtime.in" // string locale(string s=emptystring); -void gen_runtime74(stack *Stack) +void gen_runtime75(stack *Stack) { string s=vm::pop<string>(Stack,emptystring); -#line 660 "runtime.in" +#line 669 "runtime.in" char *L=setlocale(LC_ALL,s.empty() ? NULL : s.c_str()); {Stack->push<string>(L != NULL ? string(L) : ""); return;} } -#line 665 "runtime.in" +#line 674 "runtime.in" // void abort(string s=emptystring); -void gen_runtime75(stack *Stack) +void gen_runtime76(stack *Stack) { string s=vm::pop<string>(Stack,emptystring); -#line 666 "runtime.in" +#line 675 "runtime.in" if(s.empty()) throw handled_error(); error(s.c_str()); } -#line 671 "runtime.in" +#line 680 "runtime.in" // void exit(); -void gen_runtime76(stack *) +void gen_runtime77(stack *) { -#line 672 "runtime.in" +#line 681 "runtime.in" throw quit(); } -#line 676 "runtime.in" +#line 685 "runtime.in" // void assert(bool b, string s=emptystring); -void gen_runtime77(stack *Stack) +void gen_runtime78(stack *Stack) { string s=vm::pop<string>(Stack,emptystring); bool b=vm::pop<bool>(Stack); -#line 677 "runtime.in" +#line 686 "runtime.in" flush(cout); if(!b) { ostringstream buf; @@ -1008,34 +1021,34 @@ void gen_runtime77(stack *Stack) } } -#line 687 "runtime.in" +#line 696 "runtime.in" // void sleep(Int seconds); -void gen_runtime78(stack *Stack) +void gen_runtime79(stack *Stack) { Int seconds=vm::pop<Int>(Stack); -#line 688 "runtime.in" +#line 697 "runtime.in" if(seconds <= 0) return; sleep(seconds); } -#line 693 "runtime.in" +#line 702 "runtime.in" // void usleep(Int microseconds); -void gen_runtime79(stack *Stack) +void gen_runtime80(stack *Stack) { Int microseconds=vm::pop<Int>(Stack); -#line 694 "runtime.in" +#line 703 "runtime.in" if(microseconds <= 0) return; usleep((unsigned long) microseconds); } -#line 699 "runtime.in" +#line 708 "runtime.in" // void _eval(string *s, bool embedded, bool interactiveWrite=false); -void gen_runtime80(stack *Stack) +void gen_runtime81(stack *Stack) { bool interactiveWrite=vm::pop<bool>(Stack,false); bool embedded=vm::pop<bool>(Stack); string * s=vm::pop<string *>(Stack); -#line 700 "runtime.in" +#line 709 "runtime.in" if(embedded) { trans::coenv *e=Stack->getEnvironment(); vm::interactiveStack *is=dynamic_cast<vm::interactiveStack *>(Stack); @@ -1047,13 +1060,13 @@ void gen_runtime80(stack *Stack) runString(*s,interactiveWrite); } -#line 712 "runtime.in" +#line 721 "runtime.in" // void _eval(runnable *s, bool embedded); -void gen_runtime81(stack *Stack) +void gen_runtime82(stack *Stack) { bool embedded=vm::pop<bool>(Stack); runnable * s=vm::pop<runnable *>(Stack); -#line 713 "runtime.in" +#line 722 "runtime.in" absyntax::block *ast=new absyntax::block(s->getPos(), false); ast->add(s); @@ -1068,31 +1081,31 @@ void gen_runtime81(stack *Stack) runCode(ast); } -#line 728 "runtime.in" +#line 737 "runtime.in" // string location(); -void gen_runtime82(stack *Stack) +void gen_runtime83(stack *Stack) { -#line 729 "runtime.in" +#line 738 "runtime.in" ostringstream buf; buf << getPos(); {Stack->push<string>(buf.str()); return;} } // Wrapper for the stack::load() method. -#line 735 "runtime.in" +#line 744 "runtime.in" void loadModule(stack *Stack) { string * index=vm::pop<string *>(Stack); -#line 736 "runtime.in" +#line 745 "runtime.in" Stack->load(*index); } -#line 740 "runtime.in" +#line 749 "runtime.in" // string cd(string s=emptystring); -void gen_runtime84(stack *Stack) +void gen_runtime85(stack *Stack) { string s=vm::pop<string>(Stack,emptystring); -#line 741 "runtime.in" +#line 750 "runtime.in" if(!s.empty() && !globalwrite()) { string outname=getSetting<string>("outname"); string dir=stripDir(outname); @@ -1101,13 +1114,13 @@ void gen_runtime84(stack *Stack) {Stack->push<string>(setPath(s.c_str())); return;} } -#line 750 "runtime.in" +#line 759 "runtime.in" // void list(string *s, bool imports=false); -void gen_runtime85(stack *Stack) +void gen_runtime86(stack *Stack) { bool imports=vm::pop<bool>(Stack,false); string * s=vm::pop<string *>(Stack); -#line 751 "runtime.in" +#line 760 "runtime.in" if(*s == "-") return; trans::genv ge; symbol name=symbol::trans(*s); @@ -1117,18 +1130,18 @@ void gen_runtime85(stack *Stack) // Guide operations -#line 761 "runtime.in" +#line 770 "runtime.in" void nullGuide(stack *Stack) { -#line 762 "runtime.in" +#line 771 "runtime.in" {Stack->push<guide*>(new pathguide(path())); return;} } -#line 767 "runtime.in" +#line 776 "runtime.in" void dotsGuide(stack *Stack) { guidearray * a=vm::pop<guidearray *>(Stack); -#line 768 "runtime.in" +#line 777 "runtime.in" guidevector v; size_t size=checkArray(a); for (size_t i=0; i < size; ++i) @@ -1137,11 +1150,11 @@ void dotsGuide(stack *Stack) {Stack->push<guide*>(new multiguide(v)); return;} } -#line 777 "runtime.in" +#line 786 "runtime.in" void dashesGuide(stack *Stack) { guidearray * a=vm::pop<guidearray *>(Stack); -#line 778 "runtime.in" +#line 787 "runtime.in" static camp::curlSpec curly; static specguide curlout(&curly, camp::OUT); static specguide curlin(&curly, camp::IN); @@ -1167,179 +1180,179 @@ void dashesGuide(stack *Stack) {Stack->push<guide*>(new multiguide(v)); return;} } -#line 804 "runtime.in" +#line 813 "runtime.in" void newCycleToken(stack *Stack) { -#line 805 "runtime.in" +#line 814 "runtime.in" {Stack->push<cycleToken>(cycleToken()); return;} } -#line 809 "runtime.in" +#line 818 "runtime.in" // guide* operator cast(cycleToken tok); -void gen_runtime90(stack *Stack) +void gen_runtime91(stack *Stack) { cycleToken tok=vm::pop<cycleToken>(Stack); -#line 810 "runtime.in" +#line 819 "runtime.in" // Avoid unused variable warning messages. unused(&tok); {Stack->push<guide*>(new cycletokguide()); return;} } -#line 816 "runtime.in" +#line 825 "runtime.in" // guide* operator spec(pair z, Int p); -void gen_runtime91(stack *Stack) +void gen_runtime92(stack *Stack) { Int p=vm::pop<Int>(Stack); pair z=vm::pop<pair>(Stack); -#line 817 "runtime.in" +#line 826 "runtime.in" camp::side d=(camp::side) p; camp::dirSpec *sp=new camp::dirSpec(z); {Stack->push<guide*>(new specguide(sp,d)); return;} } -#line 824 "runtime.in" +#line 833 "runtime.in" // curlSpecifier operator curl(real gamma, Int p); -void gen_runtime92(stack *Stack) +void gen_runtime93(stack *Stack) { Int p=vm::pop<Int>(Stack); real gamma=vm::pop<real>(Stack); -#line 825 "runtime.in" +#line 834 "runtime.in" camp::side s=(camp::side) p; {Stack->push<curlSpecifier>(curlSpecifier(gamma,s)); return;} } -#line 830 "runtime.in" +#line 839 "runtime.in" void curlSpecifierValuePart(stack *Stack) { curlSpecifier spec=vm::pop<curlSpecifier>(Stack); -#line 831 "runtime.in" +#line 840 "runtime.in" {Stack->push<real>(spec.getValue()); return;} } -#line 835 "runtime.in" +#line 844 "runtime.in" void curlSpecifierSidePart(stack *Stack) { curlSpecifier spec=vm::pop<curlSpecifier>(Stack); -#line 836 "runtime.in" +#line 845 "runtime.in" {Stack->push<Int>(spec.getSide()); return;} } -#line 840 "runtime.in" +#line 849 "runtime.in" // guide* operator cast(curlSpecifier spec); -void gen_runtime95(stack *Stack) +void gen_runtime96(stack *Stack) { curlSpecifier spec=vm::pop<curlSpecifier>(Stack); -#line 841 "runtime.in" +#line 850 "runtime.in" {Stack->push<guide*>(new specguide(spec)); return;} } -#line 845 "runtime.in" +#line 854 "runtime.in" // tensionSpecifier operator tension(real tout, real tin, bool atleast); -void gen_runtime96(stack *Stack) +void gen_runtime97(stack *Stack) { bool atleast=vm::pop<bool>(Stack); real tin=vm::pop<real>(Stack); real tout=vm::pop<real>(Stack); -#line 846 "runtime.in" +#line 855 "runtime.in" {Stack->push<tensionSpecifier>(tensionSpecifier(tout, tin, atleast)); return;} } -#line 850 "runtime.in" +#line 859 "runtime.in" void tensionSpecifierOutPart(stack *Stack) { tensionSpecifier t=vm::pop<tensionSpecifier>(Stack); -#line 851 "runtime.in" +#line 860 "runtime.in" {Stack->push<real>(t.getOut()); return;} } -#line 855 "runtime.in" +#line 864 "runtime.in" void tensionSpecifierInPart(stack *Stack) { tensionSpecifier t=vm::pop<tensionSpecifier>(Stack); -#line 856 "runtime.in" +#line 865 "runtime.in" {Stack->push<real>(t.getIn()); return;} } -#line 860 "runtime.in" +#line 869 "runtime.in" void tensionSpecifierAtleastPart(stack *Stack) { tensionSpecifier t=vm::pop<tensionSpecifier>(Stack); -#line 861 "runtime.in" +#line 870 "runtime.in" {Stack->push<bool>(t.getAtleast()); return;} } -#line 865 "runtime.in" +#line 874 "runtime.in" // guide* operator cast(tensionSpecifier t); -void gen_runtime100(stack *Stack) +void gen_runtime101(stack *Stack) { tensionSpecifier t=vm::pop<tensionSpecifier>(Stack); -#line 866 "runtime.in" +#line 875 "runtime.in" {Stack->push<guide*>(new tensionguide(t)); return;} } -#line 870 "runtime.in" +#line 879 "runtime.in" // guide* operator controls(pair zout, pair zin); -void gen_runtime101(stack *Stack) +void gen_runtime102(stack *Stack) { pair zin=vm::pop<pair>(Stack); pair zout=vm::pop<pair>(Stack); -#line 871 "runtime.in" +#line 880 "runtime.in" {Stack->push<guide*>(new controlguide(zout, zin)); return;} } -#line 875 "runtime.in" +#line 884 "runtime.in" // Int size(guide *g); -void gen_runtime102(stack *Stack) +void gen_runtime103(stack *Stack) { guide * g=vm::pop<guide *>(Stack); -#line 876 "runtime.in" +#line 885 "runtime.in" flatguide f; g->flatten(f,false); {Stack->push<Int>(f.size()); return;} } -#line 882 "runtime.in" +#line 891 "runtime.in" // Int length(guide *g); -void gen_runtime103(stack *Stack) +void gen_runtime104(stack *Stack) { guide * g=vm::pop<guide *>(Stack); -#line 883 "runtime.in" +#line 892 "runtime.in" flatguide f; g->flatten(f,false); {Stack->push<Int>(g->cyclic() ? f.size() : f.size()-1); return;} } -#line 889 "runtime.in" +#line 898 "runtime.in" // bool cyclic(guide *g); -void gen_runtime104(stack *Stack) +void gen_runtime105(stack *Stack) { guide * g=vm::pop<guide *>(Stack); -#line 890 "runtime.in" +#line 899 "runtime.in" flatguide f; g->flatten(f,false); {Stack->push<bool>(g->cyclic()); return;} } -#line 896 "runtime.in" +#line 905 "runtime.in" // pair point(guide *g, Int t); -void gen_runtime105(stack *Stack) +void gen_runtime106(stack *Stack) { Int t=vm::pop<Int>(Stack); guide * g=vm::pop<guide *>(Stack); -#line 897 "runtime.in" +#line 906 "runtime.in" flatguide f; g->flatten(f,false); {Stack->push<pair>(f.Nodes(adjustedIndex(t,f.size(),g->cyclic())).z); return;} } -#line 903 "runtime.in" +#line 912 "runtime.in" // pairarray* dirSpecifier(guide *g, Int t); -void gen_runtime106(stack *Stack) +void gen_runtime107(stack *Stack) { Int t=vm::pop<Int>(Stack); guide * g=vm::pop<guide *>(Stack); -#line 904 "runtime.in" +#line 913 "runtime.in" flatguide f; g->flatten(f,false); Int n=f.size(); @@ -1350,13 +1363,13 @@ void gen_runtime106(stack *Stack) {Stack->push<pairarray*>(c); return;} } -#line 915 "runtime.in" +#line 924 "runtime.in" // pairarray* controlSpecifier(guide *g, Int t); -void gen_runtime107(stack *Stack) +void gen_runtime108(stack *Stack) { Int t=vm::pop<Int>(Stack); guide * g=vm::pop<guide *>(Stack); -#line 916 "runtime.in" +#line 925 "runtime.in" flatguide f; g->flatten(f,false); Int n=f.size(); @@ -1372,13 +1385,13 @@ void gen_runtime107(stack *Stack) } else {Stack->push<pairarray*>(new array(0)); return;} } -#line 932 "runtime.in" +#line 941 "runtime.in" // tensionSpecifier tensionSpecifier(guide *g, Int t); -void gen_runtime108(stack *Stack) +void gen_runtime109(stack *Stack) { Int t=vm::pop<Int>(Stack); guide * g=vm::pop<guide *>(Stack); -#line 933 "runtime.in" +#line 942 "runtime.in" flatguide f; g->flatten(f,false); Int n=f.size(); @@ -1387,13 +1400,13 @@ void gen_runtime108(stack *Stack) {Stack->push<tensionSpecifier>(tensionSpecifier(curr.tout.val,f.Nodes(t+1).tin.val,curr.tout.atleast)); return;} } -#line 942 "runtime.in" +#line 951 "runtime.in" // realarray* curlSpecifier(guide *g, Int t); -void gen_runtime109(stack *Stack) +void gen_runtime110(stack *Stack) { Int t=vm::pop<Int>(Stack); guide * g=vm::pop<guide *>(Stack); -#line 943 "runtime.in" +#line 952 "runtime.in" flatguide f; g->flatten(f,false); Int n=f.size(); @@ -1406,12 +1419,12 @@ void gen_runtime109(stack *Stack) {Stack->push<realarray*>(c); return;} } -#line 956 "runtime.in" +#line 965 "runtime.in" // guide* reverse(guide *g); -void gen_runtime110(stack *Stack) +void gen_runtime111(stack *Stack) { guide * g=vm::pop<guide *>(Stack); -#line 957 "runtime.in" +#line 966 "runtime.in" flatguide f; g->flatten(f,false); if(f.precyclic()) @@ -1420,55 +1433,53 @@ void gen_runtime110(stack *Stack) size_t n=f.size(); bool cyclic=g->cyclic(); guidevector v; - if(n >= 0) { - size_t start=cyclic ? n : n-1; - knot curr=f.Nodes(start); - knot next; - for(size_t i=start; i > 0; --i) { - next=f.Nodes(i-1); - v.push_back(new pairguide(curr.z)); - if(next.out->controlled()) { - assert(curr.in->controlled()); - v.push_back(new controlguide(curr.in->control(),next.out->control())); - } else { - pair d=curr.in->dir(); - if(d != zero) - v.push_back(new specguide(new dirSpec(-d),camp::OUT)); - else { - real C=curr.in->curl(); - if(C >= 0.0) - v.push_back(new specguide(new curlSpec(C),camp::OUT)); - } - real tout=curr.tin.val; - real tin=next.tout.val; - bool atleast=next.tout.atleast; - if(tout != 1.0 || tin != 1.0 || next.tout.atleast) - v.push_back(new tensionguide(tensionSpecifier(tout,tin,atleast))); - d=next.out->dir(); - if(d != zero) - v.push_back(new specguide(new dirSpec(-d),camp::IN)); - else { - real C=next.out->curl(); - if(C >= 0.0) - v.push_back(new specguide(new curlSpec(C),camp::IN)); - } + size_t start=cyclic ? n : n-1; + knot curr=f.Nodes(start); + knot next; + for(size_t i=start; i > 0; --i) { + next=f.Nodes(i-1); + v.push_back(new pairguide(curr.z)); + if(next.out->controlled()) { + assert(curr.in->controlled()); + v.push_back(new controlguide(curr.in->control(),next.out->control())); + } else { + pair d=curr.in->dir(); + if(d != zero) + v.push_back(new specguide(new dirSpec(-d),camp::OUT)); + else { + real C=curr.in->curl(); + if(C >= 0.0) + v.push_back(new specguide(new curlSpec(C),camp::OUT)); + } + real tout=curr.tin.val; + real tin=next.tout.val; + bool atleast=next.tout.atleast; + if(tout != 1.0 || tin != 1.0 || next.tout.atleast) + v.push_back(new tensionguide(tensionSpecifier(tout,tin,atleast))); + d=next.out->dir(); + if(d != zero) + v.push_back(new specguide(new dirSpec(-d),camp::IN)); + else { + real C=next.out->curl(); + if(C >= 0.0) + v.push_back(new specguide(new curlSpec(C),camp::IN)); } - curr=next; } - if(cyclic) - v.push_back(new cycletokguide()); - else - v.push_back(new pairguide(next.z)); - + curr=next; } + if(cyclic) + v.push_back(new cycletokguide()); + else + v.push_back(new pairguide(next.z)); + {Stack->push<guide*>(new multiguide(v)); return;} } -#line 1011 "runtime.in" +#line 1018 "runtime.in" // realarray* _cputime(); -void gen_runtime111(stack *Stack) +void gen_runtime112(stack *Stack) { -#line 1012 "runtime.in" +#line 1019 "runtime.in" static const real ticktime=1.0/sysconf(_SC_CLK_TCK); struct tms buf; @@ -1483,103 +1494,103 @@ void gen_runtime111(stack *Stack) // Transforms -#line 1027 "runtime.in" +#line 1034 "runtime.in" // bool ==(transform a, transform b); -void gen_runtime112(stack *Stack) +void gen_runtime113(stack *Stack) { transform b=vm::pop<transform>(Stack); transform a=vm::pop<transform>(Stack); -#line 1028 "runtime.in" +#line 1035 "runtime.in" {Stack->push<bool>(a == b); return;} } -#line 1033 "runtime.in" +#line 1040 "runtime.in" // bool !=(transform a, transform b); -void gen_runtime113(stack *Stack) +void gen_runtime114(stack *Stack) { transform b=vm::pop<transform>(Stack); transform a=vm::pop<transform>(Stack); -#line 1034 "runtime.in" +#line 1041 "runtime.in" {Stack->push<bool>(a != b); return;} } -#line 1038 "runtime.in" +#line 1045 "runtime.in" // transform +(transform a, transform b); -void gen_runtime114(stack *Stack) +void gen_runtime115(stack *Stack) { transform b=vm::pop<transform>(Stack); transform a=vm::pop<transform>(Stack); -#line 1039 "runtime.in" +#line 1046 "runtime.in" {Stack->push<transform>(a+b); return;} } -#line 1043 "runtime.in" +#line 1050 "runtime.in" // transform *(transform a, transform b); -void gen_runtime115(stack *Stack) +void gen_runtime116(stack *Stack) { transform b=vm::pop<transform>(Stack); transform a=vm::pop<transform>(Stack); -#line 1044 "runtime.in" +#line 1051 "runtime.in" {Stack->push<transform>(a*b); return;} } -#line 1048 "runtime.in" +#line 1055 "runtime.in" // pair *(transform t, pair z); -void gen_runtime116(stack *Stack) +void gen_runtime117(stack *Stack) { pair z=vm::pop<pair>(Stack); transform t=vm::pop<transform>(Stack); -#line 1049 "runtime.in" +#line 1056 "runtime.in" {Stack->push<pair>(t*z); return;} } -#line 1053 "runtime.in" +#line 1060 "runtime.in" // path *(transform t, path g); -void gen_runtime117(stack *Stack) +void gen_runtime118(stack *Stack) { path g=vm::pop<path>(Stack); transform t=vm::pop<transform>(Stack); -#line 1054 "runtime.in" +#line 1061 "runtime.in" {Stack->push<path>(transformed(t,g)); return;} } -#line 1058 "runtime.in" +#line 1065 "runtime.in" // pen *(transform t, pen p); -void gen_runtime118(stack *Stack) +void gen_runtime119(stack *Stack) { pen p=vm::pop<pen>(Stack); transform t=vm::pop<transform>(Stack); -#line 1059 "runtime.in" +#line 1066 "runtime.in" {Stack->push<pen>(transformed(t,p)); return;} } -#line 1063 "runtime.in" +#line 1070 "runtime.in" // picture* *(transform t, picture *f); -void gen_runtime119(stack *Stack) +void gen_runtime120(stack *Stack) { picture * f=vm::pop<picture *>(Stack); transform t=vm::pop<transform>(Stack); -#line 1064 "runtime.in" +#line 1071 "runtime.in" {Stack->push<picture*>(transformed(t,f)); return;} } -#line 1068 "runtime.in" +#line 1075 "runtime.in" // picture* *(realarray2 *t, picture *f); -void gen_runtime120(stack *Stack) +void gen_runtime121(stack *Stack) { picture * f=vm::pop<picture *>(Stack); realarray2 * t=vm::pop<realarray2 *>(Stack); -#line 1069 "runtime.in" +#line 1076 "runtime.in" {Stack->push<picture*>(transformed(*t,f)); return;} } -#line 1073 "runtime.in" +#line 1080 "runtime.in" // transform ^(transform t, Int n); -void gen_runtime121(stack *Stack) +void gen_runtime122(stack *Stack) { Int n=vm::pop<Int>(Stack); transform t=vm::pop<transform>(Stack); -#line 1074 "runtime.in" +#line 1081 "runtime.in" transform T; if(n < 0) { n=-n; @@ -1589,55 +1600,55 @@ void gen_runtime121(stack *Stack) {Stack->push<transform>(T); return;} } -#line 1084 "runtime.in" +#line 1091 "runtime.in" void transformXPart(stack *Stack) { transform t=vm::pop<transform>(Stack); -#line 1085 "runtime.in" +#line 1092 "runtime.in" {Stack->push<real>(t.getx()); return;} } -#line 1089 "runtime.in" +#line 1096 "runtime.in" void transformYPart(stack *Stack) { transform t=vm::pop<transform>(Stack); -#line 1090 "runtime.in" +#line 1097 "runtime.in" {Stack->push<real>(t.gety()); return;} } -#line 1094 "runtime.in" +#line 1101 "runtime.in" void transformXXPart(stack *Stack) { transform t=vm::pop<transform>(Stack); -#line 1095 "runtime.in" +#line 1102 "runtime.in" {Stack->push<real>(t.getxx()); return;} } -#line 1099 "runtime.in" +#line 1106 "runtime.in" void transformXYPart(stack *Stack) { transform t=vm::pop<transform>(Stack); -#line 1100 "runtime.in" +#line 1107 "runtime.in" {Stack->push<real>(t.getxy()); return;} } -#line 1104 "runtime.in" +#line 1111 "runtime.in" void transformYXPart(stack *Stack) { transform t=vm::pop<transform>(Stack); -#line 1105 "runtime.in" +#line 1112 "runtime.in" {Stack->push<real>(t.getyx()); return;} } -#line 1109 "runtime.in" +#line 1116 "runtime.in" void transformYYPart(stack *Stack) { transform t=vm::pop<transform>(Stack); -#line 1110 "runtime.in" +#line 1117 "runtime.in" {Stack->push<real>(t.getyy()); return;} } -#line 1114 "runtime.in" +#line 1121 "runtime.in" void real6ToTransform(stack *Stack) { real yy=vm::pop<real>(Stack); @@ -1646,127 +1657,127 @@ void real6ToTransform(stack *Stack) real xx=vm::pop<real>(Stack); real y=vm::pop<real>(Stack); real x=vm::pop<real>(Stack); -#line 1116 "runtime.in" +#line 1123 "runtime.in" {Stack->push<transform>(transform(x,y,xx,xy,yx,yy)); return;} } -#line 1120 "runtime.in" +#line 1127 "runtime.in" // transform shift(transform t); -void gen_runtime129(stack *Stack) +void gen_runtime130(stack *Stack) { transform t=vm::pop<transform>(Stack); -#line 1121 "runtime.in" +#line 1128 "runtime.in" {Stack->push<transform>(transform(t.getx(),t.gety(),0,0,0,0)); return;} } -#line 1125 "runtime.in" +#line 1132 "runtime.in" // transform shiftless(transform t); -void gen_runtime130(stack *Stack) +void gen_runtime131(stack *Stack) { transform t=vm::pop<transform>(Stack); -#line 1126 "runtime.in" +#line 1133 "runtime.in" {Stack->push<transform>(transform(0,0,t.getxx(),t.getxy(),t.getyx(),t.getyy())); return;} } -#line 1130 "runtime.in" +#line 1137 "runtime.in" // transform identity(); void transformIdentity(stack *Stack) { -#line 1131 "runtime.in" +#line 1138 "runtime.in" {Stack->push<transform>(identity); return;} } -#line 1135 "runtime.in" +#line 1142 "runtime.in" // transform inverse(transform t); -void gen_runtime132(stack *Stack) +void gen_runtime133(stack *Stack) { transform t=vm::pop<transform>(Stack); -#line 1136 "runtime.in" +#line 1143 "runtime.in" {Stack->push<transform>(inverse(t)); return;} } -#line 1140 "runtime.in" +#line 1147 "runtime.in" // transform shift(pair z); -void gen_runtime133(stack *Stack) +void gen_runtime134(stack *Stack) { pair z=vm::pop<pair>(Stack); -#line 1141 "runtime.in" +#line 1148 "runtime.in" {Stack->push<transform>(shift(z)); return;} } -#line 1145 "runtime.in" +#line 1152 "runtime.in" // transform shift(real x, real y); -void gen_runtime134(stack *Stack) +void gen_runtime135(stack *Stack) { real y=vm::pop<real>(Stack); real x=vm::pop<real>(Stack); -#line 1146 "runtime.in" +#line 1153 "runtime.in" {Stack->push<transform>(shift(pair(x,y))); return;} } -#line 1150 "runtime.in" +#line 1157 "runtime.in" // transform xscale(real x); -void gen_runtime135(stack *Stack) +void gen_runtime136(stack *Stack) { real x=vm::pop<real>(Stack); -#line 1151 "runtime.in" +#line 1158 "runtime.in" {Stack->push<transform>(xscale(x)); return;} } -#line 1155 "runtime.in" +#line 1162 "runtime.in" // transform yscale(real y); -void gen_runtime136(stack *Stack) +void gen_runtime137(stack *Stack) { real y=vm::pop<real>(Stack); -#line 1156 "runtime.in" +#line 1163 "runtime.in" {Stack->push<transform>(yscale(y)); return;} } -#line 1160 "runtime.in" +#line 1167 "runtime.in" // transform scale(real x); -void gen_runtime137(stack *Stack) +void gen_runtime138(stack *Stack) { real x=vm::pop<real>(Stack); -#line 1161 "runtime.in" +#line 1168 "runtime.in" {Stack->push<transform>(scale(x)); return;} } -#line 1165 "runtime.in" +#line 1172 "runtime.in" // transform scale(real x, real y); -void gen_runtime138(stack *Stack) +void gen_runtime139(stack *Stack) { real y=vm::pop<real>(Stack); real x=vm::pop<real>(Stack); -#line 1166 "runtime.in" +#line 1173 "runtime.in" {Stack->push<transform>(scale(x,y)); return;} } -#line 1170 "runtime.in" +#line 1177 "runtime.in" // transform slant(real s); -void gen_runtime139(stack *Stack) +void gen_runtime140(stack *Stack) { real s=vm::pop<real>(Stack); -#line 1171 "runtime.in" +#line 1178 "runtime.in" {Stack->push<transform>(slant(s)); return;} } -#line 1175 "runtime.in" +#line 1182 "runtime.in" // transform rotate(real angle, pair z=0); -void gen_runtime140(stack *Stack) +void gen_runtime141(stack *Stack) { pair z=vm::pop<pair>(Stack,0); real angle=vm::pop<real>(Stack); -#line 1176 "runtime.in" +#line 1183 "runtime.in" {Stack->push<transform>(rotatearound(z,radians(angle))); return;} } -#line 1180 "runtime.in" +#line 1187 "runtime.in" // transform reflect(pair a, pair b); -void gen_runtime141(stack *Stack) +void gen_runtime142(stack *Stack) { pair b=vm::pop<pair>(Stack); pair a=vm::pop<pair>(Stack); -#line 1181 "runtime.in" +#line 1188 "runtime.in" {Stack->push<transform>(reflectabout(a,b)); return;} } @@ -1776,290 +1787,292 @@ namespace trans { void gen_runtime_venv(venv &ve) { -#line 218 "runtime.in" +#line 222 "runtime.in" REGISTER_BLTIN(run::IntZero,"IntZero"); -#line 226 "runtime.in" +#line 230 "runtime.in" REGISTER_BLTIN(run::realZero,"realZero"); -#line 231 "runtime.in" +#line 235 "runtime.in" REGISTER_BLTIN(run::boolFalse,"boolFalse"); -#line 236 "runtime.in" +#line 240 "runtime.in" + addFunc(ve, run::gen_runtime3, primBoolean(), SYM(isnan), formal(primReal(), SYM(x), false, false)); +#line 245 "runtime.in" REGISTER_BLTIN(run::pushNullArray,"pushNullArray"); -#line 241 "runtime.in" +#line 250 "runtime.in" REGISTER_BLTIN(run::pushNullRecord,"pushNullRecord"); -#line 246 "runtime.in" +#line 255 "runtime.in" REGISTER_BLTIN(run::pushNullFunction,"pushNullFunction"); -#line 251 "runtime.in" +#line 260 "runtime.in" REGISTER_BLTIN(run::pushDefault,"pushDefault"); -#line 261 "runtime.in" +#line 270 "runtime.in" REGISTER_BLTIN(run::isDefault,"isDefault"); -#line 268 "runtime.in" +#line 277 "runtime.in" REGISTER_BLTIN(run::pairToGuide,"pairToGuide"); -#line 276 "runtime.in" +#line 285 "runtime.in" REGISTER_BLTIN(run::pathToGuide,"pathToGuide"); -#line 281 "runtime.in" +#line 290 "runtime.in" REGISTER_BLTIN(run::guideToPath,"guideToPath"); -#line 286 "runtime.in" +#line 295 "runtime.in" REGISTER_BLTIN(run::newPen,"newPen"); -#line 294 "runtime.in" - addFunc(ve, run::gen_runtime12, primBoolean(), SYM_EQ, formal(primPen(), SYM(a), false, false), formal(primPen(), SYM(b), false, false)); -#line 299 "runtime.in" - addFunc(ve, run::gen_runtime13, primBoolean(), SYM_NEQ, formal(primPen(), SYM(a), false, false), formal(primPen(), SYM(b), false, false)); -#line 304 "runtime.in" - addFunc(ve, run::gen_runtime14, primPen(), SYM_PLUS, formal(primPen(), SYM(a), false, false), formal(primPen(), SYM(b), false, false)); -#line 309 "runtime.in" - addFunc(ve, run::gen_runtime15, primPen(), SYM_TIMES, formal(primReal(), SYM(a), false, false), formal(primPen(), SYM(b), false, false)); -#line 314 "runtime.in" - addFunc(ve, run::gen_runtime16, primPen(), SYM_TIMES, formal(primPen(), SYM(a), false, false), formal(primReal(), SYM(b), false, false)); -#line 319 "runtime.in" - addFunc(ve, run::gen_runtime17, primPair(), SYM(max), formal(primPen(), SYM(p), false, false)); -#line 324 "runtime.in" - addFunc(ve, run::gen_runtime18, primPair(), SYM(min), formal(primPen(), SYM(p), false, false)); -#line 329 "runtime.in" - addFunc(ve, run::gen_runtime19, primVoid(), SYM(resetdefaultpen)); -#line 335 "runtime.in" - addFunc(ve, run::gen_runtime20, primVoid(), SYM(defaultpen), formal(primPen(), SYM(p), false, false)); -#line 340 "runtime.in" - addFunc(ve, run::gen_runtime21, primPen(), SYM(defaultpen)); -#line 345 "runtime.in" - addFunc(ve, run::gen_runtime22, primBoolean(), SYM(invisible), formal(primPen(), SYM(p), false, false)); -#line 350 "runtime.in" - addFunc(ve, run::gen_runtime23, primPen(), SYM(invisible)); -#line 355 "runtime.in" - addFunc(ve, run::gen_runtime24, primPen(), SYM(gray), formal(primPen(), SYM(p), false, false)); -#line 361 "runtime.in" - addFunc(ve, run::gen_runtime25, primPen(), SYM(rgb), formal(primPen(), SYM(p), false, false)); -#line 367 "runtime.in" - addFunc(ve, run::gen_runtime26, primPen(), SYM(cmyk), formal(primPen(), SYM(p), false, false)); -#line 373 "runtime.in" - addFunc(ve, run::gen_runtime27, primPen(), SYM(interp), formal(primPen(), SYM(a), false, false), formal(primPen(), SYM(b), false, false), formal(primReal(), SYM(t), false, false)); -#line 378 "runtime.in" - addFunc(ve, run::gen_runtime28, primPen(), SYM(rgb), formal(primReal(), SYM(r), false, false), formal(primReal(), SYM(g), false, false), formal(primReal(), SYM(b), false, false)); -#line 383 "runtime.in" - addFunc(ve, run::gen_runtime29, primPen(), SYM(cmyk), formal(primReal(), SYM(c), false, false), formal(primReal(), SYM(m), false, false), formal(primReal(), SYM(y), false, false), formal(primReal(), SYM(k), false, false)); -#line 388 "runtime.in" - addFunc(ve, run::gen_runtime30, primPen(), SYM(gray), formal(primReal(), SYM(gray), false, false)); -#line 393 "runtime.in" - addFunc(ve, run::gen_runtime31, realArray(), SYM(colors), formal(primPen(), SYM(p), false, false)); -#line 421 "runtime.in" - addFunc(ve, run::gen_runtime32, primString() , SYM(hex), formal(primPen(), SYM(p), false, false)); -#line 426 "runtime.in" - addFunc(ve, run::gen_runtime33, primInt(), SYM(byte), formal(primReal(), SYM(x), false, false)); -#line 431 "runtime.in" - addFunc(ve, run::gen_runtime34, primString() , SYM(colorspace), formal(primPen(), SYM(p), false, false)); -#line 438 "runtime.in" - addFunc(ve, run::gen_runtime35, primPen(), SYM(pattern), formal(primString(), SYM(s), false, false)); -#line 443 "runtime.in" - addFunc(ve, run::gen_runtime36, primString() , SYM(pattern), formal(primPen(), SYM(p), false, false)); -#line 448 "runtime.in" - addFunc(ve, run::gen_runtime37, primPen(), SYM(fillrule), formal(primInt(), SYM(n), false, false)); -#line 453 "runtime.in" - addFunc(ve, run::gen_runtime38, primInt(), SYM(fillrule), formal(primPen(), SYM(p), false, false)); -#line 458 "runtime.in" - addFunc(ve, run::gen_runtime39, primPen(), SYM(opacity), formal(primReal(), SYM(opacity), true, false), formal(primString() , SYM(blend), true, false)); -#line 468 "runtime.in" - addFunc(ve, run::gen_runtime40, primReal(), SYM(opacity), formal(primPen(), SYM(p), false, false)); -#line 473 "runtime.in" - addFunc(ve, run::gen_runtime41, primString() , SYM(blend), formal(primPen(), SYM(p), false, false)); -#line 478 "runtime.in" - addFunc(ve, run::gen_runtime42, primPen(), SYM(linetype), formal(realArray(), SYM(pattern), false, false), formal(primReal(), SYM(offset), true, false), formal(primBoolean(), SYM(scale), true, false), formal(primBoolean(), SYM(adjust), true, false)); -#line 489 "runtime.in" - addFunc(ve, run::gen_runtime43, realArray(), SYM(linetype), formal(primPen(), SYM(p), true, false)); -#line 495 "runtime.in" - addFunc(ve, run::gen_runtime44, primReal(), SYM(offset), formal(primPen(), SYM(p), false, false)); -#line 500 "runtime.in" - addFunc(ve, run::gen_runtime45, primBoolean(), SYM(scale), formal(primPen(), SYM(p), false, false)); -#line 505 "runtime.in" - addFunc(ve, run::gen_runtime46, primBoolean(), SYM(adjust), formal(primPen(), SYM(p), false, false)); -#line 510 "runtime.in" - addFunc(ve, run::gen_runtime47, primPen(), SYM(adjust), formal(primPen(), SYM(p), false, false), formal(primReal(), SYM(arclength), false, false), formal(primBoolean(), SYM(cyclic), false, false)); -#line 515 "runtime.in" - addFunc(ve, run::gen_runtime48, primPen(), SYM(linecap), formal(primInt(), SYM(n), false, false)); -#line 520 "runtime.in" - addFunc(ve, run::gen_runtime49, primInt(), SYM(linecap), formal(primPen(), SYM(p), true, false)); -#line 525 "runtime.in" - addFunc(ve, run::gen_runtime50, primPen(), SYM(linejoin), formal(primInt(), SYM(n), false, false)); -#line 530 "runtime.in" - addFunc(ve, run::gen_runtime51, primInt(), SYM(linejoin), formal(primPen(), SYM(p), true, false)); -#line 535 "runtime.in" - addFunc(ve, run::gen_runtime52, primPen(), SYM(miterlimit), formal(primReal(), SYM(x), false, false)); -#line 540 "runtime.in" - addFunc(ve, run::gen_runtime53, primReal(), SYM(miterlimit), formal(primPen(), SYM(p), true, false)); -#line 545 "runtime.in" - addFunc(ve, run::gen_runtime54, primPen(), SYM(linewidth), formal(primReal(), SYM(x), false, false)); -#line 550 "runtime.in" - addFunc(ve, run::gen_runtime55, primReal(), SYM(linewidth), formal(primPen(), SYM(p), true, false)); -#line 555 "runtime.in" - addFunc(ve, run::gen_runtime56, primPen(), SYM(fontcommand), formal(primString(), SYM(s), false, false)); -#line 560 "runtime.in" - addFunc(ve, run::gen_runtime57, primString() , SYM(font), formal(primPen(), SYM(p), true, false)); -#line 565 "runtime.in" - addFunc(ve, run::gen_runtime58, primPen(), SYM(fontsize), formal(primReal(), SYM(size), false, false), formal(primReal(), SYM(lineskip), false, false)); -#line 571 "runtime.in" - addFunc(ve, run::gen_runtime59, primReal(), SYM(fontsize), formal(primPen(), SYM(p), true, false)); -#line 576 "runtime.in" - addFunc(ve, run::gen_runtime60, primReal(), SYM(lineskip), formal(primPen(), SYM(p), true, false)); -#line 581 "runtime.in" - addFunc(ve, run::gen_runtime61, primPen(), SYM(overwrite), formal(primInt(), SYM(n), false, false)); -#line 587 "runtime.in" - addFunc(ve, run::gen_runtime62, primInt(), SYM(overwrite), formal(primPen(), SYM(p), true, false)); -#line 592 "runtime.in" - addFunc(ve, run::gen_runtime63, primPen(), SYM(basealign), formal(primInt(), SYM(n), false, false)); -#line 597 "runtime.in" - addFunc(ve, run::gen_runtime64, primInt(), SYM(basealign), formal(primPen(), SYM(p), true, false)); -#line 602 "runtime.in" - addFunc(ve, run::gen_runtime65, primTransform(), SYM(transform), formal(primPen(), SYM(p), false, false)); -#line 607 "runtime.in" - addFunc(ve, run::gen_runtime66, primPath(), SYM(nib), formal(primPen(), SYM(p), false, false)); -#line 612 "runtime.in" - addFunc(ve, run::gen_runtime67, primPen(), SYM(makepen), formal(primPath(), SYM(p), false, false)); -#line 617 "runtime.in" - addFunc(ve, run::gen_runtime68, primPen(), SYM(colorless), formal(primPen(), SYM(p), false, false)); -#line 623 "runtime.in" - addFunc(ve, run::gen_runtime69, primBoolean(), SYM(interactive)); -#line 630 "runtime.in" - addFunc(ve, run::gen_runtime70, primBoolean(), SYM(uptodate)); -#line 635 "runtime.in" - addFunc(ve, run::gen_runtime71, primInt(), SYM(system), formal(stringArray(), SYM(s), false, false)); -#line 649 "runtime.in" - addFunc(ve, run::gen_runtime72, primBoolean(), SYM(view)); -#line 654 "runtime.in" - addFunc(ve, run::gen_runtime73, primString() , SYM(asydir)); -#line 659 "runtime.in" - addFunc(ve, run::gen_runtime74, primString() , SYM(locale), formal(primString() , SYM(s), true, false)); -#line 665 "runtime.in" - addFunc(ve, run::gen_runtime75, primVoid(), SYM(abort), formal(primString() , SYM(s), true, false)); -#line 671 "runtime.in" - addFunc(ve, run::gen_runtime76, primVoid(), SYM(exit)); -#line 676 "runtime.in" - addFunc(ve, run::gen_runtime77, primVoid(), SYM(assert), formal(primBoolean(), SYM(b), false, false), formal(primString() , SYM(s), true, false)); -#line 687 "runtime.in" - addFunc(ve, run::gen_runtime78, primVoid(), SYM(sleep), formal(primInt(), SYM(seconds), false, false)); -#line 693 "runtime.in" - addFunc(ve, run::gen_runtime79, primVoid(), SYM(usleep), formal(primInt(), SYM(microseconds), false, false)); -#line 699 "runtime.in" - addFunc(ve, run::gen_runtime80, primVoid(), SYM(_eval), formal(primString(), SYM(s), false, false), formal(primBoolean(), SYM(embedded), false, false), formal(primBoolean(), SYM(interactivewrite), true, false)); -#line 712 "runtime.in" - addFunc(ve, run::gen_runtime81, primVoid(), SYM(_eval), formal(primCode(), SYM(s), false, false), formal(primBoolean(), SYM(embedded), false, false)); -#line 728 "runtime.in" - addFunc(ve, run::gen_runtime82, primString() , SYM(location)); -#line 734 "runtime.in" +#line 303 "runtime.in" + addFunc(ve, run::gen_runtime13, primBoolean(), SYM_EQ, formal(primPen(), SYM(a), false, false), formal(primPen(), SYM(b), false, false)); +#line 308 "runtime.in" + addFunc(ve, run::gen_runtime14, primBoolean(), SYM_NEQ, formal(primPen(), SYM(a), false, false), formal(primPen(), SYM(b), false, false)); +#line 313 "runtime.in" + addFunc(ve, run::gen_runtime15, primPen(), SYM_PLUS, formal(primPen(), SYM(a), false, false), formal(primPen(), SYM(b), false, false)); +#line 318 "runtime.in" + addFunc(ve, run::gen_runtime16, primPen(), SYM_TIMES, formal(primReal(), SYM(a), false, false), formal(primPen(), SYM(b), false, false)); +#line 323 "runtime.in" + addFunc(ve, run::gen_runtime17, primPen(), SYM_TIMES, formal(primPen(), SYM(a), false, false), formal(primReal(), SYM(b), false, false)); +#line 328 "runtime.in" + addFunc(ve, run::gen_runtime18, primPair(), SYM(max), formal(primPen(), SYM(p), false, false)); +#line 333 "runtime.in" + addFunc(ve, run::gen_runtime19, primPair(), SYM(min), formal(primPen(), SYM(p), false, false)); +#line 338 "runtime.in" + addFunc(ve, run::gen_runtime20, primVoid(), SYM(resetdefaultpen)); +#line 344 "runtime.in" + addFunc(ve, run::gen_runtime21, primVoid(), SYM(defaultpen), formal(primPen(), SYM(p), false, false)); +#line 349 "runtime.in" + addFunc(ve, run::gen_runtime22, primPen(), SYM(defaultpen)); +#line 354 "runtime.in" + addFunc(ve, run::gen_runtime23, primBoolean(), SYM(invisible), formal(primPen(), SYM(p), false, false)); +#line 359 "runtime.in" + addFunc(ve, run::gen_runtime24, primPen(), SYM(invisible)); +#line 364 "runtime.in" + addFunc(ve, run::gen_runtime25, primPen(), SYM(gray), formal(primPen(), SYM(p), false, false)); +#line 370 "runtime.in" + addFunc(ve, run::gen_runtime26, primPen(), SYM(rgb), formal(primPen(), SYM(p), false, false)); +#line 376 "runtime.in" + addFunc(ve, run::gen_runtime27, primPen(), SYM(cmyk), formal(primPen(), SYM(p), false, false)); +#line 382 "runtime.in" + addFunc(ve, run::gen_runtime28, primPen(), SYM(interp), formal(primPen(), SYM(a), false, false), formal(primPen(), SYM(b), false, false), formal(primReal(), SYM(t), false, false)); +#line 387 "runtime.in" + addFunc(ve, run::gen_runtime29, primPen(), SYM(rgb), formal(primReal(), SYM(r), false, false), formal(primReal(), SYM(g), false, false), formal(primReal(), SYM(b), false, false)); +#line 392 "runtime.in" + addFunc(ve, run::gen_runtime30, primPen(), SYM(cmyk), formal(primReal(), SYM(c), false, false), formal(primReal(), SYM(m), false, false), formal(primReal(), SYM(y), false, false), formal(primReal(), SYM(k), false, false)); +#line 397 "runtime.in" + addFunc(ve, run::gen_runtime31, primPen(), SYM(gray), formal(primReal(), SYM(gray), false, false)); +#line 402 "runtime.in" + addFunc(ve, run::gen_runtime32, realArray(), SYM(colors), formal(primPen(), SYM(p), false, false)); +#line 430 "runtime.in" + addFunc(ve, run::gen_runtime33, primString() , SYM(hex), formal(primPen(), SYM(p), false, false)); +#line 435 "runtime.in" + addFunc(ve, run::gen_runtime34, primInt(), SYM(byte), formal(primReal(), SYM(x), false, false)); +#line 440 "runtime.in" + addFunc(ve, run::gen_runtime35, primString() , SYM(colorspace), formal(primPen(), SYM(p), false, false)); +#line 447 "runtime.in" + addFunc(ve, run::gen_runtime36, primPen(), SYM(pattern), formal(primString(), SYM(s), false, false)); +#line 452 "runtime.in" + addFunc(ve, run::gen_runtime37, primString() , SYM(pattern), formal(primPen(), SYM(p), false, false)); +#line 457 "runtime.in" + addFunc(ve, run::gen_runtime38, primPen(), SYM(fillrule), formal(primInt(), SYM(n), false, false)); +#line 462 "runtime.in" + addFunc(ve, run::gen_runtime39, primInt(), SYM(fillrule), formal(primPen(), SYM(p), false, false)); +#line 467 "runtime.in" + addFunc(ve, run::gen_runtime40, primPen(), SYM(opacity), formal(primReal(), SYM(opacity), true, false), formal(primString() , SYM(blend), true, false)); +#line 477 "runtime.in" + addFunc(ve, run::gen_runtime41, primReal(), SYM(opacity), formal(primPen(), SYM(p), false, false)); +#line 482 "runtime.in" + addFunc(ve, run::gen_runtime42, primString() , SYM(blend), formal(primPen(), SYM(p), false, false)); +#line 487 "runtime.in" + addFunc(ve, run::gen_runtime43, primPen(), SYM(linetype), formal(realArray(), SYM(pattern), false, false), formal(primReal(), SYM(offset), true, false), formal(primBoolean(), SYM(scale), true, false), formal(primBoolean(), SYM(adjust), true, false)); +#line 498 "runtime.in" + addFunc(ve, run::gen_runtime44, realArray(), SYM(linetype), formal(primPen(), SYM(p), true, false)); +#line 504 "runtime.in" + addFunc(ve, run::gen_runtime45, primReal(), SYM(offset), formal(primPen(), SYM(p), false, false)); +#line 509 "runtime.in" + addFunc(ve, run::gen_runtime46, primBoolean(), SYM(scale), formal(primPen(), SYM(p), false, false)); +#line 514 "runtime.in" + addFunc(ve, run::gen_runtime47, primBoolean(), SYM(adjust), formal(primPen(), SYM(p), false, false)); +#line 519 "runtime.in" + addFunc(ve, run::gen_runtime48, primPen(), SYM(adjust), formal(primPen(), SYM(p), false, false), formal(primReal(), SYM(arclength), false, false), formal(primBoolean(), SYM(cyclic), false, false)); +#line 524 "runtime.in" + addFunc(ve, run::gen_runtime49, primPen(), SYM(linecap), formal(primInt(), SYM(n), false, false)); +#line 529 "runtime.in" + addFunc(ve, run::gen_runtime50, primInt(), SYM(linecap), formal(primPen(), SYM(p), true, false)); +#line 534 "runtime.in" + addFunc(ve, run::gen_runtime51, primPen(), SYM(linejoin), formal(primInt(), SYM(n), false, false)); +#line 539 "runtime.in" + addFunc(ve, run::gen_runtime52, primInt(), SYM(linejoin), formal(primPen(), SYM(p), true, false)); +#line 544 "runtime.in" + addFunc(ve, run::gen_runtime53, primPen(), SYM(miterlimit), formal(primReal(), SYM(x), false, false)); +#line 549 "runtime.in" + addFunc(ve, run::gen_runtime54, primReal(), SYM(miterlimit), formal(primPen(), SYM(p), true, false)); +#line 554 "runtime.in" + addFunc(ve, run::gen_runtime55, primPen(), SYM(linewidth), formal(primReal(), SYM(x), false, false)); +#line 559 "runtime.in" + addFunc(ve, run::gen_runtime56, primReal(), SYM(linewidth), formal(primPen(), SYM(p), true, false)); +#line 564 "runtime.in" + addFunc(ve, run::gen_runtime57, primPen(), SYM(fontcommand), formal(primString(), SYM(s), false, false)); +#line 569 "runtime.in" + addFunc(ve, run::gen_runtime58, primString() , SYM(font), formal(primPen(), SYM(p), true, false)); +#line 574 "runtime.in" + addFunc(ve, run::gen_runtime59, primPen(), SYM(fontsize), formal(primReal(), SYM(size), false, false), formal(primReal(), SYM(lineskip), false, false)); +#line 580 "runtime.in" + addFunc(ve, run::gen_runtime60, primReal(), SYM(fontsize), formal(primPen(), SYM(p), true, false)); +#line 585 "runtime.in" + addFunc(ve, run::gen_runtime61, primReal(), SYM(lineskip), formal(primPen(), SYM(p), true, false)); +#line 590 "runtime.in" + addFunc(ve, run::gen_runtime62, primPen(), SYM(overwrite), formal(primInt(), SYM(n), false, false)); +#line 596 "runtime.in" + addFunc(ve, run::gen_runtime63, primInt(), SYM(overwrite), formal(primPen(), SYM(p), true, false)); +#line 601 "runtime.in" + addFunc(ve, run::gen_runtime64, primPen(), SYM(basealign), formal(primInt(), SYM(n), false, false)); +#line 606 "runtime.in" + addFunc(ve, run::gen_runtime65, primInt(), SYM(basealign), formal(primPen(), SYM(p), true, false)); +#line 611 "runtime.in" + addFunc(ve, run::gen_runtime66, primTransform(), SYM(transform), formal(primPen(), SYM(p), false, false)); +#line 616 "runtime.in" + addFunc(ve, run::gen_runtime67, primPath(), SYM(nib), formal(primPen(), SYM(p), false, false)); +#line 621 "runtime.in" + addFunc(ve, run::gen_runtime68, primPen(), SYM(makepen), formal(primPath(), SYM(p), false, false)); +#line 626 "runtime.in" + addFunc(ve, run::gen_runtime69, primPen(), SYM(colorless), formal(primPen(), SYM(p), false, false)); +#line 632 "runtime.in" + addFunc(ve, run::gen_runtime70, primBoolean(), SYM(interactive)); +#line 639 "runtime.in" + addFunc(ve, run::gen_runtime71, primBoolean(), SYM(uptodate)); +#line 644 "runtime.in" + addFunc(ve, run::gen_runtime72, primInt(), SYM(system), formal(stringArray(), SYM(s), false, false)); +#line 658 "runtime.in" + addFunc(ve, run::gen_runtime73, primBoolean(), SYM(view)); +#line 663 "runtime.in" + addFunc(ve, run::gen_runtime74, primString() , SYM(asydir)); +#line 668 "runtime.in" + addFunc(ve, run::gen_runtime75, primString() , SYM(locale), formal(primString() , SYM(s), true, false)); +#line 674 "runtime.in" + addFunc(ve, run::gen_runtime76, primVoid(), SYM(abort), formal(primString() , SYM(s), true, false)); +#line 680 "runtime.in" + addFunc(ve, run::gen_runtime77, primVoid(), SYM(exit)); +#line 685 "runtime.in" + addFunc(ve, run::gen_runtime78, primVoid(), SYM(assert), formal(primBoolean(), SYM(b), false, false), formal(primString() , SYM(s), true, false)); +#line 696 "runtime.in" + addFunc(ve, run::gen_runtime79, primVoid(), SYM(sleep), formal(primInt(), SYM(seconds), false, false)); +#line 702 "runtime.in" + addFunc(ve, run::gen_runtime80, primVoid(), SYM(usleep), formal(primInt(), SYM(microseconds), false, false)); +#line 708 "runtime.in" + addFunc(ve, run::gen_runtime81, primVoid(), SYM(_eval), formal(primString(), SYM(s), false, false), formal(primBoolean(), SYM(embedded), false, false), formal(primBoolean(), SYM(interactivewrite), true, false)); +#line 721 "runtime.in" + addFunc(ve, run::gen_runtime82, primVoid(), SYM(_eval), formal(primCode(), SYM(s), false, false), formal(primBoolean(), SYM(embedded), false, false)); +#line 737 "runtime.in" + addFunc(ve, run::gen_runtime83, primString() , SYM(location)); +#line 743 "runtime.in" REGISTER_BLTIN(run::loadModule,"loadModule"); -#line 740 "runtime.in" - addFunc(ve, run::gen_runtime84, primString() , SYM(cd), formal(primString() , SYM(s), true, false)); -#line 750 "runtime.in" - addFunc(ve, run::gen_runtime85, primVoid(), SYM(list), formal(primString(), SYM(s), false, false), formal(primBoolean(), SYM(imports), true, false)); +#line 749 "runtime.in" + addFunc(ve, run::gen_runtime85, primString() , SYM(cd), formal(primString() , SYM(s), true, false)); #line 759 "runtime.in" + addFunc(ve, run::gen_runtime86, primVoid(), SYM(list), formal(primString(), SYM(s), false, false), formal(primBoolean(), SYM(imports), true, false)); +#line 768 "runtime.in" REGISTER_BLTIN(run::nullGuide,"nullGuide"); -#line 767 "runtime.in" +#line 776 "runtime.in" REGISTER_BLTIN(run::dotsGuide,"dotsGuide"); -#line 777 "runtime.in" +#line 786 "runtime.in" REGISTER_BLTIN(run::dashesGuide,"dashesGuide"); -#line 804 "runtime.in" +#line 813 "runtime.in" REGISTER_BLTIN(run::newCycleToken,"newCycleToken"); -#line 809 "runtime.in" - addFunc(ve, run::gen_runtime90, primGuide(), symbol::trans("operator cast"), formal(primCycleToken(), SYM(tok), false, false)); -#line 816 "runtime.in" - addFunc(ve, run::gen_runtime91, primGuide(), symbol::trans("operator spec"), formal(primPair(), SYM(z), false, false), formal(primInt(), SYM(p), false, false)); -#line 824 "runtime.in" - addFunc(ve, run::gen_runtime92, primCurlSpecifier(), SYM_CURL, formal(primReal(), SYM(gamma), false, false), formal(primInt(), SYM(p), false, false)); -#line 830 "runtime.in" +#line 818 "runtime.in" + addFunc(ve, run::gen_runtime91, primGuide(), symbol::trans("operator cast"), formal(primCycleToken(), SYM(tok), false, false)); +#line 825 "runtime.in" + addFunc(ve, run::gen_runtime92, primGuide(), symbol::trans("operator spec"), formal(primPair(), SYM(z), false, false), formal(primInt(), SYM(p), false, false)); +#line 833 "runtime.in" + addFunc(ve, run::gen_runtime93, primCurlSpecifier(), SYM_CURL, formal(primReal(), SYM(gamma), false, false), formal(primInt(), SYM(p), false, false)); +#line 839 "runtime.in" REGISTER_BLTIN(run::curlSpecifierValuePart,"curlSpecifierValuePart"); -#line 835 "runtime.in" +#line 844 "runtime.in" REGISTER_BLTIN(run::curlSpecifierSidePart,"curlSpecifierSidePart"); -#line 840 "runtime.in" - addFunc(ve, run::gen_runtime95, primGuide(), symbol::trans("operator cast"), formal(primCurlSpecifier(), SYM(spec), false, false)); -#line 845 "runtime.in" - addFunc(ve, run::gen_runtime96, primTensionSpecifier(), SYM_TENSION, formal(primReal(), SYM(tout), false, false), formal(primReal(), SYM(tin), false, false), formal(primBoolean(), SYM(atleast), false, false)); -#line 850 "runtime.in" +#line 849 "runtime.in" + addFunc(ve, run::gen_runtime96, primGuide(), symbol::trans("operator cast"), formal(primCurlSpecifier(), SYM(spec), false, false)); +#line 854 "runtime.in" + addFunc(ve, run::gen_runtime97, primTensionSpecifier(), SYM_TENSION, formal(primReal(), SYM(tout), false, false), formal(primReal(), SYM(tin), false, false), formal(primBoolean(), SYM(atleast), false, false)); +#line 859 "runtime.in" REGISTER_BLTIN(run::tensionSpecifierOutPart,"tensionSpecifierOutPart"); -#line 855 "runtime.in" +#line 864 "runtime.in" REGISTER_BLTIN(run::tensionSpecifierInPart,"tensionSpecifierInPart"); -#line 860 "runtime.in" +#line 869 "runtime.in" REGISTER_BLTIN(run::tensionSpecifierAtleastPart,"tensionSpecifierAtleastPart"); -#line 865 "runtime.in" - addFunc(ve, run::gen_runtime100, primGuide(), symbol::trans("operator cast"), formal(primTensionSpecifier(), SYM(t), false, false)); -#line 870 "runtime.in" - addFunc(ve, run::gen_runtime101, primGuide(), SYM_CONTROLS, formal(primPair(), SYM(zout), false, false), formal(primPair(), SYM(zin), false, false)); -#line 875 "runtime.in" - addFunc(ve, run::gen_runtime102, primInt(), SYM(size), formal(primGuide(), SYM(g), false, false)); -#line 882 "runtime.in" - addFunc(ve, run::gen_runtime103, primInt(), SYM(length), formal(primGuide(), SYM(g), false, false)); -#line 889 "runtime.in" - addFunc(ve, run::gen_runtime104, primBoolean(), SYM(cyclic), formal(primGuide(), SYM(g), false, false)); -#line 896 "runtime.in" - addFunc(ve, run::gen_runtime105, primPair(), SYM(point), formal(primGuide(), SYM(g), false, false), formal(primInt(), SYM(t), false, false)); -#line 903 "runtime.in" - addFunc(ve, run::gen_runtime106, pairArray(), SYM(dirSpecifier), formal(primGuide(), SYM(g), false, false), formal(primInt(), SYM(t), false, false)); -#line 915 "runtime.in" - addFunc(ve, run::gen_runtime107, pairArray(), SYM(controlSpecifier), formal(primGuide(), SYM(g), false, false), formal(primInt(), SYM(t), false, false)); -#line 932 "runtime.in" - addFunc(ve, run::gen_runtime108, primTensionSpecifier(), SYM(tensionSpecifier), formal(primGuide(), SYM(g), false, false), formal(primInt(), SYM(t), false, false)); -#line 942 "runtime.in" - addFunc(ve, run::gen_runtime109, realArray(), SYM(curlSpecifier), formal(primGuide(), SYM(g), false, false), formal(primInt(), SYM(t), false, false)); -#line 956 "runtime.in" - addFunc(ve, run::gen_runtime110, primGuide(), SYM(reverse), formal(primGuide(), SYM(g), false, false)); -#line 1011 "runtime.in" - addFunc(ve, run::gen_runtime111, realArray(), SYM(_cputime)); -#line 1025 "runtime.in" - addFunc(ve, run::gen_runtime112, primBoolean(), SYM_EQ, formal(primTransform(), SYM(a), false, false), formal(primTransform(), SYM(b), false, false)); -#line 1033 "runtime.in" - addFunc(ve, run::gen_runtime113, primBoolean(), SYM_NEQ, formal(primTransform(), SYM(a), false, false), formal(primTransform(), SYM(b), false, false)); -#line 1038 "runtime.in" - addFunc(ve, run::gen_runtime114, primTransform(), SYM_PLUS, formal(primTransform(), SYM(a), false, false), formal(primTransform(), SYM(b), false, false)); -#line 1043 "runtime.in" - addFunc(ve, run::gen_runtime115, primTransform(), SYM_TIMES, formal(primTransform(), SYM(a), false, false), formal(primTransform(), SYM(b), false, false)); -#line 1048 "runtime.in" - addFunc(ve, run::gen_runtime116, primPair(), SYM_TIMES, formal(primTransform(), SYM(t), false, false), formal(primPair(), SYM(z), false, false)); -#line 1053 "runtime.in" - addFunc(ve, run::gen_runtime117, primPath(), SYM_TIMES, formal(primTransform(), SYM(t), false, false), formal(primPath(), SYM(g), false, false)); -#line 1058 "runtime.in" - addFunc(ve, run::gen_runtime118, primPen(), SYM_TIMES, formal(primTransform(), SYM(t), false, false), formal(primPen(), SYM(p), false, false)); -#line 1063 "runtime.in" - addFunc(ve, run::gen_runtime119, primPicture(), SYM_TIMES, formal(primTransform(), SYM(t), false, false), formal(primPicture(), SYM(f), false, false)); -#line 1068 "runtime.in" - addFunc(ve, run::gen_runtime120, primPicture(), SYM_TIMES, formal(realArray2(), SYM(t), false, false), formal(primPicture(), SYM(f), false, false)); -#line 1073 "runtime.in" - addFunc(ve, run::gen_runtime121, primTransform(), SYM_CARET, formal(primTransform(), SYM(t), false, false), formal(primInt(), SYM(n), false, false)); -#line 1084 "runtime.in" +#line 874 "runtime.in" + addFunc(ve, run::gen_runtime101, primGuide(), symbol::trans("operator cast"), formal(primTensionSpecifier(), SYM(t), false, false)); +#line 879 "runtime.in" + addFunc(ve, run::gen_runtime102, primGuide(), SYM_CONTROLS, formal(primPair(), SYM(zout), false, false), formal(primPair(), SYM(zin), false, false)); +#line 884 "runtime.in" + addFunc(ve, run::gen_runtime103, primInt(), SYM(size), formal(primGuide(), SYM(g), false, false)); +#line 891 "runtime.in" + addFunc(ve, run::gen_runtime104, primInt(), SYM(length), formal(primGuide(), SYM(g), false, false)); +#line 898 "runtime.in" + addFunc(ve, run::gen_runtime105, primBoolean(), SYM(cyclic), formal(primGuide(), SYM(g), false, false)); +#line 905 "runtime.in" + addFunc(ve, run::gen_runtime106, primPair(), SYM(point), formal(primGuide(), SYM(g), false, false), formal(primInt(), SYM(t), false, false)); +#line 912 "runtime.in" + addFunc(ve, run::gen_runtime107, pairArray(), SYM(dirSpecifier), formal(primGuide(), SYM(g), false, false), formal(primInt(), SYM(t), false, false)); +#line 924 "runtime.in" + addFunc(ve, run::gen_runtime108, pairArray(), SYM(controlSpecifier), formal(primGuide(), SYM(g), false, false), formal(primInt(), SYM(t), false, false)); +#line 941 "runtime.in" + addFunc(ve, run::gen_runtime109, primTensionSpecifier(), SYM(tensionSpecifier), formal(primGuide(), SYM(g), false, false), formal(primInt(), SYM(t), false, false)); +#line 951 "runtime.in" + addFunc(ve, run::gen_runtime110, realArray(), SYM(curlSpecifier), formal(primGuide(), SYM(g), false, false), formal(primInt(), SYM(t), false, false)); +#line 965 "runtime.in" + addFunc(ve, run::gen_runtime111, primGuide(), SYM(reverse), formal(primGuide(), SYM(g), false, false)); +#line 1018 "runtime.in" + addFunc(ve, run::gen_runtime112, realArray(), SYM(_cputime)); +#line 1032 "runtime.in" + addFunc(ve, run::gen_runtime113, primBoolean(), SYM_EQ, formal(primTransform(), SYM(a), false, false), formal(primTransform(), SYM(b), false, false)); +#line 1040 "runtime.in" + addFunc(ve, run::gen_runtime114, primBoolean(), SYM_NEQ, formal(primTransform(), SYM(a), false, false), formal(primTransform(), SYM(b), false, false)); +#line 1045 "runtime.in" + addFunc(ve, run::gen_runtime115, primTransform(), SYM_PLUS, formal(primTransform(), SYM(a), false, false), formal(primTransform(), SYM(b), false, false)); +#line 1050 "runtime.in" + addFunc(ve, run::gen_runtime116, primTransform(), SYM_TIMES, formal(primTransform(), SYM(a), false, false), formal(primTransform(), SYM(b), false, false)); +#line 1055 "runtime.in" + addFunc(ve, run::gen_runtime117, primPair(), SYM_TIMES, formal(primTransform(), SYM(t), false, false), formal(primPair(), SYM(z), false, false)); +#line 1060 "runtime.in" + addFunc(ve, run::gen_runtime118, primPath(), SYM_TIMES, formal(primTransform(), SYM(t), false, false), formal(primPath(), SYM(g), false, false)); +#line 1065 "runtime.in" + addFunc(ve, run::gen_runtime119, primPen(), SYM_TIMES, formal(primTransform(), SYM(t), false, false), formal(primPen(), SYM(p), false, false)); +#line 1070 "runtime.in" + addFunc(ve, run::gen_runtime120, primPicture(), SYM_TIMES, formal(primTransform(), SYM(t), false, false), formal(primPicture(), SYM(f), false, false)); +#line 1075 "runtime.in" + addFunc(ve, run::gen_runtime121, primPicture(), SYM_TIMES, formal(realArray2(), SYM(t), false, false), formal(primPicture(), SYM(f), false, false)); +#line 1080 "runtime.in" + addFunc(ve, run::gen_runtime122, primTransform(), SYM_CARET, formal(primTransform(), SYM(t), false, false), formal(primInt(), SYM(n), false, false)); +#line 1091 "runtime.in" REGISTER_BLTIN(run::transformXPart,"transformXPart"); -#line 1089 "runtime.in" +#line 1096 "runtime.in" REGISTER_BLTIN(run::transformYPart,"transformYPart"); -#line 1094 "runtime.in" +#line 1101 "runtime.in" REGISTER_BLTIN(run::transformXXPart,"transformXXPart"); -#line 1099 "runtime.in" +#line 1106 "runtime.in" REGISTER_BLTIN(run::transformXYPart,"transformXYPart"); -#line 1104 "runtime.in" +#line 1111 "runtime.in" REGISTER_BLTIN(run::transformYXPart,"transformYXPart"); -#line 1109 "runtime.in" +#line 1116 "runtime.in" REGISTER_BLTIN(run::transformYYPart,"transformYYPart"); -#line 1114 "runtime.in" +#line 1121 "runtime.in" REGISTER_BLTIN(run::real6ToTransform,"real6ToTransform"); -#line 1120 "runtime.in" - addFunc(ve, run::gen_runtime129, primTransform(), SYM(shift), formal(primTransform(), SYM(t), false, false)); -#line 1125 "runtime.in" - addFunc(ve, run::gen_runtime130, primTransform(), SYM(shiftless), formal(primTransform(), SYM(t), false, false)); -#line 1130 "runtime.in" +#line 1127 "runtime.in" + addFunc(ve, run::gen_runtime130, primTransform(), SYM(shift), formal(primTransform(), SYM(t), false, false)); +#line 1132 "runtime.in" + addFunc(ve, run::gen_runtime131, primTransform(), SYM(shiftless), formal(primTransform(), SYM(t), false, false)); +#line 1137 "runtime.in" addFunc(ve, run::transformIdentity, primTransform(), SYM(identity)); -#line 1135 "runtime.in" - addFunc(ve, run::gen_runtime132, primTransform(), SYM(inverse), formal(primTransform(), SYM(t), false, false)); -#line 1140 "runtime.in" - addFunc(ve, run::gen_runtime133, primTransform(), SYM(shift), formal(primPair(), SYM(z), false, false)); -#line 1145 "runtime.in" - addFunc(ve, run::gen_runtime134, primTransform(), SYM(shift), formal(primReal(), SYM(x), false, false), formal(primReal(), SYM(y), false, false)); -#line 1150 "runtime.in" - addFunc(ve, run::gen_runtime135, primTransform(), SYM(xscale), formal(primReal(), SYM(x), false, false)); -#line 1155 "runtime.in" - addFunc(ve, run::gen_runtime136, primTransform(), SYM(yscale), formal(primReal(), SYM(y), false, false)); -#line 1160 "runtime.in" - addFunc(ve, run::gen_runtime137, primTransform(), SYM(scale), formal(primReal(), SYM(x), false, false)); -#line 1165 "runtime.in" - addFunc(ve, run::gen_runtime138, primTransform(), SYM(scale), formal(primReal(), SYM(x), false, false), formal(primReal(), SYM(y), false, false)); -#line 1170 "runtime.in" - addFunc(ve, run::gen_runtime139, primTransform(), SYM(slant), formal(primReal(), SYM(s), false, false)); -#line 1175 "runtime.in" - addFunc(ve, run::gen_runtime140, primTransform(), SYM(rotate), formal(primReal(), SYM(angle), false, false), formal(primPair(), SYM(z), true, false)); -#line 1180 "runtime.in" - addFunc(ve, run::gen_runtime141, primTransform(), SYM(reflect), formal(primPair(), SYM(a), false, false), formal(primPair(), SYM(b), false, false)); +#line 1142 "runtime.in" + addFunc(ve, run::gen_runtime133, primTransform(), SYM(inverse), formal(primTransform(), SYM(t), false, false)); +#line 1147 "runtime.in" + addFunc(ve, run::gen_runtime134, primTransform(), SYM(shift), formal(primPair(), SYM(z), false, false)); +#line 1152 "runtime.in" + addFunc(ve, run::gen_runtime135, primTransform(), SYM(shift), formal(primReal(), SYM(x), false, false), formal(primReal(), SYM(y), false, false)); +#line 1157 "runtime.in" + addFunc(ve, run::gen_runtime136, primTransform(), SYM(xscale), formal(primReal(), SYM(x), false, false)); +#line 1162 "runtime.in" + addFunc(ve, run::gen_runtime137, primTransform(), SYM(yscale), formal(primReal(), SYM(y), false, false)); +#line 1167 "runtime.in" + addFunc(ve, run::gen_runtime138, primTransform(), SYM(scale), formal(primReal(), SYM(x), false, false)); +#line 1172 "runtime.in" + addFunc(ve, run::gen_runtime139, primTransform(), SYM(scale), formal(primReal(), SYM(x), false, false), formal(primReal(), SYM(y), false, false)); +#line 1177 "runtime.in" + addFunc(ve, run::gen_runtime140, primTransform(), SYM(slant), formal(primReal(), SYM(s), false, false)); +#line 1182 "runtime.in" + addFunc(ve, run::gen_runtime141, primTransform(), SYM(rotate), formal(primReal(), SYM(angle), false, false), formal(primPair(), SYM(z), true, false)); +#line 1187 "runtime.in" + addFunc(ve, run::gen_runtime142, primTransform(), SYM(reflect), formal(primPair(), SYM(a), false, false), formal(primPair(), SYM(b), false, false)); } } // namespace trans diff --git a/Build/source/utils/asymptote/runtime.in b/Build/source/utils/asymptote/runtime.in index 542378bbe53..49e6de4d3eb 100644 --- a/Build/source/utils/asymptote/runtime.in +++ b/Build/source/utils/asymptote/runtime.in @@ -85,6 +85,10 @@ stringarray2* => stringArray2() #include "process.h" #include "arrayop.h" +#ifdef __APPLE__ +extern "C" int isnan(double); +#endif + #if defined(USEGC) && defined(GC_DEBUG) && defined(GC_BACKTRACE) extern "C" { void *GC_generate_random_valid_address(void); @@ -233,6 +237,11 @@ bool :boolFalse() return false; } +bool isnan(real x) +{ + return isnan(x); +} + array* :pushNullArray() { return 0; @@ -963,47 +972,45 @@ guide *reverse(guide *g) size_t n=f.size(); bool cyclic=g->cyclic(); guidevector v; - if(n >= 0) { - size_t start=cyclic ? n : n-1; - knot curr=f.Nodes(start); - knot next; - for(size_t i=start; i > 0; --i) { - next=f.Nodes(i-1); - v.push_back(new pairguide(curr.z)); - if(next.out->controlled()) { - assert(curr.in->controlled()); - v.push_back(new controlguide(curr.in->control(),next.out->control())); - } else { - pair d=curr.in->dir(); - if(d != zero) - v.push_back(new specguide(new dirSpec(-d),camp::OUT)); - else { - real C=curr.in->curl(); - if(C >= 0.0) - v.push_back(new specguide(new curlSpec(C),camp::OUT)); - } - real tout=curr.tin.val; - real tin=next.tout.val; - bool atleast=next.tout.atleast; - if(tout != 1.0 || tin != 1.0 || next.tout.atleast) - v.push_back(new tensionguide(tensionSpecifier(tout,tin,atleast))); - d=next.out->dir(); - if(d != zero) - v.push_back(new specguide(new dirSpec(-d),camp::IN)); - else { - real C=next.out->curl(); - if(C >= 0.0) - v.push_back(new specguide(new curlSpec(C),camp::IN)); - } + size_t start=cyclic ? n : n-1; + knot curr=f.Nodes(start); + knot next; + for(size_t i=start; i > 0; --i) { + next=f.Nodes(i-1); + v.push_back(new pairguide(curr.z)); + if(next.out->controlled()) { + assert(curr.in->controlled()); + v.push_back(new controlguide(curr.in->control(),next.out->control())); + } else { + pair d=curr.in->dir(); + if(d != zero) + v.push_back(new specguide(new dirSpec(-d),camp::OUT)); + else { + real C=curr.in->curl(); + if(C >= 0.0) + v.push_back(new specguide(new curlSpec(C),camp::OUT)); + } + real tout=curr.tin.val; + real tin=next.tout.val; + bool atleast=next.tout.atleast; + if(tout != 1.0 || tin != 1.0 || next.tout.atleast) + v.push_back(new tensionguide(tensionSpecifier(tout,tin,atleast))); + d=next.out->dir(); + if(d != zero) + v.push_back(new specguide(new dirSpec(-d),camp::IN)); + else { + real C=next.out->curl(); + if(C >= 0.0) + v.push_back(new specguide(new curlSpec(C),camp::IN)); } - curr=next; } - if(cyclic) - v.push_back(new cycletokguide()); - else - v.push_back(new pairguide(next.z)); - + curr=next; } + if(cyclic) + v.push_back(new cycletokguide()); + else + v.push_back(new pairguide(next.z)); + return new multiguide(v); } diff --git a/Build/source/utils/asymptote/settings.cc b/Build/source/utils/asymptote/settings.cc index 59d3b8373f3..a97804a1831 100644 --- a/Build/source/utils/asymptote/settings.cc +++ b/Build/source/utils/asymptote/settings.cc @@ -67,7 +67,8 @@ using trans::refAccess; using trans::varEntry; using vm::array; -void doConfig(string filename); +void runFile(const string& filename); + namespace settings { @@ -89,7 +90,7 @@ mode_t mask; string systemDir=ASYMPTOTE_SYSDIR; -#ifndef __CYGWIN__ +#ifndef __MSDOS__ bool msdos=false; string HOME="HOME"; @@ -189,8 +190,8 @@ void queryRegistry() gs=getEntry("AFPL Ghostscript/*/GS_DLL"); defaultGhostscript=stripFile(gs)+defaultGhostscript; if(defaultPDFViewer != "cmd") - defaultPDFViewer=getEntry("Adobe/Acrobat Reader/*/InstallPath/@")+"\\"+ - defaultPDFViewer; + defaultPDFViewer=getEntry("Adobe/Acrobat Reader/*/InstallPath/@")+"\\"+ + defaultPDFViewer; if(defaultPSViewer != "cmd") defaultPSViewer=getEntry("Ghostgum/GSview/*")+"\\gsview\\"+defaultPSViewer; string s; @@ -275,7 +276,7 @@ bool warn(const string& s) } // The dictionaries of long options and short options. -class option; +struct option; typedef mem::map<CONST string, option *> optionsMap_t; optionsMap_t optionsMap; @@ -693,8 +694,8 @@ struct stringArraySetting : public itemSetting { struct engineSetting : public argumentSetting { engineSetting(string name, char code, - string argname, string desc, - string defaultValue) + string argname, string desc, + string defaultValue) : argumentSetting(name, code, argname, description(desc,defaultValue), types::primString(), (item)defaultValue) {} @@ -1208,8 +1209,8 @@ void initSettings() { addOption(new boolSetting("wait", 0, "Wait for child processes to finish before exiting")); - // Be interactive even in a pipe - addOption(new boolSetting("interactive", 0, "")); + addOption(new IntSetting("inpipe", 0, "n","",-1)); + addOption(new IntSetting("outpipe", 0, "n","",-1)); addOption(new boolSetting("exitonEOF", 0, "Exit interactive mode on EOF", true)); @@ -1301,7 +1302,7 @@ char *getArg(int n) { return argList[n]; } void setInteractive() { if(numArgs() == 0 && !getSetting<bool>("listvariables") && getSetting<string>("command").empty() && - (isatty(STDIN_FILENO) || getSetting<bool>("interactive"))) + (isatty(STDIN_FILENO) || getSetting<Int>("inpipe") >= 0)) interact::interactive=true; historyname=getSetting<bool>("localhistory") ? @@ -1367,7 +1368,7 @@ void initDir() { if(initdir.empty()) initdir=Getenv(HOME.c_str(),msdos)+dirsep+"."+suffix; -#ifdef __CYGWIN__ +#ifdef __MSDOS__ mask=umask(0); if(mask == 0) mask=0027; umask(mask); @@ -1557,11 +1558,11 @@ Int getScroll() if(terminal) { int error; error=setupterm(terminal,1,&error); -#ifndef __CYGWIN__ +#ifndef __MSDOS__ if(error == 0) scroll=lines > 2 ? lines-1 : 1; else #endif - scroll=0; + scroll=0; } else scroll=0; } @@ -1569,12 +1570,25 @@ Int getScroll() return scroll; } +void doConfig(string file) +{ + bool autoplain=getSetting<bool>("autoplain"); + bool listvariables=getSetting<bool>("listvariables"); + if(autoplain) Setting("autoplain")=false; // Turn off for speed. + if(listvariables) Setting("listvariables")=false; + + runFile(file); + + if(autoplain) Setting("autoplain")=true; + if(listvariables) Setting("listvariables")=true; +} + void setOptions(int argc, char *argv[]) { argv0=argv[0]; cout.precision(DBL_DIG); - + // Build settings module. initSettings(); @@ -1604,6 +1618,9 @@ void setOptions(int argc, char *argv[]) // Read command-line options again to override configuration file defaults. getOptions(argc,argv); + if(getSetting<Int>("outpipe") == 2) // Redirect cerr to cout + std::cerr.rdbuf(std::cout.rdbuf()); + Setting("sysdir")=sysdir; if(docdir.empty()) diff --git a/Build/source/utils/asymptote/settings.h b/Build/source/utils/asymptote/settings.h index f6044c6601d..77725cde544 100644 --- a/Build/source/utils/asymptote/settings.h +++ b/Build/source/utils/asymptote/settings.h @@ -27,7 +27,7 @@ namespace gl { extern bool glthread; extern bool initialize; -#ifdef HAVE_LIBPTHREAD +#ifdef HAVE_PTHREAD extern pthread_t mainthread; extern pthread_cond_t initSignal; extern pthread_mutex_t initLock; diff --git a/Build/source/utils/asymptote/stack.cc b/Build/source/utils/asymptote/stack.cc index 31eab91106e..99a71e79348 100644 --- a/Build/source/utils/asymptote/stack.cc +++ b/Build/source/utils/asymptote/stack.cc @@ -38,57 +38,58 @@ position curPos = nullPos; const program::label nulllabel; } -inline stack::vars_t make_frame(lambda *l, stack::vars_t closure) +inline stack::vars_t base_frame( + size_t size, + size_t parentIndex, + stack::vars_t closure +#ifdef DEBUG_FRAME + , string name +#endif + ) { + stack::vars_t vars; #ifdef SIMPLE_FRAME - stack::vars_t vars = new item[l->framesize]; - vars[l->parentIndex] = closure; + vars = new item[size]; + vars[parentIndex] = closure; #else +# ifdef DEBUG_FRAME + assert(!name.empty()); + vars = new frame(name, parentIndex, size); +# else + vars = new frame(size); +# endif + (*vars)[parentIndex] = closure; +#endif + + // TODO: Re-factor closure. + return vars; +} + #ifdef DEBUG_FRAME - assert(!l->name.empty()); - stack::vars_t vars = new frame(l->name, l->parentIndex, l->framesize); +#define BASEFRAME(s,p,c,n) (base_frame((s), (p), (c), (n))) #else - stack::vars_t vars = new frame(l->framesize); +#define BASEFRAME(s,p,c,n) (base_frame((s), (p), (c))) #endif - // The closure is stored after the parameters. - (*vars)[l->parentIndex] = closure; -#endif +// Abstractions needed. +//accessor(frame_handle) +// operator[] for accessor - return vars; + +inline stack::vars_t make_frame(lambda *l, stack::vars_t closure) +{ + return BASEFRAME(l->framesize, l->parentIndex, closure, l->name); } inline stack::vars_t make_pushframe(size_t size, stack::vars_t closure) { assert(size >= 1); -#if SIMPLE_FRAME - stack::vars_t vars = new item[size]; - vars[0] = closure; -#else -#ifdef DEBUG_FRAME - stack::vars_t vars = new frame("<pushed frame>", 0, size); -#else - stack::vars_t vars = new frame(size); -#endif - (*vars)[0] = closure; -#endif - - return vars; + return BASEFRAME(size, 0, closure, "<pushed frame>"); } stack::vars_t make_dummyframe(string name) { -#if SIMPLE_FRAME - stack::vars_t vars = new item[1]; -#else -#ifdef DEBUG_FRAME - stack::vars_t vars = new frame("<dummy frame for "+name+">", 0, 1); -#else - stack::vars_t vars = new frame(1); -#endif -#endif - - return vars; + return BASEFRAME(1, 0, 0, "<dummy frame for "+name+">"); } inline stack::vars_t make_globalframe(size_t size) @@ -102,6 +103,8 @@ inline stack::vars_t make_globalframe(size_t size) direct[0] = indirect; return direct; #else + return BASEFRAME(size, 0, 0, "<globals>"); +#if 0 #ifdef DEBUG_FRAME stack::vars_t vars = new frame("<pushed frame>", 0, size); #else @@ -109,6 +112,7 @@ inline stack::vars_t make_globalframe(size_t size) #endif return vars; #endif +#endif } @@ -260,6 +264,7 @@ void stack::debug() } } + void stack::runWithOrWithoutClosure(lambda *l, vars_t vars, vars_t parent) { // The size of the frame (when running without closure). @@ -660,4 +665,3 @@ void interactiveStack::run(lambda *codelet) { } } // namespace vm - diff --git a/Build/source/utils/asymptote/stack.h b/Build/source/utils/asymptote/stack.h index 4cb2ef0b41e..df072b51573 100644 --- a/Build/source/utils/asymptote/stack.h +++ b/Build/source/utils/asymptote/stack.h @@ -19,7 +19,7 @@ namespace vm { struct func; class program; -class lambda; +struct lambda; class importInitMap; struct bpinfo : public gc { diff --git a/Build/source/utils/asymptote/stm.cc b/Build/source/utils/asymptote/stm.cc index d4ffdaa4e81..af7a0c1d47f 100644 --- a/Build/source/utils/asymptote/stm.cc +++ b/Build/source/utils/asymptote/stm.cc @@ -184,12 +184,7 @@ void ifStm::trans(coenv &e) label elseLabel = e.c.fwdLabel(); label end = e.c.fwdLabel(); -#ifdef TRANSJUMP test->transConditionalJump(e, false, elseLabel); -#else - test->transToType(e, types::primBoolean()); - e.c.useLabel(inst::njmp,elseLabel); -#endif onTrue->markTrans(e); @@ -217,7 +212,7 @@ void transLoopBody(coenv &e, stm *body) { // for (int i = 0; i < 10; ++i) { // int j=10*i; // if (i == 5) - // f = new int() { return j; } + // f = new int() { return j; }; // } // write(f()); // @@ -266,12 +261,7 @@ void whileStm::trans(coenv &e) label start = e.c.defNewLabel(); e.c.pushLoop(start, end); -#ifdef TRANSJUMP test->transConditionalJump(e, false, end); -#else - test->transToType(e, types::primBoolean()); - e.c.useLabel(inst::njmp,end); -#endif transLoopBody(e,body); @@ -302,12 +292,7 @@ void doStm::trans(coenv &e) e.c.defLabel(testLabel); -#ifdef TRANSJUMP test->transConditionalJump(e, true, start); -#else - test->transToType(e, types::primBoolean()); - e.c.useLabel(inst::cjmp,start); -#endif e.c.defLabel(end); @@ -338,12 +323,7 @@ void forStm::trans(coenv &e) label start = e.c.defNewLabel(); if(test) { -#ifdef TRANSJUMP test->transConditionalJump(e, false, end); -#else - test->transToType(e, types::primBoolean()); - e.c.useLabel(inst::njmp,end); -#endif } transLoopBody(e,body); diff --git a/Build/source/utils/asymptote/stm.h b/Build/source/utils/asymptote/stm.h index e525de75aaa..d0cf203108d 100644 --- a/Build/source/utils/asymptote/stm.h +++ b/Build/source/utils/asymptote/stm.h @@ -200,7 +200,7 @@ public: void trans(coenv &e); - // A return statement, is of course, guaranteed to return. + // A return statement is, of course, guaranteed to return. bool returns() { return true; } diff --git a/Build/source/utils/asymptote/tests/Makefile b/Build/source/utils/asymptote/tests/Makefile index afdae4e0472..ec7827ca476 100644 --- a/Build/source/utils/asymptote/tests/Makefile +++ b/Build/source/utils/asymptote/tests/Makefile @@ -1,6 +1,6 @@ .NOTPARALLEL: -TESTDIRS = string arith frames types imp array +TESTDIRS = string arith frames types imp array pic EXTRADIRS = gsl output test: $(TESTDIRS) diff --git a/Build/source/utils/asymptote/tests/gc/label.asy b/Build/source/utils/asymptote/tests/gc/label.asy new file mode 100644 index 00000000000..8ffa26409c9 --- /dev/null +++ b/Build/source/utils/asymptote/tests/gc/label.asy @@ -0,0 +1,8 @@ +guide a; +for (int i = 0; i < 1e7; ++i) +{ + picture pic; + size(pic,10cm,20cm); + draw(pic,"a",scale(2)*(0,0)--(1,1)); + shipout(pic); +} diff --git a/Build/source/utils/asymptote/tests/gc/shipout.asy b/Build/source/utils/asymptote/tests/gc/shipout.asy new file mode 100644 index 00000000000..6622093cf8c --- /dev/null +++ b/Build/source/utils/asymptote/tests/gc/shipout.asy @@ -0,0 +1,11 @@ +guide a; +for (int i = 0; i < 1e7; ++i) +{ + picture pic; + size(pic,10cm,20cm); + path p=(1.0,2.0); + path q=(3.0,4.0); + path a=p..q..(3,5); + draw(pic,a,blue+dashed); + shipout(pic); +} diff --git a/Build/source/utils/asymptote/tests/pic/trans.asy b/Build/source/utils/asymptote/tests/pic/trans.asy new file mode 100644 index 00000000000..9a2e02decfa --- /dev/null +++ b/Build/source/utils/asymptote/tests/pic/trans.asy @@ -0,0 +1,75 @@ +import TestLib; + +StartTest("trans"); + +// Ensure the same test each time. +srand(3456); + +pair randompair() +{ + return (unitrand(),unitrand()); +} + +path randombox() +{ + return box(randompair(), randompair()); +} + +// For now, only tests transforms which take axes to axes. +transform randomtrans() +{ + return rotate(90 * (rand() % 4)) * shift(unitrand(), unitrand()); +} + +real tolerance = 1e-4; + +void testpic(int objs, int trans) +{ + path[] pp; + picture orig; + for (int i = 0; i < objs; ++i) { + pp.push(randombox()); + fill(orig, pp[i]); + } + + picture pic = orig; + transform t = identity(); + for (int i = 0; i < trans; ++i) + { + transform tt = randomtrans(); + pic = tt * pic; + t = tt * t; + } + + pair m = pic.userMin2(), M = pic.userMax2(); + pair pm = min(t * pp), pM = max(t * pp); + + assert(abs(m-pm) < tolerance); + assert(abs(M-pM) < tolerance); +} + +for (int i = 0; i < 100; ++i) + testpic(1,1); +for (int i = 0; i < 100; ++i) + testpic(1,1); +for (int i = 0; i < 100; ++i) + testpic(3,1); +for (int i = 0; i < 100; ++i) + testpic(1,2); +for (int i = 0; i < 100; ++i) + testpic(2,2); +for (int i = 0; i < 100; ++i) + testpic(3,2); +for (int i = 0; i < 100; ++i) + testpic(3,4); +for (int i = 0; i < 100; ++i) + testpic(1,4); +for (int i = 0; i < 100; ++i) + testpic(2,4); +for (int i = 0; i < 100; ++i) + testpic(3,4); +for (int i = 0; i < 100; ++i) + testpic(3,4); + + +EndTest(); diff --git a/Build/source/utils/asymptote/tests/types/constructor.asy b/Build/source/utils/asymptote/tests/types/constructor.asy index 754584edcdb..78a0684fa94 100644 --- a/Build/source/utils/asymptote/tests/types/constructor.asy +++ b/Build/source/utils/asymptote/tests/types/constructor.asy @@ -277,3 +277,104 @@ assert(constructor()==44); EndTest(); // {{{1 +StartTest("tuple"); // {{{1 +{ + pair z = (1,2); + assert(z.x==1); + assert(z.y==2); + pair w = z; + w = (2,3); + assert(z.x==1); + assert(z.y==2); +} +{ + triple z = (1,2,6); + assert(z.x==1); + assert(z.y==2); + assert(z.z==6); + triple w = z; + w = (2,3,9); + assert(z.x==1); + assert(z.y==2); + assert(z.z==6); +} +{ + transform z = (1,2,3,4,5,6); + assert(z.x==1); + assert(z.y==2); + assert(z.xx==3); + assert(z.xy==4); + assert(z.yx==5); + assert(z.yy==6); +} +{ + pair z = (34.0, 35.0); + triple t = (34.0, 35.0, 36.0); + + { + int operator tuple(int x, int y) { return x+y; } + assert((1,2) == 3); + assert((34,35) == 34+35); + assert((34.0,35) == z); + assert((34,35.0) == z); + assert((34.0,35.0) == z); + } + { + int operator tuple(int x, int y) { return x+y; } + int operator tuple(int x, real y) { return 123; } + assert((1,2) == 3); + assert((34,35) == 34+35); + assert((34.0,35) == z); + assert((34,35.0) == 123); + assert((34.0,35.0) == z); + } + { + int operator tuple(int x, int y) { return x+y; } + int operator tuple(int x, real y) { return 123; } + int operator tuple(real x, int y) { return 456; } + assert((1,2) == 3); + assert((34,35) == 34+35); + assert((34.0,35) == 456); + assert((34,35.0) == 123); + assert((34.0,35.0) == z); + } + { + int operator tuple(int x, int y) { return x+y; } + int operator tuple(real x, int y) { return 456; } + assert((1,2) == 3); + assert((34,35) == 34+35); + assert((34.0,35) == 456); + assert((34,35.0) == z); + assert((34.0,35.0) == z); + } + { + int operator tuple(int x, int y) { return x+y; } + int operator tuple(int x, real y) { return 123; } + int operator tuple(real x, int y) { return 456; } + int operator tuple(real x, real y) { return 789; } + assert((1,2) == 3); + assert((34,35) == 34+35); + assert((34.0,35) == 456); + assert((34,35.0) == 123); + assert((34.0,35.0) == 789); + } + { + int operator tuple(int x, int y) { return x+y; } + int operator tuple(real x, real y) { return 789; } + assert((1,2) == 3); + assert((34,35) == 34+35); + assert((34.0,35) == 789); + assert((34,35.0) == 789); + assert((34.0,35.0) == 789); + } + { + int operator tuple(...int[] x) { return x.length; } + assert((34,35) == z); + assert((34,35,36) == t); + assert((34,35,36,37) == 4); + assert((34,35,36,37,38) == 5); + assert((34,35,36,37,1,2,3,4) == 8); + assert((34,35,36,37,1,2,3,4,5,6,7,8,9) == 13); + } +} +EndTest(); diff --git a/Build/source/utils/asymptote/tests/types/keyword.asy b/Build/source/utils/asymptote/tests/types/keyword.asy index 63ad01fecd5..73e407b6f8c 100644 --- a/Build/source/utils/asymptote/tests/types/keyword.asy +++ b/Build/source/utils/asymptote/tests/types/keyword.asy @@ -85,10 +85,8 @@ StartTest("keyword"); assert(f(4, 5, r=3, 10, 20, 30 ... new int[] {40,50,60}) == 3); assert(f(r=3, 10, 20, 30 ... new int[] {40,50,60}) == 3); assert(f(r=3, 10, 20, 30 ... new int[] {40,50,60}) == 3); - /* assert(f(... new int[] {40,50,60}, r=3) == 3); assert(f(... new int[] {40,50,60}, r=3) == 3); - */ } { @@ -106,10 +104,8 @@ StartTest("keyword"); assert(f(4, 5, r=3, 10, 20, 30 ... new int[] {40,50,60}) == 3); assert(f(r=3, 10, 20, 30 ... new int[] {40,50,60}) == 3); assert(f(r=3, 10, 20, 30 ... new int[] {40,50,60}) == 3); - /* assert(f(... new int[] {40,50,60}, r=3) == 3); assert(f(... new int[] {40,50,60}, r=3) == 3); - */ assert(f() == 77); assert(f(1) == 77); @@ -139,11 +135,8 @@ StartTest("keyword"); assert(f(345,4, 5, r=3, 10, 20, 30 ... new int[] {40,50,60}) == 3); assert(f(345,r=3, 10, 20, 30 ... new int[] {40,50,60}) == 3); assert(f(345,r=3, 10, 20, 30 ... new int[] {40,50,60}) == 3); - /* assert(f(345 ... new int[] {40,50,60}, r=3) == 3); assert(f(345 ... new int[] {40,50,60}, r=3) == 3); - assert("ADD LEFT TO RIGHT ORDER TESTING" == "Not yet"); - */ assert(f(345) == 77); assert(f(345,1) == 77); diff --git a/Build/source/utils/asymptote/tests/types/order.asy b/Build/source/utils/asymptote/tests/types/order.asy new file mode 100644 index 00000000000..b2530b17abf --- /dev/null +++ b/Build/source/utils/asymptote/tests/types/order.asy @@ -0,0 +1,165 @@ +import TestLib; +StartTest("order"); + +// Ordering tests. +int counter = 0; +int step(int n) { ++counter; assert(counter == n); return n; } +int[] stepArray(int n) { return new int[] {step(n)}; } +void reset() { counter = 0; } + +{ + reset(); + assert(step(1) + step(2) == step(3)); step(4); +} + +{ + reset(); + assert(step(1) == 0 || step(2) == 2); step(3); +} + +{ + reset(); + step(1) == 0 && step(999) == step(456); step(2); +} + +{ + reset(); + int x = step(1), y = step(2); step(3); + int x = step(4), y = step(5); step(6); +} + +{ + void f(int x, int y) {} + + reset(); + f(step(1), step(2)); step(3); + reset(); + f(x=step(1), y=step(2)); step(3); + reset(); + f(y=step(1), x=step(2)); step(3); + reset(); + f(x=step(1), step(2)); step(3); + reset(); + f(y=step(1), step(2)); step(3); + reset(); + f(step(1), x=step(2)); step(3); + reset(); + f(step(1), y=step(2)); step(3); +} + +{ + void f(int x, int y ... int[] z) {} + + reset(); + f(step(1), step(2)); step(3); + reset(); + f(x=step(1), y=step(2)); step(3); + reset(); + f(y=step(1), x=step(2)); step(3); + reset(); + f(x=step(1), step(2)); step(3); + reset(); + f(y=step(1), step(2)); step(3); + reset(); + f(step(1), x=step(2)); step(3); + reset(); + f(step(1), y=step(2)); step(3); + + reset(); + f(step(1), step(2), step(3)); step(4); + reset(); + f(x=step(1), y=step(2), step(3)); step(4); + reset(); + f(y=step(1), x=step(2), step(3)); step(4); + reset(); + f(x=step(1), step(2), step(3)); step(4); + reset(); + f(y=step(1), step(2), step(3)); step(4); + reset(); + f(step(1), x=step(2), step(3)); step(4); + reset(); + f(step(1), y=step(2), step(3)); step(4); + + reset(); + f(step(1), step(2), step(3), step(4)); step(5); + reset(); + f(x=step(1), y=step(2), step(3), step(4)); step(5); + reset(); + f(y=step(1), x=step(2), step(3), step(4)); step(5); + reset(); + f(x=step(1), step(2), step(3), step(4)); step(5); + reset(); + f(y=step(1), step(2), step(3), step(4)); step(5); + reset(); + f(step(1), x=step(2), step(3), step(4)); step(5); + reset(); + f(step(1), y=step(2), step(3), step(4)); step(5); + + reset(); + f(step(1), step(2), step(3)); step(4); + reset(); + f(x=step(1), step(2), y=step(3)); step(4); + reset(); + f(y=step(1), step(2), x=step(3)); step(4); + reset(); + f(x=step(1), step(2), step(3)); step(4); + reset(); + f(y=step(1), step(2), step(3)); step(4); + reset(); + f(step(1), step(2), x=step(3)); step(4); + reset(); + f(step(1), step(2), y=step(3)); step(4); + + reset(); + f(step(1), step(2), step(3), step(4)); step(5); + reset(); + f(x=step(1), step(2), y=step(3), step(4)); step(5); + reset(); + f(y=step(1), step(2), x=step(3), step(4)); step(5); + reset(); + f(x=step(1), step(2), step(3), step(4)); step(5); + reset(); + f(y=step(1), step(2), step(3), step(4)); step(5); + reset(); + f(step(1), step(2), x=step(3), step(4)); step(5); + reset(); + f(step(1), step(2), y=step(3), step(4)); step(5); + + reset(); + f(step(1), step(2), step(3), step(4)... stepArray(5)); step(6); + reset(); + f(x=step(1), step(2), y=step(3), step(4)... stepArray(5)); step(6); + reset(); + f(y=step(1), step(2), x=step(3), step(4)... stepArray(5)); step(6); + reset(); + f(x=step(1), step(2), step(3), step(4)... stepArray(5)); step(6); + reset(); + f(y=step(1), step(2), step(3), step(4)... stepArray(5)); step(6); + reset(); + f(step(1), step(2), x=step(3), step(4)... stepArray(5)); step(6); + reset(); + f(step(1), step(2), y=step(3), step(4)... stepArray(5)); step(6); + + reset(); + f(...stepArray(1), x=step(2), y=step(3)); step(4); + reset(); + f(...stepArray(1), y=step(2), x=step(3)); step(4); + reset(); + f(step(1)...stepArray(2), x=step(3), y=step(4)); step(5); + reset(); + f(step(1)...stepArray(2), y=step(3), x=step(4)); step(5); + reset(); + f(step(1),step(2)...stepArray(3), y=step(4), x=step(5)); step(6); + reset(); + f(step(1),step(2)...stepArray(3), y=step(4), x=step(5)); step(6); + reset(); + f(step(1),step(2),x=step(3)...stepArray(4), y=step(5)); step(6); + reset(); + f(step(1),step(2),x=step(3)...stepArray(4), y=step(5)); step(6); +} + + + +// TODO: Add packing vs. casting tests. + +EndTest(); diff --git a/Build/source/utils/asymptote/texfile.cc b/Build/source/utils/asymptote/texfile.cc index 9437ab389f3..8e1e07b9c4b 100644 --- a/Build/source/utils/asymptote/texfile.cc +++ b/Build/source/utils/asymptote/texfile.cc @@ -258,14 +258,14 @@ void texfile::endpicture(const bbox& b) verbatimline("pt%"); } -void texfile::gsave() +void texfile::gsave(bool) { *out << settings::beginspecial(texengine); psfile::gsave(true); *out << settings::endspecial() << newl; } -void texfile::grestore() +void texfile::grestore(bool) { *out << settings::beginspecial(texengine); psfile::grestore(true); @@ -356,7 +356,7 @@ void svgtexfile::endtransform() *out << "</g>"; } -void svgtexfile::gsave(bool tex) +void svgtexfile::gsave(bool) { if(clipstack.size() < 1) clipstack.push(0); @@ -366,7 +366,7 @@ void svgtexfile::gsave(bool tex) pens.push(lastpen); } -void svgtexfile::grestore(bool tex) +void svgtexfile::grestore(bool) { if(pens.size() < 1 || clipstack.size() < 1) reportError("grestore without matching gsave"); @@ -418,7 +418,7 @@ void svgtexfile::beginclip() ++clipcount; *out << "id='clip" << clipcount << "'>" << nl; beginpath(); - if(clipstack.size() >= 0) + if(clipstack.size() > 0) clipstack.pop(); clipstack.push(clipcount); } diff --git a/Build/source/utils/asymptote/texfile.h b/Build/source/utils/asymptote/texfile.h index d1bc235f748..13b733bb145 100644 --- a/Build/source/utils/asymptote/texfile.h +++ b/Build/source/utils/asymptote/texfile.h @@ -216,9 +216,9 @@ public: void setfont(pen p); - void gsave(); + void gsave(bool tex=true); - void grestore(); + void grestore(bool tex=true); void beginspecial(); diff --git a/Build/source/utils/asymptote/types.h b/Build/source/utils/asymptote/types.h index 72650f9c91a..22c1daf8936 100644 --- a/Build/source/utils/asymptote/types.h +++ b/Build/source/utils/asymptote/types.h @@ -106,6 +106,9 @@ public: return false; } + bool isError() const { return kind == ty_error; } + bool isNotError() const { return !isError(); } + // The following are only used by the overloaded type, but it is so common // to test for an overloaded type then iterate over its types, that this // allows the code: @@ -118,6 +121,7 @@ public: bool isOverloaded() const { return kind == ty_overloaded; } + bool isNotOverloaded() const { return !isOverloaded(); } ty_iterator begin(); ty_iterator end(); diff --git a/Build/source/utils/asymptote/util.cc b/Build/source/utils/asymptote/util.cc index 9e307a20800..4ab92050784 100644 --- a/Build/source/utils/asymptote/util.cc +++ b/Build/source/utils/asymptote/util.cc @@ -86,7 +86,7 @@ char *StrdupMalloc(string s) string stripDir(string name) { size_t p; -#ifdef __CYGWIN__ +#ifdef __MSDOS__ p=name.rfind('\\'); if(p < string::npos) name.erase(0,p+1); #endif @@ -99,7 +99,7 @@ string stripFile(string name) { size_t p; bool dir=false; -#ifdef __CYGWIN__ +#ifdef __MSDOS__ p=name.rfind('\\'); if(p < string::npos) { dir=true; @@ -344,7 +344,11 @@ void noPath() char *getPath(char *p) { - static size_t size=MAXPATHLEN; +#ifdef MAXPATHLEN + static size_t size = MAXPATHLEN; +#else + static size_t size = 1024; +#endif if(!p) p=new(UseGC) char[size]; if(!p) noPath(); else while(getcwd(p,size) == NULL) { @@ -375,7 +379,7 @@ const char *setPath(const char *s, bool quiet) void push_command(mem::vector<string>& a, const string& s) { a.push_back(s); -#ifdef __CYGWIN__ +#ifdef __MSDOS__ if(s == "cmd") { a.push_back("/c"); a.push_back("start"); diff --git a/Build/source/utils/asymptote/util.h b/Build/source/utils/asymptote/util.h index 4feb9f517a7..a5dc37a60db 100644 --- a/Build/source/utils/asymptote/util.h +++ b/Build/source/utils/asymptote/util.h @@ -96,12 +96,12 @@ extern "C" double jn(Int n, double x); extern "C" double yn(Int n, double x); #endif -#if defined(__mips) -extern "C" double tgamma(double x); -#endif #if defined(__DECCXX_LIBCXX_RH70) || defined(__CYGWIN__) extern "C" int snprintf(char *str, size_t size, const char *format,...); +extern "C" int isnan(double); +#include <stdio.h> +extern "C" FILE *fdopen(int fd, const char *mode); extern "C" int fileno(FILE *); extern "C" char *strptime(const char *s, const char *format, struct tm *tm); extern "C" int setenv(const char *name, const char *value, int overwrite); diff --git a/Build/source/utils/asymptote/vm.h b/Build/source/utils/asymptote/vm.h index fd332dd99cb..5be4c7a104f 100644 --- a/Build/source/utils/asymptote/vm.h +++ b/Build/source/utils/asymptote/vm.h @@ -12,7 +12,7 @@ namespace vm { -class lambda; class stack; +struct lambda; class stack; typedef void (*bltin)(stack *s); #ifdef DEBUG_BLTIN |