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:
authorU-NORTHAMERICA\jcl <jcl@JCL.northamerica.corp.microsoft.com>2013-10-30 21:15:09 +0400
committerU-NORTHAMERICA\jcl <jcl@JCL.northamerica.corp.microsoft.com>2013-10-30 21:15:09 +0400
commit53a0a7e5a757761ae9b0780c1a0c2cb648a08faf (patch)
tree4ce28f5120c81f060fccb978dc63aaa8e689e470 /vowpalwabbit/vw.h
parent91d8aacd4989ba8948c6f0fd38a21ab060d1f1d0 (diff)
updated for windows compile and library interface
Diffstat (limited to 'vowpalwabbit/vw.h')
-rw-r--r--vowpalwabbit/vw.h7
1 files changed, 5 insertions, 2 deletions
diff --git a/vowpalwabbit/vw.h b/vowpalwabbit/vw.h
index 7d09bd12..9696d2a4 100644
--- a/vowpalwabbit/vw.h
+++ b/vowpalwabbit/vw.h
@@ -92,8 +92,11 @@ namespace VW {
return (uint32_t)(all.p->hasher(ss,u) & all.parse_mask);
}
- inline float get_weight(vw& all, uint32_t index)
- { return all.reg.weight_vector[(index * all.reg.stride) & all.reg.weight_mask];}
+ 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];}
+
+ 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;}
inline uint32_t num_weights(vw& all)
{ return (uint32_t)all.length();}