I have to use a very simple data structure consisting only two double type data members (like complex numbers). I have written a class because it is practical to handle that object, and it is also usefull for me to overload all overloadable operators and define constructors and friend functions and so on. In my computation I have to use lots of objects from this class. How can I speed up? What is important to care with?
For example define as little member functions as I can? or it isnt important? for example define operator overloading as a friend and not as a member function? and try to avoidoverloading += which hs to be a membr function?
Or define as little friend functions as I can? or it isnt important?
Or declare as litte object in my programme as I can, change values o an existing object instead of creating a new one?
Creating two double number takes how much less time than creating a class with these two double and lots of functions? Or the functions are created only once during the programme?