~ubuntu-branches/ubuntu/raring/python-scipy/raring-proposed

« back to all changes in this revision

Viewing changes to Lib/sparse/SuperLU/SRC/dGetDiagU.c

  • Committer: Bazaar Package Importer
  • Author(s): Matthias Klose
  • Date: 2007-01-07 14:12:12 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20070107141212-mm0ebkh5b37hcpzn
* Remove build dependency on python-numpy-dev.
* python-scipy: Depend on python-numpy instead of python-numpy-dev.
* Package builds on other archs than i386. Closes: #402783.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* 
2
 
 * -- Auxiliary routine in SuperLU (version 2.0) --
3
 
 * Lawrence Berkeley National Lab, Univ. of California Berkeley.
4
 
 * Xiaoye S. Li
5
 
 * September 11, 2003
6
 
 *
7
 
 */
8
 
 
9
 
#include "dsp_defs.h"
10
 
 
11
 
 
12
 
void dGetDiagU(SuperMatrix *L, double *diagU)
13
 
{
14
 
  /*
15
 
   * Purpose
16
 
   * =======
17
 
   *
18
 
   * GetDiagU extracts the main diagonal of matrix U of the LU factorization.
19
 
   *  
20
 
   * Arguments
21
 
   * =========
22
 
   *
23
 
   * L      (input) SuperMatrix*
24
 
   *        The factor L from the factorization Pr*A*Pc=L*U as computed by
25
 
   *        dgstrf(). Use compressed row subscripts storage for supernodes,
26
 
   *        i.e., L has types: Stype = SLU_SC, Dtype = SLU_D, Mtype = SLU_TRLU.
27
 
   *
28
 
   * diagU  (output) double*, dimension (n)
29
 
   *        The main diagonal of matrix U.
30
 
   *
31
 
   * Note
32
 
   * ====
33
 
   * The diagonal blocks of the L and U matrices are stored in the L
34
 
   * data structures.
35
 
   *
36
 
   */
37
 
    int_t i, k, nsupers;
38
 
    int_t fsupc, nsupr, nsupc, luptr;
39
 
    double *dblock, *Lval;
40
 
    SCformat *Lstore;
41
 
 
42
 
    Lstore = L->Store;
43
 
    Lval = Lstore->nzval;
44
 
    nsupers = Lstore->nsuper + 1;
45
 
 
46
 
    for (k = 0; k < nsupers; ++k) {
47
 
      fsupc = L_FST_SUPC(k);
48
 
      nsupc = L_FST_SUPC(k+1) - fsupc;
49
 
      nsupr = L_SUB_START(fsupc+1) - L_SUB_START(fsupc);
50
 
      luptr = L_NZ_START(fsupc);
51
 
 
52
 
      dblock = &diagU[fsupc];
53
 
      for (i = 0; i < nsupc; ++i) {
54
 
        dblock[i] = Lval[luptr];
55
 
        luptr += nsupr + 1;
56
 
      }
57
 
    }
58
 
}
59