Skip to content

Commit 0526844

Browse files
committed
Init commit, adding stiv implementation from SC19 paper.
0 parents  commit 0526844

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+27290
-0
lines changed

Diff for: Makefile

+49
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
2+
# Things for users to define
3+
#
4+
#include make.inc
5+
6+
7+
IAGM_LIB := libiagm.a
8+
9+
CXX := mpic++
10+
CXXFLAGS := -std=c++11 -Wall -Wextra -pipe -fPIC -O3 -fopenmp # -shared -no-inline-max-size -no-inline-max-total-size
11+
12+
EIGEN_INC := /opt/local/include/eigen3
13+
INCS := -Iinc -Isrc -I$(EIGEN_INC)
14+
15+
#LIB_DIR := -L/opt/intel/compilers_and_libraries_2018.2.164/mac/compiler/lib
16+
#LIBS := -lCGAL -lgmp -llapack -liomp5
17+
#LIBS := -lCGAL -lgmp -llapack #-lgomp
18+
19+
VPATH = ./src
20+
SRCS := $(wildcard ./src/*.cpp)
21+
22+
BUILD_DIR := build/
23+
OBJS := $(addprefix $(BUILD_DIR), $(addsuffix .o, $(basename $(notdir $(SRCS)))))
24+
25+
26+
all: $(IAGM_LIB)
27+
28+
$(IAGM_LIB): $(OBJS)
29+
mkdir -p lib
30+
/bin/rm -f lib/$(IAGM_LIB)
31+
ar ruv lib/$(IAGM_LIB) $(OBJS)
32+
#$(CXX) -dynamiclib -Wl,-install_name,./lib/$(IAGM_LIB) -o lib/$(IAGM_LIB) $(OBJS) $(LIBS) $(LIB_DIR)
33+
34+
$(BUILD_DIR)%.o: %.cpp
35+
$(shell mkdir -p $(BUILD_DIR))
36+
$(CXX) $(CXXFLAGS) $(INCS) -c -o $@ $<
37+
38+
depend:
39+
$(CXX) $(INCS) -MM $(SRCS) | sed 's/.*\.o/build\/&/' > .depend
40+
41+
ifeq (.depend, $(wildcard .depend))
42+
include .depend
43+
endif
44+
45+
clean:
46+
-rm -f lib/$(IAGM_LIB) $(BUILD_DIR)*.o .depend
47+
48+
rebuild: clean depend all
49+

Diff for: Makefile_mercer

+47
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
2+
# Things for users to define
3+
#
4+
#include make.inc
5+
6+
VES3D_PLATFORM ?= $(shell hostname -s || echo "generic-host" )
7+
$(warning $(VES3D_PLATFORM))
8+
9+
IAGM_LIB := libiagm.a
10+
11+
CXX := mpicxx
12+
CXXFLAGS := -fPIC -O3 -qopenmp -unroll-aggressive -ip -march=core-avx-i#-no-inline-max-size -no-inline-max-total-size
13+
14+
EIGEN_INC := /share/apps/eigen/3.3.1/include
15+
GMP_INC := /share/apps/gmp/6.1.2/gnu/include
16+
MPFR_INC := /share/apps/mpfr/3.1.5/gnu/include
17+
INCS := -Iinc -Isrc -I$(EIGEN_INC) -I$(CGAL_INC) -I$(BOOST_INC) -I$(GMP_INC) -I$(MPFR_INC)
18+
19+
VPATH = ./src
20+
SRCS := $(wildcard ./src/*.cpp)
21+
22+
BUILD_DIR := build/
23+
OBJS := $(addprefix $(BUILD_DIR), $(addsuffix .o, $(basename $(notdir $(SRCS)))))
24+
25+
26+
all: $(IAGM_LIB)
27+
28+
$(IAGM_LIB): $(OBJS)
29+
mkdir -p lib
30+
/bin/rm -f lib/$(IAGM_LIB)
31+
ar ruv lib/$(IAGM_LIB) $(OBJS)
32+
33+
$(BUILD_DIR)%.o: %.cpp
34+
$(shell mkdir -p $(BUILD_DIR))
35+
$(CXX) $(CXXFLAGS) $(INCS) -c -o $@ $<
36+
37+
depend:
38+
$(CXX) $(INCS) -MM $(SRCS) | sed 's/.*\.o/build\/&/' > .depend
39+
40+
ifeq (.depend, $(wildcard .depend))
41+
include .depend
42+
endif
43+
44+
clean:
45+
-rm -f lib/$(IAGM_LIB) $(BUILD_DIR)*.o .depend
46+
47+
rebuild: clean depend all

Diff for: inc/BV.h

+94
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
/*************************************************************************\
2+
3+
Copyright 1999 The University of North Carolina at Chapel Hill.
4+
All Rights Reserved.
5+
6+
Permission to use, copy, modify and distribute this software and its
7+
documentation for educational, research and non-profit purposes, without
8+
fee, and without a written agreement is hereby granted, provided that the
9+
above copyright notice and the following three paragraphs appear in all
10+
copies.
11+
12+
IN NO EVENT SHALL THE UNIVERSITY OF NORTH CAROLINA AT CHAPEL HILL BE
13+
LIABLE TO ANY PARTY FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR
14+
CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS, ARISING OUT OF THE
15+
USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF THE UNIVERSITY
16+
OF NORTH CAROLINA HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH
17+
DAMAGES.
18+
19+
THE UNIVERSITY OF NORTH CAROLINA SPECIFICALLY DISCLAIM ANY
20+
WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
21+
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE
22+
PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND THE UNIVERSITY OF
23+
NORTH CAROLINA HAS NO OBLIGATIONS TO PROVIDE MAINTENANCE, SUPPORT,
24+
UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
25+
26+
The authors may be contacted via:
27+
28+
US Mail: E. Larsen
29+
Department of Computer Science
30+
Sitterson Hall, CB #3175
31+
University of N. Carolina
32+
Chapel Hill, NC 27599-3175
33+
34+
Phone: (919)962-1749
35+
36+
37+
38+
39+
\**************************************************************************/
40+
41+
#ifndef PQP_BV_H
42+
#define PQP_BV_H
43+
44+
#include <math.h>
45+
#include "Tri.h"
46+
#include "PQP_Compile.h"
47+
48+
struct BV
49+
{
50+
PQP_REAL R[3][3]; // orientation of RSS & OBB
51+
52+
#if PQP_BV_TYPE & RSS_TYPE
53+
PQP_REAL Tr[3]; // position of rectangle
54+
PQP_REAL l[2]; // side lengths of rectangle
55+
PQP_REAL r; // radius of sphere summed with rectangle to form RSS
56+
#endif
57+
58+
#if PQP_BV_TYPE & OBB_TYPE
59+
PQP_REAL To[3]; // position of obb
60+
PQP_REAL d[3]; // (half) dimensions of obb
61+
#endif
62+
63+
int first_child; // positive value is index of first_child bv
64+
// negative value is -(index + 1) of triangle
65+
66+
BV();
67+
~BV();
68+
int Leaf() { return first_child < 0; }
69+
PQP_REAL GetSize();
70+
void FitToTris(PQP_REAL O[3][3], Tri *tris, int num_tris);
71+
};
72+
73+
inline
74+
PQP_REAL
75+
BV::GetSize()
76+
{
77+
#if PQP_BV_TYPE & RSS_TYPE
78+
return (sqrt(l[0]*l[0] + l[1]*l[1]) + 2*r);
79+
#else
80+
return (d[0]*d[0] + d[1]*d[1] + d[2]*d[2]);
81+
#endif
82+
}
83+
84+
int
85+
BV_Overlap(PQP_REAL R[3][3], PQP_REAL T[3], BV *b1, BV *b2);
86+
87+
#if PQP_BV_TYPE & RSS_TYPE
88+
PQP_REAL
89+
BV_Distance(PQP_REAL R[3][3], PQP_REAL T[3], BV *b1, BV *b2);
90+
#endif
91+
92+
#endif
93+
94+

0 commit comments

Comments
 (0)