Changeset 789 for trunk/yat/classifier


Ignore:
Timestamp:
Mar 10, 2007, 9:07:13 PM (14 years ago)
Author:
Jari Häkkinen
Message:

Addresses #193. vector now works as outlined here. Added some
functionality. Added a clone function that facilitates resizing of
vectors. clone is needed since assignement operator functionality is
changed.

Location:
trunk/yat/classifier
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/yat/classifier/IGP.cc

    r680 r789  
    4545   
    4646    // Calculate IGP for each class
    47     igp_=utility::vector(target_.nof_classes());
     47    igp_.clone(utility::vector(target_.nof_classes()));
    4848    for(u_int i=0; i<target_.size(); i++) {
    4949      u_int neighbor=i;
  • trunk/yat/classifier/NCC.cc

    r722 r789  
    110110                    utility::vector& prediction) const
    111111  {
    112     prediction=utility::vector(centroids_.columns());   
     112    prediction.clone(utility::vector(centroids_.columns()));
    113113
    114114    utility::vector value(input.size(),0);
  • trunk/yat/classifier/utility.cc

    r779 r789  
    3434  void convert(const DataLookup1D& lookup, utility::vector& vector)
    3535  {
    36     vector=utility::vector(lookup.size());
     36    vector.clone(utility::vector(lookup.size()));
    3737    for(u_int i=0; i<lookup.size(); i++)
    3838      vector(i)=lookup(i);
     
    4343  {
    4444   
    45     value=utility::vector(lookup.size());
    46     weight=utility::vector(lookup.size());
     45    value.clone(utility::vector(lookup.size()));
     46    weight.clone(utility::vector(lookup.size()));
    4747    for(u_int i=0; i<lookup.size(); i++){
    4848      value(i)=lookup.data(i);
Note: See TracChangeset for help on using the changeset viewer.