Changeset 51
Legend:
 Unmodified
 Added
 Removed

trunk/src/Kernel.cc
r42 r51 11 11 12 12 Kernel::Kernel(const gslapi::matrix& data, const KernelFunction& kf) 13 : k_(data. columns(),data.columns())13 : k_(data.rows(),data.rows()) 14 14 { 15 for(u_int i=0;i<data. columns();i++)15 for(u_int i=0;i<data.rows();i++) 16 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));17 k_(i,j)=kf(data[i],data[j]); 18 18 19 19 // Copy lower triangle to upper triangle of Kernel matrix 20 for(u_int i=0;i<data. columns()1;i++)21 for(u_int j=i+1;j<data. columns();j++)20 for(u_int i=0;i<data.rows()1;i++) 21 for(u_int j=i+1;j<data.rows();j++) 22 22 k_(i,j)=k_(j,i); 23 23 } 
trunk/src/Kernel.h
r42 r51 11 11 class KernelFunction; 12 12 13 /** 14 Class calculating the kernel matrix from the data matrix using 15 KernelFunction. The kernel matrix is quadratic and has the same number of 16 columns as the data matrix. 17 */ 13 /// 14 /// Class calculating the \f$NxN\f$ kernel matrix from the \f$MxN\f$ 15 /// data matrix using KernelFunction. Each row in the data matrix 16 /// corresponds to one sample. 17 /// 18 /// 18 19 class Kernel 19 20 { 20 21 21 22 public: 22 / **23 Constructor taking the data matrix and KernelFunction as input.24 */23 /// 24 /// Constructor taking the data matrix and KernelFunction as input. 25 /// 25 26 Kernel(const gslapi::matrix&, const KernelFunction&); 26 / **27 Destructor28 */27 /// 28 /// Destructor 29 /// 29 30 virtual ~Kernel(void); 30 / **31 @return Kernel matrix32 */31 /// 32 /// @return Kernel matrix 33 /// 33 34 const gslapi::matrix& get() const {return k_;} 34 35
Note: See TracChangeset
for help on using the changeset viewer.