Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Concatenation and reshape of Array variables #945

Open
raphaelchinchilla opened this issue Aug 4, 2023 · 1 comment
Open

Concatenation and reshape of Array variables #945

raphaelchinchilla opened this issue Aug 4, 2023 · 1 comment

Comments

@raphaelchinchilla
Copy link
Contributor

I was playing around with concatenation and reshape of Array variables, and I found behaviors that seem to me to be either a bug that should be corrected or a feature design that should be changed. Consider the following code snippet:

@variables x[1:4]

var1=[x;x]

var2=reshape(x,2,2)

if we look at the resulting variables, we get:

var1
8-element Vector{Num}:
 x[1]
 x[2]
 x[3]
 x[4]
 x[1]
 x[2]
 x[3]
 x[4]

and

var2
2×2 reshape(::Symbolics.Arr{Num, 1}, 2, 2) with eltype Num:
 x[1]  x[3]
 x[2]  x[4]

I would have expected var2 to have a similar effect to doing @variables var2[1:2,1:3] and var1 to create a new vector array that references the original variable x.

What is not clear to me is whether these are design choices or a bug. I say a bug because it often happens that one needs the reshape the variable or concatenate them.

If it is a bug, could you let me know? I will try to look into fixing it. These issues seem to be somehow similar to #850 and #855 .

@shashi
Copy link
Member

shashi commented Nov 7, 2023

We don't have reshape implemented.

Concatenation is possible with #548 (should probably not call it stencils)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants