6.15 Subtypes
6.15.1 Flonum Arrays
syntax
syntax
(flarray #[#[...] ...])
> (flarray 0.0) - : FlArray
(flarray 0.0)
> (flarray #['x]) eval:312:0: Type Checker: type mismatch
expected: Real
given: 'x
in: #((quote x))
> (flarray #[#[1 2] #[3 4]]) - : FlArray
(flarray #[#[1.0 2.0] #[3.0 4.0]])
procedure
(array->flarray arr) → FlArray
arr : (Array Real)
procedure
(flarray-data arr) → FlVector
arr : FlArray
> (flarray-data (flarray #[#[1 2] #[3 4]])) - : FlVector
(flvector 1.0 2.0 3.0 4.0)
The function f is meant to accept the same number of arguments as the number of its following flonum array arguments. However, a current limitation in Typed Racket requires f to accept any number of arguments. To map a single-arity function such as fl+, for now, use inline-flarray-map or array-map.
This is currently unavailable in untyped Racket.
procedure
arr0 : FlArray arr1 : FlArray
procedure
arr0 : FlArray arr1 : FlArray
procedure
arr : FlArray (flarray- arr0 arr1) → FlArray arr0 : FlArray arr1 : FlArray
procedure
arr : FlArray (flarray/ arr0 arr1) → FlArray arr0 : FlArray arr1 : FlArray
procedure
(flarray-min arr0 arr1) → FlArray
arr0 : FlArray arr1 : FlArray
procedure
(flarray-max arr0 arr1) → FlArray
arr0 : FlArray arr1 : FlArray
procedure
(flarray-scale arr x) → FlArray
arr : FlArray x : Flonum
procedure
(flarray-abs arr) → FlArray
arr : FlArray
procedure
(flarray-sqr arr) → FlArray
arr : FlArray
procedure
(flarray-sqrt arr) → FlArray
arr : FlArray
6.15.2 Float-Complex Arrays
syntax
syntax
(fcarray #[#[...] ...])
> (fcarray 0.0) - : FCArray
(fcarray 0.0+0.0i)
> (fcarray #['x]) eval:316:0: Type Checker: type mismatch
expected: Number
given: 'x
in: #((quote x))
> (fcarray #[#[1 2+1i] #[3 4+3i]]) - : FCArray
(fcarray #[#[1.0+0.0i 2.0+1.0i] #[3.0+0.0i 4.0+3.0i]])
procedure
(array->fcarray arr) → FCArray
arr : (Array Number)
procedure
(fcarray-real-data arr) → FlVector
arr : FCArray
procedure
(fcarray-imag-data arr) → FlVector
arr : FCArray
> (define arr (fcarray #[#[1 2+1i] #[3 4+3i]])) > (fcarray-real-data arr) - : FlVector
(flvector 1.0 2.0 3.0 4.0)
> (fcarray-imag-data arr) - : FlVector
(flvector 0.0 1.0 0.0 3.0)
procedure
(fcarray-map f arrs ...) → FCArray
f : (Float-Complex ... -> Float-Complex) arrs : FCArray
The function f is meant to accept the same number of arguments as the number of its following float-complex array arguments. However, a current limitation in Typed Racket requires f to accept any number of arguments. To map a single-arity function, for now, use inline-fcarray-map or array-map.
syntax
(inline-fcarray-map f arrs ...)
f : (Float-Complex ... -> Float-Complex)
arrs : FCArray
This is currently unavailable in untyped Racket.
procedure
arr0 : FCArray arr1 : FCArray
procedure
arr0 : FCArray arr1 : FCArray
procedure
arr : FCArray (fcarray- arr0 arr1) → FCArray arr0 : FCArray arr1 : FCArray
procedure
arr : FCArray (fcarray/ arr0 arr1) → FCArray arr0 : FCArray arr1 : FCArray
procedure
(fcarray-scale arr z) → FCArray
arr : FCArray z : Float-Complex
procedure
(fcarray-sqr arr) → FCArray
arr : FCArray
procedure
(fcarray-sqrt arr) → FCArray
arr : FCArray
procedure
(fcarray-conjugate arr) → FCArray
arr : FCArray
procedure
(fcarray-real-part arr) → FlArray
arr : FCArray
procedure
(fcarray-imag-part arr) → FlArray
arr : FCArray
procedure
(fcarray-make-rectangular arr0 arr1) → FCArray
arr0 : FlArray arr1 : FlArray
procedure
(fcarray-magnitude arr) → FlArray
arr : FCArray
procedure
(fcarray-angle arr) → FlArray
arr : FCArray
procedure
(fcarray-make-polar arr0 arr1) → FCArray
arr0 : FlArray arr1 : FlArray