Subject | Hash | Author | Date (UTC) |
---|---|---|---|
Fix price => scaling transformation | 1c223b72d65972e9b381e576b90934c40d555e27 | Jason Riedy | 2005-04-20 20:22:12 |
Bugs go poo | a136075289af1e672e28187cf41210a5ec27eccc | Jason Riedy | 2005-04-20 02:22:32 |
More data: primal, dual, duration | 2c59b3bdc4789035f919ce2132f2d20e33884329 | Jason Riedy | 2005-04-18 18:20:44 |
Removed mistaken Acopy | 8af95560220c3dd532eba9efa95b6993a0bedf97 | Jason Riedy | 2005-04-18 05:07:13 |
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 |
File | Lines added | Lines deleted |
---|---|---|
Make.inc | 3 | 2 |
matchmtx.c | 19 | 16 |
File Make.inc changed (mode: 100644) (index 0c62762..399ea10) | |||
2 | 2 | #CC=gcc-3.4 | #CC=gcc-3.4 |
3 | 3 | LDLIBS = -lm | LDLIBS = -lm |
4 | 4 | CFLAGS = -std=gnu9x -g -Wall -Wno-unused | CFLAGS = -std=gnu9x -g -Wall -Wno-unused |
5 | CPPFLAGS=-DHAVE_LOGB -DHAVE_SCALB | ||
5 | 6 | #-DHAVE_CALLGRIND | #-DHAVE_CALLGRIND |
6 | CFLAGS = -std=gnu9x -O3 -DNDEBUG -g -Wall -Wno-unused \ | ||
7 | -DHAVE_RESTRICT -DHAVE_INLINE -DNOSTATS | ||
7 | #CFLAGS = -std=gnu9x -O3 -DNDEBUG -g -Wall -Wno-unused \ | ||
8 | # -DHAVE_RESTRICT -DHAVE_INLINE -DNOSTATS | ||
8 | 9 | # -DHAVE_CALLGRIND -DHAVE_RESTRICT -DHAVE_INLINE -DNOSTATS | # -DHAVE_CALLGRIND -DHAVE_RESTRICT -DHAVE_INLINE -DNOSTATS |
9 | 10 | FFLAGS = -O3 -g -Wall | FFLAGS = -O3 -g -Wall |
10 | 11 | MPICC = CC=$(CC) mpicc | MPICC = CC=$(CC) mpicc |
File matchmtx.c changed (mode: 100644) (index c2fcc93..cb06aa6) | |||
... | ... | main (int argc, char **argv) | |
174 | 174 | ||
175 | 175 | profit = malloc (A.nr * sizeof(double)); | profit = malloc (A.nr * sizeof(double)); |
176 | 176 | for (i = 0; i < A.nr; ++i) { | for (i = 0; i < A.nr; ++i) { |
177 | profit[i] = -HUGE_VAL; | ||
177 | profit[i] = 0.0; | ||
178 | 178 | for (k = A.rowoff[i]; k < A.rowoff[i+1]; ++k) { | for (k = A.rowoff[i]; k < A.rowoff[i+1]; ++k) { |
179 | 179 | const int j = A.colind[k]; | const int j = A.colind[k]; |
180 | 180 | const double e = expint[k]; | const double e = expint[k]; |
181 | assert(!isinf(e)); | ||
181 | #if 0 | ||
182 | if (e > 0 && isinf(e)) | ||
183 | printf ("inf expint[%d] (%d, %d)\n", k, i, j); | ||
184 | #endif | ||
182 | 185 | if (isinf(price[j])) | if (isinf(price[j])) |
183 | 186 | price[j] = e; | price[j] = e; |
184 | profit[i] = fmax(profit[i], price[j] - e); | ||
187 | if (!isinf(e)) | ||
188 | profit[i] = fmax(profit[i], price[j] - e); | ||
185 | 189 | assert(!isinf(profit[i])); | assert(!isinf(profit[i])); |
186 | 190 | } | } |
187 | 191 | if (profit[i] == -HUGE_VAL) profit[i] = 0.0; | if (profit[i] == -HUGE_VAL) profit[i] = 0.0; |
188 | 192 | } | } |
189 | 193 | ||
190 | 194 | #if 0 | #if 0 |
195 | printf ("shiftamount %g\n", shiftamount); | ||
196 | #endif | ||
191 | 197 | for (j = 0; j < A.nc; ++j) { | for (j = 0; j < A.nc; ++j) { |
192 | price[j] += shiftamount; | ||
193 | price[j] = C[j] * scalbn(1.0, (int)price[j]); | ||
194 | } | ||
195 | for (i = 0; i < A.nc; ++i) { | ||
196 | profit[i] = R[i] * scalbn(1.0, (int)profit[i]); | ||
197 | } | ||
198 | #else | ||
199 | for (j = 0; j < A.nc; ++j) { | ||
200 | price[j] = scalbn(1.0, (int)price[j]); | ||
198 | double tmp; | ||
199 | tmp = C[j] * scalbn(1.0, (int)price[j] + shiftamount); | ||
200 | #if 0 | ||
201 | printf ("price[%d] = %g ===> %g (%g)\n", j, price[j], tmp, C[j]); | ||
202 | #endif | ||
203 | price[j] = tmp; | ||
201 | 204 | } | } |
202 | 205 | for (i = 0; i < A.nc; ++i) { | for (i = 0; i < A.nc; ++i) { |
203 | 206 | double tmp; | double tmp; |
204 | tmp = scalbn(1.0, (int)profit[i]); | ||
205 | if (tmp == 0.0) | ||
206 | printf ("tmp %g profit[%d] %g\n", tmp, i, profit[i]); | ||
207 | tmp = R[i] * scalbn(1.0, (int)profit[i]); | ||
208 | #if 0 | ||
209 | printf ("profit[%d] = %g ===> %g (%g)\n", i, profit[i], tmp, R[i]); | ||
210 | #endif | ||
207 | 211 | profit[i] = tmp; | profit[i] = tmp; |
208 | 212 | } | } |
209 | #endif | ||
210 | 213 | fwrite(price, sizeof(double), A.nc, fout); | fwrite(price, sizeof(double), A.nc, fout); |
211 | 214 | fwrite(profit, sizeof(double), A.nc, fout); | fwrite(profit, sizeof(double), A.nc, fout); |
212 | 215 | } | } |