Sha256: be696642ddc5a30e734fd1d09d61b202552a01864b5fe049225d693bd48af7ac

Contents?: true

Size: 1.2 KB

Versions: 4

Compression:

Stored size: 1.2 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;
  std::vector<dval> scratch;

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

 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 violate_constraints(param** test_case, const std::size_t length);
  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.7-java ext/dither/simple_constraint_handler.h
dither-0.2.7 ext/dither/simple_constraint_handler.h
dither-0.2.6 ext/dither/simple_constraint_handler.h
dither-0.2.6-java ext/dither/simple_constraint_handler.h