Small improvements

This commit is contained in:
Tiago Gomes 2013-02-06 00:29:29 +00:00
parent 42a5bc493a
commit 80452bf75d

View File

@ -52,7 +52,7 @@ class TFactor
void absorveEvidence (const T& arg, unsigned obsIdx); void absorveEvidence (const T& arg, unsigned obsIdx);
void reorderArguments (const vector<T> new_args); void reorderArguments (const vector<T>& new_args);
bool contains (const T& arg) const; bool contains (const T& arg) const;
@ -79,7 +79,7 @@ template <typename T> inline void
TFactor<T>::randomize (void) TFactor<T>::randomize (void)
{ {
for (size_t i = 0; i < params_.size(); ++i) { for (size_t i = 0; i < params_.size(); ++i) {
params_[i] = (double) std::rand() / RAND_MAX; params_[i] = (double) std::rand() / RAND_MAX;
} }
} }
@ -225,7 +225,7 @@ TFactor<T>::absorveEvidence (const T& arg, unsigned obsIdx)
template <typename T> inline void template <typename T> inline void
TFactor<T>::reorderArguments (const vector<T> new_args) TFactor<T>::reorderArguments (const vector<T>& new_args)
{ {
assert (new_args.size() == args_.size()); assert (new_args.size() == args_.size());
if (new_args == args_) { if (new_args == args_) {