% TRACEAXB Computes the trace of two matrices. % % [TR] = TRACEAXB(A,B) % % This calculates the trace of the product of two matrices. It is also % equivalent to X = trace(A*B), where A and B are matrices. % % Inputs: % A = Square matrix, of size n % B = Square matrix, of size n % % Output: % TR = Trace result of matrix product % % % The computation is written in C code for execution of fast algorithm. The % origin of the fast algorithm is contributed by Y. Zhang (2004) for the % use in Gaussian Process Prior Models. % % % (C) Gaussian Process Toolbox 1.0 % (C) Copyright 2004-2007, Keith Neo % http://www.hamilton.ie