-
Notifications
You must be signed in to change notification settings - Fork 0
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
help from people smarter than me #4
Comments
I would advise you to comment on the lines you've pasted in from your code to show that you understand what each is doing |
Diamond_square_step_dont_fail <- function(mat,n){ |
...please do this in your repo... |
my code:
Diamond_square_step_dont_fail <- function(mat,n){
i <- (2^n)-1
j <- (2^n)-1
mat <- mat_function (n)
mat <- square_step (mat,n)
mat <- diamond_step (mat,n)
for (k in 2^(n:1)-1)
for (i in seq(from=1, to=(ncol(mat)), by=k-1)){
for (j in seq(from=1, to=(nrow(mat)), by=k-1)){
mat[j:(j+k-1), i:(i+k-1)] <- square_step(mat[j:(j+k-1), i:(i+k-1)],n)
mat[j:(j+k-1), i:(i+k-1)] <- diamond_step(mat[j:(j+k-1), i:(i+k-1)],n)
}
}
return(mat)
}
was inspired by Alex Regos code
dss <- function(n, sd){
mat <- genmat(n)
side <- (2^n)+1
sd <- sd
for(k in 2^(n:1)){
for(i in seq(1,side-1,by=k)){
for(j in seq(1,side-1,by=k)){
mat[j:(j+k),i:(i+k)] <- d.s(mat[j:(j+k),i:(i+k)],sd)
mat[j:(j+k),i:(i+k)] <- s.s(mat[j:(j+k),i:(i+k)],sd)
}
}
sd <- abs(sd/1.5)
}
return(mat)
}
Mine still doesn't work but you know.....I feel better about it
The text was updated successfully, but these errors were encountered: