blas1pp.h File Reference

Blas Level-1 Routines: Vector-Scalar and Vector-Vector Operations. More...

Go to the source code of this file.

Complex-valued vector operations

void Blas_Add_Mult (LaVectorComplex &dy, COMPLEX da, const LaVectorComplex &dx)
 Combined vector scaling and addition (saxpy).
void Blas_Mult (LaVectorComplex &dy, COMPLEX da, const LaVectorComplex &dx)
 Vector scaling.
COMPLEX Blas_U_Dot_Prod (const LaVectorComplex &cx, const LaVectorComplex &cy)
 Non-conjugated dot product (very unusual!).
COMPLEX Blas_H_Dot_Prod (const LaVectorComplex &cx, const LaVectorComplex &cy)
 Dot product.
void Blas_Copy (const LaVectorComplex &dx, LaVectorComplex &dy)
void Blas_Scale (COMPLEX da, LaVectorComplex &dx)
void Blas_Swap (LaVectorComplex &dx, LaVectorComplex &dy)

Real-valued vector operations

void Blas_Add_Mult (LaVectorDouble &dy, double da, const LaVectorDouble &dx)
 Combined vector scaling and addition (saxpy).
void Blas_Mult (LaVectorDouble &dy, double da, const LaVectorDouble &dx)
 Vector scaling.
double Blas_Dot_Prod (const LaVectorDouble &dx, const LaVectorDouble &dy)
 Dot product.
void Blas_Apply_Plane_Rot (LaVectorDouble &dx, LaVectorDouble &dy, double &c, double &s)
 Apply Givens plane rotation.
void Blas_Gen_Plane_Rot (double &da, double &db, double &c, double &s)
 Construct Givens plane rotation.
void Blas_Copy (const LaVectorDouble &dx, LaVectorDouble &dy)
void Blas_Scale (double da, LaVectorDouble &dx)
void Blas_Swap (LaVectorDouble &dx, LaVectorDouble &dy)

Vector norms

double Blas_Norm1 (const LaVectorComplex &dx)
 1-Norm
double Blas_Norm2 (const LaVectorComplex &dx)
 2-Norm, Euclidean Norm
int Blas_Index_Max (const LaVectorComplex &dx)
double Blas_Norm_Inf (const LaVectorComplex &x)
 Infinity-Norm.
double Blas_Norm1 (const LaVectorDouble &dx)
 1-Norm
double Blas_Norm2 (const LaVectorDouble &dx)
 2-Norm, Euclidean Norm
int Blas_Index_Max (const LaVectorDouble &dx)
double Blas_Norm_Inf (const LaVectorDouble &x)
 Infinity-Norm.


Detailed Description

Blas Level-1 Routines: Vector-Scalar and Vector-Vector Operations.

This file defines the basic operations on vectors itself, commonly known as the Blas Level-1 routines.


Function Documentation

void Blas_Add_Mult ( LaVectorComplex dy,
COMPLEX  da,
const LaVectorComplex dx 
)

Combined vector scaling and addition (saxpy).

Combined vector scaling and addition: dy = dy + da * dx

void Blas_Mult ( LaVectorComplex dy,
COMPLEX  da,
const LaVectorComplex dx 
)

Vector scaling.

Vector scaling: dy = da * dx

Note:
This function is quite dumb - it only sets dy to 0.0, then calls daxpy i.e. Blas_Add_Mult. You should rather use Blas_Add_Mult() or Blas_Scale() instead.

COMPLEX Blas_U_Dot_Prod ( const LaVectorComplex cx,
const LaVectorComplex cy 
)

Non-conjugated dot product (very unusual!).

Returns the dot product of two vectors x and y, which is Sum(x[i]*y[i]), without taking any complex conjugate, which is a difference to the usual definition of complex dot products. This is probably not what you want, and you probably want to use Blas_H_Dot_Prod() instead.

Note:
Unlike Blas_H_Dot_Prod(), the vector x is not taken complex conjugate, which is a difference from the usual definition (Matlab-notation) x'*y . This function rather calculates (Matlab-notation) x.'*y .

COMPLEX Blas_H_Dot_Prod ( const LaVectorComplex cx,
const LaVectorComplex cy 
)

Dot product.

Returns the dot product of two vectors conj(x) and y, where the first vector is taken conjugate complex, which is Sum(conj(x[i])*y[i]). Note: This is not commutative any longer but rather complex conjugate commutative. But this is the usual case for these complex vectors.

void Blas_Copy ( const LaVectorComplex dx,
LaVectorComplex dy 
)

Vector assignment (copying): dy = dx

void Blas_Scale ( COMPLEX  da,
LaVectorComplex dx 
)

Vector scaling: dx = da * dx

void Blas_Swap ( LaVectorComplex dx,
LaVectorComplex dy 
)

Swaps the elements of two vectors: dx <=> dy

void Blas_Add_Mult ( LaVectorDouble dy,
double  da,
const LaVectorDouble dx 
)

Combined vector scaling and addition (saxpy).

Combined vector scaling and addition: dy = dy + da * dx

void Blas_Mult ( LaVectorDouble dy,
double  da,
const LaVectorDouble dx 
)

Vector scaling.

Vector scaling: dy = da * dx

Note:
This function is quite dumb - it only sets dy to 0.0, then calls daxpy i.e. Blas_Add_Mult. You should rather use Blas_Add_Mult() or Blas_Scale() instead.

double Blas_Dot_Prod ( const LaVectorDouble dx,
const LaVectorDouble dy 
)

Dot product.

Returns the dot product of two vectors x and y, which is Sum(x[i]*y[i]).

void Blas_Apply_Plane_Rot ( LaVectorDouble dx,
LaVectorDouble dy,
double &  c,
double &  s 
)

Apply Givens plane rotation.

Applies a Givens plane rotation to (x,y): dx = c*dx + s*dy; dy = c*dy - s*dx

void Blas_Gen_Plane_Rot ( double &  da,
double &  db,
double &  c,
double &  s 
)

Construct Givens plane rotation.

Construct a Givens plane rotation for (a,b). da, db are the rotational elimination parameters a,b.

void Blas_Copy ( const LaVectorDouble dx,
LaVectorDouble dy 
)

Vector assignment (copying): dy = dx

void Blas_Scale ( double  da,
LaVectorDouble dx 
)

Vector scaling: dx = da * dx

void Blas_Swap ( LaVectorDouble dx,
LaVectorDouble dy 
)

Swaps the elements of two vectors: dx <=> dy

double Blas_Norm1 ( const LaVectorComplex dx  ) 

1-Norm

Returns the sum of the absolute values: $|x|_1=\sum_i|x_i|$

See also:
Eric W. Weisstein. "Vector Norm." From MathWorld--A Wolfram Web Resource. http://mathworld.wolfram.com/VectorNorm.html

double Blas_Norm2 ( const LaVectorComplex dx  ) 

2-Norm, Euclidean Norm

Returns the euclidean norm of the vector: $|x|_2=\sqrt{\sum_i|x_i|^2}$

In other notation sqrt(conj(x')*x) or in Matlab notation sqrt(x'*x)

See also:
Eric W. Weisstein. "Vector Norm." From MathWorld--A Wolfram Web Resource. http://mathworld.wolfram.com/VectorNorm.html

int Blas_Index_Max ( const LaVectorComplex dx  ) 

Returns the index of largest absolute value; i such that |x[i]| == max(|x[0]|,|x[1]|,...)

double Blas_Norm_Inf ( const LaVectorComplex x  )  [inline]

Infinity-Norm.

Returns the Infinity norm of a vector, which is the absolute value of its maximum element: $|x|_{\infty}=\max_i|x_i|$

See also:
Eric W. Weisstein. "Vector Norm." From MathWorld--A Wolfram Web Resource. http://mathworld.wolfram.com/VectorNorm.html

double Blas_Norm1 ( const LaVectorDouble dx  ) 

1-Norm

Returns the sum of the absolute values: $|x|_1=\sum_i|x_i|$

See also:
Eric W. Weisstein. "Vector Norm." From MathWorld--A Wolfram Web Resource. http://mathworld.wolfram.com/VectorNorm.html

double Blas_Norm2 ( const LaVectorDouble dx  ) 

2-Norm, Euclidean Norm

Returns the euclidean norm of the vector: $|x|_2=\sqrt{\sum_i|x_i|^2}$

In other notation sqrt(conj(x')*x) or in Matlab notation sqrt(x'*x)

See also:
Eric W. Weisstein. "Vector Norm." From MathWorld--A Wolfram Web Resource. http://mathworld.wolfram.com/VectorNorm.html

int Blas_Index_Max ( const LaVectorDouble dx  ) 

Returns the index of largest absolute value; i such that |x[i]| == max(|x[0]|,|x[1]|,...)

double Blas_Norm_Inf ( const LaVectorDouble x  )  [inline]

Infinity-Norm.

Returns the Infinity norm of a vector, which is the absolute value of its maximum element: $|x|_{\infty}=\max_i|x_i|$

See also:
Eric W. Weisstein. "Vector Norm." From MathWorld--A Wolfram Web Resource. http://mathworld.wolfram.com/VectorNorm.html


Generated on Sat Jul 14 11:40:36 2007 for Lapack++ by  doxygen 1.5.0