From ad3331a45abbed4902ece2871f1afff4f93c9b80 Mon Sep 17 00:00:00 2001 From: Martin Rusek <martin.rusek@vsb.cz> Date: Tue, 31 Oct 2017 12:01:44 +0100 Subject: [PATCH] change: constant.h removed and replaced by cstruct.h: contains declaration of static struct --- SequenceComparison/constant.h | 94 ----------------------------------- SequenceComparison/cstruct.h | 26 ++++++++++ 2 files changed, 26 insertions(+), 94 deletions(-) delete mode 100644 SequenceComparison/constant.h create mode 100644 SequenceComparison/cstruct.h diff --git a/SequenceComparison/constant.h b/SequenceComparison/constant.h deleted file mode 100644 index 3e4927b..0000000 --- a/SequenceComparison/constant.h +++ /dev/null @@ -1,94 +0,0 @@ -#ifndef CONSTANT_H -#define CONSTANT_H - -#include "templates.h" -#include <map> - -namespace cstruct { - - const vtr2<bool> scaleChord{ - { 1,0,0,0,1,0,0,1,0,0,0,0 }, //12 major triad scale vectors - { 0,1,0,0,0,1,0,0,1,0,0,0 }, - { 0,0,1,0,0,0,1,0,0,1,0,0 }, - { 0,0,0,1,0,0,0,1,0,0,1,0 }, - { 0,0,0,0,1,0,0,0,1,0,0,1 }, - { 1,0,0,0,0,1,0,0,0,1,0,0 }, - { 0,1,0,0,0,0,1,0,0,0,1,0 }, - { 0,0,1,0,0,0,0,1,0,0,0,1 }, - { 1,0,0,1,0,0,0,0,1,0,0,0 }, - { 0,1,0,0,1,0,0,0,0,1,0,0 }, - { 0,0,1,0,0,1,0,0,0,0,1,0 }, - { 0,0,0,1,0,0,1,0,0,0,0,1 }, - - { 1,0,0,1,0,0,0,1,0,0,0,0 }, //12 minor triad scale vectors - { 0,1,0,0,1,0,0,0,1,0,0,0 }, - { 0,0,1,0,0,1,0,0,0,1,0,0 }, - { 0,0,0,1,0,0,1,0,0,0,1,0 }, - { 0,0,0,0,1,0,0,1,0,0,0,1 }, - { 1,0,0,0,0,1,0,0,1,0,0,0 }, - { 0,1,0,0,0,0,1,0,0,1,0,0 }, - { 0,0,1,0,0,0,0,1,0,0,1,0 }, - { 0,0,0,1,0,0,0,0,1,0,0,1 }, - { 1,0,0,0,1,0,0,0,0,1,0,0 }, - { 0,1,0,0,0,1,0,0,0,0,1,0 }, - { 0,0,1,0,0,0,1,0,0,0,0,1 }, - }; - - const vtr2<bool> scaleKey{ - { 1,0,1,0,1,1,0,1,0,1,0,1 }, //12 major triad scale vectors - { 1,1,0,1,0,1,1,0,1,0,1,0 }, - { 0,1,1,0,1,0,1,1,0,1,0,1 }, - { 1,0,1,1,0,1,0,1,1,0,1,0 }, - { 0,1,0,1,1,0,1,0,1,1,0,1 }, - { 1,0,1,0,1,1,0,1,0,1,1,0 }, - { 0,1,0,1,0,1,1,0,1,0,1,1 }, - { 1,0,1,0,1,0,1,1,0,1,0,1 }, - { 1,1,0,1,0,1,0,1,1,0,1,0 }, - { 0,1,1,0,1,0,1,0,1,1,0,1 }, - { 1,0,1,1,0,1,0,1,0,1,1,0 }, - { 0,1,0,1,1,0,1,0,1,0,1,1 }, - - { 1,0,1,1,0,1,0,1,1,0,1,0 }, //12 minor triad scale vectors - { 0,1,0,1,1,0,1,0,1,1,0,1 }, - { 1,0,1,0,1,1,0,1,0,1,1,0 }, - { 0,1,0,1,0,1,1,0,1,0,1,1 }, - { 1,0,1,0,1,0,1,1,0,1,0,1 }, - { 1,1,0,1,0,1,0,1,1,0,1,0 }, - { 0,1,1,0,1,0,1,0,1,1,0,1 }, - { 1,0,1,1,0,1,0,1,0,1,1,0 }, - { 0,1,0,1,1,0,1,0,1,0,1,1 }, - { 1,0,1,0,1,1,0,1,0,1,0,1 }, - { 1,1,0,1,0,1,1,0,1,0,1,0 }, - { 0,1,1,0,1,0,1,1,0,1,0,1 }, - }; - - const std::map<int, int> cofDistance = { - { 0,0 }, - { 1,5 }, - { 2,2 }, - { 3,3 }, - { 4,4 }, - { 5,1 }, - { 6,6 }, - { 7,1 }, - { 8,4 }, - { 9,3 }, - { 10,2 }, - { 11,5 }, - }; - - //const unordered_map< couple2<char>, int> shape = { - // { couple2<char>(0,0), 0 }, - // { couple2<char>(0,1), 1 }, - // { couple2<char>(0,2), 1 }, - // { couple2<char>(1,0), 1 }, - // { couple2<char>(1,1), 0 }, - // { couple2<char>(1,2), 1 }, - // { couple2<char>(2,0), 1 }, - // { couple2<char>(2,1), 0 }, - // { couple2<char>(2,2), 0 } - //}; - -} - -#endif //CONSTANT_H \ No newline at end of file diff --git a/SequenceComparison/cstruct.h b/SequenceComparison/cstruct.h new file mode 100644 index 0000000..5a96563 --- /dev/null +++ b/SequenceComparison/cstruct.h @@ -0,0 +1,26 @@ +#ifndef CSTRUCT_H +#define CSTRUCT_H + +#include "templates.h" +#include <map> + +///Contains constant structures +namespace cstruct +{ + ///Contains RGB colors (used in operation 5, switch: -op 5) + extern const float colorsBase; + + ///Contains hex codes for colors (used in html cluster matrix output, switch: -op [3,4] -html path); + extern const vtr<std::string> colorsMass; + + ///Contains chord scale (used in CSI chroma distance, switch: -d 3) + extern const vtr2<bool> scaleChord; + + ///Contains key scale (used in CSI chord distance, switch: -d 4) + extern const vtr2<bool> scaleKey; + + ///Contains circle of fifth distance (used in chord distance, switch: -d 4). + extern const std::map<int, int> cofDistance; +} + +#endif //CSTRUCT_H \ No newline at end of file -- GitLab