Main Page | Namespace List | Class Hierarchy | Class List | File List | Namespace Members | Class Members | File Members

gslib::glsl_math::tuple_mixin< SubClass, Size > Struct Template Reference

This class provides basic operators. More...

#include <glsl_math.h>

Inheritance diagram for gslib::glsl_math::tuple_mixin< SubClass, Size >:

Inheritance graph
[legend]
Collaboration diagram for gslib::glsl_math::tuple_mixin< SubClass, Size >:

Collaboration graph
[legend]
List of all members.

Public Member Functions

SubClass & operator+= (const tuple< Size > &other)
SubClass operator+ (const tuple< Size > &other) const
SubClass & operator-= (const tuple< Size > &other)
SubClass operator- (const tuple< Size > &other) const
SubClass & operator *= (value_type v)
SubClass operator * (value_type v) const
SubClass & operator/= (value_type v)
SubClass operator/ (value_type v) const
SubClass & operator+ () const
SubClass operator- () const
bool operator< (const tuple< Size > &other) const
bool operator== (const tuple< Size > &other) const
bool operator!= (const tuple< Size > &other) const

Friends

SubClass operator * (value_type v, const tuple_mixin &other)

Detailed Description

template<typename SubClass, size_t Size>
struct gslib::glsl_math::tuple_mixin< SubClass, Size >

This class provides basic operators.

Definition at line 186 of file glsl_math.h.


Member Function Documentation

template<typename SubClass, size_t Size>
SubClass gslib::glsl_math::tuple_mixin< SubClass, Size >::operator * value_type  v  )  const [inline]
 

Reimplemented in gslib::glsl_math::vector_mixin< SubClass, Size >, gslib::glsl_math::matrix_mixin< SubClass, FriendVector, RowSize, ColumnSize >, gslib::glsl_math::quat, gslib::glsl_math::vector_mixin< vec2, 2 >, gslib::glsl_math::vector_mixin< vec3, 3 >, gslib::glsl_math::vector_mixin< vec4, 4 >, gslib::glsl_math::matrix_mixin< mat4, vec4, 4, 4 >, gslib::glsl_math::matrix_mixin< mat3, vec3, 3, 3 >, and gslib::glsl_math::matrix_mixin< mat2, vec2, 2, 2 >.

Definition at line 212 of file glsl_math.h.

00212                                                        {
00213                 SubClass result( *static_cast< const SubClass* >( this ) );
00214                 result *= v;
00215                 return result;
00216             }

template<typename SubClass, size_t Size>
SubClass& gslib::glsl_math::tuple_mixin< SubClass, Size >::operator *= value_type  v  )  [inline]
 

Reimplemented in gslib::glsl_math::vector_mixin< SubClass, Size >, gslib::glsl_math::matrix_mixin< SubClass, FriendVector, RowSize, ColumnSize >, gslib::glsl_math::quat, gslib::glsl_math::vector_mixin< vec2, 2 >, gslib::glsl_math::vector_mixin< vec3, 3 >, gslib::glsl_math::vector_mixin< vec4, 4 >, gslib::glsl_math::matrix_mixin< mat4, vec4, 4, 4 >, gslib::glsl_math::matrix_mixin< mat3, vec3, 3, 3 >, and gslib::glsl_math::matrix_mixin< mat2, vec2, 2, 2 >.

Definition at line 207 of file glsl_math.h.

Referenced by gslib::glsl_math::tuple_mixin< vec4, Size >::operator/=().

00207                                                    {
00208                 std::transform(
00209                     begin(), end(), begin(), std::bind2nd( std::multiplies< value_type >(), v ) );
00210                 return *static_cast< SubClass* >( this );
00211             }

template<typename SubClass, size_t Size>
bool gslib::glsl_math::tuple_mixin< SubClass, Size >::operator!= const tuple< Size > &  other  )  const [inline]
 

Definition at line 240 of file glsl_math.h.

00240                                                                   {
00241                 return !operator == ( other );
00242             }

template<typename SubClass, size_t Size>
SubClass& gslib::glsl_math::tuple_mixin< SubClass, Size >::operator+  )  const [inline]
 

Definition at line 226 of file glsl_math.h.

00226                                           {
00227                 return *static_cast< SubClass* >( this );
00228             }

template<typename SubClass, size_t Size>
SubClass gslib::glsl_math::tuple_mixin< SubClass, Size >::operator+ const tuple< Size > &  other  )  const [inline]
 

Definition at line 192 of file glsl_math.h.

00192                                                                      {
00193                 SubClass result( *static_cast< const SubClass* >( this ) );
00194                 result += other;
00195                 return result;
00196             }

template<typename SubClass, size_t Size>
SubClass& gslib::glsl_math::tuple_mixin< SubClass, Size >::operator+= const tuple< Size > &  other  )  [inline]
 

Definition at line 187 of file glsl_math.h.

00187                                                                  {
00188                 std::transform(
00189                     begin(), end(), other.begin(), begin(), std::plus< value_type >() );
00190                 return *static_cast< SubClass* >( this );
00191             }

template<typename SubClass, size_t Size>
SubClass gslib::glsl_math::tuple_mixin< SubClass, Size >::operator-  )  const [inline]
 

Definition at line 229 of file glsl_math.h.

00229                                          {
00230                 SubClass result;
00231                 std::transform( begin(), end(), result.begin(), std::negate< value_type >() );
00232                 return result;
00233             }

template<typename SubClass, size_t Size>
SubClass gslib::glsl_math::tuple_mixin< SubClass, Size >::operator- const tuple< Size > &  other  )  const [inline]
 

Definition at line 202 of file glsl_math.h.

00202                                                                      {
00203                 SubClass result( *static_cast< const SubClass* >( this ) );
00204                 result -= other;
00205                 return result;
00206             }

template<typename SubClass, size_t Size>
SubClass& gslib::glsl_math::tuple_mixin< SubClass, Size >::operator-= const tuple< Size > &  other  )  [inline]
 

Definition at line 197 of file glsl_math.h.

00197                                                                  {
00198                 std::transform(
00199                     begin(), end(), other.begin(), begin(), std::minus< value_type >() );
00200                 return *static_cast< SubClass* >( this );
00201             }

template<typename SubClass, size_t Size>
SubClass gslib::glsl_math::tuple_mixin< SubClass, Size >::operator/ value_type  v  )  const [inline]
 

Reimplemented in gslib::glsl_math::vector_mixin< SubClass, Size >, gslib::glsl_math::matrix_mixin< SubClass, FriendVector, RowSize, ColumnSize >, gslib::glsl_math::quat, gslib::glsl_math::vector_mixin< vec2, 2 >, gslib::glsl_math::vector_mixin< vec3, 3 >, gslib::glsl_math::vector_mixin< vec4, 4 >, gslib::glsl_math::matrix_mixin< mat4, vec4, 4, 4 >, gslib::glsl_math::matrix_mixin< mat3, vec3, 3, 3 >, and gslib::glsl_math::matrix_mixin< mat2, vec2, 2, 2 >.

Definition at line 223 of file glsl_math.h.

00223                                                        {
00224                 return ( *this ) * ( 1.0f / v );
00225             }

template<typename SubClass, size_t Size>
SubClass& gslib::glsl_math::tuple_mixin< SubClass, Size >::operator/= value_type  v  )  [inline]
 

Reimplemented in gslib::glsl_math::vector_mixin< SubClass, Size >, gslib::glsl_math::matrix_mixin< SubClass, FriendVector, RowSize, ColumnSize >, gslib::glsl_math::quat, gslib::glsl_math::vector_mixin< vec2, 2 >, gslib::glsl_math::vector_mixin< vec3, 3 >, gslib::glsl_math::vector_mixin< vec4, 4 >, gslib::glsl_math::matrix_mixin< mat4, vec4, 4, 4 >, gslib::glsl_math::matrix_mixin< mat3, vec3, 3, 3 >, and gslib::glsl_math::matrix_mixin< mat2, vec2, 2, 2 >.

Definition at line 220 of file glsl_math.h.

00220                                                    {
00221                 return operator *= ( 1.0f / v );
00222             }

template<typename SubClass, size_t Size>
bool gslib::glsl_math::tuple_mixin< SubClass, Size >::operator< const tuple< Size > &  other  )  const [inline]
 

Definition at line 234 of file glsl_math.h.

00234                                                                  {
00235                 return std::lexicographical_compare( begin(), end(), other.begin(), other.end() );
00236             }

template<typename SubClass, size_t Size>
bool gslib::glsl_math::tuple_mixin< SubClass, Size >::operator== const tuple< Size > &  other  )  const [inline]
 

Definition at line 237 of file glsl_math.h.

Referenced by gslib::glsl_math::tuple_mixin< vec4, Size >::operator!=().

00237                                                                   {
00238                 return std::equal( begin(), end(), other.begin() );
00239             }


Friends And Related Function Documentation

template<typename SubClass, size_t Size>
SubClass operator * value_type  v,
const tuple_mixin< SubClass, Size > &  other
[friend]
 

Definition at line 217 of file glsl_math.h.

00217                                                                                   {
00218                 return other * v;
00219             }


The documentation for this struct was generated from the following file:
Generated on Fri Dec 24 00:52:06 2004 for glsl_math by doxygen 1.3.6