Changeset 553


Ignore:
Timestamp:
Mar 7, 2006, 2:53:57 PM (16 years ago)
Author:
Peter
Message:

added range check in KernelLookup? Constructor and clarified doc in EnsembleBuilder?

Location:
trunk/lib/classifier
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/classifier/EnsembleBuilder.h

    r531 r553  
    5656
    5757    ///
    58     /// Generate validation data for ensemble
     58    /// @brief Generate validation data for ensemble
     59    ///
     60    /// validate()[i][j] return averager for class @a i for sample @a j
    5961    ///
    6062    const std::vector<std::vector<statistics::Averager> >& validate(void);
  • trunk/lib/classifier/KernelLookup.cc

    r546 r553  
    2929    // Checking that each row index is less than kernel.rows()
    3030    assert(row.empty() ||
    31            *(std::max_element(row.begin(),row.end()))<kernel.rows());
     31           *(std::max_element(row.begin(),row.end()))<kernel_->rows());
    3232    // Checking that each column index is less than kernel.column()
    3333    assert(column.empty() ||
    34            *(std::max_element(column.begin(),column.end()))<kernel.columns());
     34           *(std::max_element(column.begin(),column.end()))<kernel_->columns());
    3535
    3636  }
     
    4848    : DataLookup2D(kernel), kernel_(kernel.kernel_)
    4949  {
     50    // Checking that no index is out of range
     51    assert(row_index_.empty() ||
     52           *(max_element(row_index_.begin(), row_index_.end()))<kernel_->rows());
     53    assert(column_index_.empty() ||
     54           *(max_element(column_index_.begin(), column_index_.end()))<
     55           kernel_->columns());
     56
    5057  }
    5158 
Note: See TracChangeset for help on using the changeset viewer.