From: E.L. Willighagen <egonw@sc...>  20020822 14:28:34

On Thursday 22 August 2002 15:01, Joerg Kurt Wegner wrote: > i would use a static or better a singleton class anyway, because the > standard distance matrix is O(N^3) with > N=Number of atoms. This class is really often used by descriptor > calculation methods and it would be a good choice to calculate the > distances only once. Then what will happen if you have more than one molecule at the same time? Egon 
From: E.L. Willighagen <egonw@sc...>  20020822 10:38:04

Hi all, Does CDK have classes for adjecency and/or (through bond) distance matrix classes? I know that the AtomContainer can return a ConnectionMatrix... (as double[][])... Egon 
From: Christoph Steinbeck <steinbeck@ic...>  20020822 12:49:09

E.L. Willighagen wrote: > Hi all, > > Does CDK have classes for adjecency and/or (through bond) distance matrix > classes? I know that the AtomContainer can return a ConnectionMatrix... (as > double[][])... The central datastructure for moleculelike constructs is the AtomContainer. We should, in a way, discourage the use of connection matrices as "the standard way" of coding a molecule. This might be the most important reason not to provide an extra class for connection or adjacency matrices, besides the fact that they are just int[][] or double[][] anyway (the latter in the case of a connection matrix with partial bond orders like 1.5). Cheers, Chris  Dr. Christoph Steinbeck (http://www.ice.mpg.de/departments/ChemInf) MPI of Chemical Ecology, Winzerlaer Str. 10, Beutenberg Campus, 07745 Jena, Germany Tel: +49(0)3641 571263  Fax: +49(0)3641 571202 What is man but that lofty spirit  that sense of enterprise. ... Kirk, "I, Mudd," stardate 4513.3.. 
From: E.L. Willighagen <egonw@sc...>  20020822 12:54:15

On Thursday 22 August 2002 14:49, Christoph Steinbeck wrote: > E.L. Willighagen wrote: > > Does CDK have classes for adjecency and/or (through bond) distance matrix > > classes? I know that the AtomContainer can return a ConnectionMatrix... > > (as double[][])... > > The central datastructure for moleculelike constructs is the > AtomContainer. > We should, in a way, discourage the use of connection matrices as "the > standard way" > of coding a molecule. This might be the most important reason > not to provide an extra class for connection or adjacency matrices, > besides the fact that they are just int[][] or double[][] anyway (the > latter in the > case of a connection matrix with partial bond orders like 1.5). Yes, that makes sense... can I then add two procedures to generate an adjecency matrix and a (through bond) distance matrix? Egon 
From: Joerg Kurt Wegner <wegnerj@in...>  20020822 13:02:09

Hi all, i would use a static or better a singleton class anyway, because the standard distance matrix is O(N^3) with N=Number of atoms. This class is really often used by descriptor calculation methods and it would be a good choice to calculate the distances only once. Regards, Joerg K. Wegner > E.L. Willighagen wrote: > > Hi all, > > > > Does CDK have classes for adjecency and/or (through bond) distance matrix > > classes? I know that the AtomContainer can return a ConnectionMatrix... (as > > double[][])... > > The central datastructure for moleculelike constructs is the > AtomContainer. > We should, in a way, discourage the use of connection matrices as "the > standard way" > of coding a molecule. This might be the most important reason > not to provide an extra class for connection or adjacency matrices, > besides the fact that they are just int[][] or double[][] anyway (the > latter in the > case of a connection matrix with partial bond orders like 1.5). > > Cheers, > > Chris > >  > Dr. Christoph Steinbeck (http://www.ice.mpg.de/departments/ChemInf) > MPI of Chemical Ecology, Winzerlaer Str. 10, Beutenberg Campus, 07745 > Jena, Germany > Tel: +49(0)3641 571263  Fax: +49(0)3641 571202 > > What is man but that lofty spirit  that sense of enterprise. > ... Kirk, "I, Mudd," stardate 4513.3.. > >  > This sf.net email is sponsored by: OSDN  Tired of that same old > cell phone? Get a new here for FREE! > https://www.inphonic.com/r.asp?r=sourceforge1&refcode1=vs3390 > _______________________________________________ > Cdkdevel mailing list > Cdkdevel@... > https://lists.sourceforge.net/lists/listinfo/cdkdevel  Dipl. Chem. Joerg K. Wegner Univ. Tuebingen, Computer Architecture, Sand 1, D72076 Tuebingen, Germany Tel. (+49/0) 7071 29 78970, Fax (+49/0) 7071 29 5091 EMail: mailto:wegnerj@... WWW: http://wwwra.informatik.unituebingen.de 
From: E.L. Willighagen <egonw@sc...>  20020822 14:28:34

On Thursday 22 August 2002 15:01, Joerg Kurt Wegner wrote: > i would use a static or better a singleton class anyway, because the > standard distance matrix is O(N^3) with > N=Number of atoms. This class is really often used by descriptor > calculation methods and it would be a good choice to calculate the > distances only once. Then what will happen if you have more than one molecule at the same time? Egon 
From: Joerg Kurt Wegner <wegnerj@in...>  20020822 15:20:45

Hello Egon, you are right, a singleton class won't work. But there are different possibilities ... every molecule should know if the distance matrix has already been calculated. If the user changes atoms or bonds you have the choice to reset the calculated status or let the user decide with a remove or resetmethod. 1. very simple (saving space): Let the user decide to calculate distance matrixes as often as needed. 2. simple (saving time): In every molecule: distMatrix=new int[n][n]; or if not: distMatrix=null; That's very simple and there should be a flag for every matrix or complex calculation method, so method 3. would be better. 3. complex (saving time): I've implemented the distance matrix in JOELib as descriptor, which can be calculated by getData("Descriptor_matrix") or deleted by deleteData("Descriptor_matrix"); Further methods can simply call getData("Descriptor_matrix") and the distance matrix will not be calculated again, the user will obtain the calculated distance matrix. That maybe a little bit exaggerated for your needs, but i think it could be usefull to have an efficient Mapinterface functionality for additional data elements in CDKMolecules. This could be a distance matrix, adjacent matrix or 'real' descriptor values, or other objects you want. Something like: joelib.molecule.GenericDataHolder. int[][] and double[][] are Java Objects and you can use a Hashtable h with h.put(intMatrix) and intMatrix=(int[][]) h.get("Distance_matrix") 4. bad: Another way could be to implement a BitSetState in the distance matrix method, which can be accessed by the molecule identifier(number), but thats not a good choice, because there will be a lot of programming side effects. Regards, Joerg K. Wegner "E.L. Willighagen" wrote: > On Thursday 22 August 2002 15:01, Joerg Kurt Wegner wrote: > > i would use a static or better a singleton class anyway, because the > > standard distance matrix is O(N^3) with > > N=Number of atoms. This class is really often used by descriptor > > calculation methods and it would be a good choice to calculate the > > distances only once. > > Then what will happen if you have more than one molecule at the same time? > > Egon > >  > This sf.net email is sponsored by: OSDN  Tired of that same old > cell phone? Get a new here for FREE! > https://www.inphonic.com/r.asp?r=sourceforge1&refcode1=vs3390 > _______________________________________________ > Cdkdevel mailing list > Cdkdevel@... > https://lists.sourceforge.net/lists/listinfo/cdkdevel  Dipl. Chem. Joerg K. Wegner Univ. Tuebingen, Computer Architecture, Sand 1, D72076 Tuebingen, Germany Tel. (+49/0) 7071 29 78970, Fax (+49/0) 7071 29 5091 EMail: mailto:wegnerj@... WWW: http://wwwra.informatik.unituebingen.de 