コード例 #1
0
ファイル: keycodeconverter.cpp プロジェクト: zk1132/Remoter
void KeyCodeConverter::initIntervals()
{
    initInterval(97, 122, VK_A); //65 == VK_A
    initInterval(65, 90, VK_A);
    //initInterval(48, 57, VK_NUMPAD0); //VK_0 == 48
    initInterval(48, 57, VK_0); //VK_0 == 48
}
コード例 #2
0
ファイル: BWTAlgorithms.cpp プロジェクト: Nanapeel/StriDe
// Find the interval in pBWT corresponding to w
// If w does not exist in the BWT, the interval
// coordinates [l, u] will be such that l > u
BWTInterval BWTAlgorithms::findInterval(const BWT* pBWT, const std::string& w)
{
    int len = w.size();
    int j = len - 1;
    char curr = w[j];
    BWTInterval interval;
    initInterval(interval, curr, pBWT);
    --j;

    for(;j >= 0; --j)
    {
        curr = w[j];
        updateInterval(interval, curr, pBWT);
        if(!interval.isValid())
            return interval;
    }
    return interval;
}