0.3.0
New Features
- Add
Symbol.id()
method to return the identity of the underlying
node. - Add bin packing generator.
- Add support for exponentiation of
ArraySymbol
for positive integer
exponents other than 2. - Implement
ArrayNode
andDecisionNode
C++ classes. These classes
are useful when creating nodes that require their predecessor(s) to
be both arrays and node. See #75. - Update C++ nodes that previously inherited from both
Array
and
Node
to inherit fromArrayNode
. - Update C++ nodes that previously inherited from both
Decision
and
Node
to inherit fromDecisionNode
. - Add
ArraySymbol.initialize_arraynode()
Cython method. - Update C++
Graph
to hold a vector ofDecisionNode*
for easy
access. This will increase the memory usage for graphs with many
decisions, but provide faster access. - Support binary operations between symbols representing a scalar and
other array symbols. - Add
SizeNode
C++ class.SizeNode
reports the size of its
predecessor. See #48. - Add
Size
Python class.Size
reports the size of its predecessor. See #48. - Add C++
Graph::objective()
method for accessing the current
objective. - Add
::operands()
method to C++BinaryOpNode
,NaryOpNode
,
ReduceNode
, andUnaryOpNode
. This method allows access to the
Array*
of the node's predecessors without a dynamic cast. - Add C++
LogicalNode
and PythonLogical
symbol.Logical
propagates the truth value(s) of its predecessor element-wise. - Add C++
NotNode
and PythonNot
symbol.Not
propagates the
inverse of the truth value(s) of its predecessor element-wise. - Add C++
void Graph::commit(State& state, std::vector<const Node*>&& changed) const
overload. - Add C++
void Graph::propagate(State& state, std::vector<const Node*>&& changed) const
overload. - Add C++
void Graph::revert(State& state, std::vector<const Node*>&& changed) const
overload. - Add predecessor shape test when initializing the state of C++
ArrayValidationNode
. - Add C++
WhereNode
. See #66. - Add Python
Where
symbol andwhere
function. See #66.
Upgrade Notes
-
Require and/or return
ArrayNode*
in many places that previously
required and/or returned anArray*
.The following
Graph
methods now require anArrayNode*
argument:
Graph.set_objective()
,Graph.add_constraint()
,
Graph.constraints()
,Graph.decisions()
.The following nodes now require a
ArrayNode*
as argument(s) to
their constructor:AdvancedIndexingNode
,ArrayValidationNode
,
BasicIndexingNode
,BinaryOpNode
,NaryOpNode
,
PermutationNode
,QuadraticModelNode
.ReduceNode
,
ReshapeNode
, andUnaryOpNode
.Python code is not affected.
-
Remove
ArraySymbol.initialize_array()
Cython method. Python code
is not affected. -
Require
ArrayNode*
as an argument to thesymbol_from_ptr()
Cython function.
Bug Fixes
- Fix
Array::min()
. Previously it incorrectly reported the smallest
number expressible by adouble
, rather than the lowest. See
#85. - Implement C++
UnaryOpNode::max()
,UnaryOpNode::min()
, and
UnaryOpNode::logical()
. ThereforeAbsoluteNode
,NegativeNode
,
andSquareNode
will now correctly propagate their minimum and
maximum value and will now correctly report if they represent
integer or boolean values.
Other Notes
- Switch to using Meson as the build
system. When installing from source withpip
orpypa/build
,
Meson will be used to install the package. Previouslysetuptools
andsetuptools_dso
were used.