我很难理解如何使用a和 ainner_product来组合。给定,例如,和,我想制作std::vector<float>std::vector<std::vector<float>><2,3><<4,5>,<6,7>>inner_product
2*<4,5> + 3*<6,7> = <8,10> + <18,21> = <26,31>.
假如
vector<float> foo;
和
vector<vector<float>> bar;
已初始化并且大小相同,我不知道UK1,UK2和UK3in
vector<float> ip =
inner_product(foo.begin(), foo.end(), bar.begin(), UK1, UK2, UK3);
应该。我怀疑UK1应该是一个用 svector填充的,与s 中的s0.0f大小相同。也许应该是vectorbarUK3
std::transform(UK4.begin(), UK4.end(), UK4.begin(),
std::bind1st(std::multiplies<float>(), UK5));
而且我想UK2应该以某种方式代表组件方面的vector<float>添加!
我什至不想考虑当向量中的向量bar被具有属性的类的对象替换时,这将变得多么复杂float......