Vec class

an Nx1 vector class. More...


Files

file  vec.h
 Class Vec: an Nx1 vector class.

Classes

struct  sVec
 Contains public data memebers for Vec class. More...

Typedefs

typedef struct sVec Vec
 Declaration of the Vec class as the Vec structure.

Functions

VecVec_ctor (Vmem *vmem, const char *name, int length)
 The vector constructor (data array malloc'd by us).
VecVec_ctor2 (Vmem *vmem, const char *name, int length, double *data)
 The vector constructor (data array passed in).
void Vec_dtor (Vec **thee)
 The vector destructor.
int Vec_len (Vec *thee)
 Length of a vector.
double * Vec_addr (Vec *thee)
 Address of a vector data.
double Vec_val (Vec *thee, int i)
 Return value of component of vector.
void Vec_set (Vec *thee, int i, double val)
 Set value of component of vector.
double Vec_nrm1 (Vec *thee)
 1-norm of a vector.
double Vec_nrm2 (Vec *thee)
 2-norm of a vector.
double Vec_nrm8 (Vec *thee)
 oo-norm of a vector.
double Vec_dif1 (Vec *thee, Vec *s)
 1-norm of a vector.
double Vec_dif2 (Vec *thee, Vec *s)
 2-norm of a vector.
double Vec_dif8 (Vec *thee, Vec *s)
 oo-norm of a vector.
double Vec_dot (Vec *thee, Vec *s)
 dot product of two vectors.
void Vec_init (Vec *thee, double val)
 initialize a vector to be a constant.
void Vec_scal (Vec *thee, double val)
 vector scale.
void Vec_copy (Vec *thee, Vec *s)
 vector copy.
void Vec_axpy (Vec *thee, Vec *s, double val)
 scalar times vector plus vector.
void Vec_print (Vec *thee)
 print a vector.
void Vec_printSp (Vec *thee, char *fname, int pflag)
 print a vector.
void Vec_diagScale (Vec *thee, Mat *amat, Vec *f)
 Apply inverse of diagonal to a vector.
void Vec_matvec (Vec *thee, Mat *amat, Vec *v, int key, int part)
 Matrix times vector.
void Vec_smooth (Vec *thee, Mat *amat, Vec *f, Vec *w, int key, int ioflag, int meth, int adj, int itmax, double etol, double omega)
 Generic smoothing operator.
void Vec_jac (Vec *thee, Mat *amat, Vec *f, Vec *w, int key, int ioflag, int itmax, double etol, double omega)
 Jacobi iteration.
void Vec_gs (Vec *thee, Mat *amat, Vec *f, Vec *w, int key, int ioflag, int adj, int itmax, double etol)
 Gauss-Seidel iteration.
void Vec_bnd (Vec *thee, Mat *mat, int key)
 Apply boundary condition.
void Vec_absLog (Vec *thee, double val)
 Log of abs value of entries of block vector, shifted by < val >.
VecVec_ctorPoint (Vec *v, const char *name, int sep, int numR)
 Create a Vec pointer to the tail of a Vec.
void Vec_dtorPoint (Vec **thee)
 The vec pointer destructor.

Detailed Description

an Nx1 vector class.


Typedef Documentation

typedef struct sVec Vec

Declaration of the Vec class as the Vec structure.

Author:
Michael Holst
Returns:
None


Function Documentation

void Vec_absLog ( Vec thee,
double  val 
)

Log of abs value of entries of block vector, shifted by < val >.

Author:
Michael Holst
Note:
Class Vec: Non-Inlineable methods (vec.c)
Returns:
None
Parameters:
thee Pointer to the vector
val value to be shifted to abs value of entries of block vector

double* Vec_addr ( Vec thee  ) 

Address of a vector data.

Author:
Michael Holst
Note:
Class Vec: Non-Inlineable methods (vec.c)
Returns:
Address of a vector data
Parameters:
thee Pointer to the vector

void Vec_axpy ( Vec thee,
Vec s,
double  val 
)

scalar times vector plus vector.

Author:
Michael Holst
Note:
Class Vec: Non-Inlineable methods (vec.c)
Returns:
None
Parameters:
thee Pointer to the vector
s the source vector
val coeficient for scaling the source vector

void Vec_bnd ( Vec thee,
Mat mat,
int  key 
)

Apply boundary condition.

Author:
Michael Holst
Note:
Class Vec: Non-Inlineable methods (vec.c)
Returns:
None
Parameters:
thee Pointer to the vector
mat system matrix
key index for setting zeroes in the row/column components

void Vec_copy ( Vec thee,
Vec s 
)

vector copy.

Author:
Michael Holst
Note:
Class Vec: Non-Inlineable methods (vec.c)
Returns:
None
Parameters:
thee Pointer to the vector
s the source vector

Vec* Vec_ctor ( Vmem *  vmem,
const char *  name,
int  length 
)

The vector constructor (data array malloc'd by us).

Author:
Michael Holst
Note:
Class Vec: Non-Inlineable methods (vec.c)
Returns:
Pointer to a newly allocated (empty) vector
Parameters:
vmem Memory management object
name character string name for this vector
length the length of the vector

Vec* Vec_ctor2 ( Vmem *  vmem,
const char *  name,
int  length,
double *  data 
)

The vector constructor (data array passed in).

Author:
Michael Holst
Note:
Class Vec: Non-Inlineable methods (vec.c)
Returns:
Pointer to a newly allocated (empty) vector
Parameters:
vmem Memory management object
name character string name for this vector
length the length of the vector
data pointer to the initial value of the vector component

Vec* Vec_ctorPoint ( Vec v,
const char *  name,
int  sep,
int  numR 
)

Create a Vec pointer to the tail of a Vec.

Author:
Stephen Bond
Note:
Class Whb: Non-Inlineable methods (hbtools.c)
Returns:
None
Parameters:
v Pointer to the vec object
name character string name for the vector
sep pointer to size array
numR num of rows in each vector

void Vec_diagScale ( Vec thee,
Mat amat,
Vec f 
)

Apply inverse of diagonal to a vector.

Author:
Michael Holst
Note:
Class Vec: Non-Inlineable methods (vec.c)
Returns:
None
Parameters:
thee Pointer to the vector
amat system matrix
f source vector slot

double Vec_dif1 ( Vec thee,
Vec s 
)

1-norm of a vector.

Author:
Michael Holst
Note:
Class Vec: Non-Inlineable methods (vec.c)
Returns:
1-norm of the difference of two vectors
Parameters:
thee Pointer to the vector
s the source vector

double Vec_dif2 ( Vec thee,
Vec s 
)

2-norm of a vector.

Author:
Michael Holst
Note:
Class Vec: Non-Inlineable methods (vec.c)
Returns:
2-norm of the difference of two vectors
Parameters:
thee Pointer to the vector
s the source vector

double Vec_dif8 ( Vec thee,
Vec s 
)

oo-norm of a vector.

Author:
Michael Holst
Note:
Class Vec: Non-Inlineable methods (vec.c)
Returns:
oo-norm of the difference of two vectors
Parameters:
thee Pointer to the vector
s the source vector

double Vec_dot ( Vec thee,
Vec s 
)

dot product of two vectors.

Author:
Michael Holst
Note:
Class Vec: Non-Inlineable methods (vec.c)
Returns:
dot product of two vectors
Parameters:
thee Pointer to the vector
s the source vector

void Vec_dtor ( Vec **  thee  ) 

The vector destructor.

Author:
Michael Holst
Note:
Class Vec: Non-Inlineable methods (vec.c)
Returns:
None
Parameters:
thee Pointer to the vector

void Vec_dtorPoint ( Vec **  thee  ) 

The vec pointer destructor.

Author:
Stephen Bond
Note:
Class Whb: Non-Inlineable methods (hbtools.c)
Returns:
None
Parameters:
thee Pointer to Pointer of the Bvec object

void Vec_gs ( Vec thee,
Mat amat,
Vec f,
Vec w,
int  key,
int  ioflag,
int  adj,
int  itmax,
double  etol 
)

Gauss-Seidel iteration.

Author:
Michael Holst
Note:
Class Vec: Non-Inlineable methods (vec.c)
Returns:
None
Parameters:
thee Pointer to the vector
amat system matrix
f source vector slot
w the work block vector
key smooth with A or A' (0=A, 1=A')
ioflag debug output level (0=normal, 1=none, 2=lots, ... )
adj adjoint choice (0=normal, 1=adjoint)
itmax number of iterations to do (the maximum allowed)
etol error tolerance (currently ignored)

void Vec_init ( Vec thee,
double  val 
)

initialize a vector to be a constant.

Author:
Michael Holst
Note:
Class Vec: Non-Inlineable methods (vec.c)
Returns:
None
Parameters:
thee Pointer to the vector
val value to be initialized for the vector

void Vec_jac ( Vec thee,
Mat amat,
Vec f,
Vec w,
int  key,
int  ioflag,
int  itmax,
double  etol,
double  omega 
)

Jacobi iteration.

Author:
Michael Holst
Note:
Class Vec: Non-Inlineable methods (vec.c)
Returns:
None
Parameters:
thee Pointer to the vector
amat system matrix
f source vector slot
w the work block vector
key smooth with A or A' (0=A, 1=A')
ioflag debug output level (0=normal, 1=none, 2=lots, ... )
itmax number of iterations to do (the maximum allowed)
etol error tolerance (currently ignored)
omega iteration parameter

int Vec_len ( Vec thee  ) 

Length of a vector.

Author:
Michael Holst
Note:
Class Vec: Non-Inlineable methods (vec.c)
Returns:
Length of a vector
Parameters:
thee Pointer to the vector

void Vec_matvec ( Vec thee,
Mat amat,
Vec v,
int  key,
int  part 
)

Matrix times vector.

Author:
Michael Holst
Note:
Class Vec: Non-Inlineable methods (vec.c)
Returns:
None
Parameters:
thee Pointer to the vector
amat system matrix
v the source vector
key which of A or A' to use for the matvec
(0=A, 1=A', 2=A(accumulate), 3=A'(accumulate))
(NOTE: 0=prolongate, 1=restrict, for PRO)
part which part of matrix to use for the matvec
(0=A=D+L+U, 1=D, 2=D+L, 3=D+U, 4=L+U)
(NOTE: part!=0 only well-defined for DRC)

double Vec_nrm1 ( Vec thee  ) 

1-norm of a vector.

Author:
Michael Holst
Note:
Class Vec: Non-Inlineable methods (vec.c)
Returns:
1-norm of a vector
Parameters:
thee Pointer to the vector

double Vec_nrm2 ( Vec thee  ) 

2-norm of a vector.

Author:
Michael Holst
Note:
Class Vec: Non-Inlineable methods (vec.c)
Returns:
2-norm of a vector
Parameters:
thee Pointer to the vector

double Vec_nrm8 ( Vec thee  ) 

oo-norm of a vector.

Author:
Michael Holst
Note:
Class Vec: Non-Inlineable methods (vec.c)
Returns:
oo-norm of a vector.
Parameters:
thee Pointer to the vector

void Vec_print ( Vec thee  ) 

print a vector.

Author:
Michael Holst
Note:
Class Vec: Non-Inlineable methods (vec.c)
Returns:
None
Parameters:
thee Pointer to the vector

void Vec_printSp ( Vec thee,
char *  fname,
int  pflag 
)

print a vector.

Author:
Michael Holst
Note:
Class Vec: Non-Inlineable methods (vec.c)
Returns:
None
Parameters:
thee Pointer to the vector
fname the output file name
pflag 0 ==> write, 1 ==> append

void Vec_scal ( Vec thee,
double  val 
)

vector scale.

Author:
Michael Holst
Note:
Class Vec: Non-Inlineable methods (vec.c)
Returns:
None
Parameters:
thee Pointer to the vector
val value to be scaled to the vector

void Vec_set ( Vec thee,
int  i,
double  val 
)

Set value of component of vector.

Author:
Michael Holst
Note:
Class Vec: Non-Inlineable methods (vec.c)
Returns:
None
Parameters:
thee Pointer to the vector
i index of the component of vector
val value of the component of vector

void Vec_smooth ( Vec thee,
Mat amat,
Vec f,
Vec w,
int  key,
int  ioflag,
int  meth,
int  adj,
int  itmax,
double  etol,
double  omega 
)

Generic smoothing operator.

Author:
Michael Holst
Note:
Class Vec: Non-Inlineable methods (vec.c)
Returns:
None
Parameters:
thee Pointer to the vector
amat system matrix
f source vector slot
w the work block vector
key smooth with A or A' (0=A, 1=A')
ioflag debug output level (0=normal, 1=none, 2=lots, ... )
meth smoother choice (0=jac, 1=gs, ... )
adj adjoint choice (0=normal, 1=adjoint)
itmax number of iterations to do (the maximum allowed)
etol error tolerance (currently ignored)
omega SOR parameter (currently ignored)

double Vec_val ( Vec thee,
int  i 
)

Return value of component of vector.

Author:
Michael Holst
Note:
Class Vec: Non-Inlineable methods (vec.c)
Returns:
value of component of vector.
Parameters:
thee Pointer to the vector
i index of the component of vector


Generated on Mon Aug 9 11:13:45 2010 for MC by  doxygen 1.5.6