Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
[submodule "code/aesctr"]
path = aesctr
url = https://github.com/dnbaker/aesctr
[submodule "code/robin-hood-hashing"]
path = robin-hood-hashing
url = https://github.com/martinus/robin-hood-hashing/
[submodule "code/alias_sampler"]
path = alias_sampler
url = https://github.com/dnbaker/alias_sampler
Expand Down Expand Up @@ -43,3 +40,6 @@
[submodule "libkl"]
path = libkl
url = https://github.com/dnbaker/libkl
[submodule "unordered_dense"]
path = unordered_dense
url = https://github.com/martinus/unordered_dense
2 changes: 2 additions & 0 deletions include/minicore/clustering/centroid.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
#ifndef MINOCORE_CLUSTERING_CENTROID_H__
#define MINOCORE_CLUSTERING_CENTROID_H__
#include "minicore/util/macros.h"
#include "minicore/util/blaze_adaptor.h"
#include "minicore/util/csc.h"
#include "minicore/util/macros.h"
#include "minicore/dist.h"
#include "minicore/optim/kmedian.h"

Expand Down
1 change: 1 addition & 0 deletions include/minicore/clustering/mtx2cs.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#include "minicore/utility.h"
#include "minicore/optim.h"
#include "minicore/dist/distance.h"
#include "minicore/dist/applicator.h"

namespace minicore {

Expand Down
2 changes: 1 addition & 1 deletion include/minicore/optim/lsearch.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ struct ExhaustiveSearcher {
blaze::SmallArray<IType, N> bestsol_;
double current_cost_;
const unsigned k_;
ExhaustiveSearcher(const MatType &mat, unsigned k): mat_(mat), bestsol_(k_), current_cost_(std::numeric_limits<double>::max()), k_(k) {}
ExhaustiveSearcher(const MatType &mat, unsigned k): mat_(mat), bestsol_(k), current_cost_(std::numeric_limits<double>::max()), k_(k) {}
void run() {
blaze::SmallArray<IType, N> csol(k_);
const size_t nr = mat_.rows();
Expand Down
10 changes: 5 additions & 5 deletions include/minicore/util/shared.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#pragma once
#include "robin-hood-hashing/src/include/robin_hood.h"
#include "unordered_dense/include/ankerl/unordered_dense.h"
#include "thirdparty/kxsort.h"
#include "thirdparty/pdqsort.h"
#include "aesctr/wy.h"
Expand Down Expand Up @@ -29,12 +29,12 @@ template<typename T> class TD; // Debugging only


namespace shared {
template <typename Key, typename T, typename Hash = robin_hood::hash<Key>,
template <typename Key, typename T, typename Hash = ankerl::unordered_dense::hash<Key>,
typename KeyEqual = std::equal_to<Key>>
using flat_hash_map = robin_hood::unordered_flat_map<Key, T, Hash, KeyEqual, FGC_MAX_HASH_LOAD_FACTOR>;
using flat_hash_map = ankerl::unordered_dense::map<Key, T, Hash, KeyEqual>;

template<typename T, typename H = robin_hood::hash<T>, typename E = std::equal_to<T>>
using flat_hash_set = robin_hood::unordered_flat_set<T, H, E, FGC_MAX_HASH_LOAD_FACTOR>;
template<typename T, typename H = ankerl::unordered_dense::hash<T>, typename E = std::equal_to<T>>
using flat_hash_set = ankerl::unordered_dense::set<T, H, E>;

using ssize_t = std::ptrdiff_t;

Expand Down
1 change: 0 additions & 1 deletion robin-hood-hashing
Submodule robin-hood-hashing deleted from 1f1bfc
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ def main():
if not path.isfile("libsimdsampling/libsimdsampling.a"):
print("Making libss.a")
check_call(f"make libsimdsampling/libsimdsampling.a", shell=True)
if not path.isfile("libgomp.a"):
check_call(f"ln -s `{environ.get('CXX', 'g++')} --print-file-name=libgomp.a`", shell=True, executable="/bin/bash")
# if not path.isfile("libgomp.a"):
check_call(f"ls libgomp.a || ln -s `{environ.get('CXX', 'g++')} --print-file-name=libgomp.a`", shell=True, executable="/bin/bash")

# from https://stackoverflow.com/questions/11013851/speeding-up-build-process-with-distutils
# parallelizes extension compilation
Expand Down
4 changes: 2 additions & 2 deletions src/kzclustexp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ void print_header(std::ofstream &ofs, char **argv, unsigned nsamples, unsigned k
}

void usage(const char *ex) {
std::fprintf(stderr, "usage: %s <opts> [input file or ../data/dolphins.graph]\n"
std::fprintf(stderr, "usage: %s <opts> [input file or paper2020/dolphins.graph]\n"
"-k\tset k [12]\n"
"-z\tset z [1.]\n"
"-c\tAppend coreset size. Default: {5, 10, 15, 20, 25, 50, 75, 100, 125, 250, 375, 500, 625, 1250, 1875, 2500, 3125, 3750} (if empty)\n"
Expand Down Expand Up @@ -455,7 +455,7 @@ int main(int argc, char **argv) {
if(output_prefix.empty())
output_prefix = std::to_string(seed);
output_prefix += '.' + std::to_string(k) + '.';
std::string input = argc == optind ? "../data/dolphins.graph": const_cast<const char *>(argv[optind]);
std::string input = argc == optind ? "paper2020/dolphins.graph": const_cast<const char *>(argv[optind]);
std::srand(seed);
std::fprintf(stderr, "Reading from file: %s\n", input.data());
std::vector<latlon_t> coordinates;
Expand Down
1 change: 0 additions & 1 deletion src/mtx2cs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ void usage() {
"-R: Use reverse multinomial KL divergence\n"
"-j: Use multinomial Jensen-Shannon divergence\n"
"-J: Use multinomial Jensen-Shannon metric (square root of JSD)\n"
"-P: Use probability squared L2 norm\n"
"-Q: Use probability L2 norm\n"
"-T: Use total variation distance\n"
"-i: Use Itakura-Saito distance\n"
Expand Down
2 changes: 1 addition & 1 deletion src/tests/clustertest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ int metamain(int argc, char **argv) {

std::cerr << "Parsed matrix of " << pointmat.rows() << " rows and "
<< pointmat.columns() << " columns, with k = " << k << " clusters\n";
auto jsdapp = make_probdiv_applicator(pointmat, blz::SQRL2);
auto jsdapp = make_probdiv_applicator(pointmat, minicore::distance::SQRL2);
std::cerr << "Made probdiv applicator\n";
auto clusterdata = clustering::perform_clustering<
is_hard ? clustering::HARD: clustering::SOFT, clustering::EXTRINSIC>(jsdapp, k);
Expand Down
1 change: 1 addition & 0 deletions unordered_dense
Submodule unordered_dense added at fd9054