diff options
author | Jaron Kent-Dobias <jaron@kent-dobias.com> | 2020-11-01 17:09:15 +0100 |
---|---|---|
committer | Jaron Kent-Dobias <jaron@kent-dobias.com> | 2020-11-01 17:09:15 +0100 |
commit | 07a5acbdf79153bb505771708202a9a5fc6f98f0 (patch) | |
tree | 2559116a636b6ac1e63866a4d549834ab07c7a27 /hadamard_mcmc.hpp | |
parent | 9f49a50485a395caa57f0335b5af4e88f2fa2e16 (diff) | |
download | code-07a5acbdf79153bb505771708202a9a5fc6f98f0.tar.gz code-07a5acbdf79153bb505771708202a9a5fc6f98f0.tar.bz2 code-07a5acbdf79153bb505771708202a9a5fc6f98f0.zip |
Added correlation code.
Diffstat (limited to 'hadamard_mcmc.hpp')
-rw-r--r-- | hadamard_mcmc.hpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/hadamard_mcmc.hpp b/hadamard_mcmc.hpp index 107622a..634b822 100644 --- a/hadamard_mcmc.hpp +++ b/hadamard_mcmc.hpp @@ -68,6 +68,17 @@ public: } } } + + double operator*(const Orthogonal& o2) const { + const Orthogonal& o1 = *this; + double total = 0; + for (unsigned i = 0; i < this->size(); i++) { + for (unsigned j = 0; j < this->size(); j++) { + total += o1(i, j) * o2(i, j); + } + } + return total; + } }; class Givens { |