Commit a85b6dca authored by Mulas, Giacomo's avatar Mulas, Giacomo
Browse files

Be pedantic and, for the time being, pass _everything_ to cluster_jxi488_cycle()

parent ef512fd2
Loading
Loading
Loading
Loading
+203 −132
Original line number Original line Diff line number Diff line
@@ -43,7 +43,56 @@


using namespace std;
using namespace std;


int cluster_jxi488_cycle(int jxi488, ScattererConfiguration *sconf, GeometryConfiguration *gconf, C1 *c1, C1_AddOns *c1ao, C2 *c2, C3 *c3, C4 *c4, C6 *c6, C9 *c9, FILE *output, string output_path, double *gaps, double **tqse, dcomplex **tqspe, double **tqss, dcomplex **tqsps, double ****zpv, double **gapm, dcomplex **gappm, int nth, int nths, int nph, int nphs, int nk, int nks, int nkks, double *argi, double *args, double **gap, dcomplex **gapp, double **tqce, dcomplex **tqcpe, double **tqcs, dcomplex **tqcps, double *duk, fstream &tppoan, double **cextlr, double **cext, double **cmullr, double **cmul, double *gapv, double *tqev, double *tqsv);
// I would like to put it all in a struct, but then I'd have to write a constructor for it, due to members defined as
// references, creating a worse nightmare than the one I'd like to simplify...
//
// struct clu_jxi488_cycle_args {
//   int jxi488;
//   ScattererConfiguration *sconf;
//   GeometryConfiguration *gconf;
//   C1 *c1;
//   C1_AddOns *c1ao;
//   C2 *c2;
//   C3 *c3;
//   C4 *c4;
//   C6 *c6;
//   C9 *c9;
//   FILE *output;
//   string output_path;
//   double *gaps;
//   double **tqse;
//   dcomplex **tqspe;
//   double **tqss;
//   dcomplex **tqsps;
//   double ****zpv;
//   double **gapm;
//   dcomplex **gappm;
//   int nth, int nths;
//   int nph;
//   int nphs;
//   int nk;
//   int nks;
//   int nkks;
//   double *argi;
//   double *args;
//   double **gap;
//   dcomplex **gapp;
//   double **tqce;
//   dcomplex **tqcpe;
//   double **tqcs;
//   dcomplex **tqcps;
//   double *duk;
//   fstream &tppoan;
//   double **cextlr;
//   double **cext;
//   double **cmullr;
//   double **cmul;
//   double *gapv;
//   double *tqev;
//   double *tqsv;
// }

int cluster_jxi488_cycle(int jxi488, ScattererConfiguration *sconf, GeometryConfiguration *gconf, C1 *c1, C1_AddOns *c1ao, C2 *c2, C3 *c3, C4 *c4, C6 *c6, C9 *c9, FILE *output, string output_path, double *gaps, double **tqse, dcomplex **tqspe, double **tqss, dcomplex **tqsps, double ****zpv, double **gapm, dcomplex **gappm, int nth, int nths, int nph, int nphs, int nk, int nks, int nkks, double *argi, double *args, double **gap, dcomplex **gapp, double **tqce, dcomplex **tqcpe, double **tqcs, dcomplex **tqcps, double *duk, fstream &tppoan, double **cextlr, double **cext, double **cmullr, double **cmul, double *gapv, double *tqev, double *tqsv, int &nxi, int &nsph, np_int &mxndm, int &inpol, int &iavm, int &npnt, int &npntts, int &isam, int &lm, double &th, double &thstp, double &thlst, double &ths, double &thsstp, double &thslst, double &ph, double &phstp, double &phlst, double &phs, double &phsstp, double &phslst, double &th1, double &ph1, double &ths1, double &phs1, double &thsca, double *u, double *us, double *un, double *uns, double *up, double *ups, double *unmp, double *unsmp, double *upmp, double *upsmp, double &scan, double &cfmp, double &sfmp, double &cfsp, double &sfsp, double &sqsfi, double &exri, int &lcalc, dcomplex &arg, double &wn, double &vk, np_int &ndit, dcomplex **am, int &isq, int &ibf);


/*! \brief C++ implementation of CLU
/*! \brief C++ implementation of CLU
 *
 *
@@ -115,19 +164,20 @@ void cluster(string config_file, string data_file, string output_path) {
    C6 *c6 = new C6(c4->lmtpo);
    C6 *c6 = new C6(c4->lmtpo);
    FILE *output = fopen((output_path + "/c_OCLU").c_str(), "w");
    FILE *output = fopen((output_path + "/c_OCLU").c_str(), "w");
    int jer = 0;
    int jer = 0;
    // int lcalc = 0;
    int lcalc = 0;
    dcomplex arg = 0.0 + 0.0 * I;
    dcomplex ccsam = 0.0 + 0.0 * I;
    dcomplex ccsam = 0.0 + 0.0 * I;
    int configurations = 0;
    int configurations = 0;
    for (int ci = 1; ci <= nsph; ci++) {
    for (int ci = 1; ci <= nsph; ci++) {
      if (sconf->iog_vec[ci -1] >= ci) configurations++;
      if (sconf->iog_vec[ci -1] >= ci) configurations++;
    }
    }
    C2 *c2 = new C2(nsph, configurations, npnt, npntts);
    C2 *c2 = new C2(nsph, configurations, npnt, npntts);
    // np_int ndit = 2 * nsph * c4->nlim;
    np_int ndit = 2 * nsph * c4->nlim;
    // dcomplex *am_vector = new dcomplex[ndit * ndit]();
    dcomplex *am_vector = new dcomplex[ndit * ndit]();
    // dcomplex **am = new dcomplex*[ndit];
    dcomplex **am = new dcomplex*[ndit];
    // for (int ai = 0; ai < ndit; ai++) {
    for (int ai = 0; ai < ndit; ai++) {
    //   am[ai] = (am_vector + ai * ndit);
      am[ai] = (am_vector + ai * ndit);
    // }
    }
    const int ndi = c4->nsph * c4->nlim;
    const int ndi = c4->nsph * c4->nlim;
    C9 *c9 = new C9(ndi, c4->nlem, 2 * ndi, 2 * c4->nlem);
    C9 *c9 = new C9(ndi, c4->nlem, 2 * ndi, 2 * c4->nlem);
    double *gaps = new double[nsph]();
    double *gaps = new double[nsph]();
@@ -166,6 +216,16 @@ void cluster(string config_file, string data_file, string output_path) {
      gap[gi] = new double[2]();
      gap[gi] = new double[2]();
      gapm[gi] = new double[2]();
      gapm[gi] = new double[2]();
    }
    }
    double *u = new double[3]();
    double *us = new double[3]();
    double *un = new double[3]();
    double *uns = new double[3]();
    double *up = new double[3]();
    double *ups = new double[3]();
    double *unmp = new double[3]();
    double *unsmp = new double[3]();
    double *upmp = new double[3]();
    double *upsmp = new double[3]();
    double *argi = new double[1]();
    double *argi = new double[1]();
    double *args = new double[1]();
    double *args = new double[1]();
    double *duk = new double[3]();
    double *duk = new double[3]();
@@ -181,8 +241,8 @@ void cluster(string config_file, string data_file, string output_path) {
      cmullr[ci] = new double[4]();
      cmullr[ci] = new double[4]();
      cmul[ci] = new double[4]();
      cmul[ci] = new double[4]();
    }
    }
    //int isq, ibf;
    int isq, ibf;
    //double scan, cfmp, sfmp, cfsp, sfsp;
    double scan, cfmp, sfmp, cfsp, sfsp;
    // End of global variables for CLU
    // End of global variables for CLU
    fprintf(output, " READ(IR,*)NSPH,LI,LE,MXNDM,INPOL,NPNT,NPNTTS,IAVM,ISAM\n");
    fprintf(output, " READ(IR,*)NSPH,LI,LE,MXNDM,INPOL,NPNT,NPNTTS,IAVM,ISAM\n");
    fprintf(output, " %5d%5d%5d%5ld%5d%5d%5d%5d%5d\n",
    fprintf(output, " %5d%5d%5d%5ld%5d%5d%5d%5d%5d\n",
@@ -271,6 +331,7 @@ void cluster(string config_file, string data_file, string output_path) {
      tppoan.write(reinterpret_cast<char *>(&nths), sizeof(int));
      tppoan.write(reinterpret_cast<char *>(&nths), sizeof(int));
      tppoan.write(reinterpret_cast<char *>(&nphs), sizeof(int));
      tppoan.write(reinterpret_cast<char *>(&nphs), sizeof(int));
      double wn = wp / 3.0e8;
      double wn = wp / 3.0e8;
      double sqsfi = 1.0;
      if (sconf->idfc < 0) {
      if (sconf->idfc < 0) {
	vk = sconf->xip * wn;
	vk = sconf->xip * wn;
	fprintf(output, "  VK=%15.7lE, XI IS SCALE FACTOR FOR LENGTHS\n", vk);
	fprintf(output, "  VK=%15.7lE, XI IS SCALE FACTOR FOR LENGTHS\n", vk);
@@ -278,7 +339,7 @@ void cluster(string config_file, string data_file, string output_path) {
      }
      }
      for (int jxi488 = 1; jxi488 <= nxi; jxi488++) {
      for (int jxi488 = 1; jxi488 <= nxi; jxi488++) {
	// To test parallelism, I will now start feeding this function with "clean" copies of the parameters, so that they will not be changed by previous iterations, and each one will behave as the first one
	// To test parallelism, I will now start feeding this function with "clean" copies of the parameters, so that they will not be changed by previous iterations, and each one will behave as the first one
	jer = cluster_jxi488_cycle(jxi488, sconf, gconf, c1, c1ao, c2, c3, c4, c6, c9, output, output_path, gaps, tqse, tqspe, tqss, tqsps, zpv, gapm, gappm, nth, nths, nph, nphs, nk, nks, nkks, argi, args, gap, gapp, tqce, tqcpe, tqcs, tqcps, duk, tppoan, cextlr, cext, cmullr, cmul, gapv, tqev, tqsv);
	jer = cluster_jxi488_cycle(jxi488, sconf, gconf, c1, c1ao, c2, c3, c4, c6, c9, output, output_path, gaps, tqse, tqspe, tqss, tqsps, zpv, gapm, gappm, nth, nths, nph, nphs, nk, nks, nkks, argi, args, gap, gapp, tqce, tqcpe, tqcs, tqcps, duk, tppoan, cextlr, cext, cmullr, cmul, gapv, tqev, tqsv, nxi, nsph, mxndm, inpol, iavm, npnt, npntts, isam, lm, th, thstp, thlst, ths, thsstp, thslst, ph, phstp, phlst, phs, phsstp, phslst, th1, ph1, ths1, phs1, thsca, u, us, un, uns, up, ups, unmp, unsmp, upmp, upsmp, scan, cfmp, sfmp, cfsp, sfsp, sqsfi, exri, lcalc, arg, wn, vk, ndit, am, isq, ibf);
      } // jxi488 loop
      } // jxi488 loop
      tppoan.close();
      tppoan.close();
    } else { // In case TPPOAN could not be opened. Should never happen.
    } else { // In case TPPOAN could not be opened. Should never happen.
@@ -301,8 +362,8 @@ void cluster(string config_file, string data_file, string output_path) {
      delete[] zpv[zi];
      delete[] zpv[zi];
    }
    }
    delete[] zpv;
    delete[] zpv;
    //delete[] am_vector;
    delete[] am_vector;
    //delete[] am;
    delete[] am;
    //delete[] tam;
    //delete[] tam;
    delete[] gaps;
    delete[] gaps;
    for (int ti = 1; ti > -1; ti--) {
    for (int ti = 1; ti > -1; ti--) {
@@ -336,6 +397,16 @@ void cluster(string config_file, string data_file, string output_path) {
    delete[] gap;
    delete[] gap;
    delete[] gapm;
    delete[] gapm;
    delete[] gapv;
    delete[] gapv;
    delete[] u;
    delete[] us;
    delete[] un;
    delete[] uns;
    delete[] up;
    delete[] ups;
    delete[] unmp;
    delete[] unsmp;
    delete[] upmp;
    delete[] upsmp;
    delete[] argi;
    delete[] argi;
    delete[] args;
    delete[] args;
    delete[] duk;
    delete[] duk;
@@ -360,68 +431,68 @@ void cluster(string config_file, string data_file, string output_path) {
}
}




int cluster_jxi488_cycle(int jxi488, ScattererConfiguration *sconf, GeometryConfiguration *gconf, C1 *c1, C1_AddOns *c1ao, C2 *c2, C3 *c3, C4 *c4, C6 *c6, C9 *c9, FILE *output, string output_path, double *gaps, double **tqse, dcomplex **tqspe, double **tqss, dcomplex **tqsps, double ****zpv, double **gapm, dcomplex **gappm, int nth, int nths, int nph, int nphs, int nk, int nks, int nkks, double *argi, double *args, double **gap, dcomplex **gapp, double **tqce, dcomplex **tqcpe, double **tqcs, dcomplex **tqcps, double *duk, fstream &tppoan, double **cextlr, double **cext, double **cmullr, double **cmul, double *gapv, double *tqev, double *tqsv)
int cluster_jxi488_cycle(int jxi488, ScattererConfiguration *sconf, GeometryConfiguration *gconf, C1 *c1, C1_AddOns *c1ao, C2 *c2, C3 *c3, C4 *c4, C6 *c6, C9 *c9, FILE *output, string output_path, double *gaps, double **tqse, dcomplex **tqspe, double **tqss, dcomplex **tqsps, double ****zpv, double **gapm, dcomplex **gappm, int nth, int nths, int nph, int nphs, int nk, int nks, int nkks, double *argi, double *args, double **gap, dcomplex **gapp, double **tqce, dcomplex **tqcpe, double **tqcs, dcomplex **tqcps, double *duk, fstream &tppoan, double **cextlr, double **cext, double **cmullr, double **cmul, double *gapv, double *tqev, double *tqsv, int &nxi, int &nsph, np_int &mxndm, int &inpol, int &iavm, int &npnt, int &npntts, int &isam, int &lm, double &th, double &thstp, double &thlst, double &ths, double &thsstp, double &thslst, double &ph, double &phstp, double &phlst, double &phs, double &phsstp, double &phslst, double &th1, double &ph1, double &ths1, double &phs1, double &thsca, double *u, double *us, double *un, double *uns, double *up, double *ups, double *unmp, double *unsmp, double *upmp, double *upsmp, double &scan, double &cfmp, double &sfmp, double &cfsp, double &sfsp, double &sqsfi, double &exri, int &lcalc, dcomplex &arg, double &wn, double &vk, np_int &ndit, dcomplex **am, int &isq, int &ibf)
{
{


  int nxi = sconf->number_of_scales;
  // int nxi = sconf->number_of_scales;
  int nsph = gconf->number_of_spheres;
  // int nsph = gconf->number_of_spheres;
  np_int mxndm = (np_int)gconf->mxndm;
  // np_int mxndm = (np_int)gconf->mxndm;
  int inpol = gconf->in_pol;
  // int inpol = gconf->in_pol;
  int iavm = gconf->iavm;
  // int iavm = gconf->iavm;
  int npnt = gconf->npnt;
  // int npnt = gconf->npnt;
  int npntts = gconf->npntts;
  // int npntts = gconf->npntts;
  int isam = gconf->meridional_type;
  // int isam = gconf->meridional_type;
  int lm = gconf->l_max;
  // int lm = gconf->l_max;
  double th = gconf->in_theta_start;
  // double th = gconf->in_theta_start;
  double thstp = gconf->in_theta_step;
  // double thstp = gconf->in_theta_step;
  double thlst = gconf->in_theta_end;
  // double thlst = gconf->in_theta_end;
  double ths = gconf->sc_theta_start;
  // double ths = gconf->sc_theta_start;
  double thsstp = gconf->sc_theta_step;
  // double thsstp = gconf->sc_theta_step;
  double thslst = gconf->sc_theta_end;
  // double thslst = gconf->sc_theta_end;
  double ph = gconf->in_phi_start;
  // double ph = gconf->in_phi_start;
  double phstp = gconf->in_phi_step;
  // double phstp = gconf->in_phi_step;
  double phlst = gconf->in_phi_end;
  // double phlst = gconf->in_phi_end;
  double phs = gconf->sc_phi_start;
  // double phs = gconf->sc_phi_start;
  double phsstp = gconf->sc_phi_step;
  // double phsstp = gconf->sc_phi_step;
  double phslst = gconf->sc_phi_end;
  // double phslst = gconf->sc_phi_end;
  double th1 = th;
  // double th1 = th;
  double ph1 = ph;
  // double ph1 = ph;
  double ths1 = ths;
  // double ths1 = ths;
  double phs1 = phs;
  // double phs1 = phs;
  double thsca = 0.0;
  // double thsca = 0.0;
  if (isam > 1) thsca = ths - th;
  // if (isam > 1) thsca = ths - th;
  double *u = new double[3]();
  // double *u = new double[3]();
  double *us = new double[3]();
  // double *us = new double[3]();
  double *un = new double[3]();
  // double *un = new double[3]();
  double *uns = new double[3]();
  // double *uns = new double[3]();
  double *up = new double[3]();
  // double *up = new double[3]();
  double *ups = new double[3]();
  // double *ups = new double[3]();
  double *unmp = new double[3]();
  // double *unmp = new double[3]();
  double *unsmp = new double[3]();
  // double *unsmp = new double[3]();
  double *upmp = new double[3]();
  // double *upmp = new double[3]();
  double *upsmp = new double[3]();
  // double *upsmp = new double[3]();
  double scan;
  // double scan;
  double cfmp;
  // double cfmp;
  double sfmp;
  // double sfmp;
  double cfsp;
  // double cfsp;
  double sfsp;
  // double sfsp;
  double sqsfi = 1.0;
  // double sqsfi = 1.0;
  double exri = sqrt(sconf->exdc);
  // double exri = sqrt(sconf->exdc);
  int jer = 0;
  int jer = 0;
  int lcalc = 0;
  // int lcalc = 0;
  dcomplex arg = 0.0 + 0.0 * I;
  // dcomplex arg = 0.0 + 0.0 * I;
  double wp = sconf->wp;
  // double wp = sconf->wp;
  double wn = wp / 3.0e8;
  // double wn = wp / 3.0e8;
  double vk = 0.0;
  // double vk = 0.0;
  if (sconf->idfc < 0) vk = sconf->xip * wn;
  // if (sconf->idfc < 0) vk = sconf->xip * wn;
  np_int ndit = 2 * nsph * c4->nlim;
  // np_int ndit = 2 * nsph * c4->nlim;
  dcomplex *am_vector = new dcomplex[ndit * ndit]();
  // dcomplex *am_vector = new dcomplex[ndit * ndit]();
  dcomplex **am = new dcomplex*[ndit];
  // dcomplex **am = new dcomplex*[ndit];
  for (int ai = 0; ai < ndit; ai++) {
  // for (int ai = 0; ai < ndit; ai++) {
    am[ai] = (am_vector + ai * ndit);
  //   am[ai] = (am_vector + ai * ndit);
  }
  // }
  int isq;
  // int isq;
  int ibf;
  // int ibf;






@@ -442,18 +513,18 @@ int cluster_jxi488_cycle(int jxi488, ScattererConfiguration *sconf, GeometryConf
  hjv(exri, vkarg, jer, lcalc, arg, c1, c1ao, c4);
  hjv(exri, vkarg, jer, lcalc, arg, c1, c1ao, c4);
  if (jer != 0) {
  if (jer != 0) {
    fprintf(output, "  STOP IN HJV\n");
    fprintf(output, "  STOP IN HJV\n");
    delete[] u;
    // delete[] u;
    delete[] us;
    // delete[] us;
    delete[] un;
    // delete[] un;
    delete[] uns;
    // delete[] uns;
    delete[] up;
    // delete[] up;
    delete[] ups;
    // delete[] ups;
    delete[] unmp;
    // delete[] unmp;
    delete[] unsmp;
    // delete[] unsmp;
    delete[] upmp;
    // delete[] upmp;
    delete[] upsmp;
    // delete[] upsmp;
    delete[] am_vector;
    // delete[] am_vector;
    delete[] am;
    // delete[] am;
    return jer;
    return jer;
    // break; // rewrite this to go to the end of the function, to free locally allocated variables and return jer
    // break; // rewrite this to go to the end of the function, to free locally allocated variables and return jer
  }
  }
@@ -483,35 +554,35 @@ int cluster_jxi488_cycle(int jxi488, ScattererConfiguration *sconf, GeometryConf
	  );
	  );
      if (jer != 0) {
      if (jer != 0) {
	fprintf(output, "  STOP IN DME\n");
	fprintf(output, "  STOP IN DME\n");
	delete[] u;
	// delete[] u;
	delete[] us;
	// delete[] us;
	delete[] un;
	// delete[] un;
	delete[] uns;
	// delete[] uns;
	delete[] up;
	// delete[] up;
	delete[] ups;
	// delete[] ups;
	delete[] unmp;
	// delete[] unmp;
	delete[] unsmp;
	// delete[] unsmp;
	delete[] upmp;
	// delete[] upmp;
	delete[] upsmp;
	// delete[] upsmp;
	delete[] am_vector;
	// delete[] am_vector;
	delete[] am;
	// delete[] am;
	return jer;
	return jer;
	//break;
	//break;
      }
      }
    }
    }
    if (jer != 0) {
    if (jer != 0) {
      delete[] u;
      // delete[] u;
      delete[] us;
      // delete[] us;
      delete[] un;
      // delete[] un;
      delete[] uns;
      // delete[] uns;
      delete[] up;
      // delete[] up;
      delete[] ups;
      // delete[] ups;
      delete[] unmp;
      // delete[] unmp;
      delete[] unsmp;
      // delete[] unsmp;
      delete[] upmp;
      // delete[] upmp;
      delete[] upsmp;
      // delete[] upsmp;
      delete[] am_vector;
      // delete[] am_vector;
      delete[] am;
      // delete[] am;
      return jer;
      return jer;
      //break;
      //break;
    }
    }
@@ -519,18 +590,18 @@ int cluster_jxi488_cycle(int jxi488, ScattererConfiguration *sconf, GeometryConf
  cms(am, c1, c1ao, c4, c6);
  cms(am, c1, c1ao, c4, c6);
  invert_matrix(am, ndit, jer, mxndm);
  invert_matrix(am, ndit, jer, mxndm);
  if (jer != 0) {
  if (jer != 0) {
    delete[] u;
    // delete[] u;
    delete[] us;
    // delete[] us;
    delete[] un;
    // delete[] un;
    delete[] uns;
    // delete[] uns;
    delete[] up;
    // delete[] up;
    delete[] ups;
    // delete[] ups;
    delete[] unmp;
    // delete[] unmp;
    delete[] unsmp;
    // delete[] unsmp;
    delete[] upmp;
    // delete[] upmp;
    delete[] upsmp;
    // delete[] upsmp;
    delete[] am_vector;
    // delete[] am_vector;
    delete[] am;
    // delete[] am;
    return jer;
    return jer;
    // break; // jxi488 loop: goes to memory clean
    // break; // jxi488 loop: goes to memory clean
  }
  }
@@ -1087,18 +1158,18 @@ int cluster_jxi488_cycle(int jxi488, ScattererConfiguration *sconf, GeometryConf
    th += thstp;
    th += thstp;
  } // jth486 loop
  } // jth486 loop


  delete[] u;
  // delete[] u;
  delete[] us;
  // delete[] us;
  delete[] un;
  // delete[] un;
  delete[] uns;
  // delete[] uns;
  delete[] up;
  // delete[] up;
  delete[] ups;
  // delete[] ups;
  delete[] unmp;
  // delete[] unmp;
  delete[] unsmp;
  // delete[] unsmp;
  delete[] upmp;
  // delete[] upmp;
  delete[] upsmp;
  // delete[] upsmp;
  delete[] am_vector;
  // delete[] am_vector;
  delete[] am;
  // delete[] am;


  printf(" done.\n");
  printf(" done.\n");


+2 −2
Original line number Original line Diff line number Diff line
@@ -53,7 +53,7 @@ class C9;
class GeometryConfiguration {
class GeometryConfiguration {
  //! Temporary work-around to allow cluster() and sphere() peeking in.
  //! Temporary work-around to allow cluster() and sphere() peeking in.
  friend void cluster(std::string, std::string, std::string);
  friend void cluster(std::string, std::string, std::string);
  friend int cluster_jxi488_cycle(int, ScattererConfiguration *, GeometryConfiguration *, C1 *, C1_AddOns *, C2 *,  C3 *,  C4 *,  C6 *,  C9 *, std::FILE *, std::string, double *, double **, dcomplex **, double **, dcomplex **, double ****, double **, dcomplex **, int, int, int, int, int, int, int, double *, double *, double **, dcomplex **, double **, dcomplex **, double **, dcomplex **, double *, std::fstream &, double **, double **, double **, double **, double *, double *, double *);
  friend int cluster_jxi488_cycle(int, ScattererConfiguration *, GeometryConfiguration *, C1 *, C1_AddOns *, C2 *,  C3 *,  C4 *,  C6 *,  C9 *, std::FILE *, std::string, double *, double **, dcomplex **, double **, dcomplex **, double ****, double **, dcomplex **, int, int, int, int, int, int, int, double *, double *, double **, dcomplex **, double **, dcomplex **, double **, dcomplex **, double *, std::fstream &, double **, double **, double **, double **, double *, double *, double *, int &, int &, np_int &, int &, int &, int &, int &, int &, int &, double &, double &, double &, double &, double &, double &, double &, double &, double &, double &, double &, double &, double &, double &, double &, double &, double &, double *, double *, double *, double *, double *, double *, double *, double *, double *, double *, double &, double &, double &, double &, double &, double &, double &, int &, dcomplex &, double &, double &, np_int &, dcomplex **, int &, int &);
  friend void sphere(std::string, std::string, std::string);
  friend void sphere(std::string, std::string, std::string);
protected:
protected:
  //! \brief Number of spherical components.
  //! \brief Number of spherical components.
@@ -180,7 +180,7 @@ public:
class ScattererConfiguration {
class ScattererConfiguration {
  //! Temporary work-around to allow cluster() and sphere() peeking in.
  //! Temporary work-around to allow cluster() and sphere() peeking in.
  friend void cluster(std::string, std::string, std::string);
  friend void cluster(std::string, std::string, std::string);
  friend int cluster_jxi488_cycle(int, ScattererConfiguration *, GeometryConfiguration *, C1 *, C1_AddOns *, C2 *,  C3 *,  C4 *,  C6 *,  C9 *, std::FILE *, std::string, double *, double **, dcomplex **, double **, dcomplex **, double ****, double **, dcomplex **, int, int, int, int, int, int, int, double *, double *, double **, dcomplex **, double **, dcomplex **, double **, dcomplex **, double *, std::fstream &, double **, double **, double **, double **, double *, double *, double *);
  friend int cluster_jxi488_cycle(int, ScattererConfiguration *, GeometryConfiguration *, C1 *, C1_AddOns *, C2 *,  C3 *,  C4 *,  C6 *,  C9 *, std::FILE *, std::string, double *, double **, dcomplex **, double **, dcomplex **, double ****, double **, dcomplex **, int, int, int, int, int, int, int, double *, double *, double **, dcomplex **, double **, dcomplex **, double **, dcomplex **, double *, std::fstream &, double **, double **, double **, double **, double *, double *, double *, int &, int &, np_int &, int &, int &, int &, int &, int &, int &, double &, double &, double &, double &, double &, double &, double &, double &, double &, double &, double &, double &, double &, double &, double &, double &, double &, double *, double *, double *, double *, double *, double *, double *, double *, double *, double *, double &, double &, double &, double &, double &, double &, double &, int &, dcomplex &, double &, double &, np_int &, dcomplex **, int &, int &);
  friend void sphere(std::string, std::string, std::string);
  friend void sphere(std::string, std::string, std::string);
protected:
protected:
  //! \brief Matrix of dielectric parameters with size [NON_TRANS_LAYERS x N_SPHERES x N_SCALES].
  //! \brief Matrix of dielectric parameters with size [NON_TRANS_LAYERS x N_SPHERES x N_SCALES].