-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
95 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
lib/include/idol/mixed-integer/modeling/expressions/InternalLinExpr.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
// | ||
// Created by henri on 28.10.24. | ||
// | ||
|
||
#ifndef IDOL_INTERNALLINEXPR_H | ||
#define IDOL_INTERNALLINEXPR_H | ||
|
||
#include "idol/mixed-integer/modeling/expressions/LinExpr.h" | ||
|
||
namespace idol { | ||
class Model; | ||
|
||
template<class> | ||
class InternalLinExpr; | ||
} | ||
|
||
template<class Key> | ||
class idol::InternalLinExpr : public LinExpr<Key> { | ||
const Model* m_model; | ||
protected: | ||
unsigned int get_raw_index(const Key &t_index) const override { | ||
return t_index.index(*m_model); | ||
} | ||
public: | ||
InternalLinExpr() = default; | ||
InternalLinExpr(const Key& t_key) : LinExpr<Key>(t_key) {} // NOLINT(google-explicit-constructor) | ||
InternalLinExpr(double t_factor, const Key& t_key) : LinExpr<Key>(t_factor, t_key) {} | ||
|
||
InternalLinExpr(const Model* t_model) : m_model(t_model) {} | ||
InternalLinExpr(const Model* t_model, LinExpr<Key>&& t_other) : LinExpr<Key>(std::move(t_other)), m_model(t_model) {} | ||
InternalLinExpr(const Model* t_model, const LinExpr<Key>& t_other) : LinExpr<Key>(t_other), m_model(t_model) {} | ||
}; | ||
|
||
#endif //IDOL_INTERNALLINEXPR_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 4 additions & 0 deletions
4
lib/src/mixed-integer/modeling/expressions/InternalLinExpr.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
// | ||
// Created by henri on 28.10.24. | ||
// | ||
#include "idol/mixed-integer/modeling/expressions/InternalLinExpr.h" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.