Parent Directory
|
Revision Log
This javaScript row reduction tool is used in some problems.
1 <HTML> 2 3 <head> 4 <script language="Javascript"> 5 6 // ** COPYRIGHT (c) 1999 STEFAN WANER & STEVEN R. COSTENOBLE ** 7 // ****************** ALL RIGHTS RESERVED ******************* 8 9 // *** ERROR HANDLING 10 window.onerror = myErrorTrap; 11 12 // var exit = false; // get out of here 13 var okToRoll = true; // preliminary testing results 14 var doNotReduce = true; // automatic reduction in integer mode is off by default 15 var stepName = ""; // for error trap 16 var tab = unescape( "%09" ); // these are now the appropriate strings; 17 var cr = unescape( "%0D" ); 18 var activeX = 1; // activated cell coords 19 var activeY = 1; 20 var prevX = 0; // previously active cell 21 varPrevY = 0; 22 var comma = ","; 23 var singular = false; 24 var maxRows = 10; 25 var maxCols = 15; 26 var numRows =1; 27 var numCols = 1; 28 var cellPosition = 0; // active cell in the spreadsheet 29 var PrevCellPosition = 0; // previously active cell position 30 var lineSkip = false; // skip line on tab 31 var backSteps = 0; // how many steps you can back up at any given point 32 var backupPosition = 1; // cycles 1-5 33 var maxBackSteps = 5; // fixed at 5; 34 var reDoFlag = false; // cannot redo unless you back up 35 var firstBackUp = true; // first backup must do an extra save 36 var stackSize = 0; // the size of the row operations stack not yet implemented 37 var unDoSteps = 0; // number of successive undos 38 39 var operationsStack = new Array(); // the row operations stack not yet implemented 40 // stack location = stackSize 41 // format of each cell = string | y , R# , mult , +/- , R# , mutl | 42 // or Int to Frac Switch 43 // y = 1: a single row op y = 0, part of a chain of row ops 44 // as in a pivot op or a complete reduction 45 // this cylces back to top after 100 operations 46 var stackPtr = 0; 47 var theMatrix = new makeArray2(maxRows,maxCols); 48 // we will only work with submatrix numRows x numCols 49 var theSavedMatrix = new makeArray2(maxRows,maxCols); // to revert to saved matrix 50 var theFistBackupMatrix = new makeArray2(maxRows,maxCols); // saves latest operation 51 var theBackMatrix = new makeArray3(maxRows,maxCols, maxBackSteps); 52 var theBackStatus = new Array(); 53 var saveThis = true; 54 55 56 var numSigDigs = 6; // default accuracy 57 58 // old globals below... 59 60 var maxDenom = 1000; // for fraction approximation 61 var tol = .000000001; // for 10 digit accuracy guaranteed cutoff for fractin approx not yet implemented 62 var tooBigString = "Too many matrices in your expression," + cr + "or your expression is too complicated." + cr +"Please keep it simple!" 63 64 var fractionMode = false; 65 var integerMode = false; 66 var okToRoll = true; 67 var browserName = navigator.appName; 68 var browserVersion = navigator.appVersion; 69 if ( (browserName == "Netscape") && (parseInt(browserVersion) >= 3)) browserName = "N"; 70 else if ( (browserName == "Microsoft Internet Explorer") && (parseInt(browserVersion) >= 3) ) browserName = "M"; 71 72 // ****************** ERROR HANDLER ************* 73 function myErrorTrap(message,url,linenumber) { 74 alert("I'm sorry, Dave. I can't do that."); 75 return (true); 76 } // end of on error 77 78 // ******************** MATH UTILITIES ****************** 79 function hcf (a,b) { 80 81 if ( (a == 0) && (b == 0) ) return(0); // actually should be infinity 82 var bigger = Math.abs(a); 83 var smaller = Math.abs(b); 84 var x = 0; 85 var theResult = 1; 86 if (a == b) return(bigger); 87 88 if (smaller > bigger) {x = bigger; bigger = smaller; smaller = x} 89 if (smaller == 0) return(bigger); 90 91 var testRatio = roundSigDig(bigger/smaller, 11); 92 var testRatio2 = 0; 93 if (testRatio == Math.floor(testRatio) ) return (smaller) 94 else 95 { 96 // look for a factor of the smaller, deplete it by that factor and multiply bigger by it 97 var found = false; 98 var upperlimit = smaller; 99 for (var i = upperlimit; i >= 2; i--) 100 { 101 testRatio = roundSigDig(smaller/i, 10); 102 testRatio2 = roundSigDig(bigger/i, 10); 103 104 if ( (testRatio == Math.floor(testRatio) ) && (testRatio2 == Math.floor(testRatio2) ) ) 105 { 106 107 smaller = Math.round(smaller/i); 108 bigger = Math.round(bigger/i); 109 theResult = i* hcf(bigger, smaller) 110 return(theResult); 111 } 112 } 113 return(theResult); 114 } 115 alert("error!"); 116 return(-1); // should never get here 117 } // hcf 118 119 120 function lcm(a,b) { 121 // lowest common multiple 122 var bigger = Math.abs(a); 123 var smaller = Math.abs(b); 124 var x = 0; 125 if ( (a == 0) || (b == 0) ) return(1); 126 if (smaller > bigger) {x = bigger; bigger = smaller; smaller = x} 127 128 var testRatio = roundSigDig(bigger/smaller, 11) 129 if (testRatio == Math.floor(testRatio) ) return (bigger) 130 else 131 { 132 // look for a factor of the smaller, deplete it by that factor and multiply bigger by it 133 var found = false; 134 for (var i = 2; i <= smaller; i++) 135 { 136 if (i*i >= smaller) break; 137 testRatio = roundSigDig(smaller/i, 11); 138 if (testRatio == Math.floor(testRatio) ) 139 { 140 smaller = testRatio; 141 bigger = bigger*i; 142 return( lcm(bigger, smaller) ); 143 } 144 } 145 return(bigger*smaller); 146 } 147 alert("error!"); 148 return(-1); // should never get here 149 } // lcm 150 151 // *** reducing a fraction *** 152 function reduce(fraction){ 153 with (Math) 154 { 155 var HCF = hcf(fraction[1], fraction[2]); 156 fraction[1] = Math.round(fraction[1]/HCF); 157 fraction[2] = Math.round(fraction[2]/HCF); 158 } // with math 159 return(fraction); 160 } // reduce fraction 161 162 163 function toFracArr(x, maxDenom, tol) { 164 // identical to toFrac, except this returns an array [1] = numerator; [2] = denom 165 // rather than a string 166 // tolerance is the largest errror you will tolerate before resorting to 167 // expressing the result as the input decimal in fraction form 168 // suggest no less than 10^-10, since we round all to 15 decimal places. 169 var theFrac = new Array(); 170 theFrac[1] = 0; 171 theFrac[2] = 0; 172 var p1 = 1; 173 var p2 = 0; 174 var q1 = 0; 175 var q2 = 1; 176 var u =0; 177 var t = 0; 178 var flag = true; 179 var negflag = false; 180 var a = 0; 181 var xIn = x; // variable for later 182 var n = 0; 183 var d = 0; 184 var p = 0; 185 var q = 0; 186 187 if (x >10000000000) return(theFrac); 188 while (flag) 189 { 190 if (x<0) {x = -x; negflag = true; p1 = -p1} 191 var intPart = Math.floor(x); 192 var decimalPart = roundSigDig((x - intPart),15); 193 194 x = decimalPart; 195 a = intPart; 196 197 t = a*p1 + p2; 198 u = a*q1 + q2; 199 if ( (Math.abs(t) > 10000000000 ) || (u > maxDenom ) ) 200 { 201 n = p1; 202 d = q1; 203 break; 204 } 205 206 p = t; 207 q = u; 208 209 // cout << "cf coeff: " << a << endl; // for debugging 210 // cout << p << "/" << q << endl; // for debugging 211 212 if ( x == 0 ) 213 { 214 n = p; 215 d = q; 216 break; 217 } 218 219 p2 = p1; 220 p1 = p; 221 q2 = q1; 222 q1 = q; 223 x = 1/x; 224 225 } // while ( true ); 226 227 theFrac[1] = n; 228 theFrac[2] = d; 229 return(theFrac); 230 231 } // toFracArr 232 233 function toFrac(x, maxDenom, tol) { 234 // tolerance is the largest errror you will tolerate before resorting to 235 // expressing the result as the input decimal in fraction form 236 // suggest no less than 10^-10, since we round all to 15 decimal places. 237 var theFrac = new Array(); 238 theFrac[1] = 0; 239 theFrac[2] = 0; 240 var p1 = 1; 241 var p2 = 0; 242 var q1 = 0; 243 var q2 = 1; 244 var u =0; 245 var t = 0; 246 var flag = true; 247 var negflag = false; 248 var a = 0; 249 var xIn = x; // variable for later 250 var n = 0; 251 var d = 0; 252 var p = 0; 253 var q = 0; 254 255 if (x >10000000000) return(theFrac); 256 while (flag) 257 { 258 if (x<0) {x = -x; negflag = true; p1 = -p1} 259 var intPart = Math.floor(x); 260 var decimalPart = roundSigDig((x - intPart),15); 261 262 x = decimalPart; 263 a = intPart; 264 265 t = a*p1 + p2; 266 u = a*q1 + q2; 267 if ( (Math.abs(t) > 10000000000 ) || (u > maxDenom ) ) 268 { 269 n = p1; 270 d = q1; 271 break; 272 } 273 274 p = t; 275 q = u; 276 277 // cout << "cf coeff: " << a << endl; // for debugging 278 // cout << p << "/" << q << endl; // for debugging 279 280 if ( x == 0 ) 281 { 282 n = p; 283 d = q; 284 break; 285 } 286 287 p2 = p1; 288 p1 = p; 289 q2 = q1; 290 q1 = q; 291 x = 1/x; 292 293 } // while ( true ); 294 295 theFrac[1] = n; 296 theFrac[2] = d; 297 298 if (theFrac[2] == 1) return (theFrac[1].toString()); 299 else return (theFrac[1] + "/" + theFrac[2]); 300 301 } // toFrac 302 303 304 function lastChar(theString) { 305 if (theString == "") return(theString); 306 var len = theString.length; 307 return theString.charAt(len-1); 308 } 309 310 function looksLikeANumber(theString) { 311 // returns true if theString looks like it can be evaluated 312 var result = true; 313 var length = theString.length; 314 if (length == 0) return (false); 315 var x = "" 316 var y = "1234567890-+*. /" 317 var yLength = y.length; 318 for (var i = 0; i <= length; i++) 319 { 320 x = theString.charAt(i); 321 result = false; 322 for (var j = 0; j <= yLength; j++) 323 { 324 if (x == y.charAt(j)) {result = true; break} 325 } // j 326 if (result == false) return(false); 327 } // i 328 return(result); 329 } // looks like a number 330 331 function roundSix(theNumber) { 332 var x = (Math.round(1000000*theNumber))/1000000; 333 return(x); 334 } 335 336 function shiftRight(theNumber, k) { 337 if (k == 0) return (theNumber) 338 else 339 { 340 var k2 = 1; 341 var num = k; 342 if (num < 0) num = -num; 343 for (var i = 1; i <= num; i++) 344 { 345 k2 = k2*10 346 } 347 } 348 if (k>0) 349 {return(k2*theNumber)} 350 else 351 {return(theNumber/k2)} 352 } 353 354 function roundSigDig(theNumber, numDigits) { 355 numDigits = numDigits -1 // too accurate as written 356 with (Math) 357 { 358 if (theNumber == 0) return(0); 359 else if(abs(theNumber) < 0.000000000001) return(0); 360 // WARNING: ignores numbers less than 10^(-12) 361 else 362 { 363 var k = floor(log(abs(theNumber))/log(10))-numDigits 364 var k2 = shiftRight(round(shiftRight(abs(theNumber),-k)),k) 365 if (theNumber > 0) return(k2); 366 else return(-k2) 367 } // end else 368 } 369 } 370 371 372 function looksLikeANumber(theString) { 373 // returns true if theString looks like it can be evaluated 374 var result = true; 375 var length = theString.length; 376 var x = "" 377 var y = "1234567890-+^*./ " 378 var yLength = y.length; 379 for (var i = 0; i <= length; i++) 380 { 381 x = theString.charAt(i); 382 result = false; 383 for (var j = 0; j <= yLength; j++) 384 { 385 if (x == y.charAt(j)) {result = true; break} 386 } // j 387 if (result == false) return(false); 388 } // i 389 return(result); 390 } // looks like a number 391 392 // ************ MAKE INTEGER 393 // Makes a matrix integer by least common multiples of rows 394 // returms a matrix of STRINGS if Strings = true else gives integers 395 // input = a matrix of real floats 396 397 398 function makeInteger(theMatrix, RowNum, ColNum,Strings) { 399 var rowArray = new makeArray2(ColNum,2); 400 var outArray = new makeArray2(maxRows,maxCols); 401 for (var i = 1; i <= RowNum; i++) 402 { 403 // set up fraction row array 404 for (var j = 1; j <= ColNum; j++) 405 { 406 for (var k = 1; k <= 2; k++) rowArray[j][k] = toFracArr(theMatrix[i][j],maxDenom, tol)[k]; 407 } // j 408 409 // get the lcm of all the row denominators 410 var rowLcm = 1; 411 412 for (j = 1; j <= ColNum; j++) rowLcm = lcm(rowLcm,rowArray[j][2]); 413 // now multiply the row by the lcm 414 for (j = 1; j <= ColNum; j++) 415 { 416 rowArray[j][1] = rowLcm*rowArray[j][1]/rowArray[j][2]; 417 // now ignore [2] entry from here on 418 } 419 // undo information follows 420 stackPtr++; 421 if(stackPtr == 101) stackPtr = 1; 422 operationsStack[stackPtr] = "0,"+ i + "," + (1/rowLcm).toString(); 423 // starts with 1 to mark first step in a sequence 424 425 // now get the hcf of the integers in the row 426 if(!doNotReduce) 427 { 428 var rowHcf = 0; 429 430 for (j = 1; j <= ColNum; j++) rowHcf = hcf(rowHcf,rowArray[j][1]); 431 if (rowHcf != 0) 432 { 433 // now divide the row by the hcf 434 for (j = 1; j <= ColNum; j++) 435 { 436 rowArray[j][1] = rowArray[j][1]/rowHcf; 437 } 438 } // if row Hcf 439 } // if reducing 440 441 // prepare output array 442 var x = 0; 443 for (j = 1; j <= ColNum; j++) 444 { 445 x = rowArray[j][1] 446 if (!Strings) outArray[i][j] = Math.round(x); 447 else outArray[i][j] = Math.round(x).toString(); 448 // else outArray[i][j] = x.toString(); 449 } // j 450 451 } // i 452 return(outArray); 453 454 } // makeInteger 455 // *************END MAKE INTEGER *************** 456 457 // ***********ROW REDUCE ********************* 458 function rowReduce() { 459 460 for (var i = 1; i <= numRows; i++) 461 { 462 var theCol = 0; 463 // search for the leading entry in the ith row 464 for (var j = 1; j <= numCols; j++) 465 { 466 if (theMatrix[i][j] != 0) {theCol = j; break} 467 } // j 468 if (theCol != 0) pivot(theMatrix,numRows,numCols,i,theCol); 469 } // i 470 // Now arrange the pivoted rows by leading entries 471 // search the columns from left 472 var theRow = 1; 473 for (j = 1; j <= numCols; j++) 474 { 475 for (i = theRow; i <= numRows; i++) 476 { 477 if( theMatrix[i][j] != 0) 478 { 479 if (i == theRow) {theRow++; break;} 480 else { swapRows(theMatrix,theRow,i); theRow++; break} 481 } // found non-zero 482 } // i 483 } // j 484 } // rowReduce 485 486 // ***********END ROW REDUCE *************** 487 488 // *******************PIVOT ********************** 489 function pivot(InMatrix,rows,cols,theRow,theCol) { 490 // alert("theRow = " + theRow + "theCol" + theCol); 491 var thePivot = InMatrix[theRow][theCol]; 492 doNotReduce = false; // turns on automatic reduction 493 for (var i = 1; i <= cols; i++) 494 { 495 InMatrix[theRow][i] = InMatrix[theRow][i]/thePivot; 496 } // i 497 // undo information follows 498 stackPtr++; 499 if(stackPtr == 101) stackPtr = 1; 500 operationsStack[stackPtr] = "1,"+theRow.toString() + ","+thePivot.toString() 501 // starts with 1 to mark the first step in a sequence 502 // now pivot 503 var theNum = 1; 504 for (var i = 1; i <= rows; i++) 505 { 506 if ( (i != theRow) && (InMatrix[i][theCol] != 0) ) 507 { 508 var factr = InMatrix[i][theCol]; 509 510 for (var j = 1; j <= cols; j++) 511 { 512 513 InMatrix[i][j] = InMatrix[i][j] - factr*InMatrix[theRow][j]; 514 515 } // j 516 // undo information follows 517 stackPtr++; 518 if(stackPtr == 101) stackPtr = 1; 519 520 operationsStack[stackPtr] = "0," + i + ",1,+," + theRow + "," + factr.toString(); 521 // starts with 0 to mark subsequent steps in a sequence 522 } 523 } // i 524 525 526 return(InMatrix); 527 } 528 529 // ***************** END PIVOT ********************* 530 531 // *************DIVIDE ROW BY SELECTION ************ 532 function divideRowbySelection(InMatrix,rows,cols,theRow,theCol) { 533 // if it is in integer mode and division results in fractions, switches to fraction mode 534 535 var theNumber = theMatrix[activeX][activeY]; 536 var integerFlag = true; 537 var num = 1; 538 // it should not be zero at this point... 539 for (var i = 1; i <= cols; i++) 540 { 541 num= InMatrix[theRow][i]/theNumber; 542 InMatrix[theRow][i] = num; 543 if ( (integerFlag)&&(Math.round(num) != num) ) integerFlag = false; 544 } // i 545 // undo information follows 546 stackPtr++; 547 if(stackPtr == 101) stackPtr = 1; 548 operationsStack[stackPtr] = "1," + theRow + "," +theNumber.toString(); 549 // starts with 1 to mark first step in a sequence 550 551 if ( (integerMode) && (!integerFlag)) 552 { 553 integerMode = false; 554 fractionMode = true; 555 document.theSpreadsheet.Mode.options[1].selected = true; 556 // undo Information 557 stackPtr++; 558 if(stackPtr == 101) stackPtr = 1; 559 operationsStack[stackPtr] = "Int to Frac Switch" 560 // end undo information 561 } // if integer mode 562 return(InMatrix); 563 } // divide row by selection 564 // **********END DIVIDE ROW BY SELECTION ********** 565 566 // ************ ROW OPERATION ******************** 567 function rowOp(theMatrix,theRow, theOtherRow, a, b) { 568 // replaces theRow by a*theRow + b*theOtherRow 569 var integerFlag = true; 570 var num = 1; 571 for (var j = 1; j <= numCols; j++) 572 { 573 if (theOtherRow != 0) num = a*theMatrix[theRow][j] + b*theMatrix[theOtherRow][j]; 574 else num = a*theMatrix[theRow][j]; 575 theMatrix[theRow][j] = num; 576 if ( (integerFlag)&&(Math.round(num) != num) ) integerFlag = false; 577 } // j 578 // undo information follows 579 stackPtr++; 580 if(stackPtr == 101) stackPtr = 1; 581 operationsStack[stackPtr] = "1," + theRow + "," +a.toString() + ",-," + theOtherRow + "," + b.toString(); 582 // starts with 1 to mark first step in a sequence 583 if ( (integerMode) && (!integerFlag)) 584 { 585 integerMode = false; 586 fractionMode = true; 587 document.theSpreadsheet.Mode.options[1].selected = true; 588 // undo Information 589 stackPtr++; 590 if(stackPtr == 101) stackPtr = 1; 591 operationsStack[stackPtr] = "Int to Frac Switch" 592 // end undo information 593 } // if integer mode 594 return(theMatrix); 595 } // rowOp 596 // ********END ROW OPERATIION ******************** 597 598 // ***********SWAP ROWS ************************* 599 function swapRows(InMatrix,p,q) { 600 var rowHold =0; 601 for(var j = 1; j <= numCols; j++) 602 { 603 rowHold = InMatrix[p][j]; 604 InMatrix[p][j] = InMatrix[q][j]; 605 InMatrix[q][j] = rowHold; 606 } // j 607 // undo Information 608 stackPtr++; 609 if(stackPtr == 101) stackPtr = 1; 610 operationsStack[stackPtr] = "Swap,"+ p + "," + q; 611 // end undo information 612 return(InMatrix); 613 } // end swap rows 614 // ********END SWAP ROWS ************************ 615 616 617 618 // *************** FORM UTILITIES ****************** 619 620 function sesame(url,hsize,vsize){ 621 // Default size is 550 x 400 622 var tb="toolbar=0,directories=0,status=0,menubar=0" 623 tb+=",scrollbars=1,resizable=1," 624 var tbend="width="+hsize+",height="+vsize; 625 if(tbend.indexOf("<undefined>")!=-1){tbend="width=550,height=400"} 626 tb+=tbend 627 Win_1 = window.open("","win1",tb); 628 Win_1 = window.open(url,"win1",tb); 629 } 630 631 // ********ACTIVE CELL CHECK********* 632 function checkIn() { 633 lineSkip = false 634 prevX = activeX; 635 prevY = activeY; 636 prevCellPosition = cellPosition; 637 activeX = checkIn.arguments[0]; 638 activeY = checkIn.arguments[1]; 639 if ( ( browserName == "N") || ( browserName == "M") ) 640 { 641 cellPosition = (activeX-1)*maxCols + activeY-1; 642 if (prevCellPosition + 1 == cellPosition) 643 { 644 // looks like you tabbed there 645 lineSkip = true; 646 } 647 if ( (lineSkip) && (document.theSpreadsheet1[prevCellPosition].value == "" ) && (activeX < maxRows)) 648 { 649 var posn = cellPosition + maxCols - activeY+1; 650 document.theSpreadsheet1[posn].focus(); 651 document.theSpreadsheet1[posn].select(); 652 } 653 } // if Netscape 654 return(true); 655 } // checkIn 656 // ******END ACTIVE CELL CHeCK ****** 657 658 // ********TAB-ING HANDLE BLUR ***** 659 function handleBlur() { 660 661 } // handleBlur 662 // ********END HANDLE BLUR ********* 663 664 // *************READ THE MATRIX******************** 665 function readMatrix() { 666 // reads the current Matrix 667 668 if ((!fractionMode) && (!integerMode)) doIt(2); // rounding information 669 670 unDoSteps = 0; // no steps left to undo 671 firstBackUp = true; // have broken a possible chain of backups 672 var count = 0; 673 // first detect the size of the active Matrix 674 var theRowSize = 0; 675 var theColSize = 0; 676 677 for (var i = 1; i <= maxRows; i++) 678 { 679 for (var j = 1; j <= maxCols; j++) 680 { 681 var theString = stripSpaces(document.theSpreadsheet1[count].value); 682 if (theString == "") 683 { 684 } 685 else 686 { 687 if (theRowSize<i) theRowSize = i; 688 if (theColSize < j) theColSize = j; 689 } 690 count++; 691 } // j 692 } // i 693 694 numRows = theRowSize; // reset globals here 695 numCols = theColSize; // reset globals here 696 count = 0; 697 for (i = 1; i <= maxRows; i++) 698 { 699 for (j = 1; j <= maxCols; j++) 700 { 701 theString = stripSpaces(document.theSpreadsheet1[count].value); 702 if (theString == "") 703 { 704 theMatrix[i][j] = 0; 705 if ( (theRowSize>=i) && (theColSize >= j) ) document.theSpreadsheet1[count].value = "0"; 706 } 707 else 708 { 709 theMatrix[i][j] = eval(theString); 710 } 711 // starts numbering at 0 712 count++; 713 } // j 714 } // i 715 716 // save this if they want it 717 if (saveThis) 718 { 719 saveThis = false; 720 for (i = 1; i <= maxRows; i++) 721 { 722 for (j = 1; j <= maxCols; j++) 723 { 724 theSavedMatrix[i][j] = theMatrix[i][j]; 725 } // j 726 } // i 727 728 } // if save this 729 730 731 // save the settings 732 backSteps++; 733 if (backSteps > maxBackSteps) backSteps = maxBackSteps; 734 backupPosition++; 735 if (backupPosition > maxBackSteps) backupPosition = 1; 736 if (fractionMode) theBackStatus[backupPosition] = "F"; 737 else if (integerMode) theBackStatus[backupPosition] = "I"; 738 else theBackStatus[backupPosition] = "D" 739 // alert (theBackStatus[backupPosition]) 740 for (i = 1; i <= maxRows; i++) 741 { 742 for (j = 1; j <= maxCols; j++) 743 { 744 theBackMatrix[i][j][backupPosition] = theMatrix[i][j]; 745 } // j 746 } // i 747 // lastly, reset the mode 748 fractionMode = false; 749 integerMode = false; 750 var theMode = document.theSpreadsheet.Mode.selectedIndex; 751 // alert(document.theSpreadsheet.Mode.selectedIndex); 752 if (document.theSpreadsheet.Mode.options[theMode].text == "Fraction") fractionMode = true; 753 else if (document.theSpreadsheet.Mode.options[theMode].text == "Integer") integerMode = true; 754 // alert("fractionMode = " + fractionMode + "integerMode = " + integerMode); 755 756 // *** testing ******* 757 // var str = "x selected = "+activeX + " y selected = " + activeY + cr; 758 // document.theSpreadsheet.output.value = ""; 759 // for (var i = 1; i <= numRows; i++) 760 // { 761 // for (var j = 1; j <= numCols; j++) 762 // { 763 // str += theMatrix[i][j] + tab; 764 // } 765 // str += cr; 766 // } 767 // document.theSpreadsheet.output.value = str; 768 // alert ("here"); 769 // *** testing ******* 770 771 772 } // readMatrix 773 774 // ******* END READ MATRIX ********* 775 776 // *******BACKUP ****************** 777 function backUp() { 778 779 if(firstBackUp) 780 { 781 for (var i = 1; i <= numRows; i++) 782 { 783 for (var j = 1; j <= numCols; j++) 784 { 785 theFistBackupMatrix[i][j] = theMatrix[i][j]; 786 } // j 787 } // i 788 789 // alert("here " + theFistBackupMatrix[2][1]); 790 firstBackUp = false; 791 } 792 793 document.theSpreadsheet.expr.value = "" 794 if (backSteps == 0) {document.theSpreadsheet.expr.value = "Sorry. You have backed up as far as you can go..."; return(false)} 795 if (theBackStatus[backupPosition] == "F") {fractionMode = true; integerMode = false; document.theSpreadsheet.Mode.options[1].selected = true;} 796 else if (theBackStatus[backupPosition] == "I") {fractionMode = false; integerMode = true; document.theSpreadsheet.Mode.options[2].selected = true;} 797 else {fractionMode = false; integerMode = false; document.theSpreadsheet.Mode.options[0].selected = true;} 798 for (var i = 1; i <= maxRows; i++) 799 { 800 for (var j = 1; j <= maxCols; j++) 801 { 802 theMatrix[i][j] = theBackMatrix[i][j][backupPosition]; 803 } // j 804 } // i 805 displayMatrix(); 806 backSteps--; 807 if (backSteps < 0) backSteps = 0; 808 backupPosition--; 809 if (backupPosition == 0) backupPosition = maxBackSteps; 810 unDoSteps++; 811 reDoFlag = true; 812 return(false); 813 } // backup 814 // ********END BACKUP ************ 815 816 // ********REDO ****************** 817 function reDo() { 818 // alert(unDoSteps); 819 document.theSpreadsheet.expr.value = "" 820 if (unDoSteps == 0) {document.theSpreadsheet.expr.value = "Sorry. You cannot redo now"; return(true)} 821 else if (unDoSteps == 1) 822 { 823 readMatrix(); 824 for (var i = 1; i <= numRows; i++) 825 { 826 for (var j = 1; j <= numCols; j++) 827 { 828 theMatrix[i][j] = eval(theFistBackupMatrix [i][j]); 829 } // j 830 } // i 831 displayMatrix(); undoSteps = 0; return(true) 832 } 833 834 unDoSteps--; 835 836 backSteps++; 837 if (backSteps > maxBackSteps) backSteps = maxBackSteps; 838 backupPosition++; 839 if (backupPosition > maxBackSteps) backupPosition = 1; 840 if(reDoFlag) 841 { 842 backSteps++; 843 if (backSteps > maxBackSteps) backSteps = maxBackSteps; 844 backupPosition++; 845 if (backupPosition > maxBackSteps) backupPosition = 1; 846 reDoFlag = false; 847 } 848 849 if (theBackStatus[backupPosition] == "F") {fractionMode = true; integerMode = false; document.theSpreadsheet.Mode.options[1].selected = true;} 850 else if (theBackStatus[backupPosition] == "I") {fractionMode = false; integerMode = true; document.theSpreadsheet.Mode.options[2].selected = true;} 851 else {fractionMode = false; integerMode = false; document.theSpreadsheet.Mode.options[0].selected = true;} 852 for (var i = 1; i <= maxRows; i++) 853 { 854 for (var j = 1; j <= maxCols; j++) 855 { 856 theMatrix[i][j] = theBackMatrix[i][j][backupPosition]; 857 } // j 858 } // i 859 displayMatrix(); 860 861 862 return(false); 863 } // backup 864 // ********END REDO ************ 865 866 // *******REVERT TO SAVED ********* 867 function Revert() { 868 for (var i = 1; i <= maxRows; i++) 869 { 870 for (var j = 1; j <= maxCols; j++) 871 { 872 theMatrix[i][j] = theSavedMatrix[i][j]; 873 } // j 874 } // i 875 for (var i = 1; i <= 100; i++) operationsStack[i] = ""; 876 stackPtr = 0; 877 displayMatrix(); 878 return(true); 879 880 } // end revert 881 // ******END OF REVERT *********** 882 883 // ****** DISPLAY CURRENT MATRIX **** 884 function displayMatrix() { 885 886 var RowNum = numRows; 887 var ColNum = numCols; 888 var x = ""; // a string 889 // alert("about to display a "+ RowNum+ " x " + ColNum + "matrix"); 890 891 if (integerMode) theMatrix = makeInteger(theMatrix, numRows, numCols, true); 892 893 // else, handle fractions & decimals 894 else { 895 for (var i = 1; i <= RowNum; i++) 896 { 897 for (var j = 1; j <= ColNum; j++) 898 { 899 // alert("i = "+i + " j = " + j + "table entry = " + theMatrix[i][j]); 900 if (fractionMode) x = toFrac (roundSigDig(theMatrix[i][j],15) , maxDenom, tol); 901 else {x = roundSigDig(theMatrix[i][j], numSigDigs).toString()}; 902 903 // alert("x = "+x); 904 905 theMatrix[i][j] = x; 906 907 } // j 908 } // i 909 } // end else (if not integer mode) 910 911 var count = 0; 912 for (var i = 1; i <= maxRows; i++) 913 { 914 for (var j = 1; j <= maxCols; j++) 915 { 916 if ( (i <= numRows) && (j <= numCols)) document.theSpreadsheet1[count].value = theMatrix[i][j]; 917 count++; 918 } // j 919 } // i 920 doNotReduce = true; // turns off automatic reduction 921 return(0); 922 } 923 924 // ******** END OF DISPLAY ROUTINE *************** 925 926 927 928 929 930 function makeArray3 (X,Y,Z) 931 { 932 var count; 933 this.length = X+1; 934 for (var count = 1; count <= X+1; count++) 935 // to allow starting at 1 936 this[count] = new makeArray2(Y,Z); 937 } // makeArray3 938 939 940 function makeArray2 (X,Y) 941 { 942 var count; 943 this.length = X+1; 944 for (var count = 0; count <= X+1; count++) 945 // to allow starting at 1 946 this[count] = new makeArray(Y); 947 } // makeArray2 948 949 function makeArray (Y) 950 { 951 var count; 952 this.length = Y+1; 953 for (var count = 1; count <= Y+1; count++) 954 this[count] = 0; 955 } // makeArray 956 957 958 function stripSpaces (InString) { 959 OutString=""; 960 for (Count=0; Count < InString.length; Count++) { 961 TempChar=InString.substring (Count, Count+1); 962 if (TempChar!=" ") 963 OutString=OutString+TempChar; 964 } 965 return (OutString); 966 } 967 968 function stripChar (InString,symbol) { 969 OutString=""; 970 for (Count=0; Count < InString.length; Count++) { 971 TempChar=InString.substring (Count, Count+1); 972 if (TempChar!=symbol) 973 OutString=OutString+TempChar; 974 } 975 return (OutString); 976 } 977 978 979 function doIt(){ 980 981 fractionMode = false; 982 integerMode = false; 983 var theMode = document.theSpreadsheet.Mode.selectedIndex; 984 if (document.theSpreadsheet.Mode.options[theMode].text == "Fraction") fractionMode = true; 985 else if (document.theSpreadsheet.Mode.options[theMode].text == "Integer") integerMode = true; 986 987 var num = doIt.arguments[0]; 988 989 //********** 990 991 // Option 1 Pivot 992 if (num == 1) 993 { 994 995 readMatrix(); 996 997 if (theMatrix[activeX][activeY] == 0) 998 { 999 okToRoll = false; 1000 document.theSpreadsheet.expr.value = "You cannot pivot on a zero." 1001 } 1002 if (okToRoll) 1003 { 1004 1005 pivot(theMatrix,numRows,numCols,activeX,activeY); 1006 1007 displayMatrix(); 1008 document.theSpreadsheet.expr.value = "Done." 1009 } // of okToRoll 1010 okToRoll = true; // reset 1011 // readMatrix(); // an extra one for TESTING -- not needed 1012 } // end of this option 1013 1014 // Option 2 // preliminary checks 1015 else if (num == 2) 1016 { 1017 okToRoll = true; 1018 stepName = "Rounding information" 1019 var accuracydig = document.theSpreadsheet.acc.value; 1020 1021 if ( (accuracydig == "") || (!looksLikeANumber(accuracydig)) ) { document.theSpreadsheet.expr.value = "Enter a value for the accuracy (Rounding) in the range 1-13."; okToRoll = false} 1022 1023 if (okToRoll) 1024 { 1025 var thenum = eval(accuracydig); 1026 if ((thenum < 1) || (thenum > 14)) {document.theSpreadsheet.expr.value = "Accuracy (Rounding) must be in the range 1-13."; okToRoll = false} 1027 1028 else numSigDigs =thenum; 1029 1030 } // if okToRoll 1031 } // end of this option 1032 1033 // Option 3 (Erase) 1034 else if (num == 3) 1035 { 1036 var count = 0; 1037 document.theSpreadsheet.expr.value = ""; 1038 for (var i = 1; i <= maxRows; i++) 1039 { 1040 for (var j = 1; j <= maxCols; j++) 1041 { 1042 document.theSpreadsheet1[count].value = ""; 1043 count++; 1044 } 1045 } 1046 } // end of this option 1047 1048 // Option 4 Divide by this 1049 else if (num == 4) 1050 { 1051 readMatrix(); 1052 if (theMatrix[activeX][activeY] == 0) 1053 { 1054 okToRoll = false; 1055 document.theSpreadsheet.expr.value = "You cannot divide by zero." 1056 } 1057 if (okToRoll) 1058 { 1059 divideRowbySelection(theMatrix,numRows,numCols,activeX,activeY); 1060 displayMatrix(); 1061 } // of okToRoll 1062 okToRoll = true; // reset 1063 1064 } // of this option 1065 1066 // Option 5 General Row Operation 1067 else if (num == 5) 1068 { 1069 readMatrix(); 1070 var ast = stripSpaces(document.theSpreadsheet.a.value); 1071 var ist = stripSpaces(document.theSpreadsheet.i.value); 1072 var bst = stripSpaces(document.theSpreadsheet.b.value); 1073 var jst = stripSpaces(document.theSpreadsheet.j.value); 1074 if (ast == "") ast = "1"; 1075 if (bst == "") bst = "1"; 1076 if (!looksLikeANumber(ast) || !looksLikeANumber(bst) || !looksLikeANumber(ist) || !looksLikeANumber(jst) ) 1077 { 1078 okToRoll = false; 1079 document.theSpreadsheet.expr.value = "You must first enter numbers in all four fields." 1080 } 1081 var a = eval(ast); 1082 var b = eval(bst); 1083 var i = eval(ist); 1084 if (jst != "") var j = eval(jst); 1085 else var j= 0; // for a single multiple 1086 if (okToRoll) 1087 { 1088 if (a == 0) 1089 { 1090 okToRoll = false; 1091 document.theSpreadsheet.expr.value = "You cannot multliply the changing row by zero." 1092 } 1093 else if ( (i < 0) || (i > numRows) || (Math.round(i) != i)) 1094 { 1095 okToRoll = false; 1096 document.theSpreadsheet.expr.value = "Row "+i+" is not a valid row number." 1097 } 1098 else if ( (j < 0) || (j > numRows) || (Math.round(j) != j) || (j == i)) 1099 { 1100 okToRoll = false; 1101 document.theSpreadsheet.expr.value = "Row "+j+" is not a valid row number." 1102 } 1103 } // end of second batch of tests 1104 1105 if (okToRoll) 1106 { 1107 rowOp(theMatrix,i, j, a, b); 1108 doNotReduce = true; 1109 displayMatrix(); 1110 doNotReduce = false; 1111 1112 } // of okToRoll 1113 okToRoll = true; // reset 1114 } 1115 1116 // Option 6 Display Operations Stack (for debugging) 1117 else if (num == 6) 1118 { 1119 document.theSpreadsheet.output.value = ""; 1120 var str = "Pointer is at #" + stackPtr + cr; 1121 str += "Format: 0/1 , row#, multiple, +/-, row# multiple" + cr; 1122 for (var i = 1; i <= stackPtr; i++) 1123 { 1124 str += operationsStack[i] + cr; 1125 } 1126 document.theSpreadsheet.output.value = str; 1127 } // of this option 1128 1129 // Option 7 Row Swap 1130 else if (num == 7) 1131 { 1132 readMatrix(); 1133 var pst = document.theSpreadsheet.p.value; 1134 var qst = document.theSpreadsheet.q.value; 1135 if (!looksLikeANumber(pst) || !looksLikeANumber(qst) ) 1136 { 1137 okToRoll = false; 1138 document.theSpreadsheet.expr.value = "You must first enter row numbers in both fields." 1139 } 1140 var p = eval(pst); 1141 var q = eval(qst); 1142 if (okToRoll) 1143 { 1144 if ( (p < 0) || (p > numRows) || (Math.round(p) != p)) 1145 { 1146 okToRoll = false; 1147 document.theSpreadsheet.expr.value = "Row "+p+" is not a valid row number." 1148 } 1149 else if ( (q < 0) || (q > numRows) || (Math.round(q) != q)) 1150 { 1151 okToRoll = false; 1152 document.theSpreadsheet.expr.value = "Row "+j+" is not a valid row number." 1153 } 1154 } // end of this round of tests 1155 1156 if (okToRoll) 1157 { 1158 swapRows(theMatrix,p,q); 1159 displayMatrix(); 1160 } // of okToRoll 1161 okToRoll = true; // reset 1162 1163 } // end of option 7 1164 1165 // Option 8 Row Reduce 1166 else if (num == 8) 1167 { 1168 readMatrix(); 1169 rowReduce(); 1170 displayMatrix(); 1171 document.theSpreadsheet.expr.value = "The matrix is reduced." 1172 } // end of Option 8 1173 1174 } // end of doIt 1175 1176 </script> 1177 </head> 1178 1179 1180 <title>Matrix Row Operation Tool</title> 1181 <meta name = "Matrix Gauss Jordan Utility" content = "Part of the Finite Math & Applied Calculus resource site at http://www.hofstra.edu/~matscw/realworld.html "> 1182 1183 <body bgcolor = FFFFFF link= 444444 vlink=888888 alink = FFFF00 text = "000000"> 1184 <center> 1185 <h2><font color = "000000">Pivot & Gauss-Jordan Tool</font></h2> 1186 <h3><font color = "000000">A Utility for Row Operations</font></h3> 1187 </center> 1188 1189 <!-- 1190 <! *** Navigation Links ***> 1191 <center><img src = "../elts/greyline.gif"></center> 1192 <center> 1193 <table cellpadding = 3> 1194 <tr> 1195 1196 1197 <td align = center> 1198 <a href="../Summary2.html"><img src = "../ball/greyball.gif" border = 0><br><font size = 3><b>Summary of Systems of Linear Equations</font></a> 1199 </td> 1200 1201 <td align = center> 1202 <a href="frames2_2.html"><img src = "../ball/greyball.gif" border = 0><br><font size = 3><b>Tutorial on Row Operations</font></a> 1203 </td> 1204 1205 <td align = center> 1206 <a href="../realworld.html"><img src = "../ball/greyball.gif" border = 0><br><font size = 3><b>Real World Main Page</font></a> 1207 </td> 1208 1209 </tr> 1210 1211 <tr> 1212 1213 <td align = center> <a href="../tcfinitep.html"><img src = "../elts/redptr.gif" border = 0><br><b><font size = 3 color = "crimson"><i>Finite Mathematics Applied to the Real World</i></font></a></td> 1214 <td align = center> <a href="../tccalcp.html"><img src = "../elts/yellowptr.gif" border = 0><br><b><font size = 3 color = "darkorange"><i>Calculus Applied to the Real World</i></font></a></td> 1215 <td align = center> <a href="../tccombop.html"><img src = "../elts/blueptr.gif" border = 0><br><b><font size = 3 color = "blue"><i>Finite Mathematics & Calculus Applied to the Real World</i></font></a></td> 1216 </tr> 1217 1218 </table> 1219 <img src = "../elts/greyline.gif"> 1220 </center> 1221 <! *** End Navigation Links ***> 1222 --> 1223 1224 1225 <p>Use of this utility is quite intuitive. Just enter the matrix entries in the spreadsheet below (in fraction or decimal form; use the tab key to move from one cell to the next) and tell the program what to do. You can use as many cells as you like -- just leave unused cells blank. (This javascript utility supercedes the <a href="javapiv.html">older java applet</a>.) 1226 <p><UL type = "dot"> 1227 <LI>Decimal mode displays all the entries as decimals, rounded to the number of significant digits you have selected (up to 13, depending on your processor and browser).</LI> 1228 <LI>Fraction mode converts all decimals to fractions and displays all the tableaus (and solutions) as fractions.</LI> 1229 <LI>Integer Mode eliminates decimals and fractions (using the method in <i><font color = "crimson">Finite Mathematics Applied to the Real World</font></i>) and displays the solution as fractions. </LI> 1230 <LI>"Save This" saves the current matrix and mode, and "Revert to Saved" restores the saved matrix.</LI> 1231 <LI><b>Row Operations</b> You can use the "Row Operation" fields to either multiply a row by a constant, or replace the first-named row by a combination with the second. If you are in Integer mode and perform an operation that results in fractions, the utility will automatically switch to Fraction mode. (Press "Undo" to undo such an operation and mode change.)</LI> 1232 <li> For example: To replace the second row, by the second row with twice the first row added to it, you type <p> 1233 add 2 times Row 1 to 1 times Row 2 1234 <p> 1235 To divide the entire second row by 4 type<br> 1236 add <blank> times Row <blank> to 1/4 times Row 2<p> 1237 It's important to leave the unused entries blank. Inserting 1238 a zero in place of the blank will cause problems. 1239 <li> 1240 1241 </UL> 1242 <center> 1243 <p> 1244 <center> 1245 <p> 1246 1247 <form name="theSpreadsheet"> 1248 <table border = 1 noshade bgcolor = DDDDDD> 1249 <tr><td align = center> 1250 <!-- 1251 <input type="button" value = "Pivot on Selection" onClick="doIt(1)"> 1252 <input type="button" value = "Divide Row by Selection" onClick="doIt(4)"> 1253 <input type="button" value = "Reduce Completely" onClick="doIt(8)"> 1254 --> 1255 1256 <br> 1257 <input type="button" value = "Undo" onClick="backUp()"> 1258 <input type="button" value = "Redo" onClick="reDo()"> 1259 <input type="button" value = "Save This" onClick="saveThis = true; readMatrix(); document.theSpreadsheet.expr.value = 'OK Matrix Saved.'"> 1260 <input type="button" value = "Revert to Saved" onClick="Revert()"> 1261 <input type="button" value = "Erase Everything" onClick="doIt(3)"> 1262 <br> 1263 <b>Row Operation: add </b> <input type = text size = 15 value = "" name = "b"> times Row 1264 <input type = text size = 2 value = "" name = "j"> to <input type = text size = 15 value = "1" name = "a"> 1265 times Row <input type = text size = 2 value = "" name = "i"> 1266 <input type="button" value = "Do It" onClick="doIt(5)"> 1267 <br><b>Swap Rows: </b><input type = text size = 2 value = "" name = "p"> and 1268 <input type = text size = 2 value = "" name = "q"> <input type="button" value = "Swap Them" onClick="doIt(7)"> 1269 1270 <br>Rounding: <input type=text size=2 value="6" name="acc"> significant digits 1271 Mode: <SELECT NAME = "Mode" SIZE = 3 NOSCROLL onChange="readMatrix(); displayMatrix()"> 1272 <OPTION SELECTED>Decimal 1273 <OPTION>Fraction 1274 <OPTION>Integer 1275 </SELECT> 1276 </td> 1277 </tr> 1278 1279 <tr><td align = center><input type=text size=80 value="" name="expr" value = "Messages will appear here."> 1280 </td></tr> 1281 1282 </table> 1283 </form> 1284 1285 <form name = "labels"> 1286 <table bgcolor = DDDDDD> 1287 <tr> 1288 <td><input type=text size=10 value=" x1" name="k"></td> 1289 <td><input type=text size=10 value=" x2" name="k"></td> 1290 <td><input type=text size=10 value=" x3" name="k"></td> 1291 <td><input type=text size=10 value=" x4" name="k"></td> 1292 <td><input type=text size=10 value=" x5" name="k"></td> 1293 <td><input type=text size=10 value=" x6" name="k"></td> 1294 <td><input type=text size=10 value=" x7" name="k"></td> 1295 <td><input type=text size=10 value=" x8" name="k"></td> 1296 <td><input type=text size=10 value=" x9" name="k"></td> 1297 <td><input type=text size=10 value=" x10" name="k"></td> 1298 <td><input type=text size=10 value=" x11" name="k"></td> 1299 <td><input type=text size=10 value=" x12" name="k"></td> 1300 <td><input type=text size=10 value=" x13" name="k"></td> 1301 <td><input type=text size=10 value=" x14" name="k"></td> 1302 <td><input type=text size=10 value=" x15" name="k"></td> 1303 </tr> 1304 </table> 1305 </form> 1306 1307 <form name = "theSpreadsheet1" cellpadding = 0> 1308 1309 <table> 1310 <tr> 1311 <td><input type=text size=10 value="" name="k" onFocus = "checkIn(1,1)" onBlur = "handleBlur()"></td> 1312 <td><input type=text size=10 value="" name="k" onFocus = "checkIn(1,2)" onBlur = "handleBlur()"></td> 1313 <td><input type=text size=10 value="" name="k" onFocus = "checkIn(1,3)" onBlur = "handleBlur()"></td> 1314 <td><input type=text size=10 value="" name="k" onFocus = "checkIn(1,4)" onBlur = "handleBlur()"></td> 1315 <td><input type=text size=10 value="" name="k" onFocus = "checkIn(1,5)" onBlur = "handleBlur()"></td> 1316 <td><input type=text size=10 value="" name="k" onFocus = "checkIn(1,6)" onBlur = "handleBlur()"></td> 1317 <td><input type=text size=10 value="" name="k" onFocus = "checkIn(1,7)" onBlur = "handleBlur()"></td> 1318 <td><input type=text size=10 value="" name="k" onFocus = "checkIn(1,8)" onBlur = "handleBlur()"></td> 1319 <td><input type=text size=10 value="" name="k" onFocus = "checkIn(1,9)" onBlur = "handleBlur()"></td> 1320 <td><input type=text size=10 value="" name="k" onFocus = "checkIn(1,10)" onBlur = "handleBlur()"></td> 1321 <td><input type=text size=10 value="" name="k" onFocus = "checkIn(1,11)" onBlur = "handleBlur()"></td> 1322 <td><input type=text size=10 value="" name="k" onFocus = "checkIn(1,12)" onBlur = "handleBlur()"></td> 1323 <td><input type=text size=10 value="" name="k" onFocus = "checkIn(1,13)" onBlur = "handleBlur()"></td> 1324 <td><input type=text size=10 value="" name="k" onFocus = "checkIn(1,14)" onBlur = "handleBlur()"></td> 1325 <td><input type=text size=10 value="" name="k" onFocus = "checkIn(1,15)" onBlur = "handleBlur()"></td> 1326 </tr> 1327 <tr> 1328 <td><input type=text size=10 value="" name="k" onFocus = "checkIn(2,1)" onBlur = "handleBlur()"></td> 1329 <td><input type=text size=10 value="" name="k" onFocus = "checkIn(2,2)" onBlur = "handleBlur()"></td> 1330 <td><input type=text size=10 value="" name="k" onFocus = "checkIn(2,3)" onBlur = "handleBlur()"></td> 1331 <td><input type=text size=10 value="" name="k" onFocus = "checkIn(2,4)" onBlur = "handleBlur()"></td> 1332 <td><input type=text size=10 value="" name="k" onFocus = "checkIn(2,5)" onBlur = "handleBlur()"></td> 1333 <td><input type=text size=10 value="" name="k" onFocus = "checkIn(2,6)" onBlur = "handleBlur()"></td> 1334 <td><input type=text size=10 value="" name="k" onFocus = "checkIn(2,7)" onBlur = "handleBlur()"></td> 1335 <td><input type=text size=10 value="" name="k" onFocus = "checkIn(2,8)" onBlur = "handleBlur()"></td> 1336 <td><input type=text size=10 value="" name="k" onFocus = "checkIn(2,9)" onBlur = "handleBlur()"></td> 1337 <td><input type=text size=10 value="" name="k" onFocus = "checkIn(2,10)" onBlur = "handleBlur()"></td> 1338 <td><input type=text size=10 value="" name="k" onFocus = "checkIn(2,11)" onBlur = "handleBlur()"></td> 1339 <td><input type=text size=10 value="" name="k" onFocus = "checkIn(2,12)" onBlur = "handleBlur()"></td> 1340 <td><input type=text size=10 value="" name="k" onFocus = "checkIn(2,13)" onBlur = "handleBlur()"></td> 1341 <td><input type=text size=10 value="" name="k" onFocus = "checkIn(2,14)" onBlur = "handleBlur()"></td> 1342 <td><input type=text size=10 value="" name="k" onFocus = "checkIn(2,15)" onBlur = "handleBlur()"></td> 1343 </tr> 1344 <tr> 1345 <td><input type=text size=10 value="" name="k" onFocus = "checkIn(3,1)" onBlur = "handleBlur()"></td> 1346 <td><input type=text size=10 value="" name="k" onFocus = "checkIn(3,2)" onBlur = "handleBlur()"></td> 1347 <td><input type=text size=10 value="" name="k" onFocus = "checkIn(3,3)" onBlur = "handleBlur()"></td> 1348 <td><input type=text size=10 value="" name="k" onFocus = "checkIn(3,4)" onBlur = "handleBlur()"></td> 1349 <td><input type=text size=10 value="" name="k" onFocus = "checkIn(3,5)" onBlur = "handleBlur()"></td> 1350 <td><input type=text size=10 value="" name="k" onFocus = "checkIn(3,6)" onBlur = "handleBlur()"></td> 1351 <td><input type=text size=10 value="" name="k" onFocus = "checkIn(3,7)" onBlur = "handleBlur()"></td> 1352 <td><input type=text size=10 value="" name="k" onFocus = "checkIn(3,8)" onBlur = "handleBlur()"></td> 1353 <td><input type=text size=10 value="" name="k" onFocus = "checkIn(3,9)" onBlur = "handleBlur()"></td> 1354 <td><input type=text size=10 value="" name="k" onFocus = "checkIn(3,10)" onBlur = "handleBlur()"></td> 1355 <td><input type=text size=10 value="" name="k" onFocus = "checkIn(3,11)" onBlur = "handleBlur()"></td> 1356 <td><input type=text size=10 value="" name="k" onFocus = "checkIn(3,12)" onBlur = "handleBlur()"></td> 1357 <td><input type=text size=10 value="" name="k" onFocus = "checkIn(3,13)" onBlur = "handleBlur()"></td> 1358 <td><input type=text size=10 value="" name="k" onFocus = "checkIn(3,14)" onBlur = "handleBlur()"></td> 1359 <td><input type=text size=10 value="" name="k" onFocus = "checkIn(3,15)" onBlur = "handleBlur()"></td> 1360 </tr> 1361 <tr> 1362 <td><input type=text size=10 value="" name="k" onFocus = "checkIn(4,1)" onBlur = "handleBlur()"></td> 1363 <td><input type=text size=10 value="" name="k" onFocus = "checkIn(4,2)" onBlur = "handleBlur()"></td> 1364 <td><input type=text size=10 value="" name="k" onFocus = "checkIn(4,3)" onBlur = "handleBlur()"></td> 1365 <td><input type=text size=10 value="" name="k" onFocus = "checkIn(4,4)" onBlur = "handleBlur()"></td> 1366 <td><input type=text size=10 value="" name="k" onFocus = "checkIn(4,5)" onBlur = "handleBlur()"></td> 1367 <td><input type=text size=10 value="" name="k" onFocus = "checkIn(4,6)" onBlur = "handleBlur()"></td> 1368 <td><input type=text size=10 value="" name="k" onFocus = "checkIn(4,7)" onBlur = "handleBlur()"></td> 1369 <td><input type=text size=10 value="" name="k" onFocus = "checkIn(4,8)" onBlur = "handleBlur()"></td> 1370 <td><input type=text size=10 value="" name="k" onFocus = "checkIn(4,9)" onBlur = "handleBlur()"></td> 1371 <td><input type=text size=10 value="" name="k" onFocus = "checkIn(4,10)" onBlur = "handleBlur()"></td> 1372 <td><input type=text size=10 value="" name="k" onFocus = "checkIn(4,11)" onBlur = "handleBlur()"></td> 1373 <td><input type=text size=10 value="" name="k" onFocus = "checkIn(4,12)" onBlur = "handleBlur()"></td> 1374 <td><input type=text size=10 value="" name="k" onFocus = "checkIn(4,13)" onBlur = "handleBlur()"></td> 1375 <td><input type=text size=10 value="" name="k" onFocus = "checkIn(4,14)" onBlur = "handleBlur()"></td> 1376 <td><input type=text size=10 value="" name="k" onFocus = "checkIn(4,15)" onBlur = "handleBlur()"></td> 1377 </tr> 1378 <tr> 1379 <td><input type=text size=10 value="" name="k" onFocus = "checkIn(5,1)" onBlur = "handleBlur()"></td> 1380 <td><input type=text size=10 value="" name="k" onFocus = "checkIn(5,2)" onBlur = "handleBlur()"></td> 1381 <td><input type=text size=10 value="" name="k" onFocus = "checkIn(5,3)" onBlur = "handleBlur()"></td> 1382 <td><input type=text size=10 value="" name="k" onFocus = "checkIn(5,4)" onBlur = "handleBlur()"></td> 1383 <td><input type=text size=10 value="" name="k" onFocus = "checkIn(5,5)" onBlur = "handleBlur()"></td> 1384 <td><input type=text size=10 value="" name="k" onFocus = "checkIn(5,6)" onBlur = "handleBlur()"></td> 1385 <td><input type=text size=10 value="" name="k" onFocus = "checkIn(5,7)" onBlur = "handleBlur()"></td> 1386 <td><input type=text size=10 value="" name="k" onFocus = "checkIn(5,8)" onBlur = "handleBlur()"></td> 1387 <td><input type=text size=10 value="" name="k" onFocus = "checkIn(5,9)" onBlur = "handleBlur()"></td> 1388 <td><input type=text size=10 value="" name="k" onFocus = "checkIn(5,10)" onBlur = "handleBlur()"></td> 1389 <td><input type=text size=10 value="" name="k" onFocus = "checkIn(5,11)" onBlur = "handleBlur()"></td> 1390 <td><input type=text size=10 value="" name="k" onFocus = "checkIn(5,12)" onBlur = "handleBlur()"></td> 1391 <td><input type=text size=10 value="" name="k" onFocus = "checkIn(5,13)" onBlur = "handleBlur()"></td> 1392 <td><input type=text size=10 value="" name="k" onFocus = "checkIn(5,14)" onBlur = "handleBlur()"></td> 1393 <td><input type=text size=10 value="" name="k" onFocus = "checkIn(5,15)" onBlur = "handleBlur()"></td> 1394 </tr> 1395 <tr> 1396 <td><input type=text size=10 value="" name="k" onFocus = "checkIn(6,1)" onBlur = "handleBlur()"></td> 1397 <td><input type=text size=10 value="" name="k" onFocus = "checkIn(6,2)" onBlur = "handleBlur()"></td> 1398 <td><input type=text size=10 value="" name="k" onFocus = "checkIn(6,3)" onBlur = "handleBlur()"></td> 1399 <td><input type=text size=10 value="" name="k" onFocus = "checkIn(6,4)" onBlur = "handleBlur()"></td> 1400 <td><input type=text size=10 value="" name="k" onFocus = "checkIn(6,5)" onBlur = "handleBlur()"></td> 1401 <td><input type=text size=10 value="" name="k" onFocus = "checkIn(6,6)" onBlur = "handleBlur()"></td> 1402 <td><input type=text size=10 value="" name="k" onFocus = "checkIn(6,7)" onBlur = "handleBlur()"></td> 1403 <td><input type=text size=10 value="" name="k" onFocus = "checkIn(6,8)" onBlur = "handleBlur()"></td> 1404 <td><input type=text size=10 value="" name="k" onFocus = "checkIn(6,9)" onBlur = "handleBlur()"></td> 1405 <td><input type=text size=10 value="" name="k" onFocus = "checkIn(6,10)" onBlur = "handleBlur()"></td> 1406 <td><input type=text size=10 value="" name="k" onFocus = "checkIn(6,11)" onBlur = "handleBlur()"></td> 1407 <td><input type=text size=10 value="" name="k" onFocus = "checkIn(6,12)" onBlur = "handleBlur()"></td> 1408 <td><input type=text size=10 value="" name="k" onFocus = "checkIn(6,13)" onBlur = "handleBlur()"></td> 1409 <td><input type=text size=10 value="" name="k" onFocus = "checkIn(6,14)" onBlur = "handleBlur()"></td> 1410 <td><input type=text size=10 value="" name="k" onFocus = "checkIn(6,15)" onBlur = "handleBlur()"></td> 1411 </tr> 1412 <tr> 1413 <td><input type=text size=10 value="" name="k" onFocus = "checkIn(7,1)" onBlur = "handleBlur()"></td> 1414 <td><input type=text size=10 value="" name="k" onFocus = "checkIn(7,2)" onBlur = "handleBlur()"></td> 1415 <td><input type=text size=10 value="" name="k" onFocus = "checkIn(7,3)" onBlur = "handleBlur()"></td> 1416 <td><input type=text size=10 value="" name="k" onFocus = "checkIn(7,4)" onBlur = "handleBlur()"></td> 1417 <td><input type=text size=10 value="" name="k" onFocus = "checkIn(7,5)" onBlur = "handleBlur()"></td> 1418 <td><input type=text size=10 value="" name="k" onFocus = "checkIn(7,6)" onBlur = "handleBlur()"></td> 1419 <td><input type=text size=10 value="" name="k" onFocus = "checkIn(7,7)" onBlur = "handleBlur()"></td> 1420 <td><input type=text size=10 value="" name="k" onFocus = "checkIn(7,8)" onBlur = "handleBlur()"></td> 1421 <td><input type=text size=10 value="" name="k" onFocus = "checkIn(7,9)" onBlur = "handleBlur()"></td> 1422 <td><input type=text size=10 value="" name="k" onFocus = "checkIn(7,10)" onBlur = "handleBlur()"></td> 1423 <td><input type=text size=10 value="" name="k" onFocus = "checkIn(7,11)" onBlur = "handleBlur()"></td> 1424 <td><input type=text size=10 value="" name="k" onFocus = "checkIn(7,12)" onBlur = "handleBlur()"></td> 1425 <td><input type=text size=10 value="" name="k" onFocus = "checkIn(7,13)" onBlur = "handleBlur()"></td> 1426 <td><input type=text size=10 value="" name="k" onFocus = "checkIn(7,14)" onBlur = "handleBlur()"></td> 1427 <td><input type=text size=10 value="" name="k" onFocus = "checkIn(7,15)" onBlur = "handleBlur()"></td> 1428 </tr> 1429 <tr> 1430 <td><input type=text size=10 value="" name="k" onFocus = "checkIn(8,1)" onBlur = "handleBlur()"></td> 1431 <td><input type=text size=10 value="" name="k" onFocus = "checkIn(8,2)" onBlur = "handleBlur()"></td> 1432 <td><input type=text size=10 value="" name="k" onFocus = "checkIn(8,3)" onBlur = "handleBlur()"></td> 1433 <td><input type=text size=10 value="" name="k" onFocus = "checkIn(8,4)" onBlur = "handleBlur()"></td> 1434 <td><input type=text size=10 value="" name="k" onFocus = "checkIn(8,5)" onBlur = "handleBlur()"></td> 1435 <td><input type=text size=10 value="" name="k" onFocus = "checkIn(8,6)" onBlur = "handleBlur()"></td> 1436 <td><input type=text size=10 value="" name="k" onFocus = "checkIn(8,7)" onBlur = "handleBlur()"></td> 1437 <td><input type=text size=10 value="" name="k" onFocus = "checkIn(8,8)" onBlur = "handleBlur()"></td> 1438 <td><input type=text size=10 value="" name="k" onFocus = "checkIn(8,9)" onBlur = "handleBlur()"></td> 1439 <td><input type=text size=10 value="" name="k" onFocus = "checkIn(8,10)" onBlur = "handleBlur()"></td> 1440 <td><input type=text size=10 value="" name="k" onFocus = "checkIn(8,11)" onBlur = "handleBlur()"></td> 1441 <td><input type=text size=10 value="" name="k" onFocus = "checkIn(8,12)" onBlur = "handleBlur()"></td> 1442 <td><input type=text size=10 value="" name="k" onFocus = "checkIn(8,13)" onBlur = "handleBlur()"></td> 1443 <td><input type=text size=10 value="" name="k" onFocus = "checkIn(8,14)" onBlur = "handleBlur()"></td> 1444 <td><input type=text size=10 value="" name="k" onFocus = "checkIn(8,15)" onBlur = "handleBlur()"></td> 1445 </tr> 1446 <tr> 1447 <td><input type=text size=10 value="" name="k" onFocus = "checkIn(9,1)" onBlur = "handleBlur()"></td> 1448 <td><input type=text size=10 value="" name="k" onFocus = "checkIn(9,2)" onBlur = "handleBlur()"></td> 1449 <td><input type=text size=10 value="" name="k" onFocus = "checkIn(9,3)" onBlur = "handleBlur()"></td> 1450 <td><input type=text size=10 value="" name="k" onFocus = "checkIn(9,4)" onBlur = "handleBlur()"></td> 1451 <td><input type=text size=10 value="" name="k" onFocus = "checkIn(9,5)" onBlur = "handleBlur()"></td> 1452 <td><input type=text size=10 value="" name="k" onFocus = "checkIn(9,6)" onBlur = "handleBlur()"></td> 1453 <td><input type=text size=10 value="" name="k" onFocus = "checkIn(9,7)" onBlur = "handleBlur()"></td> 1454 <td><input type=text size=10 value="" name="k" onFocus = "checkIn(9,8)" onBlur = "handleBlur()"></td> 1455 <td><input type=text size=10 value="" name="k" onFocus = "checkIn(9,9)" onBlur = "handleBlur()"></td> 1456 <td><input type=text size=10 value="" name="k" onFocus = "checkIn(9,10)" onBlur = "handleBlur()"></td> 1457 <td><input type=text size=10 value="" name="k" onFocus = "checkIn(9,11)" onBlur = "handleBlur()"></td> 1458 <td><input type=text size=10 value="" name="k" onFocus = "checkIn(9,12)" onBlur = "handleBlur()"></td> 1459 <td><input type=text size=10 value="" name="k" onFocus = "checkIn(9,13)" onBlur = "handleBlur()"></td> 1460 <td><input type=text size=10 value="" name="k" onFocus = "checkIn(9,14)" onBlur = "handleBlur()"></td> 1461 <td><input type=text size=10 value="" name="k" onFocus = "checkIn(9,15)" onBlur = "handleBlur()"></td> 1462 </tr> 1463 <tr> 1464 <td><input type=text size=10 value="" name="k" onFocus = "checkIn(10,1)" onBlur = "handleBlur()"></td> 1465 <td><input type=text size=10 value="" name="k" onFocus = "checkIn(10,2)" onBlur = "handleBlur()"></td> 1466 <td><input type=text size=10 value="" name="k" onFocus = "checkIn(10,3)" onBlur = "handleBlur()"></td> 1467 <td><input type=text size=10 value="" name="k" onFocus = "checkIn(10,4)" onBlur = "handleBlur()"></td> 1468 <td><input type=text size=10 value="" name="k" onFocus = "checkIn(10,5)" onBlur = "handleBlur()"></td> 1469 <td><input type=text size=10 value="" name="k" onFocus = "checkIn(10,6)" onBlur = "handleBlur()"></td> 1470 <td><input type=text size=10 value="" name="k" onFocus = "checkIn(10,7)" onBlur = "handleBlur()"></td> 1471 <td><input type=text size=10 value="" name="k" onFocus = "checkIn(10,8)" onBlur = "handleBlur()"></td> 1472 <td><input type=text size=10 value="" name="k" onFocus = "checkIn(10,9)" onBlur = "handleBlur()"></td> 1473 <td><input type=text size=10 value="" name="k" onFocus = "checkIn(10,10)" onBlur = "handleBlur()"></td> 1474 <td><input type=text size=10 value="" name="k" onFocus = "checkIn(10,11)" onBlur = "handleBlur()"></td> 1475 <td><input type=text size=10 value="" name="k" onFocus = "checkIn(10,12)" onBlur = "handleBlur()"></td> 1476 <td><input type=text size=10 value="" name="k" onFocus = "checkIn(10,13)" onBlur = "handleBlur()"></td> 1477 <td><input type=text size=10 value="" name="k" onFocus = "checkIn(10,14)" onBlur = "handleBlur()"></td> 1478 <td><input type=text size=10 value="" name="k" onFocus = "checkIn(10,15)" onBlur = "handleBlur()"></td> 1479 </tr> 1480 </table> 1481 </center> 1482 1483 </form> 1484 1485 1486 1487 <p><b>Disclaimer: </b>Browsers sometimes crash when running computation-intensive Javascript code. Make sure your important work is saved before running this utility. 1488 1489 1490 <!****endmatter*****> 1491 <p><CENTER>Last Updated:<I> April, 1999</I></CENTER> 1492 <center> Copyright © 1999 Stefan Waner and Steven R. Costenoble -- This utility has been modifed by Michael Gage, to meet specific classroom purposes. The full utility can be found at the links above. </Center> 1493 </HTML> 1494 1495 1496
| aubreyja at gmail dot com | ViewVC Help |
| Powered by ViewVC 1.0.9 |