From ted at lehigh.edu Sat Jan 2 10:27:22 2021 From: ted at lehigh.edu (Ted Ralphs) Date: Sat, 2 Jan 2021 10:27:22 -0500 Subject: [CoinUtils] Move to Github Discussions Message-ID: As you may have heard, Github has been developing a new feature called Discussions. We have decided to use it as a replacement for the current mailing lists, which will be retired at some point in the near future. We envision Discussions as a way of having the kinds of conversations that currently take place on this mailing list directly where development is taking place, on Github! To take this thing for a test drive, please go to the Github page for one of the projects you're interested in and post there what you would otherwise post to this mailing list. Discussions is a place to connect with other members of our community on topics not suited for opening an Issue. We hope that you: - Ask questions you?re wondering about. - Share ideas. - Engage with other community members. - Welcome others and are open-minded. Remember that this is a community we build together ?. To get started, you can check out the initial welcome post in each repository and comment with an introduction of yourself to tell us about what you do with this community. Thanks and see you over at Github! Cheers, Ted -- Dr. Ted Ralphs Professor, Industrial and Systems Engineering Lehigh University (610) 628-1280 ted 'at' lehigh 'dot' edu coral.ie.lehigh.edu/~ted -------------- next part -------------- An HTML attachment was scrubbed... URL: From ted at lehigh.edu Thu Jan 7 09:58:35 2021 From: ted at lehigh.edu (Ted Ralphs) Date: Thu, 7 Jan 2021 09:58:35 -0500 Subject: [CoinUtils] Potential bug in CoinIndexedVector::reserve() In-Reply-To: References: Message-ID: Hi Robin, Thanks for this. You said you were directed to report bugs here, but the preferred procedure would now be to open a Github issue and I thought I had changed most references to that by now (of course, documentation in releases cannot be changed retroactively). If you would point out where the reference to this list was, I can hopefully clean that up. In fact, this list will be closing down soon in favor of Github Discussions. There is a message from me to that effect waiting for moderator approval. In any case, if you would not mind, can you open an issue on this? https://github.com/coin-or/CoinUtils/issues/new Cheers, Ted On Thu, Jan 7, 2021 at 9:42 AM Robin Whittle wrote: > Though there hasn't been a message on this list for 2 years . . . we are > instructed to report bugs to the relevant list. > > > In CoinUtils 2.11.2 and 2.11.3 - and I guess earlier versions, but I > haven't checked - the code in CoinIndexedVector.cpp for > CoinIndexedVector::reserve() differs from that from version 2.10.11. > See the attached image to see how the two differ. > > I am using 2.10.11 and have no plans to use the later code, but I did > notice one or two things which look wrong in these later versions. > > In 2.10.11, reserve() takes no action if the requested capacity == the > current capacity. > > if (n < capacity_) {...} > else if (n > capacity_) > > This looks correct to me. In the new versions, it takes one kind of > action (line 541 in 2.11.3, with some added parentheses for clarity): > > if ((n + nPlus) < capacity_) > > and the other if (line 556): > > else if (n > capacity_) > > I suspect that line 556 should be: > > else if ((n + nPlus) > capacity_) > > which would replicate the prior no action arrangement if n == capacity_. > > Functionally, the code may still work OK, but it looks wrong to me and > there are no comments to explain why it is so. > > nPlus seems to be set according to the size of integers and I guess it > represents the extra data items in the object beyond the two arrays: > > int nElements_; > int capacity_; > int offset_; > bool packedMode_; > > Also, given line 541, it seems odd that line 585 remains: > > capacity_ = n; > > The intended functionality of the various parts of this function could > have been clearly described with suitable comments. Then I wouldn't > have to guess about what it is supposed to do. In the absence of such > comments I can't know for sure what it supposed to do, but I wanted to > point out what seems to me like potential problems. > > Robin > _______________________________________________ > CoinUtils mailing list > CoinUtils at list.coin-or.org > https://list.coin-or.org/mailman/listinfo/coinutils > -- Dr. Ted Ralphs Professor, Lehigh University (610) 628-1280 ted 'at' lehigh 'dot' edu coral.ie.lehigh.edu/~ted -------------- next part -------------- An HTML attachment was scrubbed... URL: From ted at lehigh.edu Thu Jan 7 10:11:44 2021 From: ted at lehigh.edu (Ted Ralphs) Date: Thu, 7 Jan 2021 10:11:44 -0500 Subject: [CoinUtils] Potential bug in CoinIndexedVector::reserve() In-Reply-To: References: Message-ID: FYI, here is the commit that introduced the commit: https://github.com/coin-or/CoinUtils/commit/2851f9c872c413d2f1ecbc77429d47dfa17fe1ad Yes, looks like it was just buggy. Ted On Thu, Jan 7, 2021 at 9:58 AM Ted Ralphs wrote: > Hi Robin, > > Thanks for this. You said you were directed to report bugs here, but the > preferred procedure would now be to open a Github issue and I thought I had > changed most references to that by now (of course, documentation in > releases cannot be changed retroactively). If you would point out where the > reference to this list was, I can hopefully clean that up. In fact, this > list will be closing down soon in favor of Github Discussions. There is a > message from me to that effect waiting for moderator approval. > > In any case, if you would not mind, can you open an issue on this? > https://github.com/coin-or/CoinUtils/issues/new > > Cheers, > > Ted > > On Thu, Jan 7, 2021 at 9:42 AM Robin Whittle wrote: > >> Though there hasn't been a message on this list for 2 years . . . we are >> instructed to report bugs to the relevant list. >> >> >> In CoinUtils 2.11.2 and 2.11.3 - and I guess earlier versions, but I >> haven't checked - the code in CoinIndexedVector.cpp for >> CoinIndexedVector::reserve() differs from that from version 2.10.11. >> See the attached image to see how the two differ. >> >> I am using 2.10.11 and have no plans to use the later code, but I did >> notice one or two things which look wrong in these later versions. >> >> In 2.10.11, reserve() takes no action if the requested capacity == the >> current capacity. >> >> if (n < capacity_) {...} >> else if (n > capacity_) >> >> This looks correct to me. In the new versions, it takes one kind of >> action (line 541 in 2.11.3, with some added parentheses for clarity): >> >> if ((n + nPlus) < capacity_) >> >> and the other if (line 556): >> >> else if (n > capacity_) >> >> I suspect that line 556 should be: >> >> else if ((n + nPlus) > capacity_) >> >> which would replicate the prior no action arrangement if n == capacity_. >> >> Functionally, the code may still work OK, but it looks wrong to me and >> there are no comments to explain why it is so. >> >> nPlus seems to be set according to the size of integers and I guess it >> represents the extra data items in the object beyond the two arrays: >> >> int nElements_; >> int capacity_; >> int offset_; >> bool packedMode_; >> >> Also, given line 541, it seems odd that line 585 remains: >> >> capacity_ = n; >> >> The intended functionality of the various parts of this function could >> have been clearly described with suitable comments. Then I wouldn't >> have to guess about what it is supposed to do. In the absence of such >> comments I can't know for sure what it supposed to do, but I wanted to >> point out what seems to me like potential problems. >> >> Robin >> _______________________________________________ >> CoinUtils mailing list >> CoinUtils at list.coin-or.org >> https://list.coin-or.org/mailman/listinfo/coinutils >> > > > -- > Dr. Ted Ralphs > Professor, Lehigh University > (610) 628-1280 > ted 'at' lehigh 'dot' edu > coral.ie.lehigh.edu/~ted > -- Dr. Ted Ralphs Professor, Lehigh University (610) 628-1280 ted 'at' lehigh 'dot' edu coral.ie.lehigh.edu/~ted -------------- next part -------------- An HTML attachment was scrubbed... URL: