|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.netlib.util.Util
public class Util
Implementations of various Fortran intrinsic functions.
This file is part of the Fortran-to-Java (f2j) system, developed at the University of Tennessee.
This class contains various helper routines for f2j-generated code. These routines are primarily implemented for handling Fortran intrinsic functions.
Constructor Summary | |
---|---|
Util()
|
Method Summary | |
---|---|
static double |
cosh(double a)
Fortran hyperbolic cosine (COSH) intrinsic function. |
static double |
ddim(double a1,
double a2)
Fortran double precision positive difference (DDIM) intrinsic function. |
static float |
dim(float a1,
float a2)
Fortran floating point positive difference (DIM) intrinsic function. |
static double |
dsign(double a1,
double a2)
Fortran double precision transfer of sign (DSIGN) intrinsic function. |
static int |
idim(int a1,
int a2)
Fortran integer positive difference (IDIM) intrinsic function. |
static int |
idnint(double x)
Fortran nearest integer (IDNINT) intrinsic function. |
static int |
isign(int a1,
int a2)
Fortran integer transfer of sign (ISIGN) intrinsic function. |
static double |
log10(double x)
Base-10 logarithm function. |
static float |
log10(float x)
Base-10 logarithm function. |
static double |
max(double x,
double y,
double z)
Three argument double precision max function. |
static float |
max(float x,
float y,
float z)
Three argument single precision max function. |
static int |
max(int x,
int y,
int z)
Three argument integer max function. |
static double |
min(double x,
double y,
double z)
Three argument double precision min function. |
static float |
min(float x,
float y,
float z)
Three argument single precision min function. |
static int |
min(int x,
int y,
int z)
Three argument integer min function. |
static int |
nint(float x)
Fortran nearest integer (NINT) intrinsic function. |
static void |
pause()
Pauses execution temporarily. |
static void |
pause(java.lang.String msg)
Pauses execution temporarily. |
static float |
sign(float a1,
float a2)
Fortran floating point transfer of sign (SIGN) intrinsic function. |
static double |
sinh(double a)
Fortran hyperbolic sine (SINH) intrinsic function. |
static java.lang.String |
stringInsert(java.lang.String x,
java.lang.String y,
int E1,
int E2)
Inserts a string into a substring of another string. |
static double |
tanh(double a)
Fortran hyperbolic tangent (TANH) intrinsic function. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Util()
Method Detail |
---|
public static java.lang.String stringInsert(java.lang.String x, java.lang.String y, int E1, int E2)
This method handles situations in which the lhs of an assignment statement is a substring operation. For example:
a(3:4) = 'hi'
We haven't figured out an elegant way to do this with Java Strings, but we do handle it, as follows:
Where E1 is the expression representing the starting index of the substring
and E2 is the expression representing the ending index of the substring
The resulting code looks pretty bad because we have to be
prepared to handle rhs strings that are too big to fit in
the lhs substring.
a = new StringW(
a.val.substring(0,E1-1) +
"hi".substring(0,E2-E1+1) +
a.val.substring(E2,a.val.length())
);
x
- dest (string to be inserted into)y
- source (substring to insert into 'x')E1
- expression representing the start of the substringE2
- expression representing the end of the substring
public static int max(int x, int y, int z)
x
- value 1y
- value 2z
- value 3
public static float max(float x, float y, float z)
x
- value 1y
- value 2z
- value 3
public static double max(double x, double y, double z)
x
- value 1y
- value 2z
- value 3
public static int min(int x, int y, int z)
x
- value 1y
- value 2z
- value 3
public static float min(float x, float y, float z)
x
- value 1y
- value 2z
- value 3
public static double min(double x, double y, double z)
x
- value 1y
- value 2z
- value 3
public static double log10(double x)
x
- the value
public static float log10(float x)
x
- the value
public static int nint(float x)
Returns:
x
- the floating point value
public static int idnint(double x)
Returns:
x
- the double precision floating point value
public static float sign(float a1, float a2)
Returns:
a1
- floating point valuea2
- sign transfer indicator
public static int isign(int a1, int a2)
Returns:
a1
- integer valuea2
- sign transfer indicator
public static double dsign(double a1, double a2)
Returns:
a1
- double precision floating point valuea2
- sign transfer indicator
public static float dim(float a1, float a2)
Returns:
a1
- floating point valuea2
- floating point value
public static int idim(int a1, int a2)
Returns:
a1
- integer valuea2
- integer value
public static double ddim(double a1, double a2)
Returns:
a1
- double precision floating point valuea2
- double precision floating point value
public static double sinh(double a)
a
- the value to get the sine of
public static double cosh(double a)
a
- the value to get the cosine of
public static double tanh(double a)
a
- the value to get the tangent of
public static void pause()
I think this was an implementation dependent feature of Fortran 77.
public static void pause(java.lang.String msg)
I think this was an implementation dependent feature of Fortran 77.
msg
- the message to be printed before pausing. if null, no
message will be printed.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |