main
Brett 2024-01-26 12:45:30 -05:00
parent 521bef7ea9
commit 99c802552e
3 changed files with 81 additions and 1 deletions

24
include/shifting.h Normal file
View File

@ -0,0 +1,24 @@
/*
* <Short Description>
* Copyright (C) 2024 Brett Terpstra
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
#ifndef GP_IMAGE_TEST_SHIFTING_H
#define GP_IMAGE_TEST_SHIFTING_H
void calculate_ordering();
#endif //GP_IMAGE_TEST_SHIFTING_H

@ -1 +1 @@
Subproject commit 709db718275718e09b3c68bde3faa6d7c9701af8 Subproject commit 129f6e3fb9d6524e9fd6ece47f9bf4ea6f0a1a83

56
src/shifting.cpp Normal file
View File

@ -0,0 +1,56 @@
/*
* <Short Description>
* Copyright (C) 2024 Brett Terpstra
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
#include <shifting.h>
#include <blt/math/vectors.h>
#include <vector>
#include <blt/std/hashmap.h>
inline constexpr char from_char(char c)
{
return c - 'a';
}
struct vertex
{
char name;
HASHSET<char> neighbours;
vertex(char name, const HASHSET<char>& n): name(from_char(name))
{
for (const auto& v : n)
neighbours.insert(from_char(v));
}
};
std::vector<vertex> edges = {
vertex{'a', {'i', 'e', 'b', 'j', 'h'}},
vertex{'b', {'a', 'e', 'c', 'j'}},
vertex{'c', {'e', 'd', 'f', 'j', 'b'}},
vertex{'d', {'e', 'f', 'c'}},
vertex{'e', {'h', 'f', 'd', 'c', 'b', 'a', 'i'}},
vertex{'f', {'d', 'e', 'h', 'g', 'j', 'c'}},
vertex{'g', {'j', 'f', 'h'}},
vertex{'h', {'j', 'g', 'f', 'e', 'i', 'a'}},
vertex{'i', {'e', 'a', 'h'}},
vertex{'j', {'a', 'b', 'c', 'f', 'g', 'h'}},
};
void calculate_ordering()
{
}