ejr / matchpres (public) (License: BSD) (since 2018-08-29) (hash sha1)
Ye olde thesis code implementing an auction-based weighted bipartite matching algorithm over MPI.
List of commits:
Subject Hash Author Date (UTC)
write new data from matchmtx. 9bbe665ce58799a37beed4e6557f756bdf6e8a48 Jason Riedy 2005-04-18 05:05:14
Dumb bug fix. 0acb519a5298ca2fd3256cc54e7e91a267990022 Jason Riedy 2005-04-13 04:21:01
quit when not square b74d721df984ae9c60d4617921d6dc7813215022 Jason Riedy 2005-04-12 23:36:47
Go back to gcc. 9d50e51da839a9dcf5193030c9fcdd49cdfa9854 Jason Riedy 2005-04-12 23:31:07
undo extra changes 41f6e35374346b3ac19a8342a9c4ff75796ceee5 Jason Riedy 2005-04-12 23:21:08
fix auction_shift for explicit zeros 10be6a173d391689574e9e88774e90dc1c7ac1d9 Jason Riedy 2005-04-12 23:20:38
HAVE_LOGB 38a377840fbffdbcc1f8ebab1f9775502547e4cb Jason Riedy 2005-04-12 23:11:13
add -nofor_main, fix seqauction b24bdf1318ea24afd1b43230b372fcc776fef8f6 Jason Riedy 2005-04-12 23:05:54
Prepare for massive runs. 5f9172fedbc636a986bd57c48cfa20bd1f1c17a7 Jason Riedy 2005-04-12 22:55:06
Update build stuff. 64cf1bc1ea3e70fdf320fe51a95f140f57076d80 Jason Riedy 2005-04-12 22:28:15
Add bigfloat changes 11ccd212bae7140c529c3431262b03d52c8a6309 Jason Riedy 2005-04-12 21:46:27
initial import 2aa81858e4a8c9d6c37158f5f32eccdaa5184643 Jason Riedy 2005-04-12 21:45:12
Commit 9bbe665ce58799a37beed4e6557f756bdf6e8a48 - write new data from matchmtx.
* auction.c (auction_shift): Return shift amount.

* auction.h (auction_shift): Update prototype.

* matchmtx.c (main): Write both duals, etc. Also shift and unscale
duals. eep.


git-archimport-id: ejr@cs.berkeley.edu--superlu/matchpres--base--0--patch-11
Author: Jason Riedy
Author date (UTC): 2005-04-18 05:05
Committer name: Jason Riedy
Committer date (UTC): 2005-04-18 05:05
Parent(s): 0acb519a5298ca2fd3256cc54e7e91a267990022
Signing key:
Tree: 9d442cd3ff765e6d31c80e2b010cc25322449e5a
File Lines added Lines deleted
auction.c 2 1
auction.h 1 1
matchmtx.c 40 8
File auction.c changed (mode: 100644) (index 0f5644c..e60143f)
... ... auction_toabsint (const struct spcsr_t *A, double *absent_in)
127 127 absent[k] = floor(fabs(entry[k])); absent[k] = floor(fabs(entry[k]));
128 128 } }
129 129
130 void
130 double
131 131 auction_shift (const struct spcsr_t *A, double *b_in) auction_shift (const struct spcsr_t *A, double *b_in)
132 132 { {
133 133 int k; int k;
 
... ... auction_shift (const struct spcsr_t *A, double *b_in)
147 147 b[k] -= mn; b[k] -= mn;
148 148 } }
149 149 /*fprintf (stderr, "shifting by %d\n", mn);*/ /*fprintf (stderr, "shifting by %d\n", mn);*/
150 return mn;
150 151 } }
151 152
152 153 void void
File auction.h changed (mode: 100644) (index a1c1b2d..9cb7e52)
... ... void auction_tounitall (const struct spcsr_t*, double*);
8 8 void auction_toabsint (const struct spcsr_t*, double *); void auction_toabsint (const struct spcsr_t*, double *);
9 9 void auction_toabs (const struct spcsr_t*, double *); void auction_toabs (const struct spcsr_t*, double *);
10 10
11 void auction_shift (const struct spcsr_t*, double *);
11 double auction_shift (const struct spcsr_t*, double *);
12 12 void auction_scaleshift (const struct spcsr_t*, double *); void auction_scaleshift (const struct spcsr_t*, double *);
13 13
14 14
File matchmtx.c changed (mode: 100644) (index 99e70a4..66d5b67)
... ... main (int argc, char **argv)
35 35 double mu_min; double mu_min;
36 36 int relgap = 0; int relgap = 0;
37 37
38 double shiftamount;
39
38 40 double *R, *C; double *R, *C;
39 41 double *expint; double *expint;
40 42
41 43 int *match, *invmatch; int *match, *invmatch;
42 double *price;
44 double *price, *profit = NULL;
43 45
44 46 int errflg, i, j; int errflg, i, j;
45 47 double p, d; double p, d;
 
... ... main (int argc, char **argv)
87 89 memset (invmatch, -1, A.nr * sizeof(int)); memset (invmatch, -1, A.nr * sizeof(int));
88 90 price = calloc (A.nc, sizeof(double)); price = calloc (A.nc, sizeof(double));
89 91
92 spcsr_copy (&A, &Acopy);
93
90 94 printf ("nr = %d nc = %d nent = %d\n", A.nr, A.nc, A.nent); printf ("nr = %d nc = %d nent = %d\n", A.nr, A.nc, A.nent);
91 95
92 96 #if 0 #if 0
 
... ... main (int argc, char **argv)
101 105 #else #else
102 106 auction_toexp (&A, expint); auction_toexp (&A, expint);
103 107 #endif #endif
104 auction_shift (&A, expint);
108 shiftamount = auction_shift (&A, expint);
105 109
106 110 { {
107 111 int k; int k;
 
... ... main (int argc, char **argv)
156 160 } }
157 161
158 162 if (fout) { if (fout) {
159 int k;
160 smut_write_bin_vectors (1, A.nc, price, fout);
161 for (k = 0; k < A.nc; ++k) {
162 price[k] = match[k];
163 }
164 smut_write_bin_vectors (1, A.nc, price, fout);
163 int bo_tag = 1;
164 int i, j, k;
165
166 fwrite (&bo_tag, sizeof(int), 1, fout);
167 fwrite (&mu_min, sizeof(double), 1, fout);
168 fwrite (&relgap, sizeof(int), 1, fout);
169 fwrite (match, sizeof(int), A.nc, fout);
170
171 profit = malloc (A.nr * sizeof(double));
172 for (i = 0; i < A.nr; ++i) {
173 profit[i] = -HUGE_VAL;
174 for (k = A.rowoff[i]; k < A.rowoff[i+1]; ++k) {
175 const int j = A.colind[k];
176 const double e = expint[k];
177 if (isinf(price[j])) {
178 price[j] = e;
179 }
180 else {
181 profit[i] = fmax(profit[i], price[j] - e);
182 }
183 }
184 if (profit[i] == -HUGE_VAL) profit[i] = 0.0;
185 }
186
187 for (j = 0; j < A.nc; ++j) {
188 price[j] += shiftamount;
189 price[j] = R[i] * scalbn(1.0, (int)price[j]);
190 }
191 for (i = 0; i < A.nc; ++i) {
192 profit[i] = C[j] * scalbn(1.0, (int)profit[i]);
193 }
194 fwrite(price, sizeof(double), A.nc, fout);
195 fwrite(profit, sizeof(double), A.nr, fout);
165 196 } }
166 197
198 if (profit) free(profit);
167 199 free (price); free (price);
168 200 free (invmatch); free (invmatch);
169 201 free (match); free (match);
Hints:
Before first commit, do not forget to setup your git environment:
git config --global user.name "your_name_here"
git config --global user.email "your@email_here"

Clone this repository using HTTP(S):
git clone https://rocketgit.com/user/ejr/matchpres

Clone this repository using ssh (do not forget to upload a key first):
git clone ssh://rocketgit@ssh.rocketgit.com/user/ejr/matchpres

Clone this repository using git:
git clone git://git.rocketgit.com/user/ejr/matchpres

You are allowed to anonymously push to this repository.
This means that your pushed commits will automatically be transformed into a merge request:
... clone the repository ...
... make some changes and some commits ...
git push origin main