Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ class SOFA_COMPONENT_LINEARSYSTEM_API ConstantSparsityPatternSystem : public Mat
void resizeSystem(sofa::Size n) override;
void clearSystem() override;

using ConstantCRSMapping = std::unordered_map<sofa::SignedIndex, std::size_t>;
using ConstantCRSMapping = std::unordered_map<std::int64_t, std::size_t>;

bool isConstantSparsityPatternUsedYet() const;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ void ConstantSparsityPatternSystem<TMatrix, TVector>::replaceLocalMatrixMapped(c
mat->compressedInsertionOrderList.reserve(insertionOrderList.size());
for (const auto& [row, col] : insertionOrderList)
{
mat->compressedInsertionOrderList.push_back(mapping.at(row + col * sharedMatrix->rows()));
mat->compressedInsertionOrderList.push_back(mapping.at(static_cast<std::int64_t>(row) + static_cast<std::int64_t>(col) * sharedMatrix->rows()));
}
}
else
Expand Down Expand Up @@ -209,7 +209,7 @@ void ConstantSparsityPatternSystem<TMatrix, TVector>::replaceLocalMatrixNonMappe
// row and col are in global coordinates but the local coordinates will be checked
pairInsertionOrderList.push_back({row - posInGlobalMatrix[0], col - posInGlobalMatrix[1]});

const auto flatIndex = row + col * this->getSystemMatrix()->rows();
const auto flatIndex = static_cast<std::int64_t>(row) + static_cast<std::int64_t>(col) * this->getSystemMatrix()->rows();
const auto it = m_constantCRSMapping->find(flatIndex);
if (it != m_constantCRSMapping->end())
{
Expand Down Expand Up @@ -327,7 +327,7 @@ void ConstantSparsityPatternSystem<TMatrix, TVector>::buildHashTable(linearalgeb
for(auto xj = rowRange.begin() ; xj < rowRange.end() ; ++xj ) // for each non-null block
{
const auto col = M.colsIndex[xj];
mapping.emplace(row + col * M.rows(), xj);
mapping.emplace(static_cast<std::int64_t>(row) + static_cast<std::int64_t>(col) * M.rows(), xj);
}
}
}
Expand Down
Loading