It's not really a redeclaration per se.
It's usually good style to put declarations near
where they're used because it makes the program
easier to understand (less scanning). An exception to
this rule is for compound structures such as arrays
or matrices, but only when they are filled elementwise.
For this case, preallocating outside of a block where
they're repeatedly used can be more efficient.
I added a style guide appendix and I'll put a
note in there about this case with some examples.
- Bob