runPosIC, initializeGlobally

This commit is contained in:
Aik-Siong Koh
2023-05-27 21:43:09 -06:00
parent 6a577c052c
commit 9ddbdca742
139 changed files with 2401 additions and 431 deletions

View File

@@ -7,14 +7,16 @@ namespace MbD {
class SparseVector : public std::map<int, T>
{
public:
int n;
SparseVector() {}
SparseVector(int n) : std::map<int, T>(), n(n) {}
SparseVector(std::initializer_list<std::pair<const int, T>> list) : std::map<int, T>{ list } {}
SparseVector(std::initializer_list<std::initializer_list<T>> list) {
for (auto pair : list) {
for (auto& pair : list) {
int i = 0;
int index;
T value;
for (auto element : pair) {
for (auto& element : pair) {
if (i == 0) index = (int)std::round(element); ;
if (i == 1) value = element;
i++;