Преглед изворни кода

cleaning up global using namespace and namespace in cpp

Former-commit-id: a5df03abe0a49012c2227843685370b0dba0691f
Alec Jacobson пре 11 година
родитељ
комит
ec849e97dc
2 измењених фајлова са 10 додато и 20 уклоњено
  1. 8 15
      include/igl/dot_row.cpp
  2. 2 5
      include/igl/dot_row.h

+ 8 - 15
include/igl/dot_row.cpp

@@ -7,23 +7,16 @@
 // obtain one at http://mozilla.org/MPL/2.0/.
 #include "igl/dot_row.h"
 
-using namespace Eigen;
-
-namespace igl
+template <typename DerivedA, typename DerivedB, typename Derv>
+IGL_INLINE Eigen::PlainObjectBase<DerivedV> igl::dot_row(
+  const Eigen::PlainObjectBase<DerivedV>& A,
+  const Eigen::PlainObjectBase<DerivedV>& B
+  )
 {
+  assert(A.rows() == B.rows());
+  assert(A.cols() == B.cols());
 
-  template <typename DerivedV>
-  IGL_INLINE Eigen::PlainObjectBase<DerivedV> dot_row(
-    const Eigen::PlainObjectBase<DerivedV>& A,
-    const Eigen::PlainObjectBase<DerivedV>& B
-    )
-  {
-    assert(A.rows() == B.rows());
-    assert(A.cols() == B.cols());
-
-    return (A.array() * B.array()).rowwise().sum();
-  }
-
+  return (A.array() * B.array()).rowwise().sum();
 }
 
 #ifndef IGL_HEADER_ONLY

+ 2 - 5
include/igl/dot_row.h

@@ -16,19 +16,16 @@ namespace igl
   // Compute the dot product between each row of A and B
   // Templates:
   //   DerivedV derived from vertex positions matrix type: i.e. MatrixXd
-  //   DerivedF derived from face indices matrix type: i.e. MatrixXi
   // Inputs:
   //   A  eigen matrix r by c
   //   B  eigen matrix r by c
-  // Outputs:
+  // Returns:
   //   d a column vector with r entries that contains the dot product of each corresponding row of A and B
   //
-  // See also: adjacency_matrix
   template <typename DerivedV>
   IGL_INLINE Eigen::PlainObjectBase<DerivedV> dot_row(
     const Eigen::PlainObjectBase<DerivedV>& A,
-    const Eigen::PlainObjectBase<DerivedV>& B
-    );
+    const Eigen::PlainObjectBase<DerivedV>& B);
 
 }