Changeset 42 for trunk/src/Kernel.cc


Ignore:
Timestamp:
Feb 26, 2004, 4:06:20 PM (18 years ago)
Author:
Jari Häkkinen
Message:

Made a major revision of matrix and vector classes. Everything compiles
but the binaries have not been tested.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/Kernel.cc

    r33 r42  
    11// $Id$
    2 
    3 // System
    4 #include <math.h>
    5 
    62
    73// Thep C++ Tools
     
    117#include "vector.h"
    128
    13 using namespace thep_cpp_tools;
     9namespace theplu {
     10namespace cpptools { 
    1411
    15 Kernel::Kernel(const thep_gsl_api::matrix& data, const KernelFunction& kf)
     12Kernel::Kernel(const gslapi::matrix& data, const KernelFunction& kf)
     13  : k_(data.columns(),data.columns())
    1614{
    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));
    2318 
    2419  // Copy lower triangle to upper triangle of Kernel matrix
    25   for(u_int i=0;i<data.cols()-1;i++)
    26     for(u_int j=i+1;j<data.cols();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);
    2823}
    2924
     
    3227
    3328
    34 
    35 
     29}} // of namespace cpptools and namespace theplu
Note: See TracChangeset for help on using the changeset viewer.