Google OR-Tools v9.11
a fast and portable software suite for combinatorial optimization
Loading...
Searching...
No Matches
diffn_util.cc File Reference
#include "ortools/sat/diffn_util.h"
#include <stddef.h>
#include <algorithm>
#include <array>
#include <cmath>
#include <cstddef>
#include <cstdint>
#include <limits>
#include <optional>
#include <ostream>
#include <sstream>
#include <string>
#include <tuple>
#include <utility>
#include <vector>
#include "absl/container/flat_hash_set.h"
#include "absl/container/inlined_vector.h"
#include "absl/log/check.h"
#include "absl/random/bit_gen_ref.h"
#include "absl/types/span.h"
#include "ortools/base/logging.h"
#include "ortools/base/stl_util.h"
#include "ortools/sat/integer.h"
#include "ortools/sat/intervals.h"
#include "ortools/sat/util.h"
#include "ortools/util/integer_pq.h"
#include "ortools/util/strong_integers.h"

Go to the source code of this file.

Namespaces

namespace  operations_research
 In SWIG mode, we don't want anything besides these top-level includes.
 
namespace  operations_research::sat
 

Functions

std::vector< absl::Span< int > > operations_research::sat::GetOverlappingRectangleComponents (absl::Span< const Rectangle > rectangles, absl::Span< int > active_rectangles)
 
bool operations_research::sat::ReportEnergyConflict (Rectangle bounding_box, absl::Span< const int > boxes, SchedulingConstraintHelper *x, SchedulingConstraintHelper *y)
 
bool operations_research::sat::BoxesAreInEnergyConflict (const std::vector< Rectangle > &rectangles, const std::vector< IntegerValue > &energies, absl::Span< const int > boxes, Rectangle *conflict)
 
bool operations_research::sat::AnalyzeIntervals (bool transpose, absl::Span< const int > local_boxes, absl::Span< const Rectangle > rectangles, absl::Span< const IntegerValue > rectangle_energies, IntegerValue *x_threshold, IntegerValue *y_threshold, Rectangle *conflict)
 
absl::Span< int > operations_research::sat::FilterBoxesAndRandomize (absl::Span< const Rectangle > cached_rectangles, absl::Span< int > boxes, IntegerValue threshold_x, IntegerValue threshold_y, absl::BitGenRef random)
 
absl::Span< int > operations_research::sat::FilterBoxesThatAreTooLarge (absl::Span< const Rectangle > cached_rectangles, absl::Span< const IntegerValue > energies, absl::Span< int > boxes)
 
std::ostream & operations_research::sat::operator<< (std::ostream &out, const IndexedInterval &interval)
 
void operations_research::sat::ConstructOverlappingSets (bool already_sorted, std::vector< IndexedInterval > *intervals, std::vector< std::vector< int > > *result)
 
void operations_research::sat::GetOverlappingIntervalComponents (std::vector< IndexedInterval > *intervals, std::vector< std::vector< int > > *components)
 
std::vector< int > operations_research::sat::GetIntervalArticulationPoints (std::vector< IndexedInterval > *intervals)
 
void operations_research::sat::AppendPairwiseRestrictions (absl::Span< const ItemForPairwiseRestriction > items, std::vector< PairwiseRestriction > *result)
 
void operations_research::sat::AppendPairwiseRestrictions (absl::Span< const ItemForPairwiseRestriction > items, absl::Span< const ItemForPairwiseRestriction > other_items, std::vector< PairwiseRestriction > *result)
 
IntegerValue operations_research::sat::Smallest1DIntersection (IntegerValue range_min, IntegerValue range_max, IntegerValue size, IntegerValue interval_min, IntegerValue interval_max)
 
FindRectanglesResult operations_research::sat::FindRectanglesWithEnergyConflictMC (const std::vector< RectangleInRange > &intervals, absl::BitGenRef random, double temperature, double candidate_energy_usage_factor)
 
std::string operations_research::sat::RenderDot (std::optional< Rectangle > bb, absl::Span< const Rectangle > solution)
 
std::vector< Rectangle > operations_research::sat::FindEmptySpaces (const Rectangle &bounding_box, std::vector< Rectangle > ocupied_rectangles)
 

Variable Documentation

◆ adjacent_corner

Corner adjacent_corner

Definition at line 1034 of file diffn_util.cc.

◆ edge

Edge edge

Definition at line 1033 of file diffn_util.cc.

◆ kBottom

EdgeInfo kBottom
staticconstexpr
Initial value:
= {
.opposite_edge = Edge::TOP,
.shrink_direction = Direction::TOP_AND_BOTTOM,
.orthogonal_shrink_direction = Direction::LEFT_AND_RIGHT,
.orthogonal_edges = {
{.edge = Edge::LEFT, .adjacent_corner = Corner::BOTTOM_LEFT},
{.edge = Edge::RIGHT, .adjacent_corner = Corner::BOTTOM_RIGHT}}}

Definition at line 1063 of file diffn_util.cc.

◆ kLeft

EdgeInfo kLeft
staticconstexpr
Initial value:
= {
.opposite_edge = Edge::RIGHT,
.shrink_direction = Direction::LEFT_AND_RIGHT,
.orthogonal_shrink_direction = Direction::TOP_AND_BOTTOM,
.orthogonal_edges = {
{.edge = Edge::BOTTOM, .adjacent_corner = Corner::BOTTOM_LEFT},
{.edge = Edge::TOP, .adjacent_corner = Corner::TOP_LEFT}}}

Definition at line 1048 of file diffn_util.cc.

◆ kRight

EdgeInfo kRight
staticconstexpr
Initial value:
= {
.opposite_edge = Edge::LEFT,
.shrink_direction = Direction::LEFT_AND_RIGHT,
.orthogonal_shrink_direction = Direction::TOP_AND_BOTTOM,
.orthogonal_edges = {
{.edge = Edge::BOTTOM, .adjacent_corner = Corner::BOTTOM_RIGHT},
{.edge = Edge::TOP, .adjacent_corner = Corner::TOP_RIGHT}}}

Definition at line 1056 of file diffn_util.cc.

◆ kTop

EdgeInfo kTop
staticconstexpr
Initial value:
= {
.opposite_edge = Edge::BOTTOM,
.shrink_direction = Direction::TOP_AND_BOTTOM,
.orthogonal_shrink_direction = Direction::LEFT_AND_RIGHT,
.orthogonal_edges = {
{.edge = Edge::LEFT, .adjacent_corner = Corner::TOP_LEFT},
{.edge = Edge::RIGHT, .adjacent_corner = Corner::TOP_RIGHT}}}

Definition at line 1070 of file diffn_util.cc.

◆ opposite_edge

Edge opposite_edge

Definition at line 1030 of file diffn_util.cc.

◆ orthogonal_edges

OrthogonalInfo orthogonal_edges[2]

Lower coordinate one first (ie., BOTTOM before TOP, LEFT before RIGHT).

Definition at line 1040 of file diffn_util.cc.

◆ orthogonal_shrink_direction

Direction orthogonal_shrink_direction

Definition at line 1038 of file diffn_util.cc.

◆ shrink_direction

Direction shrink_direction

Definition at line 1037 of file diffn_util.cc.