virtual void clickLeft(Point point,MouseKey mkey) { if( mkey&MouseKey_Shift ) { dots.reserve(1); dots_based.reserve(1); Insert(dots,selected,point); Insert(dots_based,selected,point-field.getBase()); if( dots.getLen()>1 ) selected++; win->redraw(); } else { select(point); } }
GT create_graph() { GT g; DynArray<typename GT::Node*> nodes; nodes.reserve(V); for (int i = 0; i < V; ++i) nodes(i) = g.insert_node(i); for (int i = 0; i < V - 1; ++i) { typename GT::Node * src = nodes(i); for (int j = i + 1; j < V; ++j) g.insert_arc(src, nodes(j), i + j); } return std::move(g); }