Permalink
Browse files

Fixed all warnings other than variable length arrays (at least for th…

…e console)
  • Loading branch information...
xoltar committed Nov 23, 2016
1 parent 886d329 commit 584f3d1448f555f2d5699383d73a741a825eb4af
View
@@ -24,4 +24,4 @@ ui_dataselectdialog.h
ui_progressdialog.h
ui_visualizationwindow.h
build
cereal
cmake-build-*
View
@@ -41,7 +41,7 @@ std::unique_ptr<ComputationResult> Computation::compute_raw(ComputationInput& in
if (verbosity >= 2) {
debug() << "COMPUTING xi_0 AND xi_1 FOR HOMOLOGY DIMENSION " << params.dim << ":";
}
MultiBetti mb(input.bifiltration(), params.dim, verbosity);
MultiBetti mb(input.bifiltration(), params.dim);
Timer timer;
debug() << "Calling compute_fast";
mb.compute_fast(result->homology_dimensions, progress);
View
@@ -16,6 +16,9 @@
//TODO: Remove either this or InputData, since there's no need for both anymore now that RIVET_0 files aren't supported.
class ComputationInput {
protected:
InputData data;
public:
std::vector<exact> x_exact;
std::vector<exact> y_exact;
@@ -29,15 +32,13 @@ class ComputationInput {
ComputationInput(InputData data)
: data(data)
, x_label(data.x_label)
, y_label(data.y_label)
, x_exact(data.x_exact)
, y_exact(data.y_exact)
, x_label(data.x_label)
, y_label(data.y_label)
{
}
protected:
InputData data;
};
struct ComputationResult {
View
@@ -132,8 +132,8 @@ void print_dims(TemplatePointsMessage const& message, std::ostream& ostream)
auto data = message.homology_dimensions.data();
ostream << "Dimensions > 0:" << std::endl;
for (int row = 0; row < shape[0]; row++) {
for (int col = 0; col < shape[1]; col++) {
for (unsigned long row = 0; row < shape[0]; row++) {
for (unsigned long col = 0; col < shape[1]; col++) {
unsigned dim = data[row * shape[0] + col];
if (dim > 0) {
ostream << "(" << col << ", " << row << ", " << dim << ")" << std::endl;
View
@@ -13,21 +13,22 @@
#include <boost/graph/graph_traits.hpp>
#include <boost/graph/kruskal_min_spanning_tree.hpp>
using rivet::numeric::INFTY;
Arrangement::Arrangement()
: x_exact()
, y_exact()
, x_grades()
, y_grades()
, INFTY(std::numeric_limits<double>::infinity())
, verbosity(0)
, halfedges()
, vertices()
, halfedges()
, faces()
, all_anchors()
, topleft()
, topright()
, bottomleft()
, bottomright()
, verbosity(0)
, all_anchors()
, topleft()
, topright()
, bottomleft()
, bottomright()
{
}
@@ -39,11 +40,10 @@ Arrangement::Arrangement(std::vector<exact> xe,
, y_exact(ye)
, x_grades(rivet::numeric::to_doubles(xe))
, y_grades(rivet::numeric::to_doubles(ye))
, INFTY(std::numeric_limits<double>::infinity())
, verbosity(verbosity)
, vertices()
, halfedges()
, vertices()
, faces()
, verbosity(verbosity)
{
//create vertices
vertices.push_back(std::make_shared<Vertex>(0, INFTY)); //index 0
@@ -463,7 +463,7 @@ void Arrangement::print()
template <typename T>
long index_of(std::vector<T> const& vec, T const& t)
{
for (long i = 0; i < vec.size(); i++) {
for (size_t i = 0; i < vec.size(); i++) {
if (vec[i] == t)
return i;
}
View
@@ -76,8 +76,6 @@ class Arrangement {
std::vector<std::shared_ptr<Halfedge>> halfedges; //all halfedges in the arrangement
std::vector<std::shared_ptr<Face>> faces; //all faces in the arrangement
const double INFTY;
unsigned verbosity;
std::set<std::shared_ptr<Anchor>, PointerComparator<Anchor, Anchor_LeftComparator>> all_anchors; //set of Anchors that are represented in the arrangement, ordered by position of curve along left side of the arrangement, from bottom to top
@@ -18,6 +18,8 @@
#include <cutgraph.h>
#include <stack> //for find_subpath
using rivet::numeric::INFTY;
ArrangementBuilder::ArrangementBuilder(unsigned verbosity)
: verbosity(verbosity)
{
@@ -370,13 +372,13 @@ void ArrangementBuilder::build_interior(std::shared_ptr<Arrangement> arrangement
{
cur_x = cur_anchor->get_x();
double Y = arrangement->INFTY; //default, for lines with positive slope
double Y = INFTY; //default, for lines with positive slope
if (arrangement->x_grades[cur_x] < 0)
Y = -1 * Y; //for lines with negative slope
else if (arrangement->x_grades[cur_x] == 0)
Y = 0; //for horizontal lines
rightedge = arrangement->insert_vertex(rightedge, arrangement->INFTY, Y);
rightedge = arrangement->insert_vertex(rightedge, INFTY, Y);
} else //no new vertex required, but update previous entry for vertical-line queries
arrangement->vertical_line_query_list.pop_back();
@@ -654,7 +656,7 @@ void ArrangementBuilder::find_path(Arrangement& arrangement, std::vector<std::sh
// distance vector for sorting the adjacency list
std::vector<std::vector<unsigned>> distances(arrangement.faces.size(), std::vector<unsigned>(arrangement.faces.size(), -1));
for (int i = 0; i < distances.size(); ++i)
for (size_t i = 0; i < distances.size(); ++i)
distances.at(i).at(i) = 0;
//loop over all arrangement.faces
@@ -9,11 +9,11 @@
ArrangementMessage::ArrangementMessage(Arrangement const& arrangement)
: x_grades(arrangement.x_grades)
, y_grades(arrangement.y_grades)
, half_edges()
, vertices()
, anchors()
, faces()
, vertical_line_query_list()
, half_edges()
, vertices()
, anchors()
, faces()
{
//REALLY slow with all these VID, FID, etc. calls, but will do for now.
for (auto face : arrangement.faces) {
@@ -59,15 +59,15 @@ ArrangementMessage::ArrangementMessage(Arrangement const& arrangement)
ArrangementMessage::ArrangementMessage()
: x_grades()
, y_grades()
, topleft()
, topright()
, bottomleft()
, bottomright()
, vertical_line_query_list()
, half_edges()
, vertices()
, anchors()
, faces()
, topleft()
, topright()
, bottomleft()
, bottomright()
, anchors()
, faces()
{
}
@@ -98,7 +98,7 @@ boost::optional<ArrangementMessage::AnchorM> ArrangementMessage::find_least_uppe
//if we get here, then y_grades[best] is the greatest y-grade not greater than y_coord
//now find Anchor whose line intersects the left edge of the arrangement lowest, but not below y_grade[best]
unsigned int zero = 0; //disambiguate the following function call
AnchorM test{ zero, best };
AnchorM test{ zero, best, HalfedgeId::invalid(), 0, false, 0 };
auto it = std::lower_bound(anchors.begin(), anchors.end(), test, AnchorStructComparator());
if (it == anchors.end()) //not found
@@ -341,10 +341,10 @@ Arrangement ArrangementMessage::to_arrangement() const
for (auto vertex : vertices) {
arrangement.vertices.push_back(std::make_shared<::Vertex>(vertex.x, vertex.y));
}
for (auto face : faces) {
for (size_t i = 0; i < faces.size(); i++) {
arrangement.faces.push_back(std::make_shared<::Face>());
}
for (auto edge : half_edges) {
for (size_t i = 0; i < half_edges.size(); i++) {
arrangement.halfedges.push_back(std::make_shared<::Halfedge>());
}
std::vector<std::shared_ptr<::Anchor>> temp_anchors; //For indexing, since arrangement.all_anchors is a set
@@ -362,7 +362,7 @@ Arrangement ArrangementMessage::to_arrangement() const
assert(arrangement.all_anchors.size() == anchors.size());
auto it = arrangement.all_anchors.begin();
for (auto i = 0; i < anchors.size(); i++) {
for (size_t i = 0; i < anchors.size(); i++) {
std::clog << "Checking: ";
std::clog << anchors[i].x_coord << "-->" << temp_anchors[i]->get_x() << "-->" << (*it)->get_x() << " / ";
assert(anchors[i].x_coord == temp_anchors[i]->get_x());
@@ -375,12 +375,12 @@ Arrangement ArrangementMessage::to_arrangement() const
//Now populate all the pointers
for (auto i = 0; i < vertices.size(); i++) {
for (size_t i = 0; i < vertices.size(); i++) {
if (vertices[i].incident_edge != HalfedgeId::invalid()) {
arrangement.vertices[i]->set_incident_edge(arrangement.halfedges[static_cast<long>(vertices[i].incident_edge)]);
}
}
for (auto i = 0; i < faces.size(); i++) {
for (size_t i = 0; i < faces.size(); i++) {
auto mface = arrangement.faces[i];
auto face = faces[i];
//TODO: this doesn't seem right, why would a face not have a boundary?
@@ -389,7 +389,7 @@ Arrangement ArrangementMessage::to_arrangement() const
}
mface->set_barcode(face.dbc);
}
for (auto i = 0; i < half_edges.size(); i++) {
for (size_t i = 0; i < half_edges.size(); i++) {
::Halfedge& edge = *(arrangement.halfedges[i]);
ArrangementMessage::HalfedgeM ref = half_edges[i];
if (ref.face != FaceId::invalid())
@@ -412,14 +412,14 @@ Arrangement ArrangementMessage::to_arrangement() const
}
}
for (auto i = 0; i < vertical_line_query_list.size(); i++) {
for (size_t i = 0; i < vertical_line_query_list.size(); i++) {
arrangement.vertical_line_query_list.push_back(arrangement.halfedges[static_cast<long>(vertical_line_query_list[i])]);
}
assert(arrangement.all_anchors.size() == anchors.size());
it = arrangement.all_anchors.begin();
for (auto i = 0; i < anchors.size(); i++) {
for (size_t i = 0; i < anchors.size(); i++) {
::Anchor& anchor = **it;
ArrangementMessage::AnchorM ref = anchors[i];
if (ref.dual_line != HalfedgeId::invalid()) {
@@ -446,7 +446,7 @@ Arrangement ArrangementMessage::to_arrangement() const
arrangement.y_grades = y_grades;
it = arrangement.all_anchors.begin();
for (auto i = 0; i < anchors.size(); i++) {
for (size_t i = 0; i < anchors.size(); i++) {
std::clog << "Checking: ";
assert(anchors[i].x_coord == temp_anchors[i]->get_x());
assert(anchors[i].x_coord == (*it)->get_x());
View
@@ -20,7 +20,7 @@ class ArrangementMessage {
ArrangementMessage();
template <class Archive>
void serialize(Archive& ar, const unsigned int& version)
void serialize(Archive& ar, const unsigned int /*version*/)
{
ar& x_grades& y_grades& half_edges& vertices& anchors& faces& topleft& topright& bottomleft& bottomright& vertical_line_query_list;
}
@@ -64,7 +64,7 @@ class ArrangementMessage {
unsigned long weight; //estimate of the cost of updating the RU-decomposition when crossing this anchor
template <typename Archive>
void serialize(Archive& ar, const unsigned int& version)
void serialize(Archive& ar, const unsigned int /*version*/)
{
ar& x_coord& y_coord& dual_line& position& above_line& weight;
}
@@ -85,7 +85,7 @@ class ArrangementMessage {
AnchorId anchor; //stores the coordinates of the anchor corresponding to this halfedge
template <typename Archive>
void serialize(Archive& ar, const unsigned int& version)
void serialize(Archive& ar, const unsigned int /*version*/)
{
ar& origin& twin& next& prev& face& anchor;
}
@@ -98,7 +98,7 @@ class ArrangementMessage {
BarcodeTemplate dbc; //barcode template stored in this cell
template <typename Archive>
void serialize(Archive& ar, const unsigned int& version)
void serialize(Archive& ar, const unsigned int /*version*/)
{
ar& boundary& dbc;
}
@@ -112,7 +112,7 @@ class ArrangementMessage {
double y; //y-coordinate of this vertex
template <typename Archive>
void serialize(Archive& ar, const unsigned int& version)
void serialize(Archive& ar, const unsigned int /*version*/)
{
ar& incident_edge& x& y;
}
View
@@ -21,7 +21,7 @@ struct BarTemplate {
bool operator<(const BarTemplate other) const;
template <class Archive>
void serialize(Archive& ar, const unsigned int version)
void serialize(Archive& ar, const unsigned int /*version*/)
{
ar& begin& end& multiplicity;
}
@@ -51,7 +51,7 @@ class BarcodeTemplate {
void print(); //for testing only
template <class Archive>
void serialize(Archive& ar, const unsigned int version)
void serialize(Archive& ar, const unsigned int /*version*/)
{
ar& bars;
}
View
@@ -126,7 +126,7 @@ struct TemplatePointsMessage {
friend bool operator==(TemplatePointsMessage const& left, TemplatePointsMessage const& right);
template <class Archive>
void serialize(Archive& ar, const unsigned int version)
void serialize(Archive& ar, const unsigned int /*version*/)
{
ar& x_label& y_label& template_points& homology_dimensions& x_exact& y_exact;
}
Oops, something went wrong.

0 comments on commit 584f3d1

Please sign in to comment.