summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Albert <danalbert@google.com>2014-11-16 17:26:41 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2014-11-16 17:26:41 +0000
commit21053fad6555b9e0063e263c729aae9beeae7e2b (patch)
treeee9171d531d458d0473eca2712a2d6a6678260d5
parent4970c0dcfaf3aa0215a4e67e6e97afeabf3ace98 (diff)
parenta08525ea290ff4edc766eda1ec80388be866a79e (diff)
downloadml-21053fad6555b9e0063e263c729aae9beeae7e2b.tar.gz
Merge "Move frameworks/ml to libc++."android-wear-5.0.0_r1lollipop-wear-release
-rw-r--r--bordeaux/learning/Android.mk4
-rw-r--r--bordeaux/learning/multiclass_pa/Android.mk4
-rw-r--r--bordeaux/learning/multiclass_pa/native/multiclass_pa.cpp2
-rw-r--r--bordeaux/learning/stochastic_linear_ranker/Android.mk6
-rw-r--r--bordeaux/learning/stochastic_linear_ranker/jni/jni_stochastic_linear_ranker.cpp2
-rw-r--r--bordeaux/learning/stochastic_linear_ranker/native/sparse_weight_vector.cpp6
-rw-r--r--bordeaux/learning/stochastic_linear_ranker/native/sparse_weight_vector.h13
-rw-r--r--bordeaux/learning/stochastic_linear_ranker/native/stochastic_linear_ranker.cpp6
-rw-r--r--bordeaux/learning/stochastic_linear_ranker/native/stochastic_linear_ranker.h7
9 files changed, 20 insertions, 30 deletions
diff --git a/bordeaux/learning/Android.mk b/bordeaux/learning/Android.mk
index ae1098272..e2e3bae5f 100644
--- a/bordeaux/learning/Android.mk
+++ b/bordeaux/learning/Android.mk
@@ -27,12 +27,8 @@ LOCAL_SHARED_LIBRARIES := libcutils liblog
LOCAL_PRELINK_MODULE := false
-LOCAL_CFLAGS := -DANDROID
-
LOCAL_C_INCLUDES += $(LOCAL_PATH)/../native
-include external/stlport/libstlport.mk
-
include $(BUILD_SHARED_LIBRARY)
##
diff --git a/bordeaux/learning/multiclass_pa/Android.mk b/bordeaux/learning/multiclass_pa/Android.mk
index a925c995a..c9e57910d 100644
--- a/bordeaux/learning/multiclass_pa/Android.mk
+++ b/bordeaux/learning/multiclass_pa/Android.mk
@@ -29,10 +29,6 @@ LOCAL_SRC_FILES := native/multiclass_pa.cpp \
LOCAL_PRELINK_MODULE := false
-LOCAL_CFLAGS := -DANDROID
-
LOCAL_C_INCLUDES += $(LOCAL_PATH)/../native
-include external/stlport/libstlport.mk
-
include $(BUILD_STATIC_LIBRARY)
diff --git a/bordeaux/learning/multiclass_pa/native/multiclass_pa.cpp b/bordeaux/learning/multiclass_pa/native/multiclass_pa.cpp
index f6e8c7dc1..9ee12b035 100644
--- a/bordeaux/learning/multiclass_pa/native/multiclass_pa.cpp
+++ b/bordeaux/learning/multiclass_pa/native/multiclass_pa.cpp
@@ -21,6 +21,8 @@
#include "native/multiclass_pa.h"
+#include <stdlib.h>
+
using std::vector;
using std::pair;
diff --git a/bordeaux/learning/stochastic_linear_ranker/Android.mk b/bordeaux/learning/stochastic_linear_ranker/Android.mk
index 540141af8..55ab5a49d 100644
--- a/bordeaux/learning/stochastic_linear_ranker/Android.mk
+++ b/bordeaux/learning/stochastic_linear_ranker/Android.mk
@@ -30,12 +30,6 @@ LOCAL_SRC_FILES := native/stochastic_linear_ranker.cpp \
LOCAL_PRELINK_MODULE := false
-LOCAL_CFLAGS := -DANDROID
-
LOCAL_C_INCLUDES += $(LOCAL_PATH)/../native
-include external/stlport/libstlport.mk
-
-# include external/opencv/libopencv.mk
-
include $(BUILD_STATIC_LIBRARY)
diff --git a/bordeaux/learning/stochastic_linear_ranker/jni/jni_stochastic_linear_ranker.cpp b/bordeaux/learning/stochastic_linear_ranker/jni/jni_stochastic_linear_ranker.cpp
index f653eb907..f54b33e36 100644
--- a/bordeaux/learning/stochastic_linear_ranker/jni/jni_stochastic_linear_ranker.cpp
+++ b/bordeaux/learning/stochastic_linear_ranker/jni/jni_stochastic_linear_ranker.cpp
@@ -23,7 +23,7 @@
#include <string>
using std::string;
using std::vector;
-using std::hash_map;
+using std::unordered_map;
using learning_stochastic_linear::StochasticLinearRanker;
using learning_stochastic_linear::SparseWeightVector;
diff --git a/bordeaux/learning/stochastic_linear_ranker/native/sparse_weight_vector.cpp b/bordeaux/learning/stochastic_linear_ranker/native/sparse_weight_vector.cpp
index 54237845e..52ce11853 100644
--- a/bordeaux/learning/stochastic_linear_ranker/native/sparse_weight_vector.cpp
+++ b/bordeaux/learning/stochastic_linear_ranker/native/sparse_weight_vector.cpp
@@ -392,7 +392,7 @@ int32 SparseWeightVector<Key, Hash>::Reproject(const double norm,
return 0;
}
-template class SparseWeightVector<std::string, std::hash_map<std::string, double> >;
-template class SparseWeightVector<int, std::hash_map<int, double> >;
-template class SparseWeightVector<uint64, std::hash_map<uint64, double> >;
+template class SparseWeightVector<std::string, std::unordered_map<std::string, double> >;
+template class SparseWeightVector<int, std::unordered_map<int, double> >;
+template class SparseWeightVector<uint64, std::unordered_map<uint64, double> >;
} // namespace learning_stochastic_linear
diff --git a/bordeaux/learning/stochastic_linear_ranker/native/sparse_weight_vector.h b/bordeaux/learning/stochastic_linear_ranker/native/sparse_weight_vector.h
index 7bfd3b816..b5f1ff5af 100644
--- a/bordeaux/learning/stochastic_linear_ranker/native/sparse_weight_vector.h
+++ b/bordeaux/learning/stochastic_linear_ranker/native/sparse_weight_vector.h
@@ -22,17 +22,18 @@
#ifndef LEARNING_STOCHASTIC_LINEAR_SPARSE_WEIGHT_VECTOR_H_
#define LEARNING_STOCHASTIC_LINEAR_SPARSE_WEIGHT_VECTOR_H_
-#include <hash_map>
-#include <iosfwd>
#include <math.h>
+
+#include <iosfwd>
#include <sstream>
#include <string>
+#include <unordered_map>
#include "common_defs.h"
namespace learning_stochastic_linear {
-template<class Key = std::string, class Hash = std::hash_map<Key, double> >
+template<class Key = std::string, class Hash = std::unordered_map<Key, double> >
class SparseWeightVector {
public:
typedef Hash Wmap;
@@ -170,9 +171,9 @@ class SparseWeightVector {
Wmap wmax_;
// Normalizing constant in magnitude measurement.
double normalizer_;
- // This function in necessary since by default hash_map inserts an element
- // if it does not find the key through [] operator. It implements a lookup
- // without the space overhead of an add.
+ // This function is necessary since by default unordered_map inserts an
+ // element if it does not find the key through [] operator. It implements a
+ // lookup without the space overhead of an add.
bool GetValue(const Wmap &w1, const Key &fname, double *val) const {
Witer_const iter = w1.find(fname);
if (iter != w1.end()) {
diff --git a/bordeaux/learning/stochastic_linear_ranker/native/stochastic_linear_ranker.cpp b/bordeaux/learning/stochastic_linear_ranker/native/stochastic_linear_ranker.cpp
index 9e544b1cf..db702ad57 100644
--- a/bordeaux/learning/stochastic_linear_ranker/native/stochastic_linear_ranker.cpp
+++ b/bordeaux/learning/stochastic_linear_ranker/native/stochastic_linear_ranker.cpp
@@ -132,8 +132,8 @@ int StochasticLinearRanker<Key, Hash>::UpdateClassifier(
return 0;
}
-template class StochasticLinearRanker<std::string, std::hash_map<std::string, double> >;
-template class StochasticLinearRanker<int, std::hash_map<int, double> >;
-template class StochasticLinearRanker<uint64, std::hash_map<uint64, double> >;
+template class StochasticLinearRanker<std::string, std::unordered_map<std::string, double> >;
+template class StochasticLinearRanker<int, std::unordered_map<int, double> >;
+template class StochasticLinearRanker<uint64, std::unordered_map<uint64, double> >;
} // namespace learning_stochastic_linear
diff --git a/bordeaux/learning/stochastic_linear_ranker/native/stochastic_linear_ranker.h b/bordeaux/learning/stochastic_linear_ranker/native/stochastic_linear_ranker.h
index cfcc49b66..5419a5a30 100644
--- a/bordeaux/learning/stochastic_linear_ranker/native/stochastic_linear_ranker.h
+++ b/bordeaux/learning/stochastic_linear_ranker/native/stochastic_linear_ranker.h
@@ -22,11 +22,12 @@
#ifndef LEARNING_STOCHASTIC_LINEAR_STOCHASTIC_LINEAR_RANKER_H_
#define LEARNING_STOCHASTIC_LINEAR_STOCHASTIC_LINEAR_RANKER_H_
+#include <sys/types.h>
+
#include <cmath>
-#include <hash_map>
#include <string>
+#include <unordered_map>
-#include <sys/types.h>
#include "cutils/log.h"
#include "common_defs.h"
#include "learning_rate_controller-inl.h"
@@ -37,7 +38,7 @@ namespace learning_stochastic_linear {
// NOTE: This Stochastic Linear Ranker supports only the following update types:
// SL: Stochastic Linear
// CS: Constraint Satisfaction
-template<class Key = std::string, class Hash = std::hash_map<std::string, double> >
+template<class Key = std::string, class Hash = std::unordered_map<std::string, double> >
class StochasticLinearRanker {
public:
// initialize lambda_ and constraint to a meaningful default. Will give