int clapack_zgesv(const enum CBLAS_ORDER Order, const int N, const int NRHS, void *A, const int lda, int *ipiv, void *B, const int ldb) /* * clapack_zgesv computes the solution to a system of linear equations * A * X = B, * where A is an N-by-N matrix and X and B are N-by-NRHS matrices. * The LU factorization used to factor A is dependent on the Order parameter, * as detailed in the leading comments of clapack_zgetrf. * The factored form of A is then used solve the system of equations A * X = B. * A is overwritten with the appropriate LU factorization, and B, which * contains B on input, is overwritten with the solution X on output. */ { int ierr = 0; if (Order != CblasRowMajor && Order != CblasColMajor) { ierr = -1; cblas_xerbla(1, "clapack_zgesv", "Order must be %d or %d, but is set to %d.\n", CblasRowMajor, CblasColMajor, Order); } if (N < 0) { ierr = -2; cblas_xerbla(2, "clapack_zgesv", "N cannot be less than zero 0,; is set to %d.\n", N); } if (NRHS < 0) { ierr = -3; cblas_xerbla(3, "clapack_zgesv", "NRHS cannot be less than zero 0,; is set to %d.\n", NRHS); } if (lda < N || lda < 1) { ierr = -5; cblas_xerbla(5, "clapack_zgesv", "lda must be >= MAX(N,1): lda=%d N=%d\n", lda, N); } if (ldb < N || ldb < 1) { ierr = -8; cblas_xerbla(8, "clapack_zgesv", "ldb must be >= MAX(N,1): ldb=%d N=%d\n", ldb, N); } if (!ierr) ierr = ATL_zgetrf(Order, N, N, A, lda, ipiv); if (!ierr) ATL_zgetrs(Order, CblasNoTrans, N, NRHS, A, lda, ipiv, B, ldb); return(ierr); }
int clapack_zgetrs (const enum CBLAS_ORDER Order, const enum CBLAS_TRANSPOSE Trans, const int N, const int NRHS, const void *A, const int lda, const int *ipiv, void *B, const int ldb) { int ierr=0; if (Order != CblasRowMajor && Order != CblasColMajor) { ierr = -1; cblas_xerbla(1, "clapack_zgetrs", "Order must be %d or %d, but is set to %d\n", CblasRowMajor, CblasColMajor, Order); } if (Trans != CblasNoTrans && Trans != CblasTrans && Trans != CblasConjTrans) { ierr = -2; cblas_xerbla(2, "clapack_zgetrs", "Trans must be %d, %d, or %d, but is set to %d\n", CblasNoTrans, CblasTrans, CblasConjTrans); } if (N < 0) { ierr = -3; cblas_xerbla(3, "clapack_zgetrs", "N cannot be less than zero 0,; is set to %d.\n", N); } if (NRHS < 0) { ierr = -4; cblas_xerbla(4, "clapack_zgetrs", "NRHS cannot be less than zero 0,; is set to %d.\n", NRHS); } if (lda < N || lda < 1) { ierr = -6; cblas_xerbla(6, "clapack_zgetrs", "lda must be >= MAX(N,1): lda=%d N=%d\n", lda, N); } if (ldb < N || ldb < 1) { ierr = -9; cblas_xerbla(9, "clapack_zgetrs", "ldb must be >= MAX(N,1): lda=%d N=%d\n", lda, N); } if (!ierr) ATL_zgetrs(Order, Trans, N, NRHS, A, lda, ipiv, B, ldb); return(ierr); }