Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/moses-smt/vowpal_wabbit.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Langford <jl@hunch.net>2013-11-22 01:08:34 +0400
committerJohn Langford <jl@hunch.net>2013-11-22 01:08:34 +0400
commit7366881824568aa3c39f5a242188b320e830ac48 (patch)
treea849897d4d0333b3cb1fd5f50d9d0f3374d8843e /vowpalwabbit/vw.h
parent27bdfac1eb7fed307b71e0cfc540a2180920d659 (diff)
bugfix from Weizhu Chen
Diffstat (limited to 'vowpalwabbit/vw.h')
-rw-r--r--vowpalwabbit/vw.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/vowpalwabbit/vw.h b/vowpalwabbit/vw.h
index 51b50321..56d1ae1d 100644
--- a/vowpalwabbit/vw.h
+++ b/vowpalwabbit/vw.h
@@ -93,10 +93,10 @@ namespace VW {
}
inline float get_weight(vw& all, uint32_t index, uint32_t offset)
- { return all.reg.weight_vector[((index * all.reg.stride) & all.reg.weight_mask) + offset];}
+ { return all.reg.weight_vector[((index * all.reg.stride + offset) & all.reg.weight_mask)];}
inline void set_weight(vw& all, uint32_t index, uint32_t offset, float value)
- { all.reg.weight_vector[((index * all.reg.stride) & all.reg.weight_mask) + offset] = value;}
+ { all.reg.weight_vector[((index * all.reg.stride + offset) & all.reg.weight_mask)] = value;}
inline uint32_t num_weights(vw& all)
{ return (uint32_t)all.length();}