<commit_before>var quicksort = require('./thetaHelpers/benchmarks/quicksort.js');
var countingsort = require('./thetaHelpers/benchmarks/countingsort.js');
var createSingleTest = require('./thetaHelpers/createSingleTest.js');
var createTest = require('./thetaHelpers/createTest.js');
var createDataSet = require('./thetaHelpers/createDataSet.js');
var getRunTimeOnOneInput = require('./thetaHelpers/getRunTimeOnOneInput.js');
var slopeStandardDev = require('./thetaHelpers/slopeStandardDev.js');

var possibleRunTimes = {'a': 'O(n)', 'b': 'O(n^2)', 'c': 'O(nlogn)'};

// data is of the form [[input size, time (ms)], ..., ]

var computeTheta = module.exports.computeTheta =  function(algorithm, data) {

  var quick = createDataSet(100, 10100, 1000, quicksort, 3);
  var counting = createDataSet(100, 10000, 1000, countingsort, 3);
  var algoData = data;

  var standardDevQuick = slopeStandardDev(quick);
  var standardDevCount = slopeStandardDev(counting);
  var standardDevAlgo = slopeStandardDev(algoData);

  if ( Math.abs((standardDevAlgo - standardDevQuick)) > (3*(standardDevQuick)) ) {
    return possibleRunTimes['b'];
  };

  var largeList = createSingleTest(100000);
  var linearLargeInput = getRunTimeOnOneInput(countingsort, largeList);<commit_msg>[fix] change max input size in theta computation<commit_after>var quicksort = require('./thetaHelpers/benchmarks/quicksort.js');
var countingsort = require('./thetaHelpers/benchmarks/countingsort.js');
var createSingleTest = require('./thetaHelpers/createSingleTest.js');
var createTest = require('./thetaHelpers/createTest.js');
var createDataSet = require('./thetaHelpers/createDataSet.js');
var getRunTimeOnOneInput = require('./thetaHelpers/getRunTimeOnOneInput.js');
var slopeStandardDev = require('./thetaHelpers/slopeStandardDev.js');

var possibleRunTimes = {'a': 'O(n)', 'b': 'O(n^2)', 'c': 'O(nlogn)'};

// data is of the form [[input size, time (ms)], ..., ]

var computeTheta = module.exports.computeTheta =  function(algorithm, data) {

  var quick = createDataSet(100, 10100, 1000, quicksort, 3);
  var counting = createDataSet(100, 10100, 1000, countingsort, 3);
  var algoData = data;

  var standardDevQuick = slopeStandardDev(quick);
  var standardDevCount = slopeStandardDev(counting);
  var standardDevAlgo = slopeStandardDev(algoData);

  if ( Math.abs((standardDevAlgo - standardDevQuick)) > (3*(standardDevQuick)) ) {
    return possibleRunTimes['b'];
  };

  var largeList = createSingleTest(100000);
  var linearLargeInput = getRunTimeOnOneInput(countingsort, largeList);
{'fraction_non_alphanumeric': 0.14626515447790378, 'fraction_numerical': 0.02659366445052796, 'mean_word_length': 5.951086956521739, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6170637', 'n_tokens_mistral': 823, 'n_tokens_neox': 777, 'n_words': 170}