View dijkstra.py
import heapq | |
from collections import defaultdict | |
class Graph: | |
def __init__(self, n): | |
self.nodes = set(range(n)) | |
self.edges = defaultdict(list) | |
self.distances = {} |
View graspit.patch
diff -rupN Graspit/graspit-lib-LINUX.pro GraspitNew/graspit-lib-LINUX.pro | |
--- Graspit/graspit-lib-LINUX.pro 2012-04-21 01:03:59.000000000 +0700 | |
+++ GraspitNew/graspit-lib-LINUX.pro 2014-09-04 12:06:38.646600227 +0700 | |
@@ -21,7 +21,7 @@ LIBS += -lqhull | |
LIBS += -lSoQt -lCoin | |
#add utility libraries | |
-LIBS += -lGL -lpthread | |
+LIBS += -lGL -lpthread -ldl | |
View conesIntersection.py
import ecos | |
import sys | |
import os | |
import numpy as np | |
from scipy.sparse import csc_matrix | |
_stdout = sys.stdout | |
def perpendicular_vector(v): |
View isPositiveSpan.cpp
#include<Qhull.h> | |
#include<QhullFacetList.h> | |
using namespace orgQhull; | |
bool isPositiveSpan(const Point3d &n1,const Point3d &n2,const Point3d &n3,const Point3d &n4){ | |
Qhull qhull; | |
realT points[12]={n1.x,n1.y,n1.z,n2.x,n2.y,n2.z,n3.x,n3.y,n3.z,n4.x,n4.y,n4.z}; | |
qhull.runQhull("",3,4,points,""); | |
vector<QhullFacet> facets=qhull.facetList().toStdVector(); | |
for(const QhullFacet &facet : qhull.facetList().toStdVector()) | |
if(facet.getFacetT()->offset>=0) return false; |
View grader.sh
#!/bin/bash | |
ext=sol | |
if [ "$#" -lt 1 ] | |
then | |
echo "Usage: $0 [executable] code [input_output_solution_folder]" | |
exit 1 | |
fi | |
if [ -x "`which "$1"`" ] |