Cody

# Problem 42793. Fast 1-D Convolution (full shape)

Solution 1788083

Submitted on 15 Apr 2019
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
%{ ╔═════════════════════════════════════════════════════════════╗ ║ Please note that problems in this series are designed for ║ ║ optimizing the code performance, rather than the usual Cody ║ ║ "size". We are achieving this goal by courtesy of LY Cao's ║ ║ new scoring function, which automatically grants a better ║ ║ score to a faster solution. Kindly note that simply using ║ ║ the conv function may result in a poor score or even failure║ ║ in one of the tests. Suggestions and comments are welcome. ║ ║ ║ ║ Thanks & have fun! ║ ║ Peng ║ ╚═════════════════════════════════════════════════════════════╝ %}

2   Pass

3   Pass
u = 1; v = 1; y_correct = 1; assert(isequal(fconv1f(u,v),y_correct))

[Warning: FFT length must be a nonnegative integer scalar.] [> In fconv1f (line 4) In ScoringEngineTestPoint3 (line 3) In solutionTest (line 7) In matlab.unittest.internal.executeCodeBlock (line 11) In matlab.unittest.internal.ScriptTestCaseProvider/evaluateTestSection (line 134) In matlab.unittest.internal.ScriptTestCaseProvider/runTestSection (line 128) In matlab.unittest.internal.ScriptTestCaseProvider>@(testCase)provider.runTestSection(testCase) (line 94) In matlab.unittest.FunctionTestCase/test (line 98) In matlab.unittest.TestRunner/evaluateMethodCore (line 854) In matlab.unittest.TestRunner/evaluateMethod (line 1160) In matlab.unittest.TestRunner/invokeTestContentOperatorMethod_ (line 908) In matlab.unittest.plugins.TestRunnerPlugin/evaluateMethod (line 655) In scoringengine.OutputPlugin/evaluateMethod In matlab.unittest.plugins.TestRunnerPlugin/invokeTestContentOperatorMethod_ (line 686) In matlab.unittest.plugins.TestRunnerPlugin/evaluateMethod (line 655) In scoringengine.FiguresPlugin/evaluateMethod In matlab.unittest.plugins.TestRunnerPlugin/invokeTestContentOperatorMethod_ (line 686) In matlab.unittest.TestRunner/evaluateMethodOnPlugins (line 758) In matlab.unittest.TestRunner/evaluateMethodsOnTestContent (line 796) In matlab.unittest.TestRunner/runTestMethod (line 1156) In matlab.unittest.TestRunner/invokeTestContentOperatorMethod_ (line 908) In matlab.unittest.plugins.TestRunnerPlugin/runTestMethod (line 609) In scoringengine.OutputPlugin/runTestMethod In matlab.unittest.plugins.TestRunnerPlugin/invokeTestContentOperatorMethod_ (line 686) In matlab.unittest.plugins.TestRunnerPlugin/runTestMethod (line 609) In scoringengine.FiguresPlugin/runTestMethod In matlab.unittest.plugins.TestRunnerPlugin/invokeTestContentOperatorMethod_ (line 686) In matlab.unittest.TestRunner/evaluateMethodOnPlugins (line 758) In matlab.unittest.TestRunner/runTest (line 1103) In matlab.unittest.TestRunner/repeatTest (line 485) In matlab.unittest.TestRunner/runSharedTestCase (line 441) In matlab.unittest.TestRunner/runTestClass (line 1013) In matlab.unittest.TestRunner/invokeTestContentOperatorMethod_ (line 908) In matlab.unittest.TestRunner/evaluateMethodOnPlugins (line 758) In matlab.unittest.TestRunner/runTestSuite (line 950) In matlab.unittest.TestRunner/invokeTestContentOperatorMethod_ (line 908) In matlab.unittest.plugins.TestRunnerPlugin/runTestSuite (line 226) In scoringengine.OutputPlugin/runTestSuite In matlab.unittest.plugins.TestRunnerPlugin/invokeTestContentOperatorMethod_ (line 686) In matlab.unittest.plugins.TestRunnerPlugin/runTestSuite (line 226) In scoringengine.FiguresPlugin/runTestSuite In matlab.unittest.plugins.TestRunnerPlugin/invokeTestContentOperatorMethod_ (line 686) In matlab.unittest.plugins.TestRunnerPlugin/runTestSuite (line 226) In matlab.unittest.plugins.DiagnosticsRecordingPlugin/runTestSuite (line 204) In matlab.unittest.plugins.TestRunnerPlugin/invokeTestContentOperatorMethod_ (line 686) In matlab.unittest.TestRunner/evaluateMethodOnPlugins (line 758) In matlab.unittest.TestRunner/doRun (line 414) In matlab.unittest.TestRunner/run (line 293) In scoringengine.verifyCode In scoringengine.verifyCode In connector.internal.fevalMatlab In connector.internal.fevalJSON ] [Warning: FFT length must be a nonnegative integer scalar.] [> In fconv1f (line 4) In ScoringEngineTestPoint3 (line 3) In solutionTest (line 7) In matlab.unittest.internal.executeCodeBlock (line 11) In matlab.unittest.internal.ScriptTestCaseProvider/evaluateTestSection (line 134) In matlab.unittest.internal.ScriptTestCaseProvider/runTestSection (line 128) In matlab.unittest.internal.ScriptTestCaseProvider>@(testCase)provider.runTestSection(testCase) (line 94) In matlab.unittest.FunctionTestCase/test (line 98) In matlab.unittest.TestRunner/evaluateMethodCore (line 854) In matlab.unittest.TestRunner/evaluateMethod (line 1160) In matlab.unittest.TestRunner/invokeTestContentOperatorMethod_ (line 908) In matlab.unittest.plugins.TestRunnerPlugin/evaluateMethod (line 655) In scoringengine.OutputPlugin/evaluateMethod In matlab.unittest.plugins.TestRunnerPlugin/invokeTestContentOperatorMethod_ (line 686) In matlab.unittest.plugins.TestRunnerPlugin/evaluateMethod (line 655) In scoringengine.FiguresPlugin/evaluateMethod In matlab.unittest.plugins.TestRunnerPlugin/invokeTestContentOperatorMethod_ (line 686) In matlab.unittest.TestRunner/evaluateMethodOnPlugins (line 758) In matlab.unittest.TestRunner/evaluateMethodsOnTestContent (line 796) In matlab.unittest.TestRunner/runTestMethod (line 1156) In matlab.unittest.TestRunner/invokeTestContentOperatorMethod_ (line 908) In matlab.unittest.plugins.TestRunnerPlugin/runTestMethod (line 609) In scoringengine.OutputPlugin/runTestMethod In matlab.unittest.plugins.TestRunnerPlugin/invokeTestContentOperatorMethod_ (line 686) In matlab.unittest.plugins.TestRunnerPlugin/runTestMethod (line 609) In scoringengine.FiguresPlugin/runTestMethod In matlab.unittest.plugins.TestRunnerPlugin/invokeTestContentOperatorMethod_ (line 686) In matlab.unittest.TestRunner/evaluateMethodOnPlugins (line 758) In matlab.unittest.TestRunner/runTest (line 1103) In matlab.unittest.TestRunner/repeatTest (line 485) In matlab.unittest.TestRunner/runSharedTestCase (line 441) In matlab.unittest.TestRunner/runTestClass (line 1013) In matlab.unittest.TestRunner/invokeTestContentOperatorMethod_ (line 908) In matlab.unittest.TestRunner/evaluateMethodOnPlugins (line 758) In matlab.unittest.TestRunner/runTestSuite (line 950) In matlab.unittest.TestRunner/invokeTestContentOperatorMethod_ (line 908) In matlab.unittest.plugins.TestRunnerPlugin/runTestSuite (line 226) In scoringengine.OutputPlugin/runTestSuite In matlab.unittest.plugins.TestRunnerPlugin/invokeTestContentOperatorMethod_ (line 686) In matlab.unittest.plugins.TestRunnerPlugin/runTestSuite (line 226) In scoringengine.FiguresPlugin/runTestSuite In matlab.unittest.plugins.TestRunnerPlugin/invokeTestContentOperatorMethod_ (line 686) In matlab.unittest.plugins.TestRunnerPlugin/runTestSuite (line 226) In matlab.unittest.plugins.DiagnosticsRecordingPlugin/runTestSuite (line 204) In matlab.unittest.plugins.TestRunnerPlugin/invokeTestContentOperatorMethod_ (line 686) In matlab.unittest.TestRunner/evaluateMethodOnPlugins (line 758) In matlab.unittest.TestRunner/doRun (line 414) In matlab.unittest.TestRunner/run (line 293) In scoringengine.verifyCode In scoringengine.verifyCode In connector.internal.fevalMatlab In connector.internal.fevalJSON ]

4   Fail
u = 1:10; v = 1:5; y_correct = [1,4,10,20,35,50,65,80,95,110,114,106,85,50]; assert(all(abs(fconv1f(u,v)-y_correct)<1e-10))

[Warning: FFT length must be a nonnegative integer scalar.] [> In fconv1f (line 4) In ScoringEngineTestPoint4 (line 3) In solutionTest (line 9) In matlab.unittest.internal.executeCodeBlock (line 11) In matlab.unittest.internal.ScriptTestCaseProvider/evaluateTestSection (line 134) In matlab.unittest.internal.ScriptTestCaseProvider/runTestSection (line 128) In matlab.unittest.internal.ScriptTestCaseProvider>@(testCase)provider.runTestSection(testCase) (line 94) In matlab.unittest.FunctionTestCase/test (line 98) In matlab.unittest.TestRunner/evaluateMethodCore (line 854) In matlab.unittest.TestRunner/evaluateMethod (line 1160) In matlab.unittest.TestRunner/invokeTestContentOperatorMethod_ (line 908) In matlab.unittest.plugins.TestRunnerPlugin/evaluateMethod (line 655) In scoringengine.OutputPlugin/evaluateMethod In matlab.unittest.plugins.TestRunnerPlugin/invokeTestContentOperatorMethod_ (line 686) In matlab.unittest.plugins.TestRunnerPlugin/evaluateMethod (line 655) In scoringengine.FiguresPlugin/evaluateMethod In matlab.unittest.plugins.TestRunnerPlugin/invokeTestContentOperatorMethod_ (line 686) In matlab.unittest.TestRunner/evaluateMethodOnPlugins (line 758) In matlab.unittest.TestRunner/evaluateMethodsOnTestContent (line 796) In matlab.unittest.TestRunner/runTestMethod (line 1156) In matlab.unittest.TestRunner/invokeTestContentOperatorMethod_ (line 908) In matlab.unittest.plugins.TestRunnerPlugin/runTestMethod (line 609) In scoringengine.OutputPlugin/runTestMethod In matlab.unittest.plugins.TestRunnerPlugin/invokeTestContentOperatorMethod_ (line 686) In matlab.unittest.plugins.TestRunnerPlugin/runTestMethod (line 609) In scoringengine.FiguresPlugin/runTestMethod In matlab.unittest.plugins.TestRunnerPlugin/invokeTestContentOperatorMethod_ (line 686) In matlab.unittest.TestRunner/evaluateMethodOnPlugins (line 758) In matlab.unittest.TestRunner/runTest (line 1103) In matlab.unittest.TestRunner/repeatTest (line 485) In matlab.unittest.TestRunner/runSharedTestCase (line 441) In matlab.unittest.TestRunner/runTestClass (line 1013) In matlab.unittest.TestRunner/invokeTestContentOperatorMethod_ (line 908) In matlab.unittest.TestRunner/evaluateMethodOnPlugins (line 758) In matlab.unittest.TestRunner/runTestSuite (line 950) In matlab.unittest.TestRunner/invokeTestContentOperatorMethod_ (line 908) In matlab.unittest.plugins.TestRunnerPlugin/runTestSuite (line 226) In scoringengine.OutputPlugin/runTestSuite In matlab.unittest.plugins.TestRunnerPlugin/invokeTestContentOperatorMethod_ (line 686) In matlab.unittest.plugins.TestRunnerPlugin/runTestSuite (line 226) In scoringengine.FiguresPlugin/runTestSuite In matlab.unittest.plugins.TestRunnerPlugin/invokeTestContentOperatorMethod_ (line 686) In matlab.unittest.plugins.TestRunnerPlugin/runTestSuite (line 226) In matlab.unittest.plugins.DiagnosticsRecordingPlugin/runTestSuite (line 204) In matlab.unittest.plugins.TestRunnerPlugin/invokeTestContentOperatorMethod_ (line 686) In matlab.unittest.TestRunner/evaluateMethodOnPlugins (line 758) In matlab.unittest.TestRunner/doRun (line 414) In matlab.unittest.TestRunner/run (line 293) In scoringengine.verifyCode In scoringengine.verifyCode In connector.internal.fevalMatlab In connector.internal.fevalJSON ] [Warning: FFT length must be a nonnegative integer scalar.] [> In fconv1f (line 4) In ScoringEngineTestPoint4 (line 3) In solutionTest (line 9) In matlab.unittest.internal.executeCodeBlock (line 11) In matlab.unittest.internal.ScriptTestCaseProvider/evaluateTestSection (line 134) In matlab.unittest.internal.ScriptTestCaseProvider/runTestSection (line 128) In matlab.unittest.internal.ScriptTestCaseProvider>@(testCase)provider.runTestSection(testCase) (line 94) In matlab.unittest.FunctionTestCase/test (line 98) In matlab.unittest.TestRunner/evaluateMethodCore (line 854) In matlab.unittest.TestRunner/evaluateMethod (line 1160) In matlab.unittest.TestRunner/invokeTestContentOperatorMethod_ (line 908) In matlab.unittest.plugins.TestRunnerPlugin/evaluateMethod (line 655) In scoringengine.OutputPlugin/evaluateMethod In matlab.unittest.plugins.TestRunnerPlugin/invokeTestContentOperatorMethod_ (line 686) In matlab.unittest.plugins.TestRunnerPlugin/evaluateMethod (line 655) In scoringengine.FiguresPlugin/evaluateMethod In matlab.unittest.plugins.TestRunnerPlugin/invokeTestContentOperatorMethod_ (line 686) In matlab.unittest.TestRunner/evaluateMethodOnPlugins (line 758) In matlab.unittest.TestRunner/evaluateMethodsOnTestContent (line 796) In matlab.unittest.TestRunner/runTestMethod (line 1156) In matlab.unittest.TestRunner/invokeTestContentOperatorMethod_ (line 908) In matlab.unittest.plugins.TestRunnerPlugin/runTestMethod (line 609) In scoringengine.OutputPlugin/runTestMethod In matlab.unittest.plugins.TestRunnerPlugin/invokeTestContentOperatorMethod_ (line 686) In matlab.unittest.plugins.TestRunnerPlugin/runTestMethod (line 609) In scoringengine.FiguresPlugin/runTestMethod In matlab.unittest.plugins.TestRunnerPlugin/invokeTestContentOperatorMethod_ (line 686) In matlab.unittest.TestRunner/evaluateMethodOnPlugins (line 758) In matlab.unittest.TestRunner/runTest (line 1103) In matlab.unittest.TestRunner/repeatTest (line 485) In matlab.unittest.TestRunner/runSharedTestCase (line 441) In matlab.unittest.TestRunner/runTestClass (line 1013) In matlab.unittest.TestRunner/invokeTestContentOperatorMethod_ (line 908) In matlab.unittest.TestRunner/evaluateMethodOnPlugins (line 758) In matlab.unittest.TestRunner/runTestSuite (line 950) In matlab.unittest.TestRunner/invokeTestContentOperatorMethod_ (line 908) In matlab.unittest.plugins.TestRunnerPlugin/runTestSuite (line 226) In scoringengine.OutputPlugin/runTestSuite In matlab.unittest.plugins.TestRunnerPlugin/invokeTestContentOperatorMethod_ (line 686) In matlab.unittest.plugins.TestRunnerPlugin/runTestSuite (line 226) In scoringengine.FiguresPlugin/runTestSuite In matlab.unittest.plugins.TestRunnerPlugin/invokeTestContentOperatorMethod_ (line 686) In matlab.unittest.plugins.TestRunnerPlugin/runTestSuite (line 226) In matlab.unittest.plugins.DiagnosticsRecordingPlugin/runTestSuite (line 204) In matlab.unittest.plugins.TestRunnerPlugin/invokeTestContentOperatorMethod_ (line 686) In matlab.unittest.TestRunner/evaluateMethodOnPlugins (line 758) In matlab.unittest.TestRunner/doRun (line 414) In matlab.unittest.TestRunner/run (line 293) In scoringengine.verifyCode In scoringengine.verifyCode In connector.internal.fevalMatlab In connector.internal.fevalJSON ]

Assertion failed.

5   Fail
u = [2 -4 0 1].'; v = [1:5].'; y_correct = [2,0,-2,-3,-4,-17,4,5].'; assert(all(abs(fconv1f(u,v)-y_correct)<1e-10))

[Warning: FFT length must be a nonnegative integer scalar.] [> In fconv1f (line 4) In ScoringEngineTestPoint5 (line 3) In solutionTest (line 11) In matlab.unittest.internal.executeCodeBlock (line 11) In matlab.unittest.internal.ScriptTestCaseProvider/evaluateTestSection (line 134) In matlab.unittest.internal.ScriptTestCaseProvider/runTestSection (line 128) In matlab.unittest.internal.ScriptTestCaseProvider>@(testCase)provider.runTestSection(testCase) (line 94) In matlab.unittest.FunctionTestCase/test (line 98) In matlab.unittest.TestRunner/evaluateMethodCore (line 854) In matlab.unittest.TestRunner/evaluateMethod (line 1160) In matlab.unittest.TestRunner/invokeTestContentOperatorMethod_ (line 908) In matlab.unittest.plugins.TestRunnerPlugin/evaluateMethod (line 655) In scoringengine.OutputPlugin/evaluateMethod In matlab.unittest.plugins.TestRunnerPlugin/invokeTestContentOperatorMethod_ (line 686) In matlab.unittest.plugins.TestRunnerPlugin/evaluateMethod (line 655) In scoringengine.FiguresPlugin/evaluateMethod In matlab.unittest.plugins.TestRunnerPlugin/invokeTestContentOperatorMethod_ (line 686) In matlab.unittest.TestRunner/evaluateMethodOnPlugins (line 758) In matlab.unittest.TestRunner/evaluateMethodsOnTestContent (line 796) In matlab.unittest.TestRunner/runTestMethod (line 1156) In matlab.unittest.TestRunner/invokeTestContentOperatorMethod_ (line 908) In matlab.unittest.plugins.TestRunnerPlugin/runTestMethod (line 609) In scoringengine.OutputPlugin/runTestMethod In matlab.unittest.plugins.TestRunnerPlugin/invokeTestContentOperatorMethod_ (line 686) In matlab.unittest.plugins.TestRunnerPlugin/runTestMethod (line 609) In scoringengine.FiguresPlugin/runTestMethod In matlab.unittest.plugins.TestRunnerPlugin/invokeTestContentOperatorMethod_ (line 686) In matlab.unittest.TestRunner/evaluateMethodOnPlugins (line 758) In matlab.unittest.TestRunner/runTest (line 1103) In matlab.unittest.TestRunner/repeatTest (line 485) In matlab.unittest.TestRunner/runSharedTestCase (line 441) In matlab.unittest.TestRunner/runTestClass (line 1013) In matlab.unittest.TestRunner/invokeTestContentOperatorMethod_ (line 908) In matlab.unittest.TestRunner/evaluateMethodOnPlugins (line 758) In matlab.unittest.TestRunner/runTestSuite (line 950) In matlab.unittest.TestRunner/invokeTestContentOperatorMethod_ (line 908) In matlab.unittest.plugins.TestRunnerPlugin/runTestSuite (line 226) In scoringengine.OutputPlugin/runTestSuite In matlab.unittest.plugins.TestRunnerPlugin/invokeTestContentOperatorMethod_ (line 686) In matlab.unittest.plugins.TestRunnerPlugin/runTestSuite (line 226) In scoringengine.FiguresPlugin/runTestSuite In matlab.unittest.plugins.TestRunnerPlugin/invokeTestContentOperatorMethod_ (line 686) In matlab.unittest.plugins.TestRunnerPlugin/runTestSuite (line 226) In matlab.unittest.plugins.DiagnosticsRecordingPlugin/runTestSuite (line 204) In matlab.unittest.plugins.TestRunnerPlugin/invokeTestContentOperatorMethod_ (line 686) In matlab.unittest.TestRunner/evaluateMethodOnPlugins (line 758) In matlab.unittest.TestRunner/doRun (line 414) In matlab.unittest.TestRunner/run (line 293) In scoringengine.verifyCode In scoringengine.verifyCode In connector.internal.fevalMatlab In connector.internal.fevalJSON ] [Warning: FFT length must be a nonnegative integer scalar.] [> In fconv1f (line 4) In ScoringEngineTestPoint5 (line 3) In solutionTest (line 11) In matlab.unittest.internal.executeCodeBlock (line 11) In matlab.unittest.internal.ScriptTestCaseProvider/evaluateTestSection (line 134) In matlab.unittest.internal.ScriptTestCaseProvider/runTestSection (line 128) In matlab.unittest.internal.ScriptTestCaseProvider>@(testCase)provider.runTestSection(testCase) (line 94) In matlab.unittest.FunctionTestCase/test (line 98) In matlab.unittest.TestRunner/evaluateMethodCore (line 854) In matlab.unittest.TestRunner/evaluateMethod (line 1160) In matlab.unittest.TestRunner/invokeTestContentOperatorMethod_ (line 908) In matlab.unittest.plugins.TestRunnerPlugin/evaluateMethod (line 655) In scoringengine.OutputPlugin/evaluateMethod In matlab.unittest.plugins.TestRunnerPlugin/invokeTestContentOperatorMethod_ (line 686) In matlab.unittest.plugins.TestRunnerPlugin/evaluateMethod (line 655) In scoringengine.FiguresPlugin/evaluateMethod In matlab.unittest.plugins.TestRunnerPlugin/invokeTestContentOperatorMethod_ (line 686) In matlab.unittest.TestRunner/evaluateMethodOnPlugins (line 758) In matlab.unittest.TestRunner/evaluateMethodsOnTestContent (line 796) In matlab.unittest.TestRunner/runTestMethod (line 1156) In matlab.unittest.TestRunner/invokeTestContentOperatorMethod_ (line 908) In matlab.unittest.plugins.TestRunnerPlugin/runTestMethod (line 609) In scoringengine.OutputPlugin/runTestMethod In matlab.unittest.plugins.TestRunnerPlugin/invokeTestContentOperatorMethod_ (line 686) In matlab.unittest.plugins.TestRunnerPlugin/runTestMethod (line 609) In scoringengine.FiguresPlugin/runTestMethod In matlab.unittest.plugins.TestRunnerPlugin/invokeTestContentOperatorMethod_ (line 686) In matlab.unittest.TestRunner/evaluateMethodOnPlugins (line 758) In matlab.unittest.TestRunner/runTest (line 1103) In matlab.unittest.TestRunner/repeatTest (line 485) In matlab.unittest.TestRunner/runSharedTestCase (line 441) In matlab.unittest.TestRunner/runTestClass (line 1013) In matlab.unittest.TestRunner/invokeTestContentOperatorMethod_ (line 908) In matlab.unittest.TestRunner/evaluateMethodOnPlugins (line 758) In matlab.unittest.TestRunner/runTestSuite (line 950) In matlab.unittest.TestRunner/invokeTestContentOperatorMethod_ (line 908) In matlab.unittest.plugins.TestRunnerPlugin/runTestSuite (line 226) In scoringengine.OutputPlugin/runTestSuite In matlab.unittest.plugins.TestRunnerPlugin/invokeTestContentOperatorMethod_ (line 686) In matlab.unittest.plugins.TestRunnerPlugin/runTestSuite (line 226) In scoringengine.FiguresPlugin/runTestSuite In matlab.unittest.plugins.TestRunnerPlugin/invokeTestContentOperatorMethod_ (line 686) In matlab.unittest.plugins.TestRunnerPlugin/runTestSuite (line 226) In matlab.unittest.plugins.DiagnosticsRecordingPlugin/runTestSuite (line 204) In matlab.unittest.plugins.TestRunnerPlugin/invokeTestContentOperatorMethod_ (line 686) In matlab.unittest.TestRunner/evaluateMethodOnPlugins (line 758) In matlab.unittest.TestRunner/doRun (line 414) In matlab.unittest.TestRunner/run (line 293) In scoringengine.verifyCode In scoringengine.verifyCode In connector.internal.fevalMatlab In connector.internal.fevalJSON ]

Matrix dimensions must agree. Error in fconv1f (line 4) y= ifft(fft(u,l1+l2-1).*fft(v,1+l2-1)); Error in Test5 (line 3) assert(all(abs(fconv1f(u,v)-y_correct)<1e-10))

6   Fail
u = rand(20,1); v = rand(10,1); y_correct = conv(u,v,'full'); assert(all(abs(fconv1f(u,v)-y_correct)<1e-10))

[Warning: FFT length must be a nonnegative integer scalar.] [> In fconv1f (line 4) In ScoringEngineTestPoint6 (line 3) In solutionTest (line 13) In matlab.unittest.internal.executeCodeBlock (line 11) In matlab.unittest.internal.ScriptTestCaseProvider/evaluateTestSection (line 134) In matlab.unittest.internal.ScriptTestCaseProvider/runTestSection (line 128) In matlab.unittest.internal.ScriptTestCaseProvider>@(testCase)provider.runTestSection(testCase) (line 94) In matlab.unittest.FunctionTestCase/test (line 98) In matlab.unittest.TestRunner/evaluateMethodCore (line 854) In matlab.unittest.TestRunner/evaluateMethod (line 1160) In matlab.unittest.TestRunner/invokeTestContentOperatorMethod_ (line 908) In matlab.unittest.plugins.TestRunnerPlugin/evaluateMethod (line 655) In scoringengine.OutputPlugin/evaluateMethod In matlab.unittest.plugins.TestRunnerPlugin/invokeTestContentOperatorMethod_ (line 686) In matlab.unittest.plugins.TestRunnerPlugin/evaluateMethod (line 655) In scoringengine.FiguresPlugin/evaluateMethod In matlab.unittest.plugins.TestRunnerPlugin/invokeTestContentOperatorMethod_ (line 686) In matlab.unittest.TestRunner/evaluateMethodOnPlugins (line 758) In matlab.unittest.TestRunner/evaluateMethodsOnTestContent (line 796) In matlab.unittest.TestRunner/runTestMethod (line 1156) In matlab.unittest.TestRunner/invokeTestContentOperatorMethod_ (line 908) In matlab.unittest.plugins.TestRunnerPlugin/runTestMethod (line 609) In scoringengine.OutputPlugin/runTestMethod In matlab.unittest.plugins.TestRunnerPlugin/invokeTestContentOperatorMethod_ (line 686) In matlab.unittest.plugins.TestRunnerPlugin/runTestMethod (line 609) In scoringengine.FiguresPlugin/runTestMethod In matlab.unittest.plugins.TestRunnerPlugin/invokeTestContentOperatorMethod_ (line 686) In matlab.unittest.TestRunner/evaluateMethodOnPlugins (line 758) In matlab.unittest.TestRunner/runTest (line 1103) In matlab.unittest.TestRunner/repeatTest (line 485) In matlab.unittest.TestRunner/runSharedTestCase (line 441) In matlab.unittest.TestRunner/runTestClass (line 1013) In matlab.unittest.TestRunner/invokeTestContentOperatorMethod_ (line 908) In matlab.unittest.TestRunner/evaluateMethodOnPlugins (line 758) In matlab.unittest.TestRunner/runTestSuite (line 950) In matlab.unittest.TestRunner/invokeTestContentOperatorMethod_ (line 908) In matlab.unittest.plugins.TestRunnerPlugin/runTestSuite (line 226) In scoringengine.OutputPlugin/runTestSuite In matlab.unittest.plugins.TestRunnerPlugin/invokeTestContentOperatorMethod_ (line 686) In matlab.unittest.plugins.TestRunnerPlugin/runTestSuite (line 226) In scoringengine.FiguresPlugin/runTestSuite In matlab.unittest.plugins.TestRunnerPlugin/invokeTestContentOperatorMethod_ (line 686) In matlab.unittest.plugins.TestRunnerPlugin/runTestSuite (line 226) In matlab.unittest.plugins.DiagnosticsRecordingPlugin/runTestSuite (line 204) In matlab.unittest.plugins.TestRunnerPlugin/invokeTestContentOperatorMethod_ (line 686) In matlab.unittest.TestRunner/evaluateMethodOnPlugins (line 758) In matlab.unittest.TestRunner/doRun (line 414) In matlab.unittest.TestRunner/run (line 293) In scoringengine.verifyCode In scoringengine.verifyCode In connector.internal.fevalMatlab In connector.internal.fevalJSON ] [Warning: FFT length must be a nonnegative integer scalar.] [> In fconv1f (line 4) In ScoringEngineTestPoint6 (line 3) In solutionTest (line 13) In matlab.unittest.internal.executeCodeBlock (line 11) In matlab.unittest.internal.ScriptTestCaseProvider/evaluateTestSection (line 134) In matlab.unittest.internal.ScriptTestCaseProvider/runTestSection (line 128) In matlab.unittest.internal.ScriptTestCaseProvider>@(testCase)provider.runTestSection(testCase) (line 94) In matlab.unittest.FunctionTestCase/test (line 98) In matlab.unittest.TestRunner/evaluateMethodCore (line 854) In matlab.unittest.TestRunner/evaluateMethod (line 1160) In matlab.unittest.TestRunner/invokeTestContentOperatorMethod_ (line 908) In matlab.unittest.plugins.TestRunnerPlugin/evaluateMethod (line 655) In scoringengine.OutputPlugin/evaluateMethod In matlab.unittest.plugins.TestRunnerPlugin/invokeTestContentOperatorMethod_ (line 686) In matlab.unittest.plugins.TestRunnerPlugin/evaluateMethod (line 655) In scoringengine.FiguresPlugin/evaluateMethod In matlab.unittest.plugins.TestRunnerPlugin/invokeTestContentOperatorMethod_ (line 686) In matlab.unittest.TestRunner/evaluateMethodOnPlugins (line 758) In matlab.unittest.TestRunner/evaluateMethodsOnTestContent (line 796) In matlab.unittest.TestRunner/runTestMethod (line 1156) In matlab.unittest.TestRunner/invokeTestContentOperatorMethod_ (line 908) In matlab.unittest.plugins.TestRunnerPlugin/runTestMethod (line 609) In scoringengine.OutputPlugin/runTestMethod In matlab.unittest.plugins.TestRunnerPlugin/invokeTestContentOperatorMethod_ (line 686) In matlab.unittest.plugins.TestRunnerPlugin/runTestMethod (line 609) In scoringengine.FiguresPlugin/runTestMethod In matlab.unittest.plugins.TestRunnerPlugin/invokeTestContentOperatorMethod_ (line 686) In matlab.unittest.TestRunner/evaluateMethodOnPlugins (line 758) In matlab.unittest.TestRunner/runTest (line 1103) In matlab.unittest.TestRunner/repeatTest (line 485) In matlab.unittest.TestRunner/runSharedTestCase (line 441) In matlab.unittest.TestRunner/runTestClass (line 1013) In matlab.unittest.TestRunner/invokeTestContentOperatorMethod_ (line 908) In matlab.unittest.TestRunner/evaluateMethodOnPlugins (line 758) In matlab.unittest.TestRunner/runTestSuite (line 950) In matlab.unittest.TestRunner/invokeTestContentOperatorMethod_ (line 908) In matlab.unittest.plugins.TestRunnerPlugin/runTestSuite (line 226) In scoringengine.OutputPlugin/runTestSuite In matlab.unittest.plugins.TestRunnerPlugin/invokeTestContentOperatorMethod_ (line 686) In matlab.unittest.plugins.TestRunnerPlugin/runTestSuite (line 226) In scoringengine.FiguresPlugin/runTestSuite In matlab.unittest.plugins.TestRunnerPlugin/invokeTestContentOperatorMethod_ (line 686) In matlab.unittest.plugins.TestRunnerPlugin/runTestSuite (line 226) In matlab.unittest.plugins.DiagnosticsRecordingPlugin/runTestSuite (line 204) In matlab.unittest.plugins.TestRunnerPlugin/invokeTestContentOperatorMethod_ (line 686) In matlab.unittest.TestRunner/evaluateMethodOnPlugins (line 758) In matlab.unittest.TestRunner/doRun (line 414) In matlab.unittest.TestRunner/run (line 293) In scoringengine.verifyCode In scoringengine.verifyCode In connector.internal.fevalMatlab In connector.internal.fevalJSON ]

Matrix dimensions must agree. Error in fconv1f (line 4) y= ifft(fft(u,l1+l2-1).*fft(v,1+l2-1)); Error in Test6 (line 3) assert(all(abs(fconv1f(u,v)-y_correct)<1e-10))

7   Fail
% Large data size global sol_score u = rand(8e5,1); v = rand(1e5,1); t = builtin('tic'); y = fconv1f(u,v); sol_score = 50*builtin('toc',t); AbsTol = 1e-6; % Maximum absolute error tolerance pass = EvaluateSolution(u,v,y,AbsTol); assert(pass);

[Warning: FFT length must be a nonnegative integer scalar.] [> In fconv1f (line 4) In ScoringEngineTestPoint7 (line 5) In solutionTest (line 15) In matlab.unittest.internal.executeCodeBlock (line 11) In matlab.unittest.internal.ScriptTestCaseProvider/evaluateTestSection (line 134) In matlab.unittest.internal.ScriptTestCaseProvider/runTestSection (line 128) In matlab.unittest.internal.ScriptTestCaseProvider>@(testCase)provider.runTestSection(testCase) (line 94) In matlab.unittest.FunctionTestCase/test (line 98) In matlab.unittest.TestRunner/evaluateMethodCore (line 854) In matlab.unittest.TestRunner/evaluateMethod (line 1160) In matlab.unittest.TestRunner/invokeTestContentOperatorMethod_ (line 908) In matlab.unittest.plugins.TestRunnerPlugin/evaluateMethod (line 655) In scoringengine.OutputPlugin/evaluateMethod In matlab.unittest.plugins.TestRunnerPlugin/invokeTestContentOperatorMethod_ (line 686) In matlab.unittest.plugins.TestRunnerPlugin/evaluateMethod (line 655) In scoringengine.FiguresPlugin/evaluateMethod In matlab.unittest.plugins.TestRunnerPlugin/invokeTestContentOperatorMethod_ (line 686) In matlab.unittest.TestRunner/evaluateMethodOnPlugins (line 758) In matlab.unittest.TestRunner/evaluateMethodsOnTestContent (line 796) In matlab.unittest.TestRunner/runTestMethod (line 1156) In matlab.unittest.TestRunner/invokeTestContentOperatorMethod_ (line 908) In matlab.unittest.plugins.TestRunnerPlugin/runTestMethod (line 609) In scoringengine.OutputPlugin/runTestMethod In matlab.unittest.plugins.TestRunnerPlugin/invokeTestContentOperatorMethod_ (line 686) In matlab.unittest.plugins.TestRunnerPlugin/runTestMethod (line 609) In scoringengine.FiguresPlugin/runTestMethod In matlab.unittest.plugins.TestRunnerPlugin/invokeTestContentOperatorMethod_ (line 686) In matlab.unittest.TestRunner/evaluateMethodOnPlugins (line 758) In matlab.unittest.TestRunner/runTest (line 1103) In matlab.unittest.TestRunner/repeatTest (line 485) In matlab.unittest.TestRunner/runSharedTestCase (line 441) In matlab.unittest.TestRunner/runTestClass (line 1013) In matlab.unittest.TestRunner/invokeTestContentOperatorMethod_ (line 908) In matlab.unittest.TestRunner/evaluateMethodOnPlugins (line 758) In matlab.unittest.TestRunner/runTestSuite (line 950) In matlab.unittest.TestRunner/invokeTestContentOperatorMethod_ (line 908) In matlab.unittest.plugins.TestRunnerPlugin/runTestSuite (line 226) In scoringengine.OutputPlugin/runTestSuite In matlab.unittest.plugins.TestRunnerPlugin/invokeTestContentOperatorMethod_ (line 686) In matlab.unittest.plugins.TestRunnerPlugin/runTestSuite (line 226) In scoringengine.FiguresPlugin/runTestSuite In matlab.unittest.plugins.TestRunnerPlugin/invokeTestContentOperatorMethod_ (line 686) In matlab.unittest.plugins.TestRunnerPlugin/runTestSuite (line 226) In matlab.unittest.plugins.DiagnosticsRecordingPlugin/runTestSuite (line 204) In matlab.unittest.plugins.TestRunnerPlugin/invokeTestContentOperatorMethod_ (line 686) In matlab.unittest.TestRunner/evaluateMethodOnPlugins (line 758) In matlab.unittest.TestRunner/doRun (line 414) In matlab.unittest.TestRunner/run (line 293) In scoringengine.verifyCode In scoringengine.verifyCode In connector.internal.fevalMatlab In connector.internal.fevalJSON ] [Warning: FFT length must be a nonnegative integer scalar.] [> In fconv1f (line 4) In ScoringEngineTestPoint7 (line 5) In solutionTest (line 15) In matlab.unittest.internal.executeCodeBlock (line 11) In matlab.unittest.internal.ScriptTestCaseProvider/evaluateTestSection (line 134) In matlab.unittest.internal.ScriptTestCaseProvider/runTestSection (line 128) In matlab.unittest.internal.ScriptTestCaseProvider>@(testCase)provider.runTestSection(testCase) (line 94) In matlab.unittest.FunctionTestCase/test (line 98) In matlab.unittest.TestRunner/evaluateMethodCore (line 854) In matlab.unittest.TestRunner/evaluateMethod (line 1160) In matlab.unittest.TestRunner/invokeTestContentOperatorMethod_ (line 908) In matlab.unittest.plugins.TestRunnerPlugin/evaluateMethod (line 655) In scoringengine.OutputPlugin/evaluateMethod In matlab.unittest.plugins.TestRunnerPlugin/invokeTestContentOperatorMethod_ (line 686) In matlab.unittest.plugins.TestRunnerPlugin/evaluateMethod (line 655) In scoringengine.FiguresPlugin/evaluateMethod In matlab.unittest.plugins.TestRunnerPlugin/invokeTestContentOperatorMethod_ (line 686) In matlab.unittest.TestRunner/evaluateMethodOnPlugins (line 758) In matlab.unittest.TestRunner/evaluateMethodsOnTestContent (line 796) In matlab.unittest.TestRunner/runTestMethod (line 1156) In matlab.unittest.TestRunner/invokeTestContentOperatorMethod_ (line 908) In matlab.unittest.plugins.TestRunnerPlugin/runTestMethod (line 609) In scoringengine.OutputPlugin/runTestMethod In matlab.unittest.plugins.TestRunnerPlugin/invokeTestContentOperatorMethod_ (line 686) In matlab.unittest.plugins.TestRunnerPlugin/runTestMethod (line 609) In scoringengine.FiguresPlugin/runTestMethod In matlab.unittest.plugins.TestRunnerPlugin/invokeTestContentOperatorMethod_ (line 686) In matlab.unittest.TestRunner/evaluateMethodOnPlugins (line 758) In matlab.unittest.TestRunner/runTest (line 1103) In matlab.unittest.TestRunner/repeatTest (line 485) In matlab.unittest.TestRunner/runSharedTestCase (line 441) In matlab.unittest.TestRunner/runTestClass (line 1013) In matlab.unittest.TestRunner/invokeTestContentOperatorMethod_ (line 908) In matlab.unittest.TestRunner/evaluateMethodOnPlugins (line 758) In matlab.unittest.TestRunner/runTestSuite (line 950) In matlab.unittest.TestRunner/invokeTestContentOperatorMethod_ (line 908) In matlab.unittest.plugins.TestRunnerPlugin/runTestSuite (line 226) In scoringengine.OutputPlugin/runTestSuite In matlab.unittest.plugins.TestRunnerPlugin/invokeTestContentOperatorMethod_ (line 686) In matlab.unittest.plugins.TestRunnerPlugin/runTestSuite (line 226) In scoringengine.FiguresPlugin/runTestSuite In matlab.unittest.plugins.TestRunnerPlugin/invokeTestContentOperatorMethod_ (line 686) In matlab.unittest.plugins.TestRunnerPlugin/runTestSuite (line 226) In matlab.unittest.plugins.DiagnosticsRecordingPlugin/runTestSuite (line 204) In matlab.unittest.plugins.TestRunnerPlugin/invokeTestContentOperatorMethod_ (line 686) In matlab.unittest.TestRunner/evaluateMethodOnPlugins (line 758) In matlab.unittest.TestRunner/doRun (line 414) In matlab.unittest.TestRunner/run (line 293) In scoringengine.verifyCode In scoringengine.verifyCode In connector.internal.fevalMatlab In connector.internal.fevalJSON ]

Matrix dimensions must agree. Error in fconv1f (line 4) y= ifft(fft(u,l1+l2-1).*fft(v,1+l2-1)); Error in Test7 (line 5) y = fconv1f(u,v);

8   Pass
% New scoring function by LY Cao global sol_score fid = fopen('score.p','wb'); fwrite(fid,sscanf('7630312E30307630302E30300008501CD77E9FB100000035000001110000018422762999A8C1DE50537BEE443F4D73651F830FC6C78ADFB7DF68DF98823F565884DC58E21C7E397E3D26E4FFEA9A0D83589ABB5C0B0B553B44CFD79C9B272D11DF1965AD538598E8319529727DF4C4CF36A6016DD7816544AE5A8F64C9B2D9D0C4B94DD5EDF14595CBFE3D402647499EA3D9D125AC927454ED85973BCD1AAEA536D5A6CDDCD78A0211E8179603FFE12E4AB0E4704EA195704428700BAE5C4DFD42FF1A8760EDF2721F9724498ECC9F957735E7A3CDB9630DB17DF92ACE8F486706020E0A8D022D14BC313879724760AE20D67F572DD85211E4BEA45CDF3E22976253F113AEA96C1FF907329E4BD429BCFC6331077DA21F05D791DA6ECCF680D2E23AC77DFCE5C1D9869D3098F5B89FF92A','%2x')); fclose(fid); score(sol_score);