189#ifndef LINALG_H_DEFINED
190#define LINALG_H_DEFINED
195#define LA_NO_OPERATION 0
196#define LA_TRANSPOSE 1
197#define LA_HERMITIAN_TRANSPOSE 2
199#define LA_INVALID_INPUT_ERROR 101
200#define LA_ARRAY_SIZE_ERROR 102
201#define LA_SINGULAR_MATRIX_ERROR 103
202#define LA_MATRIX_FORMAT_ERROR 104
203#define LA_OUT_OF_MEMORY_ERROR 105
204#define LA_CONVERGENCE_ERROR 106
205#define LA_INVALID_OPERATION_ERROR 107
231 const double *y,
double *a,
int lda);
253 const double complex *x,
const double complex *y,
double complex *a,
270int la_trace(
int m,
int n,
const double *a,
int lda,
double *rst);
287 double complex *rst);
315int la_mtx_mult(
bool transa,
bool transb,
int m,
int n,
int k,
double alpha,
316 const double *a,
int lda,
const double *b,
int ldb,
double beta,
348 double complex alpha,
const double complex *a,
int lda,
349 const double complex *b,
int ldb,
double complex beta,
double complex *c,
386 double alpha,
const double *a,
const double *b,
int ldb,
double beta,
424 double complex alpha,
const double complex *a,
const double complex *b,
425 int ldb,
double complex beta,
double complex *c,
int ldc);
462 double complex alpha,
const double *a,
const double complex *b,
463 int ldb,
double complex beta,
double complex *c,
int ldc);
483int la_rank(
int m,
int n,
double *a,
int lda,
int *rnk);
503int la_rank_cmplx(
int m,
int n,
double complex *a,
int lda,
int *rnk);
520int la_det(
int n,
double *a,
int lda,
double *d);
537int la_det_cmplx(
int n,
double complex *a,
int lda,
double complex *d);
564int la_tri_mtx_mult(
bool upper,
double alpha,
int n,
const double *a,
int lda,
565 double beta,
double *b,
int ldb);
593 const double complex *a,
int lda,
double complex beta,
594 double complex *b,
int ldb);
615int la_lu_factor(
int m,
int n,
double *a,
int lda,
int *ipvt);
659int la_form_lu(
int n,
double *a,
int lda,
int *ipvt,
double *u,
int ldu,
684 double complex *u,
int ldu,
double *p,
int ldp);
707int la_qr_factor(
int m,
int n,
double *a,
int lda,
double *tau);
731 double complex *tau);
757int la_qr_factor_pvt(
int m,
int n,
double *a,
int lda,
double *tau,
int *jpvt);
784 double complex *tau,
int *jpvt);
812int la_form_qr(
bool fullq,
int m,
int n,
double *r,
int ldr,
const double *tau,
842 const double complex *tau,
double complex *q,
int ldq);
877 const double *tau,
const int *pvt,
double *q,
int ldq,
double *p,
int ldp);
912 const double complex *tau,
const int *pvt,
double complex *q,
int ldq,
913 double complex *p,
int ldp);
944int la_mult_qr(
bool lside,
bool trans,
int m,
int n,
int k,
double *a,
int lda,
945 const double *tau,
double *c,
int ldc);
977 double complex *a,
int lda,
const double complex *tau,
double complex *c,
1005 double *u,
double *v);
1138int la_svd(
int m,
int n,
double *a,
int lda,
double *s,
double *u,
int ldu,
1139 double *vt,
int ldv);
1170int la_svd_cmplx(
int m,
int n,
double complex *a,
int lda,
double *s,
1171 double complex *u,
int ldu,
double complex *vt,
int ldv);
1201int la_solve_tri_mtx(
bool lside,
bool upper,
bool trans,
bool nounit,
int m,
1202 int n,
double alpha,
const double *a,
int lda,
double *b,
int ldb);
1233 int m,
int n,
double complex alpha,
const double complex *a,
int lda,
1234 double complex *b,
int ldb);
1252int la_solve_lu(
int m,
int n,
const double *a,
int lda,
const int *ipvt,
1253 double *b,
int ldb);
1272 const int *ipvt,
double complex *b,
int ldb);
1297int la_solve_qr(
int m,
int n,
int k,
double *a,
int lda,
const double *tau,
1298 double *b,
int ldb);
1324 const double complex *tau,
double complex *b,
int ldb);
1349int la_solve_qr_pvt(
int m,
int n,
int k,
double *a,
int lda,
const double *tau,
1350 const int *jpvt,
double *b,
int ldb);
1376 const double complex *tau,
const int *jpvt,
double complex *b,
int ldb);
1397 double *b,
int ldb);
1418 int lda,
double complex *b,
int ldb);
1474 int lda,
double complex *b,
int ldb);
1523int la_pinverse(
int m,
int n,
double *a,
int lda,
double *ainv,
int ldai);
1543 double complex *ainv,
int ldai);
1568int la_eigen_symm(
bool vecs,
int n,
double *a,
int lda,
double *vals);
1593 double complex *vals,
double complex *v,
int ldv);
1627int la_eigen_gen(
bool vecs,
int n,
double *a,
int lda,
double *b,
int ldb,
1628 double complex *alpha,
double *beta,
double complex *v,
int ldv);
1653 double complex *vals,
double complex *v,
int ldv);
1674int la_sort_eigen(
bool ascend,
int n,
double *vals,
double *vecs,
int ldv);
1696 double complex *vecs,
int ldv);
1719int la_lq_factor(
int m,
int n,
double *a,
int lda,
double *tau);
1741int la_form_lq(
int m,
int n,
double *l,
int ldl,
const double *tau,
double *q,
1771int la_mult_lq(
bool lside,
bool trans,
int m,
int n,
int k,
const double *a,
1772 int lda,
const double *tau,
double *c,
int ldc);
1797int la_solve_lq(
int m,
int n,
int k,
const double *a,
int lda,
1798 const double *tau,
double *b,
int ldb);
1833 double complex *r,
int ldr,
double complex *u,
double complex *v);
1883 double complex *tau);
1909 const double complex *tau,
double complex *q,
int ldq);
1942 const double complex *a,
int lda,
const double complex *tau,
1943 double complex *c,
int ldc);
1972 const double complex *tau,
double complex *b,
int ldb);
1999 const double *a,
int lda,
const double *x,
double beta,
double *y);
2028 double complex alpha,
const double complex *a,
int lda,
2029 const double complex *x,
double complex beta,
double complex *y);
2046 double *f,
int ldf);
2063 const double complex *b,
int ldb,
double complex *f,
int ldf);
2097 double *a,
int lda,
const double *b);
2131 double complex alpha,
double complex *a,
int lda,
const double complex *b);
int la_cholesky_rank1_downdate_cmplx(int n, double complex *r, int ldr, double complex *u)
int la_trace_cmplx(int m, int n, const double complex *a, int lda, double complex *rst)
int la_tri_mtx_mult_cmplx(bool upper, double complex alpha, int n, const double complex *a, int lda, double complex beta, double complex *b, int ldb)
int la_solve_least_squares(int m, int n, int k, double *a, int lda, double *b, int ldb)
int la_form_qr_cmplx(bool fullq, int m, int n, double complex *r, int ldr, const double complex *tau, double complex *q, int ldq)
int la_rank(int m, int n, double *a, int lda, int *rnk)
int la_sort_eigen_cmplx(bool ascend, int n, double complex *vals, double complex *vecs, int ldv)
int la_solve_cholesky(bool upper, int m, int n, const double *a, int lda, double *b, int ldb)
int la_solve_qr_cmplx(int m, int n, int k, double complex *a, int lda, const double complex *tau, double complex *b, int ldb)
int la_form_lu(int n, double *a, int lda, int *ipvt, double *u, int ldu, double *p, int ldp)
int la_cholesky_factor_cmplx(bool upper, int n, double complex *a, int lda)
int la_lu_factor(int m, int n, double *a, int lda, int *ipvt)
int la_cholesky_rank1_downdate(int n, double *r, int ldr, double *u)
int la_solve_lq(int m, int n, int k, const double *a, int lda, const double *tau, double *b, int ldb)
int la_cholesky_factor(bool upper, int n, double *a, int lda)
int la_rank1_update_cmplx(int m, int n, double complex alpha, const double complex *x, const double complex *y, double complex *a, int lda)
int la_qr_factor_cmplx_pvt(int m, int n, double complex *a, int lda, double complex *tau, int *jpvt)
int la_diag_mtx_mult(bool lside, bool transb, int m, int n, int k, double alpha, const double *a, const double *b, int ldb, double beta, double *c, int ldc)
int la_qr_factor_pvt(int m, int n, double *a, int lda, double *tau, int *jpvt)
int la_diag_mtx_mult_mixed(bool lside, int opb, int m, int n, int k, double complex alpha, const double *a, const double complex *b, int ldb, double complex beta, double complex *c, int ldc)
int la_solve_lq_cmplx(int m, int n, int k, const double complex *a, int lda, const double complex *tau, double complex *b, int ldb)
int la_svd(int m, int n, double *a, int lda, double *s, double *u, int ldu, double *vt, int ldv)
int la_lq_factor_cmplx(int m, int n, double complex *a, int lda, double complex *tau)
int la_solve_qr_pvt(int m, int n, int k, double *a, int lda, const double *tau, const int *jpvt, double *b, int ldb)
int la_diag_mtx_mult_cmplx(bool lside, int opb, int m, int n, int k, double complex alpha, const double complex *a, const double complex *b, int ldb, double complex beta, double complex *c, int ldc)
int la_band_diag_mtx_mult(bool left, int m, int n, int kl, int ku, double alpha, double *a, int lda, const double *b)
int la_solve_cholesky_cmplx(bool upper, int m, int n, const double complex *a, int lda, double complex *b, int ldb)
int la_pinverse_cmplx(int m, int n, double complex *a, int lda, double complex *ainv, int ldai)
int la_form_lu_cmplx(int n, double complex *a, int lda, int *ipvt, double complex *u, int ldu, double *p, int ldp)
int la_qr_factor(int m, int n, double *a, int lda, double *tau)
int la_inverse_cmplx(int n, double complex *a, int lda)
int la_lq_factor(int m, int n, double *a, int lda, double *tau)
int la_trace(int m, int n, const double *a, int lda, double *rst)
int la_band_diag_mtx_mult_cmplx(bool left, int m, int n, int kl, int ku, double complex alpha, double complex *a, int lda, const double complex *b)
int la_eigen_asymm(bool vecs, int n, double *a, int lda, double complex *vals, double complex *v, int ldv)
int la_inverse(int n, double *a, int lda)
int la_mult_qr(bool lside, bool trans, int m, int n, int k, double *a, int lda, const double *tau, double *c, int ldc)
int la_mtx_mult(bool transa, bool transb, int m, int n, int k, double alpha, const double *a, int lda, const double *b, int ldb, double beta, double *c, int ldc)
int la_qr_rank1_update(int m, int n, double *q, int ldq, double *r, int ldr, double *u, double *v)
int la_solve_lu_cmplx(int m, int n, const double complex *a, int lda, const int *ipvt, double complex *b, int ldb)
int la_band_to_full_mtx_cmplx(int m, int n, int kl, int ku, const double complex *b, int ldb, double complex *f, int ldf)
int la_form_lq_cmplx(int m, int n, double complex *l, int ldl, const double complex *tau, double complex *q, int ldq)
int la_form_qr_pvt(bool fullq, int m, int n, double *r, int ldr, const double *tau, const int *pvt, double *q, int ldq, double *p, int ldp)
int la_solve_lu(int m, int n, const double *a, int lda, const int *ipvt, double *b, int ldb)
int la_rank1_update(int m, int n, double alpha, const double *x, const double *y, double *a, int lda)
int la_cholesky_rank1_update(int n, double *r, int ldr, double *u)
int la_sort_eigen(bool ascend, int n, double *vals, double *vecs, int ldv)
int la_eigen_symm(bool vecs, int n, double *a, int lda, double *vals)
int la_solve_least_squares_cmplx(int m, int n, int k, double complex *a, int lda, double complex *b, int ldb)
int la_form_lq(int m, int n, double *l, int ldl, const double *tau, double *q, int ldq)
int la_mult_lq(bool lside, bool trans, int m, int n, int k, const double *a, int lda, const double *tau, double *c, int ldc)
int la_det(int n, double *a, int lda, double *d)
int la_band_mtx_vec_mult_cmplx(int trans, int m, int n, int kl, int ku, double complex alpha, const double complex *a, int lda, const double complex *x, double complex beta, double complex *y)
int la_mult_qr_cmplx(bool lside, bool trans, int m, int n, int k, double complex *a, int lda, const double complex *tau, double complex *c, int ldc)
int la_lu_factor_cmplx(int m, int n, double complex *a, int lda, int *ipvt)
int la_det_cmplx(int n, double complex *a, int lda, double complex *d)
int la_qr_rank1_update_cmplx(int m, int n, double complex *q, int ldq, double complex *r, int ldr, double complex *u, double complex *v)
int la_solve_qr_cmplx_pvt(int m, int n, int k, double complex *a, int lda, const double complex *tau, const int *jpvt, double complex *b, int ldb)
int la_form_qr_cmplx_pvt(bool fullq, int m, int n, double complex *r, int ldr, const double complex *tau, const int *pvt, double complex *q, int ldq, double complex *p, int ldp)
int la_mult_lq_cmplx(bool lside, bool trans, int m, int n, int k, const double complex *a, int lda, const double complex *tau, double complex *c, int ldc)
int la_band_to_full_mtx(int m, int n, int kl, int ku, const double *b, int ldb, double *f, int ldf)
int la_band_mtx_vec_mult(bool trans, int m, int n, int kl, int ku, double alpha, const double *a, int lda, const double *x, double beta, double *y)
int la_eigen_cmplx(bool vecs, int n, double complex *a, int lda, double complex *vals, double complex *v, int ldv)
int la_qr_factor_cmplx(int m, int n, double complex *a, int lda, double complex *tau)
int la_tri_mtx_mult(bool upper, double alpha, int n, const double *a, int lda, double beta, double *b, int ldb)
int la_solve_tri_mtx(bool lside, bool upper, bool trans, bool nounit, int m, int n, double alpha, const double *a, int lda, double *b, int ldb)
int la_solve_qr(int m, int n, int k, double *a, int lda, const double *tau, double *b, int ldb)
int la_mtx_mult_cmplx(int opa, int opb, int m, int n, int k, double complex alpha, const double complex *a, int lda, const double complex *b, int ldb, double complex beta, double complex *c, int ldc)
int la_cholesky_rank1_update_cmplx(int n, double complex *r, int ldr, double complex *u)
int la_eigen_gen(bool vecs, int n, double *a, int lda, double *b, int ldb, double complex *alpha, double *beta, double complex *v, int ldv)
int la_pinverse(int m, int n, double *a, int lda, double *ainv, int ldai)
int la_solve_tri_mtx_cmplx(bool lside, bool upper, bool trans, bool nounit, int m, int n, double complex alpha, const double complex *a, int lda, double complex *b, int ldb)
int la_svd_cmplx(int m, int n, double complex *a, int lda, double *s, double complex *u, int ldu, double complex *vt, int ldv)
int la_rank_cmplx(int m, int n, double complex *a, int lda, int *rnk)
int la_form_qr(bool fullq, int m, int n, double *r, int ldr, const double *tau, double *q, int ldq)