/*! \file inline-matrix.h * * \author John Reppy */ /* * COPYRIGHT (c) 2011 The Diderot Project (http://diderot-language.cs.uchicago.edu) * All rights reserved. */ #ifndef _DIDEROT_INLINE_MATRIX_H_ #define _DIDEROT_INLINE_MATRIX_H_ #ifndef _DIDEROT_TYPES_H_ #include "types.h" #endif #ifndef _DIDEROT_INLINE_VEC2_H_ # include "inline-vec2.h" #endif #ifndef _DIDEROT_INLINE_VEC3_H_ # include "inline-vec3.h" #endif #ifndef _DIDEROT_INLINE_VEC4_H_ # include "inline-vec4.h" #endif /********** 2x2 matrix functions **********/ STATIC_INLINE float trace2x2f (Diderot_Mat2x2_t m) { return m[0].r[0] + m[1].r[1]; } // The Frobenius norm of a matrix is the sum of the squares of the elements STATIC_INLINE float norm2x2f (Diderot_Mat2x2_t m) { return dot2f(m[0].v,m[0].v) + dot2f(m[1].v,m[1].v); } /********** 3x3 matrix functions **********/ STATIC_INLINE float trace3x3f (Diderot_Mat3x3_t m) { return m[0].r[0] + m[1].r[1] + m[2].r[2]; } // The Frobenius norm of a matrix is the sum of the squares of the elements STATIC_INLINE float norm3x3f (Diderot_Mat3x3_t m) { return dot3f(m[0].v,m[0].v) + dot3f(m[1].v,m[1].v) + dot3f(m[2].v,m[2].v); } /********** 4x4 matrix functions **********/ STATIC_INLINE float trace4x4f (Diderot_Mat4x4_t m) { return m[0].r[0] + m[1].r[1] + m[2].r[2] + m[3].r[3]; } // The Frobenius norm of a matrix is the sum of the squares of the elements STATIC_INLINE float norm4x4f (Diderot_Mat4x4_t m) { return dot4f(m[0].v,m[0].v) + dot4f(m[1].v,m[1].v) + dot4f(m[2].v,m[2].v) + dot4f(m[3].v,m[3].v); } #endif /* !_DIDEROT_INLINE_MATRIX_H_ */
Click to toggle
does not end with </html> tag
does not end with </body> tag
The output has ended thus: .v,m[1].v) + dot4f(m[2].v,m[2].v) + dot4f(m[3].v,m[3].v); } #endif /* !_DIDEROT_INLINE_MATRIX_H_ */