From ab5f8ff5869021958f4ae8b838c3d707a2e85eaa Mon Sep 17 00:00:00 2001 From: Marc Jeanmougin Date: Sun, 29 Apr 2018 16:25:32 +0200 Subject: Put adaptagrams into its own folder --- src/libcola/tests/large_graph.cpp | 144 -------------------------------------- 1 file changed, 144 deletions(-) delete mode 100644 src/libcola/tests/large_graph.cpp (limited to 'src/libcola/tests/large_graph.cpp') diff --git a/src/libcola/tests/large_graph.cpp b/src/libcola/tests/large_graph.cpp deleted file mode 100644 index 712bd692c..000000000 --- a/src/libcola/tests/large_graph.cpp +++ /dev/null @@ -1,144 +0,0 @@ -/* - * vim: ts=4 sw=4 et tw=0 wm=0 - * - * libcola - A library providing force-directed network layout using the - * stress-majorization method subject to separation constraints. - * - * Copyright (C) 2006-2008 Monash University - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library 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 - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library in the file LICENSE; if not, - * write to the Free Software Foundation, Inc., 59 Temple Place, - * Suite 330, Boston, MA 02111-1307 USA - * -*/ - -// Loads a graph from a text file, generates constraints for each edge requiring them -// to point downwards, and proceeds to produce a layout using libcola. -// The input file format is 2 numeric node labels per line separated by a space, -// each pair representing a directed edge. Node labels are simply used as array -// offsets so they should start from 0. -// The graph should be connected. -// Default input file is the matrix market 1138_bus graph. -// Running times: -// no constraints - steepest descent solver: 149 seconds -// no constraints - mosek: 49.47 seconds -// no constraints - conjugate gradient solver: 12.2 seconds -// dir-edge constraints - mosek: 214.2 seconds -// -// V=1138 -#include -#include -#include -#include -#include -#include -#include "graphlayouttest.h" - -using namespace std; -using namespace cola; - -int countCrossings(vpsc::Rectangles& rs, vector& es) { - int crossings=0; - for(unsigned i=0;igetCentreX(),e1a->getCentreY()), - linesegment::Vector(e1b->getCentreX(),e1b->getCentreY())); - linesegment::LineSegment s2( - linesegment::Vector(e2a->getCentreX(),e2a->getCentreY()), - linesegment::Vector(e2b->getCentreX(),e2b->getCentreY())); - linesegment::Vector point; - if(s1.Intersect(s2,point)==linesegment::LineSegment::INTERSECTING) { - ++crossings; - } - } - } - return crossings; -} -int main() { - const char *fname="data/1138_bus.txt"; //"data/dg_850.txt"; - ifstream f(fname); - if(!f.is_open()) { - cout << "Error opening file: " << fname << endl; - exit(1); - } - string startlabel, endlabel; - unsigned V = 0; - double defaultEdgeLength=40; - vector es; - CompoundConstraints cx,cy; - while(!getline(f,startlabel,' ').eof()) { - getline(f,endlabel); - unsigned start = atoi(startlabel.c_str()), - end = atoi(endlabel.c_str()); - es.push_back(make_pair(start,end)); - cy.push_back( - new SeparationConstraint(end,start,defaultEdgeLength/3)); - V=max(V,max(start,end)); - } - V++; - /* - DFS::Graph dfs(V,es); - for(unsigned i=1;i rs; - for(unsigned i=0;i