| 1 | package Chart::GGPlot::Trans::Functions; | ||||||||||||||||||||||||||||||||
| 2 | |||||||||||||||||||||||||||||||||
| 3 | # ABSTRACT: Function interface for Chart::GGPlot::Trans | ||||||||||||||||||||||||||||||||
| 4 | |||||||||||||||||||||||||||||||||
| 5 | 8 | ▶ | use Chart::GGPlot::Setup qw(:base :pdl); | ||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||
| 6 | |||||||||||||||||||||||||||||||||
| 7 | 8 | our $VERSION = '0.002003'; # VERSION | |||||||||||||||||||||||||||||||
| 8 | |||||||||||||||||||||||||||||||||
| 9 | 8 | ▶ | use PDL::Math; | ||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||
| 10 | 8 | ▶ | use PDL::Primitive qw(which); | ||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||
| 11 | 8 | ▶ | use Role::Tiny (); | ||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||
| 12 | |||||||||||||||||||||||||||||||||
| 13 | 8 | ▶ | use Chart::GGPlot::Trans; | ||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||
| 14 | 8 | ▶ | use Chart::GGPlot::Types; | ||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||
| 15 | 8 | ▶ | use Chart::GGPlot::Util qw(:all); | ||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||
| 16 | |||||||||||||||||||||||||||||||||
| 17 | 8 | ▶ | use parent qw(Exporter::Tiny); | ||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||
| 18 | |||||||||||||||||||||||||||||||||
| 19 | 8 | our @EXPORT_OK = qw( | |||||||||||||||||||||||||||||||
| 20 | is_trans as_trans trans_range | ||||||||||||||||||||||||||||||||
| 21 | asn_trans atanh_trans | ||||||||||||||||||||||||||||||||
| 22 | identity_trans log_trans | ||||||||||||||||||||||||||||||||
| 23 | log10_trans log2_trans | ||||||||||||||||||||||||||||||||
| 24 | log1p_trans reciprocal_trans | ||||||||||||||||||||||||||||||||
| 25 | reverse_trans sqrt_trans | ||||||||||||||||||||||||||||||||
| 26 | time_trans | ||||||||||||||||||||||||||||||||
| 27 | ); | ||||||||||||||||||||||||||||||||
| 28 | 8 | our %EXPORT_TAGS = ( all => \@EXPORT_OK ); | |||||||||||||||||||||||||||||||
| 29 | |||||||||||||||||||||||||||||||||
| 30 | 25 | ▶ | sub is_trans { $_[0]->$_isa('Chart::GGPlot::Trans'); } | ||||||||||||||||||||||||||||||
|
Subroutine
is_trans: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||
| 31 | |||||||||||||||||||||||||||||||||
| 32 | |||||||||||||||||||||||||||||||||
| 33 | 8 | my %trans_registry = (); | |||||||||||||||||||||||||||||||
| 34 | |||||||||||||||||||||||||||||||||
| 35 | 88 | ▶ | fun _register_trans($trans) { | ||||||||||||||||||||||||||||||
|
Subroutine
_register_trans: called CC=3 SCAR=11.3
Branch: 2 branches
| |||||||||||||||||||||||||||||||||
| 36 | 88 | $trans_registry{ $trans->name } = $trans; | |||||||||||||||||||||||||||||||
| 37 | 8 | } | |||||||||||||||||||||||||||||||
| 38 | |||||||||||||||||||||||||||||||||
| 39 | 22 | ▶ | fun as_trans($x) { | ||||||||||||||||||||||||||||||
|
Subroutine
as_trans: called CC=5 SCAR=16.2
Pod
documented
Branch: 2 branches
| |||||||||||||||||||||||||||||||||
| 40 | 22 | ▶ | return $x if ( is_trans($x) ); | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 41 | |||||||||||||||||||||||||||||||||
| 42 | 21 | my $trans = $trans_registry{$x}; | |||||||||||||||||||||||||||||||
| 43 | 21 | ▶ | unless ($trans) { | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 44 | 1 | die "'$x' is not a transformation"; | |||||||||||||||||||||||||||||||
| 45 | } | ||||||||||||||||||||||||||||||||
| 46 | 20 | return $trans; | |||||||||||||||||||||||||||||||
| 47 | 8 | } | |||||||||||||||||||||||||||||||
| 48 | |||||||||||||||||||||||||||||||||
| 49 | # Compute range of transformed values. | ||||||||||||||||||||||||||||||||
| 50 | 0 | ▶ | fun trans_range( $trans, $p ) { | ||||||||||||||||||||||||||||||
|
Subroutine
trans_range: not called CC=3 SCAR=24.8
Pod
undocumented
Branch: 2 branches
| |||||||||||||||||||||||||||||||||
| 51 | 0 | $trans = as_trans($trans); | |||||||||||||||||||||||||||||||
| 52 | 0 | return range( | |||||||||||||||||||||||||||||||
| 53 | $trans->transform->( | ||||||||||||||||||||||||||||||||
| 54 | range_( squish( $p, $trans->domain ), true ) | ||||||||||||||||||||||||||||||||
| 55 | ) | ||||||||||||||||||||||||||||||||
| 56 | ); | ||||||||||||||||||||||||||||||||
| 57 | 8 | } | |||||||||||||||||||||||||||||||
| 58 | |||||||||||||||||||||||||||||||||
| 59 | 89 | ▶ | fun _trans_new( $name, $trans, $inv, %rest ) { | ||||||||||||||||||||||||||||||
|
Subroutine
_trans_new: called CC=4 SCAR=14.5
Branch: 2 branches
Condition66%2/3
@_ > 3 and (@_ - 3) % 2
MC/DC0%0/2
@_ > 3 and (@_ - 3) % 2
@_ > 3
(@_ - 3) % 2
Truth table66%2/3
A and B
A= @_ > 3B= (@_ - 3) % 2
| |||||||||||||||||||||||||||||||||
| 60 | 89 | return Chart::GGPlot::Trans->new( | |||||||||||||||||||||||||||||||
| 61 | name => $name, | ||||||||||||||||||||||||||||||||
| 62 | transform => $trans, | ||||||||||||||||||||||||||||||||
| 63 | inverse => $inv, | ||||||||||||||||||||||||||||||||
| 64 | %rest | ||||||||||||||||||||||||||||||||
| 65 | ); | ||||||||||||||||||||||||||||||||
| 66 | 8 | } | |||||||||||||||||||||||||||||||
| 67 | |||||||||||||||||||||||||||||||||
| 68 | # Identity transformation (do nothing). | ||||||||||||||||||||||||||||||||
| 69 | 9 | ▶ | fun identity_trans() { | ||||||||||||||||||||||||||||||
|
Subroutine
identity_trans: called CC=2 SCAR=7.1
Pod
undocumented
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 70 | 9 | ▶ | my $id = fun($p) { $p->copy }; | ||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=3 SCAR=11.2
Branch: 2 branches
| |||||||||||||||||||||||||||||||||
| 71 | 9 | _trans_new( 'identity', $id, $id); | |||||||||||||||||||||||||||||||
| 72 | 8 | } | |||||||||||||||||||||||||||||||
| 73 | |||||||||||||||||||||||||||||||||
| 74 | # Arc-sin square root transformation. | ||||||||||||||||||||||||||||||||
| 75 | 8 | ▶ | fun asn_trans() { | ||||||||||||||||||||||||||||||
|
Subroutine
asn_trans: called CC=2 SCAR=14.5
Pod
undocumented
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 76 | 0 | ▶ | _trans_new( | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 77 | 'asn', | ||||||||||||||||||||||||||||||||
| 78 | 0 | ▶ | fun($p) { $p->sqrt->asin * 2; }, | ||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: not called CC=3 SCAR=24.8
Branch: 2 branches
| |||||||||||||||||||||||||||||||||
| 79 | 0 | ▶ | fun($p) { ( $p/2 )->sin ** 2; }, | ||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: not called CC=3 SCAR=21.6
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 80 | ); | ||||||||||||||||||||||||||||||||
| 81 | 8 | } | |||||||||||||||||||||||||||||||
| 82 | |||||||||||||||||||||||||||||||||
| 83 | # Arc-tangent transformation. | ||||||||||||||||||||||||||||||||
| 84 | 8 | ▶ | fun atanh_trans() { | ||||||||||||||||||||||||||||||
|
Subroutine
atanh_trans: called CC=2 SCAR=11.6
Pod
undocumented
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 85 | 0 | ▶ | my $atanh = fun($p) { $p->atanh }; | ||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: not called CC=3 SCAR=22.6
Branch: 2 branches
| |||||||||||||||||||||||||||||||||
| 86 | 8 | _trans_new( 'atanh', $atanh, $atanh ); | |||||||||||||||||||||||||||||||
| 87 | 8 | } | |||||||||||||||||||||||||||||||
| 88 | |||||||||||||||||||||||||||||||||
| 89 | # Box-Cox power transformation. | ||||||||||||||||||||||||||||||||
| 90 | 0 | ▶ | fun boxcox_trans($x) { | ||||||||||||||||||||||||||||||
|
Subroutine
boxcox_trans: not called CC=4 SCAR=30.0
Pod
undocumented
Branch: 2 branches
| |||||||||||||||||||||||||||||||||
| 91 | 0 | ▶ | if ( abs($x) < 1e-07 ) { return ( log_trans() ); } | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 92 | _trans_new( | ||||||||||||||||||||||||||||||||
| 93 | 0 | ▶ | 'pow-' . $x, | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 94 | 0 | ▶ | fun($p) { ($p ** $x - 1) / $x * sign( $p -1) }, | ||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: not called CC=3 SCAR=24.8
Branch: 2 branches
| |||||||||||||||||||||||||||||||||
| 95 | 0 | ▶ | fun($p) { ($p->abs * $x + 1 * sign($p)) ** (1/$x) }, | ||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: not called CC=3 SCAR=24.8
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 96 | ); | ||||||||||||||||||||||||||||||||
| 97 | 8 | } | |||||||||||||||||||||||||||||||
| 98 | |||||||||||||||||||||||||||||||||
| 99 | # Exponential transformation (inverse of log transformation). | ||||||||||||||||||||||||||||||||
| 100 | 0 | ▶ | fun exp_trans( $base = exp(1) ) { | ||||||||||||||||||||||||||||||
|
Subroutine
exp_trans: not called CC=3 SCAR=24.8
Pod
undocumented
Branch: 2 branches
| |||||||||||||||||||||||||||||||||
| 101 | 0 | ▶ | _trans_new( | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 102 | 'power-' . $base, | ||||||||||||||||||||||||||||||||
| 103 | 0 | ▶ | fun($p) { pdl($base) ** $p }, | ||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: not called CC=3 SCAR=24.8
Branch: 2 branches
| |||||||||||||||||||||||||||||||||
| 104 | 0 | ▶ | fun($p) { $p->log / log($base) }, | ||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: not called CC=3 SCAR=24.8
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 105 | ); | ||||||||||||||||||||||||||||||||
| 106 | 8 | } | |||||||||||||||||||||||||||||||
| 107 | |||||||||||||||||||||||||||||||||
| 108 | # Log transformation. | ||||||||||||||||||||||||||||||||
| 109 | 24 | ▶ | fun log_trans( $base = undef ) { | ||||||||||||||||||||||||||||||
|
Subroutine
log_trans: called CC=4 SCAR=20.9
Pod
undocumented
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 110 | 24 | ▶ | my $name = defined $base ? "log$base" : 'log'; | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 111 | 24 | ▶ | $base //= exp(1); | ||||||||||||||||||||||||||||||
|
Condition100%2/2
$base //= "2.71828182845905"
MC/DC100%1/1
$base //= "2.71828182845905"
$base
Truth table100%2/2
A
A= $base
| |||||||||||||||||||||||||||||||||
| 112 | 0 | ▶ | _trans_new( $name, | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 113 | 0 | ▶ | fun($p) { $p->log / log($base) }, | ||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: not called CC=3 SCAR=24.8
Branch: 2 branches
| |||||||||||||||||||||||||||||||||
| 114 | 0 | ▶ | fun($p) { pdl($base) ** $p }, | ||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: not called CC=3 SCAR=21.6
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 115 | breaks => log_breaks($base), | ||||||||||||||||||||||||||||||||
| 116 | ); | ||||||||||||||||||||||||||||||||
| 117 | 8 | } | |||||||||||||||||||||||||||||||
| 118 | |||||||||||||||||||||||||||||||||
| 119 | 8 | ▶ | sub log10_trans { log_trans(10) } | ||||||||||||||||||||||||||||||
|
Subroutine
log10_trans: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||
| 120 | 8 | ▶ | sub log2_trans { log_trans(2) } | ||||||||||||||||||||||||||||||
|
Subroutine
log2_trans: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||
| 121 | |||||||||||||||||||||||||||||||||
| 122 | 8 | ▶ | fun log1p_trans() { | ||||||||||||||||||||||||||||||
|
Subroutine
log1p_trans: called CC=2 SCAR=14.5
Pod
undocumented
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 123 | 0 | ▶ | _trans_new( 'log1p', | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 124 | 0 | ▶ | fun($p) { ($p + 1)->log() }, | ||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: not called CC=3 SCAR=24.8
Branch: 2 branches
| |||||||||||||||||||||||||||||||||
| 125 | 0 | ▶ | fun($p) { $p->exp() - 1 }, | ||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: not called CC=3 SCAR=21.6
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 126 | ); | ||||||||||||||||||||||||||||||||
| 127 | 8 | } | |||||||||||||||||||||||||||||||
| 128 | |||||||||||||||||||||||||||||||||
| 129 | # Probability transformation. | ||||||||||||||||||||||||||||||||
| 130 | 0 | ▶ | fun probability_trans( $distribution, @rest ) { | ||||||||||||||||||||||||||||||
|
Subroutine
probability_trans: not called CC=2 SCAR=15.1
Pod
undocumented
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 131 | |||||||||||||||||||||||||||||||||
| 132 | # TODO: we probably can use Math::CDF or Math::GSL::CDF | ||||||||||||||||||||||||||||||||
| 133 | ... | ||||||||||||||||||||||||||||||||
| 134 | 0 | } | |||||||||||||||||||||||||||||||
| 135 | |||||||||||||||||||||||||||||||||
| 136 | # TODO: revisit this once probability_trans is fixed | ||||||||||||||||||||||||||||||||
| 137 | #sub logit_trans { probability_trans("logis") } | ||||||||||||||||||||||||||||||||
| 138 | #sub probit_trans { probability_trans("norm") } | ||||||||||||||||||||||||||||||||
| 139 | |||||||||||||||||||||||||||||||||
| 140 | # Reciprocal transformation. | ||||||||||||||||||||||||||||||||
| 141 | 8 | ▶ | fun reciprocal_trans() { | ||||||||||||||||||||||||||||||
|
Subroutine
reciprocal_trans: called CC=2 SCAR=11.6
Pod
undocumented
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 142 | 0 | ▶ | my $reci = fun($p) { 1 / $p }; | ||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: not called CC=3 SCAR=22.6
Branch: 2 branches
| |||||||||||||||||||||||||||||||||
| 143 | 8 | _trans_new( 'reciprocal', $reci, $reci); | |||||||||||||||||||||||||||||||
| 144 | 8 | } | |||||||||||||||||||||||||||||||
| 145 | |||||||||||||||||||||||||||||||||
| 146 | # Reverse transformation. | ||||||||||||||||||||||||||||||||
| 147 | 8 | ▶ | fun reverse_trans() { | ||||||||||||||||||||||||||||||
|
Subroutine
reverse_trans: called CC=2 SCAR=11.6
Pod
undocumented
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 148 | 0 | ▶ | my $rev = fun($p) { -$p }; | ||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: not called CC=3 SCAR=22.6
Branch: 2 branches
| |||||||||||||||||||||||||||||||||
| 149 | 8 | _trans_new( | |||||||||||||||||||||||||||||||
| 150 | 'reverse', $rev, $rev, | ||||||||||||||||||||||||||||||||
| 151 | minor_breaks => regular_minor_breaks(true), | ||||||||||||||||||||||||||||||||
| 152 | ); | ||||||||||||||||||||||||||||||||
| 153 | 8 | } | |||||||||||||||||||||||||||||||
| 154 | |||||||||||||||||||||||||||||||||
| 155 | # Square-root transformation. | ||||||||||||||||||||||||||||||||
| 156 | 8 | ▶ | fun sqrt_trans() { | ||||||||||||||||||||||||||||||
|
Subroutine
sqrt_trans: called CC=2 SCAR=14.5
Pod
undocumented
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 157 | 0 | ▶ | _trans_new( | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 158 | 'sqrt', | ||||||||||||||||||||||||||||||||
| 159 | 0 | ▶ | fun($p) { $p->sqrt }, | ||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: not called CC=3 SCAR=24.8
Branch: 2 branches
| |||||||||||||||||||||||||||||||||
| 160 | 0 | ▶ | fun($p) { $p ** 2 }, | ||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: not called CC=3 SCAR=21.6
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 161 | domain => pdl([ 0, 'inf' ]) | ||||||||||||||||||||||||||||||||
| 162 | ); | ||||||||||||||||||||||||||||||||
| 163 | 8 | } | |||||||||||||||||||||||||||||||
| 164 | |||||||||||||||||||||||||||||||||
| 165 | 8 | ▶ | fun time_trans ($tz=undef) { | ||||||||||||||||||||||||||||||
|
Subroutine
time_trans: called CC=2 SCAR=7.0
Pod
undocumented
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 166 | 13 | ▶ | state $fix = sub { | ||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=3 SCAR=11.0
| |||||||||||||||||||||||||||||||||
| 167 | 13 | my ($p, $r) = @_; | |||||||||||||||||||||||||||||||
| 168 | 13 | ▶ | if ( $p->$_DOES('PDL::Role::HasNames') ) { | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 169 | 5 | Role::Tiny->apply_roles_to_object( $r, 'PDL::Role::HasNames' ); | |||||||||||||||||||||||||||||||
| 170 | 5 | $r->names( $p->names ); | |||||||||||||||||||||||||||||||
| 171 | } | ||||||||||||||||||||||||||||||||
| 172 | 13 | ▶ | if ($p->badflag) { | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 173 | 3 | $r->setbadif($p->isbad); | |||||||||||||||||||||||||||||||
| 174 | } | ||||||||||||||||||||||||||||||||
| 175 | 13 | return $r; | |||||||||||||||||||||||||||||||
| 176 | 8 | }; | |||||||||||||||||||||||||||||||
| 177 | |||||||||||||||||||||||||||||||||
| 178 | # TODO: we don't yet support timezone | ||||||||||||||||||||||||||||||||
| 179 | 8 | ▶ | my $from_time = fun($p) { | ||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=3 SCAR=11.2
Branch: 2 branches
| |||||||||||||||||||||||||||||||||
| 180 | 8 | my $rslt = pdl( $p->unpdl ); | |||||||||||||||||||||||||||||||
| 181 | 8 | return $fix->($p, $rslt); | |||||||||||||||||||||||||||||||
| 182 | 8 | }; | |||||||||||||||||||||||||||||||
| 183 | 5 | ▶ | my $to_time = fun($p) { | ||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=3 SCAR=11.1
Branch: 2 branches
| |||||||||||||||||||||||||||||||||
| 184 | #TODO: See if there is a better way to do it. | ||||||||||||||||||||||||||||||||
| 185 | my $rslt = | ||||||||||||||||||||||||||||||||
| 186 | 5 | ▶ | PDL::DateTime->new( $p->unpdl->map( sub { $_ eq 'BAD' ? 0 : $_ } ) ); | ||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=2 SCAR=6.9
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 187 | 5 | return $fix->($p, $rslt); | |||||||||||||||||||||||||||||||
| 188 | 8 | }; | |||||||||||||||||||||||||||||||
| 189 | 8 | _trans_new( 'time', $from_time, $to_time, breaks => pretty_breaks() ); | |||||||||||||||||||||||||||||||
| 190 | 8 | } | |||||||||||||||||||||||||||||||
| 191 | |||||||||||||||||||||||||||||||||
| 192 | 8 | for my $trans ( | |||||||||||||||||||||||||||||||
| 193 | asn_trans(), atanh_trans(), | ||||||||||||||||||||||||||||||||
| 194 | identity_trans(), log_trans(), | ||||||||||||||||||||||||||||||||
| 195 | log10_trans(), log2_trans(), | ||||||||||||||||||||||||||||||||
| 196 | log1p_trans(), reciprocal_trans(), | ||||||||||||||||||||||||||||||||
| 197 | reverse_trans(), sqrt_trans(), | ||||||||||||||||||||||||||||||||
| 198 | time_trans(), | ||||||||||||||||||||||||||||||||
| 199 | ) | ||||||||||||||||||||||||||||||||
| 200 | { | ||||||||||||||||||||||||||||||||
| 201 | 88 | _register_trans($trans); | |||||||||||||||||||||||||||||||
| 202 | } | ||||||||||||||||||||||||||||||||
| 203 | |||||||||||||||||||||||||||||||||
| 204 | 8 | 1; | |||||||||||||||||||||||||||||||
| 205 | |||||||||||||||||||||||||||||||||
| 206 | __END__ | ||||||||||||||||||||||||||||||||