﻿/* Rational simplex 27.07.2019 */ /* global bigrat */ /* Determine initial variables */ var EPSILON = bigRat(1, 1E10), FACTOR = 25, INFINITY = nines(), TAB = 7, ZERO = bigRat(), a = new Array(), b = new Array(), e = new Array(), n1 = new Array(), n2 = new Array(), s = new Array(), bv = new Array(), mbv = new Array(), nbv = new Array(), tab = new Array(), i, j, k, l, m, n, beq, bet, ble, cb, cn, ms, ns, prog = 1, rule = 1, op = 1, opt = 1, max, min, few = true, less, nor1 = false, nor2 = false, output = true, perts, red = false, scal = false, solve, steps, status, str, tmp; function form() { /* Build and write form */ var form = '
'; form += ""; form += ""; form += ''; form += ''; form += ''; form += '
 Please, input linear programme (separators spaces, last rowobjective function, first column right-hand sides as in the example): Result (not the number of the correct decimal places matters, but the time complexity and the number of steps of the simplex method): '; form += '    23456'; form += '789101112131415'; form += ' rows    23456'; form += '789101112131415'; form += ' columns    Example 1Example 2'; form += 'Example 3Example 4Example 5Example 6Example 7Example 8Example 9Example 10 examples '; form += '        '; if (output) form += ' detailed output    '; else form += ' detailed output    '; if (prog == 1) form += ' primal  '; else form += ' primal  '; if (prog == 2) form += ' dual  '; else form += ' dual  '; if (rule == 1) form += ' steepest edge  '; else form += ' steepest edge  '; if (rule == 2) form += ' greatest value  '; else form += ' greatest value  '; if (rule == 3) form += ' smallest angle  '; else form += ' smallest angle  '; if (opt == 1) form += ' maximum  '; else form += ' maximum  '; if (opt == 2) form += ' minimum  '; else form += ' minimum  '; if (op == 1) form += ' ≤  '; else form += ' ≤  '; if (op == 2) form += ' ≥ '; else form += ' ≥ '; form += '    '; if (red) form += ' determine redundant constraints    '; else form += ' determine redundant constraints    '; if (few) form += ' minimise number of contraints    '; else form += ' minimise number of contraints    '; if (nor1) form += ' 1st normalisation    '; else form += ' 1st normalisation    '; if (scal) form += ' scaling    '; else form += ' scaling    '; if (nor2) form += ' 2nd normalisation