[sdpb] 129/233: Removed util.h
Tobias Hansen
thansen at moszumanska.debian.org
Thu Mar 9 04:06:29 UTC 2017
This is an automated email from the git hooks/post-receive script.
thansen pushed a commit to branch master
in repository sdpb.
commit 34995cc44bd897ae812ec70f4924db10cfe2d5e7
Author: David Simmons-Duffin <dsd at minerva.sns.ias.edu>
Date: Sat Jan 10 03:49:14 2015 -0500
Removed util.h
---
src/Matrix.h | 2 --
src/Polynomial.h | 1 -
src/SDP.h | 1 -
src/Vector.h | 17 ++++++++++++++++-
src/util.h | 33 ---------------------------------
5 files changed, 16 insertions(+), 38 deletions(-)
diff --git a/src/Matrix.h b/src/Matrix.h
index fd1fe59..d53a21d 100644
--- a/src/Matrix.h
+++ b/src/Matrix.h
@@ -114,8 +114,6 @@ class Matrix {
friend ostream& operator<<(ostream& os, const Matrix& a);
};
-ostream& operator<<(ostream& os, const Matrix& a);
-
// C := alpha*A*B + beta*C
void matrixScaleMultiplyAdd(Real alpha, Matrix &A, Matrix &B,
Real beta, Matrix &C);
diff --git a/src/Polynomial.h b/src/Polynomial.h
index baf3e6e..b37a07f 100644
--- a/src/Polynomial.h
+++ b/src/Polynomial.h
@@ -10,7 +10,6 @@
#define SDPB_POLYNOMIAL_H_
#include "types.h"
-#include "util.h"
#include "Vector.h"
// A univariate polynomial
diff --git a/src/SDP.h b/src/SDP.h
index f3f900f..9aeec82 100644
--- a/src/SDP.h
+++ b/src/SDP.h
@@ -14,7 +14,6 @@
#include <iostream>
#include <ostream>
#include "types.h"
-#include "util.h"
#include "Vector.h"
#include "Matrix.h"
#include "Polynomial.h"
diff --git a/src/Vector.h b/src/Vector.h
index e6c39b6..ff5e662 100644
--- a/src/Vector.h
+++ b/src/Vector.h
@@ -11,14 +11,29 @@
#include <assert.h>
#include <algorithm>
+#include <iostream>
+#include <ostream>
#include <vector>
#include "types.h"
-#include "util.h"
+using std::ostream;
using std::vector;
typedef vector<Real> Vector;
+// print any vector<T>, including Vector
+template <class T>
+ostream& operator<<(ostream& os, const vector<T>& v) {
+ os << "{";
+ int last = v.size() - 1;
+ for (int i = 0; i < last; i++)
+ os << v[i] << ", ";
+ if (last >= 0)
+ os << v[last];
+ os << "}";
+ return os;
+}
+
inline bool compareAbs(const Real &a, const Real &b) {
return abs(a) < abs(b);
}
diff --git a/src/util.h b/src/util.h
deleted file mode 100644
index 0043faf..0000000
--- a/src/util.h
+++ /dev/null
@@ -1,33 +0,0 @@
-//=======================================================================
-// Copyright 2014-2015 David Simmons-Duffin.
-// Distributed under the MIT License.
-// (See accompanying file LICENSE or copy at
-// http://opensource.org/licenses/MIT)
-//=======================================================================
-
-
-#ifndef SDPB_UTIL_H_
-#define SDPB_UTIL_H_
-
-#include <algorithm>
-#include <iostream>
-#include <ostream>
-#include <vector>
-#include "types.h"
-
-using std::ostream;
-using std::vector;
-
-template <class T>
-ostream& operator<<(ostream& os, const vector<T>& v) {
- os << "{";
- int last = v.size() - 1;
- for (int i = 0; i < last; i++)
- os << v[i] << ", ";
- if (last >= 0)
- os << v[last];
- os << "}";
- return os;
-}
-
-#endif // SDPB_UTIL_H_
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/sdpb.git
More information about the debian-science-commits
mailing list