Skip to content

input problem #24

@VicWenyi

Description

@VicWenyi

Every time I input my code, the model forcibly modifies it into the following code, and then the generated test cases no longer match my original code.
This is my code
def jacobi(u, f, dx, Nx, Ny, itmax): # 9
x = np.zeros(Nx * Ny) # 10
for j in range(Ny): # 11
for i in range(Nx): # 12
x[i + j * Nx] = u[i + j * Nx] # 13
for it in range(itmax): # 14
for j in range(1, Ny - 1): # 15
for i in range(1, Nx - 1): # 16
x[i + j * Nx] = 0.25 * (x[(i - 1) + j * Nx] # 17
+ x[(i + 1) + j * Nx] # 18
+ x[i + (j - 1) * Nx] # 19
+ x[i + (j + 1) * Nx] # 20
- dx * dx * f[i + j * Nx]) # 21
return x # 22
But in the model, it was changed to the code shown in the image.
Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions