class ALOGPDescriptor extends AbstractMolecularDescriptor implements IMolecularDescriptor {

    private double[] calculate(IAtomContainer atomContainer, String[] fragment, IRingSet rs) throws CDKException {
        this.atomContainer = atomContainer;
        this.fragment = fragment;
        this.rs = rs;
        alogp = 0.0;
        amr = 0.0;
        alogp2 = 0.0;

        alogpfrag = new int[atomContainer.getAtomCount()];

        for (int i = 1; i <= 120; i++) {
            frags[i] = 0;
        }

        for (int i = 0; i < atomContainer.getAtomCount(); i++) {
            // alogpfrag[i] = 0; // not needed (new array initalized above)
            try {
                if (fragment[i] != null) {
                    calcGroup001_005(i);
                    calcGroup002_006_007(i);
                    calcGroup003_008_009_010(i);
                    calcGroup004_011_to_014(i);
                    calcGroup015(i);
                    calcGroup016_018_036_037(i);
                    calcGroup017_019_020_038_to_041(i);
                    calcGroup021_to_023_040(i);
                    calcGroup024_027_030_033_042(i);
                    calcGroup025_026_028_029_031_032_034_035_043_044(i);
                    calcGroup056_57(i);
                    calcGroup058_61(i);
                    calcGroup059_060_063(i);
                    calcGroup066_to_079(i);
                    calcGroup081_to_085(i);
                    calcGroup086_to_090(i);
                    calcGroup091_to_095(i);
                    calcGroup096_to_100(i);
                    calcGroup101_to_104(i);
                    calcGroup106(i);
                    calcGroup107(i);
                    calcGroup108(i);
                    calcGroup109(i);
                    calcGroup110(i);
                    calcGroup111(i);
                    calcGroup112(i);
                    calcGroup115(i);
                    calcGroup116_117_120(i);
                    calcGroup118_119(i);
                }
            } catch (Exception e) {
                throw new CDKException(e.toString(), e);
            }
        } // end i atom loop

        logger.debug("\nFound fragments and frequencies ");

        for (int i = 1; i <= 120; i++) {
            alogp += FRAGVAL[i] * frags[i];
            amr += REFRACVAL[i] * frags[i];
            if (frags[i] > 0) {
                logger.debug("frag " + i + "  --> " + frags[i]);
            }
        }
        alogp2 = alogp * alogp;

        this.findUnassignedAtoms();

        return new double[]{alogp, alogp2, amr};

    }

    public  ALOGPDescriptor();

}