From david at compbio.dundee.ac.uk Wed Aug 3 06:39:09 2005 From: david at compbio.dundee.ac.uk (David Martin) Date: Wed, 03 Aug 2005 11:39:09 +0100 Subject: [emboss-dev] 2d array questions Message-ID: I wrote some code for an EMBOSS app which has been quietly languishing for the last few years so decided to make use of the MYEMBOSS to ressurect it. On trying to compile I get a bunch of errors related to the functions ajInt2dElemExists and ajInt2dLenElem, both of which seem to have been deprecated in recent versions. Have these been removed and if so, this is what I am trying to do: Populate a relatively sparse array, ie I do not need to have a full rectangular 2d array, but may populate odd cells in the array and add to them. So I was chacking to see whether the second dimension was large enough and whether the elements I wanted to increment had been initialised or not. Otherwise ajInt2dGet will throw an error if I try to access something which hasn't been initialised. ..d From pmr at ebi.ac.uk Wed Aug 3 07:01:22 2005 From: pmr at ebi.ac.uk (Peter Rice) Date: Wed, 03 Aug 2005 12:01:22 +0100 Subject: [emboss-dev] 2d array questions In-Reply-To: References: Message-ID: <42F0A402.6090001@ebi.ac.uk> David Martin wrote: > I wrote some code for an EMBOSS app which has been quietly languishing for > the last few years so decided to make use of the MYEMBOSS to ressurect it. > > On trying to compile I get a bunch of errors related to the functions > ajInt2dElemExists and ajInt2dLenElem, both of which seem to have been > deprecated in recent versions. > > Have these been removed and if so, this is what I am trying to do: I can find no trace of them, back as far as version 1.3.1 Were they only in a local version? Or could they be even older? > Populate a relatively sparse array, ie I do not need to have a full > rectangular 2d array, but may populate odd cells in the array and add to > them. So I was chacking to see whether the second dimension was large enough > and whether the elements I wanted to increment had been initialised or not. > > Otherwise ajInt2dGet will throw an error if I try to access something which > hasn't been initialised. I'll take a look and see what we can provide. Can you send me a code example? regards, Peter From jison at ebi.ac.uk Wed Aug 3 07:12:15 2005 From: jison at ebi.ac.uk (Jon Ison) Date: Wed, 3 Aug 2005 12:12:15 +0100 (BST) Subject: [emboss-dev] 2d array questions In-Reply-To: References: Message-ID: <32893.172.31.8.12.1123067535.squirrel@webmail.ebi.ac.uk> Dear Martin ajInt2dElemExists and ajInt2dLenElem are indeed removed. If you use ajInt2dNew or ajInt2dNewL you'll get the first dimension of your array. Subsequent calls to ajInt2dPut will allocate in the second dimension (your array can be ragged). All memory allocation is done for you, however the application code shouldn't ever ajInt2dGet an element it hasn't first ajInt2dPut a value into (errors otherwise). A safe bet if you know your second dimensions up front is to call ajInt2dPut to initialise your array, e.g. for(x=0;x I wrote some code for an EMBOSS app which has been quietly languishing for > the last few years so decided to make use of the MYEMBOSS to ressurect it. > > On trying to compile I get a bunch of errors related to the functions > ajInt2dElemExists and ajInt2dLenElem, both of which seem to have been > deprecated in recent versions. > > Have these been removed and if so, this is what I am trying to do: > > Populate a relatively sparse array, ie I do not need to have a full > rectangular 2d array, but may populate odd cells in the array and add to > them. So I was chacking to see whether the second dimension was large > enough > and whether the elements I wanted to increment had been initialised or > not. > > Otherwise ajInt2dGet will throw an error if I try to access something > which > hasn't been initialised. > > ..d > > > _______________________________________________ > emboss-dev mailing list > emboss-dev at emboss.open-bio.org > http://newportal.open-bio.org/mailman/listinfo/emboss-dev > From david at compbio.dundee.ac.uk Wed Aug 3 10:39:09 2005 From: david at compbio.dundee.ac.uk (David Martin) Date: Wed, 03 Aug 2005 11:39:09 +0100 Subject: [emboss-dev] 2d array questions Message-ID: I wrote some code for an EMBOSS app which has been quietly languishing for the last few years so decided to make use of the MYEMBOSS to ressurect it. On trying to compile I get a bunch of errors related to the functions ajInt2dElemExists and ajInt2dLenElem, both of which seem to have been deprecated in recent versions. Have these been removed and if so, this is what I am trying to do: Populate a relatively sparse array, ie I do not need to have a full rectangular 2d array, but may populate odd cells in the array and add to them. So I was chacking to see whether the second dimension was large enough and whether the elements I wanted to increment had been initialised or not. Otherwise ajInt2dGet will throw an error if I try to access something which hasn't been initialised. ..d From pmr at ebi.ac.uk Wed Aug 3 11:01:22 2005 From: pmr at ebi.ac.uk (Peter Rice) Date: Wed, 03 Aug 2005 12:01:22 +0100 Subject: [emboss-dev] 2d array questions In-Reply-To: References: Message-ID: <42F0A402.6090001@ebi.ac.uk> David Martin wrote: > I wrote some code for an EMBOSS app which has been quietly languishing for > the last few years so decided to make use of the MYEMBOSS to ressurect it. > > On trying to compile I get a bunch of errors related to the functions > ajInt2dElemExists and ajInt2dLenElem, both of which seem to have been > deprecated in recent versions. > > Have these been removed and if so, this is what I am trying to do: I can find no trace of them, back as far as version 1.3.1 Were they only in a local version? Or could they be even older? > Populate a relatively sparse array, ie I do not need to have a full > rectangular 2d array, but may populate odd cells in the array and add to > them. So I was chacking to see whether the second dimension was large enough > and whether the elements I wanted to increment had been initialised or not. > > Otherwise ajInt2dGet will throw an error if I try to access something which > hasn't been initialised. I'll take a look and see what we can provide. Can you send me a code example? regards, Peter From jison at ebi.ac.uk Wed Aug 3 11:12:15 2005 From: jison at ebi.ac.uk (Jon Ison) Date: Wed, 3 Aug 2005 12:12:15 +0100 (BST) Subject: [emboss-dev] 2d array questions In-Reply-To: References: Message-ID: <32893.172.31.8.12.1123067535.squirrel@webmail.ebi.ac.uk> Dear Martin ajInt2dElemExists and ajInt2dLenElem are indeed removed. If you use ajInt2dNew or ajInt2dNewL you'll get the first dimension of your array. Subsequent calls to ajInt2dPut will allocate in the second dimension (your array can be ragged). All memory allocation is done for you, however the application code shouldn't ever ajInt2dGet an element it hasn't first ajInt2dPut a value into (errors otherwise). A safe bet if you know your second dimensions up front is to call ajInt2dPut to initialise your array, e.g. for(x=0;x I wrote some code for an EMBOSS app which has been quietly languishing for > the last few years so decided to make use of the MYEMBOSS to ressurect it. > > On trying to compile I get a bunch of errors related to the functions > ajInt2dElemExists and ajInt2dLenElem, both of which seem to have been > deprecated in recent versions. > > Have these been removed and if so, this is what I am trying to do: > > Populate a relatively sparse array, ie I do not need to have a full > rectangular 2d array, but may populate odd cells in the array and add to > them. So I was chacking to see whether the second dimension was large > enough > and whether the elements I wanted to increment had been initialised or > not. > > Otherwise ajInt2dGet will throw an error if I try to access something > which > hasn't been initialised. > > ..d > > > _______________________________________________ > emboss-dev mailing list > emboss-dev at emboss.open-bio.org > http://newportal.open-bio.org/mailman/listinfo/emboss-dev >