Skip to main content
  • Home
  • Development
  • Documentation
  • Donate
  • Operational login
  • Browse the archive

swh logo
SoftwareHeritage
Software
Heritage
Archive
Features
  • Search

  • Downloads

  • Save code now

  • Add forge now

  • Help

https://github.com/crillab/d4v2
27 March 2023, 21:09:18 UTC
  • Code
  • Branches (1)
  • Releases (0)
  • Visits
Revision c4239d526043da01142cc81ef1b5aad2d198ff5d authored by JM on 30 September 2022, 13:33:50 UTC, committed by JM on 30 September 2022, 13:33:50 UTC
licence changed
1 parent 1606471
  • Files
  • Changes
    • Branches
    • Releases
    • HEAD
    • refs/heads/main
    • c4239d526043da01142cc81ef1b5aad2d198ff5d
    No releases to show
  • 6c3f6d1
  • /
  • 3rdParty
  • /
  • patoh_mac
  • /
  • simple.c
Raw File Download
Take a new snapshot of a software origin

If the archived software origin currently browsed is not synchronized with its upstream version (for instance when new commits have been issued), you can explicitly request Software Heritage to take a new snapshot of it.

Use the form below to proceed. Once a request has been submitted and accepted, it will be processed as soon as possible. You can then check its processing state by visiting this dedicated page.
swh spinner

Processing "take a new snapshot" request ...

To reference or cite the objects present in the Software Heritage archive, permalinks based on SoftWare Hash IDentifiers (SWHIDs) must be used.
Select below a type of object currently browsed in order to display its associated SWHID and permalink.

  • revision
  • directory
  • content
  • snapshot
origin badgerevision badge
swh:1:rev:c4239d526043da01142cc81ef1b5aad2d198ff5d
origin badgedirectory badge
swh:1:dir:507aa969c85c5315de220727f3037350655842c3
origin badgecontent badge
swh:1:cnt:b7c45f7c39d0c69ce29389ff02eae923ab79fbca
origin badgesnapshot badge
swh:1:snp:0020192acd512b1a686e83d94dc283eedf58e892

This interface enables to generate software citations, provided that the root directory of browsed objects contains a citation.cff or codemeta.json file.
Select below a type of object currently browsed in order to generate citations for them.

  • revision
  • directory
  • content
  • snapshot
Generate software citation in BibTex format (requires biblatex-software package)
Generating citation ...
Generate software citation in BibTex format (requires biblatex-software package)
Generating citation ...
Generate software citation in BibTex format (requires biblatex-software package)
Generating citation ...
Generate software citation in BibTex format (requires biblatex-software package)
Generating citation ...
Tip revision: c4239d526043da01142cc81ef1b5aad2d198ff5d authored by JM on 30 September 2022, 13:33:50 UTC
licence changed
Tip revision: c4239d5
simple.c
#include <stdio.h>
#include <stdlib.h>
#include "patoh.h"


void PrintInfo(int _k, int *partweights, int cut, int _nconst)
{
 double             *avg, *maxi, maxall=-1.0;
 int                i, j;

 printf("\n-------------------------------------------------------------------");
 printf("\n Partitioner: %s", (_nconst>1) ? "Multi-Constraint" : "Single-Constraint");
 
 printf("\n %d-way cutsize = %d \n", _k, cut);
 
 printf("\nPartWeights are:\n");
 avg = (double *) malloc(sizeof(double)*_nconst);
 maxi = (double *) malloc(sizeof(double)*_nconst);
 for (i=0; i<_nconst; ++i)
     maxi[i] = avg[i] = 0.0;     
 for (i=0; i<_k; ++i)
       for (j=0; j<_nconst; ++j)
         avg[j] += partweights[i*_nconst+j];
  for (i=0; i<_nconst; ++i)
     {
     maxi[i] = 0.0;     
     avg[i] /= (double) _k;
     }
 
 for (i=0; i<_k; ++i)
     {
     printf("\n %3d :", i);
     for (j=0; j<_nconst; ++j)
         {
         double im= (double)((double)partweights[i*_nconst+j] - avg[j]) / avg[j];
         
         maxi[j] = (maxi[j] > im) ? maxi[j] : im;
         printf("%10d ", partweights[i*_nconst+j]);
         }
     }
 for (j=0; j<_nconst; ++j)
     maxall = (maxi[j] > maxall) ? maxi[j] : maxall;
 printf("\n MaxImbals are (as %%): %.3lf", 100.0*maxall);
 printf("\n      ");
 for (i=0; i<_nconst; ++i)
     printf("%10.1lf ", 100.0*maxi[i]);
 printf("\n");
 free(maxi);
 free(avg);
}


int main(int argc, char *argv[])
{
PaToH_Parameters args;
int             _c, _n, _nconst, *cwghts, *nwghts, 
                *xpins, *pins, *partvec, cut, *partweights;


 if (argc<3) {
     fprintf(stderr, "usage: %s <filename> <#parts>\n", argv[0]);
     exit(1);
 }
     
 
PaToH_Read_Hypergraph(argv[1], &_c, &_n, &_nconst, &cwghts, 
                      &nwghts, &xpins, &pins);

printf("Hypergraph %10s -- #Cells=%6d  #Nets=%6d  #Pins=%8d #Const=%2d\n",
       argv[1], _c, _n, xpins[_n], _nconst);
 
PaToH_Initialize_Parameters(&args, PATOH_CONPART, 
                            PATOH_SUGPARAM_DEFAULT);

args._k = atoi(argv[2]);
partvec = (int *) malloc(_c*sizeof(int));
partweights = (int *) malloc(args._k*_nconst*sizeof(int));
PaToH_Alloc(&args, _c, _n, _nconst, cwghts, nwghts, 
            xpins, pins);

PaToH_Part(&args, _c, _n, _nconst, 0, cwghts, nwghts, 
           xpins, pins, NULL, partvec, partweights, &cut);

printf("%d-way cutsize is: %d\n", args._k, cut);


PrintInfo(args._k, partweights,  cut, _nconst);
 

free(cwghts);      free(nwghts);
free(xpins);       free(pins);
free(partweights); free(partvec);
  
PaToH_Free();
return 0;
}
The diff you're trying to view is too large. Only the first 1000 changed files have been loaded.
Showing with 0 additions and 0 deletions (0 / 0 diffs computed)
swh spinner

Computing file changes ...

back to top

Software Heritage — Copyright (C) 2015–2025, The Software Heritage developers. License: GNU AGPLv3+.
The source code of Software Heritage itself is available on our development forge.
The source code files archived by Software Heritage are available under their own copyright and licenses.
Terms of use: Archive access, API— Content policy— Contact— JavaScript license information— Web API