NnmfPack  2.1
Functions
utils_x86.c File Reference

Some auxiliar functions. Double and simple precision for CPU and MIC. More...

Go to the source code of this file.

Functions

void dmemset_x86 (const int n, double *__restrict__ x, const double val)
 This function fills all positions of x with val. More...
 
void smemset_x86 (const int n, float *__restrict__ x, const float val)
 This function fills all positions of x with val. More...
 
void ddiv_x86 (const int n, const double *x, double *__restrict__ y)
 This function calls the appropiate funtions to performs double precision element-wise y[i]=x[i]/y[i] for all positions of x and y. More...
 
void sdiv_x86 (const int n, const float *x, float *__restrict__ y)
 This function calls the appropiate funtions to performs simple precision element-wise x[i]=x[i]/y[i] for all positions of x and y. More...
 
void dsub_x86 (const int n, const double *x, double *__restrict__ y)
 This function performs double precision element-wise substraction y[i]=x[i]-y[i]. More...
 
void ssub_x86 (const int n, const float *x, float *__restrict__ y)
 This function performs simple precision element-wise substraction y[i]=x[i]-y[i]. More...
 
void dlarngenn_x86 (const int m, const int n, const int seed, double *X)
 dlarngenn_x86 returns an (m x n) random double precision matrix. An uniform (0, 1) distribution is used to generate the values More...
 
void slarngenn_x86 (const int m, const int n, const int seed, float *X)
 slarngenn_x86 returns an (m x n) random simple precision matrix. An uniform (0, 1) distribution is used to generate the values More...
 
double derror_x86 (const int m, const int n, const int k, const double *A, const double *W, const double *H)
 derror_x86 returns double precision "2norm(A - WH) / sqrt(m x n)" More...
 
float serror_x86 (const int m, const int n, const int k, const float *A, const float *W, const float *H)
 serror_x86 returns simple precision "2norm(A - WH) / sqrt(m x n)" More...
 

Detailed Description

Some auxiliar functions. Double and simple precision for CPU and MIC.

Author
Information Retrieval and Parallel Computing Group (IRPCG)
University of Oviedo, Spain
Interdisciplinary Computation and Communication Group (INCO2)
Universitat Politecnica de Valencia, Spain.
Contact: nnmfp.nosp@m.ack@.nosp@m.gmail.nosp@m..com
Date
04/11/14

Definition in file utils_x86.c.

Function Documentation

◆ ddiv_x86()

void ddiv_x86 ( const int  n,
const double *  x,
double *__restrict__  y 
)

This function calls the appropiate funtions to performs double precision element-wise y[i]=x[i]/y[i] for all positions of x and y.

Parameters
n(input) Number of elements of x and y
x(input) Double precision input vector/matrix (1D column-major)
y(inout) Double precision input/output vector/ matrix (1D column-major)

Definition at line 91 of file utils_x86.c.

◆ derror_x86()

double derror_x86 ( const int  m,
const int  n,
const int  k,
const double *  A,
const double *  W,
const double *  H 
)

derror_x86 returns double precision "2norm(A - WH) / sqrt(m x n)"

Parameters
m(input) Number of rows of matrix A and number of rows of W
n(input) Number of columns of matrix A and number of columns of H
k(input) Number of columns of matrix W and number of rows of H
A(input) Double precision matrix, dimension (m x n), 1D layout column major
W(input) Double precision matrix, dimension (m x k), 1D layout column major
H(input) Double precision matrix, dimension (k x n), 1D layout column major

Definition at line 283 of file utils_x86.c.

◆ dlarngenn_x86()

void dlarngenn_x86 ( const int  m,
const int  n,
const int  seed,
double *  X 
)

dlarngenn_x86 returns an (m x n) random double precision matrix. An uniform (0, 1) distribution is used to generate the values

Parameters
m(input) Number of rows of matrix X
n(input) Number of columns of matrix X
seed(input) Initial seed for the random numbers
X(output) Double precision matrix (1D column major)

Definition at line 220 of file utils_x86.c.

◆ dmemset_x86()

void dmemset_x86 ( const int  n,
double *__restrict__  x,
const double  val 
)

This function fills all positions of x with val.

Parameters
n(input) Number of elements of x
x(output) Double precision output matrix (1D column-major) or vector
val(input) Double precision value

Definition at line 42 of file utils_x86.c.

◆ dsub_x86()

void dsub_x86 ( const int  n,
const double *  x,
double *__restrict__  y 
)

This function performs double precision element-wise substraction y[i]=x[i]-y[i].

Parameters
n(input) Number of elements of x and y
x(input) Double precision input vector/matrix (1D column-major)
y(inout) Double precision input/output vector/matrix (1D column-major)

Definition at line 162 of file utils_x86.c.

◆ sdiv_x86()

void sdiv_x86 ( const int  n,
const float *  x,
float *__restrict__  y 
)

This function calls the appropiate funtions to performs simple precision element-wise x[i]=x[i]/y[i] for all positions of x and y.

Parameters
n(input) Number of elements of x and y
x(input) Simple precision input vector/matrix (1D column-major)
y(inout) Simple precision input/output vector/ matrix (1D column-major)

Definition at line 127 of file utils_x86.c.

◆ serror_x86()

float serror_x86 ( const int  m,
const int  n,
const int  k,
const float *  A,
const float *  W,
const float *  H 
)

serror_x86 returns simple precision "2norm(A - WH) / sqrt(m x n)"

Parameters
m(input) Number of rows of matrix A and number of rows of W
n(input) Number of columns of matrix A and number of columns of H
k(input) Number of columns of matrix W and number of rows of H
A(input) Simple precision matrix, dimension (m x n), 1D layout column major
W(input) Simple precision matrix, dimension (m x k), 1D layout column major
H(input) Simple precision matrix, dimension (k x n), 1D layout column major

Definition at line 329 of file utils_x86.c.

◆ slarngenn_x86()

void slarngenn_x86 ( const int  m,
const int  n,
const int  seed,
float *  X 
)

slarngenn_x86 returns an (m x n) random simple precision matrix. An uniform (0, 1) distribution is used to generate the values

Parameters
m(input) Number of rows of matrix X
n(input) Number of columns of matrix X
seed(input) Initial seed for the random numbers
X(output) Simple precision matrix (1D column major)

Definition at line 251 of file utils_x86.c.

◆ smemset_x86()

void smemset_x86 ( const int  n,
float *__restrict__  x,
const float  val 
)

This function fills all positions of x with val.

Parameters
n(input) Number of elements of x
x(output) Simple precision output matrix (1D column-major) or vector
val(input) Simple precision value

Definition at line 66 of file utils_x86.c.

◆ ssub_x86()

void ssub_x86 ( const int  n,
const float *  x,
float *__restrict__  y 
)

This function performs simple precision element-wise substraction y[i]=x[i]-y[i].

Parameters
n(input) Number of elements of x and y
x(input) Simple precision input vector/matrix (1D column-major)
y(inout) Simple precision input/output vector/matrix (1D column-major)

Definition at line 190 of file utils_x86.c.