Assignments
Assignments
|
#include <stdio.h>
#include <memory.h>
#include <malloc.h>
#include <math.h>
Macros | |
#define | MIN(A, B) (((A)<(B)) ? (A):(B)) |
#define | MAX(A, B) (((A)>(B)) ? (A):(B)) |
#define | ALLOC2D(m, n) (REAL *) malloc((unsigned)(m)*(n)*sizeof(REAL)) |
#define | ALLOC1D(n) (REAL *) malloc((unsigned)(n)*sizeof(REAL)) |
#define | FREE(p) free((char*)(p)) |
#define | CLEAR2D(a, m, n) (void) memset((char*)(a),0,(m)*(n)*sizeof(REAL)) |
#define | COPY2D(d, m, n, s) (void) memcpy((char*)(d),(char*)(s),(int)((m)*(n)*sizeof(REAL))) |
#define | REF2D(a, m, n, i, j) (a[(n)*(i)+(j)]) |
Functions | |
template<class REAL > | |
REAL | fhypot (REAL a, REAL b) |
template<class REAL > | |
void | householder_zero_col (REAL *a, REAL *u, int i, int j, int m, int n, REAL *hv) |
template<class REAL > | |
void | householder_zero_row (REAL *a, REAL *v, int i, int j, int m, int n, REAL *hv) |
template<class REAL > | |
void | rotate_cols (int i, int j, REAL cos, REAL sin, REAL *a, int start, int n, int mm, int nn) |
template<class REAL > | |
void | rotate_rows (int i, int j, REAL cos, REAL sin, REAL *a, int start, int n, int mm, int nn) |
template<class REAL > | |
void | clr_top_supdiag_elt (REAL *b, int p, int z, REAL *u, int m, int n, int min) |
template<class REAL > | |
void | clr_bot_supdiag_elt (REAL *b, int p, int z, REAL *v, int m, int n, int min) |
template<class REAL > | |
void | clr_top_subdiag_elt (REAL *b, int p, int z, REAL *u, REAL *v, int m, int n, int min) |
template<class REAL > | |
void | golub_kahn_svd_rot (REAL *b, int p, int q, REAL *v, int m, int n, int min) |
template<class REAL > | |
void | bidiagonalize (const REAL *a, int m, int n, REAL *u, REAL *b, REAL *v) |
template<class REAL > | |
void | bidiagonal_svd (REAL *b, int m, int n, REAL *u, REAL *v) |
template<class REAL > | |
void | num_svd (const REAL *a, int m, int n, REAL *u, REAL *w, REAL *vt) |
template<class REAL > | |
void | num_svd_backsubst (int m, int n, const REAL *u, const REAL *w, const REAL *vt, const REAL b[], REAL x[], REAL eps) |
#define ALLOC1D | ( | n | ) | (REAL *) malloc((unsigned)(n)*sizeof(REAL)) |
#define ALLOC2D | ( | m, | |
n | |||
) | (REAL *) malloc((unsigned)(m)*(n)*sizeof(REAL)) |
#define CLEAR2D | ( | a, | |
m, | |||
n | |||
) | (void) memset((char*)(a),0,(m)*(n)*sizeof(REAL)) |
#define COPY2D | ( | d, | |
m, | |||
n, | |||
s | |||
) | (void) memcpy((char*)(d),(char*)(s),(int)((m)*(n)*sizeof(REAL))) |
#define FREE | ( | p | ) | free((char*)(p)) |
#define MAX | ( | A, | |
B | |||
) | (((A)>(B)) ? (A):(B)) |
#define MIN | ( | A, | |
B | |||
) | (((A)<(B)) ? (A):(B)) |
#define REF2D | ( | a, | |
m, | |||
n, | |||
i, | |||
j | |||
) | (a[(n)*(i)+(j)]) |
void bidiagonal_svd | ( | REAL * | b, |
int | m, | ||
int | n, | ||
REAL * | u, | ||
REAL * | v | ||
) |
if (iter>=30)
void bidiagonalize | ( | const REAL * | a, |
int | m, | ||
int | n, | ||
REAL * | u, | ||
REAL * | b, | ||
REAL * | v | ||
) |
void clr_bot_supdiag_elt | ( | REAL * | b, |
int | p, | ||
int | z, | ||
REAL * | v, | ||
int | m, | ||
int | n, | ||
int | min | ||
) |
void clr_top_subdiag_elt | ( | REAL * | b, |
int | p, | ||
int | z, | ||
REAL * | u, | ||
REAL * | v, | ||
int | m, | ||
int | n, | ||
int | min | ||
) |
void clr_top_supdiag_elt | ( | REAL * | b, |
int | p, | ||
int | z, | ||
REAL * | u, | ||
int | m, | ||
int | n, | ||
int | min | ||
) |
REAL fhypot | ( | REAL | a, |
REAL | b | ||
) |
void golub_kahn_svd_rot | ( | REAL * | b, |
int | p, | ||
int | q, | ||
REAL * | v, | ||
int | m, | ||
int | n, | ||
int | min | ||
) |
void householder_zero_col | ( | REAL * | a, |
REAL * | u, | ||
int | i, | ||
int | j, | ||
int | m, | ||
int | n, | ||
REAL * | hv | ||
) |
void householder_zero_row | ( | REAL * | a, |
REAL * | v, | ||
int | i, | ||
int | j, | ||
int | m, | ||
int | n, | ||
REAL * | hv | ||
) |
void num_svd | ( | const REAL * | a, |
int | m, | ||
int | n, | ||
REAL * | u, | ||
REAL * | w, | ||
REAL * | vt | ||
) |
void num_svd_backsubst | ( | int | m, |
int | n, | ||
const REAL * | u, | ||
const REAL * | w, | ||
const REAL * | vt, | ||
const REAL | b[], | ||
REAL | x[], | ||
REAL | eps | ||
) |
void rotate_cols | ( | int | i, |
int | j, | ||
REAL | cos, | ||
REAL | sin, | ||
REAL * | a, | ||
int | start, | ||
int | n, | ||
int | mm, | ||
int | nn | ||
) |
void rotate_rows | ( | int | i, |
int | j, | ||
REAL | cos, | ||
REAL | sin, | ||
REAL * | a, | ||
int | start, | ||
int | n, | ||
int | mm, | ||
int | nn | ||
) |