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

Revision 4c2259d583e242ad4881ec98298d7787b5264c6a authored by Ben Hermans on 04 May 2020, 14:31:01 UTC, committed by Ben Hermans on 04 May 2020, 14:31:01 UTC
Fix ladel_setup for compiling AMD
1 parent effd840
  • Files
  • Changes
  • 999f49f
  • /
  • src
  • /
  • transpose.c
Raw File Download
Permalinks

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
revision badge
swh:1:rev:4c2259d583e242ad4881ec98298d7787b5264c6a
directory badge Iframe embedding
swh:1:dir:735dea6af23f13e2dcfa7241e96b081219e2b87d
content badge Iframe embedding
swh:1:cnt:c5e5effdde0b7168898dd9ab913e053f9aeb8a5c
Citations

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
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 ...
transpose.c
#include "types.h"
#include "global.h"
#include "constants.h"

ladel_sparse_matrix *ladel_transpose(ladel_sparse_matrix *M, int values, ladel_work* work)
{
    if (!M || !work) return NULL;
    ladel_int index;
    ladel_int *col_pointers = work->array_int_ncol1;
    for (index = 0; index < M->nrow; index++) col_pointers[index] = 0;

    ladel_sparse_matrix *M_transpose = ladel_sparse_alloc(M->ncol, M->nrow, M->nzmax, -M->symmetry, values && M->values);
    
    if (!M_transpose) return NULL; 

    ladel_int col, new_index, prev_col_count;
    for (index = 0; index < M->nzmax; index++) col_pointers[M->i[index]]++;
    
    M_transpose->p[0] = 0;
    for (col = 1; col < M_transpose->ncol; col++)
    {
        prev_col_count = col_pointers[col-1];
        col_pointers[col] += prev_col_count;
        M_transpose->p[col] = prev_col_count;
        col_pointers[col-1] = M_transpose->p[col-1];
    } 
    M_transpose->p[M_transpose->ncol] = col_pointers[M_transpose->ncol-1];
    col_pointers[M_transpose->ncol-1] = M_transpose->p[M_transpose->ncol-1];

    for (col = 0; col < M->ncol; col++)
    {
        for (index = M->p[col]; index < M->p[col+1]; index++)
        {
            new_index = col_pointers[M->i[index]]++;
            M_transpose->i[new_index] = col;
            if (M_transpose->values) M_transpose->x[new_index] = M->x[index];
        }
    }
    return M_transpose;
}
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— Contact— JavaScript license information— Web API