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 | |
Vec * | Vec_ctor (Vmem *vmem, const char *name, int length) |
The vector constructor (data array malloc'd by us). | |
Vec * | Vec_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 >. | |
Vec * | Vec_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. |
void Vec_absLog | ( | Vec * | thee, | |
double | val | |||
) |
Log of abs value of entries of block vector, shifted by < val >.
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.
thee | Pointer to the vector |
scalar times vector plus vector.
thee | Pointer to the vector | |
s | the source vector | |
val | coeficient for scaling the source vector |
Apply boundary condition.
thee | Pointer to the vector | |
mat | system matrix | |
key | index for setting zeroes in the row/column components |
vector copy.
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).
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).
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 |
Create a Vec pointer to the tail of a Vec.
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 |
Apply inverse of diagonal to a vector.
thee | Pointer to the vector | |
amat | system matrix | |
f | source vector slot |
1-norm of a vector.
thee | Pointer to the vector | |
s | the source vector |
2-norm of a vector.
thee | Pointer to the vector | |
s | the source vector |
oo-norm of a vector.
thee | Pointer to the vector | |
s | the source vector |
dot product of two vectors.
thee | Pointer to the vector | |
s | the source vector |
void Vec_dtor | ( | Vec ** | thee | ) |
The vector destructor.
thee | Pointer to the vector |
void Vec_dtorPoint | ( | Vec ** | thee | ) |
The vec pointer destructor.
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.
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.
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.
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.
thee | Pointer to the vector |
Matrix times vector.
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.
thee | Pointer to the vector |
double Vec_nrm2 | ( | Vec * | thee | ) |
2-norm of a vector.
thee | Pointer to the vector |
double Vec_nrm8 | ( | Vec * | thee | ) |
oo-norm of a vector.
thee | Pointer to the vector |
void Vec_print | ( | Vec * | thee | ) |
print a vector.
thee | Pointer to the vector |
void Vec_printSp | ( | Vec * | thee, | |
char * | fname, | |||
int | pflag | |||
) |
print a vector.
thee | Pointer to the vector | |
fname | the output file name | |
pflag | 0 ==> write, 1 ==> append |
void Vec_scal | ( | Vec * | thee, | |
double | val | |||
) |
vector scale.
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.
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.
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.
thee | Pointer to the vector | |
i | index of the component of vector |