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)
Add bigfloat changes 11ccd212bae7140c529c3431262b03d52c8a6309 Jason Riedy 2005-04-12 21:46:27
initial import 2aa81858e4a8c9d6c37158f5f32eccdaa5184643 Jason Riedy 2005-04-12 21:45:12
Commit 11ccd212bae7140c529c3431262b03d52c8a6309 - Add bigfloat changes
git-archimport-id: ejr@cs.berkeley.edu--superlu/matchpres--base--0--patch-1
Author: Jason Riedy
Author date (UTC): 2005-04-12 21:46
Committer name: Jason Riedy
Committer date (UTC): 2005-04-12 21:46
Parent(s): 2aa81858e4a8c9d6c37158f5f32eccdaa5184643
Signing key:
Tree: 0db18d2fcefd7678fb23281e5eb1d5785ad0ec59
File Lines added Lines deleted
smut.c 110 0
smut.h 10 0
File smut.c changed (mode: 100644) (index c0d3846..9fac5aa)
... ... spcsr_load_binfile (FILE *f, struct spcsr_t *A)
293 293 return errcode; return errcode;
294 294 } }
295 295
296 int
297 smut_load_bin_vectors (FILE* f, int *nrp, int *ncp, double **datap)
298 {
299 int needswap;
300 int i, tag, nr, nc, nent;
301 double *data = NULL;
302 int errcode = 0;
303
304 if (!f || !nrp || !ncp || !data) return 0;
305
306 if (1 != fread (&tag, sizeof(int), 1, f)) return -1;
307 needswap = (tag != 1);
308
309 if (1 != fread (&nr, sizeof(int), 1, f)) return -2;
310 if (needswap) bswap32 (&nr);
311
312 if (1 != fread (&nc, sizeof(int), 1, f)) return -3;
313 if (needswap) bswap32 (&nc);
314
315 data = malloc (nr * nc * sizeof(double));
316
317 if (!data) { errcode = ENOMEM; goto errfree; }
318
319 if (nr * nc != fread (data, sizeof(double), nr*nc, f)) {
320 errcode = -5;
321 goto errfree;
322 }
323 if (needswap)
324 for (i = 0; i < nr*nc; ++i) bswap64(&data[i]);
325
326 *nrp = nr;
327 *ncp = nc;
328 *datap = data;
329
330 return 0;
331
332 errfree:
333 if (data) free (data);
334 return errcode;
335 }
336
337 int
338 smut_load_bin_vectors_bf (FILE* f, int *nrp, int *ncp,
339 smut_bigfloat_t **datap)
340 {
341 int needswap;
342 int i, tag, nr, nc, nent;
343 smut_bigfloat_t *data = NULL;
344 int errcode = 0;
345
346 if (!f || !nrp || !ncp || !data) return 0;
347
348 if (1 != fread (&tag, sizeof(int), 1, f)) return -1;
349 needswap = (tag != 1);
350 if (needswap) {
351 errcode = EINVAL;
352 goto errfree;
353 }
354
355 if (1 != fread (&nr, sizeof(int), 1, f)) return -2;
356 if (needswap) bswap32 (&nr);
357
358 if (1 != fread (&nc, sizeof(int), 1, f)) return -3;
359 if (needswap) bswap32 (&nc);
360
361 data = malloc (nr * nc * sizeof(smut_bigfloat_t));
362
363 if (!data) { errcode = ENOMEM; goto errfree; }
364
365 if (nr * nc != fread (data, sizeof(smut_bigfloat_t), nr*nc, f)) {
366 errcode = -5;
367 goto errfree;
368 }
369
370 *nrp = nr;
371 *ncp = nc;
372 *datap = data;
373
374 return 0;
375
376 errfree:
377 if (data) free (data);
378 return errcode;
379 }
380
296 381 int int
297 382 spcsr_write_binfile (const struct spcsr_t *A, FILE *f) spcsr_write_binfile (const struct spcsr_t *A, FILE *f)
298 383 { {
 
... ... spcsr_write_binfile (const struct spcsr_t *A, FILE *f)
311 396
312 397 } }
313 398
399 int
400 smut_write_bin_vectors (const int nr, const int nc,
401 const double *data, FILE* f)
402 {
403 int tag = 1;
404 if (!nr || !nc || !data || !f) return 0;
405 if (1 != fwrite (&tag, sizeof(int), 1, f)) return -1;
406 if (1 != fwrite (&nr, sizeof(int), 1, f)) return -2;
407 if (1 != fwrite (&nc, sizeof(int), 1, f)) return -3;
408 if (nr*nc != fwrite (data, sizeof(double), nr*nc, f)) return -4;
409 return 0;
410 }
411
412 int
413 smut_write_bin_vectors_bf (const int nr, const int nc,
414 const smut_bigfloat_t *data, FILE *f)
415 {
416 int tag = 1;
417 if (!nr || !nc || !data || !f) return 0;
418 if (1 != fwrite (&tag, sizeof(int), 1, f)) return -1;
419 if (1 != fwrite (&nr, sizeof(int), 1, f)) return -2;
420 if (1 != fwrite (&nc, sizeof(int), 1, f)) return -3;
421 if (nr*nc != fwrite (data, sizeof(smut_bigfloat_t), nr*nc, f)) return -4;
422 return 0;
423 }
314 424
315 425 void void
316 426 spcsr_coldeg_data (const int nr, const int nc, const int nent, spcsr_coldeg_data (const int nr, const int nc, const int nent,
File smut.h changed (mode: 100644) (index db52a64..06f2519)
2 2 #if !defined(SMUT_H_) #if !defined(SMUT_H_)
3 3 #define SMUT_H_ 0 #define SMUT_H_ 0
4 4
5 #if !defined(SMUT_BIGFLOAT_T)
6 #define SMUT_BIGFLOAT_T long double
7 #endif
8 typedef SMUT_BIGFLOAT_T smut_bigfloat_t;
9
5 10 struct spcsr_t; struct spcsr_t;
6 11
7 12 void spcsr_init_clear (struct spcsr_t*); void spcsr_init_clear (struct spcsr_t*);
 
... ... void spcsr_giveout (struct spcsr_t*,
30 35 #if !defined(SMUT_NO_IO) #if !defined(SMUT_NO_IO)
31 36 int spcsr_load_binfile (FILE*, struct spcsr_t*); int spcsr_load_binfile (FILE*, struct spcsr_t*);
32 37 int spcsr_write_binfile (const struct spcsr_t*, FILE*); int spcsr_write_binfile (const struct spcsr_t*, FILE*);
38 int smut_write_bin_vectors (const int nr, const int nc, const double*, FILE*);
39 int smut_write_bin_vectors_bf (const int nr, const int nc,
40 const smut_bigfloat_t*, FILE*);
41 int smut_load_bin_vectors (FILE*, int *nr, int *nc, double**);
42 int smut_load_bin_vectors_bf (FILE*, int *nr, int *nc, smut_bigfloat_t**);
33 43 #endif #endif
34 44
35 45 int spcsr_update_coldeg (struct spcsr_t*); int spcsr_update_coldeg (struct spcsr_t*);
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