Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
integer nrows, iline, irow, ivalue
integer,dimension(xxx):: index
real,dimension(xxx)::a
!
! xxx to be the max number of nonzero elements in your
! matrix
!
nrows=360
ivalue=0
do while (evaluation not ready)
ivalue=ivalue+1
!
! routine to evaluate your values to be saved in
! row number irow and line number iline of your matrix
!
a(ivalue) = ....
index(ivalue) = (iline - 1) * nrows + irow
!
! this is a unique index for your value and in fact
! resembles the data saving sequence in your PC's memory
!
enddo
integer jndex,jj
jndex = (iline-1) * nrows + irow
jj=0
do j=1,xxx
if(index(j).eq.jndex)then
jj = j
exit
endif
enddo
if(jj.ne.0)then ! to make sure you have found data
!
! Your routine now with a(jj) being the value you wanted to retrieve.
!
endif
Is iline (line number) means the column number?
How can I retrive the output to text file as actual matrix including the zeros?
real dummy(nrows)
integer j, jj, ind
do i=1,nlines
do j=1,nrows
!
! use the retrieval algorithm as above
!
dummy(j) = a(jj)
enddo
write(xxx,xxx)(dummy(j),j=1,nrows)
enddo
How can I multiply with another matrix in this structure?