Skip to content

OrTools: new module for integration of OR-Tools - Google Optimization…#270

Draft
petersteneteg wants to merge 1 commit intomasterfrom
feature/or-tools
Draft

OrTools: new module for integration of OR-Tools - Google Optimization…#270
petersteneteg wants to merge 1 commit intomasterfrom
feature/or-tools

Conversation

@petersteneteg
Copy link
Copy Markdown
Member

@github-actions
Copy link
Copy Markdown

Cpp-Linter Report ⚠️

Some files did not pass the configured checks!

clang-format (v19.1.1) reports: 2 file(s) not formatted
  • misc/ortools/src/ortoolsmodule.cpp
  • misc/ortools/tests/unittests/hungarian-tests.cpp
clang-tidy (v19.1.1) reports: 12 concern(s)
  • misc/ortools/include/inviwo/ortools/ortoolsmodule.h:31:10: error: [clang-diagnostic-error]

    'inviwo/ortools/ortoolsmoduledefine.h' file not found

       31 | #include <inviwo/ortools/ortoolsmoduledefine.h>
          |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  • misc/ortools/include/inviwo/ortools/ortoolsmodule.h:36:30: warning: [cppcoreguidelines-avoid-non-const-global-variables]

    variable 'ortoolsModule' is non-const and globally accessible, consider making it const

       36 | class IVW_MODULE_ORTOOLS_API ortoolsModule : public InviwoModule {
          |                              ^
  • misc/ortools/include/inviwo/ortools/processors/hungarian.h:32:10: error: [clang-diagnostic-error]

    'inviwo/ortools/ortoolsmoduledefine.h' file not found

       32 | #include <inviwo/ortools/ortoolsmoduledefine.h>
          |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  • misc/ortools/include/inviwo/ortools/processors/hungarian.h:40:30: warning: [cppcoreguidelines-avoid-non-const-global-variables]

    variable 'Hungarian' is non-const and globally accessible, consider making it const

       40 | class IVW_MODULE_ORTOOLS_API Hungarian : public Processor {
          |                              ^
  • misc/ortools/src/ortoolsmodule.cpp:30:10: error: [clang-diagnostic-error]

    'inviwo/ortools/ortoolsmodule.h' file not found

       30 | #include <inviwo/ortools/ortoolsmodule.h>
          |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  • misc/ortools/src/processors/hungarian.cpp:30:10: error: [clang-diagnostic-error]

    'inviwo/ortools/processors/hungarian.h' file not found

       30 | #include <inviwo/ortools/processors/hungarian.h>
          |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  • misc/ortools/tests/unittests/hungarian-tests.cpp:35:10: error: [clang-diagnostic-error]

    'ortools/algorithms/hungarian.h' file not found

       35 | #include <ortools/algorithms/hungarian.h>
          |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  • misc/ortools/tests/unittests/hungarian-tests.cpp:43:19: warning: [bugprone-easily-swappable-parameters]

    3 adjacent parameters of 'GenericCheck' of similar type are easily swapped by mistake

       43 | void GenericCheck(const int expected_assignment_size,
          |                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
       44 |                   const absl::flat_hash_map<int, int>& direct_assignment,
          |                   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
       45 |                   const absl::flat_hash_map<int, int>& reverse_assignment,
          |                   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    /home/runner/work/modules/modules/inviwo/misc/ortools/tests/unittests/hungarian-tests.cpp:43:29: note: the first parameter in the range is 'expected_assignment_size'
       43 | void GenericCheck(const int expected_assignment_size,
          |                             ^~~~~~~~~~~~~~~~~~~~~~~~
    /home/runner/work/modules/modules/inviwo/misc/ortools/tests/unittests/hungarian-tests.cpp:45:56: note: the last parameter in the range is 'reverse_assignment'
       45 |                   const absl::flat_hash_map<int, int>& reverse_assignment,
          |                                                        ^~~~~~~~~~~~~~~~~~
    /home/runner/work/modules/modules/inviwo/misc/ortools/tests/unittests/hungarian-tests.cpp:44:19: note: 'const int' and 'const int &' parameters accept and bind the same kind of values
       44 |                   const absl::flat_hash_map<int, int>& direct_assignment,
          |                   ^
  • misc/ortools/tests/unittests/hungarian-tests.cpp:59:6: warning: [cppcoreguidelines-avoid-non-const-global-variables]

    variable 'TestMinimization' is non-const and globally accessible, consider making it const

       59 | void TestMinimization(absl::Span<const std::vector<double>> cost,
          |      ^
  • misc/ortools/tests/unittests/hungarian-tests.cpp:71:6: warning: [cppcoreguidelines-avoid-non-const-global-variables]

    variable 'TestMaximization' is non-const and globally accessible, consider making it const

       71 | void TestMaximization(absl::Span<const std::vector<double>> cost,
          |      ^
  • misc/ortools/tests/unittests/hungarian-tests.cpp:88:11: warning: [cppcoreguidelines-avoid-c-arrays]

    do not declare C-style arrays, use std::array<> instead

       88 |     const double kCost[kMatrixHeight][kMatrixWidth] = {
          |           ^
  • misc/ortools/tests/unittests/ortools-unittest-main.cpp:44:5: warning: [google-build-using-namespace]

    do not use namespace using-directives; use using-declarations instead

       44 |     using namespace inviwo;
          |     ^

Have any feedback or feature suggestions? Share it here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant