EVSL  1.1.0
EigenValues Slicing Library
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros
Macros | Functions
LanDosG.c File Reference
#include <errno.h>
#include <fcntl.h>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <sys/utsname.h>
#include <time.h>
#include <unistd.h>
#include "evsl.h"
#include "io.h"

Go to the source code of this file.

Macros

#define max(a, b)   ((a) > (b) ? (a) : (b))
 
#define min(a, b)   ((a) < (b) ? (a) : (b))
 

Functions

int exDOS (double *vals, int n, int npts, double *x, double *y, double *intv)
 
int read_coo_MM (const char *matfile, int idxin, int idxout, cooMat *Acoo)
 
int get_matrix_info (FILE *fmat, io_t *pio)
 
int findarg (const char *argname, ARG_TYPE type, void *val, int argc, char **argv)
 
int readVec (const char *filename, int *npts, double **vec)
 
int main (int argc, char *argv[])
 

Macro Definition Documentation

#define max (   a,
 
)    ((a) > (b) ? (a) : (b))

Definition at line 22 of file LanDosG.c.

#define min (   a,
 
)    ((a) < (b) ? (a) : (b))

Definition at line 23 of file LanDosG.c.

Function Documentation

int exDOS ( double *  vals,
int  n,
int  npts,
double *  x,
double *  y,
double *  intv 
)

Calculate the exact DOS given eigenvalues

Parameters
[in]valseigenvalues
[in]nnumber of eigenvalues
[in]nptsnumber of points for dos curve
[in]intvintervals of interests
[out]xcoordinates for dos plot
[out]yy coordinates for dos plot
Note
Both x and y are expected to be preallocated.

Definition at line 22 of file exDOS.c.

References DSCAL(), linspace(), max, min, and PI.

Referenced by main().

Here is the call graph for this function:

Here is the caller graph for this function:

int findarg ( const char *  argname,
ARG_TYPE  type,
void *  val,
int  argc,
char **  argv 
)

Definition at line 171 of file io.c.

Referenced by main().

Here is the caller graph for this function:

int get_matrix_info ( FILE *  fmat,
io_t pio 
)

Definition at line 22 of file io.c.

References _io_t::a, _io_t::b, ERR_IO, _io_t::Fmt, _io_t::Fname, _io_t::Fname1, _io_t::Fname2, _io_t::MatNam, _io_t::MatNam1, _io_t::MatNam2, MAX_LINE, MaxNamLen, MM0, MM1, and _io_t::n_intv.

Referenced by main().

Here is the caller graph for this function:

int main ( int  argc,
char *  argv[] 
)

Tests landosG.c , the Lanczos DOS computed for the generalized eigenvalue problem. Includes graphical comparison of calculated vs exact DOS

use -graph_exact_dos 1 to enable graphing the exact DOS


Definition at line 53 of file LanDosG.c.

References BSolPol(), cooMat_to_csrMat(), _BSolDataPol::deg, diagScalCsr(), evsl_timer(), EVSLFinish(), EVSLStart(), exDOS(), extrDiagCsr(), findarg(), _io_t::Fmt, _io_t::Fname1, _io_t::Fname2, free_coo(), free_csr(), FreeBSolPolData(), get_matrix_info(), HB, INT, LanDosG(), LanTrbounds(), _io_t::MatNam1, _io_t::MatNam2, MAX_LINE, _cooMat::nrows, rand_double(), read_coo_MM(), readVec(), SetAMatrix(), SetBMatrix(), SetBSol(), SetGenEig(), SetLTSol(), SetStdEig(), SetupPolRec(), and SetupPolSqrt().

Here is the call graph for this function:

int read_coo_MM ( const char *  matfile,
int  idxin,
int  idxout,
cooMat Acoo 
)

Definition at line 66 of file io.c.

References _cooMat::ir, _cooMat::jc, MAX_LINE, mm_is_coordinate, mm_is_integer, mm_is_real, mm_is_sparse, mm_is_symmetric, mm_is_valid(), mm_read_banner(), mm_read_mtx_crd_size(), _cooMat::ncols, _cooMat::nnz, _cooMat::nrows, and _cooMat::vv.

Referenced by main().

Here is the call graph for this function:

Here is the caller graph for this function:

int readVec ( const char *  filename,
int *  npts,
double **  vec 
)

Reads in a vector as an nx1 matrix.

Parameters
[out]nptspointer to an int to store # of points
[out]vecUNallocated space to read vector to
[in]filenamefile to read from, where the first line contains number of elements/width/height of matrix, and the rest of the lines contain the values.

Definition at line 32 of file LanDosG.c.

Referenced by main().

Here is the caller graph for this function: