Download Latest Version demo_binaries.zip (260.6 kB)
Email in envelope

Get an email when there's a new version of GoFXMath

Home / doc / DOXYGEN / html
Name Modified Size InfoDownloads / Week
Parent folder
search 2015-03-08
tab_a.png 2015-03-08 142 Bytes
tab_b.png 2015-03-08 169 Bytes
tab_h.png 2015-03-08 177 Bytes
tab_s.png 2015-03-08 184 Bytes
tabs.css 2015-03-08 1.2 kB
vec2_8h.html 2015-03-08 6.2 kB
vec2_8h_source.html 2015-03-08 14.6 kB
vec3_8h.html 2015-03-08 6.2 kB
vec3_8h_source.html 2015-03-08 16.9 kB
vec4_8h.html 2015-03-08 6.2 kB
vec4_8h_source.html 2015-03-08 20.3 kB
vecmath_8h.html 2015-03-08 33.4 kB
vecmath_8h_source.html 2015-03-08 44.7 kB
namespacemembers_vars.html 2015-03-08 11.6 kB
namespacemembers_w.html 2015-03-08 7.0 kB
namespacemembers_x.html 2015-03-08 7.0 kB
namespacemembers_y.html 2015-03-08 7.0 kB
namespacemembers_z.html 2015-03-08 7.0 kB
namespaces.html 2015-03-08 5.0 kB
nav_f.png 2015-03-08 153 Bytes
nav_g.png 2015-03-08 95 Bytes
nav_h.png 2015-03-08 98 Bytes
open.png 2015-03-08 123 Bytes
pages.html 2015-03-08 4.7 kB
quaternion_8h.html 2015-03-08 6.2 kB
quaternion_8h_source.html 2015-03-08 11.8 kB
scalar__math_8h.html 2015-03-08 14.7 kB
scalar__math_8h_source.html 2015-03-08 39.5 kB
sisd__defns_8h_source.html 2015-03-08 6.8 kB
splitbar.png 2015-03-08 314 Bytes
ssemat44_8h.html 2015-03-08 17.1 kB
ssemat44_8h_source.html 2015-03-08 159.8 kB
ssemat__math__defs_8h.html 2015-03-08 5.7 kB
ssemat__math__defs_8h_source.html 2015-03-08 5.8 kB
ssevec_8h.html 2015-03-08 63.4 kB
ssevec_8h_source.html 2015-03-08 174.5 kB
ssevec__math__defs_8h.html 2015-03-08 34.7 kB
ssevec__math__defs_8h_source.html 2015-03-08 67.3 kB
sync_off.png 2015-03-08 853 Bytes
sync_on.png 2015-03-08 845 Bytes
matmath_8h.html 2015-03-08 14.5 kB
matmath_8h_source.html 2015-03-08 16.7 kB
md__main__page.html 2015-03-08 9.9 kB
md_doxygen_mainpage.html 2015-03-08 4.1 kB
modules.html 2015-03-08 5.9 kB
namespacegfxmath.html 2015-03-08 239.4 kB
namespacemembers.html 2015-03-08 7.0 kB
namespacemembers_b.html 2015-03-08 7.0 kB
namespacemembers_c.html 2015-03-08 7.6 kB
namespacemembers_d.html 2015-03-08 7.0 kB
namespacemembers_e.html 2015-03-08 7.1 kB
namespacemembers_enum.html 2015-03-08 5.5 kB
namespacemembers_eval.html 2015-03-08 7.1 kB
namespacemembers_f.html 2015-03-08 12.0 kB
namespacemembers_func.html 2015-03-08 21.7 kB
namespacemembers_h.html 2015-03-08 7.0 kB
namespacemembers_i.html 2015-03-08 7.3 kB
namespacemembers_l.html 2015-03-08 7.8 kB
namespacemembers_m.html 2015-03-08 9.8 kB
namespacemembers_n.html 2015-03-08 7.7 kB
namespacemembers_p.html 2015-03-08 7.4 kB
namespacemembers_q.html 2015-03-08 7.5 kB
namespacemembers_r.html 2015-03-08 7.3 kB
namespacemembers_s.html 2015-03-08 9.2 kB
namespacemembers_t.html 2015-03-08 7.4 kB
namespacemembers_type.html 2015-03-08 5.2 kB
namespacemembers_u.html 2015-03-08 7.3 kB
namespacemembers_v.html 2015-03-08 13.7 kB
doc.png 2015-03-08 746 Bytes
doxygen.css 2015-03-08 25.5 kB
doxygen.png 2015-03-08 3.8 kB
dynsections.js 2015-03-08 3.1 kB
files.html 2015-03-08 9.1 kB
folderclosed.png 2015-03-08 616 Bytes
folderopen.png 2015-03-08 597 Bytes
functions.html 2015-03-08 25.1 kB
functions_func.html 2015-03-08 20.0 kB
functions_rela.html 2015-03-08 6.9 kB
functions_vars.html 2015-03-08 7.5 kB
gfxmath__config_8h_source.html 2015-03-08 5.6 kB
globals.html 2015-03-08 5.0 kB
globals_defs.html 2015-03-08 4.8 kB
group___s_i_m_d_mat_math.html 2015-03-08 5.0 kB
group___s_i_m_d_vec_math.html 2015-03-08 165.4 kB
group___s_i_s_d_mat_math.html 2015-03-08 55.6 kB
group___s_i_s_d_scalar_math.html 2015-03-08 28.9 kB
group___s_i_s_d_vec_math.html 2015-03-08 107.7 kB
group___scalar_math_consts.html 2015-03-08 32.0 kB
group___vec_math_defs.html 2015-03-08 4.8 kB
hierarchy.html 2015-03-08 6.9 kB
index.html 2015-03-08 9.8 kB
jquery.js 2015-03-08 146.3 kB
mat44_8h.html 2015-03-08 7.2 kB
mat44_8h_source.html 2015-03-08 23.3 kB
math__defs_8h.html 2015-03-08 29.2 kB
math__defs_8h_source.html 2015-03-08 45.2 kB
_form0.eps 2015-03-08 69.8 kB
_form0.ps 2015-03-08 150 Bytes
_formulas.aux 2015-03-08 9 Bytes
_formulas.dvi 2015-03-08 908 Bytes
_formulas.log 2015-03-08 4.4 kB
_formulas.tex 2015-03-08 490 Bytes
annotated.html 2015-03-08 7.1 kB
arrowdown.png 2015-03-08 246 Bytes
arrowright.png 2015-03-08 229 Bytes
bc_s.png 2015-03-08 676 Bytes
bdwn.png 2015-03-08 147 Bytes
classes.html 2015-03-08 7.0 kB
classgfxmath_1_1_mat44-members.html 2015-03-08 15.1 kB
classgfxmath_1_1_mat44.html 2015-03-08 52.9 kB
classgfxmath_1_1_quaternion-members.html 2015-03-08 21.1 kB
classgfxmath_1_1_quaternion.html 2015-03-08 80.8 kB
classgfxmath_1_1_quaternion.png 2015-03-08 574 Bytes
classgfxmath_1_1_sse_mat44-members.html 2015-03-08 13.1 kB
classgfxmath_1_1_sse_mat44.html 2015-03-08 67.9 kB
classgfxmath_1_1_vec2-members.html 2015-03-08 13.6 kB
classgfxmath_1_1_vec2.html 2015-03-08 41.5 kB
classgfxmath_1_1_vec3-members.html 2015-03-08 15.2 kB
classgfxmath_1_1_vec3.html 2015-03-08 68.5 kB
classgfxmath_1_1_vec4-members.html 2015-03-08 17.7 kB
classgfxmath_1_1_vec4.html 2015-03-08 84.7 kB
classgfxmath_1_1_vec4.png 2015-03-08 581 Bytes
closed.png 2015-03-08 132 Bytes
customdoxygen.css 2015-03-08 27.0 kB
dir_d44c64559bbebec7f509842c48db8b23.html 2015-03-08 9.4 kB
Totals: 126 Items   2.7 MB 0



G○FXMath

Introduction

The (G○F)(X) Math library (abbreviated GoFXMath) is a lightweight, but powerful, data-oriented math library focused on the development of graphics-oriented applications in C++.

Design

Given that the GoFXMath library is designed with data in mind, much of its functionality is overloaded between two major sections: SISD code and SIMD code.

SISD


The SISD code is all standard C++, and generally does not leverage the hardware or compiler for optimizations more than is absolutely necessary, keeping the code relatively fast without sacrificing too much readability. Given that the compiler will typically optimize standard C++ operations far better than most programmers ever could anyway, this doesn't affect the performance of the SISD code much.

SIMD


The SIMD side, on the other hand, almost exclusively utilizes intel® SSE intrinsics, and frequently makes use of some very low-level techniques. However, while these will somewhat reduce readability, many of the more common operations (such as absolute value, negation, etc.) have been written into helper functions. Additionally, the many of the intel® SSE functions have been given wrapper functions to improve their readability, and maintainability for future changes to SSE functions or additions of similar functionality from other libraries such as ARM NEON™. For example, _mm_mul_ps(__m128) is wrapped in VecMul(SseVec). It should be noted that almost all the functions in the SIMD portions are marked as inline, including the wrapper functions, and are fully defined in the header files. As well, GoFXMath library does not make use of .inl files, or split header files for inline functions; the declarations and definitions are fully contained in the same files.

It should be noted that the defined functions and constants for the GoFXMath library rely on big-endian logic for the SSE registers. That is to say that the logic incorporated positions the values in "reverse" order in the register from what the built-in sse functions use. The reason for this is to improve readability of complex SSE logic, and to prevent extra loading/unloading overhead when switching between the standard registers and the SSE registers. What this means is that when loading a Vec4 into or out from an SSE register, its values will not need to be reversed on each transfer, and can simply be loaded and unloaded in-order. Similarly, when calling one of the SetSseVec functions, the arguments passed are to be used in the same logical order for the desired vector (e.g. SetSseVec3(x,y,z) loads the SSE register with the values like this: <1.0f, z, y, x> where the 1.0f is used with calculations involving transformation matrices.

Requirements

The GoFXMath library doesn't have any particular dependencies attached to it. It has been built and tested with Visual C++ 2013 (32 and 64-bit versions, on Windows 7 64-bit), MinGW-w64 g++4.9.2 (64-bit version on Windows 7 64-bit), and GNU g++4.8.2 (Ubuntu 14.04.2 LTS 64-bit). As of yet, it has not been tested on an Apple machine, though the standard XCode C++ compiler should yield similarly successful results.

The GoFXMath library does make use of some C++11 features, so any compiler that should have any hope of building or using it would need to be up to at least the same level of C++11 standards as Visual C++ 12.

Additionally, as mentioned in the SIMD section, the GoFXMath library makes heavy use of intel® SSE functions. While most of this functionality is defined in earlier forms of the SSE intrinsics, some require SSE-4.1. However, most currently used, standard, consumer-grade CPUs should be able to accommodate this requirement, as it has had fairly wide support for quite some time.

Tests and Demo Projects

The prepackaged distribution files, in addition to the binaries and documentation, also contain the compiled test projects and a demo project written for OpenGL (using GLEW and GLFW).

Tests


The tests should build and run on any Windows 7 or higher machine, as well as any Linux distribution capable of running g++4.8.2 compiled libraries. The tests have been built with the Catch Testing Framework. Note that there are (sometimes significantly) more than one assertion-per-test, in many, if not most, of the test cases. The tests are written this way due to the fact that the catch framework offers a method of posing an assert while not forcing a halt on a specific test case, and all the tests have been written with this method in mind. There are also numerous fringe-cases when working with matrices and vectors (especially SSE vectors) that must be accounted for to maintain the expected mathematical behavior.

More information on how to run (or even add to) the tests can be found on the Catch Testing Framework github page.

Demo


There are included windows and linux executables for the demo project. Naturally, the source code is included alongside the executable. As mentioned in the beginning of this section, the demo project uses GLEW and GLFW, and will require both to be properly linked before it can be built.

Source: README.md, updated 2015-03-08