zscal function

void zscal(
  1. int N,
  2. Complex ZA,
  3. Array<Complex> ZX_,
  4. int INCX,
)

Implementation

void zscal(
  final int N,
  final Complex ZA,
  final Array<Complex> ZX_,
  final int INCX,
) {
  final ZX = ZX_.having();
  int I, NINCX;

  if (N <= 0 || INCX <= 0 || ZA == Complex.one) return;
  if (INCX == 1) {
    // code for increment equal to 1

    for (I = 1; I <= N; I++) {
      ZX[I] = ZA * ZX[I];
    }
  } else {
    // code for increment not equal to 1

    NINCX = N * INCX;
    for (I = 1; I <= NINCX; I += INCX) {
      ZX[I] = ZA * ZX[I];
    }
  }
}