matrix_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 matrix_functions_h
00014 #define matrix_functions_h
00015 
00016 namespace cml {
00017 
00026 template<typename E, class AT, typename BO, typename L>
00027 inline matrix<E,AT,BO,L>
00028 identity(const matrix<E,AT,BO,L>& m)
00029 {
00030     typename matrix<E,AT,BO,L>::temporary_type result;
00031 
00032     /* This is a no-op for fixed-size matrices: */
00033     cml::et::detail::Resize(result, m.size());
00034     result.identity();
00035     return result;
00036 }
00037 
00038 } // namespace cml
00039 
00040 #endif
00041 
00042 // -------------------------------------------------------------------------
00043 // vim:ft=cpp

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