public void TestAssignrPiMarsilliFactors_IAtomContainerSet()
        {
            GasteigerPEPEPartialCharges peoe = new GasteigerPEPEPartialCharges();

            IAtomContainer molecule = builder.NewAtomContainer();

            molecule.Atoms.Add(builder.NewAtom("C"));
            molecule.Atoms.Add(builder.NewAtom("F"));
            molecule.AddBond(molecule.Atoms[0], molecule.Atoms[1], BondOrder.Single);

            AddExplicitHydrogens(molecule);
            AtomContainerManipulator.PercieveAtomTypesAndConfigureAtoms(molecule);
            CDK.LonePairElectronChecker.Saturate(molecule);
            foreach (var atom in molecule.Atoms)
            {
                atom.Charge = 0;
            }

            var set = builder.NewAtomContainerSet();

            set.Add(molecule);
            set.Add(molecule);

            AddExplicitHydrogens(molecule);
            AtomContainerManipulator.PercieveAtomTypesAndConfigureAtoms(molecule);
            CDK.LonePairElectronChecker.Saturate(molecule);

            Assert.IsNotNull(peoe.AssignrPiMarsilliFactors(set));
        }
        /// <summary>
        /// Calculate the electronegativity of orbitals pi.
        /// </summary>
        /// <param name="ac"></param>
        /// <param name="atom">atom for which effective atom electronegativity should be calculated</param>
        /// <param name="maxIterations">The maximal number of Iteration</param>
        /// <param name="maxResonStruc">The maximal number of Resonance Structures</param>
        /// <returns>Electronegativity of orbitals pi.</returns>
        public double CalculatePiElectronegativity(IAtomContainer ac, IAtom atom, int maxIterations, int maxResonStruc)
        {
            MaxIterations          = maxIterations;
            MaxResonanceStructures = maxResonStruc;

            double electronegativity = 0;

            try
            {
                if (!ac.Equals(acOldP))
                {
                    molPi = ac.Builder.NewAtomContainer(ac);

                    peoe = new GasteigerMarsiliPartialCharges();
                    peoe.AssignGasteigerMarsiliSigmaPartialCharges(molPi, true);
                    var iSet = ac.Builder.NewAtomContainerSet();
                    iSet.Add(molPi);
                    iSet.Add(molPi);

                    gasteigerFactors = pepe.AssignrPiMarsilliFactors(iSet);

                    acOldP = ac;
                }
                IAtom  atomi        = molPi.Atoms[ac.Atoms.IndexOf(atom)];
                int    atomPosition = molPi.Atoms.IndexOf(atomi);
                int    stepSize     = pepe.StepSize;
                int    start        = (stepSize * (atomPosition) + atomPosition);
                double q            = atomi.Charge.Value;
                if (molPi.GetConnectedLonePairs(molPi.Atoms[atomPosition]).Any() ||
                    molPi.GetMaximumBondOrder(atomi) != BondOrder.Single || atomi.FormalCharge != 0)
                {
                    return((gasteigerFactors[1][start]) + (q * gasteigerFactors[1][start + 1]) + (gasteigerFactors[1][start + 2] * (q * q)));
                }
            }
            catch (Exception e)
            {
                Trace.TraceError(e.StackTrace);
            }

            return(electronegativity);
        }