| |
| |
| |
|
Page: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
<Return0> I made a static member <Return0> that determines the default format to be returned <Return0> esp. since you wouldn't change it often in all of your use of the matrix multiplies <MachinShi> never cared for matrix cl***es ****ing overloading ops. find it evil, myself <Return0> 8 <Yuhjn> see, machin agrees <MachinShi> qed we're right, you're wrong. stfu and do it our way ;) <Yuhjn> matrix_result = m1.multiply(m2); <Yuhjn> that's generally what you see <Yuhjn> or m1.dot(m2); m1.cross(m2); <Yuhjn> etc <MachinShi> eh.i'd rather do -> multiply ( m1, m2 ) ; but still.. ***ertion holds ;) or stick it a Math cl*** or wahtever <MachinShi> what'd you do for cross anywa? % ? ;) i've heard ppl argue for that <MachinShi> Math::multiply ( m1, m2 ) ; <Yuhjn> or more like Matrix::multiply(m1,m2); <Yuhjn> but right * is pretty ambigious <Yuhjn> so is multiply() but that's not the point :) <MachinShi> it's more descriptive <Yuhjn> yes <Return0> well the problem is actually the abiguity in the result <MachinShi> and multiply_matrix is kinda lame. since you got m1 & m2 which are the types you're multiplying :) <Return0> it can be either row major or column major? <Return0> should I make it some optional parameter or something? <Return0> or 2 different multiply functions <MachinShi> Matrix<float, row> m1 ; //maybe? <MachinShi> or make it an enum type you p*** in when you make the matrix objecdt <MachinShi> rather Matrix<float, Matrix::row> <Return0> errr <Return0> but you do a multiply function you can't overload them by the return type <Return0> so it would have to be a parameter for the multiply function <MachinShi> well.. lemme ask you this. what is it mean for a matrix to be rowmajor or column major? can that be changed at runtime? can you multiply a rm-matirx to a cm-matrix? <Return0> like m1.multiply(m2, Matrix::ROW_MAJOR); <Return0> and it could be a default parameter I guess <Return0> yes yes and yes <Return0> it means the way it indexes basically <MachinShi> is rowmajor vs. columnmajor an element of the matrix of an element of the mulitply operation? <Return0> rm and cm are just transposed <Return0> matrix. <Return0> but it matters for the multiply <Madsy_> I actually agree with MachinShi, Return0. You only need a simple transpose function. <Madsy_> It will probably be faster too, and less confusing. <Return0> yeah but it would be more efficient to index them directly <Return0> based on the format, when I do the multiply <MachinShi> why not have multiply delegate to a function that does the actual multiply based onthe formats? (a private function ) <Return0> yeah that's what I'm thinking <Yuhjn> i recommend strategy patter (see gang of 4) <Yuhjn> pattern <Return0> or even if it just had a nested if, there's only a few possibility <Return0> err possibilities <Madsy_> Return0: Ok, I have another idea. Make a matrix base cl*** you derive from. Then you make two cl***es, column-major and row-major. <Return0> I'm listening... <MachinShi> no, ewwwh. that's silly <Return0> I think a format flag works fine really... <Madsy_> Derived from the base cl***. Then overload operator * for both cl***es to take itself as an argument, in addition the the other cl***. <Return0> I can even do some index re***ignments symbolically <MachinShi> it's not a type of matrix. it's an element of the matrix. you can change a column major to a row major matrix. how do you do that w/ inheritance? <Return0> 48 ***ignment operations <Return0> handles all cases <Return0> all 8 cases <MachinShi> *twinge* <Madsy_> MachinShi: Hm, what about unions? :) <Return0> heh :P <MachinShi> unions? eh? <Return0> if not that, I need to have the multiply code listed 8 times with different indexing each time <Madsy_> Nevermind. <Grundee> Quick question: How do I edit resource files in dev c++ 5? The help files are misleading and I think that they were from an older version. <Return0> I think that's the most efficient <Return0> it's all internal <Return0> If I'm going to use a function for the multiply, it seems like it might even be best if I p*** in the address of the storage cl*** <Return0> or something. <Yuhjn> i think you're putting too much thought into it.... just "make it work" .. then later when you need to extend the functionality or fix a bug, consider the design again and refactor if necessary <Return0> I just think transposing a matrix before the multiply internally is inefficient when I can just access the array differently. <Yuhjn> doing all the design up front never works <Return0> well efficiency seems pretty important <Yuhjn> effeciency is fixed last using your profiler <Return0> for something with so many multiplies <Grundee> Anyone know about devc++ resource scripts? <Yuhjn> design should not be constrained by effeciency <Return0> I agree <Return0> well not the interface anyway <Return0> but internally I think it should be. <Return0> I'm a very meticulous coder =\, I think things through... I think it's a good attribute. <MachinShi> you're not lazy enuf. tha's your problem <Return0> heh :P <MachinShi> perfectionism in a coder is a bad thing <Return0> why? <MachinShi> least if you wanna do *WORK* as a coder that is <MachinShi> if you're gonig into academia who ****ign cares, right? :) <Return0> well, I take pride in my code, I don't just write crap for some company I don't care about <MachinShi> you miss my point <Karius> Say that to anyone in any business <MachinShi> i take pride in what i write too. what i realize however is that i will never have the time to work on the code sufficient to make me 100% happy. <Return0> Karius, what do you mean? <Symmetry_> MachinShi, yes <czthwrk> MachinShi: bah, what you mean is almost anything taken to extremes is bad <Symmetry_> true beauty comes if you do not seek beauty <Return0> I don't really expect 100%, but I put a lot more time into things, I'm ok with it. <czthwrk> my recent Net::SSH2 module makes me happy, but there will be more versions <Symmetry_> as long as it uses design patterns, czthwrk =) <Karius> Return0: The people who feed you want quick results, a short test phase and dirty fixes, then deployment. That's my coding life at least. <czthwrk> Symmetry_: yeah. Foote and Yoder :P. <Return0> yeah that might be a problem. <Return0> obviously I'll have to make that compromise when the time demands it <Return0> anyway ... <Karius> I'm right now bluffing to my manager about doing 'fixes' will I actually redesign a whole system. That's another way of doing it :) <Return0> while*? <MachinShi> czthwrk: that's sufficiently good enuf to state :) <Return0> I find when I put in a lot of thought into something and do a good job writing it, I rarely have to go back and fix it <Return0> In reality I find I'm more productive coding than my peers, at least at my college. <Return0> anyway, howd I get on this topic >< <Return0> here I am just chatting... heh <Genia4> guys, is beta 2 the latest vs 2k5 version? <job> it's gone release <job> but yes beta2 is the latest beta <Genia4> it has? <Genia4> so how come beta2 is still available? <MachinShi> cause it's not "out" yet. you can only get if you're an msdn subscriber <Genia4> job: ? <Genia4> oooh <Genia4> when will it be out? <Genia4> out for real <MachinShi> dunno. it's a full release, so it may not be available "for free" for a while <kawfee> VS2005 has been released <Genia4> how many cd's is it anyway? <kawfee> dunno, it's on MSDN <Genia4> previous one was like 7... (including msdn) <kawfee> cd's or dvds? <kawfee> Isn't everything being relased on dvd now? <Genia4> I wonder what kind of dicount ms offers for student licenses... <Genia4> I want a windows cd ;) <Genia4> kawfee, 2k3 was released on both cd's and dvd <kawfee> MS gives students a version of VS for no charge <kawfee> it's an academic version <Genia4> I need windows <Genia4> too <kawfee> they give them windows too <kawfee> and office <kawfee> and sql server <kawfee> and this <kawfee> and that too <Genia4> for free? <kawfee> they give them pretty much everything <kawfee> yes <Genia4> find it hard to believe <kawfee> I get it for free <Genia4> free for home use/ <Genia4> as in a cd? <Genia4> with a nice MS hologram? <kawfee> Genia4: maybe you didn't go to the right university then =] <kawfee> no, not on CD <kawfee> they allow you to download it
Return to c++ or Go to some related
logs:
football rock politics football chatzone error: "expression must have a constant value" com
|
|