Commit b089ba68 authored by Giovanni La Mura's avatar Giovanni La Mura
Browse files

Resize the dielectric constant matrix.

parent 949a1e60
Loading
Loading
Loading
Loading
+2 −4
Original line number Diff line number Diff line
@@ -46,7 +46,6 @@ int main(int argc, char **argv) {
  double *xiv, *wns, *wls, *pus, *evs, *vss;
  string vns[5];

  int max_nsh = 0; // A helper variable to set the size of dc0m
  int ici;

  // Input file reading section
@@ -380,7 +379,6 @@ int main(int argc, char **argv) {
    ros[i113 - 1] = ros_val * pow(10.0, ros_val_exp);
    nsh = nshl[i113 -1];
    if (i113 == 1) nsh += ies;
    if ((nsh + 1) / 2 + ies > max_nsh) max_nsh = (nsh + 1) / 2 + ies;
    rcf[i113 - 1] = new double[nsh];
    for (int ns = 0; ns < nsh; ns++) {
      double ns_rcf;
@@ -415,8 +413,8 @@ int main(int argc, char **argv) {
      write_double_(&uid, (rcf[i115 - 1] + ins));
  }
  // Remake the dc0m matrix.
  dc0m = new complex<double>**[max_nsh];
  for (int dim1 = 0; dim1 < max_nsh; dim1++) {
  dc0m = new complex<double>**[nsph];
  for (int dim1 = 0; dim1 < nsph; dim1++) {
    dc0m[dim1] = new complex<double>*[nsph];
    for (int dim2 = 0; dim2 < nxi; dim2++) {
      dc0m[dim1][dim2] = new complex<double>[nxi];