Пример #1
0
//--------------------------------------------------------------------------------------------------
/// 
//--------------------------------------------------------------------------------------------------
void RicfLoadCase::execute()
{
    bool ok = RiaImportEclipseCaseTools::openEclipseCasesFromFile(QStringList({m_path()}), nullptr, true);
    if (!ok)
    {
        RiaLogging::error(QString("loadCase: Unable to load case from %1").arg(m_path()));
    }
}
Пример #2
0
int minPathSum(vector<vector<int> > &grid) {
    int row = grid.size();
    if(row < 1)
        return 0;
    int col = grid[0].size();
    vector<int> m_path(col, 0);
    // initialize first row
    m_path[0] = grid[0][0];
    for (int i = 1; i < col; i++) {
        m_path[i] = grid[0][i] + m_path[i - 1];
    }
    // care about the first column
    for (int i = 1; i < row; i++) {
        for (int j = 0; j < col; j++) {
            if (j == 0) {
                m_path[j] += grid[i][0];
            }
            else {
                m_path[j] = min(m_path[j - 1], m_path[j]) + grid[i][j];
            }
        }
    }
    return m_path[col - 1];
}