Difference between revisions of "Hdot.m"
m (Add missing Version/authors metadata and remove raw author emails) |
(sync with Spinach main f053e432: Parameters line updated to square matrices of the same size) |
||
| (3 intermediate revisions by the same user not shown) | |||
| Line 1: | Line 1: | ||
| − | + | {{DISPLAYTITLE:hdot.m}} __NOTOC__ | |
| + | 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(n<sup>2</sup>) multiplications for square n-by-n matrices, compared to O(n<sup>3</sup>) for matrix multiplication followed by the trace. | ||
==See also== | ==See also== | ||
| − | [[cheap_norm.m]], [[krondelta.m]], [[tikhonov.m]], [[Kernel_utilities | + | [[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