cml::et::BinaryVectorOp< LeftT, RightT, OpT > Class Template Reference

A binary vector expression. More...

#include <vector_expr.h>

Collaboration diagram for cml::et::BinaryVectorOp< LeftT, RightT, OpT >:

Collaboration graph
[legend]

List of all members.

Public Types

enum  { array_size = result_type::array_size }
 Record result size as an enum (if applicable). More...
typedef cml::et::not_assignable_tag assignable_tag
typedef GetCheckedSize< LeftT,
RightT, size_tag
checked_size
typedef binary_expression expr_ary
typedef expr_type expr_const_reference
typedef BinaryVectorOp< LeftT,
RightT, OpT > 
expr_type
typedef
left_traits::const_reference 
left_reference
typedef left_traits::result_type left_result
typedef ExprTraits< LeftT > left_traits
typedef vector_result_tag result_tag
typedef VectorPromote
< left_result, right_result >
::type 
result_type
typedef
right_traits::const_reference 
right_reference
typedef right_traits::result_type right_result
typedef ExprTraits< RightT > right_traits
typedef result_type::size_tag size_tag
typedef result_type::temporary_type temporary_type
typedef OpT::value_type value_type

Public Member Functions

 BinaryVectorOp (const expr_type &e)
 Copy constructor.
 BinaryVectorOp (left_reference left, right_reference right)
 Construct from the two subexpressions.
left_reference left_expression () const
 Return reference to left expression.
value_type length () const
 Return the length.
value_type length_squared () const
 Return square of the length.
result_type normalize () const
 Return the result as a normalized vector.
value_type operator[] (size_t i) const
 Compute value at index i of the result vector.
right_reference right_expression () const
 Return reference to right expression.
size_t size () const
 Return the size of the vector result.

Protected Attributes

left_reference m_left
right_reference m_right

Private Member Functions

expr_typeoperator= (const expr_type &)

Private Attributes

checked_size::check_type _dummy


Detailed Description

template<class LeftT, class RightT, class OpT>
class cml::et::BinaryVectorOp< LeftT, RightT, OpT >

A binary vector expression.

The operator's operator() method must take exactly two arguments.

Definition at line 277 of file vector_expr.h.


Member Typedef Documentation

template<class LeftT , class RightT , class OpT >
typedef cml::et::not_assignable_tag cml::et::BinaryVectorOp< LeftT, RightT, OpT >::assignable_tag

Definition at line 307 of file vector_expr.h.

template<class LeftT , class RightT , class OpT >
typedef GetCheckedSize<LeftT,RightT,size_tag> cml::et::BinaryVectorOp< LeftT, RightT, OpT >::checked_size

Definition at line 313 of file vector_expr.h.

template<class LeftT , class RightT , class OpT >
typedef binary_expression cml::et::BinaryVectorOp< LeftT, RightT, OpT >::expr_ary

Definition at line 284 of file vector_expr.h.

template<class LeftT , class RightT , class OpT >
typedef expr_type cml::et::BinaryVectorOp< LeftT, RightT, OpT >::expr_const_reference

Definition at line 287 of file vector_expr.h.

template<class LeftT , class RightT , class OpT >
typedef BinaryVectorOp<LeftT,RightT,OpT> cml::et::BinaryVectorOp< LeftT, RightT, OpT >::expr_type

Definition at line 281 of file vector_expr.h.

template<class LeftT , class RightT , class OpT >
typedef left_traits::const_reference cml::et::BinaryVectorOp< LeftT, RightT, OpT >::left_reference

Definition at line 297 of file vector_expr.h.

template<class LeftT , class RightT , class OpT >
typedef left_traits::result_type cml::et::BinaryVectorOp< LeftT, RightT, OpT >::left_result

Definition at line 301 of file vector_expr.h.

template<class LeftT , class RightT , class OpT >
typedef ExprTraits<LeftT> cml::et::BinaryVectorOp< LeftT, RightT, OpT >::left_traits

Definition at line 293 of file vector_expr.h.

template<class LeftT , class RightT , class OpT >
typedef vector_result_tag cml::et::BinaryVectorOp< LeftT, RightT, OpT >::result_tag

Definition at line 290 of file vector_expr.h.

template<class LeftT , class RightT , class OpT >
typedef VectorPromote<left_result,right_result>::type cml::et::BinaryVectorOp< LeftT, RightT, OpT >::result_type

Definition at line 303 of file vector_expr.h.

template<class LeftT , class RightT , class OpT >
typedef right_traits::const_reference cml::et::BinaryVectorOp< LeftT, RightT, OpT >::right_reference

Definition at line 298 of file vector_expr.h.

template<class LeftT , class RightT , class OpT >
typedef right_traits::result_type cml::et::BinaryVectorOp< LeftT, RightT, OpT >::right_result

Definition at line 302 of file vector_expr.h.

template<class LeftT , class RightT , class OpT >
typedef ExprTraits<RightT> cml::et::BinaryVectorOp< LeftT, RightT, OpT >::right_traits

Definition at line 294 of file vector_expr.h.

template<class LeftT , class RightT , class OpT >
typedef result_type::size_tag cml::et::BinaryVectorOp< LeftT, RightT, OpT >::size_tag

Definition at line 304 of file vector_expr.h.

template<class LeftT , class RightT , class OpT >
typedef result_type::temporary_type cml::et::BinaryVectorOp< LeftT, RightT, OpT >::temporary_type

Definition at line 310 of file vector_expr.h.

template<class LeftT , class RightT , class OpT >
typedef OpT::value_type cml::et::BinaryVectorOp< LeftT, RightT, OpT >::value_type

Definition at line 289 of file vector_expr.h.


Member Enumeration Documentation

template<class LeftT , class RightT , class OpT >
anonymous enum

Record result size as an enum (if applicable).

Enumerator:
array_size 

Definition at line 319 of file vector_expr.h.


Constructor & Destructor Documentation

template<class LeftT , class RightT , class OpT >
cml::et::BinaryVectorOp< LeftT, RightT, OpT >::BinaryVectorOp ( left_reference  left,
right_reference  right 
) [inline, explicit]

Construct from the two subexpressions.

Definition at line 378 of file vector_expr.h.

template<class LeftT , class RightT , class OpT >
cml::et::BinaryVectorOp< LeftT, RightT, OpT >::BinaryVectorOp ( const expr_type e  )  [inline]

Copy constructor.

Definition at line 382 of file vector_expr.h.


Member Function Documentation

template<class LeftT , class RightT , class OpT >
left_reference cml::et::BinaryVectorOp< LeftT, RightT, OpT >::left_expression (  )  const [inline]

Return reference to left expression.

Definition at line 369 of file vector_expr.h.

References cml::et::BinaryVectorOp< LeftT, RightT, OpT >::m_left.

template<class LeftT , class RightT , class OpT >
value_type cml::et::BinaryVectorOp< LeftT, RightT, OpT >::length (  )  const [inline]

Return the length.

Definition at line 332 of file vector_expr.h.

References cml::et::BinaryVectorOp< LeftT, RightT, OpT >::length_squared().

Here is the call graph for this function:

template<class LeftT , class RightT , class OpT >
value_type cml::et::BinaryVectorOp< LeftT, RightT, OpT >::length_squared (  )  const [inline]

Return square of the length.

Definition at line 325 of file vector_expr.h.

References cml::dot().

Referenced by cml::et::BinaryVectorOp< LeftT, RightT, OpT >::length().

Here is the call graph for this function:

Here is the caller graph for this function:

template<class LeftT , class RightT , class OpT >
result_type cml::et::BinaryVectorOp< LeftT, RightT, OpT >::normalize (  )  const [inline]

Return the result as a normalized vector.

Definition at line 337 of file vector_expr.h.

template<class LeftT , class RightT , class OpT >
expr_type& cml::et::BinaryVectorOp< LeftT, RightT, OpT >::operator= ( const expr_type  )  [private]

template<class LeftT , class RightT , class OpT >
value_type cml::et::BinaryVectorOp< LeftT, RightT, OpT >::operator[] ( size_t  i  )  const [inline]

Compute value at index i of the result vector.

Definition at line 343 of file vector_expr.h.

References cml::et::BinaryVectorOp< LeftT, RightT, OpT >::m_left, and cml::et::BinaryVectorOp< LeftT, RightT, OpT >::m_right.

template<class LeftT , class RightT , class OpT >
right_reference cml::et::BinaryVectorOp< LeftT, RightT, OpT >::right_expression (  )  const [inline]

Return reference to right expression.

Definition at line 372 of file vector_expr.h.

References cml::et::BinaryVectorOp< LeftT, RightT, OpT >::m_right.

template<class LeftT , class RightT , class OpT >
size_t cml::et::BinaryVectorOp< LeftT, RightT, OpT >::size (  )  const [inline]

Return the size of the vector result.

Exceptions:
std::invalid_argument if the expressions do not have the same size.

Definition at line 361 of file vector_expr.h.

References cml::et::CheckedSize(), cml::et::BinaryVectorOp< LeftT, RightT, OpT >::m_left, and cml::et::BinaryVectorOp< LeftT, RightT, OpT >::m_right.

Referenced by cml::et::ExprTraits< BinaryVectorOp< LeftT, RightT, OpT > >::size().

Here is the call graph for this function:

Here is the caller graph for this function:


Member Data Documentation

template<class LeftT , class RightT , class OpT >
checked_size::check_type cml::et::BinaryVectorOp< LeftT, RightT, OpT >::_dummy [private]

Definition at line 395 of file vector_expr.h.

template<class LeftT , class RightT , class OpT >
left_reference cml::et::BinaryVectorOp< LeftT, RightT, OpT >::m_left [protected]

template<class LeftT , class RightT , class OpT >
right_reference cml::et::BinaryVectorOp< LeftT, RightT, OpT >::m_right [protected]


The documentation for this class was generated from the following file:

Generated on Sat Jul 18 19:35:39 2009 for CML 1.0 by  doxygen 1.5.9