Changeset 51


Ignore:
Timestamp:
Mar 11, 2004, 2:06:36 PM (18 years ago)
Author:
Peter
Message:

format of data matrix is transposed

Location:
trunk/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/Kernel.cc

    r42 r51  
    1111
    1212Kernel::Kernel(const gslapi::matrix& data, const KernelFunction& kf)
    13   : k_(data.columns(),data.columns())
     13  : k_(data.rows(),data.rows())
    1414{
    15   for(u_int i=0;i<data.columns();i++)
     15  for(u_int i=0;i<data.rows();i++)
    1616    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]);
    1818 
    1919  // 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++)
    2222      k_(i,j)=k_(j,i);
    2323}
  • trunk/src/Kernel.h

    r42 r51  
    1111  class KernelFunction;
    1212
    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  ///
    1819  class Kernel
    1920  {
    2021   
    2122  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    ///
    2526    Kernel(const gslapi::matrix&, const KernelFunction&);
    26     /**
    27        Destructor
    28     */
     27    ///
     28    ///   Destructor
     29    ///
    2930    virtual ~Kernel(void);
    30     /**
    31        @return Kernel matrix
    32     */
     31    ///
     32    ///   @return Kernel matrix
     33    ///
    3334    const gslapi::matrix& get() const {return k_;}
    3435   
Note: See TracChangeset for help on using the changeset viewer.