/*----------------------------------------------------------------------------
lsp_expand_1  - check for lower (0-4)
----------------------------------------------------------------------------
343623
public static void lsp_expand_1(
	 float  buf[],          /* in/out: lsp vectors  */
	 float gap
	)
	{
	   int   j;
	   float diff, tmp;

	   for(j=1; j<LD8KConstants.NC; j++) {
	      diff = buf[j-1] - buf[j];
	      tmp  = (diff + gap) * (float)0.5;
	      if(tmp >  0) {
	         buf[j-1] -= tmp;
	         buf[j]   += tmp;
	      }
	   }
	    return;
	}
520135
function checkDeclaration1(i) {
  const start = i;
  let l;

  if (i >= tokensLength) return 0;

  if (l = checkProperty(i)) i += l;
  else return 0;

  if (l = checkSC(i)) i += l;

  if (l = checkPropertyDelim(i)) i++;
  else return 0;

  if (l = checkValue(i)) return i + l - start;

  if (l = checkS(i)) i += l;

  if (l = checkValue(i)) i += l;
  else return 0;

  return i - start;
}
98646
public static void lsp_expand_2(
	 float  buf[],          /*in/out: lsp vectors  */
	 float gap

	)
	{
	   int   j;
	   float diff, tmp;

	   for(j=LD8KConstants.NC; j<LD8KConstants.M; j++) {
	      diff = buf[j-1] - buf[j];
	      tmp  = (diff + gap) * (float)0.5;
	      if(tmp >  0) {
	         buf[j-1] -= tmp;
	         buf[j]   += tmp;
	      }
	   }
	    return;
	}
1362123
function(q, lowerTail, logp) {
        return lowerTail ? logp ? log1p(-q) : 1 - q
                         : logp ? Math.log(q) : q;
      }
680046
private State checkL(State state) throws DatatypeException, IOException {
        if (state.context.length() == 0) {
            state = appendToContext(state);
        }
        state.current = state.reader.read();
        state = appendToContext(state);
        state = skipSpaces(state);
        _checkL('L', true, state);
        return state;
    }
1302259
function LSR() {
		var value = modRead();

		flagN = 0;
		flagC = ( value & 0x01 ) && 1;
		var result = write( (value >>> 1) & 0xff );
		flagZ = +( result === 0 );
	}
1112084
public static void lsp_stability(
	 float  buf[]           /*in/out: LSP parameters  */
	)
	{
	   int   j;
	   float diff, tmp;


	   for(j=0; j<LD8KConstants.M-1; j++) {
	      diff = buf[j+1] - buf[j];
	      if( diff < (float)0. ) {
	         tmp      = buf[j+1];
	         buf[j+1] = buf[j];
	         buf[j]   = tmp;
	      }
	   }

	   if( buf[0] < LD8KConstants.L_LIMIT ) {
	      buf[0] = LD8KConstants.L_LIMIT;
	      System.out.println("warning LSP Low \n");
	   }
	   for(j=0; j<LD8KConstants.M-1; j++) {
	      diff = buf[j+1] - buf[j];
	      if( diff < LD8KConstants.GAP3 ) {
	        buf[j+1] = buf[j]+ LD8KConstants.GAP3;
	      }
	   }
	   if( buf[LD8KConstants.M-1] > LD8KConstants.M_LIMIT ) {
	      buf[LD8KConstants.M-1] = LD8KConstants.M_LIMIT;
	      System.out.println("warning LSP High \n");
	   }
	   return;
	}
561969
def lower(self):
        
        q = self.copy()
        q.addFunction(Query.Function.Lower)
        return q
743465
function (start, length) {
            if (!start) {
                start = 0;
            }
            var contents = this.getFileContents();
            if (null !== contents) {
                var lines = (contents).split("\n");

                // Get a subset of lines from $start to $end
                if (length !== null) {
                    start = parseInt(start);
                    length = parseInt(length);
                    if (start < 0) {
                        start = 0;
                    }

                    if (length <= 0) {
                        throw new RangeError(
                            "length cannot be lower or equal to 0"
                        );
                    }

                    lines = lines.slice(start, start + length);
                }

                return lines;
            }
        }
560385
function expandFilter( that, trigger ) {
			that.debug.groupStart( 'expandFilter' ); // %REMOVE_LINE%

			var upper = trigger.upper,
				lower = trigger.lower;

			if ( !upper || !lower 											// NOT: EDGE_MIDDLE trigger ALWAYS has two elements.
				|| isFlowBreaker( lower ) || isFlowBreaker( upper )			// NOT: one of the elements is floated or positioned
				|| lower.equals( upper ) || upper.equals( lower ) 			// NOT: two trigger elements, one equals another.
				|| lower.contains( upper ) || upper.contains( lower ) ) { 	// NOT: two trigger elements, one contains another.
				that.debug.logEnd( 'REJECTED. No upper or no lower or they contain each other.' ); // %REMOVE_LINE%

				return false;
			}

			// YES: two trigger elements, pure siblings.
			else if ( isTrigger( that, upper ) && isTrigger( that, lower ) && areSiblings( that, upper, lower ) ) {
				that.debug.logElementsEnd( [ upper, lower ], // %REMOVE_LINE%
					[ 'upper', 'lower' ], 'APPROVED EDGE_MIDDLE' ); // %REMOVE_LINE%

				return true;
			}

			that.debug.logElementsEnd( [ upper, lower ], // %REMOVE_LINE%
				[ 'upper', 'lower' ], 'Rejected unknown pair' ); // %REMOVE_LINE%

			return false;
		}
1165805
@Override
  public IScan getScanByNumLower(int scanNum) {
    IScan scan = getNum2scan().lowerEntry(scanNum).getValue();
    if (scan != null) {
      return scan;
    }
    return null;
  }
924122
private static boolean isAllowed(char c, String allow) {
        return (c >= 'A' && c <= 'Z')
                || (c >= 'a' && c <= 'z')
                || (c >= '0' && c <= '9')
                || "_-!.~'()*".indexOf(c) != NOT_FOUND
                || (allow != null && allow.indexOf(c) != NOT_FOUND);
    }
186402
@Override
    public ZMatrixRMaj getLower(ZMatrixRMaj lower )
    {
        int numRows = LU.numRows;
        int numCols = LU.numRows < LU.numCols ? LU.numRows : LU.numCols;

        lower = UtilDecompositons_ZDRM.checkZerosUT(lower, numRows,numCols);

        for( int i = 0; i < numCols; i++ ) {
            lower.set(i,i,1.0,0.0);

            for( int j = 0; j < i; j++ ) {
                int indexLU = LU.getIndex(i,j);
                int indexL = lower.getIndex(i,j);

                double real = LU.data[indexLU];
                double imaginary = LU.data[indexLU+1];

                lower.data[indexL] = real;
                lower.data[indexL+1] = imaginary;
            }
        }

        if( numRows > numCols ) {
            for( int i = numCols; i < numRows; i++ ) {
                for( int j = 0; j < numCols; j++ ) {
                    int indexLU = LU.getIndex(i,j);
                    int indexL = lower.getIndex(i,j);

                    double real = LU.data[indexLU];
                    double imaginary = LU.data[indexLU+1];

                    lower.data[indexL] = real;
                    lower.data[indexL+1] = imaginary;
                }
            }
        }
        return lower;
    }
1364748
function betterTrim(snippetEl) {
		// Helper functions
		function trimLeft(val) {
			// Adapted from https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/Trim#Polyfill
			return val.replace(/^[\s\uFEFF\xA0]+/g, '');
		}
		function trimLineBreaks(input) {
			var lines = input.split('\n');

			// Trim line-breaks from the beginning
			for (var i = 0; i < lines.length; i++) {
				if (lines[i].trim() === '') {
					lines.splice(i--, 1);
				} else break;
			}

			// Trim line-breaks from the end
			for (var i = lines.length-1; i >= 0; i--) {
				if (lines[i].trim() === '') {
					lines.splice(i, 1);
				} else break;
			}

			return lines.join('\n');
		}

		// Main function for betterTrim()
		return (function(snippetEl) {
			var content = trimLineBreaks(snippetEl.innerHTML);
			var lines = content.split('\n');
			// Calculate the minimum amount to remove on each line start of the snippet (can be 0)
			var pad = lines.reduce(function(acc, line) {
				if (line.length > 0 && trimLeft(line).length > 0 && acc > line.length - trimLeft(line).length) {
					return line.length - trimLeft(line).length;
				}
				return acc;
			}, Number.POSITIVE_INFINITY);
			// Slice each line with this amount
			return lines.map(function(line, index) {
				return line.slice(pad);
			})
			.join('\n');
		})(snippetEl);
	}
68176
@Override
    public void validate() throws Exception {
        super.validate();
        this.parse();
        Assert.assertTrue(
                String.format(
                        "Lower bound %d should be less than upper bound %d",
                        lower,
                        upper),
                lower <= upper);
        Assert.assertFalse(
                "The range is empty",
                !this.includeLower
                    && !this.includeUpper
                    && (this.upper - this.lower) <= 1);
        Assert.assertFalse(
                "The range is empty",
                !(this.includeLower && this.includeUpper)
                    && (this.upper - this.lower) < 1);
    }
378346
function(val, ctx, partials, inverted, start, end, tags) {
      var pass;

      if (isArray(val) && val.length === 0) {
        return false;
      }

      if (typeof val == 'function') {
        val = this.ls(val, ctx, partials, inverted, start, end, tags);
      }

      pass = (val === '') || !!val;

      if (!inverted && pass && ctx) {
        ctx.push((typeof val == 'object') ? val : ctx[ctx.length - 1]);
      }

      return pass;
    }
1300659
function adjustOnComma(iLen, keepExpr, joinable) {
    // joinable for: ? [ ( OP
    if (iLen >= 3) {
      var tok4,
          tok5,
          tok1 = bPending[iLen - 1],
          tok2 = bPending[iLen - 2],
          tok3 = bPending[iLen - 3];
      var tp4,
          tp5,
          tp1 = tok1[0],
          tp2 = tok2[0],
          tp3 = tok3[0];
      if (iLen >= 5) {
        // expr ? expr : expr  --> expr_5
        tok4 = bPending[iLen - 4];tp4 = tok4[0];
        tok5 = bPending[iLen - 5];tp5 = tok5[0];
        if (!joinable && tp5 >= 31 && tp5 <= 43 && tp4 == 5 && tp3 >= 31 && tp3 <= 43 && tp2 == 6 && tp1 >= 31 && tp1 <= 43) {
          bPending.splice(iLen - 5, 5, [35, [tok5, tok4, tok3, tok2, tok1], tok5[2]]);
          return true;
        }
      }

      // expr OP expr  --> expr_4
      if (tp3 >= 31 && tp3 <= 43 && tp2 == 14 && tp1 >= 31 && tp1 <= 43) {
        bPending.splice(iLen - 3, 3);
        pushOpExpr(tok3, tok2, tok1, tok2[3]);
        return true;
      }

      // expr_list_2 : expr_list , expr
      if (!joinable && tp3 >= 51 && tp3 <= 52 && tp2 == 7 && tp1 >= 31 && tp1 <= 43) {
        bPending.splice(iLen - 3, 3, [52, [tok3, tok2, tok1], tok3[2]]);
        return true;
      }

      if (!joinable && tp3 >= 31 && tp3 <= 43 && tp2 == 6 && tp1 >= 31 && tp1 <= 43) {
        if (iLen >= 5 && tp5 >= 61 && tp5 <= 62 && tp4 == 7) {
          // expr_items_2 : expr_item , expr : expr
          bPending.splice(iLen - 5, 5, [62, [tok5, tok4, tok3, tok2, tok1], tok5[2]]);
        } else {
          // expr_items_1 : expr : expr
          bPending.splice(iLen - 3, 3, [61, [tok3, tok2, tok1], tok3[2]]);
        }
        return true;
      }
    }

    if (iLen >= 1 && !keepExpr) {
      // can not translate to expr_list if before ':'
      var tok1 = bPending[iLen - 1],
          tp1 = tok1[0];
      if (tp1 >= 31 && tp1 <= 43) {
        // expr  --> expr_list_1
        bPending.splice(iLen - 1, 1, [51, [tok1], tok1[2]]);
        return true;
      }
    }

    return false;
  }