Meta Matrix Library
Home About FAQ Install Documentation To Do Download Related Links


Tutorial   Modules   Alphabetical List   Data Structures   File List   Data Fields   Globals   Related Pages (e.g. ToDo)  

meml.h File Reference

#include <math.h>
#include "sdml.h"
#include "ssml.h"
#include "crfl.h"
#include "cmfl.h"

Defines

#define MEML_TRUE   1
#define MEML_FALSE   0

Enumerations

enum  M_TYPE { ND, BD, LS, CS }

Functions

INLINE VECTORmeml_vector_new (const MEML_INT lenght)
VECTORmeml_vector_new_eye (const MEML_INT dim, const MEML_INT position)
VECTORmeml_vector_new_zeros (const MEML_INT dim)
VECTORmeml_vector_new_ones (const MEML_INT dim)
 v:= [1, 1, ... ,1]'
VECTORmeml_vector_new_diag (const ME_MATRIX *M)
INLINE void meml_vector_free (VECTOR *v)
ME_MATRIXmeml_matrix_new (const M_TYPE type, const MEML_INT row, const MEML_INT col)
ME_MATRIXmeml_matrix_new_diag (const M_TYPE type, const VECTOR *v)
ME_MATRIXmeml_matrix_new_eye (const M_TYPE type, const MEML_INT row, const MEML_INT col)
ME_MATRIXmeml_matrix_new_zeros (const M_TYPE type, const MEML_INT row, const MEML_INT col)
ME_MATRIXmeml_matrix_new_ones (const M_TYPE type, const MEML_INT row, const MEML_INT col)
ME_MATRIXmeml_sparse (const INDEXARRAY *rows, const INDEXARRAY *cols, const VECTOR *values)
 creates a new sparse matrix
ME_MATRIXmeml_matrix_new_form_carray (const M_TYPE type, const MEML_INT row, const MEML_INT col, const MEML_FLOAT data[])
 The function creates a new matrix based on a C-array.
void meml_matrix_free (ME_MATRIX *A)
INDEXARRAYmeml_indexarray_new (const MEML_INT dim)
INDEXARRAYmeml_indexarray_copy (const INDEXARRAY *index)
INLINE void meml_indexarray_free (INDEXARRAY *indexarray)
void meml_matrix_ceil (ME_MATRIX *M)
ME_MATRIXmeml_matrix_convert (const M_TYPE type, const ME_MATRIX *A)
 B := A.
void meml_matrix_erase (ME_MATRIX *M, const MEML_FLOAT border)
MEML_FLOAT meml_matrix_element_get (const ME_MATRIX *A, const MEML_INT x, const MEML_INT y)
 alpha := A(x,y)
MEML_FLOAT meml_matrix_element_get_f (const ME_MATRIX *A, const MEML_INT x, const MEML_INT y)
void meml_matrix_element_set (ME_MATRIX *A, const MEML_INT x, const MEML_INT y, MEML_FLOAT value)
 A(x,y) := value.
void meml_matrix_element_set_f (ME_MATRIX *A, const MEML_INT x, const MEML_INT y, const MEML_FLOAT value)
void meml_matrix_element_add (ME_MATRIX *A, const MEML_INT x, const MEML_INT y, const MEML_FLOAT value)
 A(x,y) := A(x,y) + value.
void meml_matrix_element_add_f (ME_MATRIX *A, const MEML_INT x, const MEML_INT y, const MEML_FLOAT value)
 A(x,y) := A(x,y) + value.
void meml_matrix_element_mul (ME_MATRIX *A, const MEML_INT x, const MEML_INT y, const MEML_FLOAT alpha)
 A(x,y) := A(x,y) * alpha.
void meml_matrix_element_mul_f (ME_MATRIX *A, MEML_INT x, MEML_INT y, MEML_FLOAT alpha)
 A(x,y) := A(x,y) * alpha.
void meml_matrix_set_row_2_unit_vector (ME_MATRIX *M, const MEML_INT row)
void meml_matrix_set_col_2_unit_vector (ME_MATRIX *M, const MEML_INT col)
VECTORmeml_matrix_row_get (const ME_MATRIX *M, const MEML_INT row)
 $ v := M(row , :) $
void meml_matrix_row_get_f (const ME_MATRIX *M, VECTOR *v, const MEML_INT row)
 $ v := M(row , :) $
VECTORmeml_matrix_col_get (const ME_MATRIX *M, const MEML_INT col)
 $ v := M(: , col) $
void meml_matrix_col_get_f (const ME_MATRIX *M, VECTOR *v, const MEML_INT col)
 $ v := M(: , col) $
void meml_matrix_resize (ME_MATRIX **M, MEML_INT row, MEML_INT col)
ME_MATRIXmeml_matrix_copy (const ME_MATRIX *A)
int meml_matrix_part_copy_f (const ME_MATRIX *M, const MEML_INT xm1, const MEML_INT ym1, const MEML_INT xm2, const MEML_INT ym2, ME_MATRIX *D, const MEML_INT xd1, const MEML_INT yd1)
 $ D(xd1 : xd1+(xm2-xm1),yd1 : yd1+(ym2-ym1) ) := M(xm1:xm2 , ym1:ym2) $
int meml_matrix_col_set (ME_MATRIX *M, const VECTOR *v, const MEML_INT col)
 $ M(:,col) := v $
int meml_matrix_row_set (ME_MATRIX *M, const VECTOR *v, const MEML_INT row)
 $ M(row,;) := v $
void meml_matrix_clear (ME_MATRIX *M)
 $ M :=0 $
VECTORmeml_vector_scaling (const MEML_FLOAT alpha, const VECTOR *x)
 $ y := \alpha x $
void meml_vector_clear (VECTOR *x)
 $ x :=0 $
INDEXARRAYmeml_vector_part_sort (VECTOR *v, MEML_INT from, MEML_INT till)
 sorts a part of the vector v; v[from:till] ; ascending
INDEXARRAYmeml_vector_sort (VECTOR *v)
 sorts a vector v ascending
int meml_indexarray_element_set (INDEXARRAY *indexarray, const MEML_INT x, const MEML_INT value)
 indexarray[x] := value
MEML_INT meml_indexarray_element_max (const INDEXARRAY *indexarray)
INDEXARRAYmeml_indexarray_part_sort (INDEXARRAY *a, MEML_INT from, MEML_INT till)
 sorts a part of the indexarray a; a[from:till] ; ascending
void meml_vector_abs_f (VECTOR *a)
 $ a := abs( a ) $
VECTORmeml_vector_abs (const VECTOR *a)
 $ b := abs( a ) $
MEML_FLOAT meml_vector_element_max (const VECTOR *a)
 $ \alpha := \max a $
MEML_FLOAT meml_vector_element_max_f (const VECTOR *a, MEML_INT *which)
 $ \alpha := \max a := a[which] $
VECTORmeml_vector_min (const VECTOR *x, const VECTOR *y)
 $ z := x - y$
void meml_vector_min_f (const VECTOR *x, VECTOR *y)
 $ y := - x + y = y - x$
VECTORmeml_vector_multiadd (const MEML_FLOAT *alpha, const VECTOR **x, MEML_INT n)
 $ y := \sum_{i=0}^{n-1} \alpha_i x_i $
VECTORmeml_vector_add (const VECTOR *x, const VECTOR *y)
 $ y := x + y$
MEML_FLOAT meml_vector_norm (const VECTOR *x)
 $ \alpha := \|x\|_{2} $
MEML_FLOAT meml_vector_norm_max (const VECTOR *x)
 $ \alpha := \|x\|_{max} $
int meml_vector_equal (const VECTOR *x, const VECTOR *y)
 returns 1 if x=y and 0 if x $ \not= $ y
ME_MATRIXmeml_matrix_scaling (const MEML_FLOAT alpha, const ME_MATRIX *M)
 $ B := alpha * A $
void meml_matrix_scaling_f (const MEML_FLOAT alpha, ME_MATRIX *M)
 $ A := alpha * A $
MEML_FLOAT meml_matrix_norm (const ME_MATRIX *M)
 $ \alpha := \|A\|_2 $
MEML_FLOAT meml_matrix_norm_inf (const ME_MATRIX *M)
 $ \alpha := \|A\|_{inf} $
MEML_FLOAT meml_matrix_norm_1 (const ME_MATRIX *M)
 $ \alpha := \|A\|_{1} $
MEML_FLOAT meml_matrix_norm_frobenius (const ME_MATRIX *M)
 $ \alpha := \|A\|_{fro} = \sqrt{\sum_{i=1}^m \sum_{j=1}^m a_{ij}^2}$
void meml_matrix_rank_one_update_f (const MEML_FLOAT alpha, const VECTOR *x, const VECTOR *y, ME_MATRIX *M)
 $ A := \alpha xy^T + A $
ME_MATRIXmeml_matrix_rank_one_update (const MEML_FLOAT alpha, const VECTOR *x, const VECTOR *y, const ME_MATRIX *M)
 $ B := \alpha xy^T + A $
ME_MATRIXmeml_matrix_mul (const ME_MATRIX *A, const ME_MATRIX *B)
 $ C := A * B $
void meml_matrix_mul_f (const ME_MATRIX *A, const ME_MATRIX *B, ME_MATRIX **C)
 $ C := A * B $
void meml_matrix_mul_ff (const MEML_FLOAT alpha, const ME_MATRIX *A, const ME_MATRIX *B, const MEML_FLOAT beta, ME_MATRIX **C)
 $ C := alpha A * B + beta C $
ME_MATRIXmeml_matrix_add (const ME_MATRIX *A, const ME_MATRIX *B)
 $ C := A + B $
void meml_matrix_add_f (const ME_MATRIX *A, ME_MATRIX *B)
 $ B := A + B $
ME_MATRIXmeml_matrix_trans (ME_MATRIX *M)
 A : = M'.
void meml_matrix_trans_f (ME_MATRIX **M)
 M : = M'.
int meml_matrix_qr (const ME_MATRIX *M, ME_MATRIX **Q, ME_MATRIX **R)
 QR = M.
ME_MATRIXmeml_matrix_eig_f (const ME_MATRIX *M, VECTOR *wr, VECTOR *wi)
void meml_matrix_eig (const ME_MATRIX *M, VECTOR *wr, VECTOR *wi)
VECTORmeml_matrix_svd (const ME_MATRIX *A)
int meml_matrix_svd_f (const ME_MATRIX *A, VECTOR *s)
MEML_INT meml_matrix_rank (const ME_MATRIX *M)
 rank of a matrix
ME_MATRIXmeml_matrix_lu (const ME_MATRIX *M, ME_MATRIX *L, ME_MATRIX *U)
 M = P * L * U.
int meml_matrix_equal (const ME_MATRIX *A, const ME_MATRIX *B)
 returns 1 if A=B and 0 if A $ \not= $ B
void meml_matrix_vector_mul_ff (const ME_MATRIX *M, VECTOR *y)
 $ y := M*y $
void meml_matrix_vector_mul_f (const ME_MATRIX *matrix, const VECTOR *vector, VECTOR *result)
 result := matrix*vector
VECTORmeml_matrix_vector_mul (const ME_MATRIX *matrix, const VECTOR *vector)
 result := matrix * vector
void meml_matrix_t_vector_mul_f (const ME_MATRIX *matrix, const VECTOR *vector, VECTOR *result)
VECTORmeml_matrix_t_vector_mul (const ME_MATRIX *matrix, const VECTOR *vector)
void meml_matrix_print (const ME_MATRIX *M)
void meml_vector_print (const VECTOR *x)
int meml_vector_export2dat (const char dateiname[], const int number_of_vectors,...)
int meml_vector_import_from_dat (const char filename[], const int number_of_vectors,...)
ME_MATRIXmeml_matrix_import_from_dat (const M_TYPE type, const MEML_INT row, const MEML_INT col, const char filename[])
void meml_init (MEML_FLOAT eps, char plot, char verbose)
void meml_matrix_property_get (const ME_MATRIX *A, MEML_INT *row, MEML_INT *col, M_TYPE *type)
void meml_int_qsort (MEML_INT *a, MEML_INT *wohin, MEML_INT l, MEML_INT r)
void meml_float_qsort (MEML_FLOAT *a, MEML_INT *wohin, MEML_INT l, MEML_INT r)
void meml_indexarray_print (const INDEXARRAY *a)
INLINE MEML_FLOAT meml_vector_element_get (const VECTOR *x, const MEML_INT i)
 alpha := x[i]
INLINE MEML_FLOAT meml_vector_element_get_f (const VECTOR *x, const MEML_INT i)
 alpha := x[i]
INLINE int meml_vector_element_set (VECTOR *x, const MEML_INT i, const MEML_FLOAT value)
 x[i] := value
INLINE void meml_vector_element_set_f (VECTOR *x, const MEML_INT i, const MEML_FLOAT value)
 x[i] := value
INLINE int meml_vector_element_add (VECTOR *x, const MEML_INT i, const MEML_FLOAT value)
 x[i] := x[i] + value
INLINE void meml_vector_element_add_f (VECTOR *x, const MEML_INT i, const MEML_FLOAT value)
 x[i] := x[i] + value
INLINE INDEXARRAYmeml_indexarray_sort (INDEXARRAY *a)
 sorts an indexarray a ascending
INLINE void meml_indexarray_element_set_f (INDEXARRAY *indexarray, const MEML_INT x, const MEML_INT value)
 indexarray[x] := value
INLINE MEML_INT meml_indexarray_element_get_f (const INDEXARRAY *indexarray, const MEML_INT x)
 return : = indexarray[x]
INLINE MEML_INT meml_indexarray_element_get (const INDEXARRAY *indexarray, const MEML_INT x)
 return : = indexarray[x]
INLINE MEML_INT meml_element_of_indexarray (const INDEXARRAY *indexarray, MEML_INT a)
 returns MEML_TRUE if a is an element of the indexarray and MEML_FALSE if it is not.
INLINE MEML_FLOAT meml_vector_scalarproduct (const VECTOR *a, const VECTOR *b)
 $ \alpha := a \cdot b $
INLINE MEML_FLOAT meml_vector_scalarproduct_f (const VECTOR *a, const VECTOR *b)
 $ \alpha := a \cdot b $
INLINE void meml_vector_copy_f (const VECTOR *x, VECTOR *y)
 $ y := x $
INLINE VECTORmeml_vector_copy (const VECTOR *x)
 $ y := x $
INLINE void meml_vector_scaling_f (const MEML_FLOAT alpha, VECTOR *x)
 $ x := \alpha x $
INLINE void meml_vector_add_ff (const MEML_FLOAT alpha, const VECTOR *x, VECTOR *y)
 $ y := \alpha x + y$
INLINE void meml_vector_add_f (const VECTOR *x, VECTOR *y)
 $ y := x + y $
INLINE MEML_FLOAT meml_matrix_norm_2 (const ME_MATRIX *M)
 $ \alpha := \|A\|_2 $
INLINE int meml_vector_export2csv (const VECTOR *x, const char dateiname[])
INLINE MEML_FLOAT meml_max (const MEML_FLOAT a, const MEML_FLOAT b)
INLINE MEML_FLOAT meml_min (const MEML_FLOAT a, const MEML_FLOAT b)
INLINE int meml_equal (const MEML_FLOAT a, const MEML_FLOAT b)

Variables

double MEML_EPS
int MEML_VERBOSE
char MEML_PLOT

Define Documentation

#define MEML_FALSE   0
 

#define MEML_TRUE   1
 


Enumeration Type Documentation

enum M_TYPE
 

Enumeration values:
ND 
BD 
LS 
CS 


Function Documentation

INLINE MEML_INT meml_element_of_indexarray const INDEXARRAY indexarray,
MEML_INT  a
 

returns MEML_TRUE if a is an element of the indexarray and MEML_FALSE if it is not.

INLINE int meml_equal const MEML_FLOAT  a,
const MEML_FLOAT  b
 

a = b <=> |a-b| < MEML_EPS

INLINE MEML_INT meml_indexarray_element_get const INDEXARRAY indexarray,
const MEML_INT  x
 

return : = indexarray[x]

INLINE MEML_INT meml_indexarray_element_get_f const INDEXARRAY indexarray,
const MEML_INT  x
 

return : = indexarray[x]

INLINE void meml_indexarray_element_set_f INDEXARRAY indexarray,
const MEML_INT  x,
const MEML_INT  value
 

indexarray[x] := value

INLINE INDEXARRAY* meml_indexarray_sort INDEXARRAY a  ) 
 

sorts an indexarray a ascending

The INDEXARRAY which the function returns shows where the single element has been moved.

e.g. a = [ 4 2 1 3]

after calling meml_indexarray_sort it will look like this:

a = [1 2 3 4] ; INDEXARRAY = [ 3 1 0 2]

so you see, a[0] has been moved to a[3] etc.

INLINE MEML_FLOAT meml_matrix_norm_2 const ME_MATRIX M  ) 
 

$ \alpha := \|A\|_2 $

INLINE MEML_FLOAT meml_max const MEML_FLOAT  a,
const MEML_FLOAT  b
 

c : = max(a,b)

INLINE MEML_FLOAT meml_min const MEML_FLOAT  a,
const MEML_FLOAT  b
 

c : = min(a,b)

INLINE void meml_vector_add_f const VECTOR x,
VECTOR y
 

$ y := x + y $

INLINE void meml_vector_add_ff const MEML_FLOAT  alpha,
const VECTOR x,
VECTOR y
 

$ y := \alpha x + y$

INLINE VECTOR* meml_vector_copy const VECTOR x  ) 
 

$ y := x $

INLINE void meml_vector_copy_f const VECTOR x,
VECTOR y
 

$ y := x $

INLINE int meml_vector_export2csv const VECTOR x,
const char  dateiname[]
 

saves the vector x in a csv-file

INLINE MEML_FLOAT meml_vector_scalarproduct const VECTOR a,
const VECTOR b
 

$ \alpha := a \cdot b $

INLINE MEML_FLOAT meml_vector_scalarproduct_f const VECTOR a,
const VECTOR b
 

$ \alpha := a \cdot b $

INLINE void meml_vector_scaling_f const MEML_FLOAT  alpha,
VECTOR x
 

$ x := \alpha x $


Variable Documentation

double MEML_EPS
 

char MEML_PLOT
 

int MEML_VERBOSE
 


Generated on Tue Mar 28 14:10:38 2006 by  doxygen 1.4.1