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
  • /
  • debug_print.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:2ea3b53cc11a6f1b3dc8ddc2528977caac1c58a4
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 ...
debug_print.c
#include "global.h"
#include "types.h"
#include "debug_print.h"
#include <stdio.h>

/* Print a sparse matrix so the output can be entered into matlab */
void ladel_print_sparse_matrix_matlab(ladel_sparse_matrix *M) {
    ladel_print("M = sparse(%ld, %ld);", M->nrow, M->ncol);
    ladel_int col, index = 0, row;
    ladel_double *Mx = M->x;
    ladel_int *Mi = M->i;
    ladel_int *Mp = M->p;

    for (col = 1; col <= M->ncol; col++) {
        for (row = Mp[col-1]; row < Mp[col]; row++) {
            ladel_print("M(%ld, %ld) = %.16le;", Mi[index]+1, col, Mx[index]);
            index++;
        }
    }
    ladel_print("\n");
}

void ladel_print_factor_matlab(ladel_factor *LD) {
    ladel_print("L = sparse(%ld, %ld);", LD->L->nrow, LD->L->ncol);
    ladel_int col, index = 0;
    ladel_double *Lx = LD->L->x;
    ladel_int *Li = LD->L->i;
    ladel_int *Lp = LD->L->p;
    ladel_int *nz = LD->L->nz;

    for (col = 1; col <= LD->L->ncol; col++) {
        for (index = Lp[col-1]; index < Lp[col-1] + nz[col-1]; index++) {
            ladel_print("L(%ld, %ld) = %.16le;", Li[index]+1, col, Lx[index]);
        }
    }
    ladel_print_dense_vector_matlab(LD->Dinv, LD->ncol);
}

void ladel_print_dense_vector_matlab(ladel_double* x, size_t len) {
    size_t k;
    ladel_print("x = zeros(%lu, 1);", len);
    for (k = 0; k < len; k++) {
        ladel_print("x(%lu) = %.16le;", k+1, x[k]);
    }
    ladel_print("\n");
}

void ladel_print_set(ladel_set *set)
{
    ladel_print("Size set %d (max %d)\n", set->size_set, set->max_size_set);
    ladel_print("Elements: ");
    ladel_int index;
    for (index = 0; index < set->size_set; index++) ladel_print("%d ", set->set[index]);
    ladel_print("\n");
}
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