12 #ifndef __DENSEMAT_HEADER__
13 #define __DENSEMAT_HEADER__
28 void dscal_(
const int* n,
const double* alpha,
double* x,
const int* incx);
31 double ddot_(
const int* n,
double* a,
const int* inca,
double* b,
const int* incb);
35 const int* n,
const double* src,
const int* incx,
double* dst,
const int* incy);
46 double dnrm2_(
const int* n,
double* x,
const int* incx);
49 double dasum_(
const int* n,
double* x,
const int* incx);
52 int idamax_(
const int* n,
double* x,
const int* incx);
110 void CalEigenSY(
const int& N,
float* A,
float* w,
float* work,
const int& lwork);
116 void Dcopy(
const int& N,
double* dst,
const double* src);
119 double Ddot(
int n,
double* a,
double* b);
122 double Dnorm1(
const int& N,
double* x);
125 double Dnorm2(
const int& N,
double* x);
128 void Dscalar(
const int& n,
const double& alpha,
double* x);
131 void Daxpy(
const int& n,
const double& alpha,
const double* x,
double* y);
144 void myDABpC(
const int& m,
150 void myDABpCp(
const int& m,
158 void myDABpCp1(
const int& m,
166 void myDABpCp2(
const int& m,
185 void LUSolve(
const int& nrhs,
const int& N,
double* A,
double* b,
int* pivot);
198 template <
typename T>
201 for (
int i = 0; i < N; i++) {
202 cout << i <<
" " << setprecision(16) << x[i] << endl;
208 template <
typename T>
211 for (
int i = 0; i < N; i++) {
212 if (!isfinite(x[i])) {
double dasum_(const int *n, double *x, const int *incx)
Computes the sum of the absolute values of a vector.
int idamax_(const int *n, double *x, const int *incx)
Finds the index of element having max absolute value.
int dsysv_(const char *uplo, const int *n, const int *nrhs, double *A, const int *lda, int *ipiv, double *b, const int *ldb, double *work, const int *lwork, int *info)
Computes the solution to system of linear equations A * X = B for symm matrices.
int dgesv_(const int *n, const int *nrhs, double *A, const int *lda, int *ipiv, double *b, const int *ldb, int *info)
Computes the solution to system of linear equations A * X = B for general matrices.
double Ddot(int n, double *a, double *b)
Dot product of two double vectors stored as pointers.
void DaABpbC(const int &m, const int &n, const int &k, const double &alpha, const double *A, const double *B, const double &beta, double *C)
Computes C' = alpha B'A' + beta C', all matrices are column-major.
int ssyevd_(char *jobz, char *uplo, const int *n, float *A, const int *lda, float *w, float *work, const int *lwork, int *iwork, const int *liwork, int *info)
int daxpy_(const int *n, const double *alpha, const double *x, const int *incx, double *y, const int *incy)
Constant times a vector plus a vector.
void Dscalar(const int &n, const double &alpha, double *x)
Scales a vector by a constant.
void CalEigenSY(const int &N, float *A, float *w, float *work, const int &lwork)
Calculate the minimal eigenvalue for symmetric matrix with mkl lapack.
void DaAxpby(const int &m, const int &n, const double &a, const double *A, const double *x, const double &b, double *y)
Computes y = a A x + b y.
void LUSolve(const int &nrhs, const int &N, double *A, double *b, int *pivot)
Calls dgesv to solve the linear system for general matrices.
bool CheckNan(const int &N, const T *x)
check NaN
void Daxpy(const int &n, const double &alpha, const double *x, double *y)
Constant times a vector plus a vector.
int dcopy_(const int *n, const double *src, const int *incx, double *dst, const int *incy)
Copies a vector, src, to a vector, dst.
int dgemm_(const char *transa, const char *transb, const int *m, const int *n, const int *k, const double *alpha, const double *A, const int *lda, const double *B, const int *ldb, const double *beta, double *C, const int *ldc)
Performs matrix-matrix operations C : = alpha * op(A) * op(B) + beta * C.
double dnrm2_(const int *n, double *x, const int *incx)
Computes the Euclidean norm of a vector.
void dscal_(const int *n, const double *alpha, double *x, const int *incx)
Scales a vector by a constant.
double Dnorm1(const int &N, double *x)
Computes the L1-norm of a vector.
void PrintDX(const int &N, const T *x)
Prints a vector.
int SYSSolve(const int &nrhs, const char *uplo, const int &N, double *A, double *b, int *pivot, double *work, const int &lwork)
Calls dsysy to solve the linear system for symm matrices.
void Dcopy(const int &N, double *dst, const double *src)
Calculate the minimal eigenvalue for symmetric matrix with mkl lapack.
double ddot_(const int *n, double *a, const int *inca, double *b, const int *incb)
Forms the dot product of two vectors.
double Dnorm2(const int &N, double *x)
Computes the L2-norm of a vector.