Sandia Home Sandia Home
Main Page | Publications | Downloads | Configuration | Running the Code | Solver Parameters | FAQ | Namespace List | Class Hierarchy | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

APPSPACK Namespace Reference


Detailed Description

The namespace for all APPSPACK files.


Classes

class  APPSPACK::Conveyor
class  APPSPACK::Counter
 Counts the different types of function evaluations, using arbitary codes returned by the user. More...
class  APPSPACK::Directions
 The search directions and associated information. More...
class  APPSPACK::GCI
 APPS Communicator - An interface for both PVM and MPI commands. More...
class  APPSPACK::List
 Manipulates a list of Point objects. More...
class  APPSPACK::Matrix
 Stores a matrix A. All indices begin at zero. More...
class  APPSPACK::Point
 A trial point. More...
class  APPSPACK::Print
 Printing utilities. More...
class  APPSPACK::Print::PrintablePositiveDouble
 Class used for printing formatted positive doubles. More...
class  APPSPACK::Print::PrintableDouble
 Class used for printing formatted doubles. More...
class  APPSPACK::Solver
 The solver itself. More...
class  APPSPACK::Vector
 Class Vector -- Extends properties of the Standard Template Library (STL) vector<double>, v. More...

Functions

double dne ()
 Use x = APPSPACK::dne() to say that the value of x does not exist.
bool exists (double value)
 Returns true if value had previously been set by a call to APPSPACK::dne.
void DGELQF_F77 (int *M, int *N, double A[], int *LDA, double TAU[], double WORK[], int *LWORK, int *INFO)
 DGELQF computes an LQ factorization of a real M-by-N matrix A: A = L * Q.
void DGGLSE_F77 (int *M, int *N, int *P, double B[], int *LDB, double A[], int *LDA, double C[], double D[], double X[], double WORK[], int *LWORK, int *INFO)
 Solves the linear equality-constrained least squares problem min || c - Ax || subject to Bx = d.
void DGESVD_F77 (char *JOBU, char *JOBVT, int *M, int *N, double A[], int *LDA, double S[], double U[], int *LDU, double VT[], int *LDVT, double WORK[], int *LWORK, int *INFO)
 DGESVD computes the singular value decomposition (SVD) of a real M-by-N matrix A, optionally computing the left and/or right singular vectors. The SVD is written

\[ A = U \Sigma V^T \]

where $\Sigma$ is an M-by-N matrix which is zero except for its min(m,n) diagonal elements, U is an M-by-M orthogonal matrix, and V is an N-by-N orthogonal matrix. The diagonal elements of $\Sigma$ are the singular values of A; they are real and non-negative, and are returned in descending order. The first min(m,n) columns of U and V are the left and right singular vectors of A.

void DGEMM_F77 (char *TRANSA, char *TRANSB, int *M, int *N, int *K, double *ALPHA, double A[], int *LDA, double B[], int *LDB, double *BETA, double C[], int *LDC)
 DGEMM performs one of the matrix-matrix operations

\[ C := \alpha *op( A ) *op( B ) + \beta* C, \]

where $ op( X )$ is one of $ op( X ) = X$ or $ op( X ) = X^T $, and $\alpha$ and $ \beta$ are scalars, and $A$, $B$ and $C$ are matrices, with $ op(A)$ an $ m \times k$ matrix, $ op(B)$ a $ k \times n$ matrix and $ C $ an $m \times n$ matrix.

void DGEMV_F77 (char *TRANS, int *M, int *N, double *ALPHA, double A[], int *LDA, double X[], int *INCX, double *BETA, double Y[], int *INCY)
 DGEMV performs one of the matrix-vector operations

\[ y := \alpha A x + \beta y, \;{\rm or }\; y := \alpha A' x + \beta y, \]

where $\alpha$ and $beta$ are scalars, $x$ and $y$ are vectors and $A$ is an $m$ by $n$ matrix.

double DDOT_F77 (int *n, double dx[], int *incx, double dy[], int *incy)
 Forms the dot product of two vectors. Uses unrolled loops for increments equal to one.
bool getNextQuotedString (const string &line, string::size_type &pos, string &value)
bool getNextString (const string &line, string::size_type &pos, string &value)
bool getNextDouble (const string &line, string::size_type &pos, double &value)
bool getNextInt (const string &line, string::size_type &pos, int &value)
bool parseTextInputFile (const string filename, Parameter::List &params)
 Parse an APPSPACK input file and store the data in the given parameter list.
bool processTextInputFileLine (const string &line, Parameter::List &params, Parameter::List *&subPtr, ifstream &fin)
 Process a single line of the text input file.
void tokenize (const string &line, vector< string > &linesplit)


Function Documentation

double APPSPACK::dne  ) 
 

Use x = APPSPACK::dne() to say that the value of x does not exist.

This is done by returning the constant APPSPACK_DBL_MAX.

Definition at line 40 of file APPSPACK_Float.cpp.

Referenced by APPSPACK::Constraints::Linear::formDistanceVector(), APPSPACK::Combiner::Generic::operator()(), APPSPACK::Point::Point(), processTextInputFileLine(), APPSPACK::Evaluator::SystemCall::readOutputFile(), APPSPACK::Constraints::Linear::setupBounds(), APPSPACK::Constraints::Linear::setupRhs(), and APPSPACK::Constraints::Linear::setupScaledSystem().

bool APPSPACK::exists double  value  ) 
 

Returns true if value had previously been set by a call to APPSPACK::dne.

Checks against the constant APPSPACK_DBL_MAX.

Definition at line 45 of file APPSPACK_Float.cpp.

Referenced by APPSPACK::Constraints::Linear::errorCheck(), APPSPACK::Constraints::Linear::formDistanceVector(), APPSPACK::Constraints::Linear::formSnapSystem(), APPSPACK::Constraints::Linear::getIneqState(), APPSPACK::Constraints::Linear::getNominalX(), APPSPACK::Point::greaterThan(), APPSPACK::Point::isSufficientDecrease(), APPSPACK::Point::lessThan(), APPSPACK::Constraints::Linear::makeBoundsFeasible(), APPSPACK::Combiner::Generic::operator()(), operator<<(), APPSPACK::Constraints::Linear::print(), APPSPACK::Constraints::Linear::setupBounds(), APPSPACK::Constraints::Linear::setupScaledSystem(), and APPSPACK::Constraints::Linear::setupScaling().

void DGELQF_F77 int *  M,
int *  N,
double  A[],
int *  LDA,
double  TAU[],
double  WORK[],
int *  LWORK,
int *  INFO
 

DGELQF computes an LQ factorization of a real M-by-N matrix A: A = L * Q.

Parameters:
M (input) INTEGER The number of rows of the matrix A. M >= 0.
N (input) INTEGER The number of columns of the matrix A. N >= 0.
A (input/output) DOUBLE PRECISION array, dimension (LDA,N) On entry, the M-by-N matrix A. On exit, the elements on and below the diagonal of the array contain the m-by-min(m,n) lower trapezoidal matrix L (L is lower triangular if m <= n); the elements above the diagonal, with the array TAU, represent the orthogonal matrix Q as a product of elementary reflectors (see Further Details).
LDA (input) INTEGER The leading dimension of the array A. LDA >= max(1,M).
TAU (output) DOUBLE PRECISION array, dimension (min(M,N)) The scalar factors of the elementary reflectors (see Further Details).
WORK (workspace/output) DOUBLE PRECISION array, dimension (LWORK) On exit, if INFO = 0, WORK(1) returns the optimal LWORK.
LWORK (input) INTEGER The dimension of the array WORK. LWORK >= max(1,M). For optimum performance LWORK >= M*NB, where NB is the optimal blocksize. If LWORK = -1, then a workspace query is assumed; the routine only calculates the optimal size of the WORK array, returns this value as the first entry of the WORK array, and no error message related to LWORK is issued by XERBLA.
INFO (output) INTEGER = 0: successful exit < 0: if INFO = -i, the i-th argument had an illegal value
Further Details

The matrix Q is represented as a product of elementary reflectors

Q = H(k) . . . H(2) H(1), where k = min(m,n).

Each H(i) has the form

H(i) = I - tau * v * v'

where tau is a real scalar, and v is a real vector with v(1:i-1) = 0 and v(i) = 1; v(i+1:n) is stored on exit in A(i,i+1:n), and tau in TAU(i).

Referenced by APPSPACK::Matrix::pruneDependentRows().

void DGGLSE_F77 int *  M,
int *  N,
int *  P,
double  B[],
int *  LDB,
double  A[],
int *  LDA,
double  C[],
double  D[],
double  X[],
double  WORK[],
int *  LWORK,
int *  INFO
 

Solves the linear equality-constrained least squares problem min || c - Ax || subject to Bx = d.

DGGLSE solves the linear equality-constrained least squares (LSE) problem:

\[ \mbox{minimize } \| c - Ax \|_2 \mbox{ subject to } Bx = d \]

where A is an M-by-N matrix, B is a P-by-N matrix, c is a given M-vector, and d is a given P-vector. It is assumed that P <= N <= M+P, and

\[ \mbox{rank}(B) = P \mbox{ and } \mbox{rank} \left( \begin{array}{c} A \\ B \end{array} \right) = N. \]

These conditions ensure that the LSE problem has a unique solution, which is obtained using a GRQ factorization of the matrices B and A.

Parameters:
M (input) INTEGER The number of rows of the matrix A. M >= 0.
N (input) INTEGER The number of columns of the matrices A and B. N >= 0.
P (input) INTEGER The number of rows of the matrix B. 0 <= P <= N <= M+P.
A (input/output) DOUBLE PRECISION array, dimension (LDA,N) On entry, the M-by-N matrix A. On exit, A is destroyed.
LDA (input) INTEGER The leading dimension of the array A. LDA >= max(1,M).
B (input/output) DOUBLE PRECISION array, dimension (LDB,N) On entry, the P-by-N matrix B. On exit, B is destroyed.
LDB (input) INTEGER The leading dimension of the array B. LDB >= max(1,P).
C (input/output) DOUBLE PRECISION array, dimension (M) On entry, C contains the right hand side vector for the least squares part of the LSE problem. On exit, the residual sum of squares for the solution is given by the sum of squares of elements N-P+1 to M of vector C.
D (input/output) DOUBLE PRECISION array, dimension (P) On entry, D contains the right hand side vector for the constrained equation. On exit, D is destroyed.
X (output) DOUBLE PRECISION array, dimension (N) On exit, X is the solution of the LSE problem.
WORK (workspace/output) DOUBLE PRECISION array, dimension (LWORK) On exit, if INFO = 0, WORK(1) returns the optimal LWORK.
LWORK (input) INTEGER The dimension of the array WORK. LWORK >= max(1,M+N+P). For optimum performance LWORK >= P+min(M,N)+max(M,N)*NB, where NB is an upper bound for the optimal blocksizes for DGEQRF, SGERQF, DORMQR and SORMRQ. If LWORK = -1, then a workspace query is assumed; the routine only calculates the optimal size of the WORK array, returns this value as the first entry of the WORK array, and no error message related to LWORK is issued by XERBLA.
INFO (output) INTEGER = 0: successful exit. < 0: if INFO = -i, the i-th argument had an illegal value.

Referenced by APPSPACK::Matrix::constrainedLSQR().

void DGESVD_F77 char *  JOBU,
char *  JOBVT,
int *  M,
int *  N,
double  A[],
int *  LDA,
double  S[],
double  U[],
int *  LDU,
double  VT[],
int *  LDVT,
double  WORK[],
int *  LWORK,
int *  INFO
 

DGESVD computes the singular value decomposition (SVD) of a real M-by-N matrix A, optionally computing the left and/or right singular vectors. The SVD is written

\[ A = U \Sigma V^T \]

where $\Sigma$ is an M-by-N matrix which is zero except for its min(m,n) diagonal elements, U is an M-by-M orthogonal matrix, and V is an N-by-N orthogonal matrix. The diagonal elements of $\Sigma$ are the singular values of A; they are real and non-negative, and are returned in descending order. The first min(m,n) columns of U and V are the left and right singular vectors of A.

Note that the routine returns $V^T$, not $V$.

Parameters:
JOBU (input) CHARACTER*1 Specifies options for computing all or part of the matrix U:
  • = 'A': all M columns of U are returned in array U:
  • = 'S': the first min(m,n) columns of U (the left singular vectors) are returned in the array U;
  • = 'O': the first min(m,n) columns of U (the left singular vectors) are overwritten on the array A;
  • = 'N': no columns of U (no left singular vectors) are computed.
JOBVT (input) CHARACTER*1 Specifies options for computing all or part of the matrix V^T:
  • = 'A': all N rows of V^T are returned in the array VT;
  • = 'S': the first min(m,n) rows of V^T (the right singular vectors) are returned in the array VT;
  • = 'O': the first min(m,n) rows of V^T (the right singular vectors) are overwritten on the array A;
  • = 'N': no rows of V^T (no right singular vectors) are computed. JOBVT and JOBU cannot both be 'O'.
M (input) INTEGER The number of rows of the input matrix A. M >= 0.
N (input) INTEGER The number of columns of the input matrix A. N >= 0.
A (input/output) DOUBLE PRECISION array, dimension (LDA,N). On entry, the M-by-N matrix A. On exit,
  • if JOBU = 'O', A is overwritten with the first min(m,n) columns of U (the left singular vectors, stored columnwise);
  • if JOBVT = 'O', A is overwritten with the first min(m,n) rows of V^T (the right singular vectors, stored rowwise);
  • if JOBU .ne. 'O' and JOBVT .ne. 'O', the contents of A are destroyed.
LDA (input) INTEGER The leading dimension of the array A. LDA >= max(1,M).
S (output) DOUBLE PRECISION array, dimension (min(M,N)). The singular values of A, sorted so that S(i) >= S(i+1).
U (output) DOUBLE PRECISION array, dimension (LDU,UCOL)
  • (LDU,M) if JOBU = 'A' or,
  • (LDU,min(M,N)) if JOBU = 'S'.
  • If JOBU = 'A', U contains the M-by-M orthogonal matrix U;
  • if JOBU = 'S', U contains the first min(m,n) columns of U (the left singular vectors, stored columnwise);
  • if JOBU = 'N' or 'O', U is not referenced.
LDU (input) INTEGER The leading dimension of the array U. LDU >= 1; if JOBU = 'S' or 'A', LDU >= M.
VT (output) DOUBLE PRECISION array, dimension (LDVT,N)
  • If JOBVT = 'A', VT contains the N-by-N orthogonal matrix $V^T$;
  • if JOBVT = 'S', VT contains the first min(m,n) rows of V^T (the right singular vectors, stored rowwise);
  • if JOBVT = 'N' or 'O', VT is not referenced.
LDVT (input) INTEGER The leading dimension of the array VT. LDVT >= 1;
  • if JOBVT = 'A', LDVT >= N;
  • if JOBVT = 'S', LDVT >= min(M,N).
WORK (workspace/output) DOUBLE PRECISION array, dimension (LWORK) On exit, if INFO = 0, WORK(1) returns the optimal LWORK; if INFO > 0, WORK(2:MIN(M,N)) contains the unconverged superdiagonal elements of an upper bidiagonal matrix B whose diagonal is in S (not necessarily sorted). B satisfies A = U B VT, so it has the same singular values as A, and singular vectors related by U and VT.
LWORK (input) INTEGER The dimension of the array WORK. LWORK >= 1. LWORK >= MAX(3*MIN(M,N)+MAX(M,N),5*MIN(M,N)). For good performance, LWORK should generally be larger. If LWORK = -1, then a workspace query is assumed; the routine only calculates the optimal size of the WORK array, returns this value as the first entry of the WORK array, and no error message related to LWORK is issued by XERBLA.
INFO (output) INTEGER
  • = 0: successful exit.
  • < 0: if INFO = -i, the i-th argument had an illegal value.
  • > 0: if DBDSQR did not converge, INFO specifies how many superdiagonals of an intermediate bidiagonal form B did not converge to zero. See the description of WORK above for details.

Referenced by APPSPACK::Matrix::svd().

void DGEMM_F77 char *  TRANSA,
char *  TRANSB,
int *  M,
int *  N,
int *  K,
double *  ALPHA,
double  A[],
int *  LDA,
double  B[],
int *  LDB,
double *  BETA,
double  C[],
int *  LDC
 

DGEMM performs one of the matrix-matrix operations

\[ C := \alpha *op( A ) *op( B ) + \beta* C, \]

where $ op( X )$ is one of $ op( X ) = X$ or $ op( X ) = X^T $, and $\alpha$ and $ \beta$ are scalars, and $A$, $B$ and $C$ are matrices, with $ op(A)$ an $ m \times k$ matrix, $ op(B)$ a $ k \times n$ matrix and $ C $ an $m \times n$ matrix.

Parameters:
TRANSA - CHARACTER1*. On entry, TRANSA specifies the form of op(A) to be used in the matrix multiplication as follows:
  • TRANSA = 'N' or 'n', $op(A) = A$.
  • TRANSA = 'T' or 't', $op(A) = A^T$.
  • TRANSA = 'C' or 'c', $op(A) = A^T$.
  • Unchanged on exit.
TRANSB - CHARACTER*1. On entry, TRANSB specifies the form of op(B) to be used in the matrix multiplication as follows:
  • TRANSB = 'N' or 'n', $op(B) = B$.
  • TRANSB = 'T' or 't', $op(B) = B^T$.
  • TRANSB = 'C' or 'c', $op(B) = B^T$.
  • Unchanged on exit.
M - INTEGER. On entry, M specifies the number of rows of the matrix op(A) and of the matrix C. M must be at least zero. Unchanged on exit.
N - INTEGER. On entry, N specifies the number of columns of the matrix op(B) and the number of columns of the matrix C. N must be at least zero. Unchanged on exit.
K - INTEGER. On entry, K specifies the number of columns of the matrix op(A) and the number of rows of the matrix op(B). K must be at least zero. Unchanged on exit.
ALPHA - DOUBLE PRECISION. On entry, ALPHA specifies the scalar alpha. Unchanged on exit.
A - DOUBLE PRECISION array of DIMENSION (LDA, ka), where ka is k when TRANSA = 'N' or 'n', and is m otherwise. Before entry with TRANSA = 'N' or 'n', the leading $m\times k$ part of the array A must contain the matrix A, otherwise the leading $ k \times m$ part of the array A must contain the matrix A. Unchanged on exit.
LDA - INTEGER. On entry, LDA specifies the first dimension of A as declared in the calling (sub) program. When TRANSA = 'N' or 'n' then LDA must be at least $\max(1,m)$, otherwise LDA must be at least $\max(1,k)$. Unchanged on exit.
B - DOUBLE PRECISION array of DIMENSION (LDB, kb), where kb is n when TRANSB = 'N' or 'n', and is k otherwise. Before entry with TRANSB = 'N' or 'n', the leading $k \times n $ part of the array B must contain the matrix B, otherwise the leading $ n \times k $ part of the array B must contain the matrix B. Unchanged on exit.
LDB - INTEGER. On entry, LDB specifies the first dimension of B as declared in the calling (sub) program. When TRANSB = 'N' or 'n' then LDB must be at least $\max(1,k)$, otherwise LDB must be at least $\max(1,n)$. Unchanged on exit.
BETA - DOUBLE PRECISION. On entry, BETA specifies the scalar beta. When BETA is supplied as zero then C need not be set on input. Unchanged on exit.
C - DOUBLE PRECISION array of DIMENSION (LDC, n). Before entry, the leading $m\times n$ part of the array C must contain the matrix C, except when beta is zero, in which case C need not be set on entry. On exit, the array C is overwritten by the $m\times n$ matrix $ \left(\alpha * op(A) * op(B) + \beta*C \right)$.
LDC - INTEGER. On entry, LDC specifies the first dimension of C as declared in the calling (sub) program. LDC must be at least $\max(1,m)$. Unchanged on exit.
DGEMM is a level 3 Blas routine.

Referenced by APPSPACK::Matrix::multMatWithBlas().

void DGEMV_F77 char *  TRANS,
int *  M,
int *  N,
double *  ALPHA,
double  A[],
int *  LDA,
double  X[],
int *  INCX,
double *  BETA,
double  Y[],
int *  INCY
 

DGEMV performs one of the matrix-vector operations

\[ y := \alpha A x + \beta y, \;{\rm or }\; y := \alpha A' x + \beta y, \]

where $\alpha$ and $beta$ are scalars, $x$ and $y$ are vectors and $A$ is an $m$ by $n$ matrix.

Parameters:
TRANS CHARACTER*1. On entry, TRANS specifies the operation to be performed as follows:
  • TRANS = 'N' or 'n' $ y := \alpha A x + \beta y $
  • TRANS = 'T' or 't' $ y := \alpha A' x + \beta y, $
  • TRANS = 'C' or 'c' $ y := \alpha A' x + \beta y, $ Unchanged on exit.
M INTEGER. On entry, M specifies the number of rows of the matrix A. M must be at least zero. Unchanged on exit.
N INTEGER. On entry, N specifies the number of columns of the matrix A. N must be at least zero. Unchanged on exit.
ALPHA DOUBLE PRECISION. On entry, ALPHA specifies the scalar alpha. Unchanged on exit.
A DOUBLE PRECISION array of DIMENSION ( LDA, n ). Before entry, the leading m by n part of the array A must contain the matrix of coefficients. Unchanged on exit.
LDA INTEGER. On entry, LDA specifies the first dimension of A as declared in the calling (sub) program. LDA must be at least max( 1, m ). Unchanged on exit.
X DOUBLE PRECISION array of DIMENSION at least
  • ( 1 + ( n - 1 )*abs( INCX ) ) when TRANS = 'N' or 'n' and at least
  • ( 1 + ( m - 1 )*abs( INCX ) ) otherwise. Before entry, the incremented array X must contain the vector x. Unchanged on exit.
INCX INTEGER. On entry, INCX specifies the increment for the elements of X. INCX must not be zero. Unchanged on exit.
BETA DOUBLE PRECISION. On entry, BETA specifies the scalar beta. When BETA is supplied as zero then Y need not be set on input. Unchanged on exit.
Y DOUBLE PRECISION array of DIMENSION at least
  • ( 1 + ( m - 1 )*abs( INCY ) ) when TRANS = 'N' or 'n' and at least
  • ( 1 + ( n - 1 )*abs( INCY ) ) otherwise. Before entry with BETA non-zero, the incremented array Y must contain the vector y. On exit, Y is overwritten by the updated vector y.
INCY INTEGER. On entry, INCY specifies the increment for the elements of Y. INCY must not be zero. Unchanged on exit.
Level 2 Blas routine.

-- Written on 22-October-1986.

  • Jack Dongarra, Argonne National Lab.
  • Jeremy Du Croz, Nag Central Office.
  • Sven Hammarling, Nag Central Office.
  • Richard Hanson, Sandia National Labs.

Referenced by APPSPACK::Matrix::multVecWithBlas().

double DDOT_F77 int *  n,
double  dx[],
int *  incx,
double  dy[],
int *  incy
 

Forms the dot product of two vectors. Uses unrolled loops for increments equal to one.

Parameters:
n Length of dx and dy.
dx Input vector.
incx Increments to move along dx by.
dy Input vector.
incy Increments to move along dy by.
  • jack dongarra, linpack, 3/11/78.
  • modified 12/3/93, array(1) declarations changed to array(*)

Referenced by APPSPACK::Vector::dot().

bool APPSPACK::getNextQuotedString const string &  line,
string::size_type &  pos,
string &  value
 

Get the next quoted string on the given line, starting at position pos.

Parameters:
line - Line of text from which to read
pos - On input, the starting position in the line. On output, the next position after the quoted string (which may be std::string::npos). If there is any sort of error, this is set to std::string::npos upon return.
value - On output, filled in with the quoted string (without the quotes). This is an empty string if no quoted string is found.
Return values:
Returns true if the quoted string is successfully found, false otherwise.

Definition at line 45 of file APPSPACK_Utils.cpp.

Referenced by processTextInputFileLine().

bool APPSPACK::getNextString const string &  line,
string::size_type &  pos,
string &  value
 

Get the next string on the given line, starting at position pos.

Parameters:
line - Line of text from which to read
pos - On input, the starting position in the line. On output, the next position after the string (which may be std::string::npos). If there is any sort of error, this is set to std::string::npos upon return.
value - On output, filled in with the next string (i.e., the next contiguous block of non-space characters). This is an empty string if no string is found.
Return values:
Returns true if the string is successfully found, false otherwise.

Definition at line 89 of file APPSPACK_Utils.cpp.

Referenced by getNextDouble(), getNextInt(), APPSPACK::Cache::Manager::processInputLine(), processTextInputFileLine(), and APPSPACK::Evaluator::SystemCall::readOutputFile().

bool APPSPACK::getNextDouble const string &  line,
string::size_type &  pos,
double &  value
 

Get the next string on the given line, starting at position pos, and convert it to a double.

Parameters:
line - Line of text from which to read
pos - On input, the starting position in the line. On output, the next position after the string (which may be std::string::npos). If there is any sort of error in reading the next string, this is set to std::string::npos upon return.
value - On output, filled in with the double value constrained in the next string (i.e., the next contiguous block of non-space characters).
Return values:
Returns true if the next string contains a double, false otherwise.

Definition at line 132 of file APPSPACK_Utils.cpp.

References getNextString().

Referenced by APPSPACK::Cache::Manager::processInputLine(), and processTextInputFileLine().

bool APPSPACK::getNextInt const string &  line,
string::size_type &  pos,
int &  value
 

Get the next string on the given line, starting at position pos, and convert it to a int.

Parameters:
line - Line of text from which to read
pos - On input, the starting position in the line. On output, the next position after the string (which may be std::string::npos). If there is any sort of error in reading the next string, this is set to std::string::npos upon return.
value - On output, filled in with the int value constrained in the next string (i.e., the next contguous block of non-space characters).
Return values:
Returns true if the next string contains a int, false otherwise.

Definition at line 123 of file APPSPACK_Utils.cpp.

References getNextString().

Referenced by processTextInputFileLine().

bool APPSPACK::parseTextInputFile const string  filename,
Parameter::List &  params
 

Parse an APPSPACK input file and store the data in the given parameter list.

Parameters:
filename - The file name. See Step 2: Create an APPSPACK input file for details on the structure of the input file.
params - The parameter list that is to be filled in by this function
Returns:
Returns false if there are any problems parsing the input file, true otherwise.

Definition at line 344 of file APPSPACK_Utils.cpp.

References processTextInputFileLine().

Referenced by main().

bool APPSPACK::processTextInputFileLine const string &  line,
Parameter::List &  params,
Parameter::List *&  subPtr,
ifstream &  fin
 

Process a single line of the text input file.

Definition at line 141 of file APPSPACK_Utils.cpp.

References APPSPACK::Matrix::addRow(), dne(), getNextDouble(), getNextInt(), getNextQuotedString(), getNextString(), APPSPACK::Vector::resize(), APPSPACK::Parameter::List::setParameter(), APPSPACK::Parameter::List::sublist(), and tokenize().

Referenced by parseTextInputFile().

void APPSPACK::tokenize const string &  line,
vector< string > &  linesplit
 

Splits line into a vector of strings based upon whitespace delimiter.

Example
The following code segment
string line("one two three");
vector<string> linesplit;
tokenize(line,linesplit);
for (int i = 0; i < linesplit.size(); i++)
  cout << linesplit[i] << endl;
will output
one
two
three

Definition at line 376 of file APPSPACK_Utils.cpp.

Referenced by processTextInputFileLine().

 

© Sandia Corporation | Site Contact | Privacy and Security

Generated on Fri Feb 16 10:33:36 2007 for APPSPACK 5.0.1 by doxygen 1.3.9.1 written by Dimitri van Heesch, © 1997-2002