Comments (4)
Yes it seems the slice is somehow not being type checked correctly.
As a workaround for now, this seems to work:
array[int] of int: bar = [
r[1] | i in index_set_1of2(foos), r=array1d(foos[i, ..])
];
from libminizinc.
This is fine
array[int] of int: bar = [ foos[i, ..][1] | i in index_set_1of2(foos) ];
but not what I want 😞
from libminizinc.
What I would really want is to be able to iterate over rows in a 2d array, like in other languages with comprehensions
[ r[1] | r in foos where r[2] == 0 ]
but just being able to assign r=ReallyLongTableNameTableThingy[i, ..]
would go along way
from libminizinc.
Apparently I can do
array[int] of int: bar = [ r[1] | i in 1..1, r=[1,2] ];
so I'm guessing this is a bug?
from libminizinc.
Related Issues (20)
- Quoted identifiers are missing quotes in output dzn
- Missing option '-f/--free-search' in flags of command line help
- Linearized model leads to UNSAT or unfeasible solutions given the bound HOT 1
- `Assertion `typeId() == 0 || dim() == d' failed.` HOT 2
- Poor diagnostic for missing int->enum conversion? HOT 2
- `EnumEntry` `in` `anotherEnum` is incorrect? HOT 2
- `arr[enum]` is wrong? HOT 2
- `void MiniZinc::Type::ot(const OptType&): Assertion 'o == OT_PRESENT || !structBT() || typeId() == 0' failed.` HOT 2
- Feature request: circumvent naming clashes when including models
- `./lib/flatten.cpp:2833: MiniZinc::KeepAlive MiniZinc::bind(EnvI&, Ctx, VarDecl*, Expression*): Assertion Expression::type(e).isbool()' failed`
- `./lib/flatten.cpp:1241: unsigned int MiniZinc::EnvI::registerArrayEnum(const std::vector<unsigned int>&): Assertion 'i <= _enumVarDecls.size() || i <= _tupleTypes.size() || i <= _recordTypes.size()' failed.` HOT 2
- cplex objective is incorrect for a problem solved at the root node
- Minizinc 2.8.5 + Gecode `release/6.3.0`: `tests/spec/unit/test-globals-float.mzn` causes OOM HOT 1
- "Official" Debian package? HOT 10
- Please consider providing Graph Reachability Matrix predicate HOT 1
- Allow caching of `par` functions HOT 1
- 2.8.5 crash HOT 2
- Overloading ++, show2d Error: evaluation error: index_set: wrong dimension HOT 4
- Segfault when searching on paramater and concatenating search annotations HOT 1
- `MiniZinc::simplify_bool_constraint()`: `Assertion 'nonfixed >= 0' failed.` HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from libminizinc.