Re: complex number & sort
- From: "highegg" <highegg@xxxxxxxxx>
- Date: 19 Mar 2007 07:46:51 -0700
2) i have an array with dimensioins A(3,200) . i want to sort these
array
with increasing the second row data algebrically . in fortran
libarary i can't
find suitable program , all program are for vectors .can anybody
propose me a way ?
You can use, for instance, this module:
http://artax.karlin.mff.cuni.cz/~hajej2am/ulozna/ordering.f90
to sort your array according to the second column (i.e. permute rows
in such a way that the second column is in increasing order), you can
simply do:
USE ordering
.....
A = A(:, order(A(2,:)) ) ! sort A by 2nd column
"order" is a function that computes an ordering permutation for an
integer/real array X, such that X(order(X)) is increasing sequence.
3) in my program , numbers are calculated with 6 digits precesion
after point .( for example 21.938495 ) how
can i control the precesion ? i want it computes with 3 or 2 digits
after point .
Available kinds of real numbers depend on you hardware. What you
probably want is to display the results with only 2 or 3 digits. Check
out the WRITE statement and edit descriptors in your compiler's
manual.
.
- Follow-Ups:
- Re: complex number & sort
- From: highegg
- Re: complex number & sort
- From: nakisa
- Re: complex number & sort
- References:
- complex number & sort
- From: nakisa
- complex number & sort
- Prev by Date: Re: variable names for different fortrans
- Next by Date: Re: Zombie Code -- Re: How old is the average Fortran programmer?
- Previous by thread: RE: complex number & sort
- Next by thread: Re: complex number & sort
- Index(es):
Relevant Pages
|