Main Page | Directories | File List | Globals

pmv_ref.c File Reference


Detailed Description

This is a complete implementation of the routines in pmv.h.

It is written in pure C, and requires only on standard library libm, and almost-standard library libgsl.

Definition in file pmv_ref.c.

#include <math.h>
#include <assert.h>
#include <gsl/gsl_complex_math.h>
#include <gsl/gsl_cblas.h>
#include <gsl/gsl_math.h>
#include <gsl/gsl_rng.h>
#include <gsl/gsl_randist.h>
#include "pmv.h"

Go to the source code of this file.

Defines

#define restrict   __restrict__
#define SIGMOID(x)   (1.0 / (1.0 + exp(-(x)) ))

Functions

void pmv_fabs (int size1, int size2, const double *x, int xtda, double *y, int ytda)
 $ b[i,j] \leftarrow | a[i,j] | $
void pmv_axpby_cabs (int size1, int size2, const double a, const complex_t *x, int tdx, const double b, double *y, int tdy)
 $ y[i,j] \leftarrow a | x[i,j] | + b \cdot y[i,j] $
void pmv_clogabs (int size1, int size2, const complex_t *x, int tdx, double *y, int tdy)
 $ y[i,j] \leftarrow log \left( | x[i,j] | \right) $
void pmv_carg (int size1, int size2, const complex_t *x, int xtda, double *y, int ytda)
 $ y[i,j] \leftarrow \arg ( x[i,j] ) $
void pmv_pow (int size1, int size2, const double *x, int xtda, double *y, int ytda, double p)
 $ y[i,j] \leftarrow x[i,j]^{p} $
void pmv_exp (int size1, int size2, const double *x, int xtda, double *y, int ytda)
 $ y[i,j] \leftarrow e^{x[i,j]} $
void pmv_log (int size1, int size2, const double *x, int xtda, double *y, int ytda)
 $ y[i,j] \leftarrow \log(x[i,j]) $
void pmv_sigmoid (int size1, int size2, const double *x, int xtda, double *y, int ytda)
 $ y[i,j] \leftarrow \frac{1}{1 + e^{-x[i,j]}} $
void pmv_softmax (int size1, int size2, const double *x, int xtda, double *y, int ytda)
 $ y[i,j] \leftarrow \frac{e^{x[i,j]}}{\sum_k e^{x[i,k]}} $
void pmv_uniform (int size1, int size2, unsigned long seed, double *y, int ytd)
void pmv_normal (int size1, int size2, unsigned long seed, double *y, int ytd)


Function Documentation

void pmv_axpby_cabs int  size1,
int  size2,
const double  a,
const complex_t x,
int  tdx,
const double  b,
double *  y,
int  tdy
 

$ y[i,j] \leftarrow a | x[i,j] | + b \cdot y[i,j] $

Definition at line 63 of file pmv_ref.c.

void pmv_carg int  size1,
int  size2,
const complex_t x,
int  xtda,
double *  y,
int  ytda
 

$ y[i,j] \leftarrow \arg ( x[i,j] ) $

Definition at line 87 of file pmv_ref.c.

void pmv_clogabs int  size1,
int  size2,
const complex_t x,
int  tdx,
double *  y,
int  tdy
 

$ y[i,j] \leftarrow log \left( | x[i,j] | \right) $

Definition at line 75 of file pmv_ref.c.

void pmv_exp int  size1,
int  size2,
const double *  x,
int  xtda,
double *  y,
int  ytda
 

$ y[i,j] \leftarrow e^{x[i,j]} $

Definition at line 109 of file pmv_ref.c.

void pmv_fabs int  size1,
int  size2,
const double *  x,
int  xtda,
double *  y,
int  ytda
 

$ b[i,j] \leftarrow | a[i,j] | $

Definition at line 52 of file pmv_ref.c.

void pmv_log int  size1,
int  size2,
const double *  x,
int  xtda,
double *  y,
int  ytda
 

$ y[i,j] \leftarrow \log(x[i,j]) $

Definition at line 120 of file pmv_ref.c.

void pmv_pow int  size1,
int  size2,
const double *  x,
int  xtda,
double *  y,
int  ytda,
double  p
 

$ y[i,j] \leftarrow x[i,j]^{p} $

Definition at line 98 of file pmv_ref.c.

void pmv_sigmoid int  size1,
int  size2,
const double *  x,
int  xtda,
double *  y,
int  ytda
 

$ y[i,j] \leftarrow \frac{1}{1 + e^{-x[i,j]}} $

Definition at line 131 of file pmv_ref.c.

References SIGMOID.

void pmv_softmax int  size1,
int  size2,
const double *  x,
int  xtda,
double *  y,
int  ytda
 

$ y[i,j] \leftarrow \frac{e^{x[i,j]}}{\sum_k e^{x[i,k]}} $

Definition at line 142 of file pmv_ref.c.


Generated on Wed Sep 27 13:21:21 2006 for libpmv by  doxygen 1.4.4