diff options
author | Chris Dyer <cdyer@cs.cmu.edu> | 2011-04-28 15:48:43 -0400 |
---|---|---|
committer | Chris Dyer <cdyer@cs.cmu.edu> | 2011-04-28 15:48:43 -0400 |
commit | 2738a4d902757d60108dccb2ddbb778251be63e3 (patch) | |
tree | e9e4abb02b0ecbd0be2289a3df821464e6159627 /utils/ts.cc | |
parent | 49e4ba3fc4166a29d4cded3cd66d0cca977cc8eb (diff) |
replace old sparse vector with much faster version, major speed improvements for cdec
Diffstat (limited to 'utils/ts.cc')
-rw-r--r-- | utils/ts.cc | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/utils/ts.cc b/utils/ts.cc index 563794c5..3694e076 100644 --- a/utils/ts.cc +++ b/utils/ts.cc @@ -40,6 +40,19 @@ void test_logv() { MPrint(x); x -= x; MPrint(x); + FastSparseVector<prob_t> y; + y = x; + for (int i = 1; i < 10; ++i) { + x.set_value(i, prob_t(i*1.3)); + y.set_value(i*2, prob_t(i*1.4)); + } + swap(x,y); + MPrint(y); + MPrint(x); + x = y; + y = y; + x = x; + MPrint(y); } int main() { |