Changeset 172
- Timestamp:
- Sep 28, 2004, 11:53:45 AM (19 years ago)
- Location:
- trunk
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/NNI.cc
r146 r172 15 15 NNI::NNI(gslapi::matrix& matrix,const gslapi::matrix& weight, 16 16 const u_int neighbours) 17 : data_(matrix), weight_(weight), neighbours_(neighbours) 17 : data_(matrix), imputed_data_(matrix), neighbours_(neighbours), 18 weight_(weight) 18 19 { 19 20 } -
trunk/src/NNI.h
r146 r172 29 29 virtual ~NNI(void) {}; 30 30 31 const gslapi::matrix& imputed_data(void) const { return imputed_data_; } 32 31 33 protected: 32 34 vector<pair<u_int,double> > calculate_distances(const u_int) const; … … 36 38 37 39 gslapi::matrix& data_; 40 gslapi::matrix imputed_data_; 41 u_int neighbours_; 38 42 const gslapi::matrix& weight_; 39 u_int neighbours_;40 43 }; 41 44 -
trunk/src/WeNNI.cc
r157 r172 42 42 // No impute if no contributions from neighbours. 43 43 if (norm) 44 data_(i,j)=weight_(i,j)*data_(i,j)+(1-weight_(i,j))*new_value/norm;44 imputed_data_(i,j)=weight_(i,j)*data_(i,j)+(1-weight_(i,j))*new_value/norm; 45 45 } 46 46 } -
trunk/src/kNNI.cc
r157 r172 49 49 // No impute if no contributions from neighbours. 50 50 if (norm) 51 data_(mv_rows_[i],j)=new_value/norm;51 imputed_data_(mv_rows_[i],j)=new_value/norm; 52 52 } 53 53 } -
trunk/test/data/wenni_result.data
r157 r172 8 8 0.2234 0.77639 0.38783 0.28953 0.62376 0.5445 0.32489 0.22388 0.238746 0.23468 0.1234 9 9 0.2388 0.234688 0.43687 0.86456 0.65654 0.6864 0.879645 0.98454 0.98731 0.164897 0.1234 10 0.1968 0.153987 0.13684 0.14685 0.316135 0.5286 0.69435 0.13634 0.18351 0.5774 987307520.123410 0.1968 0.153987 0.13684 0.14685 0.316135 0.5286 0.69435 0.13634 0.18351 0.577488912729 0.1234 11 11 0.6865 0.213687 0.12368 0.18564 0.897654 0.4945 0.789654 0.45547 0.98466 0.66136 0.1234 12 12 0.9835 0.963154 0.964664 0.132369 0.983316 0.3276 0.376513 0.34941 0.387433 0.31685 0.1234 -
trunk/test/test_nni.cc
r146 r172 43 43 std::ifstream control_stream(knni_result.c_str()); 44 44 theplu::gslapi::matrix control(control_stream); 45 control-= data;45 control-=knni.imputed_data(); 46 46 for (unsigned int i=0; i<control.rows(); i++) 47 47 for (unsigned int j=0; j<control.columns(); j++) … … 64 64 control_stream.open(wenni_result.c_str()); 65 65 control=theplu::gslapi::matrix(control_stream); 66 control-= data;66 control-=wenni.imputed_data(); 67 67 for (unsigned int i=0; i<control.rows(); i++) 68 68 for (unsigned int j=0; j<control.columns(); j++)
Note: See TracChangeset
for help on using the changeset viewer.