Sha256: 8da8a3224990131762b3c7ed1ffb5f72387cb0cafd5144d53a926314bcf2c3bb

Contents?: true

Size: 1.14 KB

Versions: 8

Compression:

Stored size: 1.14 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 ground(dtest_case &test_case);
  };
}

#endif  // SIMPLE_CONSTRAINT_HANDLER_H_

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
dither-0.2.2-java ext/dither/simple_constraint_handler.h
dither-0.2.2 ext/dither/simple_constraint_handler.h
dither-0.2.1 ext/dither/simple_constraint_handler.h
dither-0.2.1-java ext/dither/simple_constraint_handler.h
dither-0.2.0-java ext/dither/simple_constraint_handler.h
dither-0.2.0 ext/dither/simple_constraint_handler.h
dither-0.2.0.rc5 ext/dither/simple_constraint_handler.h
dither-0.2.0.rc5-java ext/dither/simple_constraint_handler.h