public class Library
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
Library.Power
EXPERIMENTAL, The class of Cts2Cts Functions,
Power(c,p)(x)=c.xp.
|
Modifier and Type | Field and Description |
---|---|
static Function.CtsD2CtsD.WithInverse |
cartesian2polar
This Function, R2→R2,
converts Cartesian coordinates 〈x,y〉
to polar coordinates 〈r,θ〉.
|
static Function.Native3 |
curry
curry: ((t, u) → v) → (t → u → v).
|
static Environment |
env
|
static Function.Cts2Cts.WithInverse |
exp
|
static Function |
frth
Return the fourth element of a
Value.Tuple . |
static Function |
fst
Return the first element of a
Value.Tuple . |
static Function |
id
The identity Function, id x = x.
|
static Function.Cts2Cts.WithInverse |
inv
The function, inv(x)=1/x.
|
static Function.Cts2Cts.WithInverse |
log
|
static Function.CtsD2CtsD.WithInverse |
polar2cartesian
This Function, R2→R2,
converts polar coordinates 〈r,θ〉
to Cartesian 〈x,y〉.
|
static Function |
snd
Return the second element of a
Value.Tuple . |
static Function |
thrd
Return the third element of a
Value.Tuple . |
static Function.Native2 |
uncurry
uncurry: (t → u → v) → ((t, u) → v).
|
static Function.Native2 |
whnf
whnf p0 p1 can be used to make a parameter (p0) strict, say:
force p0 to weak head normal form (WHNF), but
return p1 (also in WHNF). |
Constructor and Description |
---|
Library() |
Modifier and Type | Method and Description |
---|---|
static Function.Native2 |
bOp(int op)
Return a curried Function based on the binary operator, 'op'
(+, *, etc).
|
static void |
main(java.lang.String[] argv)
Run a few simple tests on Library.
|
static Function.Native |
uOp(int op)
Return a Function based on the unary operator,
'op' (not, -, hd, etc.).
|
public static final Function id
public static final Function fst
Value.Tuple
.public static final Function snd
Value.Tuple
.public static final Function thrd
Value.Tuple
.public static final Function frth
Value.Tuple
.public static final Function.Native3 curry
uncurry
.public static final Function.Native2 uncurry
uncurry
.public static final Function.Native2 whnf
force
p0 to weak head normal form (WHNF), but
return p1 (also in WHNF).public static final Function.Cts2Cts.WithInverse inv
public static final Function.Cts2Cts.WithInverse exp
public static final Function.Cts2Cts.WithInverse log
public static final Function.CtsD2CtsD.WithInverse polar2cartesian
matrix
is
{{cos(θ), −r.sin(θ)},
{sin(θ), r.cos(θ)}}.
The negative log of its determinant, nlJ(r_t)
,
equals −log(r).
These are used by apply(.)
to "adjust"
the AoMs of the result. The inverse Function is
cartesian2polar〈x,y〉
.{{cos(θ), −r.sin(θ)}, {sin(θ), r.cos(θ)}} × {{x/r, y/r}, {−y/r2, x/r2}} = {{x.cosθ/r+y.sinθ/r, y.cosθ/r−x.sinθ/r}, {x.sinθ/r−y.cosθ/r, y.sinθ/r+x.cosθ/r}} = {{1, 0}, {0, 1}}.
public static final Function.CtsD2CtsD.WithInverse cartesian2polar
matrix
is
{{x/r, y/r},
{−y/r2, x/r2}}.
The negative log of its determinant,
nlJ(xy)
, equals +log(r).
These are used by apply(.)
to "adjust"
the AoMs of the result. The inverse Function is
polar2cartesian〈r,θ〉
.public static final Environment env
public static Function.Native uOp(int op)
Value.uOp(int)
and bOp(int)
.public static Function.Native2 bOp(int op)
Value.bOp(int, la.la.Value)
and uOp(int)
.public static void main(java.lang.String[] argv)