Home || Visual Search || Applications || Architecture || Important Messages || OGL || Src

MatTrace.h

Go to the documentation of this file.
00001 #ifndef Impala_Core_Matrix_MatTrace_h
00002 #define Impala_Core_Matrix_MatTrace_h
00003 
00004 #include "Core/Matrix/MatFunc.h"
00005 
00006 namespace Impala
00007 {
00008 namespace Core
00009 {
00010 namespace Matrix
00011 {
00012 
00013 
00014 template<class ArrayT>
00015 inline Real64
00016 MatTrace(ArrayT* m)
00017 {
00018     Real64 total = 0.0;
00019     for (int i=0 ; i<Min(MatNrRow(m), MatNrCol(m)) ; i++)
00020         total += *MatE(m, i, i);
00021     return total;
00022 }
00023 
00024 } // namespace Matrix
00025 } // namespace Core
00026 } // namespace Impala
00027 
00028 #endif

Generated on Thu Jan 13 09:04:34 2011 for ImpalaSrc by  doxygen 1.5.1