matrix_concat.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 matrix_concat_h
00014 #define matrix_concat_h
00015 
00016 #include <cml/matrix/matrix_expr.h>
00017 
00018 /* This will all most likely be abstracted away in a future version of the
00019  * CML. For now, this file provides support for functions that need to
00020  * concatenate transformation matrices in a basis-independent manner.
00021  *
00022  * @todo: The 2x2 and 3x3 versions of these functions are currently in
00023  * matrix_rotation.h. They should be moved here.
00024  */
00025 
00026 namespace cml {
00027 namespace detail {
00028 
00030 #define MAT_TEMP_4X4 matrix<         \
00031     typename et::ScalarPromote<      \
00032         typename MatT_1::value_type, \
00033         typename MatT_2::value_type  \
00034     >::type,                         \
00035     fixed<4,4>,                      \
00036     typename MatT_1::basis_orient,   \
00037     typename MatT_1::layout          \
00038 >
00039 
00040 template < class MatT_1, class MatT_2 > MAT_TEMP_4X4
00041 matrix_concat_transforms_4x4(const MatT_1& m1, const MatT_2& m2, row_basis) {
00042     return m1*m2;
00043 }
00044 
00046 template < class MatT_1, class MatT_2 > MAT_TEMP_4X4
00047 matrix_concat_transforms_4x4(const MatT_1& m1, const MatT_2& m2, col_basis) {
00048     return m2*m1;
00049 }
00050 
00052 template < class MatT_1, class MatT_2 > MAT_TEMP_4X4
00053 matrix_concat_transforms_4x4(const MatT_1& m1, const MatT_2& m2) {
00054     return matrix_concat_transforms_4x4(m1,m2,typename MatT_1::basis_orient());
00055 }
00056 
00057 #undef MAT_TEMP_4x4
00058 
00059 } // namespace detail
00060 } // namespace cml
00061 
00062 #endif

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