36 int* __restrict__ indPivot)
39 for (
int i = 0; i < n - 1; i ++)
41 if (cabs(A[i *
STRIDE + i]) < cabs(A[i *
STRIDE + i + 1]))
44 for(
int k = last_pivot; k < n; ++k)
46 double complex temp = A[k *
STRIDE + i];
48 A[k *
STRIDE + i + 1] = temp;
57 if (cabs(A[i *
STRIDE + i]) > 0.0)
59 double complex tau = A[i *
STRIDE + i + 1] / A[i *
STRIDE + i];
60 for (
int j = i + 1; j < n; j++)
64 A[i *
STRIDE + i + 1] = tau;
72 indPivot[n - 1] = n - 1;
83 void scaleComplex (
const int n,
const double complex val,
double complex* __restrict__ arrX) {
85 for (
int i = 0; i < n; ++i) {
109 const double complex* A) {
111 for (
int j = 0; j < n; ++j) {
112 if (cabs(x[j]) > 0.0) {
113 double complex temp = x[j];
114 for (
int i = 0; i < j; ++i) {
115 x[i] += temp * A[i + (lda * j)];
118 x[j] *= A[j + (lda * j)];
146 void complexGEMV (
const int m,
const int n,
const int lda,
const double alpha,
const double complex* __restrict__ A,
147 const double complex* arrX,
double complex* arrY) {
154 for (
int j = 0; j < n - 1; ++j) {
156 if (cabs(arrX[j]) > 0.0) {
157 double complex temp = alpha * arrX[j];
158 for (
int i = 0; i < m; ++i) {
159 arrY[i] += temp * A[i + (lda * j)];
179 const int* __restrict__ indPivot) {
181 double complex work[
STRIDE] = {0};
184 for (
int j = 0; j < n; ++j) {
185 if (cabs(A[j + (
STRIDE * j)]) == 0)
188 double complex Ajj = -A[j + (
STRIDE * j)];
199 for (
int j = n - 1; j >= 0; --j) {
202 for (
int i = j + 1; i < n; ++i) {
203 work[i] = A[i +
STRIDE * j];
215 for (
int j = n - 2; j >= 0; --j) {
217 if (indPivot[j] != j)
219 for (
int i = 0; i < n; ++i) {
220 double complex temp = A[
STRIDE * j + i];
222 A[
STRIDE * indPivot[j] + i] = temp;
239 int* __restrict__ ipiv,
int* __restrict__ info)
void getComplexInverseHessenberg(const int n, double complex *__restrict__ A, int *__restrict__ ipiv, int *__restrict__ info)
getComplexInverseHessenberg computes the inverse of an upper Hessenberg matrix A using a LU factoriza...
int getComplexInverseHessenbergLU(const int n, double complex *__restrict__ A, const int *__restrict__ indPivot)
getComplexInverseHessenbergLU computes the inverse of a matrix using the LU factorization computed by...
#define STRIDE
the matrix dimensions
void multiplyComplexUpperMV(const int n, double complex *x, const int lda, const double complex *A)
Performs the matrix-vector operation .
External lapack routine definitions.
simple convenience file to include the correct solver properties file
void complexGEMV(const int m, const int n, const int lda, const double alpha, const double complex *__restrict__ A, const double complex *arrX, double complex *arrY)
Computes the matrix-vector operation where alpha is a scalar, x and y are vectors and A is an m by n...
void scaleComplex(const int n, const double complex val, double complex *__restrict__ arrX)
scaleComplex scales a vector (with increment equal to one) by a constant val.
static int getHessenbergLU(const int n, double complex *__restrict__ A, int *__restrict__ indPivot)
Computes the LU factorization of a (n x STRIDE) Hessenberg Matrix using partial pivoting with row int...