diff options
Diffstat (limited to 'Build/source/utils/asymptote/runarray.cc')
-rw-r--r-- | Build/source/utils/asymptote/runarray.cc | 640 |
1 files changed, 336 insertions, 304 deletions
diff --git a/Build/source/utils/asymptote/runarray.cc b/Build/source/utils/asymptote/runarray.cc index 0ae52bcf918..5ba123e8616 100644 --- a/Build/source/utils/asymptote/runarray.cc +++ b/Build/source/utils/asymptote/runarray.cc @@ -362,7 +362,7 @@ array *mult(array *a, array *b) array *ci=new array(nb0); (*c)[i]=ci; for(size_t j=0; j < nb0; ++j) { - T sum=0.0; + T sum=T(); size_t kj=j; for(size_t k=0; k < nb; ++k, kj += nb0) sum += Ai[k]*B[kj]; @@ -523,6 +523,13 @@ void integeroverflow(size_t i) buf << "Integer overflow"; 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: @@ -533,10 +540,10 @@ void integeroverflow(size_t i) namespace run { // Create an empty array. -#line 444 "runarray.in" +#line 451 "runarray.in" void emptyArray(stack *Stack) { -#line 445 "runarray.in" +#line 452 "runarray.in" {Stack->push<array*>(new array(0)); return;} } @@ -545,11 +552,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 454 "runarray.in" +#line 461 "runarray.in" void newDeepArray(stack *Stack) { Int depth=vm::pop<Int>(Stack); -#line 455 "runarray.in" +#line 462 "runarray.in" assert(depth > 0); Int *dims = new Int[depth]; @@ -568,11 +575,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 474 "runarray.in" +#line 481 "runarray.in" void newInitializedArray(stack *Stack) { Int n=vm::pop<Int>(Stack); -#line 475 "runarray.in" +#line 482 "runarray.in" assert(n >= 0); array *a = new array(n); @@ -585,12 +592,12 @@ void newInitializedArray(stack *Stack) // Similar to newInitializedArray, but after the n elements, append another // array to it. -#line 488 "runarray.in" +#line 495 "runarray.in" void newAppendedArray(stack *Stack) { Int n=vm::pop<Int>(Stack); array* tail=vm::pop<array*>(Stack); -#line 489 "runarray.in" +#line 496 "runarray.in" assert(n >= 0); array *a = new array(n); @@ -603,28 +610,49 @@ void newAppendedArray(stack *Stack) {Stack->push<array*>(a); return;} } -// The function T[] array(int n, T value, int depth=0) produces a array of n -// copies of x, where each copy is copied up to depth. -#line 504 "runarray.in" -void newDuplicateArray(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 505 "runarray.in" - if(n < 0) error("cannot create a negative length array"); - if(depth < 0) error("cannot copy to a negative depth"); +#line 511 "runarray.in" + checkSize(n,depth); + {Stack->push<array*>(new array((size_t) n, value, (size_t) 0)); return;} +} - {Stack->push<array*>(new array(n, value, depth)); 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) +{ + 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;} } // Read an element from an array. Checks for initialization & bounds. -#line 513 "runarray.in" +#line 531 "runarray.in" void arrayRead(stack *Stack) { Int n=vm::pop<Int>(Stack); array * a=vm::pop<array *>(Stack); -#line 514 "runarray.in" +#line 532 "runarray.in" item& i=arrayRead(a,n); if (i.empty()) { ostringstream buf; @@ -635,50 +663,50 @@ void arrayRead(stack *Stack) } // Slice a substring from an array. -#line 525 "runarray.in" +#line 543 "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 526 "runarray.in" +#line 544 "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 533 "runarray.in" +#line 551 "runarray.in" void arraySliceReadToEnd(stack *Stack) { Int left=vm::pop<Int>(Stack); array * a=vm::pop<array *>(Stack); -#line 534 "runarray.in" +#line 552 "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 541 "runarray.in" +#line 559 "runarray.in" void arrayArrayRead(stack *Stack) { Int n=vm::pop<Int>(Stack); array * a=vm::pop<array *>(Stack); -#line 542 "runarray.in" +#line 560 "runarray.in" item& i=arrayRead(a,n); if (i.empty()) i=new array(0); {Stack->push(i); return;} } // Write an element to an array. Increase size if necessary. -#line 549 "runarray.in" +#line 567 "runarray.in" void arrayWrite(stack *Stack) { Int n=vm::pop<Int>(Stack); array * a=vm::pop<array *>(Stack); item value=vm::pop(Stack); -#line 550 "runarray.in" +#line 568 "runarray.in" size_t len=checkArray(a); bool cyclic=a->cyclic(); if(cyclic && len > 0) n=imod(n,len); @@ -692,27 +720,27 @@ void arrayWrite(stack *Stack) {Stack->push(value); return;} } -#line 564 "runarray.in" +#line 582 "runarray.in" void arraySliceWrite(stack *Stack) { Int right=vm::pop<Int>(Stack); Int left=vm::pop<Int>(Stack); array * dest=vm::pop<array *>(Stack); array * src=vm::pop<array *>(Stack); -#line 565 "runarray.in" +#line 583 "runarray.in" checkArray(src); checkArray(dest); dest->setSlice(left, right, src); {Stack->push<array*>(src); return;} } -#line 572 "runarray.in" +#line 590 "runarray.in" void arraySliceWriteToEnd(stack *Stack) { Int left=vm::pop<Int>(Stack); array * dest=vm::pop<array *>(Stack); array * src=vm::pop<array *>(Stack); -#line 573 "runarray.in" +#line 591 "runarray.in" checkArray(src); size_t len=checkArray(dest); dest->setSlice(left, (Int) len, src); @@ -720,20 +748,20 @@ void arraySliceWriteToEnd(stack *Stack) } // Returns the length of an array. -#line 581 "runarray.in" +#line 599 "runarray.in" void arrayLength(stack *Stack) { array * a=vm::pop<array *>(Stack); -#line 582 "runarray.in" +#line 600 "runarray.in" {Stack->push<Int>((Int) checkArray(a)); return;} } // Returns an array of integers representing the keys of the array. -#line 587 "runarray.in" +#line 605 "runarray.in" void arrayKeys(stack *Stack) { array * a=vm::pop<array *>(Stack); -#line 588 "runarray.in" +#line 606 "runarray.in" size_t size=checkArray(a); array *keys=new array(); @@ -747,33 +775,33 @@ void arrayKeys(stack *Stack) } // Return the cyclic flag for an array. -#line 602 "runarray.in" +#line 620 "runarray.in" void arrayCyclicFlag(stack *Stack) { array * a=vm::pop<array *>(Stack); -#line 603 "runarray.in" +#line 621 "runarray.in" checkArray(a); {Stack->push<bool>(a->cyclic()); return;} } -#line 608 "runarray.in" +#line 626 "runarray.in" void arraySetCyclicFlag(stack *Stack) { array * a=vm::pop<array *>(Stack); bool b=vm::pop<bool>(Stack); -#line 609 "runarray.in" +#line 627 "runarray.in" checkArray(a); a->cyclic(b); {Stack->push<bool>(b); return;} } // Check to see if an array element is initialized. -#line 616 "runarray.in" +#line 634 "runarray.in" void arrayInitializedHelper(stack *Stack) { array * a=vm::pop<array *>(Stack); Int n=vm::pop<Int>(Stack); -#line 617 "runarray.in" +#line 635 "runarray.in" size_t len=checkArray(a); bool cyclic=a->cyclic(); if(cyclic && len > 0) n=imod(n,len); @@ -783,62 +811,62 @@ void arrayInitializedHelper(stack *Stack) } // Returns the initialize method for an array. -#line 627 "runarray.in" +#line 645 "runarray.in" void arrayInitialized(stack *Stack) { array * a=vm::pop<array *>(Stack); -#line 628 "runarray.in" +#line 646 "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 633 "runarray.in" +#line 651 "runarray.in" void arrayCyclicHelper(stack *Stack) { array * a=vm::pop<array *>(Stack); bool b=vm::pop<bool>(Stack); -#line 634 "runarray.in" +#line 652 "runarray.in" checkArray(a); a->cyclic(b); } // Set the cyclic flag for an array. -#line 640 "runarray.in" +#line 658 "runarray.in" void arrayCyclic(stack *Stack) { array * a=vm::pop<array *>(Stack); -#line 641 "runarray.in" +#line 659 "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 646 "runarray.in" +#line 664 "runarray.in" void arrayPushHelper(stack *Stack) { array * a=vm::pop<array *>(Stack); item x=vm::pop(Stack); -#line 647 "runarray.in" +#line 665 "runarray.in" checkArray(a); a->push(x); {Stack->push(x); return;} } // Returns the push method for an array. -#line 654 "runarray.in" +#line 672 "runarray.in" void arrayPush(stack *Stack) { array * a=vm::pop<array *>(Stack); -#line 655 "runarray.in" +#line 673 "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 660 "runarray.in" +#line 678 "runarray.in" void arrayAppendHelper(stack *Stack) { array * a=vm::pop<array *>(Stack); array * b=vm::pop<array *>(Stack); -#line 661 "runarray.in" +#line 679 "runarray.in" checkArray(a); size_t size=checkArray(b); for(size_t i=0; i < size; i++) @@ -846,20 +874,20 @@ void arrayAppendHelper(stack *Stack) } // Returns the append method for an array. -#line 669 "runarray.in" +#line 687 "runarray.in" void arrayAppend(stack *Stack) { array * a=vm::pop<array *>(Stack); -#line 670 "runarray.in" +#line 688 "runarray.in" {Stack->push<callable*>(new thunk(new bfunc(arrayAppendHelper),a)); return;} } // The helper function for the pop method. -#line 675 "runarray.in" +#line 693 "runarray.in" void arrayPopHelper(stack *Stack) { array * a=vm::pop<array *>(Stack); -#line 676 "runarray.in" +#line 694 "runarray.in" size_t asize=checkArray(a); if(asize == 0) error("cannot pop element from empty array"); @@ -867,22 +895,22 @@ void arrayPopHelper(stack *Stack) } // Returns the pop method for an array. -#line 684 "runarray.in" +#line 702 "runarray.in" void arrayPop(stack *Stack) { array * a=vm::pop<array *>(Stack); -#line 685 "runarray.in" +#line 703 "runarray.in" {Stack->push<callable*>(new thunk(new bfunc(arrayPopHelper),a)); return;} } // The helper function for the insert method. -#line 690 "runarray.in" +#line 708 "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 691 "runarray.in" +#line 709 "runarray.in" size_t asize=checkArray(a); checkArray(x); if(a->cyclic() && asize > 0) i=imod(i,asize); @@ -892,39 +920,39 @@ void arrayInsertHelper(stack *Stack) } // Returns the insert method for an array. -#line 701 "runarray.in" +#line 719 "runarray.in" void arrayInsert(stack *Stack) { array * a=vm::pop<array *>(Stack); -#line 702 "runarray.in" +#line 720 "runarray.in" {Stack->push<callable*>(new thunk(new bfunc(arrayInsertHelper),a)); return;} } // Returns the delete method for an array. -#line 707 "runarray.in" +#line 725 "runarray.in" void arrayDelete(stack *Stack) { array * a=vm::pop<array *>(Stack); -#line 708 "runarray.in" +#line 726 "runarray.in" {Stack->push<callable*>(new thunk(new bfunc(arrayDeleteHelper),a)); return;} } -#line 712 "runarray.in" +#line 730 "runarray.in" void arrayAlias(stack *Stack) { array * b=vm::pop<array *>(Stack); array * a=vm::pop<array *>(Stack); -#line 713 "runarray.in" +#line 731 "runarray.in" {Stack->push<bool>(a==b); return;} } // Return array formed by indexing array a with elements of integer array b -#line 718 "runarray.in" +#line 736 "runarray.in" void arrayIntArray(stack *Stack) { array * b=vm::pop<array *>(Stack); array * a=vm::pop<array *>(Stack); -#line 719 "runarray.in" +#line 737 "runarray.in" size_t asize=checkArray(a); size_t bsize=checkArray(b); array *r=new array(bsize); @@ -942,13 +970,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 737 "runarray.in" +#line 755 "runarray.in" // Intarray* complement(Intarray *a, Int n); -void gen_runarray31(stack *Stack) +void gen_runarray33(stack *Stack) { Int n=vm::pop<Int>(Stack); Intarray * a=vm::pop<Intarray *>(Stack); -#line 738 "runarray.in" +#line 756 "runarray.in" size_t asize=checkArray(a); array *r=new array(0); bool *keep=new bool[n]; @@ -965,12 +993,12 @@ void gen_runarray31(stack *Stack) } // Generate the sequence {f(i) : i=0,1,...n-1} given a function f and integer n -#line 755 "runarray.in" +#line 773 "runarray.in" void arraySequence(stack *Stack) { Int n=vm::pop<Int>(Stack); callable * f=vm::pop<callable *>(Stack); -#line 756 "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 +1010,12 @@ void arraySequence(stack *Stack) } // Return the array {0,1,...n-1} -#line 768 "runarray.in" +#line 786 "runarray.in" // Intarray* sequence(Int n); -void gen_runarray33(stack *Stack) +void gen_runarray35(stack *Stack) { Int n=vm::pop<Int>(Stack); -#line 769 "runarray.in" +#line 787 "runarray.in" if(n < 0) n=0; array *a=new array(n); for(Int i=0; i < n; ++i) { @@ -997,12 +1025,12 @@ void gen_runarray33(stack *Stack) } // Apply a function to each element of an array -#line 779 "runarray.in" +#line 797 "runarray.in" void arrayFunction(stack *Stack) { array * a=vm::pop<array *>(Stack); callable * f=vm::pop<callable *>(Stack); -#line 780 "runarray.in" +#line 798 "runarray.in" size_t size=checkArray(a); array *b=new array(size); for(size_t i=0; i < size; ++i) { @@ -1013,12 +1041,12 @@ void arrayFunction(stack *Stack) {Stack->push<array*>(b); return;} } -#line 791 "runarray.in" +#line 809 "runarray.in" void arraySort(stack *Stack) { callable * f=vm::pop<callable *>(Stack); array * a=vm::pop<array *>(Stack); -#line 792 "runarray.in" +#line 810 "runarray.in" array *c=copyArray(a); compareFunc=f; FuncStack=Stack; @@ -1026,12 +1054,12 @@ void arraySort(stack *Stack) {Stack->push<array*>(c); return;} } -#line 800 "runarray.in" +#line 818 "runarray.in" // bool all(boolarray *a); -void gen_runarray36(stack *Stack) +void gen_runarray38(stack *Stack) { boolarray * a=vm::pop<boolarray *>(Stack); -#line 801 "runarray.in" +#line 819 "runarray.in" size_t size=checkArray(a); bool c=true; for(size_t i=0; i < size; i++) @@ -1039,12 +1067,12 @@ void gen_runarray36(stack *Stack) {Stack->push<bool>(c); return;} } -#line 809 "runarray.in" +#line 827 "runarray.in" // boolarray* !(boolarray* a); -void gen_runarray37(stack *Stack) +void gen_runarray39(stack *Stack) { boolarray* a=vm::pop<boolarray*>(Stack); -#line 810 "runarray.in" +#line 828 "runarray.in" size_t size=checkArray(a); array *c=new array(size); for(size_t i=0; i < size; i++) @@ -1052,12 +1080,12 @@ void gen_runarray37(stack *Stack) {Stack->push<boolarray*>(c); return;} } -#line 818 "runarray.in" +#line 836 "runarray.in" // Int sum(boolarray *a); -void gen_runarray38(stack *Stack) +void gen_runarray40(stack *Stack) { boolarray * a=vm::pop<boolarray *>(Stack); -#line 819 "runarray.in" +#line 837 "runarray.in" size_t size=checkArray(a); Int sum=0; for(size_t i=0; i < size; i++) @@ -1065,19 +1093,19 @@ void gen_runarray38(stack *Stack) {Stack->push<Int>(sum); return;} } -#line 827 "runarray.in" +#line 845 "runarray.in" void arrayCopy(stack *Stack) { array * a=vm::pop<array *>(Stack); -#line 828 "runarray.in" +#line 846 "runarray.in" {Stack->push<array*>(copyArray(a)); return;} } -#line 832 "runarray.in" +#line 850 "runarray.in" void arrayConcat(stack *Stack) { array * a=vm::pop<array *>(Stack); -#line 833 "runarray.in" +#line 851 "runarray.in" // a is an array of arrays to be concatenated together. // The signature is // T[] concat(... T[][] a); @@ -1104,27 +1132,27 @@ void arrayConcat(stack *Stack) {Stack->push<array*>(result); return;} } -#line 860 "runarray.in" +#line 878 "runarray.in" void array2Copy(stack *Stack) { array * a=vm::pop<array *>(Stack); -#line 861 "runarray.in" +#line 879 "runarray.in" {Stack->push<array*>(copyArray2(a)); return;} } -#line 865 "runarray.in" +#line 883 "runarray.in" void array3Copy(stack *Stack) { array * a=vm::pop<array *>(Stack); -#line 866 "runarray.in" +#line 884 "runarray.in" {Stack->push<array*>(copyArray3(a)); return;} } -#line 870 "runarray.in" +#line 888 "runarray.in" void array2Transpose(stack *Stack) { array * a=vm::pop<array *>(Stack); -#line 871 "runarray.in" +#line 889 "runarray.in" size_t asize=checkArray(a); array *c=new array(0); for(size_t i=0; i < asize; i++) { @@ -1151,12 +1179,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 898 "runarray.in" +#line 916 "runarray.in" void array3Transpose(stack *Stack) { array * perm=vm::pop<array *>(Stack); array * a=vm::pop<array *>(Stack); -#line 899 "runarray.in" +#line 917 "runarray.in" const size_t DIM=3; if(checkArray(perm) != DIM) { @@ -1240,13 +1268,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 983 "runarray.in" +#line 1001 "runarray.in" // Int find(boolarray *a, Int n=1); -void gen_runarray45(stack *Stack) +void gen_runarray47(stack *Stack) { Int n=vm::pop<Int>(Stack,1); boolarray * a=vm::pop<boolarray *>(Stack); -#line 984 "runarray.in" +#line 1002 "runarray.in" size_t size=checkArray(a); Int j=-1; if(n > 0) @@ -1264,13 +1292,13 @@ void gen_runarray45(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 1002 "runarray.in" +#line 1020 "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 1003 "runarray.in" +#line 1021 "runarray.in" size_t size=checkArray(a); array *r=new array(size); if(b && c) { @@ -1294,22 +1322,22 @@ void arrayConditional(stack *Stack) } // Return an n x n identity matrix. -#line 1027 "runarray.in" +#line 1045 "runarray.in" // realarray2* identity(Int n); -void gen_runarray47(stack *Stack) +void gen_runarray49(stack *Stack) { Int n=vm::pop<Int>(Stack); -#line 1028 "runarray.in" +#line 1046 "runarray.in" {Stack->push<realarray2*>(Identity(n)); return;} } // Return the inverse of an n x n matrix a using Gauss-Jordan elimination. -#line 1033 "runarray.in" +#line 1051 "runarray.in" // realarray2* inverse(realarray2 *a); -void gen_runarray48(stack *Stack) +void gen_runarray50(stack *Stack) { realarray2 * a=vm::pop<realarray2 *>(Stack); -#line 1034 "runarray.in" +#line 1052 "runarray.in" a=copyArray2(a); size_t n=checkArray(a); checkSquare(a); @@ -1402,14 +1430,14 @@ void gen_runarray48(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 1127 "runarray.in" +#line 1145 "runarray.in" // realarray* solve(realarray2 *a, realarray *b, bool warn=true); -void gen_runarray49(stack *Stack) +void gen_runarray51(stack *Stack) { bool warn=vm::pop<bool>(Stack,true); realarray * b=vm::pop<realarray *>(Stack); realarray2 * a=vm::pop<realarray2 *>(Stack); -#line 1128 "runarray.in" +#line 1146 "runarray.in" size_t n=checkArray(a); if(n == 0) {Stack->push<realarray*>(new array(0)); return;} @@ -1461,14 +1489,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 n x m matrix. // If no solution exists, return an empty array. -#line 1180 "runarray.in" +#line 1198 "runarray.in" // realarray2* solve(realarray2 *a, realarray2 *b, bool warn=true); -void gen_runarray50(stack *Stack) +void gen_runarray52(stack *Stack) { bool warn=vm::pop<bool>(Stack,true); realarray2 * b=vm::pop<realarray2 *>(Stack); realarray2 * a=vm::pop<realarray2 *>(Stack); -#line 1181 "runarray.in" +#line 1199 "runarray.in" size_t n=checkArray(a); if(n == 0) {Stack->push<realarray2*>(new array(0)); return;} @@ -1530,12 +1558,12 @@ void gen_runarray50(stack *Stack) } // Compute the determinant of an n x n matrix. -#line 1243 "runarray.in" +#line 1261 "runarray.in" // real determinant(realarray2 *a); -void gen_runarray51(stack *Stack) +void gen_runarray53(stack *Stack) { realarray2 * a=vm::pop<realarray2 *>(Stack); -#line 1244 "runarray.in" +#line 1262 "runarray.in" real *A; copyArray2C(A,a); size_t n=checkArray(a); @@ -1550,13 +1578,13 @@ void gen_runarray51(stack *Stack) {Stack->push<real>(det); return;} } -#line 1259 "runarray.in" +#line 1277 "runarray.in" // realarray* *(realarray2 *a, realarray *b); -void gen_runarray52(stack *Stack) +void gen_runarray54(stack *Stack) { realarray * b=vm::pop<realarray *>(Stack); realarray2 * a=vm::pop<realarray2 *>(Stack); -#line 1260 "runarray.in" +#line 1278 "runarray.in" size_t n=checkArray(a); size_t m=checkArray(b); array *c=new array(n); @@ -1574,13 +1602,13 @@ void gen_runarray52(stack *Stack) {Stack->push<realarray*>(c); return;} } -#line 1278 "runarray.in" +#line 1296 "runarray.in" // realarray* *(realarray *a, realarray2 *b); -void gen_runarray53(stack *Stack) +void gen_runarray55(stack *Stack) { realarray2 * b=vm::pop<realarray2 *>(Stack); realarray * a=vm::pop<realarray *>(Stack); -#line 1279 "runarray.in" +#line 1297 "runarray.in" size_t n=checkArray(a); if(n != checkArray(b)) error(incommensurate); real *A; @@ -1608,53 +1636,53 @@ void gen_runarray53(stack *Stack) {Stack->push<realarray*>(c); return;} } -#line 1307 "runarray.in" +#line 1325 "runarray.in" // Intarray2* *(Intarray2 *a, Intarray2 *b); -void gen_runarray54(stack *Stack) +void gen_runarray56(stack *Stack) { Intarray2 * b=vm::pop<Intarray2 *>(Stack); Intarray2 * a=vm::pop<Intarray2 *>(Stack); -#line 1308 "runarray.in" +#line 1326 "runarray.in" {Stack->push<Intarray2*>(mult<Int>(a,b)); return;} } -#line 1312 "runarray.in" +#line 1330 "runarray.in" // realarray2* *(realarray2 *a, realarray2 *b); -void gen_runarray55(stack *Stack) +void gen_runarray57(stack *Stack) { realarray2 * b=vm::pop<realarray2 *>(Stack); realarray2 * a=vm::pop<realarray2 *>(Stack); -#line 1313 "runarray.in" +#line 1331 "runarray.in" {Stack->push<realarray2*>(mult<real>(a,b)); return;} } -#line 1317 "runarray.in" +#line 1335 "runarray.in" // pairarray2* *(pairarray2 *a, pairarray2 *b); -void gen_runarray56(stack *Stack) +void gen_runarray58(stack *Stack) { pairarray2 * b=vm::pop<pairarray2 *>(Stack); pairarray2 * a=vm::pop<pairarray2 *>(Stack); -#line 1318 "runarray.in" +#line 1336 "runarray.in" {Stack->push<pairarray2*>(mult<pair>(a,b)); return;} } -#line 1322 "runarray.in" +#line 1340 "runarray.in" // triple *(realarray2 *t, triple v); -void gen_runarray57(stack *Stack) +void gen_runarray59(stack *Stack) { triple v=vm::pop<triple>(Stack); realarray2 * t=vm::pop<realarray2 *>(Stack); -#line 1323 "runarray.in" +#line 1341 "runarray.in" {Stack->push<triple>(*t*v); return;} } -#line 1327 "runarray.in" +#line 1345 "runarray.in" // pair project(triple v, realarray2 *t); -void gen_runarray58(stack *Stack) +void gen_runarray60(stack *Stack) { realarray2 * t=vm::pop<realarray2 *>(Stack); triple v=vm::pop<triple>(Stack); -#line 1328 "runarray.in" +#line 1346 "runarray.in" size_t n=checkArray(t); if(n != 4) error(incommensurate); array *t0=read<array*>(t,0); @@ -1679,13 +1707,13 @@ void gen_runarray58(stack *Stack) } // Compute the dot product of vectors a and b. -#line 1353 "runarray.in" +#line 1371 "runarray.in" // real dot(realarray *a, realarray *b); -void gen_runarray59(stack *Stack) +void gen_runarray61(stack *Stack) { realarray * b=vm::pop<realarray *>(Stack); realarray * a=vm::pop<realarray *>(Stack); -#line 1354 "runarray.in" +#line 1372 "runarray.in" size_t n=checkArrays(a,b); real sum=0.0; for(size_t i=0; i < n; ++i) @@ -1694,13 +1722,13 @@ void gen_runarray59(stack *Stack) } // Compute the complex dot product of vectors a and b. -#line 1363 "runarray.in" +#line 1381 "runarray.in" // pair dot(pairarray *a, pairarray *b); -void gen_runarray60(stack *Stack) +void gen_runarray62(stack *Stack) { pairarray * b=vm::pop<pairarray *>(Stack); pairarray * a=vm::pop<pairarray *>(Stack); -#line 1364 "runarray.in" +#line 1382 "runarray.in" size_t n=checkArrays(a,b); pair sum=zero; for(size_t i=0; i < n; ++i) @@ -1715,15 +1743,15 @@ void gen_runarray60(stack *Stack) // [ a[2] b[2] c[2] ] // [ ... ] // [ c[n-1] a[n-1] b[n-1] ] -#line 1379 "runarray.in" +#line 1397 "runarray.in" // realarray* tridiagonal(realarray *a, realarray *b, realarray *c, realarray *f); -void gen_runarray61(stack *Stack) +void gen_runarray63(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 1380 "runarray.in" +#line 1398 "runarray.in" size_t n=checkArrays(a,b); checkEqual(n,checkArray(c)); checkEqual(n,checkArray(f)); @@ -1820,16 +1848,16 @@ void gen_runarray61(stack *Stack) } // Root solve by Newton-Raphson -#line 1477 "runarray.in" +#line 1495 "runarray.in" // real newton(Int iterations=100, callableReal *f, callableReal *fprime, real x, bool verbose=false); -void gen_runarray62(stack *Stack) +void gen_runarray64(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 1479 "runarray.in" +#line 1497 "runarray.in" static const real fuzz=1000.0*DBL_EPSILON; Int i=0; size_t oldPrec=0; @@ -1875,9 +1903,9 @@ void gen_runarray62(stack *Stack) // Root solve by Newton-Raphson bisection // cf. routine rtsafe (Press et al., Numerical Recipes, 1991). -#line 1525 "runarray.in" +#line 1543 "runarray.in" // real newton(Int iterations=100, callableReal *f, callableReal *fprime, real x1, real x2, bool verbose=false); -void gen_runarray63(stack *Stack) +void gen_runarray65(stack *Stack) { bool verbose=vm::pop<bool>(Stack,false); real x2=vm::pop<real>(Stack); @@ -1885,7 +1913,7 @@ void gen_runarray63(stack *Stack) callableReal * fprime=vm::pop<callableReal *>(Stack); callableReal * f=vm::pop<callableReal *>(Stack); Int iterations=vm::pop<Int>(Stack,100); -#line 1527 "runarray.in" +#line 1545 "runarray.in" static const real fuzz=1000.0*DBL_EPSILON; size_t oldPrec=0; if(verbose) @@ -1963,16 +1991,16 @@ void gen_runarray63(stack *Stack) {Stack->push<real>((j == iterations) ? DBL_MAX : x); return;} } -#line 1605 "runarray.in" +#line 1623 "runarray.in" // real simpson(callableReal *f, real a, real b, real acc=DBL_EPSILON, real dxmax=0); -void gen_runarray64(stack *Stack) +void gen_runarray66(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 1607 "runarray.in" +#line 1625 "runarray.in" real integral; if(dxmax <= 0) dxmax=fabs(b-a); Func=f; @@ -1983,13 +2011,13 @@ void gen_runarray64(stack *Stack) } // Compute the fast Fourier transform of a pair array -#line 1618 "runarray.in" +#line 1636 "runarray.in" // pairarray* fft(pairarray *a, Int sign=1); -void gen_runarray65(stack *Stack) +void gen_runarray67(stack *Stack) { Int sign=vm::pop<Int>(Stack,1); pairarray * a=vm::pop<pairarray *>(Stack); -#line 1619 "runarray.in" +#line 1637 "runarray.in" unsigned n=(unsigned) checkArray(a); #ifdef HAVE_LIBFFTW3 array *c=new array(n); @@ -2018,12 +2046,12 @@ void gen_runarray65(stack *Stack) {Stack->push<pairarray*>(c); return;} } -#line 1648 "runarray.in" +#line 1666 "runarray.in" // Intarray2* triangulate(pairarray *z); -void gen_runarray66(stack *Stack) +void gen_runarray68(stack *Stack) { pairarray * z=vm::pop<pairarray *>(Stack); -#line 1649 "runarray.in" +#line 1667 "runarray.in" size_t nv=checkArray(z); // Call robust version of Gilles Dumoulin's port of Paul Bourke's // triangulation code. @@ -2057,12 +2085,12 @@ void gen_runarray66(stack *Stack) {Stack->push<Intarray2*>(t); return;} } -#line 1683 "runarray.in" +#line 1701 "runarray.in" // real norm(realarray *a); -void gen_runarray67(stack *Stack) +void gen_runarray69(stack *Stack) { realarray * a=vm::pop<realarray *>(Stack); -#line 1684 "runarray.in" +#line 1702 "runarray.in" size_t n=checkArray(a); real M=0.0; for(size_t i=0; i < n; ++i) { @@ -2072,12 +2100,12 @@ void gen_runarray67(stack *Stack) {Stack->push<real>(M); return;} } -#line 1694 "runarray.in" +#line 1712 "runarray.in" // real norm(realarray2 *a); -void gen_runarray68(stack *Stack) +void gen_runarray70(stack *Stack) { realarray2 * a=vm::pop<realarray2 *>(Stack); -#line 1695 "runarray.in" +#line 1713 "runarray.in" size_t n=checkArray(a); real M=0.0; for(size_t i=0; i < n; ++i) { @@ -2091,12 +2119,12 @@ void gen_runarray68(stack *Stack) {Stack->push<real>(M); return;} } -#line 1709 "runarray.in" +#line 1727 "runarray.in" // real norm(triplearray2 *a); -void gen_runarray69(stack *Stack) +void gen_runarray71(stack *Stack) { triplearray2 * a=vm::pop<triplearray2 *>(Stack); -#line 1710 "runarray.in" +#line 1728 "runarray.in" size_t n=checkArray(a); real M=0.0; for(size_t i=0; i < n; ++i) { @@ -2110,12 +2138,12 @@ void gen_runarray69(stack *Stack) {Stack->push<real>(sqrt(M)); return;} } -#line 1724 "runarray.in" +#line 1742 "runarray.in" // real change2(triplearray2 *a); -void gen_runarray70(stack *Stack) +void gen_runarray72(stack *Stack) { triplearray2 * a=vm::pop<triplearray2 *>(Stack); -#line 1725 "runarray.in" +#line 1743 "runarray.in" size_t n=checkArray(a); if(n == 0) {Stack->push<real>(0.0); return;} @@ -2136,13 +2164,13 @@ void gen_runarray70(stack *Stack) {Stack->push<real>(M); return;} } -#line 1746 "runarray.in" +#line 1764 "runarray.in" // triple minbezier(triplearray2 *P, triple b); -void gen_runarray71(stack *Stack) +void gen_runarray73(stack *Stack) { triple b=vm::pop<triple>(Stack); triplearray2 * P=vm::pop<triplearray2 *>(Stack); -#line 1747 "runarray.in" +#line 1765 "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)), @@ -2151,13 +2179,13 @@ void gen_runarray71(stack *Stack) {Stack->push<triple>(b); return;} } -#line 1756 "runarray.in" +#line 1774 "runarray.in" // triple maxbezier(triplearray2 *P, triple b); -void gen_runarray72(stack *Stack) +void gen_runarray74(stack *Stack) { triple b=vm::pop<triple>(Stack); triplearray2 * P=vm::pop<triplearray2 *>(Stack); -#line 1757 "runarray.in" +#line 1775 "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)), @@ -2166,13 +2194,13 @@ void gen_runarray72(stack *Stack) {Stack->push<triple>(b); return;} } -#line 1766 "runarray.in" +#line 1784 "runarray.in" // pair minratio(triplearray2 *P, pair b); -void gen_runarray73(stack *Stack) +void gen_runarray75(stack *Stack) { pair b=vm::pop<pair>(Stack); triplearray2 * P=vm::pop<triplearray2 *>(Stack); -#line 1767 "runarray.in" +#line 1785 "runarray.in" triple *A; copyArray2C(A,P,true,4); real fuzz=sqrtFuzz*norm(A,16); @@ -2182,13 +2210,13 @@ void gen_runarray73(stack *Stack) {Stack->push<pair>(b); return;} } -#line 1777 "runarray.in" +#line 1795 "runarray.in" // pair maxratio(triplearray2 *P, pair b); -void gen_runarray74(stack *Stack) +void gen_runarray76(stack *Stack) { pair b=vm::pop<pair>(Stack); triplearray2 * P=vm::pop<triplearray2 *>(Stack); -#line 1778 "runarray.in" +#line 1796 "runarray.in" triple *A; copyArray2C(A,P,true,4); real fuzz=sqrtFuzz*norm(A,16); @@ -2198,11 +2226,11 @@ void gen_runarray74(stack *Stack) {Stack->push<pair>(b); return;} } -#line 1788 "runarray.in" +#line 1806 "runarray.in" // realarray* _projection(); -void gen_runarray75(stack *Stack) +void gen_runarray77(stack *Stack) { -#line 1789 "runarray.in" +#line 1807 "runarray.in" #ifdef HAVE_GL array *a=new array(14); gl::projection P=gl::camera(); @@ -2239,158 +2267,162 @@ namespace trans { void gen_runarray_venv(venv &ve) { -#line 443 "runarray.in" +#line 450 "runarray.in" REGISTER_BLTIN(run::emptyArray,"emptyArray"); -#line 449 "runarray.in" +#line 456 "runarray.in" REGISTER_BLTIN(run::newDeepArray,"newDeepArray"); -#line 471 "runarray.in" +#line 478 "runarray.in" REGISTER_BLTIN(run::newInitializedArray,"newInitializedArray"); -#line 486 "runarray.in" +#line 493 "runarray.in" REGISTER_BLTIN(run::newAppendedArray,"newAppendedArray"); -#line 502 "runarray.in" - REGISTER_BLTIN(run::newDuplicateArray,"newDuplicateArray"); -#line 512 "runarray.in" +#line 509 "runarray.in" + REGISTER_BLTIN(run::copyArray0,"copyArray0"); +#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 524 "runarray.in" +#line 542 "runarray.in" REGISTER_BLTIN(run::arraySliceRead,"arraySliceRead"); -#line 531 "runarray.in" +#line 549 "runarray.in" REGISTER_BLTIN(run::arraySliceReadToEnd,"arraySliceReadToEnd"); -#line 539 "runarray.in" +#line 557 "runarray.in" REGISTER_BLTIN(run::arrayArrayRead,"arrayArrayRead"); -#line 548 "runarray.in" +#line 566 "runarray.in" REGISTER_BLTIN(run::arrayWrite,"arrayWrite"); -#line 564 "runarray.in" +#line 582 "runarray.in" REGISTER_BLTIN(run::arraySliceWrite,"arraySliceWrite"); -#line 572 "runarray.in" +#line 590 "runarray.in" REGISTER_BLTIN(run::arraySliceWriteToEnd,"arraySliceWriteToEnd"); -#line 580 "runarray.in" +#line 598 "runarray.in" REGISTER_BLTIN(run::arrayLength,"arrayLength"); -#line 586 "runarray.in" +#line 604 "runarray.in" REGISTER_BLTIN(run::arrayKeys,"arrayKeys"); -#line 601 "runarray.in" +#line 619 "runarray.in" REGISTER_BLTIN(run::arrayCyclicFlag,"arrayCyclicFlag"); -#line 608 "runarray.in" +#line 626 "runarray.in" REGISTER_BLTIN(run::arraySetCyclicFlag,"arraySetCyclicFlag"); -#line 615 "runarray.in" +#line 633 "runarray.in" REGISTER_BLTIN(run::arrayInitializedHelper,"arrayInitializedHelper"); -#line 626 "runarray.in" +#line 644 "runarray.in" REGISTER_BLTIN(run::arrayInitialized,"arrayInitialized"); -#line 632 "runarray.in" +#line 650 "runarray.in" REGISTER_BLTIN(run::arrayCyclicHelper,"arrayCyclicHelper"); -#line 639 "runarray.in" +#line 657 "runarray.in" REGISTER_BLTIN(run::arrayCyclic,"arrayCyclic"); -#line 645 "runarray.in" +#line 663 "runarray.in" REGISTER_BLTIN(run::arrayPushHelper,"arrayPushHelper"); -#line 653 "runarray.in" +#line 671 "runarray.in" REGISTER_BLTIN(run::arrayPush,"arrayPush"); -#line 659 "runarray.in" +#line 677 "runarray.in" REGISTER_BLTIN(run::arrayAppendHelper,"arrayAppendHelper"); -#line 668 "runarray.in" +#line 686 "runarray.in" REGISTER_BLTIN(run::arrayAppend,"arrayAppend"); -#line 674 "runarray.in" +#line 692 "runarray.in" REGISTER_BLTIN(run::arrayPopHelper,"arrayPopHelper"); -#line 683 "runarray.in" +#line 701 "runarray.in" REGISTER_BLTIN(run::arrayPop,"arrayPop"); -#line 689 "runarray.in" +#line 707 "runarray.in" REGISTER_BLTIN(run::arrayInsertHelper,"arrayInsertHelper"); -#line 700 "runarray.in" +#line 718 "runarray.in" REGISTER_BLTIN(run::arrayInsert,"arrayInsert"); -#line 706 "runarray.in" +#line 724 "runarray.in" REGISTER_BLTIN(run::arrayDelete,"arrayDelete"); -#line 712 "runarray.in" +#line 730 "runarray.in" REGISTER_BLTIN(run::arrayAlias,"arrayAlias"); -#line 717 "runarray.in" - REGISTER_BLTIN(run::arrayIntArray,"arrayIntArray"); #line 735 "runarray.in" - addFunc(ve, run::gen_runarray31, IntArray(), SYM(complement), formal(IntArray(), SYM(a), false, false), formal(primInt(), SYM(n), false, false)); -#line 754 "runarray.in" + REGISTER_BLTIN(run::arrayIntArray,"arrayIntArray"); +#line 753 "runarray.in" + addFunc(ve, run::gen_runarray33, IntArray(), SYM(complement), formal(IntArray(), SYM(a), false, false), formal(primInt(), SYM(n), false, false)); +#line 772 "runarray.in" REGISTER_BLTIN(run::arraySequence,"arraySequence"); -#line 767 "runarray.in" - addFunc(ve, run::gen_runarray33, IntArray(), SYM(sequence), formal(primInt(), SYM(n), false, false)); -#line 778 "runarray.in" +#line 785 "runarray.in" + addFunc(ve, run::gen_runarray35, IntArray(), SYM(sequence), formal(primInt(), SYM(n), false, false)); +#line 796 "runarray.in" REGISTER_BLTIN(run::arrayFunction,"arrayFunction"); -#line 791 "runarray.in" - REGISTER_BLTIN(run::arraySort,"arraySort"); -#line 800 "runarray.in" - addFunc(ve, run::gen_runarray36, primBoolean(), SYM(all), formal(booleanArray(), SYM(a), false, false)); #line 809 "runarray.in" - addFunc(ve, run::gen_runarray37, booleanArray(), SYM_LOGNOT, formal(booleanArray(), SYM(a), false, false)); + REGISTER_BLTIN(run::arraySort,"arraySort"); #line 818 "runarray.in" - addFunc(ve, run::gen_runarray38, primInt(), SYM(sum), formal(booleanArray(), SYM(a), false, false)); + addFunc(ve, run::gen_runarray38, primBoolean(), SYM(all), formal(booleanArray(), SYM(a), false, false)); #line 827 "runarray.in" + addFunc(ve, run::gen_runarray39, booleanArray(), SYM_LOGNOT, formal(booleanArray(), SYM(a), false, false)); +#line 836 "runarray.in" + addFunc(ve, run::gen_runarray40, primInt(), SYM(sum), formal(booleanArray(), SYM(a), false, false)); +#line 845 "runarray.in" REGISTER_BLTIN(run::arrayCopy,"arrayCopy"); -#line 832 "runarray.in" +#line 850 "runarray.in" REGISTER_BLTIN(run::arrayConcat,"arrayConcat"); -#line 860 "runarray.in" +#line 878 "runarray.in" REGISTER_BLTIN(run::array2Copy,"array2Copy"); -#line 865 "runarray.in" +#line 883 "runarray.in" REGISTER_BLTIN(run::array3Copy,"array3Copy"); -#line 870 "runarray.in" +#line 888 "runarray.in" REGISTER_BLTIN(run::array2Transpose,"array2Transpose"); -#line 894 "runarray.in" +#line 912 "runarray.in" REGISTER_BLTIN(run::array3Transpose,"array3Transpose"); -#line 981 "runarray.in" - addFunc(ve, run::gen_runarray45, primInt(), SYM(find), formal(booleanArray(), SYM(a), false, false), formal(primInt(), SYM(n), true, false)); -#line 1000 "runarray.in" +#line 999 "runarray.in" + addFunc(ve, run::gen_runarray47, primInt(), SYM(find), formal(booleanArray(), SYM(a), false, false), formal(primInt(), SYM(n), true, false)); +#line 1018 "runarray.in" REGISTER_BLTIN(run::arrayConditional,"arrayConditional"); -#line 1026 "runarray.in" - addFunc(ve, run::gen_runarray47, realArray2(), SYM(identity), formal(primInt(), SYM(n), false, false)); -#line 1032 "runarray.in" - addFunc(ve, run::gen_runarray48, realArray2(), SYM(inverse), formal(realArray2(), SYM(a), false, false)); -#line 1124 "runarray.in" - addFunc(ve, run::gen_runarray49, realArray(), SYM(solve), formal(realArray2(), SYM(a), false, false), formal(realArray(), SYM(b), false, false), formal(primBoolean(), SYM(warn), true, false)); -#line 1177 "runarray.in" - addFunc(ve, run::gen_runarray50, realArray2(), SYM(solve), formal(realArray2(), SYM(a), false, false), formal(realArray2(), SYM(b), false, false), formal(primBoolean(), SYM(warn), true, false)); -#line 1242 "runarray.in" - addFunc(ve, run::gen_runarray51, primReal(), SYM(determinant), formal(realArray2(), SYM(a), false, false)); -#line 1259 "runarray.in" - addFunc(ve, run::gen_runarray52, realArray(), SYM_TIMES, formal(realArray2(), SYM(a), false, false), formal(realArray(), SYM(b), false, false)); -#line 1278 "runarray.in" - addFunc(ve, run::gen_runarray53, realArray(), SYM_TIMES, formal(realArray(), SYM(a), false, false), formal(realArray2(), SYM(b), false, false)); -#line 1307 "runarray.in" - addFunc(ve, run::gen_runarray54, IntArray2(), SYM_TIMES, formal(IntArray2(), SYM(a), false, false), formal(IntArray2(), SYM(b), false, false)); -#line 1312 "runarray.in" - addFunc(ve, run::gen_runarray55, realArray2(), SYM_TIMES, formal(realArray2(), SYM(a), false, false), formal(realArray2(), SYM(b), false, false)); -#line 1317 "runarray.in" - addFunc(ve, run::gen_runarray56, pairArray2(), SYM_TIMES, formal(pairArray2(), SYM(a), false, false), formal(pairArray2(), SYM(b), false, false)); -#line 1322 "runarray.in" - addFunc(ve, run::gen_runarray57, primTriple(), SYM_TIMES, formal(realArray2(), SYM(t), false, false), formal(primTriple(), SYM(v), false, false)); -#line 1327 "runarray.in" - addFunc(ve, run::gen_runarray58, primPair(), SYM(project), formal(primTriple(), SYM(v), false, false), formal(realArray2(), SYM(t), false, false)); -#line 1352 "runarray.in" - addFunc(ve, run::gen_runarray59, primReal(), SYM(dot), formal(realArray(), SYM(a), false, false), formal(realArray(), SYM(b), false, false)); -#line 1362 "runarray.in" - addFunc(ve, run::gen_runarray60, primPair(), SYM(dot), formal(pairArray(), SYM(a), false, false), formal(pairArray(), SYM(b), false, false)); -#line 1372 "runarray.in" - addFunc(ve, run::gen_runarray61, 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 1476 "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(x), false, false), formal(primBoolean(), SYM(verbose), true, false)); -#line 1523 "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(x1), false, false), formal(primReal(), SYM(x2), false, false), formal(primBoolean(), SYM(verbose), true, false)); -#line 1605 "runarray.in" - addFunc(ve, run::gen_runarray64, 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 1617 "runarray.in" - addFunc(ve, run::gen_runarray65, pairArray(), SYM(fft), formal(pairArray(), SYM(a), false, false), formal(primInt(), SYM(sign), true, false)); -#line 1648 "runarray.in" - addFunc(ve, run::gen_runarray66, IntArray2(), SYM(triangulate), formal(pairArray(), SYM(z), false, false)); -#line 1683 "runarray.in" - addFunc(ve, run::gen_runarray67, primReal(), SYM(norm), formal(realArray(), SYM(a), false, false)); -#line 1694 "runarray.in" - addFunc(ve, run::gen_runarray68, primReal(), SYM(norm), formal(realArray2(), SYM(a), false, false)); -#line 1709 "runarray.in" - addFunc(ve, run::gen_runarray69, primReal(), SYM(norm), formal(tripleArray2(), SYM(a), false, false)); -#line 1724 "runarray.in" - addFunc(ve, run::gen_runarray70, primReal(), SYM(change2), formal(tripleArray2(), SYM(a), false, false)); -#line 1746 "runarray.in" - addFunc(ve, run::gen_runarray71, primTriple(), SYM(minbezier), formal(tripleArray2(), SYM(p), false, false), formal(primTriple(), SYM(b), false, false)); -#line 1756 "runarray.in" - addFunc(ve, run::gen_runarray72, primTriple(), SYM(maxbezier), formal(tripleArray2(), SYM(p), false, false), formal(primTriple(), SYM(b), false, false)); -#line 1766 "runarray.in" - addFunc(ve, run::gen_runarray73, primPair(), SYM(minratio), formal(tripleArray2(), SYM(p), false, false), formal(primPair(), SYM(b), false, false)); -#line 1777 "runarray.in" - addFunc(ve, run::gen_runarray74, primPair(), SYM(maxratio), formal(tripleArray2(), SYM(p), false, false), formal(primPair(), SYM(b), false, false)); -#line 1788 "runarray.in" - addFunc(ve, run::gen_runarray75, realArray(), SYM(_projection)); +#line 1044 "runarray.in" + addFunc(ve, run::gen_runarray49, realArray2(), SYM(identity), formal(primInt(), SYM(n), false, false)); +#line 1050 "runarray.in" + addFunc(ve, run::gen_runarray50, realArray2(), SYM(inverse), formal(realArray2(), SYM(a), false, false)); +#line 1142 "runarray.in" + addFunc(ve, run::gen_runarray51, realArray(), SYM(solve), formal(realArray2(), SYM(a), false, false), formal(realArray(), SYM(b), false, false), formal(primBoolean(), SYM(warn), true, false)); +#line 1195 "runarray.in" + addFunc(ve, run::gen_runarray52, realArray2(), SYM(solve), formal(realArray2(), SYM(a), false, false), formal(realArray2(), SYM(b), false, false), formal(primBoolean(), SYM(warn), true, false)); +#line 1260 "runarray.in" + addFunc(ve, run::gen_runarray53, primReal(), SYM(determinant), formal(realArray2(), SYM(a), false, false)); +#line 1277 "runarray.in" + addFunc(ve, run::gen_runarray54, realArray(), SYM_TIMES, formal(realArray2(), SYM(a), false, false), formal(realArray(), SYM(b), false, false)); +#line 1296 "runarray.in" + addFunc(ve, run::gen_runarray55, realArray(), SYM_TIMES, formal(realArray(), SYM(a), false, false), formal(realArray2(), SYM(b), false, false)); +#line 1325 "runarray.in" + addFunc(ve, run::gen_runarray56, IntArray2(), SYM_TIMES, formal(IntArray2(), SYM(a), false, false), formal(IntArray2(), SYM(b), false, false)); +#line 1330 "runarray.in" + addFunc(ve, run::gen_runarray57, realArray2(), SYM_TIMES, formal(realArray2(), SYM(a), false, false), formal(realArray2(), SYM(b), false, false)); +#line 1335 "runarray.in" + addFunc(ve, run::gen_runarray58, pairArray2(), SYM_TIMES, formal(pairArray2(), SYM(a), false, false), formal(pairArray2(), SYM(b), false, false)); +#line 1340 "runarray.in" + addFunc(ve, run::gen_runarray59, primTriple(), SYM_TIMES, formal(realArray2(), SYM(t), false, false), formal(primTriple(), SYM(v), false, false)); +#line 1345 "runarray.in" + addFunc(ve, run::gen_runarray60, primPair(), SYM(project), formal(primTriple(), SYM(v), false, false), formal(realArray2(), SYM(t), false, false)); +#line 1370 "runarray.in" + addFunc(ve, run::gen_runarray61, primReal(), SYM(dot), formal(realArray(), SYM(a), false, false), formal(realArray(), SYM(b), false, false)); +#line 1380 "runarray.in" + addFunc(ve, run::gen_runarray62, primPair(), SYM(dot), formal(pairArray(), SYM(a), false, false), formal(pairArray(), SYM(b), false, false)); +#line 1390 "runarray.in" + addFunc(ve, run::gen_runarray63, 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 1494 "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(x), false, false), formal(primBoolean(), SYM(verbose), true, false)); +#line 1541 "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(x1), false, false), formal(primReal(), SYM(x2), false, false), formal(primBoolean(), SYM(verbose), true, false)); +#line 1623 "runarray.in" + addFunc(ve, run::gen_runarray66, 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 1635 "runarray.in" + addFunc(ve, run::gen_runarray67, pairArray(), SYM(fft), formal(pairArray(), SYM(a), false, false), formal(primInt(), SYM(sign), true, false)); +#line 1666 "runarray.in" + addFunc(ve, run::gen_runarray68, IntArray2(), SYM(triangulate), formal(pairArray(), SYM(z), false, false)); +#line 1701 "runarray.in" + addFunc(ve, run::gen_runarray69, primReal(), SYM(norm), formal(realArray(), SYM(a), false, false)); +#line 1712 "runarray.in" + addFunc(ve, run::gen_runarray70, primReal(), SYM(norm), formal(realArray2(), SYM(a), false, false)); +#line 1727 "runarray.in" + addFunc(ve, run::gen_runarray71, primReal(), SYM(norm), formal(tripleArray2(), SYM(a), false, false)); +#line 1742 "runarray.in" + addFunc(ve, run::gen_runarray72, primReal(), SYM(change2), formal(tripleArray2(), SYM(a), false, false)); +#line 1764 "runarray.in" + addFunc(ve, run::gen_runarray73, primTriple(), SYM(minbezier), formal(tripleArray2(), SYM(p), false, false), formal(primTriple(), SYM(b), false, false)); +#line 1774 "runarray.in" + addFunc(ve, run::gen_runarray74, primTriple(), SYM(maxbezier), formal(tripleArray2(), SYM(p), false, false), formal(primTriple(), SYM(b), false, false)); +#line 1784 "runarray.in" + addFunc(ve, run::gen_runarray75, primPair(), SYM(minratio), formal(tripleArray2(), SYM(p), false, false), formal(primPair(), SYM(b), false, false)); +#line 1795 "runarray.in" + addFunc(ve, run::gen_runarray76, primPair(), SYM(maxratio), formal(tripleArray2(), SYM(p), false, false), formal(primPair(), SYM(b), false, false)); +#line 1806 "runarray.in" + addFunc(ve, run::gen_runarray77, realArray(), SYM(_projection)); } } // namespace trans |