]>
Dogcows Code - chaz/yoink/blob - src/cml/vector/vector_functions.h
1 /* -*- C++ -*- ------------------------------------------------------------
3 Copyright (c) 2007 Jesse Anders and Demian Nave http://cmldev.net/
5 The Configurable Math Library (CML) is distributed under the terms of the
6 Boost Software License, v1.0 (see cml/LICENSE for details).
8 *-----------------------------------------------------------------------*/
13 #ifndef vector_functions_h
14 #define vector_functions_h
18 /** Squared length of a vector. */
19 template<typename E
, class AT
>
20 inline typename vector
<E
,AT
>::value_type
21 length_squared(const vector
<E
,AT
>& arg
)
23 return arg
.length_squared();
26 /** Squared length of a vector expr. */
27 template<typename XprT
>
28 inline typename
XprT::value_type
29 length_squared(VECXPR_ARG_TYPE arg
)
31 return arg
.length_squared();
34 /** Length of a vector. */
35 template<typename E
, class AT
>
36 inline typename vector
<E
,AT
>::value_type
37 length(const vector
<E
,AT
>& arg
)
42 /** Length of a vector expr. */
43 template<typename XprT
>
44 inline typename
XprT::value_type
45 length(VECXPR_ARG_TYPE arg
)
50 /** Normalize a vector. */
51 template<typename E
, class AT
>
53 normalize(const vector
<E
,AT
>& arg
)
55 vector
<E
, AT
> result(arg
);
60 /** Normalize a vector expr. */
61 template<typename XprT
>
62 inline typename
XprT::result_type
63 normalize(VECXPR_ARG_TYPE arg
)
65 return arg
.normalize();
72 // -------------------------------------------------------------------------
This page took 0.038412 seconds and 5 git commands to generate.