Skip to content
This repository has been archived by the owner on Jan 30, 2023. It is now read-only.

Commit

Permalink
input of intersection in standard order
Browse files Browse the repository at this point in the history
  • Loading branch information
Jonathan Kliem committed Aug 24, 2020
1 parent 30cac80 commit fe880a4
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,18 +38,18 @@ inline int is_subset(uint64_t *A, uint64_t *B, size_t face_length){
return 1;
}

inline void intersection(uint64_t *A, uint64_t *B, uint64_t *C, \
inline void intersection(uint64_t *dest, uint64_t *A, uint64_t *B, \
size_t face_length){
/*
Set ``C = A & B``, i.e. C is the intersection of A and B.
``face_length`` is the length of A, B and C in terms of uint64_t.
Set ``dest = A & B``, i.e. dest is the intersection of A and B.
``face_length`` is the length of A, B and dest in terms of uint64_t.
*/
for (size_t i = 0; i < face_length; i++){
C[i] = A[i] & B[i];
dest[i] = A[i] & B[i];
}
}

inline size_t count_atoms(uint64_t* A, size_t face_length){
inline size_t count_atoms(const uint64_t* A, size_t face_length){
/*
Return the number of atoms/vertices in A.
This is the number of set bits in A.
Expand All @@ -67,7 +67,7 @@ inline size_t count_atoms(uint64_t* A, size_t face_length){
}

size_t get_next_level(\
uint64_t **faces, const size_t n_faces, uint64_t **maybe_newfaces, \
uint64_t **faces, size_t n_faces, uint64_t **maybe_newfaces, \
uint64_t **newfaces, uint64_t **visited_all, \
size_t n_visited_all, size_t face_length){
/*
Expand Down Expand Up @@ -110,7 +110,7 @@ size_t get_next_level(\

// Step 1:
for (size_t j = 0; j < n_faces - 1; j++){
intersection(faces[j], faces[n_faces - 1], maybe_newfaces[j], face_length);
intersection(maybe_newfaces[j], faces[j], faces[n_faces - 1], face_length);
is_not_newface[j] = 0;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,10 @@ from .base cimport CombinatorialPolyhedron
from .face_iterator cimport FaceIterator

cdef extern from "bit_vector_operations.cc":
cdef void intersection(uint64_t *A, uint64_t *B, uint64_t *C,
cdef void intersection(uint64_t *dest, uint64_t *A, uint64_t *B,
size_t face_length)
# Set ``C = A & B``, i.e. C is the intersection of A and B.
# ``face_length`` is the length of A, B and C in terms of uint64_t.
# Set ``dest = A & B``, i.e. dest is the intersection of A and B.
# ``face_length`` is the length of A, B and dest in terms of uint64_t.

cdef size_t bit_rep_to_coatom_rep(
uint64_t *face, uint64_t **coatoms, size_t n_coatoms,
Expand Down Expand Up @@ -624,8 +624,8 @@ cdef class PolyhedronFaceLattice:

# Get the intersection of ``dimension_one_face`` with the
# ``self.incidence_counter_two``-th coatom.
intersection(dimension_one_face, coatoms[self.incidence_counter_two],
self.incidence_face, self.face_length)
intersection(self.incidence_face, dimension_one_face,
coatoms[self.incidence_counter_two], self.face_length)

# Get the location of the intersection and
# check, wether it is correct.
Expand Down

0 comments on commit fe880a4

Please sign in to comment.