Sha256: 3d47058ef3fc1c72cf7fa2f59f1e8345160ba5762490241f7ec9eefc7f6f4d8b

Contents?: true

Size: 1.17 KB

Versions: 4

Compression:

Stored size: 1.17 KB

Contents

/*
 *
 * Copyright (C) 2015 Jason Gowan
 * All rights reserved.
 *
 * This software may be modified and distributed under the terms
 * of the BSD license.  See the LICENSE file for details.
 */

#ifndef SIMPLE_CONSTRAINT_HANDLER_H_
#define SIMPLE_CONSTRAINT_HANDLER_H_

#include <vector>
#include <utility>
#include <algorithm>
#include "dither_types.h"
#include "base_constraint_handler.h"

namespace dither {

  class SimpleConstraintHandler : public BaseConstraintHandler {
    protected:
      std::vector<std::vector<std::pair<std::size_t, dval>>> constraints;
      std::vector<dval> params;

      inline bool violate_constraint(const dtest_case& test_case, const std::vector<std::pair<std::size_t, dval>>& constraint);
      inline bool violate_constraint(const std::vector<param>& test_case, const std::vector<std::pair<std::size_t, dval>>& constraint);

    public:
      SimpleConstraintHandler(std::vector<dval>& ranges, std::vector<std::vector<dval>>& pconstraints);
      bool violate_constraints(const dtest_case &test_case);
      bool violate_constraints(const std::vector<param> &test_case);
      bool ground(dtest_case &test_case);
  };
}

#endif  // SIMPLE_CONSTRAINT_HANDLER_H_

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
dither-0.2.0.rc4-java ext/dither/simple_constraint_handler.h
dither-0.2.0.rc4 ext/dither/simple_constraint_handler.h
dither-0.2.0.rc3-java ext/dither/simple_constraint_handler.h
dither-0.2.0.rc3 ext/dither/simple_constraint_handler.h