Changeset 42 for trunk/src/Kernel.cc
 Timestamp:
 Feb 26, 2004, 4:06:20 PM (18 years ago)
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

trunk/src/Kernel.cc
r33 r42 1 1 // $Id$ 2 3 // System4 #include <math.h>5 6 2 7 3 // Thep C++ Tools … … 11 7 #include "vector.h" 12 8 13 using namespace thep_cpp_tools; 9 namespace theplu { 10 namespace cpptools { 14 11 15 Kernel::Kernel(const thep_gsl_api::matrix& data, const KernelFunction& kf) 12 Kernel::Kernel(const gslapi::matrix& data, const KernelFunction& kf) 13 : k_(data.columns(),data.columns()) 16 14 { 17 k_=thep_gsl_api::matrix(data.cols(),data.cols(),0); 18 for(u_int i=0;i<data.cols();i++) 19 for(u_int j=0;j<i+1;j++) { 20 double tmp = kf(data.col_vector(i),data.col_vector(j)); 21 k_.set(i,j,tmp); 22 } 15 for(u_int i=0;i<data.columns();i++) 16 for(u_int j=0;j<i+1;j++) 17 k_(i,j)=kf(data.TEMP_col_return(i),data.TEMP_col_return(j)); 23 18 24 19 // Copy lower triangle to upper triangle of Kernel matrix 25 for(u_int i=0;i<data.col s()1;i++)26 for(u_int j=i+1;j<data.col s();j++)27 k_ .set(i,j,k_.get(j,i));20 for(u_int i=0;i<data.columns()1;i++) 21 for(u_int j=i+1;j<data.columns();j++) 22 k_(i,j)=k_(j,i); 28 23 } 29 24 … … 32 27 } 33 28 34 35 29 }} // of namespace cpptools and namespace theplu
Note: See TracChangeset
for help on using the changeset viewer.