NnmfPack
2.1
|
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... | |
Some auxiliar functions. Double and simple precision for CPU and MIC.
Definition in file utils_x86.c.
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.
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.
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)"
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.
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
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.
void dmemset_x86 | ( | const int | n, |
double *__restrict__ | x, | ||
const double | val | ||
) |
This function fills all positions of x with val.
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.
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].
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.
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.
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.
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)"
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.
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
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.
void smemset_x86 | ( | const int | n, |
float *__restrict__ | x, | ||
const float | val | ||
) |
This function fills all positions of x with val.
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.
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].
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.