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 a137ab8c6d6d0a8110a234da6f4de49aa7b548d9 authored by Roger Koenker on 31 August 2015, 23:25:56 UTC, committed by Gabor Csardi on 31 August 2015, 23:25:56 UTC
version 5.19
1 parent a6e1bd2
  • Files
  • Changes
  • 7636eae
  • /
  • src
  • /
  • chlfct.c
Raw File Download

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:a137ab8c6d6d0a8110a234da6f4de49aa7b548d9
directory badge
swh:1:dir:a58012c164c314abf600da40546b4bba54a556df
content badge
swh:1:cnt:0ae9c1d273f6473abc4bfc153be1f31de1763118

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 ...
chlfct.c
/*-*- mode: C; kept-old-versions: 12;  kept-new-versions: 20; -*-
 *
 * chlfct.f -- translated by f2c (version 20031025) and by
 * $Id: f2c-clean,v 1.10 2002/03/28 16:37:27 maechler Exp $
 * plus extended manual code cleaning by Martin Maechler, ETH Zurich
 */

#include <math.h>

/* Subroutine to perform Cholesky factorization
 *			 ======================
 * based on subroutines in ./cholesky.c , declared here :
*/
#include "cholesky.h"

void
F77_SUB(chlfct)(int *m, int *xlindx, int *lindx,
		int *invp, int *perm, int *iwork, int *nnzdsub,
		int *jdsub, int *colcnt, int *nsuper, int *snode,
		int *xsuper, int *nnzlmax, int *nsubmax, int *xlnz,
		double *lnz, int *id, int *jd, double *d,
		int *cachsz, int *tmpmax, int *level, double *tmpvec,
		int *split,
		int *ierr, /* on error return, sets error code in {3:12},
			      docu., see e.g., ./srqfn.c */
		int *it,   /* it <= 1: do initializations;  otherwise: no init.*/
		double *timewd)/* of length >= 6: will return timing information */
/*  as follows: [1] ordmmd()
 *		[2] sfinit() - initialization for sym.fact.
 *		[3] symfct() - symbolic factorization
 *		[4] inpnv()  - Input numerical values into data structures of L
 *		[5] bfinit() - Initialization for block factorization
 *		[6] blkfct() - Numerical factorization
 */
{
    /* Local variables */
    int i, nsub, nnzl, iwsiz, tmpsiz;
    double timbeg;

    --timewd; /* so we can use 1-indexing below */

/* Save the matrix structure from jdsub(m+2:nzzd+1),jdsub(1:m+1)
   to lindx and xlindx because the matrix structure is destroyed by the
   minimum degree ordering routine */

    for (i = 0; i < (*m + 1); ++i)
	xlindx[i] = jdsub[i];
    for (i = 0; i < *nnzdsub; ++i)
	lindx[i] = jdsub[*m + 1 + i];


    iwsiz = *m << 2;

    if (*it <= 1) { /* do the initializations : */

	/* Reorder the matrix using minimum degree ordering routine */

	timbeg = F77_CALL(gtimer)();
	F77_CALL(ordmmd)(m, xlindx, lindx, invp, perm,
			 &iwsiz, iwork, &nsub, ierr);
	timewd[1] += F77_CALL(gtimer)() - timbeg;

	if (*ierr == -1)	{ *ierr = 3; return; }

	/* Call sfinit: Symbolic factorization initialization
	   to compute supernode partition and storage requirements
	   for symbolic factorization. New ordering is a postordering
	   of the nodal elimination tree */

	iwsiz = *m * 7 + 3;
	timbeg = F77_CALL(gtimer)();
	F77_CALL(sfinit)(m, nnzdsub, jdsub, &jdsub[*m + 1], perm, invp,
			 colcnt, &nnzl, &nsub, nsuper, snode, xsuper,
			 &iwsiz, iwork, ierr);
	timewd[2] += F77_CALL(gtimer)() - timbeg;

	if (*ierr == -1)     { *ierr = 4; return; }
	if (nnzl > *nnzlmax) { *ierr = 5; return; }
	if (nsub > *nsubmax) { *ierr = 6; return; }
    }

/* Call symfct: Perform supernodal symbolic factorization */

    /* iwsiz = nsuper + 2 * m + 1; */
    timbeg = F77_CALL(gtimer)();
    F77_CALL(symfct)(m, nnzdsub, jdsub, &jdsub[*m + 1], perm, invp,
		     colcnt, nsuper, xsuper, snode, &nsub,
		     xlindx, lindx, xlnz, &iwsiz, iwork, ierr);
    timewd[3] += F77_CALL(gtimer)() - timbeg;

    if (*ierr == -1)	{ *ierr = 7; return; }
    if (*ierr == -2)	{ *ierr = 8; return; }

/* Call inpnv: Input numerical values into data structures of L */

    timbeg = F77_CALL(gtimer)();
    F77_CALL(inpnv)(m, id, jd, d, perm, invp, nsuper, xsuper,
		    xlindx, lindx, xlnz, lnz, iwork);
    timewd[4] += F77_CALL(gtimer)() - timbeg;

/* Call bfinit: Initialization for block factorization */

    timbeg = F77_CALL(gtimer)();
    F77_CALL(bfinit)(m, nsuper, xsuper, snode, xlindx, lindx,
		     cachsz, &tmpsiz, split);
    timewd[5] += F77_CALL(gtimer)() - timbeg;

    if (tmpsiz > *tmpmax) { *ierr = 9; return; }

/* Call blkfct: Numerical factorization */

    iwsiz = (*m << 1) + (*nsuper << 1);
    timbeg = F77_CALL(gtimer)();
    if (*level == 1) {
	F77_CALL(blkfct)(m, nsuper, xsuper, snode, split,  xlindx, lindx,
			 xlnz, lnz, &iwsiz, iwork, &tmpsiz, tmpvec, ierr,
			 (U_fp) F77_NAME(mmpy1), (U_fp) F77_NAME(smxpy1));
    } else if (*level == 2) {
	F77_CALL(blkfct)(m, nsuper, xsuper, snode, split,  xlindx, lindx,
			 xlnz, lnz, &iwsiz, iwork, &tmpsiz, tmpvec, ierr,
			 (U_fp) F77_NAME(mmpy2), (U_fp) F77_NAME(smxpy2));
    } else if (*level == 4) {
	F77_CALL(blkfct)(m, nsuper, xsuper, snode, split,  xlindx, lindx,
			 xlnz, lnz, &iwsiz, iwork, &tmpsiz, tmpvec, ierr,
			 (U_fp) F77_NAME(mmpy4), (U_fp) F77_NAME(smxpy4));
    } else if (*level == 8) { /* the one used from R */
	F77_CALL(blkfct)(m, nsuper, xsuper, snode, split,  xlindx, lindx,
			 xlnz, lnz, &iwsiz, iwork, &tmpsiz, tmpvec, ierr,
			 (U_fp) F77_NAME(mmpy8), (U_fp) F77_NAME(smxpy8));
    }
    timewd[6] += F77_CALL(gtimer)() - timbeg;

    if (*ierr == -1) { *ierr = 10; return; }
    if (*ierr == -2) { *ierr = 11; return; }
    if (*ierr == -3) { *ierr = 12; return; }
    /* this is new [ from blkfct() -> blkfc2() in ./cholesky.c ] : */
    if (*ierr == -17) { *ierr = 17; return; }

} /* chlfct_ */
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–2026, 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