0

この 2D ベクトル変数に要素を挿入しようとしていますが、この奇妙なベクトル型でそれを行う方法がわかりません

void CaesarCypher::caesarAttack(string inputFileName, string frequencyFileName, string       outputFileName, string phiFile)
{
    vector<pair<char, double>> cipherTable = charFreqGen(inputFileName, outputFileName, numberDisplayed);
    vector<pair<char, double>> frequencyTable = charFreqGen(frequencyFileName, outputFileName, 150);
    vector<pair<int, double>> phiTable;

    for (int i = 0; i <= 94; i++)
    {
        double phi = 0.0;
        for (const auto& p : cipherTable)
        {
             char key = (char) ((int) p.first - i);
             auto find_it = find(frequencyTable.begin(), frequencyTable.end(), [key](const pair<char, double>& x) { return x.first == key; });
             double value;
             if (find_it != frequencyTable.end())
             {
                 value = find_it->second;
             }
             phi += p.second * value;
             //Insert a new element into the phiTable with the int parameter being i and the double paramter being phi
        }
    }
}

挿入したい場所はコメントで指定します。i 値をペアの整数部分に、phi 値を double 部分に入れたい

4

2 に答える 2