test_class.declarator: builder = SilentChemObjectBuilder.getInstance()
test_class.modifier: private
test_class.original_string: private IChemObjectBuilder      builder = SilentChemObjectBuilder.getInstance();
test_class.type: IChemObjectBuilder
test_class.var_name: builder
test_class.declarator: lpcheck = new LonePairElectronChecker()
test_class.modifier: private
test_class.original_string: private LonePairElectronChecker lpcheck = new LonePairElectronChecker();
test_class.type: LonePairElectronChecker
test_class.var_name: lpcheck
test_class.file: tool/charges/src/test/java/org/openscience/cdk/charges/GasteigerPEPEPartialChargesTest.java
test_class.identifier: GasteigerPEPEPartialChargesTest
test_class.superclass: extends CDKTestCase
test_case.body: @Test
      public void testAssignGasteigerPiPartialCharges_IAtomContainer_Boolean() throws Exception {
          double[] testResult = {0.0, 0.0, 0.0, 0.0, 0.0};
  
          GasteigerPEPEPartialCharges peoe = new GasteigerPEPEPartialCharges();
  
          IAtomContainer molecule = builder.newInstance(IAtomContainer.class);
          molecule.addAtom(new Atom("C"));
          molecule.addAtom(new Atom("F"));
          molecule.addBond(0, 1, IBond.Order.SINGLE);
  
          addExplicitHydrogens(molecule);
          AtomContainerManipulator.percieveAtomTypesAndConfigureAtoms(molecule);
          lpcheck.saturate(molecule);
  
          peoe.assignGasteigerPiPartialCharges(molecule, true);
          for (int i = 0; i < molecule.getAtomCount(); i++) {
              //logger.debug("Charge for atom:"+i+" S:"+mol.getAtomAt(i).getSymbol()+" Charge:"+mol.getAtomAt(i).getCharge());
              Assert.assertEquals(testResult[i], molecule.getAtom(i).getCharge(), 0.01);
          }
  
      }
test_case.class_method_signature: GasteigerPEPEPartialChargesTest.testAssignGasteigerPiPartialCharges_IAtomContainer_Boolean()
test_case.full_signature: @Test public void testAssignGasteigerPiPartialCharges_IAtomContainer_Boolean()
test_case.identifier: testAssignGasteigerPiPartialCharges_IAtomContainer_Boolean
test_case.invocations: newInstance addAtom addAtom addBond addExplicitHydrogens percieveAtomTypesAndConfigureAtoms saturate assignGasteigerPiPartialCharges getAtomCount assertEquals getCharge getAtom
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testAssignGasteigerPiPartialCharges_IAtomContainer_Boolean()
focal_class.declarator: MX_ITERATIONS = 8
focal_class.modifier: private
focal_class.original_string: private int                 MX_ITERATIONS = 8;
focal_class.type: int
focal_class.var_name: MX_ITERATIONS
focal_class.declarator: MX_RESON      = 50
focal_class.modifier: private
focal_class.original_string: private int                 MX_RESON      = 50;
focal_class.type: int
focal_class.var_name: MX_RESON
focal_class.declarator: STEP_SIZE     = 5
focal_class.modifier: private
focal_class.original_string: private int                 STEP_SIZE     = 5;
focal_class.type: int
focal_class.var_name: STEP_SIZE
focal_class.declarator: factory
focal_class.modifier: private
focal_class.original_string: private AtomTypeFactory     factory;
focal_class.type: AtomTypeFactory
focal_class.var_name: factory
focal_class.declarator: ISCHANGEDFC   = 0x1
focal_class.modifier: private static
focal_class.original_string: private static int          ISCHANGEDFC   = 0x1;
focal_class.type: int
focal_class.var_name: ISCHANGEDFC
focal_class.declarator: fE            = 1.1
focal_class.modifier: private
focal_class.original_string: private double              fE            = 1.1;
focal_class.type: double
focal_class.var_name: fE
focal_class.declarator: fS            = 0.37
focal_class.modifier: private
focal_class.original_string: private double              fS            = 0.37;
focal_class.type: double
focal_class.var_name: fS
focal_class.declarator: logger        = LoggingToolFactory.createLoggingTool(GasteigerPEPEPartialCharges.class)
focal_class.modifier: private static
focal_class.original_string: private static ILoggingTool logger        = LoggingToolFactory.createLoggingTool(GasteigerPEPEPartialCharges.class);
focal_class.type: ILoggingTool
focal_class.var_name: logger
focal_class.file: tool/charges/src/main/java/org/openscience/cdk/charges/GasteigerPEPEPartialCharges.java
focal_class.identifier: GasteigerPEPEPartialCharges
focal_class.interfaces: implements IChargeCalculator
focal_class.class_method_signature: GasteigerPEPEPartialCharges.GasteigerPEPEPartialCharges()
focal_class.full_signature: public  GasteigerPEPEPartialCharges()
focal_class.identifier: GasteigerPEPEPartialCharges
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.signature:  GasteigerPEPEPartialCharges()
focal_class.class_method_signature: GasteigerPEPEPartialCharges.setMaxGasteigerIters(int iters)
focal_class.full_signature: public void setMaxGasteigerIters(int iters)
focal_class.identifier: setMaxGasteigerIters
focal_class.modifiers: public
focal_class.parameters: (int iters)
focal_class.return: void
focal_class.signature: void setMaxGasteigerIters(int iters)
focal_class.class_method_signature: GasteigerPEPEPartialCharges.setMaxResoStruc(int numbReson)
focal_class.full_signature: public void setMaxResoStruc(int numbReson)
focal_class.identifier: setMaxResoStruc
focal_class.modifiers: public
focal_class.parameters: (int numbReson)
focal_class.return: void
focal_class.signature: void setMaxResoStruc(int numbReson)
focal_class.class_method_signature: GasteigerPEPEPartialCharges.getMaxGasteigerIters()
focal_class.full_signature: public int getMaxGasteigerIters()
focal_class.identifier: getMaxGasteigerIters
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: int
focal_class.signature: int getMaxGasteigerIters()
focal_class.class_method_signature: GasteigerPEPEPartialCharges.getMaxResoStruc()
focal_class.full_signature: public int getMaxResoStruc()
focal_class.identifier: getMaxResoStruc
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: int
focal_class.signature: int getMaxResoStruc()
focal_class.class_method_signature: GasteigerPEPEPartialCharges.assignGasteigerPiPartialCharges(IAtomContainer ac, boolean setCharge)
focal_class.full_signature: public IAtomContainer assignGasteigerPiPartialCharges(IAtomContainer ac, boolean setCharge)
focal_class.identifier: assignGasteigerPiPartialCharges
focal_class.modifiers: public
focal_class.parameters: (IAtomContainer ac, boolean setCharge)
focal_class.return: IAtomContainer
focal_class.signature: IAtomContainer assignGasteigerPiPartialCharges(IAtomContainer ac, boolean setCharge)
focal_class.class_method_signature: GasteigerPEPEPartialCharges.calculateCharges(IAtomContainer container)
focal_class.full_signature: @Override public void calculateCharges(IAtomContainer container)
focal_class.identifier: calculateCharges
focal_class.modifiers: @Override public
focal_class.parameters: (IAtomContainer container)
focal_class.return: void
focal_class.signature: void calculateCharges(IAtomContainer container)
focal_class.class_method_signature: GasteigerPEPEPartialCharges.removingFlagsAromaticity(IAtomContainer ac)
focal_class.full_signature: private IAtomContainer removingFlagsAromaticity(IAtomContainer ac)
focal_class.identifier: removingFlagsAromaticity
focal_class.modifiers: private
focal_class.parameters: (IAtomContainer ac)
focal_class.return: IAtomContainer
focal_class.signature: IAtomContainer removingFlagsAromaticity(IAtomContainer ac)
focal_class.class_method_signature: GasteigerPEPEPartialCharges.setFlags(IAtomContainer container, IAtomContainer ac, boolean b)
focal_class.full_signature: private IAtomContainer setFlags(IAtomContainer container, IAtomContainer ac, boolean b)
focal_class.identifier: setFlags
focal_class.modifiers: private
focal_class.parameters: (IAtomContainer container, IAtomContainer ac, boolean b)
focal_class.return: IAtomContainer
focal_class.signature: IAtomContainer setFlags(IAtomContainer container, IAtomContainer ac, boolean b)
focal_class.class_method_signature: GasteigerPEPEPartialCharges.setAntiFlags(IAtomContainer container, IAtomContainer ac, int number, boolean b)
focal_class.full_signature: private IAtomContainer setAntiFlags(IAtomContainer container, IAtomContainer ac, int number, boolean b)
focal_class.identifier: setAntiFlags
focal_class.modifiers: private
focal_class.parameters: (IAtomContainer container, IAtomContainer ac, int number, boolean b)
focal_class.return: IAtomContainer
focal_class.signature: IAtomContainer setAntiFlags(IAtomContainer container, IAtomContainer ac, int number, boolean b)
focal_class.class_method_signature: GasteigerPEPEPartialCharges.getHyperconjugationInteractions(IAtomContainer ac, IAtomContainerSet iSet)
focal_class.full_signature: private IAtomContainerSet getHyperconjugationInteractions(IAtomContainer ac, IAtomContainerSet iSet)
focal_class.identifier: getHyperconjugationInteractions
focal_class.modifiers: private
focal_class.parameters: (IAtomContainer ac, IAtomContainerSet iSet)
focal_class.return: IAtomContainerSet
focal_class.signature: IAtomContainerSet getHyperconjugationInteractions(IAtomContainer ac, IAtomContainerSet iSet)
focal_class.class_method_signature: GasteigerPEPEPartialCharges.getElectrostaticPotentialN(IAtomContainer ac, int atom1, double[] ds)
focal_class.full_signature: private double getElectrostaticPotentialN(IAtomContainer ac, int atom1, double[] ds)
focal_class.identifier: getElectrostaticPotentialN
focal_class.modifiers: private
focal_class.parameters: (IAtomContainer ac, int atom1, double[] ds)
focal_class.return: double
focal_class.signature: double getElectrostaticPotentialN(IAtomContainer ac, int atom1, double[] ds)
focal_class.class_method_signature: GasteigerPEPEPartialCharges.getTopologicalFactors(IAtomContainer atomContainer, IAtomContainer ac)
focal_class.full_signature: private double getTopologicalFactors(IAtomContainer atomContainer, IAtomContainer ac)
focal_class.identifier: getTopologicalFactors
focal_class.modifiers: private
focal_class.parameters: (IAtomContainer atomContainer, IAtomContainer ac)
focal_class.return: double
focal_class.signature: double getTopologicalFactors(IAtomContainer atomContainer, IAtomContainer ac)
focal_class.class_method_signature: GasteigerPEPEPartialCharges.getStepSize()
focal_class.full_signature: public int getStepSize()
focal_class.identifier: getStepSize
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: int
focal_class.signature: int getStepSize()
focal_class.class_method_signature: GasteigerPEPEPartialCharges.setStepSize(int step)
focal_class.full_signature: public void setStepSize(int step)
focal_class.identifier: setStepSize
focal_class.modifiers: public
focal_class.parameters: (int step)
focal_class.return: void
focal_class.signature: void setStepSize(int step)
focal_class.class_method_signature: GasteigerPEPEPartialCharges.assignPiFactors(IAtomContainerSet setAc)
focal_class.full_signature: private double[][] assignPiFactors(IAtomContainerSet setAc)
focal_class.identifier: assignPiFactors
focal_class.modifiers: private
focal_class.parameters: (IAtomContainerSet setAc)
focal_class.return: double[][]
focal_class.signature: double[][] assignPiFactors(IAtomContainerSet setAc)
focal_class.class_method_signature: GasteigerPEPEPartialCharges.assignrPiMarsilliFactors(IAtomContainerSet setAc)
focal_class.full_signature: public double[][] assignrPiMarsilliFactors(IAtomContainerSet setAc)
focal_class.identifier: assignrPiMarsilliFactors
focal_class.modifiers: public
focal_class.parameters: (IAtomContainerSet setAc)
focal_class.return: double[][]
focal_class.signature: double[][] assignrPiMarsilliFactors(IAtomContainerSet setAc)
focal_class.class_method_signature: GasteigerPEPEPartialCharges.cleanFlagReactiveCenter(IAtomContainer ac)
focal_class.full_signature: private void cleanFlagReactiveCenter(IAtomContainer ac)
focal_class.identifier: cleanFlagReactiveCenter
focal_class.modifiers: private
focal_class.parameters: (IAtomContainer ac)
focal_class.return: void
focal_class.signature: void cleanFlagReactiveCenter(IAtomContainer ac)
focal_method.body: public IAtomContainer assignGasteigerPiPartialCharges(IAtomContainer ac, boolean setCharge) throws Exception {
  
          // we save the aromaticity flags for the input molecule so that
          // we can add them back before we return
          boolean[] oldBondAromaticity = new boolean[ac.getBondCount()];
          boolean[] oldAtomAromaticity = new boolean[ac.getAtomCount()];
          for (int i = 0; i < ac.getAtomCount(); i++)
              oldAtomAromaticity[i] = ac.getAtom(i).getFlag(CDKConstants.ISAROMATIC);
          for (int i = 0; i < ac.getBondCount(); i++)
              oldBondAromaticity[i] = ac.getBond(i).getFlag(CDKConstants.ISAROMATIC);
  
          IAtomContainerSet setHI = null;
  
          /* 0: remove charge, and possible flag ac */
          for (int j = 0; j < ac.getAtomCount(); j++) {
              ac.getAtom(j).setCharge(0.0);
              ac.getAtom(j).setFlag(ISCHANGEDFC, false);
          }
          for (int j = 0; j < ac.getBondCount(); j++) {
              ac.getBond(j).setFlag(ISCHANGEDFC, false);
          }
  
          /* 1: detect resonance structure */
          StructureResonanceGenerator gR1 = new StructureResonanceGenerator();/*
                                                                               * according
                                                                               * G
                                                                               * .
                                                                               * should
                                                                               * be
                                                                               * integrated
                                                                               * the
                                                                               * breaking
                                                                               * bonding
                                                                               */
          List<IReactionProcess> reactionList1 = gR1.getReactions();
          List<IParameterReact> paramList1 = new ArrayList<IParameterReact>();
          IParameterReact param = new SetReactionCenter();
          param.setParameter(Boolean.TRUE);
          paramList1.add(param);
          HeterolyticCleavagePBReaction reactionHCPB = new HeterolyticCleavagePBReaction();
          reactionHCPB.setParameterList(paramList1);
          reactionList1.add(new SharingAnionReaction());
          Iterator<IReactionProcess> itReaction = reactionList1.iterator();
          while (itReaction.hasNext()) {
              IReactionProcess reaction = itReaction.next();
              reaction.setParameterList(paramList1);
          }
          gR1.setReactions(reactionList1);
  
          StructureResonanceGenerator gR2 = new StructureResonanceGenerator();/*
                                                                               * according
                                                                               * G
                                                                               * .
                                                                               * should
                                                                               * be
                                                                               * integrated
                                                                               * the
                                                                               * breaking
                                                                               * bonding
                                                                               */
          gR2.setMaximalStructures(MX_RESON);
          List<IReactionProcess> reactionList2 = gR2.getReactions();
          List<IParameterReact> paramList = new ArrayList<IParameterReact>();
          IParameterReact paramA = new SetReactionCenter();
          paramA.setParameter(Boolean.TRUE);
          paramList.add(paramA);
          reactionList2.add(new HeterolyticCleavagePBReaction());
          reactionList2.add(new SharingAnionReaction());
          itReaction = reactionList2.iterator();
          while (itReaction.hasNext()) {
              IReactionProcess reaction = itReaction.next();
              reaction.setParameterList(paramList);
          }
          gR2.setReactions(reactionList2);
  
          /* find resonance containers, which eliminates the repetitions */
          StructureResonanceGenerator gRN = new StructureResonanceGenerator();/*
                                                                               * according
                                                                               * G
                                                                               * .
                                                                               * should
                                                                               * be
                                                                               * integrated
                                                                               * the
                                                                               * breaking
                                                                               * bonding
                                                                               */
          IAtomContainerSet acSet = gRN.getContainers(removingFlagsAromaticity(ac));
          //		IAtomContainerSet acSet = ConjugatedPiSystemsDetector.detect(removingFlagsAromaticity(ac));
  
          IAtomContainerSet iSet = ac.getBuilder().newInstance(IAtomContainerSet.class);
          iSet.addAtomContainer(ac);
  
          if (acSet != null) for (Iterator<IAtomContainer> it = acSet.atomContainers().iterator(); it.hasNext();) {
              IAtomContainer container = it.next();
              ac = setFlags(container, ac, true);
  
              // Aromatic don't break its double bond homolytically
              if (Aromaticity.cdkLegacy().apply(ac))
                  reactionList1.remove(reactionHCPB);
              else
                  reactionList1.add(reactionHCPB);
  
              IAtomContainerSet a = gR1.getStructures(removingFlagsAromaticity(ac));
              if (a.getAtomContainerCount() > 1) {
                  for (int j = 1; j < a.getAtomContainerCount(); j++) { // the first is already added
                      iSet.addAtomContainer(a.getAtomContainer(j));
                  }
              }
              ac = setFlags(container, ac, false);
  
              /* processing for bonds which are not in resonance */
              for (int number = 0; number < ac.getBondCount(); number++) {
                  IAtomContainer aa = setAntiFlags(container, ac, number, true);
                  if (aa != null) {
                      IAtomContainerSet ab = gR2.getStructures(aa);
                      if (ab.getAtomContainerCount() > 1) for (int j = 1; j < ab.getAtomContainerCount(); j++) { // the first is already added
                              iSet.addAtomContainer(ab.getAtomContainer(j));
                          }
                      ac = setAntiFlags(container, aa, number, false);
                  }
              }
          }
  
          /* detect hyperconjugation interactions */
          setHI = getHyperconjugationInteractions(ac, iSet);
  
          if (setHI != null) {
              if (setHI.getAtomContainerCount() != 0) iSet.add(setHI);
              logger.debug("setHI: " + iSet.getAtomContainerCount());
          }
          if (iSet.getAtomContainerCount() < 2) {
              for (int i = 0; i < ac.getAtomCount(); i++)
                  ac.getAtom(i).setFlag(CDKConstants.ISAROMATIC, oldAtomAromaticity[i]);
              for (int i = 0; i < ac.getBondCount(); i++)
                  ac.getBond(i).setFlag(CDKConstants.ISAROMATIC, oldBondAromaticity[i]);
              return ac;
          }
  
          /*
           * 2: search whose atoms which don't keep their formal charge and set flags
           */
          double[][] sumCharges = new double[iSet.getAtomContainerCount()][ac.getAtomCount()];
          for (int i = 1; i < iSet.getAtomContainerCount(); i++) {
              IAtomContainer iac = iSet.getAtomContainer(i);
              for (int j = 0; j < iac.getAtomCount(); j++)
                  sumCharges[i][j] = iac.getAtom(j).getFormalCharge();
  
          }
  
          for (int i = 1; i < iSet.getAtomContainerCount(); i++) {
              IAtomContainer iac = iSet.getAtomContainer(i);
              int count = 0;
              for (int j = 0; j < ac.getAtomCount(); j++)
                  if (count < 2) if (sumCharges[i][j] != ac.getAtom(j).getFormalCharge()) {
                      ac.getAtom(j).setFlag(ISCHANGEDFC, true);
                      iac.getAtom(j).setFlag(ISCHANGEDFC, true);
                      count++; /* TODO- error */
                  }
          }
  
          /* 3: set sigma charge (PEOE). Initial start point */
          GasteigerMarsiliPartialCharges peoe = new GasteigerMarsiliPartialCharges();;
          peoe.setMaxGasteigerIters(6);
          IAtomContainer acCloned;
  
          double[][] gasteigerFactors = assignPiFactors(iSet);//a,b,c,deoc,chi,q
  
          /* 4: calculate topological weight factors Wt=fQ*fB*fA */
          double[] Wt = new double[iSet.getAtomContainerCount() - 1];
          for (int i = 1; i < iSet.getAtomContainerCount(); i++) {
              Wt[i - 1] = getTopologicalFactors(iSet.getAtomContainer(i), ac);
              logger.debug(", W:" + Wt[i - 1]);
              try {
                  acCloned = (IAtomContainer) iSet.getAtomContainer(i).clone();
  
                  acCloned = peoe.assignGasteigerMarsiliSigmaPartialCharges(acCloned, true);
                  for (int j = 0; j < acCloned.getAtomCount(); j++)
                      if (iSet.getAtomContainer(i).getAtom(j).getFlag(ISCHANGEDFC)) {
                          gasteigerFactors[i][STEP_SIZE * j + j + 5] = acCloned.getAtom(j).getCharge();
                      }
              } catch (CloneNotSupportedException e) {
                  throw new CDKException("Could not clone ac", e);
              }
          }
  
          /*
           * calculate electronegativity for changed atoms and make the difference
           * between whose atoms which change their formal charge
           */
          for (int iter = 0; iter < MX_ITERATIONS; iter++) {
              //		for (int iter = 0; iter < 1; iter++) {
              for (int k = 1; k < iSet.getAtomContainerCount(); k++) {
                  IAtomContainer iac = iSet.getAtomContainer(k);
                  double[] electronegativity = new double[2];
                  int count = 0;
                  int atom1 = 0;
                  int atom2 = 0;
                  for (int j = 0; j < iac.getAtomCount(); j++) {
                      if (count == 2) /*
                                       * The change of sign is product of only two
                                       * atoms, is not true
                                       */
                      break;
                      if (iac.getAtom(j).getFlag(ISCHANGEDFC)) {
                          logger.debug("Atom: " + j + ", S:" + iac.getAtom(j).getSymbol() + ", C:"
                                  + iac.getAtom(j).getFormalCharge());
                          if (count == 0)
                              atom1 = j;
                          else
                              atom2 = j;
  
                          double q1 = gasteigerFactors[k][STEP_SIZE * j + j + 5];
                          electronegativity[count] = gasteigerFactors[k][STEP_SIZE * j + j + 2] * q1 * q1
                                  + gasteigerFactors[k][STEP_SIZE * j + j + 1] * q1
                                  + gasteigerFactors[k][STEP_SIZE * j + j];
                          logger.debug("e:" + electronegativity[count] + ",q1: " + q1 + ", c:"
                                  + gasteigerFactors[k][STEP_SIZE * j + j + 2] + ", b:"
                                  + gasteigerFactors[k][STEP_SIZE * j + j + 1] + ", a:"
                                  + gasteigerFactors[k][STEP_SIZE * j + j]);
                          count++;
                      }
                  }
                  logger.debug("Atom1:" + atom1 + ",Atom2:" + atom2);
                  /* difference of electronegativity 1 lower */
                  double max1 = Math.max(electronegativity[0], electronegativity[1]);
                  double min1 = Math.min(electronegativity[0], electronegativity[1]);
                  double DX = 1.0;
                  if (electronegativity[0] < electronegativity[1])
                      DX = gasteigerFactors[k][STEP_SIZE * atom1 + atom1 + 3];
                  else
                      DX = gasteigerFactors[k][STEP_SIZE * atom2 + atom2 + 3];
  
                  double Dq = (max1 - min1) / DX;
                  logger.debug("Dq : " + Dq + " = (" + max1 + "-" + min1 + ")/" + DX);
                  double epN1 = getElectrostaticPotentialN(iac, atom1, gasteigerFactors[k]);
                  double epN2 = getElectrostaticPotentialN(iac, atom2, gasteigerFactors[k]);
                  double SumQN = Math.abs(epN1 - epN2);
                  logger.debug("sum(" + SumQN + ") = (" + epN1 + ") - (" + epN2 + ")");
  
                  /* electronic weight */
                  double WE = Dq + fE * SumQN;
                  logger.debug("WE : " + WE + " = Dq(" + Dq + ")+fE(" + fE + ")*SumQN(" + SumQN);
                  int iTE = iter + 1;
  
                  /* total topological */
                  double W = WE * Wt[k - 1] * fS / (iTE);
                  logger.debug("W : " + W + " = WE(" + WE + ")*Wt(" + Wt[k - 1] + ")*fS(" + fS + ")/iter(" + iTE
                          + "), atoms: " + atom1 + ", " + atom2);
  
                  /* iac == new structure, ac == old structure */
                  /* atom1 */
                  if (iac.getAtom(atom1).getFormalCharge() == 0) {
                      if (ac.getAtom(atom1).getFormalCharge() < 0) {
                          gasteigerFactors[k][STEP_SIZE * atom1 + atom1 + 5] = -1 * W;
                      } else {
                          gasteigerFactors[k][STEP_SIZE * atom1 + atom1 + 5] = W;
                      }
                  } else if (iac.getAtom(atom1).getFormalCharge() > 0) {
                      gasteigerFactors[k][STEP_SIZE * atom1 + atom1 + 5] = W;
                  } else {
                      gasteigerFactors[k][STEP_SIZE * atom1 + atom1 + 5] = -1 * W;
                  }
                  /* atom2 */
                  if (iac.getAtom(atom2).getFormalCharge() == 0) {
                      if (ac.getAtom(atom2).getFormalCharge() < 0) {
                          gasteigerFactors[k][STEP_SIZE * atom2 + atom2 + 5] = -1 * W;
                      } else {
                          gasteigerFactors[k][STEP_SIZE * atom2 + atom2 + 5] = W;
                      }
                  } else if (iac.getAtom(atom2).getFormalCharge() > 0) {
                      gasteigerFactors[k][STEP_SIZE * atom2 + atom2 + 5] = W;
                  } else {
                      gasteigerFactors[k][STEP_SIZE * atom2 + atom2 + 5] = -1 * W;
                  }
  
              }
              for (int k = 1; k < iSet.getAtomContainerCount(); k++) {
  
                  for (int i = 0; i < ac.getAtomCount(); i++)
                      if (iSet.getAtomContainer(k).getAtom(i).getFlag(ISCHANGEDFC)) {
                          double charge = ac.getAtom(i).getCharge();
                          double chargeT = 0.0;
                          chargeT = charge + gasteigerFactors[k][STEP_SIZE * i + i + 5];
                          logger.debug("i<|" + ac.getAtom(i).getSymbol() + ", " + chargeT + "=c:" + charge + "+g: "
                                  + gasteigerFactors[k][STEP_SIZE * i + i + 5]);
                          ac.getAtom(i).setCharge(chargeT);
                      }
              }
  
          }// iterations
          logger.debug("final");
  
          // before getting back we should set back the aromatic flags
          for (int i = 0; i < ac.getAtomCount(); i++)
              ac.getAtom(i).setFlag(CDKConstants.ISAROMATIC, oldAtomAromaticity[i]);
          for (int i = 0; i < ac.getBondCount(); i++)
              ac.getBond(i).setFlag(CDKConstants.ISAROMATIC, oldBondAromaticity[i]);
  
          return ac;
  
      }
focal_method.class_method_signature: GasteigerPEPEPartialCharges.assignGasteigerPiPartialCharges(IAtomContainer ac, boolean setCharge)
focal_method.full_signature: public IAtomContainer assignGasteigerPiPartialCharges(IAtomContainer ac, boolean setCharge)
focal_method.identifier: assignGasteigerPiPartialCharges
focal_method.invocations: getBondCount getAtomCount getAtomCount getFlag getAtom getBondCount getFlag getBond getAtomCount setCharge getAtom setFlag getAtom getBondCount setFlag getBond getReactions setParameter add setParameterList add iterator hasNext next setParameterList setReactions setMaximalStructures getReactions setParameter add add add iterator hasNext next setParameterList setReactions getContainers removingFlagsAromaticity newInstance getBuilder addAtomContainer iterator atomContainers hasNext next setFlags apply cdkLegacy remove add getStructures removingFlagsAromaticity getAtomContainerCount getAtomContainerCount addAtomContainer getAtomContainer setFlags getBondCount setAntiFlags getStructures getAtomContainerCount getAtomContainerCount addAtomContainer getAtomContainer setAntiFlags getHyperconjugationInteractions getAtomContainerCount add debug getAtomContainerCount getAtomContainerCount getAtomCount setFlag getAtom getBondCount setFlag getBond getAtomContainerCount getAtomCount getAtomContainerCount getAtomContainer getAtomCount getFormalCharge getAtom getAtomContainerCount getAtomContainer getAtomCount getFormalCharge getAtom setFlag getAtom setFlag getAtom setMaxGasteigerIters assignPiFactors getAtomContainerCount getAtomContainerCount getTopologicalFactors getAtomContainer debug clone getAtomContainer assignGasteigerMarsiliSigmaPartialCharges getAtomCount getFlag getAtom getAtomContainer getCharge getAtom getAtomContainerCount getAtomContainer getAtomCount getFlag getAtom debug getSymbol getAtom getFormalCharge getAtom debug debug max min debug getElectrostaticPotentialN getElectrostaticPotentialN abs debug debug debug getFormalCharge getAtom getFormalCharge getAtom getFormalCharge getAtom getFormalCharge getAtom getFormalCharge getAtom getFormalCharge getAtom getAtomContainerCount getAtomCount getFlag getAtom getAtomContainer getCharge getAtom debug getSymbol getAtom setCharge getAtom debug getAtomCount setFlag getAtom getBondCount setFlag getBond
focal_method.modifiers: public
focal_method.parameters: (IAtomContainer ac, boolean setCharge)
focal_method.return: IAtomContainer
focal_method.signature: IAtomContainer assignGasteigerPiPartialCharges(IAtomContainer ac, boolean setCharge)