.\" -*- mode: troff; coding: utf-8 -*- .\" Automatically generated by Pod::Man 5.01 (Pod::Simple 3.43) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>. .ie n \{\ . ds C` "" . ds C' "" 'br\} .el\{\ . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "Set::Infinite::Arithmetic 3" .TH Set::Infinite::Arithmetic 3 2024-07-13 "perl v5.38.2" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SS NAME .IX Subsection "NAME" Set::Infinite::Arithmetic \- Scalar operations used by \fBquantize()\fR and \fBoffset()\fR .SS AUTHOR .IX Subsection "AUTHOR" Flavio Soibelmann Glock \- fglock@pucrs.br .ie n .SS "%_MODE hash of subs" .el .SS "\f(CW%_MODE\fP hash of subs" .IX Subsection "%_MODE hash of subs" .Vb 1 \& $a\->offset ( value => [1,2], mode => \*(Aqoffset\*(Aq, unit => \*(Aqdays\*(Aq ); \& \& $a\->offset ( value => [1,2, \-5,\-4], mode => \*(Aqoffset\*(Aq, unit => \*(Aqdays\*(Aq ); .Ve .PP note: if mode = circle, then "\-5" counts from end (like a Perl negative array index). .PP .Vb 1 \& $a\->offset ( value => [1,2], mode => \*(Aqoffset\*(Aq, unit => \*(Aqdays\*(Aq, strict => $a ); .Ve .PP option 'strict' will return intersection($a,offset). Default: none. .ie n .SS "%subs_offset2($object, $offset1, $offset2)" .el .SS "\f(CW%subs_offset\fP2($object, \f(CW$offset1\fP, \f(CW$offset2\fP)" .IX Subsection "%subs_offset2($object, $offset1, $offset2)" .Vb 1 \& &{ $subs_offset2{$unit} } ($object, $offset1, $offset2); .Ve .PP A hash of functions that return: .PP .Vb 1 \& ($object+$offset1, $object+$offset2) .Ve .PP in \f(CW$unit\fR context. .PP Returned \f(CW$object\fR+$offset1, \f(CW$object\fR+$offset2 may be scalars or objects. .ie n .SS "%Offset_to_value($object, $offset)" .el .SS "\f(CW%Offset_to_valu\fPe($object, \f(CW$offset\fP)" .IX Subsection "%Offset_to_value($object, $offset)" .ie n .SS %Init_quantizer($object) .el .SS \f(CW%Init_quantize\fPr($object) .IX Subsection "%Init_quantizer($object)" .Vb 1 \& $Offset_to_value{$unit} ($object, $offset); \& \& $Init_quantizer{$unit} ($object); .Ve .PP Maps an 'offset value' to a 'value' .PP A hash of functions that return ( int($object) + \f(CW$offset\fR ) in \f(CW$unit\fR context. .PP Init_quantizer subroutines must be called before using subs_offset1 functions. .PP int(object)+offset is a scalar. .PP Offset_to_value is optimized for calling it multiple times on the same object, with different offsets. That's why there is a separate initialization subroutine. .PP \&\f(CW$self\fR\->{offset} is created on initialization. It is an index used by the memoization cache.