Re: [Libmesh-devel] DenseSubVector

2009-03-09 Thread Kirk, Benjamin (JSC-EG311)
>> On Mon, Mar 9, 2009 at 1:03 PM, Kirk, Benjamin (JSC-EG311) >> wrote: >>> >>> OMG, just derive from std::map<>, implement a proper descructor, and be done >>> with it!!! ;-) >> >> I know you are trying to get me to bite... OK it worked. > > Really? I could have sworn he was making fun of my

Re: [Libmesh-devel] DenseSubVector

2009-03-09 Thread Roy Stogner
On Mon, 9 Mar 2009, John Peterson wrote: > On Mon, Mar 9, 2009 at 1:03 PM, Kirk, Benjamin (JSC-EG311) > wrote: >> >> OMG, just derive from std::map<>, implement a proper descructor, and be done >> with it!!! ;-) > > I know you are trying to get me to bite... OK it worked. Really? I could have

Re: [Libmesh-devel] DenseSubVector

2009-03-09 Thread John Peterson
On Mon, Mar 9, 2009 at 1:03 PM, Kirk, Benjamin (JSC-EG311) wrote: > >> Someday I'll have time to get in there and fix those things... >> someday... > > OMG, just derive from std::map<>, implement a proper descructor, and be done > with it!!! ;-) I know you are trying to get me to bite... OK it wo

Re: [Libmesh-devel] DenseSubVector

2009-03-09 Thread Kirk, Benjamin (JSC-EG311)
> Someday I'll have time to get in there and fix those things... > someday... OMG, just derive from std::map<>, implement a proper descructor, and be done with it!!! ;-) -Ben -- Open Source Business Conference (OSBC),

Re: [Libmesh-devel] DenseSubVector

2009-03-09 Thread Derek Gaston
LOL - yes, I was but the only thing you can deduce from computer science majors is: we're lazy. That's right. We got into computers so that they could do our work for us. ;-) And yes... technically all of our applications here "leak" memory like crazy but that's only for objects th

Re: [Libmesh-devel] DenseSubVector

2009-03-09 Thread John Peterson
On Mon, Mar 9, 2009 at 11:31 AM, Derek Gaston wrote: > Just to give a different perspective on containers of DenseSubVectors... I > actually have some of these in my code: > > std::map * > _var_Res; > > In my case I really don't care if the memory is ever cleaned up because > these objects live un

Re: [Libmesh-devel] DenseSubVector

2009-03-09 Thread Derek Gaston
Just to give a different perspective on containers of DenseSubVectors... I actually have some of these in my code: std::map * > _var_Res; In my case I really don't care if the memory is ever cleaned up because these objects live until the program exits anyway Sometimes the simplest solut

Re: [Libmesh-devel] DenseSubVector

2009-03-09 Thread John Peterson
On Mon, Mar 9, 2009 at 10:12 AM, Roy Stogner wrote: > > On Mon, 9 Mar 2009, Tim Kroeger wrote: > >> What do you guys think about having assignment operators in DenseSubVector >> and DenseSubMatrix? > > I'll wait to hear what Ben and John think, but operator= in the > STL container sense would be t

Re: [Libmesh-devel] DenseSubVector

2009-03-09 Thread Roy Stogner
On Mon, 9 Mar 2009, Tim Kroeger wrote: > On Mon, 9 Mar 2009, Roy Stogner wrote: > >> I'll wait to hear what Ben and John think, but operator= in the >> STL container sense would be too misleading, in my opinion. If I set >> up a DenseSubVector with parent a and an identically sized >> DenseSubV

Re: [Libmesh-devel] DenseSubVector

2009-03-09 Thread John Peterson
On Mon, Mar 9, 2009 at 10:36 AM, Tim Kroeger wrote: > > That doesn't work.  Your assignment operator copies the value that the > reference points to, not the address that is pointed to. Hehe, oops of course you are right. -- John

Re: [Libmesh-devel] DenseSubVector

2009-03-09 Thread John Peterson
On Mon, Mar 9, 2009 at 10:25 AM, Tim Kroeger wrote: > > I'm not familiar with boost.  Perhaps I can do the same with libMesh's > AutoPtr?  I'm not familiar with that too much either, but that would > at least not require installation of another library. No containers of auto pointers. They aren'

Re: [Libmesh-devel] DenseSubVector

2009-03-09 Thread Tim Kroeger
On Mon, 9 Mar 2009, John Peterson wrote: > Why does it need to be a pointer? AFAICT it was not a constant > reference so it can be changed at op=. The following test code > compiles OK for me. The fact that it's a reference reflects the fact > that the parent of a dense sub matrix/vector should

Re: [Libmesh-devel] DenseSubVector

2009-03-09 Thread Tim Kroeger
On Mon, 9 Mar 2009, Roy Stogner wrote: > On Mon, 9 Mar 2009, Tim Kroeger wrote: > >> What do you guys think about having assignment operators in DenseSubVector >> and DenseSubMatrix? > > I'll wait to hear what Ben and John think, but operator= in the > STL container sense would be too misleading,

Re: [Libmesh-devel] DenseSubVector

2009-03-09 Thread John Peterson
On Mon, Mar 9, 2009 at 8:50 AM, Tim Kroeger wrote: > Dear all, > > What do you guys think about having assignment operators in DenseSubVector > and DenseSubMatrix?  Actually, I would like to have them since that would > enable me to use a std::vector. This requires the > DenseSubVector::parent mem

Re: [Libmesh-devel] DenseSubVector

2009-03-09 Thread Roy Stogner
On Mon, 9 Mar 2009, Tim Kroeger wrote: > What do you guys think about having assignment operators in DenseSubVector > and DenseSubMatrix? I'll wait to hear what Ben and John think, but operator= in the STL container sense would be too misleading, in my opinion. If I set up a DenseSubVector wit

[Libmesh-devel] DenseSubVector

2009-03-09 Thread Tim Kroeger
Dear all, What do you guys think about having assignment operators in DenseSubVector and DenseSubMatrix? Actually, I would like to have them since that would enable me to use a std::vector. This requires the DenseSubVector::parent member to be a pointer rather than a reference, but that shou