[Pntool-developers] SF.net SVN: pntool:[218] spnbox
Brought to you by:
compaqdrew,
miordache
From: <Ste...@us...> - 2009-08-17 02:22:23
|
Revision: 218 http://pntool.svn.sourceforge.net/pntool/?rev=218&view=rev Author: StephenCamp Date: 2009-08-17 02:22:15 +0000 (Mon, 17 Aug 2009) Log Message: ----------- Dp now uses pn2eacpn instead of pn2acpn. Bug corrected: pn2eacpn previously failed to modify L0 and M if they had no rows, even if they had columns. Modified Paths: -------------- spnbox/dp.c spnbox/pn2eacpn.c spnbox/tests/Makefile Modified: spnbox/dp.c =================================================================== --- spnbox/dp.c 2009-08-14 22:27:49 UTC (rev 217) +++ spnbox/dp.c 2009-08-17 02:22:15 UTC (rev 218) @@ -890,12 +890,12 @@ { ncp[d->cpl[i]] = 1; } - /* For debugging purposes, we replace the pn2eacpn call with a pn2acpn call. + /* For debugging purposes, we replace the pn2eacpn call with a pn2acpn call.*/ pn2eacpn_r pn2eacpnRes = pn2eacpn(&d->Dm, &d->Dp, ncp, &d->M, &d->L0, &d->L, d->ipl, d->ipCount, d->dpl, d->dpCount, d->TD, d->TDCount); UpdateDPData(d, "free matrix Dm Dp M L0 L ipl ipCount TD TDCount", &pn2eacpnRes); - */ + /* pn2acpn_r pn2acpnRes = pn2acpn(&d->Dm, &d->Dp, ncp, &d->M, &d->L0, &d->L, d->ipl, d->ipCount, d->dpl, d->dpCount); - UpdateDPData(d, "free matrix Dm Dp M L0 L ipl ipCount", &pn2acpnRes); + UpdateDPData(d, "free matrix Dm Dp M L0 L ipl ipCount", &pn2acpnRes);*/ free(ncp); } @@ -1362,10 +1362,10 @@ { /*If we get here we are doing (T-)liveness enforcement. Transform the net to an EAC net.*/ - /*pn2eacpn_r pn2eacpnRes = pn2eacpn(&d->Dm, &d->Dp, 0, &d->M, &d->L0, &d->L, d->ipl, d->ipCount, d->dpl, d->dpCount, d->TD, d->TDCount); - UpdateDPData(d, "free matrix Dm Dp M L0 L ipl ipCount TD TDCount", &pn2eacpnRes);*/ - pn2acpn_r pn2acpnRes = pn2acpn(&d->Dm, &d->Dp, 0, &d->M, &d->L0, &d->L, d->ipl, d->ipCount, d->dpl, d->dpCount); - UpdateDPData(d, "free matrix Dm Dp M L0 L ipl ipCount", &pn2acpnRes); + pn2eacpn_r pn2eacpnRes = pn2eacpn(&d->Dm, &d->Dp, 0, &d->M, &d->L0, &d->L, d->ipl, d->ipCount, d->dpl, d->dpCount, d->TD, d->TDCount); + UpdateDPData(d, "free matrix Dm Dp M L0 L ipl ipCount TD TDCount", &pn2eacpnRes); + /*pn2acpn_r pn2acpnRes = pn2acpn(&d->Dm, &d->Dp, 0, &d->M, &d->L0, &d->L, d->ipl, d->ipCount, d->dpl, d->dpCount); + UpdateDPData(d, "free matrix Dm Dp M L0 L ipl ipCount", &pn2acpnRes);*/ /*Find the t-minimal active subnet.*/ tactn_r tactnRes = tactn(&d->Dm, &d->Dp, d->IncludeT, d->IncludeCount, d->ExcludeT, d->ExcludeCount, 0, 0, 1); Modified: spnbox/pn2eacpn.c =================================================================== --- spnbox/pn2eacpn.c 2009-08-14 22:27:49 UTC (rev 217) +++ spnbox/pn2eacpn.c 2009-08-17 02:22:15 UTC (rev 218) @@ -167,7 +167,7 @@ /*We will be adding new columns to MX and L0. Reseve space and copy existing columns.*/ - if (NumberOfRows(result->MXF)) + if (NumberOfColumns(result->MXF)) { AllocateMatrixType(2, &MX, NumberOfRows(result->MXF), NumberOfColumns(result->MXF) + ToAdd); CopyBlock(NumberOfRows(result->MXF), NumberOfColumns(result->MXF), &result->MXF, 0, 0, &MX, 0, 0); @@ -177,7 +177,7 @@ /*Zero MX.*/ AllocateMatrix(&MX, 0, 0); } - if (NumberOfRows(result->L0F)) + if (NumberOfColumns(result->L0F)) { AllocateMatrixType(2, &L0, NumberOfRows(result->L0F), NumberOfColumns(result->L0F) + ToAdd); CopyBlock(NumberOfRows(result->L0F), NumberOfColumns(result->L0F), &result->L0F, 0, 0, &L0, 0, 0); @@ -245,7 +245,7 @@ interest.*/ SetMatrixEl(&Dmf, Rows + j, Transition, GetMatrixEl(Dm, i, Transition)); /*Modify MX and L0 if they exist.*/ - if (NumberOfRows(MX) || NumberOfRows(L0)) + if (NumberOfColumns(MX) || NumberOfColumns(L0)) { /*Find out if the current place is independent..*/ for (x = 0; x < ipCount; x++) @@ -260,11 +260,11 @@ place just found. (if they exist)*/ if (x < ipCount) { - if (NumberOfRows(MX)) + if (NumberOfColumns(MX)) { CopyBlock(NumberOfRows(MX), 1, &MX, 0, x, &MX, 0, NumberOfColumns(MX) - ToAdd + j); } - if (NumberOfRows(L0)) + if (NumberOfColumns(L0)) { CopyBlock(NumberOfRows(L0), 1, &L0, 0, x, &L0, 0, NumberOfColumns(L0) - ToAdd + j); } @@ -292,12 +292,12 @@ result->Dmf = Dmf; DeallocateMatrix(&result->Dpf); result->Dpf = Dpf; - if (NumberOfRows(MX)) + if (NumberOfColumns(MX)) { DeallocateMatrix(&result->MXF); result->MXF = MX; } - if (NumberOfRows(L0)) + if (NumberOfColumns(L0)) { DeallocateMatrix(&result->L0F); result->L0F = L0; Modified: spnbox/tests/Makefile =================================================================== --- spnbox/tests/Makefile 2009-08-14 22:27:49 UTC (rev 217) +++ spnbox/tests/Makefile 2009-08-17 02:22:15 UTC (rev 218) @@ -46,7 +46,7 @@ PN2EACPN=pn2eacpn.o $(NLTRANS) REDUCE=reduce.o chkcons.o $(IPSOLVE) TACTN=tactn.o $(IPSOLVE) -DP=dp.o tactn.o reduce.o chkcons.o pn2acpn.o nltrans.o asiph.o actn.o admcon.o supervis.o msplit.o issiph.o fvpr.o avpr.o $(EXTENDEDMATRIX) $(IPSOLVE) +DP=dp.o tactn.o reduce.o chkcons.o pn2eacpn.o nltrans.o asiph.o actn.o admcon.o supervis.o msplit.o issiph.o fvpr.o avpr.o $(EXTENDEDMATRIX) $(IPSOLVE) #Common test header dependencies. COMMONHEADER=../spnbox.h test.h ../../pnheaders/pns.h ../../pnheaders/matrix.h ../matrixmath.h ../MemoryManager.h StructuredIO.h This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |