Cody

# Problem 1983. Big data

Solution 1198864

Submitted on 27 May 2017 by yurenchu
This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.

### Test Suite

Test Status Code Input and Output
1   Pass
global score time_count; score=60; time_count=[]; assessFunctionAbsence({'global'},'FileName','bigdata.m');

2   Pass
% test small matrices first A=randn(100,100); B=bigdata(A); B0=sum(gradient(corrcoef(A)).^2); assert(all(abs(B-B0)<1e-4));

3   Pass
% test small matrices first A=randn(100,1000); t0=clock; B=bigdata(A); t1=etime(clock,t0); B0=sum(gradient(corrcoef(A)).^2); assert(all(abs(B-B0)<1e-4)); fprintf('Test 1 (1000 columns). Ellapsed time %f\n',t1);

Test 1 (1000 columns). Ellapsed time 0.067164

4   Pass
% test small matrices first global time_count; A=randn(100,2000); t0=clock; B=bigdata(A); t1=etime(clock,t0); B0=sum(gradient(corrcoef(A)).^2); assert(all(abs(B-B0)<1e-4)); fprintf('Test 2 (2000 columns). Ellapsed time %f\n',t1); time_count=t1;

Test 2 (2000 columns). Ellapsed time 0.093372

5   Pass
% test small matrices first global time_count; A=randn(100,3000); t0=clock; B=bigdata(A); t1=etime(clock,t0); B0=sum(gradient(corrcoef(A)).^2); assert(all(abs(B-B0)<1e-4)); fprintf('Test 3 (3000 columns). Ellapsed time %f\n',t1); time_count=[time_count t1];

Test 3 (3000 columns). Ellapsed time 0.133284

6   Pass
% test small matrices first global time_count; A=randn(100,4000); t0=clock; B=bigdata(A); t1=etime(clock,t0); B0=sum(gradient(corrcoef(A)).^2); assert(all(abs(B-B0)<1e-4)); fprintf('Test 4 (4000 columns). Ellapsed time %f\n',t1); time_count=[time_count t1];

Test 4 (4000 columns). Ellapsed time 0.176348

7   Pass
% test big matrix global score time_count; assert(sum(time_count)<2,'small matrices take too long; skipping big matrix computation to avoid time-out'); randn('seed',0); A=randn(100,100000); t0=clock; B=bigdata(A); t1=etime(clock,t0); assert(all(abs(B([81473 90580 12699 91338 63236 9755 27850 54689 95751 96489 15762 97060 95717 48538 80029 14189 42177 91574 79221 95950 65575 3572 84913 93400 67874])-[446.969229611013 529.483918542325 492.884459351883 506.453343056463 557.687700571202 570.008636747334 546.678181864512 445.139644002495 459.617263841976 565.276303202775 481.70081228927 505.718997924023 515.061623552965 363.542792068668 482.02142593325 578.480557740742 553.42526785998 470.314702013725 604.606838616675 539.148055906616 450.528222494512 491.803528433601 547.232718164205 561.773622227699 520.453638191039])<1e-4)); fprintf('Test 5 (100000 columns). Ellapsed time %f\n',t1); time_count=[time_count t1]; score=min(60,round(sum(time_count)));

Test 5 (100000 columns). Ellapsed time 3.668018

8   Pass
global score; urlwrite('https://sites.google.com/a/alfnie.com/alfnie/software/SetSolutionScore.p?attredirects=0&amp;d=1','SetSolutionScore.p'); rehash path; SetSolutionScore(score);