Skip to content

Commit

Permalink
remove use of the matrix functions
Browse files Browse the repository at this point in the history
  • Loading branch information
payetvin committed Jan 27, 2025
1 parent 6909712 commit ee6c7eb
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 1 deletion.
18 changes: 18 additions & 0 deletions src/libs/antares/study/area/list.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -874,6 +874,24 @@ static bool AreaListLoadFromFolderSingleArea(Study& study,
{
buffer.clear() << "Misc Gen: `" << area.id << '`';
MatrixTestForPositiveValues_LimitWidth(buffer.c_str(), &area.miscGen, fhhPSP);
logs.debug() << "Checking : " << buffer;
const auto& m = area.miscGen;
if (m.width and m.height and fhhPSP)
{
for (uint x = 0; x < fhhPSP; ++x)
{
auto& column = m.entry[x];
for (uint y = 0; y < m.height; ++y)
{
if (column[y] < 0.)
{
logs.error() << buffer << ": negative value detected (at column " << x
<< ", row: " << y << ')';
ret = false;
}
}
}
}
}

// Links
Expand Down
18 changes: 17 additions & 1 deletion src/libs/antares/study/parts/thermal/cluster.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -428,7 +428,23 @@ bool Data::ThermalCluster::integrityCheck()
{
CString<ant_k_cluster_name_max_length + ant_k_area_name_max_length + 50, false> buffer;
buffer << "Thermal cluster: " << parentArea->name << '/' << pName << ": Modulation";
ret = MatrixTestForPositiveValues(buffer.c_str(), &modulation) && ret;

if (modulation.width and modulation.height)
{
for (int x = 0; x < modulation.width; ++x)
{
const Matrix<>::ColumnType& col = modulation.entry[x];
for (int y = 0; y < modulation.height; ++y)
{
if (col[y] < 0.)
{
logs.error() << buffer << ": Negative value detected (at the position " << x
<< ',' << y << ')';
ret = false;
}
}
}
}
}

// la valeur minStablePower should not be modified
Expand Down

0 comments on commit ee6c7eb

Please sign in to comment.