Architecture (sort of)

So far, I've reached a point where my dimension class is ready for everything you could expect from it. It accepts scalar values, other dimension objects, and C arrays as input. It's also completey template-based (that means not jsut on type T, but also a shitload of template methods) to keep implicit conversion possible, but only for the things where it's useful. For example, applying a differently typed scalar values to all components isn't better than making the method only available for one type. That's because you'd repet the conversion for each component - using a single expected type will result in conversion based on what is defined elsewhere, so I think it's some kind of current maximum I reached for this class in terms of "easy to guess" performance. You can even add vectors in array format like (int[]){x,y,z} and so on without any problems. You can even address and access elements invidually by using [] und (), this ensures full and convenient compatibility to for example OpenGL vectors etc. I implemented everything useful I could think of and it shows how nice this stuff can go with enough hard and rather "unproductive" work including research, reading and testing.

I'll simply leaving as useful as it is and continue to other things, like making special variants of it. Most notably vectors and RGB/RGBA structures. And that's where the question for math formulas and memoization kicks in.... Vectors have a length, thus you can sum all component's square and extract the square root to get this values. And, well - square root alghorithms are REALLY something where I don't want to rely on C functions. I'm a bit biased in this case, using my own square root alghorithms all the from Purebasic to C to C++. I almost forgot how they worked in the past for me, so I better need tomake my own one. And that's where I'm AGAIN at this math-related point. I either need to implement optimized functions approximiting using taylor or so, OR I implement them using my memoization technique. I'd love to implement it cause it would enable to implement 1:1 without any segmentation of the original formula! I don't like to split these annoying formulas into step-by-step subterm components, that's only difficult to read and doesn't make my understanding of maths formulas and resulting code better. So I'm back at memoization and such... I don't know. It often happens to me that I see whether there's a "conceptual loop" in the beginning but then turning back to it's beginning after a while of stupid and random tingling with whatsoever necessary architecture and interface decisions. It's just difficult to design a such special system with flexibility in mind. I always care about that, it's kind of a "trademark" to ensure I won't have to worry about ugly, platform-specific implementation details. For examples, the math functions I already wrote don't even specify one type on their own. Instead, they are represented as template parameters for Index and Value types. This enables me to mix types for optimal performance and less impliciti type casting if desired. For example, If I want to develop for the Pandora I may choose other types depending on the Pandora's "performance profile". Or take 32 vs. 64 bit for example. One works great with normal ints and the other one works better with larger versions. I may be wrong here cause I can't exactly remember whether the size of int changes then. However, for bit compatibility and other, more special things it's the best idea to keep everything open. A trademark, you see. And that trademark is currently difficult to keep up with what I need to plan now. I don't like making too special techniques. Their use is always debatable unless you see them in action. I should take some nice library or framework for my next semester instead. It's easier to just read manuals and then make your boring projects for good marks and maximum freetime.

I may consider doing so.

Oh, and Epiphany is goind nuts lately. Constand crashes and bookmark lost. Thanks to home folder synchronization, it wasn't too damaging. Though I didn't save the newest ones... Well.

No comments: