diff options
| author | Dennis Brentjes <d.brentjes@gmail.com> | 2016-11-18 13:01:34 +0100 |
|---|---|---|
| committer | Dennis Brentjes <d.brentjes@gmail.com> | 2016-11-18 13:01:34 +0100 |
| commit | 39fa834e6f88ca68015eb5f91915ba681a7ce7ed (patch) | |
| tree | 27bae91b6d7d21b36fa97f125c0d2b96071b8719 /node/node_node.cpp | |
| parent | 127b6d6d55456eb49104d380157a63ef1d1ac546 (diff) | |
| download | cmix-39fa834e6f88ca68015eb5f91915ba681a7ce7ed.tar.gz cmix-39fa834e6f88ca68015eb5f91915ba681a7ce7ed.tar.bz2 cmix-39fa834e6f88ca68015eb5f91915ba681a7ce7ed.zip | |
Made permutation a responsibility of cmix in the realtime phase.
Diffstat (limited to 'node/node_node.cpp')
| -rw-r--r-- | node/node_node.cpp | 28 |
1 files changed, 13 insertions, 15 deletions
diff --git a/node/node_node.cpp b/node/node_node.cpp index 1742035..8faa4cf 100644 --- a/node/node_node.cpp +++ b/node/node_node.cpp @@ -160,25 +160,23 @@ cmix_proto::RealMix fill_realtime_mix_message(CMixContext& ctx, T const& ms) { cmix_proto::RealMix realmix; size_t len = get_group_element_array_size(&ctx); - - for(int i = 0; i < ms.size(); ++i) { - realmix.add_m(); - } - + std::vector<char*> mv(ms.size(), nullptr); + std::vector<char const*> msv(ms.size(), nullptr); for(int i = 0; i < ms.size(); ++i) { - auto new_pos = ctx.permutation[i]; - - realmix.mutable_m(new_pos)->resize(len); - - multiply_s( - &ctx, - &(*realmix.mutable_m(new_pos))[0], - ms.Get(i).data(), - i - ); + std::string* m = realmix.add_m(); + m->resize(len); + mv[i] = &(*m)[0]; + msv[i] = ms.Get(i).data(); } + permute_and_multiply_s( + &ctx, + mv.data(), + msv.data(), + ms.size() + ); + return realmix; } |
