/* * Project: MoleCuilder * Description: creates and alters molecular systems * Copyright (C) 2014 Frederik Heber. All rights reserved. * * * This file is part of MoleCuilder. * * MoleCuilder 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 2 of the License, or * (at your option) any later version. * * MoleCuilder 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 MoleCuilder. If not, see . */ /* * SphericalPointDistribution_getConnections.cpp * * Created on: Jul 12, 2014 * Author: heber */ // include config.h #ifdef HAVE_CONFIG_H #include #endif //#include "CodePatterns/MemDebug.hpp" #include "SphericalPointDistribution.hpp" #include "CodePatterns/Assert.hpp" #include using namespace std; using namespace boost::assign; typedef SphericalPointDistribution::IndexSet_t IndexSet_t; template <> SphericalPointDistribution::adjacency_t SphericalPointDistribution::getConnections<0>() { adjacency_t adjacency; ASSERT( adjacency.size() == 0, "SphericalPointDistribution::getConnections<0>() - adjacency has wrong size."); return adjacency; } template <> SphericalPointDistribution::adjacency_t SphericalPointDistribution::getConnections<1>() { adjacency_t adjacency; ASSERT( adjacency.size() == 0, "SphericalPointDistribution::getConnections<1>() - adjacency has wrong size."); return adjacency; } template <> SphericalPointDistribution::adjacency_t SphericalPointDistribution::getConnections<2>() { adjacency_t adjacency; adjacency += make_pair( 0, list_of(1) ); adjacency += make_pair( 1, list_of(0) ); ASSERT( adjacency.size() == 2, "SphericalPointDistribution::getConnections<2>() - adjacency has wrong size."); return adjacency; } template <> SphericalPointDistribution::adjacency_t SphericalPointDistribution::getConnections<3>() { adjacency_t adjacency; adjacency += make_pair( 0, list_of(1)(2) ); adjacency += make_pair( 1, list_of(0)(2) ); adjacency += make_pair( 2, list_of(0)(1) ); ASSERT( adjacency.size() == 3, "SphericalPointDistribution::getConnections<3>() - adjacency has wrong size."); return adjacency; } template <> SphericalPointDistribution::adjacency_t SphericalPointDistribution::getConnections<4>() { adjacency_t adjacency; adjacency += make_pair( 0, list_of(1)(2)(3) ); adjacency += make_pair( 1, list_of(0)(2)(3) ); adjacency += make_pair( 2, list_of(0)(1)(3) ); adjacency += make_pair( 3, list_of(0)(1)(2) ); ASSERT( adjacency.size() == 4, "SphericalPointDistribution::getConnections<4>() - adjacency has wrong size."); return adjacency; } template <> SphericalPointDistribution::adjacency_t SphericalPointDistribution::getConnections<5>() { adjacency_t adjacency; adjacency += make_pair( 0, list_of(2)(3)(4) ); adjacency += make_pair( 1, list_of(2)(3)(4) ); adjacency += make_pair( 2, list_of(0)(1)(3)(4) ); adjacency += make_pair( 3, list_of(0)(1)(2)(4) ); adjacency += make_pair( 4, list_of(0)(1)(2)(3) ); ASSERT( adjacency.size() == 5, "SphericalPointDistribution::getConnections<5>() - adjacency has wrong size."); return adjacency; } template <> SphericalPointDistribution::adjacency_t SphericalPointDistribution::getConnections<6>() { adjacency_t adjacency; adjacency += make_pair( 0, list_of(2)(3)(4)(5) ); adjacency += make_pair( 1, list_of(2)(3)(4)(5) ); adjacency += make_pair( 2, list_of(0)(1)(4)(5) ); adjacency += make_pair( 3, list_of(0)(1)(4)(5) ); adjacency += make_pair( 4, list_of(0)(1)(2)(3) ); adjacency += make_pair( 5, list_of(0)(1)(2)(3) ); ASSERT( adjacency.size() == 6, "SphericalPointDistribution::getConnections<6>() - adjacency has wrong size."); return adjacency; } template <> SphericalPointDistribution::adjacency_t SphericalPointDistribution::getConnections<7>() { adjacency_t adjacency; adjacency += make_pair( 0, list_of(2)(3)(4)(5)(6) ); adjacency += make_pair( 1, list_of(2)(3)(4)(5)(6) ); adjacency += make_pair( 2, list_of(0)(1)(3)(6) ); adjacency += make_pair( 3, list_of(0)(1)(2)(4) ); adjacency += make_pair( 4, list_of(0)(1)(3)(5) ); adjacency += make_pair( 5, list_of(0)(1)(4)(6) ); adjacency += make_pair( 6, list_of(0)(1)(2)(5) ); ASSERT( adjacency.size() == 7, "SphericalPointDistribution::getConnections<7>() - adjacency has wrong size."); return adjacency; } template <> SphericalPointDistribution::adjacency_t SphericalPointDistribution::getConnections<8>() { adjacency_t adjacency; adjacency += make_pair( 0, list_of(2)(3)(4)(5)(6)(7) ); adjacency += make_pair( 1, list_of(2)(3)(4)(5) ); adjacency += make_pair( 2, list_of(0)(1)(3)(4)(6)(7) ); adjacency += make_pair( 3, list_of(0)(1)(2)(5)(7) ); adjacency += make_pair( 4, list_of(0)(1)(2)(5)(6) ); adjacency += make_pair( 5, list_of(0)(1)(3)(4) ); adjacency += make_pair( 6, list_of(0)(2)(4) ); adjacency += make_pair( 7, list_of(0)(2)(3) ); ASSERT( adjacency.size() == 8, "SphericalPointDistribution::getConnections<8>() - adjacency has wrong size."); return adjacency; } template <> SphericalPointDistribution::adjacency_t SphericalPointDistribution::getConnections<9>() { adjacency_t adjacency; adjacency += make_pair( 0, list_of(1)(2)(3)(4) ); adjacency += make_pair( 1, list_of(0)(3)(4)(5)(6) ); adjacency += make_pair( 2, list_of(0)(3)(4)(7)(8) ); adjacency += make_pair( 3, list_of(0)(1)(2)(5)(8) ); adjacency += make_pair( 4, list_of(0)(1)(2)(6)(7) ); adjacency += make_pair( 5, list_of(1)(3)(6)(7)(8) ); adjacency += make_pair( 6, list_of(1)(4)(5)(7) ); adjacency += make_pair( 7, list_of(2)(4)(5)(6)(8) ); adjacency += make_pair( 8, list_of(2)(3)(5)(7) ); ASSERT( adjacency.size() == 9, "SphericalPointDistribution::getConnections<9>() - adjacency has wrong size."); return adjacency; } template <> SphericalPointDistribution::adjacency_t SphericalPointDistribution::getConnections<10>() { adjacency_t adjacency; adjacency += make_pair( 0, list_of(2)(3)(4)(5) ); adjacency += make_pair( 1, list_of(6)(7)(8)(9) ); adjacency += make_pair( 2, list_of(0)(4)(5)(6)(7) ); adjacency += make_pair( 3, list_of(0)(4)(5)(8)(9) ); adjacency += make_pair( 4, list_of(0)(2)(3)(6)(9) ); adjacency += make_pair( 5, list_of(0)(2)(3)(7)(8) ); adjacency += make_pair( 6, list_of(1)(2)(4)(7)(9) ); adjacency += make_pair( 7, list_of(1)(2)(5)(6)(8) ); adjacency += make_pair( 8, list_of(1)(3)(5)(7)(9) ); adjacency += make_pair( 9, list_of(1)(3)(4)(6)(8) ); ASSERT( adjacency.size() == 10, "SphericalPointDistribution::getConnections<10>() - adjacency has wrong size."); return adjacency; } template <> SphericalPointDistribution::adjacency_t SphericalPointDistribution::getConnections<11>() { adjacency_t adjacency; adjacency += make_pair( 0, list_of(1)(2)(3)(4)(5) ); adjacency += make_pair( 1, list_of(0)(2)(5)(6)(10) ); adjacency += make_pair( 2, list_of(0)(1)(3)(6)(7) ); adjacency += make_pair( 3, list_of(0)(2)(4)(7)(8) ); adjacency += make_pair( 4, list_of(0)(3)(5)(8)(9) ); adjacency += make_pair( 5, list_of(0)(1)(4)(9)(10) ); adjacency += make_pair( 6, list_of(1)(2)(7)(8)(9)(10) ); adjacency += make_pair( 7, list_of(2)(3)(6)(8) ); adjacency += make_pair( 8, list_of(3)(4)(6)(7)(9) ); adjacency += make_pair( 9, list_of(4)(5)(6)(8)(10) ); adjacency += make_pair( 10, list_of(1)(5)(6)(9) ); ASSERT( adjacency.size() == 11, "SphericalPointDistribution::getConnections<11>() - adjacency has wrong size."); return adjacency; } template <> SphericalPointDistribution::adjacency_t SphericalPointDistribution::getConnections<12>() { adjacency_t adjacency; adjacency += make_pair( 0, list_of(2)(3)(4)(5)(6) ); adjacency += make_pair( 1, list_of(7)(8)(9)(10)(11) ); adjacency += make_pair( 2, list_of(0)(3)(6)(9)(10) ); adjacency += make_pair( 3, list_of(0)(2)(4)(10)(11) ); adjacency += make_pair( 4, list_of(0)(3)(5)(7)(11) ); adjacency += make_pair( 5, list_of(0)(4)(6)(7)(8) ); adjacency += make_pair( 6, list_of(0)(2)(5)(8)(9) ); adjacency += make_pair( 7, list_of(1)(4)(5)(8)(11) ); adjacency += make_pair( 8, list_of(1)(5)(6)(7)(9) ); adjacency += make_pair( 9, list_of(1)(2)(6)(8)(10) ); adjacency += make_pair( 10, list_of(1)(2)(3)(9)(11) ); adjacency += make_pair( 11, list_of(1)(3)(4)(7)(10) ); ASSERT( adjacency.size() == 12, "SphericalPointDistribution::getConnections<12>() - adjacency has wrong size."); return adjacency; } template <> SphericalPointDistribution::adjacency_t SphericalPointDistribution::getConnections<14>() { adjacency_t adjacency; adjacency += make_pair( 0, list_of(2)(3)(4)(5)(6)(7) ); adjacency += make_pair( 1, list_of(8)(9)(10)(11)(12)(13) ); adjacency += make_pair( 2, list_of(0)(3)(7)(8)(13) ); adjacency += make_pair( 3, list_of(0)(2)(4)(8)(9) ); adjacency += make_pair( 4, list_of(0)(3)(5)(9)(10) ); adjacency += make_pair( 5, list_of(0)(4)(6)(10)(11) ); adjacency += make_pair( 6, list_of(0)(5)(7)(11)(12) ); adjacency += make_pair( 7, list_of(0)(2)(6)(12)(13) ); adjacency += make_pair( 8, list_of(1)(2)(3)(9)(13) ); adjacency += make_pair( 9, list_of(1)(3)(4)(8)(10) ); adjacency += make_pair( 10, list_of(1)(4)(5)(9)(11) ); adjacency += make_pair( 11, list_of(1)(5)(6)(10)(12) ); adjacency += make_pair( 12, list_of(1)(6)(7)(11)(13) ); adjacency += make_pair( 13, list_of(1)(2)(7)(8)(12) ); ASSERT( adjacency.size() == 14, "SphericalPointDistribution::getConnections<14>() - adjacency has wrong size."); return adjacency; }