Sha256: c27f66a6a81490beaca2018e815548de84d51c708d799368651061b7949be670

Contents?: true

Size: 868 Bytes

Versions: 8

Compression:

Stored size: 868 Bytes

Contents

#include <stdexcept>
#ifndef __dense_data_set_example_h__
#define __dense_data_set_example_h__
#include "dense_data_set.h"
#include <iostream>

namespace DataSet {
  class DenseExample : public Example {
  public:
    double *values;
    
    DenseExample(int size) : Example(size) {
      values = (double *) calloc(size, sizeof(double));
    }
    
    ~DenseExample() {
      free(values);
    }
    
    double get_value(int index) {
      return values[index];
    }
    
    void set_value(int index, double new_value) {
      values[index] = new_value;
    }
    
    double euclidean_distance(Example *other_example) {
      return 0.0;
    }
    
    double cosine_distance(Example *other_example) {
      return 0.0;
    }
    
    void print() {
      for(int i = 0; i < size; i++)
        cout << values[i] << ",";
      cout << endl;
    }
  };
}

#endif

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
thera-0.0.8 lib/quarry/src/data_set/dense/dense_example.h
thera-0.0.7 lib/quarry/src/data_set/dense/dense_example.h
thera-0.0.6 lib/quarry/src/data_set/dense/dense_example.h
thera-0.0.5 lib/quarry/src/data_set/dense/dense_example.h
thera-0.0.4 lib/quarry/src/data_set/dense/dense_example.h
thera-0.0.3 lib/quarry/src/data_set/dense/dense_example.h
thera-0.0.2 lib/quarry/src/data_set/dense/dense_example.h
thera-0.0.1 lib/quarry/src/data_set/dense/dense_example.h