Skip to content

Commit

Permalink
Fix iterator to pointer issue in ublas_space.h (#12761)
Browse files Browse the repository at this point in the history
  • Loading branch information
rfaasse authored Oct 17, 2024
1 parent d18b2c4 commit 574bd67
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions kratos/spaces/ublas_space.h
Original file line number Diff line number Diff line change
Expand Up @@ -710,8 +710,8 @@ class UblasSpace
{
const std::size_t system_size = rA.size1();

const double* Avalues = rA.value_data().begin();
const std::size_t* Arow_indices = rA.index1_data().begin();
const auto& Avalues = rA.value_data();
const auto& Arow_indices = rA.index1_data();

// Define zero value tolerance
const double zero_tolerance = std::numeric_limits<double>::epsilon();
Expand Down Expand Up @@ -778,9 +778,9 @@ class UblasSpace
*/
static double GetDiagonalNorm(const MatrixType& rA)
{
const double* Avalues = rA.value_data().begin();
const std::size_t* Arow_indices = rA.index1_data().begin();
const std::size_t* Acol_indices = rA.index2_data().begin();
const auto& Avalues = rA.value_data();
const auto& Arow_indices = rA.index1_data();
const auto& Acol_indices = rA.index2_data();

const double diagonal_norm = IndexPartition<std::size_t>(Size1(rA)).for_each<SumReduction<double>>([&](std::size_t Index){
const std::size_t col_begin = Arow_indices[Index];
Expand Down Expand Up @@ -813,9 +813,9 @@ class UblasSpace
*/
static double GetMaxDiagonal(const MatrixType& rA)
{
const double* Avalues = rA.value_data().begin();
const std::size_t* Arow_indices = rA.index1_data().begin();
const std::size_t* Acol_indices = rA.index2_data().begin();
const auto& Avalues = rA.value_data();
const auto& Arow_indices = rA.index1_data();
const auto& Acol_indices = rA.index2_data();

return IndexPartition<std::size_t>(Size1(rA)).for_each<MaxReduction<double>>([&](std::size_t Index){
const std::size_t col_begin = Arow_indices[Index];
Expand All @@ -836,9 +836,9 @@ class UblasSpace
*/
static double GetMinDiagonal(const MatrixType& rA)
{
const double* Avalues = rA.value_data().begin();
const std::size_t* Arow_indices = rA.index1_data().begin();
const std::size_t* Acol_indices = rA.index2_data().begin();
const auto& Avalues = rA.value_data();
const auto& Arow_indices = rA.index1_data();
const auto& Acol_indices = rA.index2_data();

return IndexPartition<std::size_t>(Size1(rA)).for_each<MinReduction<double>>([&](std::size_t Index){
const std::size_t col_begin = Arow_indices[Index];
Expand Down

0 comments on commit 574bd67

Please sign in to comment.