Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Remove free_long and free_double #671
Conversation
suma
reviewed
Feb 24, 2014
+ | ||
+template <typename T> | ||
+void sort_by(const std::vector<double>& scores, std::vector<T>& array) { | ||
+ assert(scores.size() == array.size()); |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
Show comment
Hide comment
suma
reviewed
Feb 24, 2014
@@ -50,6 +64,8 @@ void bicriteria_as_coreset( | ||
wplist bic, | ||
const size_t dstsize, | ||
wplist& dst) { | ||
+ assert(dstsize >= dst.size()); |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
Show comment
Hide comment
gintenlabo
reviewed
Feb 24, 2014
+namespace { | ||
+ | ||
+template <typename T, typename S> | ||
+struct sort_by_first { |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
Show comment
Hide comment
gintenlabo
Feb 24, 2014
Contributor
sort_by_first
appears inappropriate. How about compare_by_first
?
gintenlabo
Feb 24, 2014
Contributor
sort_by_first
appears inappropriate. How about compare_by_first
?
gintenlabo
reviewed
Feb 24, 2014
+ pairs[i].first = scores[i]; | ||
+ swap(pairs[i].second, array[i]); | ||
+ } | ||
+ std::sort(pairs.begin(), pairs.end(), sort_by_first<double, T>()); |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
Show comment
Hide comment
gintenlabo
Feb 24, 2014
Contributor
This template argument appears redundant.
How about modifying sort_by_first
's definition like this:
struct sort_by_first {
template<class T, class S>
bool operator() const (
const std::pair<T, S>& p1,
const std::pair<T, S>& p2) const {
return p1.first < p2.first;
}
};
and use sort_by_first()
?
gintenlabo
Feb 24, 2014
Contributor
This template argument appears redundant.
How about modifying sort_by_first
's definition like this:
struct sort_by_first {
template<class T, class S>
bool operator() const (
const std::pair<T, S>& p1,
const std::pair<T, S>& p2) const {
return p1.first < p2.first;
}
};
and use sort_by_first()
?
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
Show comment Hide comment
kmaehashi
Feb 24, 2014
Owner
In the meeting on 2014-02-24, reviewer was not decided.
I've temporarily set the milestone to Near Future as a reminder.
In the meeting on 2014-02-24, reviewer was not decided. |
kmaehashi
added this to the Near Future milestone
Feb 24, 2014
kmaehashi
added
core
labels
Feb 24, 2014
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
Show comment Hide comment
kmaehashi
Feb 24, 2014
Owner
Discussion from meeting on 2014-02-24:
- This pull-req is a improvement to eliminate variables used during calculation.
- We should note that these variables are currently serialized to the model file. We can pad with dummy variable to keep compatibility.
Discussion from meeting on 2014-02-24:
|
kmaehashi
added
the
_updated
label
Feb 25, 2014
unnonouno
added some commits
Mar 3, 2014
unnonouno
changed the title from
(WIP) Remove free_long and free_double
to
Remove free_long and free_double
Mar 24, 2014
related to #662 |
kmaehashi
self-assigned this
Apr 7, 2014
kmaehashi
modified the milestones:
0.5.4,
Near Future
Apr 7, 2014
added a commit
that referenced
this pull request
Apr 7, 2014
kmaehashi
merged commit f1fdcf0
into
develop
Apr 7, 2014
1 check passed
kmaehashi
deleted the
remove_free
branch
Apr 7, 2014
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
Show comment Hide comment
|
unnonouno commentedFeb 17, 2014
I removed
free_long
andfree_double
fromweighted_point
.Model file compatibility is broken.