matop.hxx File Reference

Basic types, constants and templates for simple linear algebra routines like BLAS level 1. More...

#include <limits.h>
#include <float.h>
#include <assert.h>
#include "gb_rand.hxx"
#include "CBconfig.hxx"

Go to the source code of this file.

Namespaces

namespace  CH_Matrix_Classes

Classes

struct  CH_Matrix_Classes::mat_less_index< Val >
 "less"-routine for sorting indices of value arrays by std::sort More...
class  CH_Matrix_Classes::MatrixError
 Such an object is generated and passed to MEmessage(), whenever an error occurs. It holds some output information on the error. More...
class  CH_Matrix_Classes::MErange
 Such an object is generated and passed to MEmessage() whenever some index is out of range. More...
class  CH_Matrix_Classes::MEmem
 Such an object is generated and passed to MEmessage() whenever a memory allocation fails. More...
class  CH_Matrix_Classes::MEdim
 Such an object is generated and passed to MEmessage() whenever matrix dimensions do not agree for a desired operation. More...

Defines

#define chk_init(x)
 CONICBUNDLE_DEBUG being undefined, the template function is removed. Otherwise it would check, whether x is initialized.
#define chk_add(x, y)
 CONICBUNDLE_DEBUG being undefined, the template function is removed. Otherwise it would check, whether matrices x and y can be added.
#define chk_rowseq(x, y)
 CONICBUNDLE_DEBUG being undefined, the template function is removed. Otherwise it would check, whether matrices x and y have the same row dimension.
#define chk_colseq(x, y)
 CONICBUNDLE_DEBUG being undefined, the template function is removed. Otherwise it would check, whether matrices x and y have the same column dimension.
#define chk_range(i, j, ubi, ubj)
 CONICBUNDLE_DEBUG being undefined, the template function is removed. Otherwise it would check, whether i and j fit into [0,ubi-1] amd [0,ubj-1] respectively.
#define chk_set_init(x, y)
 CONICBUNDLE_DEBUG being undefined, the template function is removed. Otherwise it would allow to set the initialized flag of matrix x to value y.

Typedefs

typedef int CH_Matrix_Classes::Integer
 all integer numbers in calculations and indexing are of this type
typedef double CH_Matrix_Classes::Real
 all real numbers in calculations are of this type

Enumerations

enum  CH_Matrix_Classes::Mtype {
  CH_Matrix_Classes::MTglobalfun, CH_Matrix_Classes::MTindexmatrix, CH_Matrix_Classes::MTmatrix, CH_Matrix_Classes::MTsymmetric,
  CH_Matrix_Classes::MTsparse, CH_Matrix_Classes::MTsparsesym
}
 serves for specifying the source (matrix class or function) of the error More...
enum  CH_Matrix_Classes::MEcode {
  CH_Matrix_Classes::ME_unspec, CH_Matrix_Classes::ME_range, CH_Matrix_Classes::ME_mem, CH_Matrix_Classes::ME_dim,
  CH_Matrix_Classes::ME_num, CH_Matrix_Classes::ME_warning
}
 serves for specifying the error type. More...

Functions

template<class Val>
void CH_Matrix_Classes::mat_xey (Integer len, Val *x, const Val *y)
 Copy an array of length len to destination x from source y.
template<class Val>
void CH_Matrix_Classes::mat_xey (Integer len, Val *x, const Integer incx, const Val *y, const Integer incy)
 Copy an array of length len to destination x (increment incx) from source y (increment incy).
template<class Val>
void CH_Matrix_Classes::mat_xemx (Integer len, Val *x)
 Set x[i]=-x[i] for an array of length len.
template<class Val>
void CH_Matrix_Classes::mat_xemx (Integer len, Val *x, const Integer incx)
 Set x[i]=-x[i] for len elements of an array incremented by incx.
template<class Val>
void CH_Matrix_Classes::mat_xemy (Integer len, Val *x, const Val *y)
 Set x[i]=-y[i] for len elements of the arrays x and y.
template<class Val>
void CH_Matrix_Classes::mat_xemy (Integer len, Val *x, const Integer incx, const Val *y, const Integer incy)
 Set x[i]=-y[i] for len elements of the arrays x and y incremented by incx and incy, respectively.
template<class Val>
void CH_Matrix_Classes::mat_xeya (Integer len, Val *x, const Val *y, Val a)
 Set x[i]=a*y[i] for len elements of the arrays x and y.
template<class Val>
void CH_Matrix_Classes::mat_xeya (Integer len, Val *x, const Integer incx, const Val *y, const Integer incy, Val a)
 Set x[i]=a*y[i] for len elements of the arrays x and y incremented by incx and incy, respectively.
template<class Val>
void CH_Matrix_Classes::mat_xpey (Integer len, Val *x, const Val *y)
 Set x[i]+=y[i] for len elements of the arrays x and y.
template<class Val>
void CH_Matrix_Classes::mat_xpey (Integer len, Val *x, const Integer incx, const Val *y, const Integer incy)
 Set x[i]+=y[i] for len elements of the arrays x and y incremented by incx and incy, respectively.
template<class Val>
void CH_Matrix_Classes::mat_xmey (Integer len, Val *x, const Val *y)
 Set x[i]=-y[i] for len elements of the arrays x and y.
template<class Val>
void CH_Matrix_Classes::mat_xmey (Integer len, Val *x, const Integer incx, const Val *y, const Integer incy)
 Set x[i]=-y[i] for len elements of the arrays x and y incremented by incx and incy, respectively.
template<class Val>
void CH_Matrix_Classes::mat_xhadey (Integer len, Val *x, const Val *y)
 Set x[i]*=y[i] for len elements of the arrays x and y.
template<class Val>
void CH_Matrix_Classes::mat_xinvhadey (Integer len, Val *x, const Val *y)
 Set x[i]/=y[i] for len elements of the arrays x and y, no zero checking!
template<class Val>
void CH_Matrix_Classes::mat_xhadey (Integer len, Val *x, const Integer incx, const Val *y, const Integer incy)
 Set x[i]*=y[i] for len elements of the arrays x and y incremented by incx and incy, respectively.
template<class Val>
void CH_Matrix_Classes::mat_xinvhadey (Integer len, Val *x, const Integer incx, const Val *y, const Integer incy)
 Set x[i]/=y[i] for len elements of the arrays x and y incremented by incx and incy, respectively, no zero checking!
template<class Val>
void CH_Matrix_Classes::mat_xpeya (Integer len, Val *x, const Val *y, Val a)
 Set x[i]+=a*y[i] for len elements of the arrays x and y.
template<class Val>
void CH_Matrix_Classes::mat_xpeya (Integer len, Val *x, const Integer incx, const Val *y, const Integer incy, Val a)
 Set x[i]+=a*y[i] for len elements of the arrays x and y incremented by incx and incy, respectively.
template<class Val>
void CH_Matrix_Classes::mat_xbpeya (Integer len, Val *x, const Val *y, Val a, Val b)
 Set x[i]=a*y[i]+b*x[i] for len elements of the arrays x and y.
template<class Val>
void CH_Matrix_Classes::mat_xbpeya (Integer len, Val *x, const Integer incx, const Val *y, const Integer incy, Val a, Val b)
 Set x[i]=a*y[i]+b*x[i] for len elements of the arrays x and y incremented by incx and incy, respectively.
template<class Val>
void CH_Matrix_Classes::mat_xea (Integer len, Val *x, Val a)
 Set x[i]=a for len elements of the array x.
template<class Val>
void CH_Matrix_Classes::mat_xea (Integer len, Val *x, const Integer incx, Val a)
 Set x[i]=a for len elements of the array x incremented by incx.
template<class Val>
void CH_Matrix_Classes::mat_xpea (Integer len, Val *x, Val a)
 Set x[i]+=a for len elements of the array x.
template<class Val>
void CH_Matrix_Classes::mat_xpea (Integer len, Val *x, const Integer incx, Val a)
 Set x[i]+=a for len elements of the array x incremented by incx.
template<class Val>
void CH_Matrix_Classes::mat_xmultea (Integer len, Val *x, Val a)
 Set x[i]*=a for len elements of the array x.
template<class Val>
void CH_Matrix_Classes::mat_xmultea (Integer len, Val *x, const Integer incx, Val a)
 Set x[i]*=a for len elements of the array x incremented by incx.
template<class Val>
void CH_Matrix_Classes::mat_xdivea (Integer len, Val *x, Val a)
 Set x[i]/=a for len elements of the array x.
template<class Val>
void CH_Matrix_Classes::mat_xdivea (Integer len, Val *x, const Integer incx, Val a)
 Set x[i]/=a for len elements of the array x incremented by incx.
template<class Val>
void CH_Matrix_Classes::mat_xmodea (Integer len, Val *x, Val a)
 Set x[i]=a for len elements of the array x.
template<class Val>
void CH_Matrix_Classes::mat_xmodea (Integer len, Val *x, const Integer incx, Val a)
 Set x[i]=a for len elements of the array x incremented by incx.
template<class Val>
void CH_Matrix_Classes::mat_xeypz (Integer len, Val *x, const Val *y, const Val *z)
 Set x[i]=y[i]+z[i] for len elements of the arrays x, y and z.
template<class Val>
void CH_Matrix_Classes::mat_xeypz (Integer len, Val *x, const Integer incx, const Val *y, const Integer incy, const Val *z, const Integer incz)
 Set x[i]=y[i]+z[i] for len elements of the arrays x, y and z incremented by incx, incy, and incz, respectively.
template<class Val>
void CH_Matrix_Classes::mat_xeymz (Integer len, Val *x, const Val *y, const Val *z)
 Set x[i]=y[i]-z[i] for len elements of the arrays x, y and z.
template<class Val>
void CH_Matrix_Classes::mat_xeymz (Integer len, Val *x, const Integer incx, const Val *y, const Integer incy, const Val *z, const Integer incz)
 Set x[i]=y[i]-z[i] for len elements of the arrays x, y and z incremented by incx, incy, and incz, respectively.
template<class Val>
void CH_Matrix_Classes::mat_xeyapzb (Integer len, Val *x, const Val *y, const Val *z, Val a, Val b)
 Set x[i]=a*y[i]+b*z[i] for len elements of the arrays x, y and z.
template<class Val>
void CH_Matrix_Classes::mat_xeyapzb (Integer len, Val *x, const Integer incx, const Val *y, const Integer incy, const Val *z, const Integer incz, Val a, Val b)
 Set x[i]=a*y[i]+b*z[i] for len elements of the arrays x, y and z incremented by incx, incy, and incz, respectively.
template<class Val>
Val CH_Matrix_Classes::mat_ip (Integer len, const Val *x, const Val *y)
 return sum(x[i]*y[i]) summing over len elements of the arrays x and y.
template<class Val>
Val CH_Matrix_Classes::mat_ip (Integer len, const Val *x, const Integer incx, const Val *y, const Integer incy)
 return sum(x[i]*y[i]) summing over len elements of the arrays x and y incremented by incx and incy, respectively.
template<class Val>
Val CH_Matrix_Classes::mat_ip (Integer len, const Val *x)
 return sum(x[i]*x[i]) summing over len elements of the array x.
template<class Val>
Val CH_Matrix_Classes::mat_ip (Integer len, const Val *x, const Integer incx)
 return sum(x[i]*x[i]) summing over len elements of the array x incremented by incx.
template<class Val>
Val CH_Matrix_Classes::mat_sum (Integer len, const Val *x)
 returns sum(x[i]) over len elements of the array x.
template<class Val>
Val CH_Matrix_Classes::mat_sum (Integer len, const Val *x, const Integer incx)
 returns sum(x[i]) over len elements of the array x incremented by incx.
template<class Val>
void CH_Matrix_Classes::mat_swap (Integer len, Val *x, Val *y)
 swap values x[i] and y[i] for len elements of the arrays x and y.
template<class Val>
void CH_Matrix_Classes::mat_swap (Integer len, Val *x, const Integer incx, Val *y, const Integer incy)
 swap values x[i] and y[i] for len elements of the arrays x and y incremented by incx and incy, respectively.
int CH_Matrix_Classes::MEmessage (const MatrixError &)
 displays an error message and terminates via abort() or returns 1 in case of warnings.
template<class Mat1, class Mat2>
void CH_Matrix_Classes::chk_mult (const Mat1 &, const Mat2 &, int=0, int=0)
 CONICBUNDLE_DEBUG being undefined, the template function is removed. Otherwise it would check, whether matrices x and y can be multiplied.

Variables

const Integer CH_Matrix_Classes::max_Integer = INT_MAX
 maximal attainable value by an Integer
const Integer CH_Matrix_Classes::min_Integer = INT_MIN
 minimal attainable value by an Integer
const Real CH_Matrix_Classes::max_Real = DBL_MAX
 maximal attainable value by a Real
const Real CH_Matrix_Classes::min_Real = -DBL_MAX
 minimal attainable value by a Real
const Real CH_Matrix_Classes::eps_Real = DBL_EPSILON
 machine epsilon for type Real
CH_Tools::GB_rand CH_Matrix_Classes::mat_randgen
 common random number generator used whenever a random matrix is generated.
std::ostream * CH_Matrix_Classes::materrout
 if not zero, this is the output stream for runtime error messages, by default it is set to &std::cout


Detailed Description

Basic types, constants and templates for simple linear algebra routines like BLAS level 1.

Version:
1.0
Date:
2005-03-01
Author:
Christoph Helmberg

Generated on Tue May 3 16:52:53 2011 for ConicBundle by  doxygen 1.5.6