- Space efficiency when using vectors. - 7 Updates
- Bitset Initialization - 8 Updates
"Alf P. Steinbach" <alf.p.steinbach+usenet@gmail.com>: Dec 06 12:43AM +0100 On 12/5/2015 9:14 PM, Paul wrote: > BEGIN QUOTE > There are several alternatives for maintaining the adjacency lists. First, observe that the lists themselves can be maintained in either vectors or lists. However, for sparse graphs, when using vectors, the programmer may need to initialize each vector with a smaller capacity than the default; otherwise, there could be significant wasted space. > END QUOTE First, sorry for TB's quoting. I used to fix it manually. Mozilla sucks. *** This could be meaningful if "the default" refers to something other than std::vector's own default. Otherwise it would have to refer to some implementation-specific functionality. Cheers & hth., - Alf |
Ian Collins <ian-news@hotmail.com>: Dec 06 12:50PM +1300 Alf P. Steinbach wrote: > First, sorry for TB's quoting. I used to fix it manually. Mozilla sucks. Edit->Rewrap -- Ian Collins |
"Alf P. Steinbach" <alf.p.steinbach+usenet@gmail.com>: Dec 06 02:28AM +0100 On 12/6/2015 12:50 AM, Ian Collins wrote: > Alf P. Steinbach wrote: >> First, sorry for TB's quoting. I used to fix it manually. Mozilla sucks. > Edit->Rewrap Oh thanks! I hadn't noticed that. Must have been added in recent years. Cheers, - Alf |
David Brown <david.brown@hesbynett.no>: Dec 06 12:32PM +0100 On 06/12/15 02:28, Alf P. Steinbach wrote: >> Edit->Rewrap > Oh thanks! I hadn't noticed that. Must have been added in recent years. It has a shortcut ctrl-R, and has existed as long as I can remember (I've used Thunderbird since version 1). Just be careful if there is code listings in the post - they don't look good after a re-wrap! |
Christian Gollwitzer <auriocus@gmx.de>: Dec 06 02:29PM +0100 Am 06.12.15 um 12:32 schrieb David Brown: > It has a shortcut ctrl-R, and has existed as long as I can remember > (I've used Thunderbird since version 1). Just be careful if there is > code listings in the post - they don't look good after a re-wrap! Yep. But you can also select a portion of the message and hit ^R, it'll reformat just the selection. Christian |
David Brown <david.brown@hesbynett.no>: Dec 06 10:27PM +0100 On 06/12/15 14:29, Christian Gollwitzer wrote: >> code listings in the post - they don't look good after a re-wrap! > Yep. But you can also select a portion of the message and hit ^R, it'll > reformat just the selection. I never thought of that! Thanks. (It is highly unusual for moans about line wrapping to lead to any changes - but this time at least two people have learned a new and useful trick.) |
mark <mark@invalid.invalid>: Dec 07 12:03AM +0100 On 2015-12-05 21:14, Paul wrote: > means by initializing a vector with small capacity. The nearest > thing that I'm aware of is the reserve() method. However, that only > works to request more capacity, not to limit capacity. If you know the exact capacity beforehand, this does limit excess capacity. Chances are pretty good that you will get the exact capacity you want, if you call reserve() in the beginning. If the internal vector resizing is triggered by push_back(), you usually get a 50% or 100% capacity increase. So chances are good you end up with a fair amount of wasted space. |
asetofsymbols@gmail.com: Dec 06 02:39AM -0800 setbit(&n,7,9,43, 47, 51, 52, 53, 54, 55, 56, 57, 58, 59, 66, 67); |
asetofsymbols@gmail.com: Dec 06 02:49AM -0800 > setbit(&n,7,9,43, 47, 51, 52, 53, 54, 55, 56, 57, 58, 59, 66, 67); ✔(&n,7,9,43, 47, 51, 52, 53, 54, 55, 56, 57, 58, 59, 66, 67) |
asetofsymbols@gmail.com: Dec 06 02:53AM -0800 a=✔(&n,7,9,43,47,51..59,66,67) |
asetofsymbols@gmail.com: Dec 06 03:53AM -0800 > a=✔(&n,7,9,43,47,51..59,66,67) a=✔(&n,7,9,43,47,51…59,66,67) |
"Öö Tiib" <ootiib@hot.ee>: Dec 06 04:07AM -0800 > On Sunday, December 6, 2015 at 11:53:40 AM UTC+1, asetof...@gmail.com wrote: > > a=✔(&n,7,9,43,47,51..59,66,67) > a=✔(&n,7,9,43,47,51…59,66,67) Can't be that you have nothing more fruitful to do but to post such questionable pieces of unicode art? |
asetofsymbols@gmail.com: Dec 06 05:02AM -0800 > a=✔(&n,7,9,43,47,51..59,66,67) Bits n &n✔[7,9,43,47,51..59,66,67] Set n as bit vector where bit 7,9,43,47,51..59,66,67 are 1 The bit remain are 0 |
asetofsymbols@gmail.com: Dec 06 05:12AM -0800 > are 1 > The bit remain > are 0 Perhaps better something as: Bits n n✔=[7,9,43,47,51.59,66,67] Set n as bit vector where bit 7,9,43,47,51..59,66,67 are 1 The bit remain are 0 |
asetofsymbols@gmail.com: Dec 06 05:19AM -0800 Possibly would be better just this Bit n|n=[7,9,43,47,51.59,66,67] |
You received this digest because you're subscribed to updates for this group. You can change your settings on the group membership page. To unsubscribe from this group and stop receiving emails from it send an email to comp.lang.c+++unsubscribe@googlegroups.com. |
No comments:
Post a Comment