-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Take helper class for index-value pairs outside MatrixHandler sources.
- Loading branch information
Showing
5 changed files
with
47 additions
and
124 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
#pragma once | ||
|
||
|
||
namespace ReSolve { | ||
|
||
/// @brief Helper class for COO matrix sorting | ||
class IndexValuePair | ||
{ | ||
public: | ||
IndexValuePair() : idx_(0), value_(0.0) | ||
{} | ||
~IndexValuePair() | ||
{} | ||
void setIdx (index_type new_idx) | ||
{ | ||
idx_ = new_idx; | ||
} | ||
void setValue (real_type new_value) | ||
{ | ||
value_ = new_value; | ||
} | ||
|
||
index_type getIdx() | ||
{ | ||
return idx_; | ||
} | ||
real_type getValue() | ||
{ | ||
return value_; | ||
} | ||
|
||
bool operator < (const IndexValuePair& str) const | ||
{ | ||
return (idx_ < str.idx_); | ||
} | ||
|
||
private: | ||
index_type idx_; | ||
real_type value_; | ||
}; | ||
|
||
} // namespace ReSolve | ||
|