dreadhb.c File Reference

Read a matrix stored in Harwell-Boeing format. More...

`#include <stdio.h>`
`#include <stdlib.h>`
`#include "slu_ddefs.h"`
Include dependency graph for dreadhb.c:

## Functions

int | dDumpLine (FILE *fp)
| Eat up the rest of the current line. More...
int | dParseIntFormat (char *buf, int *num, int *size)
int | dParseFloatFormat (char *buf, int *num, int *size)
static int | ReadVector (FILE *fp, int_t n, int_t *where, int perline, int persize)
int | dReadValues (FILE *fp, int n, double *destination, int perline, int persize)
static void | FormFullA (int n, int_t *nonz, double **nzval, int_t **rowind, int_t **colptr)
void | dreadhb (FILE *fp, int *nrow, int *ncol, int_t *nonz, double **nzval, int_t **rowind, int_t **colptr)
| Auxiliary routines. More...

## Detailed Description

Copyright (c) 2003, The Regents of the University of California, through Lawrence Berkeley National Laboratory (subject to receipt of any required approvals from U.S. Dept. of Energy)

All rights reserved.

The source code is distributed under BSD license, see the file License.txt at the top-level directory.

    -- SuperLU routine (version 2.0) --
    Univ. of California Berkeley, Xerox Palo Alto Research Center,
    and Lawrence Berkeley National Lab.
    November 15, 1997

    Purpose
    =======

    Read a DOUBLE PRECISION matrix stored in Harwell-Boeing format
    as described below.

    Line 1 (A72,A8)
            Col. 1 - 72   Title (TITLE)
         Col. 73 - 80  Key (KEY)

    Line 2 (5I14)
            Col. 1 - 14   Total number of lines excluding header (TOTCRD)
            Col. 15 - 28  Number of lines for pointers (PTRCRD)
            Col. 29 - 42  Number of lines for row (or variable) indices (INDCRD)
            Col. 43 - 56  Number of lines for numerical values (VALCRD)
         Col. 57 - 70  Number of lines for right-hand sides (RHSCRD)
                       (including starting guesses and solution vectors
                   if present)
                          (zero indicates no right-hand side data is present)

    Line 3 (A3, 11X, 4I14)
            Col. 1 - 3    Matrix type (see below) (MXTYPE)
            Col. 15 - 28  Number of rows (or variables) (NROW)
            Col. 29 - 42  Number of columns (or elements) (NCOL)
         Col. 43 - 56  Number of row (or variable) indices (NNZERO)
                       (equal to number of entries for assembled matrices)
            Col. 57 - 70  Number of elemental matrix entries (NELTVL)
                       (zero in the case of assembled matrices)
    Line 4 (2A16, 2A20)
            Col. 1 - 16   Format for pointers (PTRFMT)
         Col. 17 - 32  Format for row (or variable) indices (INDFMT)
         Col. 33 - 52  Format for numerical values of coefficient matrix (VALFMT)
            Col. 53 - 72 Format for numerical values of right-hand sides (RHSFMT)

    Line 5 (A3, 11X, 2I14) Only present if there are right-hand sides present
            Col. 1        Right-hand side type:
                      F for full storage or M for same format as matrix
            Col. 2        G if a starting vector(s) (Guess) is supplied. (RHSTYP)
            Col. 3        X if an exact solution vector(s) is supplied.
         Col. 15 - 28  Number of right-hand sides (NRHS)
         Col. 29 - 42  Number of row indices (NRHSIX)
                          (ignored in case of unassembled matrices)

    The three character type field on line 3 describes the matrix type.
    The following table lists the permitted values for each of the three
    characters. As an example of the type field, RSA denotes that the matrix
    is real, symmetric, and assembled.

    First Character:
         R Real matrix
         C Complex matrix
         P Pattern only (no numerical values supplied)

    Second Character:
         S Symmetric
         U Unsymmetric
         H Hermitian
         Z Skew symmetric
         R Rectangular

    Third Character:
         A Assembled
         E Elemental matrices (unassembled)

## Function Documentation

## dDumpLine()

int dDumpLine | ( | FILE * | fp | ) |

## dParseFloatFormat()

int dParseFloatFormat | ( | char * | buf,
|  | int * | num,
|  | int * | size
| ) |  |

## dParseIntFormat()

int dParseIntFormat | ( | char * | buf,
|  | int * | num,
|  | int * | size
| ) |  |

## dreadhb()

void dreadhb | ( | FILE * | fp,
|  | int * | nrow,
|  | int * | ncol,
|  | int_t * | nonz,
|  | double ** | nzval,
|  | int_t ** | rowind,
|  | int_t ** | colptr
| ) |  |

Here is the call graph for this function:

## dReadValues()

int dReadValues | ( | FILE * | fp,
|  | int | n,
|  | double * | destination,
|  | int | perline,
|  | int | persize
| ) |  |

## FormFullA()

static void FormFullA | ( | int | n,
|  | int_t * | nonz,
|  | double ** | nzval,
|  | int_t ** | rowind,
|  | int_t ** | colptr
| ) |  |

static

    On input, nonz/nzval/rowind/colptr represents lower part of a symmetric
    matrix. On exit, it represents the full matrix with lower and upper parts.

Here is the call graph for this function:

## ReadVector()

static int ReadVector | ( | FILE * | fp,
|  | int_t | n,
|  | int_t * | where,
|  | int | perline,
|  | int | persize
| ) |  |

static