[Pntool-developers] SF.net SVN: pntool:[222] spnbox
Brought to you by:
compaqdrew,
miordache
From: <Ste...@us...> - 2009-08-19 15:29:35
|
Revision: 222 http://pntool.svn.sourceforge.net/pntool/?rev=222&view=rev Author: StephenCamp Date: 2009-08-19 15:29:25 +0000 (Wed, 19 Aug 2009) Log Message: ----------- dp4.c has been modified slightly: now uses pn2acpn calls instead of pn2eacpn. Added a new type of memory management object and routines to MemoryManager.c: A manager that will "grow" regions of memory by blocks to avoid constantly having to reallocate them. Added gcdv.c and test routines. All tests passed. Added invar.c and test routines. All tests passed. Modified spnbox.h and makefiles as appropriate. Modified Paths: -------------- spnbox/Makefile spnbox/MemoryManager.c spnbox/MemoryManager.h spnbox/dp4.c spnbox/spnbox.h spnbox/tests/Makefile Added Paths: ----------- spnbox/gcdv.c spnbox/invar.c Modified: spnbox/Makefile =================================================================== --- spnbox/Makefile 2009-08-18 22:18:47 UTC (rev 221) +++ spnbox/Makefile 2009-08-19 15:29:25 UTC (rev 222) @@ -4,7 +4,7 @@ COMPILER=gcc -g all: actn.o admcon.o asiph.o avpr.o chkcons.o deallocation.o dp.o dp4.o\ - extendedmatrix.o fvpr.o ilpadm.o ipslv.o ipsolve.o isadm.o issiph.o\ + extendedmatrix.o fvpr.o gcdv.o ilpadm.o ipslv.o ipsolve.o isadm.o issiph.o\ linenf.o matrixmath.o MemoryManager.o msplit.o nltrans.o pn2acpn.o\ pn2eacpn.o reduce.o supervis.o tactn.o liblpsolve55.a @@ -38,6 +38,12 @@ fvpr.o: fvpr.c ../pnheaders/general.h ../pnheaders/matrix.h $(COMPILER) -c fvpr.c +gcdv.o: gcdv.c ../pnheaders/general.h ../pnheaders/matrix.h + $(COMPILER) -c gcdv.c + +invar.o: invar.c spnbox.h matrixmath.h MemoryManager.h extendedmatrix.h ../pnheaders/general.h ../pnheaders/matrix.h + $(COMPILER) -c invar.c + ilpadm.o: ilpadm.c spnbox.h MemoryManager.h matrixmath.h ../pnheaders/general.h ../pnheaders/matrix.h ../pnheaders/pns.h $(COMPILER) -c ilpadm.c Modified: spnbox/MemoryManager.c =================================================================== --- spnbox/MemoryManager.c 2009-08-18 22:18:47 UTC (rev 221) +++ spnbox/MemoryManager.c 2009-08-19 15:29:25 UTC (rev 222) @@ -107,3 +107,95 @@ mgr.addressblockm = MatrixAddressBlockSize; return mgr; } + +/*CreateMemoryGrower initializes a memory grower structure.*/ +MemoryGrower CreateMemoryGrower(int pointers, int blocksize) +{ + MemoryGrower g; + if (pointers < 1 || blocksize < 1) + { + merror(0, "CREATEMEMORYGROWER: Parameters are non-positive"); + memset(&g, 0, sizeof(MemoryGrower)); + return g; + } + + g.blocksize = blocksize; + g.memories = pointers; + g.memory = tcalloc(pointers, sizeof(void*)); + g.capacity = tcalloc(pointers, sizeof(int)); + g.next = 0; + return g; +} + +/*GetGrowableMemory gets some memory that can grow.*/ +void* GetGrowableMemory(MemoryGrower* g, int size) +{ + if (! g) + { + merror(0, "GETGROWABLEMEMORY: Required parameter is null"); + return 0; + } + if (g->next == g->memories) + { + merror(0, "GETGROWABLEMEMORY: Too many pointers in memory"); + return 0; + } + if (size < g->blocksize) size = g->blocksize; + g->memory[g->next] = tmalloc(size); + g->capacity[g->next] = size; + return g->memory[g->next++]; +} + +/*GrowMemory increases the capacity of the given piece of memory. Raises +a fatal error if the memory has not been registered with it.*/ +void* GrowMemory(MemoryGrower* g, void* memory, int newCapacity) +{ + if (! (g && memory)) + { + merror(0, "GROWMEMORY: Required pointer is null"); + return 0; + } + /*Find the memory.*/ + int i; + for (i = 0; i < g->next; i++) + { + if (memory == g->memory[i]) break; + } + if (i == g->next) + { + merror(0, "GROWMEMORY: The memory did not originate with the grower"); + return 0; + } + /*If we are still within the allocated capacity, return the memory + as-is.*/ + if (newCapacity <= g->capacity[i]) + { + return memory; + } + /*Otherwise, allocate some new memory.*/ + else + { + if (newCapacity < g->capacity[i] + g->blocksize) newCapacity = g->capacity[i] + g->blocksize; + void* newMem = tmalloc(newCapacity); + memcpy(newMem, memory, g->capacity[i]); + g->capacity[i] = newCapacity; + g->memory[i] = newMem; + free(memory); + return newMem; + } +} + +/*FreeMemoryGrower deallocates all the memories pointed to by a memory +grower.*/ +void FreeMemoryGrower(MemoryGrower* g) +{ + if (! g) return; + int i; + for (i = 0; i < g->next; i++) + { + free(g->memory[i]); + } + free(g->memory); + free(g->capacity); + memset(g, 0, sizeof(MemoryGrower)); +} Modified: spnbox/MemoryManager.h =================================================================== --- spnbox/MemoryManager.h 2009-08-18 22:18:47 UTC (rev 221) +++ spnbox/MemoryManager.h 2009-08-19 15:29:25 UTC (rev 222) @@ -20,7 +20,6 @@ int addressblockm; } MemoryManager; - /*ManageMatrix adds a matrix to the list of matrices to free later.*/ inline void ManageMatrix(MemoryManager* mgr, matrix* m); @@ -50,4 +49,28 @@ five and will be set to five automatically if passed as less than that.*/ MemoryManager CreateMemoryManager(int InitialLength, int InitialMatrices, int AddressBlockSize, int MatrixAddressBlockSize); +/*The MemoryGrower structure maintains the information needed to have a region +of memory that can be increased in size several times before a time-consuming +reallocation is necessary.*/ +typedef struct MemoryGrower +{ + void** memory; + int * capacity; + int blocksize, memories, next; +} MemoryGrower; + +/*CreateMemoryGrower initializes a memory grower structure.*/ +MemoryGrower CreateMemoryGrower(int pointers, int blocksize); + +/*GetGrowableMemory gets some memory that can grow.*/ +void* GetGrowableMemory(MemoryGrower* g, int size); + +/*GrowMemory increases the capacity of the given piece of memory. Raises +a fatal error if the memory has not been registered with the memory +grower.*/ +void* GrowMemory(MemoryGrower* g, void* memory, int newCapacity); + +/*FreeMemoryGrower deallocates all the memories pointed to by a memory +grower.*/ +void FreeMemoryGrower(MemoryGrower* g); #endif Modified: spnbox/dp4.c =================================================================== --- spnbox/dp4.c 2009-08-18 22:18:47 UTC (rev 221) +++ spnbox/dp4.c 2009-08-19 15:29:25 UTC (rev 222) @@ -876,12 +876,8 @@ { ncp[d->cpl[i]] = 1; } - /* 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, 0, 0); - UpdateDPData(d, "free matrix Dm Dp M L0 L ipl ipCount free TD free intarray", &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); } @@ -1348,10 +1344,8 @@ { /*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, 0, 0); - UpdateDPData(d, "free matrix Dm Dp M L0 L ipl ipCount free TD free intarray", &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);*/ + 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); Added: spnbox/gcdv.c =================================================================== --- spnbox/gcdv.c (rev 0) +++ spnbox/gcdv.c 2009-08-19 15:29:25 UTC (rev 222) @@ -0,0 +1,95 @@ +#include "../pnheaders/general.h" +#include "../pnheaders/matrix.h" + +static int gcd(int a, int b); + +int gcdv(matrix* m, int row, int col) +{ + /*If the matrix pointer is present, get the limits on where we should be' + processing.*/ + if (m) + { + /*Check to make sure the row/column numbers are in range.*/ + if (row >= NumberOfRows(*m) || col >= NumberOfColumns(*m)) + { + merror(0, "GCDV: The row or column number is out of range"); + return 0; + } + int i, j, i0, j0, i1, j1, x; + /*Check to make sure we aren't being asked to find the gcd of a single + element.*/ + if (row >= 0 && col >= 0) + { + merror(0, "GCDV: The row and column numbers request the GCD of a single scalar element"); + return 1; + } + /*Get the limits over which we will be iterating (row and column)*/ + if (row >= 0) + { + i0 = row; + i1 = row + 1; + } + else + { + i0 = 0; + i1 = NumberOfRows(*m); + } + if (col >= 0) + { + j0 = col; + j1 = col + 1; + } + else + { + j0 = 0; + j1 = NumberOfColumns(*m); + } + /*Do the actual iteration.*/ + for (i = i0; i < i1; i++) + { + for (j = j0; j < j1; j++) + { + if (i == i0 && j == j0) + { + if ((x = GetMatrixEl(m, i, j)) == 1) break; + } + else + { + if ((x = gcd(GetMatrixEl(m, i, j), x)) == 1) break; + } + } + } + return x; + } + /*If m was not provided, find the gcd of the row and column numbers.*/ + else + { + return gcd(row, col); + } +} + +/******************************************************************************* +Find the greatest common divisor of a pair of integers via the Euclidian +algorithm.*/ +int gcd(int a, int b) +{ + int c; + /*Make sure a is greater than b by swapping if necessary.*/ + if (a < b) + { + c = a; + a = b; + b = c; + } + /*Make sure both are positive.*/ + if (a < 0) a = -a; + if (b < 0) b = -b; + /*Division-based Euclidian gcd algorithm.*/ + while (b) + { + c = b; + b = a % b; + a = c; + } + return a; +} Added: spnbox/invar.c =================================================================== --- spnbox/invar.c (rev 0) +++ spnbox/invar.c 2009-08-19 15:29:25 UTC (rev 222) @@ -0,0 +1,258 @@ +#include "../pnheaders/general.h" +#include "../pnheaders/matrix.h" +#include "MemoryManager.h" +#include "matrixmath.h" +#include "extendedmatrix.h" + +typedef struct invarData +{ + matrix B, C; + int *Ip, *Im, *I; + MemoryGrower gmem; +} invarData; + +static int InitMatrices(matrix* A, invarData* d); +static void AddGcdRows(invarData* d, int j); +static void FindNonMinimalRows(invarData* d); +static void EliminateNullSpace(invarData* d, matrix* A); + +matrix invar(matrix* A) +{ + invarData d; + if (! InitMatrices(A, &d)) + { + return d.B; + } + + /*We are going to be using several flag lists that will need to change + size with A and C. Use a memory grower (a fast memory-area growing + routine set in MemoryManager.c)*/ + d.gmem = CreateMemoryGrower(3, NumberOfRows(d.B) * sizeof(int)); + int i, j, flag; + d.Ip = GetGrowableMemory(&d.gmem, NumberOfRows(d.B) * sizeof(int)); + d.Im = GetGrowableMemory(&d.gmem, NumberOfRows(d.B) * sizeof(int)); + d.I = GetGrowableMemory(&d.gmem, NumberOfRows(d.B) * sizeof(int)); + + /*Iterate through columns of B.*/ + for (j = 0; j < NumberOfColumns(d.B); j++) + { + /*Flag the places with input and output arcs from the current + transition.*/ + flag = 0; + memset(d.Im, 0, sizeof(int) * NumberOfRows(d.B)); + memset(d.Ip, 0, sizeof(int) * NumberOfRows(d.B)); + for (i = 0; i < NumberOfRows(d.B); i++) + { + if (GetMatrixEl(&d.B, i, j) < 0) + { + d.Im[i] = 1; + flag |= 1; + } + if (GetMatrixEl(&d.B, i, j) > 0) + { + d.Ip[i] = 1; + flag |= 2; + } + } + /*Do the gcd row adds only if there is at least one flagged place each in + Ip and Im..*/ + if (flag == 3) + { + AddGcdRows(&d, j); + /*Eliminate all rows not flagged in I.*/ + for (i = NumberOfRows(d.B) - 1; i >= 0; i--) + { + if (! d.I[i]) + { + RemoveRows(&d.B, i, 1, -1); + RemoveRows(&d.C, i, 1, -1); + } + } + if (! NumberOfRows(d.B)) break; + + /*Flag the rows of C whose support is not minimal with respect to + other rows of C.*/ + FindNonMinimalRows(&d); + /*Remove those rows.*/ + for (i = NumberOfRows(d.C) - 1; i >= 0; i--) + { + if (d.I[i]) + { + RemoveRows(&d.B, i, 1, -1); + RemoveRows(&d.C, i, 1, -1); + } + } + /*Make sure I, Ip, and Im are as large as they need to be for the next + loop iteration.*/ + d.I = GrowMemory(&d.gmem, d.I, sizeof(int) * NumberOfRows(d.C)); + d.Ip = GrowMemory(&d.gmem, d.Ip, sizeof(int) * NumberOfRows(d.C)); + d.Im = GrowMemory(&d.gmem, d.Im, sizeof(int) * NumberOfRows(d.C)); + if (! NumberOfRows(d.B)) break; + } + } + /*Eliminate rows of C which are not part of null space.*/ + TransposeMatrix(A); + EliminateNullSpace(&d, A); + TransposeMatrix(A); + TransposeMatrix(&d.C); + /*Clean up C by reducing all the arc weights.*/ + for (j = 0; j < NumberOfColumns(d.C); j++) + { + int div; + if ((div = gcdv(&d.C, -1, j)) > 1) + { + for (i = 0; i < NumberOfRows(d.C); i++) + { + SetMatrixEl(&d.C, i, j, GetMatrixEl(&d.C, i, j) / div); + } + } + } + /*Free memory.*/ + DeallocateMatrix(&d.B); + FreeMemoryGrower(&d.gmem); + + return d.C; +} + +/******************************************************************************* +EliminateNonNullSpace eliminates rows which are not part of null space.*/ +void EliminateNullSpace(invarData* d, matrix* A) +{ + /*Get the matrix product of C and A.*/ + matrix X = MultiplyMatrix(&d->C, A, (matrix*) 2); + int i, j; + /*We'll be using I to flag rows that should be kept. Clear it now.*/ + memset(d->I, 0, sizeof(int) * NumberOfRows(d->C)); + /*Iterate through rows of C.*/ + for (i = 0; i < NumberOfRows(d->C); i++) + { + /*Find out if the corresponding row in X has any non-null entries.*/ + for (j = 0; j < NumberOfColumns(X); j++) + { + if (GetMatrixEl(&X, i, j)) break; + } + /*If there were no non-null entries, the row should be flagged for + keeping. Otherwise leave the flag blank to request removal.*/ + if (j == NumberOfColumns(X)) d->I[i] = 1; + } + /*Remove any rows of C not flagged in I.*/ + for (i = NumberOfRows(d->C) - 1; i >= 0; i--) + { + if (! d->I[i]) RemoveRows(&d->C, i, 1, -1); + } + DeallocateMatrix(&X); +} + +/******************************************************************************* +FindNonMinimimalRows finds rows of C whose support is not minimal with respect +to other rows of C and flags them for removal in I.*/ +void FindNonMinimalRows(invarData* d) +{ + int i, j, k, less, more; + /*Make sure I is big enough to hold all the new flags.*/ + d->I = GrowMemory(&d->gmem, d->I, sizeof(int) * NumberOfRows(d->C)); + /*Clear I.*/ + memset(d->I, 0, sizeof(int) * NumberOfRows(d->C)); + for (i = 0; i < NumberOfRows(d->C); i++) + { + if (d->I[i]) continue; + for (j = i + 1; j < NumberOfRows(d->C); j++) + { + if (d->I[j]) continue; + /*Check to see if logic(C(i,:)) >= logic(C(j,:)) or if logic(C(i,:)) <= + logic(C(j,:))*/ + less = 1; + more = 1; + for (k = 0; k < NumberOfColumns(d->C) && (less || more); k++) + { + if (more && GetMatrixEl(&d->C, j, k) && ! GetMatrixEl(&d->C, i, k)) + { + more = 0; + } + if (less && GetMatrixEl(&d->C, i, k) && ! GetMatrixEl(&d->C, j, k)) + { + less = 0; + } + } + if (more) + { + d->I[i] = 1; + } + else if (less) + { + d->I[j] = 1; + } + } + } +} + +/******************************************************************************* +AddGcdRows adds some rows to the B/C pair based on the gcd of particular +elements.*/ +void AddGcdRows(invarData* d, int j) +{ + int i, k, l, originalrows; + /*Make sure that*/ + originalrows = NumberOfRows(d->B); + memset(d->I, 0, originalrows * sizeof(int)); + for (i = 0; i < originalrows; i++) + { + /*Flag in I any row of B null in the current column.*/ + if (! GetMatrixEl(&d->B, i, j)) d->I[i] = 1; + + /*Skip from here any places without input arcs.*/ + if (! d->Ip[i]) continue; + /*Iterate through all the places again. We will examine input places in the + outer loop and output places in the inner loop.*/ + for (k = 0; k < originalrows; k++) + { + if (! d->Im[k]) continue; + int z = gcdv(0, GetMatrixEl(&d->B, i, j), GetMatrixEl(&d->B, k, j)); + int x = GetMatrixEl(&d->B, k, j) / z; + int y = GetMatrixEl(&d->B, i, j) / z; + /*Add a new row to BC.*/ + InsertNullRows(&d->B, -1, 1, -1); + InsertNullRows(&d->C, -1, 1, -1); + /*The new row should be found algorithmically.*/ + for (l = 0; l < NumberOfColumns(d->B); l++) + { + int c = (-x * GetMatrixEl(&d->B, i, l)) + (y * GetMatrixEl(&d->B, k, l)); + SetMatrixEl(&d->B, NumberOfRows(d->B) - 1, l, c); + } + for (l = 0; l < NumberOfColumns(d->C); l++) + { + int c = (-x * GetMatrixEl(&d->C, i, l)) + (y * GetMatrixEl(&d->C, k, l)); + SetMatrixEl(&d->C, NumberOfRows(d->C) - 1, l, c); + } + /*Flag the new row in I.*/ + d->I = GrowMemory(&d->gmem, d->I, sizeof(int) * NumberOfRows(d->C)); + d->I[NumberOfRows(d->C) - 1] = 1; + } + } +} + +/******************************************************************************* +InitMatrices initializes the matrices B and C.*/ +int InitMatrices(matrix* A, invarData* d) +{ + memset(d, 0, sizeof(invarData)); + if (! A) + { + merror(0, "INVAR: Null matrix pointer"); + return 0; + } + /*B should be a transpose copy of A optimized for row ops.*/ + AllocateMatrixType(2, &d->B, NumberOfColumns(*A), NumberOfRows(*A)); + TransposeMatrix(&d->B); + CopyMatrix(A, &d->B); + TransposeMatrix(&d->B); + + /*C should be an identity, number of rows of A, optimized for row ops.*/ + AllocateMatrixType(2, &d->C, NumberOfRows(d->B), NumberOfRows(d->B)); + int i; + for (i = 0; i < NumberOfRows(d->B); i++) + { + SetMatrixEl(&d->C, i, i, 1); + } + return 1; +} Modified: spnbox/spnbox.h =================================================================== --- spnbox/spnbox.h 2009-08-18 22:18:47 UTC (rev 221) +++ spnbox/spnbox.h 2009-08-19 15:29:25 UTC (rev 222) @@ -1108,4 +1108,48 @@ pointers in the structure to point to integer arrays containing the indices and setting the corresponding count integers to the length of the index lists. */ + +int gcdv(matrix *m, int row, int column); +/* +GCDV greatest common divisor of a vector/matrix. Uses GCD. + +Written by Marian V. Iordache, mio...@nd... + +C Usage: +If m is a null pointer, the function returns the gcd of the row and column +numbers. Otherwise: +If row is nonnegative the function returns the gcd of the given row, ignoring +the column number. +If row is negative but column is positive, the function returns the gcd of the +given column, ignoring the row number. +If both row and column are negative, the function returns the gcd of every +element in the matrix. +If both row and column are positive the function fails with an error.*/ + +matrix invar(matrix* A); +/* +INVAR - Positive invariant computation. + +INVAR(A) returns a matrix whose columns give the minimal support positive +invariants of a matrix A, i.e., it returns a basis for the solutions to +Ax = 0, x >= 0. + +The matlab version of INVAR is a modification of INVAR1. INVAR works with +integers only! In Matlab, INVAR1 is called if A is not an integer matrix. + +The solution is based on an algorithm by Martinez and Silva. + +In Matlab, INVAR is a slight modification of INVAR1; INVAR1 has been written by +John O. Moody. + + +C Usage: +INVAR1 has not been implemented in C. INVAR takes a pointer to a matrix as its +only parameter and returns the solution matrix. Since the pntool matrix type +does not support non-integer matrices, nothing has been implemented to deal with +them. +Converted from Matlab to C by Marian V. Iordache, mar...@le..., and +Stephen Camp, ste...@le.... +*/ + #endif Modified: spnbox/tests/Makefile =================================================================== --- spnbox/tests/Makefile 2009-08-18 22:18:47 UTC (rev 221) +++ spnbox/tests/Makefile 2009-08-19 15:29:25 UTC (rev 222) @@ -6,7 +6,7 @@ #This variable controls whether or not the memwatch memory debugging routines are included in #compilation. Set to "yes" to include them and "no" to leave them out. -USEMEMWATCH = no +USEMEMWATCH = yes #Assign the default compiler call and options. COMPILER=gcc -g @@ -30,6 +30,8 @@ AVPR=avpr.o EXTENDEDMATRIX=extendedmatrix.o FVPR=fvpr.o +GCDV=gcdv.o +INVAR=invar.o $(GCDV) $(EXTENDEDMATRIX) IPSLV=ipslv.o ../liblpsolve55.a IPSOLVE=ipsolve.o $(IPSLV) ISADM=isadm.o @@ -47,19 +49,23 @@ REDUCE=reduce.o chkcons.o $(IPSOLVE) TACTN=tactn.o $(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) -DP4=dp4.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) +DP4=dp4.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) #Common test header dependencies. -COMMONHEADER=../spnbox.h test.h ../../pnheaders/pns.h ../../pnheaders/matrix.h ../matrixmath.h ../MemoryManager.h StructuredIO.h +COMMONHEADER=../spnbox.h test.h ../../pnheaders/general.h ../../pnheaders/pns.h ../../pnheaders/matrix.h ../matrixmath.h ../MemoryManager.h StructuredIO.h #Targets -all: avpr extendedmatrix fvpr ipslv ipsolve isadm issiph msplit matrixmath pn2acpn supervis actn admcon asiph ilpadm linenf nltrans pn2eacpn reduce tactn +all: avpr extendedmatrix fvpr gcdv invar ipslv ipsolve isadm issiph msplit matrixmath pn2acpn supervis actn admcon asiph ilpadm linenf nltrans pn2eacpn reduce tactn avpr: test-avpr.o $(AVPR) $(COMMON) $(COMPILER) -o avpr.exe test-avpr.o $(AVPR) $(COMMON) extendedmatrix: test-extendedmatrix.o $(EXTENDEDMATRIX) $(COMMON) $(COMPILER) -o extendedmatrix.exe test-extendedmatrix.o $(EXTENDEDMATRIX) $(COMMON) fvpr: test-fvpr.o $(FVPR) $(COMMON) $(COMPILER) -o fvpr.exe test-fvpr.o $(FVPR) $(COMMON) +gcdv: test-gcdv.o $(GCDV) $(COMMON) + $(COMPILER) -o gcdv.exe test-gcdv.o $(GCDV) $(COMMON) +invar: test-invar.o $(INVAR) $(COMMON) + $(COMPILER) -o invar.exe test-invar.o $(INVAR) $(COMMON) ipslv: test-ipslv.o $(IPSLV) $(COMMON) $(COMPILER) -o ipslv.exe test-ipslv.o $(IPSLV) $(COMMON) ipsolve: test-ipsolve.o $(COMMON) $(IPSOLVE) @@ -122,10 +128,14 @@ $(MEMWCOMP) -c ../extendedmatrix.c fvpr.o: ../fvpr.c ../../pnheaders/general.h ../../pnheaders/matrix.h $(MEMWCOMP) -c ../fvpr.c +gcdv.o: ../gcdv.c ../../pnheaders/general.h ../../pnheaders/matrix.h + $(MEMWCOMP) -c ../gcdv.c general.o: ../../pnheaders/general.c ../../pnheaders/general.h $(MEMWCOMP) -c ../../pnheaders/general.c ilpadm.o: ../spnbox.h ../matrixmath.h ../../pnheaders/general.h ../../pnheaders/matrix.h ../MemoryManager.h ../ilpadm.c $(MEMWCOMP) -c ../ilpadm.c +invar.o: ../invar.c ../spnbox.h ../matrixmath.h ../MemoryManager.h ../extendedmatrix.h ../../pnheaders/general.h ../../pnheaders/matrix.h + $(MEMWCOMP) -c ../invar.c isadm.o: ../isadm.c ../spnbox.h ../../pnheaders/general.h ../MemoryManager.h ../../pnheaders/pns.h ../matrixmath.h $(MEMWCOMP) -c ../isadm.c issiph.o: ../issiph.c ../spnbox.h ../../pnheaders/general.h ../../pnheaders/matrix.h @@ -178,8 +188,12 @@ $(MEMWCOMP) -c test-dp.c test-fvpr.o: test-fvpr.c $(COMMONHEADER) $(MEMWCOMP) -c test-fvpr.c +test-gcdv.o: test-gcdv.c $(COMMONHEADER) + $(MEMWCOMP) -c test-gcdv.c test-ilpadm.o: test-ilpadm.c $(COMMONHEADER) $(MEMWCOMP) -c test-ilpadm.c +test-invar.o: test-invar.c $(COMMONHEADER) + $(MEMWCOMP) -c test-invar.c test-ipslv.o: test-ipslv.c $(MEMWCOMP) -c test-ipslv.c test-ipsolve.o: test-ipsolve.c $(COMMONHEADER) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |