Vec3 class

3x1 vector object More...


Files

file  vec3.h
 Classes Vec3,Mat3: 3x1 vector and 3x3 dense matrix objects.

Typedefs

typedef double Vec3 [3]
 Vec3 definition. 3x1 vector object.

Functions

double Vec3_nrm1 (Vec3 u)
 1-norm of a 3-vector.
double Vec3_nrm2 (Vec3 u)
 2-norm of a 3-vector.
double Vec3_nrm8 (Vec3 u)
 oo-norm of a 3-vector.
double Vec3_dif1 (Vec3 u, Vec3 v)
 1-norm of a 3-vector.
double Vec3_dif2 (Vec3 u, Vec3 v)
 2-norm of a 3-vector.
double Vec3_dif8 (Vec3 u, Vec3 v)
 oo-norm of a 3-vector.
double Vec3_dot (Vec3 u, Vec3 v)
 dot product of two 3-vectors.
void Vec3_init (Vec3 u, double val)
 Initialize a 3-vector to be a constant.
void Vec3_scal (Vec3 u, double val)
 3-vector scale.
void Vec3_copy (Vec3 u, Vec3 v)
 3-vector copy.
void Vec3_axpy (Vec3 u, Vec3 v, double val)
 scalar times 3-vector plus 3-vector.
void Vec3_xcry (Vec3 u, Vec3 v, double *w)
 cross-product of two 3-vectors.
void Vec3_nrmlize (Vec3 u, double scale)
 normalize a 3-vector.
void Vec3_nrmlizeNE (Vec3 u, double scale)
 normalize a 3-vector (no error check).
void Vec3_print (Vec3 u, const char *name)
 print a 3-vector.
void Vec3_mult (Vec3 u, Mat3 A, Vec3 v)
 multiply a 3-matrix and a 3-vector.
void Vec3_getCol (Vec3 u, Mat3 A, int col)
 get 3-vector column of a 3-matrix.
void Vec3_getRow (Vec3 u, Mat3 A, int row)
 get 3-vector row of a 3-matrix.

Detailed Description

3x1 vector object


Typedef Documentation

typedef double Vec3[3]

Vec3 definition. 3x1 vector object.

Author:
Michael Holst


Function Documentation

void Vec3_axpy ( Vec3  u,
Vec3  v,
double  val 
)

scalar times 3-vector plus 3-vector.

Author:
Michael Holst
Note:
Class Vec3,Mat3: Non-inlineable methods (vec3.c)
Returns:
None
Parameters:
u the output 3-vector
v the source 3-vector
val the coeficient for scaling 3-vector v

void Vec3_copy ( Vec3  u,
Vec3  v 
)

3-vector copy.

Author:
Michael Holst
Note:
Class Vec3,Mat3: Non-inlineable methods (vec3.c)
Returns:
None
Parameters:
u the destiny 3-vector
v the source 3-vector

double Vec3_dif1 ( Vec3  u,
Vec3  v 
)

1-norm of a 3-vector.

Author:
Michael Holst
Note:
Class Vec3,Mat3: Non-inlineable methods (vec3.c)
Returns:
1-norm of a 3-vector
Parameters:
u 3-vector u
v 3-vector v

double Vec3_dif2 ( Vec3  u,
Vec3  v 
)

2-norm of a 3-vector.

Author:
Michael Holst
Note:
Class Vec3,Mat3: Non-inlineable methods (vec3.c)
Returns:
2-norm of a 3-vector
Parameters:
u 3-vector u
v 3-vector v

double Vec3_dif8 ( Vec3  u,
Vec3  v 
)

oo-norm of a 3-vector.

Author:
Michael Holst
Note:
Class Vec3,Mat3: Non-inlineable methods (vec3.c)
Returns:
oo-norm of a 3-vector
Parameters:
u 3-vector u
v 3-vector v

double Vec3_dot ( Vec3  u,
Vec3  v 
)

dot product of two 3-vectors.

Author:
Michael Holst
Note:
Class Vec3,Mat3: Non-inlineable methods (vec3.c)
Returns:
dot product of two 3-vectors
Parameters:
u 3-vector u
v 3-vector v

void Vec3_getCol ( Vec3  u,
Mat3  A,
int  col 
)

get 3-vector column of a 3-matrix.

Author:
Michael Holst
Note:
Class Vec3,Mat3: Non-inlineable methods (vec3.c)
Returns:
None
Parameters:
u the output 3-vector
A the 3-matrix
col the index of column

void Vec3_getRow ( Vec3  u,
Mat3  A,
int  row 
)

get 3-vector row of a 3-matrix.

Author:
Michael Holst
Note:
Class Vec3,Mat3: Non-inlineable methods (vec3.c)
Returns:
None
Parameters:
u the output 3-vector
A the 3-matrix
row the index of row

void Vec3_init ( Vec3  u,
double  val 
)

Initialize a 3-vector to be a constant.

Author:
Michael Holst
Note:
Class Vec3,Mat3: Non-inlineable methods (vec3.c)
Returns:
None
Parameters:
u 3-vector u
val the constant to be initialized for a 3-vector

void Vec3_mult ( Vec3  u,
Mat3  A,
Vec3  v 
)

multiply a 3-matrix and a 3-vector.

Author:
Michael Holst
Note:
Class Vec3,Mat3: Non-inlineable methods (vec3.c)
Returns:
None
Parameters:
u the output 3-vector
A the 3-matrix
v the source 3-vector

double Vec3_nrm1 ( Vec3  u  ) 

1-norm of a 3-vector.

Author:
Michael Holst
Note:
Class Vec3,Mat3: Non-inlineable methods (vec3.c)
Returns:
1-norm of a 3-vector
Parameters:
u 3-vector

double Vec3_nrm2 ( Vec3  u  ) 

2-norm of a 3-vector.

Author:
Michael Holst
Note:
Class Vec3,Mat3: Non-inlineable methods (vec3.c)
Returns:
2-norm of a 3-vector
Parameters:
u 3-vector

double Vec3_nrm8 ( Vec3  u  ) 

oo-norm of a 3-vector.

Author:
Michael Holst
Note:
Class Vec3,Mat3: Non-inlineable methods (vec3.c)
Returns:
oo-norm of a 3-vector
Parameters:
u 3-vector

void Vec3_nrmlize ( Vec3  u,
double  scale 
)

normalize a 3-vector.

Author:
Michael Holst
Note:
Class Vec3,Mat3: Non-inlineable methods (vec3.c)
Returns:
None
Parameters:
u the output 3-vector
scale scale value of the 3-vector u

void Vec3_nrmlizeNE ( Vec3  u,
double  scale 
)

normalize a 3-vector (no error check).

Author:
Michael Holst
Note:
Class Vec3,Mat3: Non-inlineable methods (vec3.c)
Returns:
None
Parameters:
u the output 3-vector
scale scale value of the 3-vector u

void Vec3_print ( Vec3  u,
const char *  name 
)

print a 3-vector.

Author:
Michael Holst
Note:
Class Vec3,Mat3: Non-inlineable methods (vec3.c)
Returns:
None
Parameters:
u the output 3-vector
name the output file name

void Vec3_scal ( Vec3  u,
double  val 
)

3-vector scale.

Author:
Michael Holst
Note:
Class Vec3,Mat3: Non-inlineable methods (vec3.c)
Returns:
None
Parameters:
u 3-vector u
val the constant to be initialized for a 3-vector

void Vec3_xcry ( Vec3  u,
Vec3  v,
double *  w 
)

cross-product of two 3-vectors.

Author:
Michael Holst
Note:
Class Vec3,Mat3: Non-inlineable methods (vec3.c)
Returns:
None
Parameters:
u the output 3-vector
v the source 3-vector
w another source 3-vector


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