Sable / mclab-core

Core McLab features. McSAF, Tamer, Tamer+
http://www.sable.mcgill.ca/mclab/
Apache License 2.0
9 stars 9 forks source link

GC Limit reached with a ~500 line file #9

Open elavoie opened 8 years ago

elavoie commented 8 years ago

Exception in thread "main" java.lang.OutOfMemoryError: GC overhead limit exceeded at java.util.LinkedHashMap.newNode(LinkedHashMap.java:256) at java.util.HashMap.putVal(HashMap.java:630) at java.util.HashMap.putMapEntries(HashMap.java:514) at java.util.HashMap.putAll(HashMap.java:784) at natlab.tame.valueanalysis.ValueFlowMap.(ValueFlowMap.java:58) at natlab.tame.valueanalysis.ValueFlowMap.copy(ValueFlowMap.java:111) at natlab.tame.valueanalysis.IntraproceduralValueAnalysis.assign(IntraproceduralValueAnalysis.java:745) at natlab.tame.valueanalysis.IntraproceduralValueAnalysis.assign(IntraproceduralValueAnalysis.java:729) at natlab.tame.valueanalysis.IntraproceduralValueAnalysis.caseTIRAssignLiteralStmt(IntraproceduralValueAnalysis.java:378) at natlab.tame.tir.TIRAssignLiteralStmt.tirAnalyze(TIRAssignLiteralStmt.java:49) at natlab.tame.tir.analysis.TIRNodeForwarder.caseAssignStmt(TIRNodeForwarder.java:94) at analysis.natlab.NatlabAnalysisHelper.caseAssignStmt(NatlabAnalysisHelper.java:244) at ast.AssignStmt.analyze(AssignStmt.java:68) at analysis.natlab.NatlabAbstractStructuralAnalysis.analyze(NatlabAbstractStructuralAnalysis.java:128) at analysis.natlab.NatlabAbstractStructuralForwardAnalysis.caseASTNode(NatlabAbstractStructuralForwardAnalysis.java:58) at nodecases.natlab.NatlabAbstractNodeCaseHandler.caseList(NatlabAbstractNodeCaseHandler.java:124) at natlab.tame.tir.analysis.TIRParentForwardingNodeCasehandler.caseTIRStatementList(TIRParentForwardingNodeCasehandler.java:196) at natlab.tame.tir.analysis.TIRAbstractSimpleStructuralForwardAnalysis.caseTIRStatementList(TIRAbstractSimpleStructuralForwardAnalysis.java:172) at natlab.tame.tir.TIRStatementList.tirAnalyze(TIRStatementList.java:53) at natlab.tame.tir.analysis.TIRNodeForwarder.caseList(TIRNodeForwarder.java:74) at analysis.natlab.NatlabAnalysisHelper.caseList(NatlabAnalysisHelper.java:174) at ast.List.analyze(List.java:58) at analysis.natlab.NatlabAbstractStructuralAnalysis.analyze(NatlabAbstractStructuralAnalysis.java:128) at analysis.natlab.NatlabAbstractStructuralForwardAnalysis.caseASTNode(NatlabAbstractStructuralForwardAnalysis.java:58) at natlab.tame.valueanalysis.IntraproceduralValueAnalysis.caseFunction(IntraproceduralValueAnalysis.java:152) at natlab.tame.tir.analysis.TIRParentForwardingNodeCasehandler.caseTIRFunction(TIRParentForwardingNodeCasehandler.java:186) at natlab.tame.tir.analysis.TIRAbstractSimpleStructuralForwardAnalysis.caseTIRFunction(TIRAbstractSimpleStructuralForwardAnalysis.java:164) at natlab.tame.tir.TIRFunction.tirAnalyze(TIRFunction.java:51) at natlab.tame.tir.analysis.TIRNodeForwarder.caseFunction(TIRNodeForwarder.java:83) at analysis.natlab.NatlabAnalysisHelper.caseFunction(NatlabAnalysisHelper.java:489) at ast.Function.analyze(Function.java:72) at analysis.natlab.NatlabAbstractStructuralAnalysis.analyze(NatlabAbstractStructuralAnalysis.java:128)

Code in 'minus_test.m':

function minus_test(x) assert(isequal(minus(2,2),0)); assert(isequal(minus(2,-7),9)); assert(isequal(minus(2,7),-5)); assert(isequal(minus(2,0),2)); assert(isequal(minus(2,1),1)); assert(isequal(minus(2,-1),3)); assert(isequal(minus(2,[[-9];[-8];[-9]]),[[11];[10];[11]])); assert(isequal(minus(2,[[-7];[7];[-6]]),[[9];[-5];[8]])); assert(isequal(minus(2,[[10];[7];[8]]),[[-8];[-5];[-6]])); assert(isequal(minus(2,[[1 -2 2]]),[1 4 0])); assert(isequal(minus(2,[[8 9 -1]]),[-6 -7 3])); assert(isequal(minus(2,[[5 -7 3]]),[-3 9 -1])); assert(isequal(minus(2,[[-3 -9 -3 4];[2 5 -6 0];[2 1 -7 4]]),[[5 11 5 -2];[0 -3 8 2];[0 1 9 -2]])); assert(isequal(minus(2,[[7 -2 -6 6];[3 -2 -7 -1];[4 -4 -10 2]]),[[-5 4 8 -4];[-1 4 9 3];[-2 6 12 0]])); assert(isequal(minus(2,[[3 -4 9 1];[6 8 -6 -4];[-1 -3 3 -7]]),[[-1 6 -7 1];[-4 -6 8 6];[3 5 -1 9]])); assert(isequal(minus(1,2),-1)); assert(isequal(minus(1,-7),8)); assert(isequal(minus(1,7),-6)); assert(isequal(minus(1,0),1)); assert(isequal(minus(1,1),0)); assert(isequal(minus(1,-1),2)); assert(isequal(minus(1,[[-9];[-8];[-9]]),[[10];[9];[10]])); assert(isequal(minus(1,[[-7];[7];[-6]]),[[8];[-6];[7]])); assert(isequal(minus(1,[[10];[7];[8]]),[[-9];[-6];[-7]])); assert(isequal(minus(1,[[1 -2 2]]),[0 3 -1])); assert(isequal(minus(1,[[8 9 -1]]),[-7 -8 2])); assert(isequal(minus(1,[[5 -7 3]]),[-4 8 -2])); assert(isequal(minus(1,[[-3 -9 -3 4];[2 5 -6 0];[2 1 -7 4]]),[[4 10 4 -3];[-1 -4 7 1];[-1 0 8 -3]])); assert(isequal(minus(1,[[7 -2 -6 6];[3 -2 -7 -1];[4 -4 -10 2]]),[[-6 3 7 -5];[-2 3 8 2];[-3 5 11 -1]])); assert(isequal(minus(1,[[3 -4 9 1];[6 8 -6 -4];[-1 -3 3 -7]]),[[-2 5 -8 0];[-5 -7 7 5];[2 4 -2 8]])); assert(isequal(minus(-3,2),-5)); assert(isequal(minus(-3,-7),4)); assert(isequal(minus(-3,7),-10)); assert(isequal(minus(-3,0),-3)); assert(isequal(minus(-3,1),-4)); assert(isequal(minus(-3,-1),-2)); assert(isequal(minus(-3,[[-9];[-8];[-9]]),[[6];[5];[6]])); assert(isequal(minus(-3,[[-7];[7];[-6]]),[[4];[-10];[3]])); assert(isequal(minus(-3,[[10];[7];[8]]),[[-13];[-10];[-11]])); assert(isequal(minus(-3,[[1 -2 2]]),[-4 -1 -5])); assert(isequal(minus(-3,[[8 9 -1]]),[-11 -12 -2])); assert(isequal(minus(-3,[[5 -7 3]]),[-8 4 -6])); assert(isequal(minus(-3,[[-3 -9 -3 4];[2 5 -6 0];[2 1 -7 4]]),[[0 6 0 -7];[-5 -8 3 -3];[-5 -4 4 -7]])); assert(isequal(minus(-3,[[7 -2 -6 6];[3 -2 -7 -1];[4 -4 -10 2]]),[[-10 -1 3 -9];[-6 -1 4 -2];[-7 1 7 -5]])); assert(isequal(minus(-3,[[3 -4 9 1];[6 8 -6 -4];[-1 -3 3 -7]]),[[-6 1 -12 -4];[-9 -11 3 1];[-2 0 -6 4]])); assert(isequal(minus(0,2),-2)); assert(isequal(minus(0,-7),7)); assert(isequal(minus(0,7),-7)); assert(isequal(minus(0,0),0)); assert(isequal(minus(0,1),-1)); assert(isequal(minus(0,-1),1)); assert(isequal(minus(0,[[-9];[-8];[-9]]),[[9];[8];[9]])); assert(isequal(minus(0,[[-7];[7];[-6]]),[[7];[-7];[6]])); assert(isequal(minus(0,[[10];[7];[8]]),[[-10];[-7];[-8]])); assert(isequal(minus(0,[[1 -2 2]]),[-1 2 -2])); assert(isequal(minus(0,[[8 9 -1]]),[-8 -9 1])); assert(isequal(minus(0,[[5 -7 3]]),[-5 7 -3])); assert(isequal(minus(0,[[-3 -9 -3 4];[2 5 -6 0];[2 1 -7 4]]),[[3 9 3 -4];[-2 -5 6 0];[-2 -1 7 -4]])); assert(isequal(minus(0,[[7 -2 -6 6];[3 -2 -7 -1];[4 -4 -10 2]]),[[-7 2 6 -6];[-3 2 7 1];[-4 4 10 -2]])); assert(isequal(minus(0,[[3 -4 9 1];[6 8 -6 -4];[-1 -3 3 -7]]),[[-3 4 -9 -1];[-6 -8 6 4];[1 3 -3 7]])); assert(isequal(minus(1,2),-1)); assert(isequal(minus(1,-7),8)); assert(isequal(minus(1,7),-6)); assert(isequal(minus(1,0),1)); assert(isequal(minus(1,1),0)); assert(isequal(minus(1,-1),2)); assert(isequal(minus(1,[[-9];[-8];[-9]]),[[10];[9];[10]])); assert(isequal(minus(1,[[-7];[7];[-6]]),[[8];[-6];[7]])); assert(isequal(minus(1,[[10];[7];[8]]),[[-9];[-6];[-7]])); assert(isequal(minus(1,[[1 -2 2]]),[0 3 -1])); assert(isequal(minus(1,[[8 9 -1]]),[-7 -8 2])); assert(isequal(minus(1,[[5 -7 3]]),[-4 8 -2])); assert(isequal(minus(1,[[-3 -9 -3 4];[2 5 -6 0];[2 1 -7 4]]),[[4 10 4 -3];[-1 -4 7 1];[-1 0 8 -3]])); assert(isequal(minus(1,[[7 -2 -6 6];[3 -2 -7 -1];[4 -4 -10 2]]),[[-6 3 7 -5];[-2 3 8 2];[-3 5 11 -1]])); assert(isequal(minus(1,[[3 -4 9 1];[6 8 -6 -4];[-1 -3 3 -7]]),[[-2 5 -8 0];[-5 -7 7 5];[2 4 -2 8]])); assert(isequal(minus(-1,2),-3)); assert(isequal(minus(-1,-7),6)); assert(isequal(minus(-1,7),-8)); assert(isequal(minus(-1,0),-1)); assert(isequal(minus(-1,1),-2)); assert(isequal(minus(-1,-1),0)); assert(isequal(minus(-1,[[-9];[-8];[-9]]),[[8];[7];[8]])); assert(isequal(minus(-1,[[-7];[7];[-6]]),[[6];[-8];[5]])); assert(isequal(minus(-1,[[10];[7];[8]]),[[-11];[-8];[-9]])); assert(isequal(minus(-1,[[1 -2 2]]),[-2 1 -3])); assert(isequal(minus(-1,[[8 9 -1]]),[-9 -10 0])); assert(isequal(minus(-1,[[5 -7 3]]),[-6 6 -4])); assert(isequal(minus(-1,[[-3 -9 -3 4];[2 5 -6 0];[2 1 -7 4]]),[[2 8 2 -5];[-3 -6 5 -1];[-3 -2 6 -5]])); assert(isequal(minus(-1,[[7 -2 -6 6];[3 -2 -7 -1];[4 -4 -10 2]]),[[-8 1 5 -7];[-4 1 6 0];[-5 3 9 -3]])); assert(isequal(minus(-1,[[3 -4 9 1];[6 8 -6 -4];[-1 -3 3 -7]]),[[-4 3 -10 -2];[-7 -9 5 3];[0 2 -4 6]])); assert(isequal(minus([[-2];[6];[9]],2),[[-4];[4];[7]])); assert(isequal(minus([[-2];[6];[9]],-7),[[5];[13];[16]])); assert(isequal(minus([[-2];[6];[9]],7),[[-9];[-1];[2]])); assert(isequal(minus([[-2];[6];[9]],0),[[-2];[6];[9]])); assert(isequal(minus([[-2];[6];[9]],1),[[-3];[5];[8]])); assert(isequal(minus([[-2];[6];[9]],-1),[[-1];[7];[10]])); assert(isequal(minus([[-2];[6];[9]],[[-9];[-8];[-9]]),[[7];[14];[18]])); assert(isequal(minus([[-2];[6];[9]],[[-7];[7];[-6]]),[[5];[-1];[15]])); assert(isequal(minus([[-2];[6];[9]],[[10];[7];[8]]),[[-12];[-1];[1]])); % Call 'minus([[-2];[6];[9]],[[1 -2 2]])' produces an error % Call 'minus([[-2];[6];[9]],[[8 9 -1]])' produces an error % Call 'minus([[-2];[6];[9]],[[5 -7 3]])' produces an error % Call 'minus([[-2];[6];[9]],[[-3 -9 -3 4];[2 5 -6 0];[2 1 -7 4]])' produces an error % Call 'minus([[-2];[6];[9]],[[7 -2 -6 6];[3 -2 -7 -1];[4 -4 -10 2]])' produces an error % Call 'minus([[-2];[6];[9]],[[3 -4 9 1];[6 8 -6 -4];[-1 -3 3 -7]])' produces an error assert(isequal(minus([[-4];[10];[-6]],2),[[-6];[8];[-8]])); assert(isequal(minus([[-4];[10];[-6]],-7),[[3];[17];[1]])); assert(isequal(minus([[-4];[10];[-6]],7),[[-11];[3];[-13]])); assert(isequal(minus([[-4];[10];[-6]],0),[[-4];[10];[-6]])); assert(isequal(minus([[-4];[10];[-6]],1),[[-5];[9];[-7]])); assert(isequal(minus([[-4];[10];[-6]],-1),[[-3];[11];[-5]])); assert(isequal(minus([[-4];[10];[-6]],[[-9];[-8];[-9]]),[[5];[18];[3]])); assert(isequal(minus([[-4];[10];[-6]],[[-7];[7];[-6]]),[[3];[3];[0]])); assert(isequal(minus([[-4];[10];[-6]],[[10];[7];[8]]),[[-14];[3];[-14]])); % Call 'minus([[-4];[10];[-6]],[[1 -2 2]])' produces an error % Call 'minus([[-4];[10];[-6]],[[8 9 -1]])' produces an error % Call 'minus([[-4];[10];[-6]],[[5 -7 3]])' produces an error % Call 'minus([[-4];[10];[-6]],[[-3 -9 -3 4];[2 5 -6 0];[2 1 -7 4]])' produces an error % Call 'minus([[-4];[10];[-6]],[[7 -2 -6 6];[3 -2 -7 -1];[4 -4 -10 2]])' produces an error % Call 'minus([[-4];[10];[-6]],[[3 -4 9 1];[6 8 -6 -4];[-1 -3 3 -7]])' produces an error assert(isequal(minus([[3];[9];[-8]],2),[[1];[7];[-10]])); assert(isequal(minus([[3];[9];[-8]],-7),[[10];[16];[-1]])); assert(isequal(minus([[3];[9];[-8]],7),[[-4];[2];[-15]])); assert(isequal(minus([[3];[9];[-8]],0),[[3];[9];[-8]])); assert(isequal(minus([[3];[9];[-8]],1),[[2];[8];[-9]])); assert(isequal(minus([[3];[9];[-8]],-1),[[4];[10];[-7]])); assert(isequal(minus([[3];[9];[-8]],[[-9];[-8];[-9]]),[[12];[17];[1]])); assert(isequal(minus([[3];[9];[-8]],[[-7];[7];[-6]]),[[10];[2];[-2]])); assert(isequal(minus([[3];[9];[-8]],[[10];[7];[8]]),[[-7];[2];[-16]])); % Call 'minus([[3];[9];[-8]],[[1 -2 2]])' produces an error % Call 'minus([[3];[9];[-8]],[[8 9 -1]])' produces an error % Call 'minus([[3];[9];[-8]],[[5 -7 3]])' produces an error % Call 'minus([[3];[9];[-8]],[[-3 -9 -3 4];[2 5 -6 0];[2 1 -7 4]])' produces an error % Call 'minus([[3];[9];[-8]],[[7 -2 -6 6];[3 -2 -7 -1];[4 -4 -10 2]])' produces an error % Call 'minus([[3];[9];[-8]],[[3 -4 9 1];[6 8 -6 -4];[-1 -3 3 -7]])' produces an error assert(isequal(minus([[7 -2 -9]],2),[5 -4 -11])); assert(isequal(minus([[7 -2 -9]],-7),[14 5 -2])); assert(isequal(minus([[7 -2 -9]],7),[0 -9 -16])); assert(isequal(minus([[7 -2 -9]],0),[7 -2 -9])); assert(isequal(minus([[7 -2 -9]],1),[6 -3 -10])); assert(isequal(minus([[7 -2 -9]],-1),[8 -1 -8])); % Call 'minus([[7 -2 -9]],[[-9];[-8];[-9]])' produces an error % Call 'minus([[7 -2 -9]],[[-7];[7];[-6]])' produces an error % Call 'minus([[7 -2 -9]],[[10];[7];[8]])' produces an error assert(isequal(minus([[7 -2 -9]],[[1 -2 2]]),[6 0 -11])); assert(isequal(minus([[7 -2 -9]],[[8 9 -1]]),[-1 -11 -8])); assert(isequal(minus([[7 -2 -9]],[[5 -7 3]]),[2 5 -12])); % Call 'minus([[7 -2 -9]],[[-3 -9 -3 4];[2 5 -6 0];[2 1 -7 4]])' produces an error % Call 'minus([[7 -2 -9]],[[7 -2 -6 6];[3 -2 -7 -1];[4 -4 -10 2]])' produces an error % Call 'minus([[7 -2 -9]],[[3 -4 9 1];[6 8 -6 -4];[-1 -3 3 -7]])' produces an error assert(isequal(minus([[4 -3 -2]],2),[2 -5 -4])); assert(isequal(minus([[4 -3 -2]],-7),[11 4 5])); assert(isequal(minus([[4 -3 -2]],7),[-3 -10 -9])); assert(isequal(minus([[4 -3 -2]],0),[4 -3 -2])); assert(isequal(minus([[4 -3 -2]],1),[3 -4 -3])); assert(isequal(minus([[4 -3 -2]],-1),[5 -2 -1])); % Call 'minus([[4 -3 -2]],[[-9];[-8];[-9]])' produces an error % Call 'minus([[4 -3 -2]],[[-7];[7];[-6]])' produces an error % Call 'minus([[4 -3 -2]],[[10];[7];[8]])' produces an error assert(isequal(minus([[4 -3 -2]],[[1 -2 2]]),[3 -1 -4])); assert(isequal(minus([[4 -3 -2]],[[8 9 -1]]),[-4 -12 -1])); assert(isequal(minus([[4 -3 -2]],[[5 -7 3]]),[-1 4 -5])); % Call 'minus([[4 -3 -2]],[[-3 -9 -3 4];[2 5 -6 0];[2 1 -7 4]])' produces an error % Call 'minus([[4 -3 -2]],[[7 -2 -6 6];[3 -2 -7 -1];[4 -4 -10 2]])' produces an error % Call 'minus([[4 -3 -2]],[[3 -4 9 1];[6 8 -6 -4];[-1 -3 3 -7]])' produces an error assert(isequal(minus([[6 6 3]],2),[4 4 1])); assert(isequal(minus([[6 6 3]],-7),[13 13 10])); assert(isequal(minus([[6 6 3]],7),[-1 -1 -4])); assert(isequal(minus([[6 6 3]],0),[6 6 3])); assert(isequal(minus([[6 6 3]],1),[5 5 2])); assert(isequal(minus([[6 6 3]],-1),[7 7 4])); % Call 'minus([[6 6 3]],[[-9];[-8];[-9]])' produces an error % Call 'minus([[6 6 3]],[[-7];[7];[-6]])' produces an error % Call 'minus([[6 6 3]],[[10];[7];[8]])' produces an error assert(isequal(minus([[6 6 3]],[[1 -2 2]]),[5 8 1])); assert(isequal(minus([[6 6 3]],[[8 9 -1]]),[-2 -3 4])); assert(isequal(minus([[6 6 3]],[[5 -7 3]]),[1 13 0])); % Call 'minus([[6 6 3]],[[-3 -9 -3 4];[2 5 -6 0];[2 1 -7 4]])' produces an error % Call 'minus([[6 6 3]],[[7 -2 -6 6];[3 -2 -7 -1];[4 -4 -10 2]])' produces an error % Call 'minus([[6 6 3]],[[3 -4 9 1];[6 8 -6 -4];[-1 -3 3 -7]])' produces an error assert(isequal(minus([[7 2 -1];[10 6 -4]],2),[[5 0 -3];[8 4 -6]])); assert(isequal(minus([[7 2 -1];[10 6 -4]],-7),[[14 9 6];[17 13 3]])); assert(isequal(minus([[7 2 -1];[10 6 -4]],7),[[0 -5 -8];[3 -1 -11]])); assert(isequal(minus([[7 2 -1];[10 6 -4]],0),[[7 2 -1];[10 6 -4]])); assert(isequal(minus([[7 2 -1];[10 6 -4]],1),[[6 1 -2];[9 5 -5]])); assert(isequal(minus([[7 2 -1];[10 6 -4]],-1),[[8 3 0];[11 7 -3]])); % Call 'minus([[7 2 -1];[10 6 -4]],[[-9];[-8];[-9]])' produces an error % Call 'minus([[7 2 -1];[10 6 -4]],[[-7];[7];[-6]])' produces an error % Call 'minus([[7 2 -1];[10 6 -4]],[[10];[7];[8]])' produces an error % Call 'minus([[7 2 -1];[10 6 -4]],[[1 -2 2]])' produces an error % Call 'minus([[7 2 -1];[10 6 -4]],[[8 9 -1]])' produces an error % Call 'minus([[7 2 -1];[10 6 -4]],[[5 -7 3]])' produces an error % Call 'minus([[7 2 -1];[10 6 -4]],[[-3 -9 -3 4];[2 5 -6 0];[2 1 -7 4]])' produces an error % Call 'minus([[7 2 -1];[10 6 -4]],[[7 -2 -6 6];[3 -2 -7 -1];[4 -4 -10 2]])' produces an error % Call 'minus([[7 2 -1];[10 6 -4]],[[3 -4 9 1];[6 8 -6 -4];[-1 -3 3 -7]])' produces an error assert(isequal(minus([[4 9 -1];[-5 -6 -9]],2),[[2 7 -3];[-7 -8 -11]])); assert(isequal(minus([[4 9 -1];[-5 -6 -9]],-7),[[11 16 6];[2 1 -2]])); assert(isequal(minus([[4 9 -1];[-5 -6 -9]],7),[[-3 2 -8];[-12 -13 -16]])); assert(isequal(minus([[4 9 -1];[-5 -6 -9]],0),[[4 9 -1];[-5 -6 -9]])); assert(isequal(minus([[4 9 -1];[-5 -6 -9]],1),[[3 8 -2];[-6 -7 -10]])); assert(isequal(minus([[4 9 -1];[-5 -6 -9]],-1),[[5 10 0];[-4 -5 -8]])); % Call 'minus([[4 9 -1];[-5 -6 -9]],[[-9];[-8];[-9]])' produces an error % Call 'minus([[4 9 -1];[-5 -6 -9]],[[-7];[7];[-6]])' produces an error % Call 'minus([[4 9 -1];[-5 -6 -9]],[[10];[7];[8]])' produces an error % Call 'minus([[4 9 -1];[-5 -6 -9]],[[1 -2 2]])' produces an error % Call 'minus([[4 9 -1];[-5 -6 -9]],[[8 9 -1]])' produces an error % Call 'minus([[4 9 -1];[-5 -6 -9]],[[5 -7 3]])' produces an error % Call 'minus([[4 9 -1];[-5 -6 -9]],[[-3 -9 -3 4];[2 5 -6 0];[2 1 -7 4]])' produces an error % Call 'minus([[4 9 -1];[-5 -6 -9]],[[7 -2 -6 6];[3 -2 -7 -1];[4 -4 -10 2]])' produces an error % Call 'minus([[4 9 -1];[-5 -6 -9]],[[3 -4 9 1];[6 8 -6 -4];[-1 -3 3 -7]])' produces an error assert(isequal(minus([[1 2 2];[-10 -2 3]],2),[[-1 0 0];[-12 -4 1]])); assert(isequal(minus([[1 2 2];[-10 -2 3]],-7),[[8 9 9];[-3 5 10]])); assert(isequal(minus([[1 2 2];[-10 -2 3]],7),[[-6 -5 -5];[-17 -9 -4]])); assert(isequal(minus([[1 2 2];[-10 -2 3]],0),[[1 2 2];[-10 -2 3]])); assert(isequal(minus([[1 2 2];[-10 -2 3]],1),[[0 1 1];[-11 -3 2]])); assert(isequal(minus([[1 2 2];[-10 -2 3]],-1),[[2 3 3];[-9 -1 4]])); % Call 'minus([[1 2 2];[-10 -2 3]],[[-9];[-8];[-9]])' produces an error % Call 'minus([[1 2 2];[-10 -2 3]],[[-7];[7];[-6]])' produces an error % Call 'minus([[1 2 2];[-10 -2 3]],[[10];[7];[8]])' produces an error % Call 'minus([[1 2 2];[-10 -2 3]],[[1 -2 2]])' produces an error % Call 'minus([[1 2 2];[-10 -2 3]],[[8 9 -1]])' produces an error % Call 'minus([[1 2 2];[-10 -2 3]],[[5 -7 3]])' produces an error % Call 'minus([[1 2 2];[-10 -2 3]],[[-3 -9 -3 4];[2 5 -6 0];[2 1 -7 4]])' produces an error % Call 'minus([[1 2 2];[-10 -2 3]],[[7 -2 -6 6];[3 -2 -7 -1];[4 -4 -10 2]])' produces an error % Call 'minus([[1 2 2];[-10 -2 3]],[[3 -4 9 1];[6 8 -6 -4];[-1 -3 3 -7]])' produces an error assert(isequal(minus([[3 4 3 -6];[-5 -1 9 6];[-4 6 2 -1]],2),[[1 2 1 -8];[-7 -3 7 4];[-6 4 0 -3]])); assert(isequal(minus([[3 4 3 -6];[-5 -1 9 6];[-4 6 2 -1]],-7),[[10 11 10 1];[2 6 16 13];[3 13 9 6]])); assert(isequal(minus([[3 4 3 -6];[-5 -1 9 6];[-4 6 2 -1]],7),[[-4 -3 -4 -13];[-12 -8 2 -1];[-11 -1 -5 -8]])); assert(isequal(minus([[3 4 3 -6];[-5 -1 9 6];[-4 6 2 -1]],0),[[3 4 3 -6];[-5 -1 9 6];[-4 6 2 -1]])); assert(isequal(minus([[3 4 3 -6];[-5 -1 9 6];[-4 6 2 -1]],1),[[2 3 2 -7];[-6 -2 8 5];[-5 5 1 -2]])); assert(isequal(minus([[3 4 3 -6];[-5 -1 9 6];[-4 6 2 -1]],-1),[[4 5 4 -5];[-4 0 10 7];[-3 7 3 0]])); % Call 'minus([[3 4 3 -6];[-5 -1 9 6];[-4 6 2 -1]],[[-9];[-8];[-9]])' produces an error % Call 'minus([[3 4 3 -6];[-5 -1 9 6];[-4 6 2 -1]],[[-7];[7];[-6]])' produces an error % Call 'minus([[3 4 3 -6];[-5 -1 9 6];[-4 6 2 -1]],[[10];[7];[8]])' produces an error % Call 'minus([[3 4 3 -6];[-5 -1 9 6];[-4 6 2 -1]],[[1 -2 2]])' produces an error % Call 'minus([[3 4 3 -6];[-5 -1 9 6];[-4 6 2 -1]],[[8 9 -1]])' produces an error % Call 'minus([[3 4 3 -6];[-5 -1 9 6];[-4 6 2 -1]],[[5 -7 3]])' produces an error assert(isequal(minus([[3 4 3 -6];[-5 -1 9 6];[-4 6 2 -1]],[[-3 -9 -3 4];[2 5 -6 0];[2 1 -7 4]]),[[6 13 6 -10];[-7 -6 15 6];[-6 5 9 -5]])); assert(isequal(minus([[3 4 3 -6];[-5 -1 9 6];[-4 6 2 -1]],[[7 -2 -6 6];[3 -2 -7 -1];[4 -4 -10 2]]),[[-4 6 9 -12];[-8 1 16 7];[-8 10 12 -3]])); assert(isequal(minus([[3 4 3 -6];[-5 -1 9 6];[-4 6 2 -1]],[[3 -4 9 1];[6 8 -6 -4];[-1 -3 3 -7]]),[[0 8 -6 -7];[-11 -9 15 10];[-3 9 -1 6]])); assert(isequal(minus([[6 1 6 1];[3 7 -6 10];[1 1 6 -9]],2),[[4 -1 4 -1];[1 5 -8 8];[-1 -1 4 -11]])); assert(isequal(minus([[6 1 6 1];[3 7 -6 10];[1 1 6 -9]],-7),[[13 8 13 8];[10 14 1 17];[8 8 13 -2]])); assert(isequal(minus([[6 1 6 1];[3 7 -6 10];[1 1 6 -9]],7),[[-1 -6 -1 -6];[-4 0 -13 3];[-6 -6 -1 -16]])); assert(isequal(minus([[6 1 6 1];[3 7 -6 10];[1 1 6 -9]],0),[[6 1 6 1];[3 7 -6 10];[1 1 6 -9]])); assert(isequal(minus([[6 1 6 1];[3 7 -6 10];[1 1 6 -9]],1),[[5 0 5 0];[2 6 -7 9];[0 0 5 -10]])); assert(isequal(minus([[6 1 6 1];[3 7 -6 10];[1 1 6 -9]],-1),[[7 2 7 2];[4 8 -5 11];[2 2 7 -8]])); % Call 'minus([[6 1 6 1];[3 7 -6 10];[1 1 6 -9]],[[-9];[-8];[-9]])' produces an error % Call 'minus([[6 1 6 1];[3 7 -6 10];[1 1 6 -9]],[[-7];[7];[-6]])' produces an error % Call 'minus([[6 1 6 1];[3 7 -6 10];[1 1 6 -9]],[[10];[7];[8]])' produces an error % Call 'minus([[6 1 6 1];[3 7 -6 10];[1 1 6 -9]],[[1 -2 2]])' produces an error % Call 'minus([[6 1 6 1];[3 7 -6 10];[1 1 6 -9]],[[8 9 -1]])' produces an error % Call 'minus([[6 1 6 1];[3 7 -6 10];[1 1 6 -9]],[[5 -7 3]])' produces an error assert(isequal(minus([[6 1 6 1];[3 7 -6 10];[1 1 6 -9]],[[-3 -9 -3 4];[2 5 -6 0];[2 1 -7 4]]),[[9 10 9 -3];[1 2 0 10];[-1 0 13 -13]])); assert(isequal(minus([[6 1 6 1];[3 7 -6 10];[1 1 6 -9]],[[7 -2 -6 6];[3 -2 -7 -1];[4 -4 -10 2]]),[[-1 3 12 -5];[0 9 1 11];[-3 5 16 -11]])); assert(isequal(minus([[6 1 6 1];[3 7 -6 10];[1 1 6 -9]],[[3 -4 9 1];[6 8 -6 -4];[-1 -3 3 -7]]),[[3 5 -3 0];[-3 -1 0 14];[2 4 3 -2]])); assert(isequal(minus([[0 5 -1 8];[6 0 5 5];[-3 1 1 -5]],2),[[-2 3 -3 6];[4 -2 3 3];[-5 -1 -1 -7]])); assert(isequal(minus([[0 5 -1 8];[6 0 5 5];[-3 1 1 -5]],-7),[[7 12 6 15];[13 7 12 12];[4 8 8 2]])); assert(isequal(minus([[0 5 -1 8];[6 0 5 5];[-3 1 1 -5]],7),[[-7 -2 -8 1];[-1 -7 -2 -2];[-10 -6 -6 -12]])); assert(isequal(minus([[0 5 -1 8];[6 0 5 5];[-3 1 1 -5]],0),[[0 5 -1 8];[6 0 5 5];[-3 1 1 -5]])); assert(isequal(minus([[0 5 -1 8];[6 0 5 5];[-3 1 1 -5]],1),[[-1 4 -2 7];[5 -1 4 4];[-4 0 0 -6]])); assert(isequal(minus([[0 5 -1 8];[6 0 5 5];[-3 1 1 -5]],-1),[[1 6 0 9];[7 1 6 6];[-2 2 2 -4]])); % Call 'minus([[0 5 -1 8];[6 0 5 5];[-3 1 1 -5]],[[-9];[-8];[-9]])' produces an error % Call 'minus([[0 5 -1 8];[6 0 5 5];[-3 1 1 -5]],[[-7];[7];[-6]])' produces an error % Call 'minus([[0 5 -1 8];[6 0 5 5];[-3 1 1 -5]],[[10];[7];[8]])' produces an error % Call 'minus([[0 5 -1 8];[6 0 5 5];[-3 1 1 -5]],[[1 -2 2]])' produces an error % Call 'minus([[0 5 -1 8];[6 0 5 5];[-3 1 1 -5]],[[8 9 -1]])' produces an error % Call 'minus([[0 5 -1 8];[6 0 5 5];[-3 1 1 -5]],[[5 -7 3]])' produces an error assert(isequal(minus([[0 5 -1 8];[6 0 5 5];[-3 1 1 -5]],[[-3 -9 -3 4];[2 5 -6 0];[2 1 -7 4]]),[[3 14 2 4];[4 -5 11 5];[-5 0 8 -9]])); assert(isequal(minus([[0 5 -1 8];[6 0 5 5];[-3 1 1 -5]],[[7 -2 -6 6];[3 -2 -7 -1];[4 -4 -10 2]]),[[-7 7 5 2];[3 2 12 6];[-7 5 11 -7]])); assert(isequal(minus([[0 5 -1 8];[6 0 5 5];[-3 1 1 -5]],[[3 -4 9 1];[6 8 -6 -4];[-1 -3 3 -7]]),[[-3 9 -10 7];[0 -8 11 9];[-2 4 -2 2]])); assert(isequal((2 - 2),0)); assert(isequal((2 - -7),9)); assert(isequal((2 - 7),-5)); assert(isequal((2 - 0),2)); assert(isequal((2 - 1),1)); assert(isequal((2 - -1),3)); assert(isequal((2 - [[-9];[-8];[-9]]),[[11];[10];[11]])); assert(isequal((2 - [[-7];[7];[-6]]),[[9];[-5];[8]])); assert(isequal((2 - [[10];[7];[8]]),[[-8];[-5];[-6]])); assert(isequal((2 - [[1 -2 2]]),[1 4 0])); assert(isequal((2 - [[8 9 -1]]),[-6 -7 3])); assert(isequal((2 - [[5 -7 3]]),[-3 9 -1])); assert(isequal((2 - [[-3 -9 -3 4];[2 5 -6 0];[2 1 -7 4]]),[[5 11 5 -2];[0 -3 8 2];[0 1 9 -2]])); assert(isequal((2 - [[7 -2 -6 6];[3 -2 -7 -1];[4 -4 -10 2]]),[[-5 4 8 -4];[-1 4 9 3];[-2 6 12 0]])); assert(isequal((2 - [[3 -4 9 1];[6 8 -6 -4];[-1 -3 3 -7]]),[[-1 6 -7 1];[-4 -6 8 6];[3 5 -1 9]])); assert(isequal((1 - 2),-1)); assert(isequal((1 - -7),8)); assert(isequal((1 - 7),-6)); assert(isequal((1 - 0),1)); assert(isequal((1 - 1),0)); assert(isequal((1 - -1),2)); assert(isequal((1 - [[-9];[-8];[-9]]),[[10];[9];[10]])); assert(isequal((1 - [[-7];[7];[-6]]),[[8];[-6];[7]])); assert(isequal((1 - [[10];[7];[8]]),[[-9];[-6];[-7]])); assert(isequal((1 - [[1 -2 2]]),[0 3 -1])); assert(isequal((1 - [[8 9 -1]]),[-7 -8 2])); assert(isequal((1 - [[5 -7 3]]),[-4 8 -2])); assert(isequal((1 - [[-3 -9 -3 4];[2 5 -6 0];[2 1 -7 4]]),[[4 10 4 -3];[-1 -4 7 1];[-1 0 8 -3]])); assert(isequal((1 - [[7 -2 -6 6];[3 -2 -7 -1];[4 -4 -10 2]]),[[-6 3 7 -5];[-2 3 8 2];[-3 5 11 -1]])); assert(isequal((1 - [[3 -4 9 1];[6 8 -6 -4];[-1 -3 3 -7]]),[[-2 5 -8 0];[-5 -7 7 5];[2 4 -2 8]])); assert(isequal((-3 - 2),-5)); assert(isequal((-3 - -7),4)); assert(isequal((-3 - 7),-10)); assert(isequal((-3 - 0),-3)); assert(isequal((-3 - 1),-4)); assert(isequal((-3 - -1),-2)); assert(isequal((-3 - [[-9];[-8];[-9]]),[[6];[5];[6]])); assert(isequal((-3 - [[-7];[7];[-6]]),[[4];[-10];[3]])); assert(isequal((-3 - [[10];[7];[8]]),[[-13];[-10];[-11]])); assert(isequal((-3 - [[1 -2 2]]),[-4 -1 -5])); assert(isequal((-3 - [[8 9 -1]]),[-11 -12 -2])); assert(isequal((-3 - [[5 -7 3]]),[-8 4 -6])); assert(isequal((-3 - [[-3 -9 -3 4];[2 5 -6 0];[2 1 -7 4]]),[[0 6 0 -7];[-5 -8 3 -3];[-5 -4 4 -7]])); assert(isequal((-3 - [[7 -2 -6 6];[3 -2 -7 -1];[4 -4 -10 2]]),[[-10 -1 3 -9];[-6 -1 4 -2];[-7 1 7 -5]])); assert(isequal((-3 - [[3 -4 9 1];[6 8 -6 -4];[-1 -3 3 -7]]),[[-6 1 -12 -4];[-9 -11 3 1];[-2 0 -6 4]])); assert(isequal((0 - 2),-2)); assert(isequal((0 - -7),7)); assert(isequal((0 - 7),-7)); assert(isequal((0 - 0),0)); assert(isequal((0 - 1),-1)); assert(isequal((0 - -1),1)); assert(isequal((0 - [[-9];[-8];[-9]]),[[9];[8];[9]])); assert(isequal((0 - [[-7];[7];[-6]]),[[7];[-7];[6]])); assert(isequal((0 - [[10];[7];[8]]),[[-10];[-7];[-8]])); assert(isequal((0 - [[1 -2 2]]),[-1 2 -2])); assert(isequal((0 - [[8 9 -1]]),[-8 -9 1])); assert(isequal((0 - [[5 -7 3]]),[-5 7 -3])); assert(isequal((0 - [[-3 -9 -3 4];[2 5 -6 0];[2 1 -7 4]]),[[3 9 3 -4];[-2 -5 6 0];[-2 -1 7 -4]])); assert(isequal((0 - [[7 -2 -6 6];[3 -2 -7 -1];[4 -4 -10 2]]),[[-7 2 6 -6];[-3 2 7 1];[-4 4 10 -2]])); assert(isequal((0 - [[3 -4 9 1];[6 8 -6 -4];[-1 -3 3 -7]]),[[-3 4 -9 -1];[-6 -8 6 4];[1 3 -3 7]])); assert(isequal((1 - 2),-1)); assert(isequal((1 - -7),8)); assert(isequal((1 - 7),-6)); assert(isequal((1 - 0),1)); assert(isequal((1 - 1),0)); assert(isequal((1 - -1),2)); assert(isequal((1 - [[-9];[-8];[-9]]),[[10];[9];[10]])); assert(isequal((1 - [[-7];[7];[-6]]),[[8];[-6];[7]])); assert(isequal((1 - [[10];[7];[8]]),[[-9];[-6];[-7]])); assert(isequal((1 - [[1 -2 2]]),[0 3 -1])); assert(isequal((1 - [[8 9 -1]]),[-7 -8 2])); assert(isequal((1 - [[5 -7 3]]),[-4 8 -2])); assert(isequal((1 - [[-3 -9 -3 4];[2 5 -6 0];[2 1 -7 4]]),[[4 10 4 -3];[-1 -4 7 1];[-1 0 8 -3]])); assert(isequal((1 - [[7 -2 -6 6];[3 -2 -7 -1];[4 -4 -10 2]]),[[-6 3 7 -5];[-2 3 8 2];[-3 5 11 -1]])); assert(isequal((1 - [[3 -4 9 1];[6 8 -6 -4];[-1 -3 3 -7]]),[[-2 5 -8 0];[-5 -7 7 5];[2 4 -2 8]])); assert(isequal((-1 - 2),-3)); assert(isequal((-1 - -7),6)); assert(isequal((-1 - 7),-8)); assert(isequal((-1 - 0),-1)); assert(isequal((-1 - 1),-2)); assert(isequal((-1 - -1),0)); assert(isequal((-1 - [[-9];[-8];[-9]]),[[8];[7];[8]])); assert(isequal((-1 - [[-7];[7];[-6]]),[[6];[-8];[5]])); assert(isequal((-1 - [[10];[7];[8]]),[[-11];[-8];[-9]])); assert(isequal((-1 - [[1 -2 2]]),[-2 1 -3])); assert(isequal((-1 - [[8 9 -1]]),[-9 -10 0])); assert(isequal((-1 - [[5 -7 3]]),[-6 6 -4])); assert(isequal((-1 - [[-3 -9 -3 4];[2 5 -6 0];[2 1 -7 4]]),[[2 8 2 -5];[-3 -6 5 -1];[-3 -2 6 -5]])); assert(isequal((-1 - [[7 -2 -6 6];[3 -2 -7 -1];[4 -4 -10 2]]),[[-8 1 5 -7];[-4 1 6 0];[-5 3 9 -3]])); assert(isequal((-1 - [[3 -4 9 1];[6 8 -6 -4];[-1 -3 3 -7]]),[[-4 3 -10 -2];[-7 -9 5 3];[0 2 -4 6]])); assert(isequal(([[-2];[6];[9]] - 2),[[-4];[4];[7]])); assert(isequal(([[-2];[6];[9]] - -7),[[5];[13];[16]])); assert(isequal(([[-2];[6];[9]] - 7),[[-9];[-1];[2]])); assert(isequal(([[-2];[6];[9]] - 0),[[-2];[6];[9]])); assert(isequal(([[-2];[6];[9]] - 1),[[-3];[5];[8]])); assert(isequal(([[-2];[6];[9]] - -1),[[-1];[7];[10]])); assert(isequal(([[-2];[6];[9]] - [[-9];[-8];[-9]]),[[7];[14];[18]])); assert(isequal(([[-2];[6];[9]] - [[-7];[7];[-6]]),[[5];[-1];[15]])); assert(isequal(([[-2];[6];[9]] - [[10];[7];[8]]),[[-12];[-1];[1]])); % Call '([[-2];[6];[9]] - [[1 -2 2]])' produces an error % Call '([[-2];[6];[9]] - [[8 9 -1]])' produces an error % Call '([[-2];[6];[9]] - [[5 -7 3]])' produces an error % Call '([[-2];[6];[9]] - [[-3 -9 -3 4];[2 5 -6 0];[2 1 -7 4]])' produces an error % Call '([[-2];[6];[9]] - [[7 -2 -6 6];[3 -2 -7 -1];[4 -4 -10 2]])' produces an error % Call '([[-2];[6];[9]] - [[3 -4 9 1];[6 8 -6 -4];[-1 -3 3 -7]])' produces an error assert(isequal(([[-4];[10];[-6]] - 2),[[-6];[8];[-8]])); assert(isequal(([[-4];[10];[-6]] - -7),[[3];[17];[1]])); assert(isequal(([[-4];[10];[-6]] - 7),[[-11];[3];[-13]])); assert(isequal(([[-4];[10];[-6]] - 0),[[-4];[10];[-6]])); assert(isequal(([[-4];[10];[-6]] - 1),[[-5];[9];[-7]])); assert(isequal(([[-4];[10];[-6]] - -1),[[-3];[11];[-5]])); assert(isequal(([[-4];[10];[-6]] - [[-9];[-8];[-9]]),[[5];[18];[3]])); assert(isequal(([[-4];[10];[-6]] - [[-7];[7];[-6]]),[[3];[3];[0]])); assert(isequal(([[-4];[10];[-6]] - [[10];[7];[8]]),[[-14];[3];[-14]])); % Call '([[-4];[10];[-6]] - [[1 -2 2]])' produces an error % Call '([[-4];[10];[-6]] - [[8 9 -1]])' produces an error % Call '([[-4];[10];[-6]] - [[5 -7 3]])' produces an error % Call '([[-4];[10];[-6]] - [[-3 -9 -3 4];[2 5 -6 0];[2 1 -7 4]])' produces an error % Call '([[-4];[10];[-6]] - [[7 -2 -6 6];[3 -2 -7 -1];[4 -4 -10 2]])' produces an error % Call '([[-4];[10];[-6]] - [[3 -4 9 1];[6 8 -6 -4];[-1 -3 3 -7]])' produces an error assert(isequal(([[3];[9];[-8]] - 2),[[1];[7];[-10]])); assert(isequal(([[3];[9];[-8]] - -7),[[10];[16];[-1]])); assert(isequal(([[3];[9];[-8]] - 7),[[-4];[2];[-15]])); assert(isequal(([[3];[9];[-8]] - 0),[[3];[9];[-8]])); assert(isequal(([[3];[9];[-8]] - 1),[[2];[8];[-9]])); assert(isequal(([[3];[9];[-8]] - -1),[[4];[10];[-7]])); assert(isequal(([[3];[9];[-8]] - [[-9];[-8];[-9]]),[[12];[17];[1]])); assert(isequal(([[3];[9];[-8]] - [[-7];[7];[-6]]),[[10];[2];[-2]])); assert(isequal(([[3];[9];[-8]] - [[10];[7];[8]]),[[-7];[2];[-16]])); % Call '([[3];[9];[-8]] - [[1 -2 2]])' produces an error % Call '([[3];[9];[-8]] - [[8 9 -1]])' produces an error % Call '([[3];[9];[-8]] - [[5 -7 3]])' produces an error % Call '([[3];[9];[-8]] - [[-3 -9 -3 4];[2 5 -6 0];[2 1 -7 4]])' produces an error % Call '([[3];[9];[-8]] - [[7 -2 -6 6];[3 -2 -7 -1];[4 -4 -10 2]])' produces an error % Call '([[3];[9];[-8]] - [[3 -4 9 1];[6 8 -6 -4];[-1 -3 3 -7]])' produces an error assert(isequal(([[7 -2 -9]] - 2),[5 -4 -11])); assert(isequal(([[7 -2 -9]] - -7),[14 5 -2])); assert(isequal(([[7 -2 -9]] - 7),[0 -9 -16])); assert(isequal(([[7 -2 -9]] - 0),[7 -2 -9])); assert(isequal(([[7 -2 -9]] - 1),[6 -3 -10])); assert(isequal(([[7 -2 -9]] - -1),[8 -1 -8])); % Call '([[7 -2 -9]] - [[-9];[-8];[-9]])' produces an error % Call '([[7 -2 -9]] - [[-7];[7];[-6]])' produces an error % Call '([[7 -2 -9]] - [[10];[7];[8]])' produces an error assert(isequal(([[7 -2 -9]] - [[1 -2 2]]),[6 0 -11])); assert(isequal(([[7 -2 -9]] - [[8 9 -1]]),[-1 -11 -8])); assert(isequal(([[7 -2 -9]] - [[5 -7 3]]),[2 5 -12])); % Call '([[7 -2 -9]] - [[-3 -9 -3 4];[2 5 -6 0];[2 1 -7 4]])' produces an error % Call '([[7 -2 -9]] - [[7 -2 -6 6];[3 -2 -7 -1];[4 -4 -10 2]])' produces an error % Call '([[7 -2 -9]] - [[3 -4 9 1];[6 8 -6 -4];[-1 -3 3 -7]])' produces an error assert(isequal(([[4 -3 -2]] - 2),[2 -5 -4])); assert(isequal(([[4 -3 -2]] - -7),[11 4 5])); assert(isequal(([[4 -3 -2]] - 7),[-3 -10 -9])); assert(isequal(([[4 -3 -2]] - 0),[4 -3 -2])); assert(isequal(([[4 -3 -2]] - 1),[3 -4 -3])); assert(isequal(([[4 -3 -2]] - -1),[5 -2 -1])); % Call '([[4 -3 -2]] - [[-9];[-8];[-9]])' produces an error % Call '([[4 -3 -2]] - [[-7];[7];[-6]])' produces an error % Call '([[4 -3 -2]] - [[10];[7];[8]])' produces an error assert(isequal(([[4 -3 -2]] - [[1 -2 2]]),[3 -1 -4])); assert(isequal(([[4 -3 -2]] - [[8 9 -1]]),[-4 -12 -1])); assert(isequal(([[4 -3 -2]] - [[5 -7 3]]),[-1 4 -5])); % Call '([[4 -3 -2]] - [[-3 -9 -3 4];[2 5 -6 0];[2 1 -7 4]])' produces an error % Call '([[4 -3 -2]] - [[7 -2 -6 6];[3 -2 -7 -1];[4 -4 -10 2]])' produces an error % Call '([[4 -3 -2]] - [[3 -4 9 1];[6 8 -6 -4];[-1 -3 3 -7]])' produces an error assert(isequal(([[6 6 3]] - 2),[4 4 1])); assert(isequal(([[6 6 3]] - -7),[13 13 10])); assert(isequal(([[6 6 3]] - 7),[-1 -1 -4])); assert(isequal(([[6 6 3]] - 0),[6 6 3])); assert(isequal(([[6 6 3]] - 1),[5 5 2])); assert(isequal(([[6 6 3]] - -1),[7 7 4])); % Call '([[6 6 3]] - [[-9];[-8];[-9]])' produces an error % Call '([[6 6 3]] - [[-7];[7];[-6]])' produces an error % Call '([[6 6 3]] - [[10];[7];[8]])' produces an error assert(isequal(([[6 6 3]] - [[1 -2 2]]),[5 8 1])); assert(isequal(([[6 6 3]] - [[8 9 -1]]),[-2 -3 4])); assert(isequal(([[6 6 3]] - [[5 -7 3]]),[1 13 0])); % Call '([[6 6 3]] - [[-3 -9 -3 4];[2 5 -6 0];[2 1 -7 4]])' produces an error % Call '([[6 6 3]] - [[7 -2 -6 6];[3 -2 -7 -1];[4 -4 -10 2]])' produces an error % Call '([[6 6 3]] - [[3 -4 9 1];[6 8 -6 -4];[-1 -3 3 -7]])' produces an error assert(isequal(([[7 2 -1];[10 6 -4]] - 2),[[5 0 -3];[8 4 -6]])); assert(isequal(([[7 2 -1];[10 6 -4]] - -7),[[14 9 6];[17 13 3]])); assert(isequal(([[7 2 -1];[10 6 -4]] - 7),[[0 -5 -8];[3 -1 -11]])); assert(isequal(([[7 2 -1];[10 6 -4]] - 0),[[7 2 -1];[10 6 -4]])); assert(isequal(([[7 2 -1];[10 6 -4]] - 1),[[6 1 -2];[9 5 -5]])); assert(isequal(([[7 2 -1];[10 6 -4]] - -1),[[8 3 0];[11 7 -3]])); % Call '([[7 2 -1];[10 6 -4]] - [[-9];[-8];[-9]])' produces an error % Call '([[7 2 -1];[10 6 -4]] - [[-7];[7];[-6]])' produces an error % Call '([[7 2 -1];[10 6 -4]] - [[10];[7];[8]])' produces an error % Call '([[7 2 -1];[10 6 -4]] - [[1 -2 2]])' produces an error % Call '([[7 2 -1];[10 6 -4]] - [[8 9 -1]])' produces an error % Call '([[7 2 -1];[10 6 -4]] - [[5 -7 3]])' produces an error % Call '([[7 2 -1];[10 6 -4]] - [[-3 -9 -3 4];[2 5 -6 0];[2 1 -7 4]])' produces an error % Call '([[7 2 -1];[10 6 -4]] - [[7 -2 -6 6];[3 -2 -7 -1];[4 -4 -10 2]])' produces an error % Call '([[7 2 -1];[10 6 -4]] - [[3 -4 9 1];[6 8 -6 -4];[-1 -3 3 -7]])' produces an error assert(isequal(([[4 9 -1];[-5 -6 -9]] - 2),[[2 7 -3];[-7 -8 -11]])); assert(isequal(([[4 9 -1];[-5 -6 -9]] - -7),[[11 16 6];[2 1 -2]])); assert(isequal(([[4 9 -1];[-5 -6 -9]] - 7),[[-3 2 -8];[-12 -13 -16]])); assert(isequal(([[4 9 -1];[-5 -6 -9]] - 0),[[4 9 -1];[-5 -6 -9]])); assert(isequal(([[4 9 -1];[-5 -6 -9]] - 1),[[3 8 -2];[-6 -7 -10]])); assert(isequal(([[4 9 -1];[-5 -6 -9]] - -1),[[5 10 0];[-4 -5 -8]])); % Call '([[4 9 -1];[-5 -6 -9]] - [[-9];[-8];[-9]])' produces an error % Call '([[4 9 -1];[-5 -6 -9]] - [[-7];[7];[-6]])' produces an error % Call '([[4 9 -1];[-5 -6 -9]] - [[10];[7];[8]])' produces an error % Call '([[4 9 -1];[-5 -6 -9]] - [[1 -2 2]])' produces an error % Call '([[4 9 -1];[-5 -6 -9]] - [[8 9 -1]])' produces an error % Call '([[4 9 -1];[-5 -6 -9]] - [[5 -7 3]])' produces an error % Call '([[4 9 -1];[-5 -6 -9]] - [[-3 -9 -3 4];[2 5 -6 0];[2 1 -7 4]])' produces an error % Call '([[4 9 -1];[-5 -6 -9]] - [[7 -2 -6 6];[3 -2 -7 -1];[4 -4 -10 2]])' produces an error % Call '([[4 9 -1];[-5 -6 -9]] - [[3 -4 9 1];[6 8 -6 -4];[-1 -3 3 -7]])' produces an error assert(isequal(([[1 2 2];[-10 -2 3]] - 2),[[-1 0 0];[-12 -4 1]])); assert(isequal(([[1 2 2];[-10 -2 3]] - -7),[[8 9 9];[-3 5 10]])); assert(isequal(([[1 2 2];[-10 -2 3]] - 7),[[-6 -5 -5];[-17 -9 -4]])); assert(isequal(([[1 2 2];[-10 -2 3]] - 0),[[1 2 2];[-10 -2 3]])); assert(isequal(([[1 2 2];[-10 -2 3]] - 1),[[0 1 1];[-11 -3 2]])); assert(isequal(([[1 2 2];[-10 -2 3]] - -1),[[2 3 3];[-9 -1 4]])); % Call '([[1 2 2];[-10 -2 3]] - [[-9];[-8];[-9]])' produces an error % Call '([[1 2 2];[-10 -2 3]] - [[-7];[7];[-6]])' produces an error % Call '([[1 2 2];[-10 -2 3]] - [[10];[7];[8]])' produces an error % Call '([[1 2 2];[-10 -2 3]] - [[1 -2 2]])' produces an error % Call '([[1 2 2];[-10 -2 3]] - [[8 9 -1]])' produces an error % Call '([[1 2 2];[-10 -2 3]] - [[5 -7 3]])' produces an error % Call '([[1 2 2];[-10 -2 3]] - [[-3 -9 -3 4];[2 5 -6 0];[2 1 -7 4]])' produces an error % Call '([[1 2 2];[-10 -2 3]] - [[7 -2 -6 6];[3 -2 -7 -1];[4 -4 -10 2]])' produces an error % Call '([[1 2 2];[-10 -2 3]] - [[3 -4 9 1];[6 8 -6 -4];[-1 -3 3 -7]])' produces an error assert(isequal(([[3 4 3 -6];[-5 -1 9 6];[-4 6 2 -1]] - 2),[[1 2 1 -8];[-7 -3 7 4];[-6 4 0 -3]])); assert(isequal(([[3 4 3 -6];[-5 -1 9 6];[-4 6 2 -1]] - -7),[[10 11 10 1];[2 6 16 13];[3 13 9 6]])); assert(isequal(([[3 4 3 -6];[-5 -1 9 6];[-4 6 2 -1]] - 7),[[-4 -3 -4 -13];[-12 -8 2 -1];[-11 -1 -5 -8]])); assert(isequal(([[3 4 3 -6];[-5 -1 9 6];[-4 6 2 -1]] - 0),[[3 4 3 -6];[-5 -1 9 6];[-4 6 2 -1]])); assert(isequal(([[3 4 3 -6];[-5 -1 9 6];[-4 6 2 -1]] - 1),[[2 3 2 -7];[-6 -2 8 5];[-5 5 1 -2]])); assert(isequal(([[3 4 3 -6];[-5 -1 9 6];[-4 6 2 -1]] - -1),[[4 5 4 -5];[-4 0 10 7];[-3 7 3 0]])); % Call '([[3 4 3 -6];[-5 -1 9 6];[-4 6 2 -1]] - [[-9];[-8];[-9]])' produces an error % Call '([[3 4 3 -6];[-5 -1 9 6];[-4 6 2 -1]] - [[-7];[7];[-6]])' produces an error % Call '([[3 4 3 -6];[-5 -1 9 6];[-4 6 2 -1]] - [[10];[7];[8]])' produces an error % Call '([[3 4 3 -6];[-5 -1 9 6];[-4 6 2 -1]] - [[1 -2 2]])' produces an error % Call '([[3 4 3 -6];[-5 -1 9 6];[-4 6 2 -1]] - [[8 9 -1]])' produces an error % Call '([[3 4 3 -6];[-5 -1 9 6];[-4 6 2 -1]] - [[5 -7 3]])' produces an error assert(isequal(([[3 4 3 -6];[-5 -1 9 6];[-4 6 2 -1]] - [[-3 -9 -3 4];[2 5 -6 0];[2 1 -7 4]]),[[6 13 6 -10];[-7 -6 15 6];[-6 5 9 -5]])); assert(isequal(([[3 4 3 -6];[-5 -1 9 6];[-4 6 2 -1]] - [[7 -2 -6 6];[3 -2 -7 -1];[4 -4 -10 2]]),[[-4 6 9 -12];[-8 1 16 7];[-8 10 12 -3]])); assert(isequal(([[3 4 3 -6];[-5 -1 9 6];[-4 6 2 -1]] - [[3 -4 9 1];[6 8 -6 -4];[-1 -3 3 -7]]),[[0 8 -6 -7];[-11 -9 15 10];[-3 9 -1 6]])); assert(isequal(([[6 1 6 1];[3 7 -6 10];[1 1 6 -9]] - 2),[[4 -1 4 -1];[1 5 -8 8];[-1 -1 4 -11]])); assert(isequal(([[6 1 6 1];[3 7 -6 10];[1 1 6 -9]] - -7),[[13 8 13 8];[10 14 1 17];[8 8 13 -2]])); assert(isequal(([[6 1 6 1];[3 7 -6 10];[1 1 6 -9]] - 7),[[-1 -6 -1 -6];[-4 0 -13 3];[-6 -6 -1 -16]])); assert(isequal(([[6 1 6 1];[3 7 -6 10];[1 1 6 -9]] - 0),[[6 1 6 1];[3 7 -6 10];[1 1 6 -9]])); assert(isequal(([[6 1 6 1];[3 7 -6 10];[1 1 6 -9]] - 1),[[5 0 5 0];[2 6 -7 9];[0 0 5 -10]])); assert(isequal(([[6 1 6 1];[3 7 -6 10];[1 1 6 -9]] - -1),[[7 2 7 2];[4 8 -5 11];[2 2 7 -8]])); % Call '([[6 1 6 1];[3 7 -6 10];[1 1 6 -9]] - [[-9];[-8];[-9]])' produces an error % Call '([[6 1 6 1];[3 7 -6 10];[1 1 6 -9]] - [[-7];[7];[-6]])' produces an error % Call '([[6 1 6 1];[3 7 -6 10];[1 1 6 -9]] - [[10];[7];[8]])' produces an error % Call '([[6 1 6 1];[3 7 -6 10];[1 1 6 -9]] - [[1 -2 2]])' produces an error % Call '([[6 1 6 1];[3 7 -6 10];[1 1 6 -9]] - [[8 9 -1]])' produces an error % Call '([[6 1 6 1];[3 7 -6 10];[1 1 6 -9]] - [[5 -7 3]])' produces an error assert(isequal(([[6 1 6 1];[3 7 -6 10];[1 1 6 -9]] - [[-3 -9 -3 4];[2 5 -6 0];[2 1 -7 4]]),[[9 10 9 -3];[1 2 0 10];[-1 0 13 -13]])); assert(isequal(([[6 1 6 1];[3 7 -6 10];[1 1 6 -9]] - [[7 -2 -6 6];[3 -2 -7 -1];[4 -4 -10 2]]),[[-1 3 12 -5];[0 9 1 11];[-3 5 16 -11]])); assert(isequal(([[6 1 6 1];[3 7 -6 10];[1 1 6 -9]] - [[3 -4 9 1];[6 8 -6 -4];[-1 -3 3 -7]]),[[3 5 -3 0];[-3 -1 0 14];[2 4 3 -2]])); assert(isequal(([[0 5 -1 8];[6 0 5 5];[-3 1 1 -5]] - 2),[[-2 3 -3 6];[4 -2 3 3];[-5 -1 -1 -7]])); assert(isequal(([[0 5 -1 8];[6 0 5 5];[-3 1 1 -5]] - -7),[[7 12 6 15];[13 7 12 12];[4 8 8 2]])); assert(isequal(([[0 5 -1 8];[6 0 5 5];[-3 1 1 -5]] - 7),[[-7 -2 -8 1];[-1 -7 -2 -2];[-10 -6 -6 -12]])); assert(isequal(([[0 5 -1 8];[6 0 5 5];[-3 1 1 -5]] - 0),[[0 5 -1 8];[6 0 5 5];[-3 1 1 -5]])); assert(isequal(([[0 5 -1 8];[6 0 5 5];[-3 1 1 -5]] - 1),[[-1 4 -2 7];[5 -1 4 4];[-4 0 0 -6]])); assert(isequal(([[0 5 -1 8];[6 0 5 5];[-3 1 1 -5]] - -1),[[1 6 0 9];[7 1 6 6];[-2 2 2 -4]])); % Call '([[0 5 -1 8];[6 0 5 5];[-3 1 1 -5]] - [[-9];[-8];[-9]])' produces an error % Call '([[0 5 -1 8];[6 0 5 5];[-3 1 1 -5]] - [[-7];[7];[-6]])' produces an error % Call '([[0 5 -1 8];[6 0 5 5];[-3 1 1 -5]] - [[10];[7];[8]])' produces an error % Call '([[0 5 -1 8];[6 0 5 5];[-3 1 1 -5]] - [[1 -2 2]])' produces an error % Call '([[0 5 -1 8];[6 0 5 5];[-3 1 1 -5]] - [[8 9 -1]])' produces an error % Call '([[0 5 -1 8];[6 0 5 5];[-3 1 1 -5]] - [[5 -7 3]])' produces an error assert(isequal(([[0 5 -1 8];[6 0 5 5];[-3 1 1 -5]] - [[-3 -9 -3 4];[2 5 -6 0];[2 1 -7 4]]),[[3 14 2 4];[4 -5 11 5];[-5 0 8 -9]])); assert(isequal(([[0 5 -1 8];[6 0 5 5];[-3 1 1 -5]] - [[7 -2 -6 6];[3 -2 -7 -1];[4 -4 -10 2]]),[[-7 7 5 2];[3 2 12 6];[-7 5 11 -7]])); assert(isequal(([[0 5 -1 8];[6 0 5 5];[-3 1 1 -5]] - [[3 -4 9 1];[6 8 -6 -4];[-1 -3 3 -7]]),[[-3 9 -10 7];[0 -8 11 9];[-2 4 -2 2]])); end

elavoie commented 8 years ago

For the purpose of automatically generating tests (https://github.com/Sable/matlab-tests), I avoided the limitation by splitting the different cases in groups of 10, each within their own function. As suggested by Laurie, it probably worked because the huge amount of temps generated by tamer are not propagated in the valueanalysis through the entire 500 lines of code. I keep the issue open if someone else wants to dig into making the analyses of Tamer more memory efficient.

wukefe commented 8 years ago

How much memory does the 'huge amount of temps' consume in the 500 lines of code? 1GB?

elavoie commented 8 years ago

I have not measured. If you decide to dig into it, you can try it with the file mentioned previously.