diff options
Diffstat (limited to 'Build/source/utils/asymptote/runarray.cc')
-rw-r--r-- | Build/source/utils/asymptote/runarray.cc | 649 |
1 files changed, 311 insertions, 338 deletions
diff --git a/Build/source/utils/asymptote/runarray.cc b/Build/source/utils/asymptote/runarray.cc index 85f5f2c1d84..0d8e5040c6f 100644 --- a/Build/source/utils/asymptote/runarray.cc +++ b/Build/source/utils/asymptote/runarray.cc @@ -462,6 +462,7 @@ Int LUdecompose(double *a, size_t n, size_t* index, bool warn=true) } namespace run { + void dividebyzero(size_t i) { ostringstream buf; @@ -478,12 +479,6 @@ void integeroverflow(size_t i) error(buf); } -void checkSize(Int n, Int depth) -{ - if(n < 0) error("cannot create a negative length array"); - if(depth < 0) error("cannot copy to a negative depth"); -} - } // Autogenerated routines: @@ -496,10 +491,10 @@ void checkSize(Int n, Int depth) #endif namespace run { // Create an empty array. -#line 451 "runarray.in" +#line 446 "runarray.in" void emptyArray(stack *Stack) { -#line 452 "runarray.in" +#line 447 "runarray.in" {Stack->push<array*>(new array(0)); return;} } @@ -508,11 +503,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 461 "runarray.in" +#line 456 "runarray.in" void newDeepArray(stack *Stack) { Int depth=vm::pop<Int>(Stack); -#line 462 "runarray.in" +#line 457 "runarray.in" assert(depth > 0); Int *dims = new Int[depth]; @@ -531,11 +526,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 481 "runarray.in" +#line 476 "runarray.in" void newInitializedArray(stack *Stack) { Int n=vm::pop<Int>(Stack); -#line 482 "runarray.in" +#line 477 "runarray.in" assert(n >= 0); array *a = new array(n); @@ -548,12 +543,12 @@ void newInitializedArray(stack *Stack) // Similar to newInitializedArray, but after the n elements, append another // array to it. -#line 495 "runarray.in" +#line 490 "runarray.in" void newAppendedArray(stack *Stack) { Int n=vm::pop<Int>(Stack); array* tail=vm::pop<array*>(Stack); -#line 496 "runarray.in" +#line 491 "runarray.in" assert(n >= 0); array *a = new array(n); @@ -567,48 +562,30 @@ void newAppendedArray(stack *Stack) } // Produce an array of n deep copies of value. -#line 510 "runarray.in" -void copyArray0(stack *Stack) -{ - Int depth=vm::pop<Int>(Stack,Int_MAX); - item value=vm::pop(Stack); - Int n=vm::pop<Int>(Stack); -#line 511 "runarray.in" - checkSize(n,depth); - {Stack->push<array*>(new array((size_t) n, value, (size_t) 0)); return;} -} - -#line 516 "runarray.in" -void copyArray1(stack *Stack) -{ - Int depth=vm::pop<Int>(Stack,Int_MAX); - item value=vm::pop(Stack); - Int n=vm::pop<Int>(Stack); -#line 517 "runarray.in" - checkSize(n,depth); - if(depth > 1) depth=1; - {Stack->push<array*>(new array((size_t) n, value, (size_t) depth)); return;} -} - -#line 523 "runarray.in" -void copyArray2(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) { + 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 524 "runarray.in" - checkSize(n,depth); - if(depth > 2) depth=2; - {Stack->push<array*>(new array((size_t) n, value, (size_t) depth)); return;} +#line 509 "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;} } // Read an element from an array. Checks for initialization & bounds. -#line 531 "runarray.in" +#line 517 "runarray.in" void arrayRead(stack *Stack) { Int n=vm::pop<Int>(Stack); array * a=vm::pop<array *>(Stack); -#line 532 "runarray.in" +#line 518 "runarray.in" item& i=arrayRead(a,n); if (i.empty()) { ostringstream buf; @@ -619,37 +596,37 @@ void arrayRead(stack *Stack) } // Slice a substring from an array. -#line 543 "runarray.in" +#line 529 "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 544 "runarray.in" +#line 530 "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 551 "runarray.in" +#line 537 "runarray.in" void arraySliceReadToEnd(stack *Stack) { Int left=vm::pop<Int>(Stack); array * a=vm::pop<array *>(Stack); -#line 552 "runarray.in" +#line 538 "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 559 "runarray.in" +#line 545 "runarray.in" void arrayArrayRead(stack *Stack) { Int n=vm::pop<Int>(Stack); array * a=vm::pop<array *>(Stack); -#line 560 "runarray.in" +#line 546 "runarray.in" item& i=arrayRead(a,n); if (i.empty()) i=new array(0); {Stack->push(i); return;} @@ -657,13 +634,13 @@ void arrayArrayRead(stack *Stack) // Write an element to an array. Increase size if necessary. // TODO: Add arrayWriteAndPop -#line 568 "runarray.in" +#line 554 "runarray.in" void arrayWrite(stack *Stack) { item value=vm::pop(Stack); Int n=vm::pop<Int>(Stack); array * a=vm::pop<array *>(Stack); -#line 569 "runarray.in" +#line 555 "runarray.in" size_t len=checkArray(a); bool cyclic=a->cyclic(); if(cyclic && len > 0) n=imod(n,len); @@ -677,27 +654,27 @@ void arrayWrite(stack *Stack) {Stack->push(value); return;} } -#line 583 "runarray.in" +#line 569 "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 584 "runarray.in" +#line 570 "runarray.in" checkArray(src); checkArray(dest); dest->setSlice(left, right, src); {Stack->push<array*>(src); return;} } -#line 591 "runarray.in" +#line 577 "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 592 "runarray.in" +#line 578 "runarray.in" checkArray(src); size_t len=checkArray(dest); dest->setSlice(left, (Int) len, src); @@ -705,20 +682,20 @@ void arraySliceWriteToEnd(stack *Stack) } // Returns the length of an array. -#line 600 "runarray.in" +#line 586 "runarray.in" void arrayLength(stack *Stack) { array * a=vm::pop<array *>(Stack); -#line 601 "runarray.in" +#line 587 "runarray.in" {Stack->push<Int>((Int) checkArray(a)); return;} } // Returns an array of integers representing the keys of the array. -#line 606 "runarray.in" +#line 592 "runarray.in" void arrayKeys(stack *Stack) { array * a=vm::pop<array *>(Stack); -#line 607 "runarray.in" +#line 593 "runarray.in" size_t size=checkArray(a); array *keys=new array(); @@ -732,33 +709,33 @@ void arrayKeys(stack *Stack) } // Return the cyclic flag for an array. -#line 621 "runarray.in" +#line 607 "runarray.in" void arrayCyclicFlag(stack *Stack) { array * a=vm::pop<array *>(Stack); -#line 622 "runarray.in" +#line 608 "runarray.in" checkArray(a); {Stack->push<bool>(a->cyclic()); return;} } -#line 627 "runarray.in" +#line 613 "runarray.in" void arraySetCyclicFlag(stack *Stack) { array * a=vm::pop<array *>(Stack); bool b=vm::pop<bool>(Stack); -#line 628 "runarray.in" +#line 614 "runarray.in" checkArray(a); a->cyclic(b); {Stack->push<bool>(b); return;} } // Check to see if an array element is initialized. -#line 635 "runarray.in" +#line 621 "runarray.in" void arrayInitializedHelper(stack *Stack) { array * a=vm::pop<array *>(Stack); Int n=vm::pop<Int>(Stack); -#line 636 "runarray.in" +#line 622 "runarray.in" size_t len=checkArray(a); bool cyclic=a->cyclic(); if(cyclic && len > 0) n=imod(n,len); @@ -768,62 +745,62 @@ void arrayInitializedHelper(stack *Stack) } // Returns the initialize method for an array. -#line 646 "runarray.in" +#line 632 "runarray.in" void arrayInitialized(stack *Stack) { array * a=vm::pop<array *>(Stack); -#line 647 "runarray.in" +#line 633 "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 652 "runarray.in" +#line 638 "runarray.in" void arrayCyclicHelper(stack *Stack) { array * a=vm::pop<array *>(Stack); bool b=vm::pop<bool>(Stack); -#line 653 "runarray.in" +#line 639 "runarray.in" checkArray(a); a->cyclic(b); } // Set the cyclic flag for an array. -#line 659 "runarray.in" +#line 645 "runarray.in" void arrayCyclic(stack *Stack) { array * a=vm::pop<array *>(Stack); -#line 660 "runarray.in" +#line 646 "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 665 "runarray.in" +#line 651 "runarray.in" void arrayPushHelper(stack *Stack) { array * a=vm::pop<array *>(Stack); item x=vm::pop(Stack); -#line 666 "runarray.in" +#line 652 "runarray.in" checkArray(a); a->push(x); {Stack->push(x); return;} } // Returns the push method for an array. -#line 673 "runarray.in" +#line 659 "runarray.in" void arrayPush(stack *Stack) { array * a=vm::pop<array *>(Stack); -#line 674 "runarray.in" +#line 660 "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 679 "runarray.in" +#line 665 "runarray.in" void arrayAppendHelper(stack *Stack) { array * a=vm::pop<array *>(Stack); array * b=vm::pop<array *>(Stack); -#line 680 "runarray.in" +#line 666 "runarray.in" checkArray(a); size_t size=checkArray(b); for(size_t i=0; i < size; i++) @@ -831,20 +808,20 @@ void arrayAppendHelper(stack *Stack) } // Returns the append method for an array. -#line 688 "runarray.in" +#line 674 "runarray.in" void arrayAppend(stack *Stack) { array * a=vm::pop<array *>(Stack); -#line 689 "runarray.in" +#line 675 "runarray.in" {Stack->push<callable*>(new thunk(new bfunc(arrayAppendHelper),a)); return;} } // The helper function for the pop method. -#line 694 "runarray.in" +#line 680 "runarray.in" void arrayPopHelper(stack *Stack) { array * a=vm::pop<array *>(Stack); -#line 695 "runarray.in" +#line 681 "runarray.in" size_t asize=checkArray(a); if(asize == 0) error("cannot pop element from empty array"); @@ -852,22 +829,22 @@ void arrayPopHelper(stack *Stack) } // Returns the pop method for an array. -#line 703 "runarray.in" +#line 689 "runarray.in" void arrayPop(stack *Stack) { array * a=vm::pop<array *>(Stack); -#line 704 "runarray.in" +#line 690 "runarray.in" {Stack->push<callable*>(new thunk(new bfunc(arrayPopHelper),a)); return;} } // The helper function for the insert method. -#line 709 "runarray.in" +#line 695 "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 710 "runarray.in" +#line 696 "runarray.in" size_t asize=checkArray(a); checkArray(x); if(a->cyclic() && asize > 0) i=imod(i,asize); @@ -877,39 +854,39 @@ void arrayInsertHelper(stack *Stack) } // Returns the insert method for an array. -#line 720 "runarray.in" +#line 706 "runarray.in" void arrayInsert(stack *Stack) { array * a=vm::pop<array *>(Stack); -#line 721 "runarray.in" +#line 707 "runarray.in" {Stack->push<callable*>(new thunk(new bfunc(arrayInsertHelper),a)); return;} } // Returns the delete method for an array. -#line 726 "runarray.in" +#line 712 "runarray.in" void arrayDelete(stack *Stack) { array * a=vm::pop<array *>(Stack); -#line 727 "runarray.in" +#line 713 "runarray.in" {Stack->push<callable*>(new thunk(new bfunc(arrayDeleteHelper),a)); return;} } -#line 731 "runarray.in" +#line 717 "runarray.in" void arrayAlias(stack *Stack) { array * b=vm::pop<array *>(Stack); array * a=vm::pop<array *>(Stack); -#line 732 "runarray.in" +#line 718 "runarray.in" {Stack->push<bool>(a==b); return;} } // Return array formed by indexing array a with elements of integer array b -#line 737 "runarray.in" +#line 723 "runarray.in" void arrayIntArray(stack *Stack) { array * b=vm::pop<array *>(Stack); array * a=vm::pop<array *>(Stack); -#line 738 "runarray.in" +#line 724 "runarray.in" size_t asize=checkArray(a); size_t bsize=checkArray(b); array *r=new array(bsize); @@ -927,13 +904,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 756 "runarray.in" +#line 742 "runarray.in" // Intarray* complement(Intarray *a, Int n); -void gen_runarray33(stack *Stack) +void gen_runarray31(stack *Stack) { Int n=vm::pop<Int>(Stack); Intarray * a=vm::pop<Intarray *>(Stack); -#line 757 "runarray.in" +#line 743 "runarray.in" size_t asize=checkArray(a); array *r=new array(0); bool *keep=new bool[n]; @@ -950,12 +927,12 @@ void gen_runarray33(stack *Stack) } // Generate the sequence {f(i) : i=0,1,...n-1} given a function f and integer n -#line 774 "runarray.in" +#line 760 "runarray.in" void arraySequence(stack *Stack) { Int n=vm::pop<Int>(Stack); callable * f=vm::pop<callable *>(Stack); -#line 775 "runarray.in" +#line 761 "runarray.in" if(n < 0) n=0; array *a=new array(n); for(Int i=0; i < n; ++i) { @@ -967,12 +944,12 @@ void arraySequence(stack *Stack) } // Return the array {0,1,...n-1} -#line 787 "runarray.in" +#line 773 "runarray.in" // Intarray* sequence(Int n); -void gen_runarray35(stack *Stack) +void gen_runarray33(stack *Stack) { Int n=vm::pop<Int>(Stack); -#line 788 "runarray.in" +#line 774 "runarray.in" if(n < 0) n=0; array *a=new array(n); for(Int i=0; i < n; ++i) { @@ -982,12 +959,12 @@ void gen_runarray35(stack *Stack) } // Apply a function to each element of an array -#line 798 "runarray.in" +#line 784 "runarray.in" void arrayFunction(stack *Stack) { array * a=vm::pop<array *>(Stack); callable * f=vm::pop<callable *>(Stack); -#line 799 "runarray.in" +#line 785 "runarray.in" size_t size=checkArray(a); array *b=new array(size); for(size_t i=0; i < size; ++i) { @@ -998,12 +975,12 @@ void arrayFunction(stack *Stack) {Stack->push<array*>(b); return;} } -#line 810 "runarray.in" +#line 796 "runarray.in" void arraySort(stack *Stack) { callable * less=vm::pop<callable *>(Stack); array * a=vm::pop<array *>(Stack); -#line 811 "runarray.in" +#line 797 "runarray.in" array *c=copyArray(a); compareFunc=less; FuncStack=Stack; @@ -1011,13 +988,13 @@ void arraySort(stack *Stack) {Stack->push<array*>(c); return;} } -#line 819 "runarray.in" +#line 805 "runarray.in" void arraySearch(stack *Stack) { callable * less=vm::pop<callable *>(Stack); item key=vm::pop(Stack); array * a=vm::pop<array *>(Stack); -#line 820 "runarray.in" +#line 806 "runarray.in" size_t size=a->size(); compareFunc=less; FuncStack=Stack; @@ -1035,12 +1012,12 @@ void arraySearch(stack *Stack) {Stack->push<Int>(0); return;} } -#line 838 "runarray.in" +#line 824 "runarray.in" // bool all(boolarray *a); -void gen_runarray39(stack *Stack) +void gen_runarray37(stack *Stack) { boolarray * a=vm::pop<boolarray *>(Stack); -#line 839 "runarray.in" +#line 825 "runarray.in" size_t size=checkArray(a); bool c=true; for(size_t i=0; i < size; i++) @@ -1048,12 +1025,12 @@ void gen_runarray39(stack *Stack) {Stack->push<bool>(c); return;} } -#line 847 "runarray.in" +#line 833 "runarray.in" // boolarray* !(boolarray* a); -void gen_runarray40(stack *Stack) +void gen_runarray38(stack *Stack) { boolarray* a=vm::pop<boolarray*>(Stack); -#line 848 "runarray.in" +#line 834 "runarray.in" size_t size=checkArray(a); array *c=new array(size); for(size_t i=0; i < size; i++) @@ -1061,12 +1038,12 @@ void gen_runarray40(stack *Stack) {Stack->push<boolarray*>(c); return;} } -#line 856 "runarray.in" +#line 842 "runarray.in" // Int sum(boolarray *a); -void gen_runarray41(stack *Stack) +void gen_runarray39(stack *Stack) { boolarray * a=vm::pop<boolarray *>(Stack); -#line 857 "runarray.in" +#line 843 "runarray.in" size_t size=checkArray(a); Int sum=0; for(size_t i=0; i < size; i++) @@ -1074,19 +1051,19 @@ void gen_runarray41(stack *Stack) {Stack->push<Int>(sum); return;} } -#line 865 "runarray.in" +#line 851 "runarray.in" void arrayCopy(stack *Stack) { array * a=vm::pop<array *>(Stack); -#line 866 "runarray.in" +#line 852 "runarray.in" {Stack->push<array*>(copyArray(a)); return;} } -#line 870 "runarray.in" +#line 856 "runarray.in" void arrayConcat(stack *Stack) { array * a=vm::pop<array *>(Stack); -#line 871 "runarray.in" +#line 857 "runarray.in" // a is an array of arrays to be concatenated together. // The signature is // T[] concat(... T[][] a); @@ -1113,27 +1090,27 @@ void arrayConcat(stack *Stack) {Stack->push<array*>(result); return;} } -#line 898 "runarray.in" +#line 884 "runarray.in" void array2Copy(stack *Stack) { array * a=vm::pop<array *>(Stack); -#line 899 "runarray.in" +#line 885 "runarray.in" {Stack->push<array*>(copyArray2(a)); return;} } -#line 903 "runarray.in" +#line 889 "runarray.in" void array3Copy(stack *Stack) { array * a=vm::pop<array *>(Stack); -#line 904 "runarray.in" +#line 890 "runarray.in" {Stack->push<array*>(copyArray3(a)); return;} } -#line 908 "runarray.in" +#line 894 "runarray.in" void array2Transpose(stack *Stack) { array * a=vm::pop<array *>(Stack); -#line 909 "runarray.in" +#line 895 "runarray.in" size_t asize=checkArray(a); array *c=new array(0); for(size_t i=0; i < asize; i++) { @@ -1160,12 +1137,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 936 "runarray.in" +#line 922 "runarray.in" void array3Transpose(stack *Stack) { array * perm=vm::pop<array *>(Stack); array * a=vm::pop<array *>(Stack); -#line 937 "runarray.in" +#line 923 "runarray.in" const size_t DIM=3; if(checkArray(perm) != DIM) { @@ -1249,13 +1226,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 1021 "runarray.in" +#line 1007 "runarray.in" // Int find(boolarray *a, Int n=1); -void gen_runarray48(stack *Stack) +void gen_runarray46(stack *Stack) { Int n=vm::pop<Int>(Stack,1); boolarray * a=vm::pop<boolarray *>(Stack); -#line 1022 "runarray.in" +#line 1008 "runarray.in" size_t size=checkArray(a); Int j=-1; if(n > 0) @@ -1273,13 +1250,13 @@ void gen_runarray48(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 1040 "runarray.in" +#line 1026 "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 1041 "runarray.in" +#line 1027 "runarray.in" size_t size=checkArray(a); array *r=new array(size); if(b && c) { @@ -1303,22 +1280,22 @@ void arrayConditional(stack *Stack) } // Return an n x n identity matrix. -#line 1065 "runarray.in" +#line 1051 "runarray.in" // realarray2* identity(Int n); -void gen_runarray50(stack *Stack) +void gen_runarray48(stack *Stack) { Int n=vm::pop<Int>(Stack); -#line 1066 "runarray.in" +#line 1052 "runarray.in" {Stack->push<realarray2*>(Identity(n)); return;} } // Return the inverse of an n x n matrix a using Gauss-Jordan elimination. -#line 1071 "runarray.in" +#line 1057 "runarray.in" // realarray2* inverse(realarray2 *a); -void gen_runarray51(stack *Stack) +void gen_runarray49(stack *Stack) { realarray2 * a=vm::pop<realarray2 *>(Stack); -#line 1072 "runarray.in" +#line 1058 "runarray.in" a=copyArray2(a); size_t n=checkArray(a); checkSquare(a); @@ -1411,14 +1388,14 @@ void gen_runarray51(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 1165 "runarray.in" +#line 1151 "runarray.in" // realarray* solve(realarray2 *a, realarray *b, bool warn=true); -void gen_runarray52(stack *Stack) +void gen_runarray50(stack *Stack) { bool warn=vm::pop<bool>(Stack,true); realarray * b=vm::pop<realarray *>(Stack); realarray2 * a=vm::pop<realarray2 *>(Stack); -#line 1166 "runarray.in" +#line 1152 "runarray.in" size_t n=checkArray(a); if(n == 0) {Stack->push<realarray*>(new array(0)); return;} @@ -1470,14 +1447,14 @@ void gen_runarray52(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 1218 "runarray.in" +#line 1204 "runarray.in" // realarray2* solve(realarray2 *a, realarray2 *b, bool warn=true); -void gen_runarray53(stack *Stack) +void gen_runarray51(stack *Stack) { bool warn=vm::pop<bool>(Stack,true); realarray2 * b=vm::pop<realarray2 *>(Stack); realarray2 * a=vm::pop<realarray2 *>(Stack); -#line 1219 "runarray.in" +#line 1205 "runarray.in" size_t n=checkArray(a); if(n == 0) {Stack->push<realarray2*>(new array(0)); return;} @@ -1539,12 +1516,12 @@ void gen_runarray53(stack *Stack) } // Compute the determinant of an n x n matrix. -#line 1281 "runarray.in" +#line 1267 "runarray.in" // real determinant(realarray2 *a); -void gen_runarray54(stack *Stack) +void gen_runarray52(stack *Stack) { realarray2 * a=vm::pop<realarray2 *>(Stack); -#line 1282 "runarray.in" +#line 1268 "runarray.in" real *A; copyArray2C(A,a); size_t n=checkArray(a); @@ -1559,13 +1536,13 @@ void gen_runarray54(stack *Stack) {Stack->push<real>(det); return;} } -#line 1297 "runarray.in" +#line 1283 "runarray.in" // realarray* *(realarray2 *a, realarray *b); -void gen_runarray55(stack *Stack) +void gen_runarray53(stack *Stack) { realarray * b=vm::pop<realarray *>(Stack); realarray2 * a=vm::pop<realarray2 *>(Stack); -#line 1298 "runarray.in" +#line 1284 "runarray.in" size_t n=checkArray(a); size_t m=checkArray(b); array *c=new array(n); @@ -1583,13 +1560,13 @@ void gen_runarray55(stack *Stack) {Stack->push<realarray*>(c); return;} } -#line 1316 "runarray.in" +#line 1302 "runarray.in" // realarray* *(realarray *a, realarray2 *b); -void gen_runarray56(stack *Stack) +void gen_runarray54(stack *Stack) { realarray2 * b=vm::pop<realarray2 *>(Stack); realarray * a=vm::pop<realarray *>(Stack); -#line 1317 "runarray.in" +#line 1303 "runarray.in" size_t n=checkArray(a); if(n != checkArray(b)) error(incommensurate); real *A; @@ -1617,53 +1594,53 @@ void gen_runarray56(stack *Stack) {Stack->push<realarray*>(c); return;} } -#line 1345 "runarray.in" +#line 1331 "runarray.in" // Intarray2* *(Intarray2 *a, Intarray2 *b); -void gen_runarray57(stack *Stack) +void gen_runarray55(stack *Stack) { Intarray2 * b=vm::pop<Intarray2 *>(Stack); Intarray2 * a=vm::pop<Intarray2 *>(Stack); -#line 1346 "runarray.in" +#line 1332 "runarray.in" {Stack->push<Intarray2*>(mult<Int>(a,b)); return;} } -#line 1350 "runarray.in" +#line 1336 "runarray.in" // realarray2* *(realarray2 *a, realarray2 *b); -void gen_runarray58(stack *Stack) +void gen_runarray56(stack *Stack) { realarray2 * b=vm::pop<realarray2 *>(Stack); realarray2 * a=vm::pop<realarray2 *>(Stack); -#line 1351 "runarray.in" +#line 1337 "runarray.in" {Stack->push<realarray2*>(mult<real>(a,b)); return;} } -#line 1355 "runarray.in" +#line 1341 "runarray.in" // pairarray2* *(pairarray2 *a, pairarray2 *b); -void gen_runarray59(stack *Stack) +void gen_runarray57(stack *Stack) { pairarray2 * b=vm::pop<pairarray2 *>(Stack); pairarray2 * a=vm::pop<pairarray2 *>(Stack); -#line 1356 "runarray.in" +#line 1342 "runarray.in" {Stack->push<pairarray2*>(mult<pair>(a,b)); return;} } -#line 1360 "runarray.in" +#line 1346 "runarray.in" // triple *(realarray2 *t, triple v); -void gen_runarray60(stack *Stack) +void gen_runarray58(stack *Stack) { triple v=vm::pop<triple>(Stack); realarray2 * t=vm::pop<realarray2 *>(Stack); -#line 1361 "runarray.in" +#line 1347 "runarray.in" {Stack->push<triple>(*t*v); return;} } -#line 1365 "runarray.in" +#line 1351 "runarray.in" // pair project(triple v, realarray2 *t); -void gen_runarray61(stack *Stack) +void gen_runarray59(stack *Stack) { realarray2 * t=vm::pop<realarray2 *>(Stack); triple v=vm::pop<triple>(Stack); -#line 1366 "runarray.in" +#line 1352 "runarray.in" size_t n=checkArray(t); if(n != 4) error(incommensurate); array *t0=read<array*>(t,0); @@ -1688,13 +1665,13 @@ void gen_runarray61(stack *Stack) } // Compute the dot product of vectors a and b. -#line 1391 "runarray.in" +#line 1377 "runarray.in" // real dot(realarray *a, realarray *b); -void gen_runarray62(stack *Stack) +void gen_runarray60(stack *Stack) { realarray * b=vm::pop<realarray *>(Stack); realarray * a=vm::pop<realarray *>(Stack); -#line 1392 "runarray.in" +#line 1378 "runarray.in" size_t n=checkArrays(a,b); real sum=0.0; for(size_t i=0; i < n; ++i) @@ -1703,13 +1680,13 @@ void gen_runarray62(stack *Stack) } // Compute the complex dot product of vectors a and b. -#line 1401 "runarray.in" +#line 1387 "runarray.in" // pair dot(pairarray *a, pairarray *b); -void gen_runarray63(stack *Stack) +void gen_runarray61(stack *Stack) { pairarray * b=vm::pop<pairarray *>(Stack); pairarray * a=vm::pop<pairarray *>(Stack); -#line 1402 "runarray.in" +#line 1388 "runarray.in" size_t n=checkArrays(a,b); pair sum=zero; for(size_t i=0; i < n; ++i) @@ -1724,15 +1701,15 @@ void gen_runarray63(stack *Stack) // [ a[2] b[2] c[2] ] // [ ... ] // [ c[n-1] a[n-1] b[n-1] ] -#line 1417 "runarray.in" +#line 1403 "runarray.in" // realarray* tridiagonal(realarray *a, realarray *b, realarray *c, realarray *f); -void gen_runarray64(stack *Stack) +void gen_runarray62(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 1418 "runarray.in" +#line 1404 "runarray.in" size_t n=checkArrays(a,b); checkEqual(n,checkArray(c)); checkEqual(n,checkArray(f)); @@ -1829,16 +1806,16 @@ void gen_runarray64(stack *Stack) } // Root solve by Newton-Raphson -#line 1515 "runarray.in" +#line 1501 "runarray.in" // real newton(Int iterations=100, callableReal *f, callableReal *fprime, real x, bool verbose=false); -void gen_runarray65(stack *Stack) +void gen_runarray63(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 1517 "runarray.in" +#line 1503 "runarray.in" static const real fuzz=1000.0*DBL_EPSILON; Int i=0; size_t oldPrec=0; @@ -1884,9 +1861,9 @@ void gen_runarray65(stack *Stack) // Root solve by Newton-Raphson bisection // cf. routine rtsafe (Press et al., Numerical Recipes, 1991). -#line 1563 "runarray.in" +#line 1549 "runarray.in" // real newton(Int iterations=100, callableReal *f, callableReal *fprime, real x1, real x2, bool verbose=false); -void gen_runarray66(stack *Stack) +void gen_runarray64(stack *Stack) { bool verbose=vm::pop<bool>(Stack,false); real x2=vm::pop<real>(Stack); @@ -1894,7 +1871,7 @@ void gen_runarray66(stack *Stack) callableReal * fprime=vm::pop<callableReal *>(Stack); callableReal * f=vm::pop<callableReal *>(Stack); Int iterations=vm::pop<Int>(Stack,100); -#line 1565 "runarray.in" +#line 1551 "runarray.in" static const real fuzz=1000.0*DBL_EPSILON; size_t oldPrec=0; if(verbose) @@ -1972,16 +1949,16 @@ void gen_runarray66(stack *Stack) {Stack->push<real>((j == iterations) ? DBL_MAX : x); return;} } -#line 1643 "runarray.in" +#line 1629 "runarray.in" // real simpson(callableReal *f, real a, real b, real acc=DBL_EPSILON, real dxmax=0); -void gen_runarray67(stack *Stack) +void gen_runarray65(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 1645 "runarray.in" +#line 1631 "runarray.in" real integral; if(dxmax <= 0) dxmax=fabs(b-a); Func=f; @@ -1992,13 +1969,13 @@ void gen_runarray67(stack *Stack) } // Compute the fast Fourier transform of a pair array -#line 1656 "runarray.in" +#line 1642 "runarray.in" // pairarray* fft(pairarray *a, Int sign=1); -void gen_runarray68(stack *Stack) +void gen_runarray66(stack *Stack) { Int sign=vm::pop<Int>(Stack,1); pairarray * a=vm::pop<pairarray *>(Stack); -#line 1657 "runarray.in" +#line 1643 "runarray.in" unsigned n=(unsigned) checkArray(a); #ifdef HAVE_LIBFFTW3 array *c=new array(n); @@ -2027,12 +2004,12 @@ void gen_runarray68(stack *Stack) {Stack->push<pairarray*>(c); return;} } -#line 1686 "runarray.in" +#line 1672 "runarray.in" // Intarray2* triangulate(pairarray *z); -void gen_runarray69(stack *Stack) +void gen_runarray67(stack *Stack) { pairarray * z=vm::pop<pairarray *>(Stack); -#line 1687 "runarray.in" +#line 1673 "runarray.in" size_t nv=checkArray(z); // Call robust version of Gilles Dumoulin's port of Paul Bourke's // triangulation code. @@ -2066,12 +2043,12 @@ void gen_runarray69(stack *Stack) {Stack->push<Intarray2*>(t); return;} } -#line 1721 "runarray.in" +#line 1707 "runarray.in" // real norm(realarray *a); -void gen_runarray70(stack *Stack) +void gen_runarray68(stack *Stack) { realarray * a=vm::pop<realarray *>(Stack); -#line 1722 "runarray.in" +#line 1708 "runarray.in" size_t n=checkArray(a); real M=0.0; for(size_t i=0; i < n; ++i) { @@ -2081,12 +2058,12 @@ void gen_runarray70(stack *Stack) {Stack->push<real>(M); return;} } -#line 1732 "runarray.in" +#line 1718 "runarray.in" // real norm(realarray2 *a); -void gen_runarray71(stack *Stack) +void gen_runarray69(stack *Stack) { realarray2 * a=vm::pop<realarray2 *>(Stack); -#line 1733 "runarray.in" +#line 1719 "runarray.in" size_t n=checkArray(a); real M=0.0; for(size_t i=0; i < n; ++i) { @@ -2100,12 +2077,12 @@ void gen_runarray71(stack *Stack) {Stack->push<real>(M); return;} } -#line 1747 "runarray.in" +#line 1733 "runarray.in" // real norm(triplearray2 *a); -void gen_runarray72(stack *Stack) +void gen_runarray70(stack *Stack) { triplearray2 * a=vm::pop<triplearray2 *>(Stack); -#line 1748 "runarray.in" +#line 1734 "runarray.in" size_t n=checkArray(a); real M=0.0; for(size_t i=0; i < n; ++i) { @@ -2119,12 +2096,12 @@ void gen_runarray72(stack *Stack) {Stack->push<real>(sqrt(M)); return;} } -#line 1762 "runarray.in" +#line 1748 "runarray.in" // real change2(triplearray2 *a); -void gen_runarray73(stack *Stack) +void gen_runarray71(stack *Stack) { triplearray2 * a=vm::pop<triplearray2 *>(Stack); -#line 1763 "runarray.in" +#line 1749 "runarray.in" size_t n=checkArray(a); if(n == 0) {Stack->push<real>(0.0); return;} @@ -2145,13 +2122,13 @@ void gen_runarray73(stack *Stack) {Stack->push<real>(M); return;} } -#line 1784 "runarray.in" +#line 1770 "runarray.in" // triple minbezier(triplearray2 *P, triple b); -void gen_runarray74(stack *Stack) +void gen_runarray72(stack *Stack) { triple b=vm::pop<triple>(Stack); triplearray2 * P=vm::pop<triplearray2 *>(Stack); -#line 1785 "runarray.in" +#line 1771 "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)), @@ -2160,13 +2137,13 @@ void gen_runarray74(stack *Stack) {Stack->push<triple>(b); return;} } -#line 1794 "runarray.in" +#line 1780 "runarray.in" // triple maxbezier(triplearray2 *P, triple b); -void gen_runarray75(stack *Stack) +void gen_runarray73(stack *Stack) { triple b=vm::pop<triple>(Stack); triplearray2 * P=vm::pop<triplearray2 *>(Stack); -#line 1795 "runarray.in" +#line 1781 "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)), @@ -2175,13 +2152,13 @@ void gen_runarray75(stack *Stack) {Stack->push<triple>(b); return;} } -#line 1804 "runarray.in" +#line 1790 "runarray.in" // pair minratio(triplearray2 *P, pair b); -void gen_runarray76(stack *Stack) +void gen_runarray74(stack *Stack) { pair b=vm::pop<pair>(Stack); triplearray2 * P=vm::pop<triplearray2 *>(Stack); -#line 1805 "runarray.in" +#line 1791 "runarray.in" triple *A; copyArray2C(A,P,true,4); real fuzz=sqrtFuzz*norm(A,16); @@ -2191,13 +2168,13 @@ void gen_runarray76(stack *Stack) {Stack->push<pair>(b); return;} } -#line 1815 "runarray.in" +#line 1801 "runarray.in" // pair maxratio(triplearray2 *P, pair b); -void gen_runarray77(stack *Stack) +void gen_runarray75(stack *Stack) { pair b=vm::pop<pair>(Stack); triplearray2 * P=vm::pop<triplearray2 *>(Stack); -#line 1816 "runarray.in" +#line 1802 "runarray.in" triple *A; copyArray2C(A,P,true,4); real fuzz=sqrtFuzz*norm(A,16); @@ -2207,11 +2184,11 @@ void gen_runarray77(stack *Stack) {Stack->push<pair>(b); return;} } -#line 1826 "runarray.in" +#line 1812 "runarray.in" // realarray* _projection(); -void gen_runarray78(stack *Stack) +void gen_runarray76(stack *Stack) { -#line 1827 "runarray.in" +#line 1813 "runarray.in" #ifdef HAVE_GL array *a=new array(14); gl::projection P=gl::camera(); @@ -2248,164 +2225,160 @@ namespace trans { void gen_runarray_venv(venv &ve) { -#line 450 "runarray.in" +#line 445 "runarray.in" REGISTER_BLTIN(run::emptyArray,"emptyArray"); -#line 456 "runarray.in" +#line 451 "runarray.in" REGISTER_BLTIN(run::newDeepArray,"newDeepArray"); -#line 478 "runarray.in" +#line 473 "runarray.in" REGISTER_BLTIN(run::newInitializedArray,"newInitializedArray"); -#line 493 "runarray.in" +#line 488 "runarray.in" REGISTER_BLTIN(run::newAppendedArray,"newAppendedArray"); -#line 509 "runarray.in" - REGISTER_BLTIN(run::copyArray0,"copyArray0"); +#line 504 "runarray.in" + REGISTER_BLTIN(run::copyArray,"copyArray"); #line 516 "runarray.in" - REGISTER_BLTIN(run::copyArray1,"copyArray1"); -#line 523 "runarray.in" - REGISTER_BLTIN(run::copyArray2,"copyArray2"); -#line 530 "runarray.in" REGISTER_BLTIN(run::arrayRead,"arrayRead"); -#line 542 "runarray.in" +#line 528 "runarray.in" REGISTER_BLTIN(run::arraySliceRead,"arraySliceRead"); -#line 549 "runarray.in" +#line 535 "runarray.in" REGISTER_BLTIN(run::arraySliceReadToEnd,"arraySliceReadToEnd"); -#line 557 "runarray.in" +#line 543 "runarray.in" REGISTER_BLTIN(run::arrayArrayRead,"arrayArrayRead"); -#line 566 "runarray.in" +#line 552 "runarray.in" REGISTER_BLTIN(run::arrayWrite,"arrayWrite"); -#line 583 "runarray.in" +#line 569 "runarray.in" REGISTER_BLTIN(run::arraySliceWrite,"arraySliceWrite"); -#line 591 "runarray.in" +#line 577 "runarray.in" REGISTER_BLTIN(run::arraySliceWriteToEnd,"arraySliceWriteToEnd"); -#line 599 "runarray.in" +#line 585 "runarray.in" REGISTER_BLTIN(run::arrayLength,"arrayLength"); -#line 605 "runarray.in" +#line 591 "runarray.in" REGISTER_BLTIN(run::arrayKeys,"arrayKeys"); -#line 620 "runarray.in" +#line 606 "runarray.in" REGISTER_BLTIN(run::arrayCyclicFlag,"arrayCyclicFlag"); -#line 627 "runarray.in" +#line 613 "runarray.in" REGISTER_BLTIN(run::arraySetCyclicFlag,"arraySetCyclicFlag"); -#line 634 "runarray.in" +#line 620 "runarray.in" REGISTER_BLTIN(run::arrayInitializedHelper,"arrayInitializedHelper"); -#line 645 "runarray.in" +#line 631 "runarray.in" REGISTER_BLTIN(run::arrayInitialized,"arrayInitialized"); -#line 651 "runarray.in" +#line 637 "runarray.in" REGISTER_BLTIN(run::arrayCyclicHelper,"arrayCyclicHelper"); -#line 658 "runarray.in" +#line 644 "runarray.in" REGISTER_BLTIN(run::arrayCyclic,"arrayCyclic"); -#line 664 "runarray.in" +#line 650 "runarray.in" REGISTER_BLTIN(run::arrayPushHelper,"arrayPushHelper"); -#line 672 "runarray.in" +#line 658 "runarray.in" REGISTER_BLTIN(run::arrayPush,"arrayPush"); -#line 678 "runarray.in" +#line 664 "runarray.in" REGISTER_BLTIN(run::arrayAppendHelper,"arrayAppendHelper"); -#line 687 "runarray.in" +#line 673 "runarray.in" REGISTER_BLTIN(run::arrayAppend,"arrayAppend"); -#line 693 "runarray.in" +#line 679 "runarray.in" REGISTER_BLTIN(run::arrayPopHelper,"arrayPopHelper"); -#line 702 "runarray.in" +#line 688 "runarray.in" REGISTER_BLTIN(run::arrayPop,"arrayPop"); -#line 708 "runarray.in" +#line 694 "runarray.in" REGISTER_BLTIN(run::arrayInsertHelper,"arrayInsertHelper"); -#line 719 "runarray.in" +#line 705 "runarray.in" REGISTER_BLTIN(run::arrayInsert,"arrayInsert"); -#line 725 "runarray.in" +#line 711 "runarray.in" REGISTER_BLTIN(run::arrayDelete,"arrayDelete"); -#line 731 "runarray.in" +#line 717 "runarray.in" REGISTER_BLTIN(run::arrayAlias,"arrayAlias"); -#line 736 "runarray.in" +#line 722 "runarray.in" REGISTER_BLTIN(run::arrayIntArray,"arrayIntArray"); -#line 754 "runarray.in" - addFunc(ve, run::gen_runarray33, IntArray(), SYM(complement), formal(IntArray(), SYM(a), false, false), formal(primInt(), SYM(n), false, false)); -#line 773 "runarray.in" +#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" REGISTER_BLTIN(run::arraySequence,"arraySequence"); -#line 786 "runarray.in" - addFunc(ve, run::gen_runarray35, IntArray(), SYM(sequence), formal(primInt(), SYM(n), false, false)); -#line 797 "runarray.in" +#line 772 "runarray.in" + addFunc(ve, run::gen_runarray33, IntArray(), SYM(sequence), formal(primInt(), SYM(n), false, false)); +#line 783 "runarray.in" REGISTER_BLTIN(run::arrayFunction,"arrayFunction"); -#line 810 "runarray.in" +#line 796 "runarray.in" REGISTER_BLTIN(run::arraySort,"arraySort"); -#line 819 "runarray.in" +#line 805 "runarray.in" REGISTER_BLTIN(run::arraySearch,"arraySearch"); -#line 838 "runarray.in" - addFunc(ve, run::gen_runarray39, primBoolean(), SYM(all), formal(booleanArray(), SYM(a), false, false)); -#line 847 "runarray.in" - addFunc(ve, run::gen_runarray40, booleanArray(), SYM_LOGNOT, formal(booleanArray(), SYM(a), false, false)); -#line 856 "runarray.in" - addFunc(ve, run::gen_runarray41, primInt(), SYM(sum), formal(booleanArray(), SYM(a), false, false)); -#line 865 "runarray.in" +#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 870 "runarray.in" +#line 856 "runarray.in" REGISTER_BLTIN(run::arrayConcat,"arrayConcat"); -#line 898 "runarray.in" +#line 884 "runarray.in" REGISTER_BLTIN(run::array2Copy,"array2Copy"); -#line 903 "runarray.in" +#line 889 "runarray.in" REGISTER_BLTIN(run::array3Copy,"array3Copy"); -#line 908 "runarray.in" +#line 894 "runarray.in" REGISTER_BLTIN(run::array2Transpose,"array2Transpose"); -#line 932 "runarray.in" +#line 918 "runarray.in" REGISTER_BLTIN(run::array3Transpose,"array3Transpose"); -#line 1019 "runarray.in" - addFunc(ve, run::gen_runarray48, primInt(), SYM(find), formal(booleanArray(), SYM(a), false, false), formal(primInt(), SYM(n), true, false)); -#line 1038 "runarray.in" +#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" REGISTER_BLTIN(run::arrayConditional,"arrayConditional"); -#line 1064 "runarray.in" - addFunc(ve, run::gen_runarray50, realArray2(), SYM(identity), formal(primInt(), SYM(n), false, false)); -#line 1070 "runarray.in" - addFunc(ve, run::gen_runarray51, realArray2(), SYM(inverse), formal(realArray2(), SYM(a), false, false)); -#line 1162 "runarray.in" - addFunc(ve, run::gen_runarray52, realArray(), SYM(solve), formal(realArray2(), SYM(a), false, false), formal(realArray(), SYM(b), false, false), formal(primBoolean(), SYM(warn), true, false)); -#line 1215 "runarray.in" - addFunc(ve, run::gen_runarray53, realArray2(), SYM(solve), formal(realArray2(), SYM(a), false, false), formal(realArray2(), SYM(b), false, false), formal(primBoolean(), SYM(warn), true, false)); -#line 1280 "runarray.in" - addFunc(ve, run::gen_runarray54, primReal(), SYM(determinant), formal(realArray2(), SYM(a), false, false)); -#line 1297 "runarray.in" - addFunc(ve, run::gen_runarray55, realArray(), SYM_TIMES, formal(realArray2(), SYM(a), false, false), formal(realArray(), SYM(b), false, false)); -#line 1316 "runarray.in" - addFunc(ve, run::gen_runarray56, realArray(), SYM_TIMES, formal(realArray(), SYM(a), false, false), formal(realArray2(), SYM(b), false, false)); -#line 1345 "runarray.in" - addFunc(ve, run::gen_runarray57, IntArray2(), SYM_TIMES, formal(IntArray2(), SYM(a), false, false), formal(IntArray2(), SYM(b), false, false)); -#line 1350 "runarray.in" - addFunc(ve, run::gen_runarray58, realArray2(), SYM_TIMES, formal(realArray2(), SYM(a), false, false), formal(realArray2(), SYM(b), false, false)); -#line 1355 "runarray.in" - addFunc(ve, run::gen_runarray59, pairArray2(), SYM_TIMES, formal(pairArray2(), SYM(a), false, false), formal(pairArray2(), SYM(b), false, false)); -#line 1360 "runarray.in" - addFunc(ve, run::gen_runarray60, primTriple(), SYM_TIMES, formal(realArray2(), SYM(t), false, false), formal(primTriple(), SYM(v), false, false)); -#line 1365 "runarray.in" - addFunc(ve, run::gen_runarray61, primPair(), SYM(project), formal(primTriple(), SYM(v), false, false), formal(realArray2(), SYM(t), false, false)); -#line 1390 "runarray.in" - addFunc(ve, run::gen_runarray62, primReal(), SYM(dot), formal(realArray(), SYM(a), false, false), formal(realArray(), SYM(b), false, false)); -#line 1400 "runarray.in" - addFunc(ve, run::gen_runarray63, primPair(), SYM(dot), formal(pairArray(), SYM(a), false, false), formal(pairArray(), SYM(b), false, false)); -#line 1410 "runarray.in" - addFunc(ve, run::gen_runarray64, 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 1514 "runarray.in" - addFunc(ve, run::gen_runarray65, 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 1561 "runarray.in" - addFunc(ve, run::gen_runarray66, 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 1643 "runarray.in" - addFunc(ve, run::gen_runarray67, 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 1655 "runarray.in" - addFunc(ve, run::gen_runarray68, pairArray(), SYM(fft), formal(pairArray(), SYM(a), false, false), formal(primInt(), SYM(sign), true, false)); -#line 1686 "runarray.in" - addFunc(ve, run::gen_runarray69, IntArray2(), SYM(triangulate), formal(pairArray(), SYM(z), false, false)); -#line 1721 "runarray.in" - addFunc(ve, run::gen_runarray70, primReal(), SYM(norm), formal(realArray(), SYM(a), false, false)); -#line 1732 "runarray.in" - addFunc(ve, run::gen_runarray71, primReal(), SYM(norm), formal(realArray2(), SYM(a), false, false)); -#line 1747 "runarray.in" - addFunc(ve, run::gen_runarray72, primReal(), SYM(norm), formal(tripleArray2(), SYM(a), false, false)); -#line 1762 "runarray.in" - addFunc(ve, run::gen_runarray73, primReal(), SYM(change2), formal(tripleArray2(), SYM(a), false, false)); -#line 1784 "runarray.in" - addFunc(ve, run::gen_runarray74, primTriple(), SYM(minbezier), formal(tripleArray2(), SYM(p), false, false), formal(primTriple(), SYM(b), false, false)); -#line 1794 "runarray.in" - addFunc(ve, run::gen_runarray75, primTriple(), SYM(maxbezier), formal(tripleArray2(), SYM(p), false, false), formal(primTriple(), SYM(b), false, false)); -#line 1804 "runarray.in" - addFunc(ve, run::gen_runarray76, primPair(), SYM(minratio), formal(tripleArray2(), SYM(p), false, false), formal(primPair(), SYM(b), false, false)); -#line 1815 "runarray.in" - addFunc(ve, run::gen_runarray77, primPair(), SYM(maxratio), formal(tripleArray2(), SYM(p), false, false), formal(primPair(), SYM(b), false, false)); -#line 1826 "runarray.in" - addFunc(ve, run::gen_runarray78, realArray(), SYM(_projection)); +#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 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)); } } // namespace trans |