Просмотр исходного кода

fix namespace / include issues

Alec Jacobson 2 лет назад
Родитель
Сommit
9350803420
3 измененных файлов с 8 добавлено и 5 удалено
  1. 3 2
      include/igl/exact_geodesic.cpp
  2. 2 2
      include/igl/ismember_rows.h
  3. 3 1
      include/igl/marching_tets.cpp

+ 3 - 2
include/igl/exact_geodesic.cpp

@@ -23,6 +23,7 @@
 #include <set>
 #include <vector>
 #include <memory>
+#include <cmath>
 namespace igl{
 namespace geodesic{
 
@@ -242,7 +243,7 @@ public:
 		double wanted = n*sizeof(T);
 		if(wanted > m_num_bytes)
 		{
-			unsigned new_size = (unsigned) ceil(wanted / (double)sizeof(double));
+			unsigned new_size = (unsigned) std::ceil(wanted / (double)sizeof(double));
 			m_buffer = std::shared_ptr<double>(new double[new_size]);
 			m_num_bytes = new_size*sizeof(double);
 		}
@@ -259,7 +260,7 @@ public:
 	template<class T>
 	unsigned capacity()
 	{
-		return (unsigned)floor((double)m_num_bytes/(double)sizeof(T));
+		return (unsigned)std::floor((double)m_num_bytes/(double)sizeof(T));
 	};
 
 private:

+ 2 - 2
include/igl/ismember_rows.h

@@ -5,8 +5,8 @@
 // This Source Code Form is subject to the terms of the Mozilla Public License 
 // v. 2.0. If a copy of the MPL was not distributed with this file, You can 
 // obtain one at http://mozilla.org/MPL/2.0/.
-#ifndef IGL_ISMEMBER_H
-#define IGL_ISMEMBER_H
+#ifndef IGL_ISMEMBER_ROWS_H
+#define IGL_ISMEMBER_ROWS_H
 #include "igl_inline.h"
 #include <Eigen/Core>
 namespace igl

+ 3 - 1
include/igl/marching_tets.cpp

@@ -13,6 +13,8 @@
 #include <utility>
 #include <cstdint>
 #include <iostream>
+#include <algorithm>
+#include <utility>
 
 template <typename DerivedTV,
           typename DerivedTT,
@@ -107,7 +109,7 @@ void igl::marching_tets(
       const int tv1_idx = TT(i, mt_edge_lookup[mt_cell_lookup[key][e]][0]);
       const int tv2_idx = TT(i, mt_edge_lookup[mt_cell_lookup[key][e]][1]);
       const int vertex_id = edge_table.size();
-      edge_table.push_back(make_pair(min(tv1_idx, tv2_idx), max(tv1_idx, tv2_idx)));
+      edge_table.push_back(make_pair(std::min(tv1_idx, tv2_idx), std::max(tv1_idx, tv2_idx)));
       v_ids[e] = vertex_id;
     }