Difference between revisions of "Hdot.m"
m (Rename Arguments section heading to Parameters) |
(sync with Spinach main f053e432: Parameters line updated to square matrices of the same size) |
||
| (One intermediate revision by the same user not shown) | |||
| Line 8: | Line 8: | ||
==Parameters== | ==Parameters== | ||
| − | A,B - | + | A,B - square matrices of the same size |
==Outputs== | ==Outputs== | ||
| Line 22: | Line 22: | ||
==See also== | ==See also== | ||
| − | [[ | + | [[ttclass/hdot.m]], [[cheap_norm.m]], [[krondelta.m]], [[tikhonov.m]], [[acomm.m]], [[arnoldi.m]], [[atranspose.m]], [[aux_mat.m]], [[binpack.m]], [[cheb_coeff.m]], [[clean_up.m]], [[dirdiff.m]], [[eigenfields.m]], [[expdrop.m]], [[expmint.m]], [[expmint2.m]], [[fftdiff.m]], [[fourdif.m]], [[fourlap.m]], [[frob_chop.m]], [[gaussfun.m]], [[herm_spline.m]], [[jacobianest.m]], [[keep_rank.m]], [[kronm_new.m]], [[logfactorial.m]], [[lorentzcon.m]], [[lorentzfun.m]], [[md5_hash.m]], [[mprealloc.m]], [[remncomm.m]], [[remtrace.m]], [[rspert.m]], [[rspt_eig.m]], [[snormpdf.m]], [[svd_shrink.m]], [[tikhoind.m]], [[trapdiff.m]], [[unit_oper.m]], [[unit_state.m]], [[vvpert.m]], [[Kernel_utilities]] |
''Version 2.11, authors: [[Ilya Kuprov]]'' | ''Version 2.11, authors: [[Ilya Kuprov]]'' | ||
Latest revision as of 06:48, 30 August 2026
Hadamard route to Frobenius matrix product. This function computes the Frobenius inner product of two numerical arrays using elementwise multiplication.
Syntax
H=hdot(A,B)
Parameters
A,B - square matrices of the same size
Outputs
H - Frobenius inner product of A and B
Notes
For matrices, the function is a faster replacement for `trace(A'*B)` because
trace(A'*B)=sum(conj(A).*B,'all')
and the elementwise route only needs O(n2) multiplications for square n-by-n matrices, compared to O(n3) for matrix multiplication followed by the trace.
See also
ttclass/hdot.m, cheap_norm.m, krondelta.m, tikhonov.m, acomm.m, arnoldi.m, atranspose.m, aux_mat.m, binpack.m, cheb_coeff.m, clean_up.m, dirdiff.m, eigenfields.m, expdrop.m, expmint.m, expmint2.m, fftdiff.m, fourdif.m, fourlap.m, frob_chop.m, gaussfun.m, herm_spline.m, jacobianest.m, keep_rank.m, kronm_new.m, logfactorial.m, lorentzcon.m, lorentzfun.m, md5_hash.m, mprealloc.m, remncomm.m, remtrace.m, rspert.m, rspt_eig.m, snormpdf.m, svd_shrink.m, tikhoind.m, trapdiff.m, unit_oper.m, unit_state.m, vvpert.m, Kernel_utilities
Version 2.11, authors: Ilya Kuprov