E-MD0000 — Dimension and shape mismatch

Error Type

Modeling Error

Phase

building the model (declaring a placeholder)

Python exception

jijmodeling.ModelingError

Message

Dimension mismatch: placeholder `{name}` is declared to be of dimension {dim}, but given inconsistent shape [{...}]

Cause

A placeholder was declared with both ndim and shape, but the number of entries in shape does not match ndim — for example ndim=2 with a three-element shape.

Fix

Make ndim and shape agree, or drop one of them: shape alone already determines the dimension.

d = problem.Float("d", shape=(N, M))   # ndim is inferred as 2