Closed wlfbck closed 5 years ago
This feature was previously removed because Java supports range-based loops only for objects, not primitive types, impacting the performance by several magnitudes as autoboxing and unboxing is required for this to work.
But we could easily reimplement this feature.
I guess it would be handy, atleast its less then two nested for loops :P
Are you assuming to use two nested loops for iterating over all elements?
I would recommend to implement this as followed:
Mat example = new Mat(4, 4, Fill.RANDU); for (into n = 0; n < example.n_elem; n++) { System.out.println(example.at(n)); }
Interesting, didn't see the Mat.at()-method.
Not sure if it was intentionally removed, but the current version is missing a feature, this worked before.
for (double val : mat)
shows the following error: "for-each not applicable to expression type" required: array or java.langIterable found: Mat