| |
| |
| |
|
Page: 1 2 3 4 5 6 7 8 9 10 11
Comments:
<0> of course my code works <0> i wouldn't paste it here without trying it first <0> what do you mean "that isn't supposed to be done" ? <0> it's well known that if you don't write an operator=, the compiler generates a default one that does a member-by-member ***ignment <0> that's called convenience <1> rdragon could you please take a quick look at my code to see what i'm doing wrong? <0> paste it to the site <1> errr. it's a little chunky <1> like.. there's more than 1 file <1> and i can't summarize sanely <0> well, i'm not going to dig through mounds of your code <0> if you separate the actual problem you're having out into a tiny program, you'll probably solve it yourself <1> hmm. let me try <0> i don't know what the problem even is <1> alright.. i have 2 cl***es, Tensor and Transform. Tensor implements operator= in the public scope. Transform inherits Tensor, and within the constructor for Transform, i would like to write "*this = arg1", where arg1 is a static variable in the global scope <0> what is arg1?
<0> and why ***ign something to the object from the constructor? that doesn't sound like a great design <0> what type is arg1? <0> Transform? <1> its a static variable i declared.. ok that is not the actual name. it is IDENT_MATRIX, and it is a Tensor <0> are you sure you don't want to use a copy constructor to do that? <1> i am building a transformation matrix out of an identity matrix.. so it initializes the values of the transform to look like the identity <0> so Transform represents a matrix? <0> what does Tensor represent? <1> yeah, i am sure i do not want a copy constructor, because i am building a rotation matrix <1> Tensor = matrix <0> what about <0> Matrix m; <0> BuildRotationMatrix( m, some_rotation_value ); <0> or just a function <0> Matrix BuildRotationMatrix( float some_rotation_value ); <1> i prefer to have a separate cl*** represent rotation matrices :) <0> why? <0> a rotation matrix is no special kind of matrix <0> it's just a matrix <0> it's just the values you put inside that happen to make it rotate another matrix when you apply one to the other <0> all you need is a convenience function that sets up a matrix to have the effect of rotating by some value when it's applied <1> that may be true, but it doesn't answer the question as to why operator= doesn't work for the Transform cl*** <0> because you're ***igning a base cl*** type to a derived type <1> in your code example, u used cl*** B for both objects.. <0> exactly <1> here, i see i am ***igning the base cl*** <0> you're ***igning an object of A to an object of B <0> that doesn't work unless you write the code that makes that happen <1> however, shouldn't the base definition for operator= recognize exactly the base ***ignment RHS <1> ? <0> no, because that's not inherited <0> the signature for operator= for B is B& operator=( B& ) <2> Duck and cover would actually help, khan <0> an A isn't a B <0> so it doesn't fit <0> a B is an A, so you could do the reverse, and ***ign a B to an A <1> I SEE! <1> i think i see the light <0> but I disagree that you should subcl*** Matrix, still <1> do u want to know something even sicker? <1> i derived cl*** Vector from Matrix <0> well that's just stupid <1> haha <1> i knew u would say that <0> I hope you're just joking <1> but i'm recognizing the fact that matrix and vector are both tensors <1> and they share the same basic principles when it comes to the dot product <0> you can implement everything just fine if vector and matrix are completely separate types <1> and transposing <0> why are you writing all of this yourself, anyway"? <1> hmm. because it gives me more control <0> control of what? <0> it's not like you're implementing them better <0> are you using this stuff for graphics? <1> so i can inherit vector from tensor, just the way i like <1> cuz no one else does it this way :P <0> probably because it doesn't have any benefit <1> yeah, i do graphics <0> what graphics library are you using to render this stuff, and why aren't you using the matrix/vector cl***es in the library? <1> but this time i'm trying to rewrite my old library from the ground up <1> i'm rolling my own
<0> oh, you've written your own; I should have guessed <0> i suppose you're writing an MMORPG too <1> thanks for the help tho, i don't have good c++ foundations <0> then you shouldn't be writing a graphics engine <0> that's a job for a pro <1> haha <1> no, i'm writing a thesis on robot control <1> and i need to have more control over my code <0> then why are you wasting your time writing a graphics engine? <1> it's not for a graphics engine <0> a math library, then <0> boost has a linear algebra library in it, by the way <0> and I bet there are a bunch out there that would work perfectly for what you need <0> the boost library is called uBLAS <1> that's true, but i just wanted to take this opportunity to give my own code a lil facelift anyhow <0> http://www.boost.org/libs/numeric/ublas/doc/index.htm <1> i'm using this lib more for the math, but i don't want to use matlab because i want to implement a standalone program <0> look at that library <0> all of the math is done <1> oh wow. they've got stuff for sparse matrices <1> i might need that <1> do u use this library? <1> i used to write my own linked lists.. long ago. i never understood why. <1> it felt stupid once i discovered stl <1> but right now my compiler doesn't like BOOST.. so i guess it rules out that option <1> i am on vc6, and reluctant to upgrade. i still use a voodoo card too :) <3> Can I declare two variables of different types within a for() loop ? <2> voodoo card, haha <4> bacl <5> threat not sure what you're asking <5> dextre what compiler are you using? <2> 6.0 <0> yeah too bad he left <5> which one? the guy w/ the ancient compiler or the other one? <0> dextre <0> my pizza got delivered so i stepped away heh <0> i found apartments that I can walk to work from <5> that's not real useful as you're moving in a week <0> I mean where I'm moving to <5> ah <0> will have to call them tomorrow, hopefully they've got some stuff available <6> <@JBlitzen> Duck and cover would actually help, khan <6> yeah, you'd be the one to believe that heh <6> bedtime w00t <2> It's not just me <2> Any idiot knows it would help <2> Where are you, Baltimore? <2> http://meyerweb.com/eric/tools/gmap/hydesim.html?ll=-96.7940,32.7838&yd=1000 <2> If you're standing in Arlington cemetary during that sort of detonation, you're in for 2-5 psi <2> ***uming you survive the thermal effects, which is likely, exactly how will ducking and going for cover not help avoid debris? <2> I mean, that's just common sense <2> Look at that map and it's quite clear that, sure, people within a couple miles of ground zero are in for a bad day, but there are a whole lot of people in areas that will be affected but not vaporized <2> Duck and cover was never for the people at ground zero, it was for everyone else <2> But idiots like Jon Stewart latch on to it, are totally oblivious to the realities, and convince all the other idiots to laugh about it. <6> wow...1 megaton <6> we **** more than that these days <6> and in the 50's, when this program was popular, we were testing hydrogen bombs <6> 10 times as destructive <6> god knows what we can do know <6> now <7> lol <6> also, the footage john steward was particularly ridiculing was the footage of school children in the streets ducking and covering when they saw the flash <6> good chance you're ****ed <2> No, the average Russian warhead is a 450 kT device <2> That's for a ground burst, too, ala terrorist attack <2> We can do about 25 mt now, but why bother <0> happy april fools day <2> Hi rd <0> hey <2> The average nuclear device in any inventory is under a megaton <2> I don't recall what our's are <8> this is really wierd my purly abstract cl*** (just an interface) is not being enforced. I inherit this abstract interface as public yet its purley virt. methods are not enforced in the child cl***es <0> Enferex are you sure they're pure virtual? and they're not defined? <8> Not defined
Return to
#c++ or Go to some related
logs:
gentoo xkeyboard #MissKitten #london remix lebnani #linux #php jermas xxx patit B
serial telebubbies #teens
|
|