innerProd.m 314 B

1234567891011
  1. % RES = innerProd(MTX)
  2. %
  3. % Compute (MTX' * MTX) efficiently (i.e., without copying the matrix)
  4. %
  5. % NOTE: This function used to call a MEX function (C code) to avoid copying, but
  6. % newer versions of matlab have eliminated the overhead of the
  7. % simpler form below.
  8. function res = innerProd(mtx)
  9. res = mtx' * mtx;