Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

samgzman

Dynamic maths library implementation

This topic is 5306 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Lets say one wanted to implement a maths library which selected optimized math routines (class methods) for the system it ran on at run-time. It seems to me that the most logical way to implement such a system would be to use an abstract class (of a vecor or matrix) and then derive child classes for each system optimization and also a standard one w/ no hardware enhancements. Then, use a class facotry to spawn the proper object instance from the appropriate class. However, from what i read, this approach might not be the best due to the overhead that comes w/ virtual functions. I have read the other topics which suggest compiling different versions, but my main objective is to create a system that adapts at runtime. Anyone have any thoughts or suggestions as to the most clever and efficient implementation??

Share this post


Link to post
Share on other sites
Advertisement
There is a projet called SoftWire which allows you to conditionally execute assembler code. I haven''t used it yet, it is interesting though and designed for problems like that.

I forget http://softwire.sourceforge.net I think is the address.

Share this post


Link to post
Share on other sites
I think if you look at the Strategy design pattern it might be helpful but i dont think a dynamic math library would be very effcient especially for vector & matrices where you will use them heavily, i think you''d be better off using static polymorphism and implement strategy pattern as template parameter the only problem is you wont be able to change the strategy at runtime.

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!