Hi all, have a good day,
My issue in the code that it sometimes prompt the sign " +"
I'm trying to find the bandwidth of a sparse matrix.
I'd be grateful if you can help
here's the code
#check bandwidth
i <-array(c(1), dim=c(1))
j<-array(c(1), dim=c(1))
k1<-0
k2<-0
while(j<=ceiling(c/2)){
while(j<=(i-k1)){
if(A[i]==0 & A[j]==0)
{
k1<-k1+1
} else {ifelse(i==c,j<-j+1,i<-i+1)
}
}
}
i <-array(c(1), dim=c(1))
j<-array(c(ceiling(c/2)), dim=c(1))
while(j>=ceiling(c/2)){
while(j<(i+k2)){
if(A[i]==0 & A[j]==0)
{
k2<-k2+1}
else {
ifelse(i==c,j<-j+1,i<-i+1)
}
}
}