test_class.file: descriptor/qsarmolecular/src/test/java/org/openscience/cdk/qsar/descriptors/molecular/WienerNumbersDescriptorTest.java
test_class.identifier: WienerNumbersDescriptorTest
test_class.superclass: extends MolecularDescriptorTest
test_case.body: @Test
      public void testOriginalWienerPaperCompounds() throws Exception {
          SmilesParser sp = new SmilesParser(DefaultChemObjectBuilder.getInstance());
          double[] testResult = {10, 20, 35, 56, 84, 120, 165, 220, 286};
          String smiles = "CCC";
          for (int i = 0; i < testResult.length; i++) {
              smiles += "C"; // create the matching paraffin
              IAtomContainer mol = sp.parseSmiles(smiles);
              DoubleArrayResult retval = (DoubleArrayResult) descriptor.calculate(mol).getValue();
              Assert.assertEquals(testResult[i], retval.get(0), 0.0001);
          }
      }
test_case.class_method_signature: WienerNumbersDescriptorTest.testOriginalWienerPaperCompounds()
test_case.full_signature: @Test public void testOriginalWienerPaperCompounds()
test_case.identifier: testOriginalWienerPaperCompounds
test_case.invocations: getInstance parseSmiles getValue calculate assertEquals get
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testOriginalWienerPaperCompounds()
focal_class.declarator: NAMES            = {"WPATH", "WPOL"}
focal_class.modifier: private static final
focal_class.original_string: private static final String[] NAMES            = {"WPATH", "WPOL"};
focal_class.type: String[]
focal_class.var_name: NAMES
focal_class.declarator: matr             = null
focal_class.original_string: double[][]                    matr             = null;
focal_class.type: double[][]
focal_class.var_name: matr
focal_class.declarator: wienerNumbers    = null
focal_class.original_string: DoubleArrayResult             wienerNumbers    = null;
focal_class.type: DoubleArrayResult
focal_class.var_name: wienerNumbers
focal_class.declarator: connectionMatrix = new ConnectionMatrix()
focal_class.original_string: ConnectionMatrix              connectionMatrix = new ConnectionMatrix();
focal_class.type: ConnectionMatrix
focal_class.var_name: connectionMatrix
focal_class.declarator: atm              = new AtomContainerManipulator()
focal_class.original_string: AtomContainerManipulator      atm              = new AtomContainerManipulator();
focal_class.type: AtomContainerManipulator
focal_class.var_name: atm
focal_class.file: descriptor/qsarmolecular/src/main/java/org/openscience/cdk/qsar/descriptors/molecular/WienerNumbersDescriptor.java
focal_class.identifier: WienerNumbersDescriptor
focal_class.interfaces: implements IMolecularDescriptor
focal_class.class_method_signature: WienerNumbersDescriptor.WienerNumbersDescriptor()
focal_class.full_signature: public  WienerNumbersDescriptor()
focal_class.identifier: WienerNumbersDescriptor
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.signature:  WienerNumbersDescriptor()
focal_class.class_method_signature: WienerNumbersDescriptor.getSpecification()
focal_class.full_signature: @Override public DescriptorSpecification getSpecification()
focal_class.identifier: getSpecification
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: DescriptorSpecification
focal_class.signature: DescriptorSpecification getSpecification()
focal_class.class_method_signature: WienerNumbersDescriptor.setParameters(Object[] params)
focal_class.full_signature: @Override public void setParameters(Object[] params)
focal_class.identifier: setParameters
focal_class.modifiers: @Override public
focal_class.parameters: (Object[] params)
focal_class.return: void
focal_class.signature: void setParameters(Object[] params)
focal_class.class_method_signature: WienerNumbersDescriptor.getParameters()
focal_class.full_signature: @Override public Object[] getParameters()
focal_class.identifier: getParameters
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: Object[]
focal_class.signature: Object[] getParameters()
focal_class.class_method_signature: WienerNumbersDescriptor.getDescriptorNames()
focal_class.full_signature: @Override public String[] getDescriptorNames()
focal_class.identifier: getDescriptorNames
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: String[]
focal_class.signature: String[] getDescriptorNames()
focal_class.class_method_signature: WienerNumbersDescriptor.calculate(IAtomContainer atomContainer)
focal_class.full_signature: @Override public DescriptorValue calculate(IAtomContainer atomContainer)
focal_class.identifier: calculate
focal_class.modifiers: @Override public
focal_class.parameters: (IAtomContainer atomContainer)
focal_class.return: DescriptorValue
focal_class.signature: DescriptorValue calculate(IAtomContainer atomContainer)
focal_class.class_method_signature: WienerNumbersDescriptor.getDescriptorResultType()
focal_class.full_signature: @Override public IDescriptorResult getDescriptorResultType()
focal_class.identifier: getDescriptorResultType
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: IDescriptorResult
focal_class.signature: IDescriptorResult getDescriptorResultType()
focal_class.class_method_signature: WienerNumbersDescriptor.getParameterNames()
focal_class.full_signature: @Override public String[] getParameterNames()
focal_class.identifier: getParameterNames
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: String[]
focal_class.signature: String[] getParameterNames()
focal_class.class_method_signature: WienerNumbersDescriptor.getParameterType(String name)
focal_class.full_signature: @Override public Object getParameterType(String name)
focal_class.identifier: getParameterType
focal_class.modifiers: @Override public
focal_class.parameters: (String name)
focal_class.return: Object
focal_class.signature: Object getParameterType(String name)
focal_class.superclass: extends AbstractMolecularDescriptor
focal_method.body: @Override
      public DescriptorValue calculate(IAtomContainer atomContainer) {
          wienerNumbers = new DoubleArrayResult(2);
          double wienerPathNumber = 0; //wienerPath
          double wienerPolarityNumber = 0; //wienerPol
  
          matr = ConnectionMatrix.getMatrix(AtomContainerManipulator.removeHydrogens(atomContainer));
          int[][] distances = PathTools.computeFloydAPSP(matr);
  
          int partial;
          for (int i = 0; i < distances.length; i++) {
              for (int j = 0; j < distances.length; j++) {
                  partial = distances[i][j];
                  wienerPathNumber += partial;
                  if (partial == 3) {
                      wienerPolarityNumber += 1;
                  }
              }
          }
          wienerPathNumber = wienerPathNumber / 2;
          wienerPolarityNumber = wienerPolarityNumber / 2;
  
          wienerNumbers.add(wienerPathNumber);
          wienerNumbers.add(wienerPolarityNumber);
          return new DescriptorValue(getSpecification(), getParameterNames(), getParameters(), wienerNumbers,
                  getDescriptorNames());
      }
focal_method.class_method_signature: WienerNumbersDescriptor.calculate(IAtomContainer atomContainer)
focal_method.full_signature: @Override public DescriptorValue calculate(IAtomContainer atomContainer)
focal_method.identifier: calculate
focal_method.invocations: getMatrix removeHydrogens computeFloydAPSP add add getSpecification getParameterNames getParameters getDescriptorNames
focal_method.modifiers: @Override public
focal_method.parameters: (IAtomContainer atomContainer)
focal_method.return: DescriptorValue
focal_method.signature: DescriptorValue calculate(IAtomContainer atomContainer)