else {\r
inputPattern.insert(connIface,NULL);\r
} \r
- } \r
+ }\r
+ // remove null columns at the end of IP\r
+ while(! isValidDataGroup(inputPattern,lengthIP-1)) {\r
+ removeDataGroup(inputPattern,lengthIP-1);\r
+ lengthIP -= 1;\r
+ }\r
}\r
\r
bool FunctionalBlock::createAdmittance(int nbExec) {\r
QList<char>* pattern = iterA.value();\r
for(int i=0;i<pattern->size();i++) {\r
if (pattern->at(i) == -1) pattern->replace(i,0);\r
+ cout << (int)(pattern->at(i));\r
}\r
+ cout << endl;\r
}\r
return true;\r
}\r
return false;\r
}\r
int nbExec = getNumberOfExecution();\r
+ cout << qPrintable(name) << " will exec. " << nbExec << " times." << endl;\r
+ \r
ok = createAdmittance(nbExec);\r
- if (!ok) return false;\r
+ \r
+ if (!ok) {\r
+ cout << "cannot create admittance" << endl;\r
+ return false;\r
+ }\r
\r
int clock = 0; // index in IP \r
- int i = 0; // index in AP\r
- while (clock < lengthIP) {\r
- if (samePatterns(inputPattern,clock,admittance,i)) {\r
- clock++;\r
- i++;\r
- }\r
- else {\r
- if (isValidDataGroup(admittance,i)) {\r
- \r
- }\r
- else {\r
- // IP and AP are not equal and AP is a valid group -> not compatible\r
+ int i = 0; // index in AP \r
+ while ((clock < lengthIP) && (i < lengthAP)) {\r
+ \r
+ // if AP is a valid group, search for the next valid group in IP\r
+ if (isValidDataGroup(admittance,i)) {\r
+ while ((clock < lengthIP) && (! isValidDataGroup(inputPattern,clock))) clock++;\r
+ if (clock == lengthIP) {\r
+ cerr << "Abnormal case: end of IP has been reached without finding a valid group" << endl;\r
return false;\r
}\r
- \r
} \r
+ /* at that point 2 cases of compat : IP(clock) and AP(i) are equal valid group, or\r
+ are both null columns\r
+ */\r
+ if (! samePatterns(inputPattern,clock,admittance,i)) {\r
+ cout << "AP(" << i << ") and IP(" << clock << ") are not equal" << endl;\r
+ return false;\r
+ }\r
+ clock++;\r
+ i++;\r
+ }\r
+ if (clock < lengthIP) {\r
+ cerr << "Abnormal case: AP is to short" << endl;\r
+ return false;\r
}\r
return true;\r
}\r
nbExec = 1;\r
int nbGroup = 0;\r
for(int i = offset;i<lengthIP;i++) {\r
- if (isValidDataGroup(inputPattern,offset)) nbGroup++;\r
+ if (isValidDataGroup(inputPattern,i)) nbGroup++;\r
if (nbGroup == delta+1) {\r
nbExec += 1;\r
nbGroup = 1;\r
bool GroupBlock::checkInputPatternCompatibility() {
return true;
+
}
bool GroupBlock::computeOutputPattern(int nbExec) {
cout << "computing output pattern of group " << qPrintable(name) << endl;
- bool canCompute = true;
- bool compatible = true;
+ bool canCompute = false;
+ bool compatible = false;
// get the input pattern on each inputs
createInputPattern();
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE QtCreatorProject>
-<!-- Written by QtCreator 3.2.1, 2017-05-22T09:28:13. -->
+<!-- Written by QtCreator 3.2.1, 2017-05-22T11:04:55. -->
<qtcreator>
<data>
<variable>EnvironmentId</variable>
- <value type="QByteArray">{1d077e47-e3a1-47fd-8b12-4de650e39df5}</value>
+ <value type="QByteArray">{eddbf04f-e5ee-4f36-bc65-6ab7f2b6d4ec}</value>
</data>
<data>
<variable>ProjectExplorer.Project.ActiveTarget</variable>
<valuemap type="QVariantMap">
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Desktop</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Desktop</value>
- <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">{451ee8a3-56ff-4aba-8a8e-3da882cc142e}</value>
+ <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">{72d0832a-d73b-473a-b29c-d1c0737451fe}</value>
<value type="int" key="ProjectExplorer.Target.ActiveBuildConfiguration">0</value>
<value type="int" key="ProjectExplorer.Target.ActiveDeployConfiguration">0</value>
<value type="int" key="ProjectExplorer.Target.ActiveRunConfiguration">0</value>
<valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.0">
- <value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">/localhome/sdomas/Projet/Blast/code/blast</value>
+ <value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">/home/sdomas/Projet/Blast/code/blast</value>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
<valuelist type="QVariantList" key="GenericProjectManager.GenericMakeStep.BuildTargets">