vector_functions.h

Go to the documentation of this file.
00001 /* -*- C++ -*- ------------------------------------------------------------
00002  
00003 Copyright (c) 2007 Jesse Anders and Demian Nave http://cmldev.net/
00004 
00005 The Configurable Math Library (CML) is distributed under the terms of the
00006 Boost Software License, v1.0 (see cml/LICENSE for details).
00007 
00008  *-----------------------------------------------------------------------*/
00013 #ifndef vector_functions_h
00014 #define vector_functions_h
00015 
00016 namespace cml {
00017 
00019 template<typename E, class AT>
00020 inline typename vector<E,AT>::value_type
00021 length_squared(const vector<E,AT>& arg)
00022 {
00023     return arg.length_squared();
00024 }
00025 
00027 template<typename XprT>
00028 inline typename XprT::value_type
00029 length_squared(VECXPR_ARG_TYPE arg)
00030 {
00031     return arg.length_squared();
00032 }
00033 
00035 template<typename E, class AT>
00036 inline typename vector<E,AT>::value_type
00037 length(const vector<E,AT>& arg)
00038 {
00039     return arg.length();
00040 }
00041 
00043 template<typename XprT>
00044 inline typename XprT::value_type
00045 length(VECXPR_ARG_TYPE arg)
00046 {
00047     return arg.length();
00048 }
00049 
00051 template<typename E, class AT>
00052 inline vector<E, AT>
00053 normalize(const vector<E,AT>& arg)
00054 {
00055     vector<E, AT> result(arg);
00056     result.normalize();
00057     return result;
00058 }
00059 
00061 template<typename XprT>
00062 inline typename XprT::result_type
00063 normalize(VECXPR_ARG_TYPE arg)
00064 {
00065     return arg.normalize();
00066 }
00067 
00068 } // namespace cml
00069 
00070 #endif
00071 
00072 // -------------------------------------------------------------------------
00073 // vim:ft=cpp

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