Fortran64¤
Communicates with the fortran_lib library via the Fortran32 class that is running on a server.
Fortran64 ¤
Fortran64()
Bases: Client64
Communicates with a 32-bit FORTRAN library.
This class demonstrates how to communicate with a 32-bit FORTRAN library if an instance of this class is created within a 64-bit Python interpreter.
Source code in src/msl/examples/loadlib/fortran64.py
17 18 19 20 21 22 23 24 25 |
|
add_1d_arrays ¤
add_1d_arrays(a1, a2)
Perform an element-wise addition of two 1D double-precision arrays.
See the corresponding Fortran32.add_1d_arrays method.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
a1
|
Sequence[float]
|
First array. |
required |
a2
|
Sequence[float]
|
Second array. |
required |
Returns:
Type | Description |
---|---|
list[float]
|
The element-wise addition of |
Source code in src/msl/examples/loadlib/fortran64.py
209 210 211 212 213 214 215 216 217 218 219 220 221 222 |
|
add_or_subtract ¤
add_or_subtract(a, b, *, do_addition)
Add or subtract two integers.
See the corresponding Fortran32.add_or_subtract method.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
a
|
int
|
First integer. |
required |
b
|
int
|
Second integer. |
required |
do_addition
|
bool
|
Whether to add or subtract the numbers. |
required |
Returns:
Type | Description |
---|---|
int
|
|
Source code in src/msl/examples/loadlib/fortran64.py
133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 |
|
besselJ0 ¤
besselJ0(x)
Compute the Bessel function of the first kind of order 0 of x.
See the corresponding Fortran32.besselJ0 method.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
x
|
float
|
The value to compute |
required |
Returns:
Type | Description |
---|---|
float
|
The value of |
Source code in src/msl/examples/loadlib/fortran64.py
180 181 182 183 184 185 186 187 188 189 190 191 192 |
|
factorial ¤
factorial(n)
Compute the n'th factorial.
See the corresponding Fortran32.factorial method.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
n
|
int
|
The integer to computer the factorial of. The maximum allowed value is 127. |
required |
Returns:
Type | Description |
---|---|
float
|
The factorial of |
Source code in src/msl/examples/loadlib/fortran64.py
150 151 152 153 154 155 156 157 158 159 160 161 162 |
|
is_positive ¤
is_positive(a)
Returns whether the value of the input argument is > 0.
See the corresponding Fortran32.is_positive method.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
a
|
float
|
Double-precision number. |
required |
Returns:
Type | Description |
---|---|
bool
|
Whether the value of |
Source code in src/msl/examples/loadlib/fortran64.py
119 120 121 122 123 124 125 126 127 128 129 130 131 |
|
matrix_multiply ¤
matrix_multiply(a1, a2)
Multiply two matrices.
See the corresponding Fortran32.matrix_multiply method.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
a1
|
Sequence[Sequence[float]]
|
First matrix. |
required |
a2
|
Sequence[Sequence[float]]
|
Second matrix. |
required |
Returns:
Type | Description |
---|---|
list[list[float]]
|
The product, |
Source code in src/msl/examples/loadlib/fortran64.py
224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 |
|
multiply_float32 ¤
multiply_float32(a, b)
Send a request to multiply two FORTRAN floating-point numbers.
See the corresponding Fortran32.multiply_float32 method.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
a
|
float
|
First floating-point number. |
required |
b
|
float
|
Second floating-point number. |
required |
Returns:
Type | Description |
---|---|
float
|
The product, |
Source code in src/msl/examples/loadlib/fortran64.py
87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 |
|
multiply_float64 ¤
multiply_float64(a, b)
Send a request to multiply two FORTRAN double-precision numbers.
See the corresponding Fortran32.multiply_float64 method.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
a
|
float
|
First double-precision number. |
required |
b
|
float
|
Second double-precision number. |
required |
Returns:
Type | Description |
---|---|
float
|
The product, |
Source code in src/msl/examples/loadlib/fortran64.py
103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 |
|
reverse_string ¤
reverse_string(original)
Reverse a string.
See the corresponding Fortran32.reverse_string method.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
original
|
str
|
The original string. |
required |
Returns:
Type | Description |
---|---|
str
|
The string reversed. |
Source code in src/msl/examples/loadlib/fortran64.py
194 195 196 197 198 199 200 201 202 203 204 205 206 207 |
|
standard_deviation ¤
standard_deviation(data)
Compute the standard deviation.
See the corresponding Fortran32.standard_deviation method.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
data
|
Sequence[float]
|
The values to compute the standard deviation of. |
required |
Returns:
Type | Description |
---|---|
float
|
The standard deviation of |
Source code in src/msl/examples/loadlib/fortran64.py
164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 |
|
sum_16bit ¤
sum_16bit(a, b)
Send a request to add two 16-bit signed integers.
See the corresponding Fortran32.sum_16bit method.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
a
|
int
|
First 16-bit signed integer. |
required |
b
|
int
|
Second 16-bit signed integer. |
required |
Returns:
Type | Description |
---|---|
int
|
The sum, |
Source code in src/msl/examples/loadlib/fortran64.py
42 43 44 45 46 47 48 49 50 51 52 53 54 55 |
|
sum_32bit ¤
sum_32bit(a, b)
Send a request to add two 32-bit signed integers.
See the corresponding Fortran32.sum_32bit method.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
a
|
int
|
First 32-bit signed integer. |
required |
b
|
int
|
Second 32-bit signed integer. |
required |
Returns:
Type | Description |
---|---|
int
|
The sum, |
Source code in src/msl/examples/loadlib/fortran64.py
57 58 59 60 61 62 63 64 65 66 67 68 69 70 |
|
sum_64bit ¤
sum_64bit(a, b)
Send a request to add two 64-bit signed integers.
See the corresponding Fortran32.sum_64bit method.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
a
|
int
|
First 64-bit signed integer. |
required |
b
|
int
|
Second 64-bit signed integer. |
required |
Returns:
Type | Description |
---|---|
int
|
The sum, |
Source code in src/msl/examples/loadlib/fortran64.py
72 73 74 75 76 77 78 79 80 81 82 83 84 85 |
|
sum_8bit ¤
sum_8bit(a, b)
Send a request to add two 8-bit signed integers.
See the corresponding Fortran32.sum_8bit method.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
a
|
int
|
First 8-bit signed integer. |
required |
b
|
int
|
Second 8-bit signed integer. |
required |
Returns:
Type | Description |
---|---|
int
|
The sum, |
Source code in src/msl/examples/loadlib/fortran64.py
27 28 29 30 31 32 33 34 35 36 37 38 39 40 |
|