Bravo!Had thought of it,but before you posted your idea of overloading the function.So i did that to the only version of the function ,so it did not work.
Bravo again to iMalc and Jim who had the patience to look the problem.ΜΠΡΑΒΟ!!!!
Bravo!Had thought of it,but before you posted your idea of overloading the function.So i did that to the only version of the function ,so it did not work.
Bravo again to iMalc and Jim who had the patience to look the problem.ΜΠΡΑΒΟ!!!!
O_o
The other methods that do not alter members should also be `const'.
Look at `inverse' for example, it does not mutate data members and so may as well be `const' for the benefit it brings.
By the by, can you explain to me how the `double& Matrix4d:perator() (int, int, int = 0)' API works?
What I mean is, can you provide documentation for that function?
I'm asking because, from my understanding, it is broken as you are relying on client code to keep related data in sync for no reason.
Soma
Soma excuse me but i do not fully understand what you want to point out :/
O_oexcuse me but i do not fully understand what you want to point out
I may not be pointing out anything; as I said, can you provide documentation for the relevant function?
How would I, writing code as a client of your implementation, use the `double& Matrix4d:perator() (int, int, int = 0)' function?
Can you give me an example of using the class correctly relevant to that method?
If I want to represent that matrix and its associated inversion, how would I go about that with code?Code:4 3 3 2
Soma
You poor soul. You're designing a matrix class in C++: Armadillo: C++ linear algebra library
Soma the class is about 4by4 arrays and not 2by2.I have written this above the function .You read it and you find it incomplete or confusing?
So if i need element i,j from the normal array M i would go for thisCode:/* * write,read the matrix element at i,j: * element of the matrix when no third parameter is specified * the element at [i,j] in the inverse matrix otherwise */
where if i wanted the i.j element from M^(-1) array i would go for thisCode:M(i,j)
probably should change it to bool as iMalc stated.Code:M(i,j,-1)
If you find that overloaded () not a must i would agree with you.I wouldn't overloaded them if my partner wouldn't aks for it.Maybe it has to do with whiteflags said.He knows matlab and i do not so i did not think of it.Also i do not the the armadillo library so thanks whiteflags.You recommend using it at the future?
So why i use the overloaded parenthesis in my code?To test them more before the the other guy use it
Might as well, if the LGPL doesn't present some sort of problem.You recommend using it at the future?
Thank you withiflags for the advice.Very kind of you
Okay. Fine. Choose a 4x4 matrix and post such code as I've requested.Soma the class is about 4by4 arrays and not 2by2.
Or don't. I've stopped caring. This is the last I'll say about this issue.
I'm trying to get you to see the problem for yourself. I'm very aware of the code's mechanical problems.You read it and you find it incomplete or confusing?
You have not seen the problem; I assume, probably correctly, that you haven't seen the problem because you haven't explored the implementation from the mindset of a client.
Soma
Well what might be obvious to you with so much experience might be not obvious at all for a guy that started programming at 2010(after summer).Anyway let's end this here.I posted the code to access element of the normal and the inverse function.
Which should explain to you why I didn't just post code.Well what might be obvious to you with so much experience might be not obvious at all for a guy that started programming at 2010(after summer).
I was trying to get you to see any faults for yourself so that you could more ably apply what you would learn from exploring those faults in the future.
Soma
My homepage
Advice: Take only as directed - If symptoms persist, please see your debugger
Linus Torvalds: "But it clearly is the only right way. The fact that everybody else does it some other way only means that they are wrong"