| 1 | package Math::DifferenceSet::Planar::Schema::Result::DifferenceSet; | ||||||||||
| 2 | |||||||||||
| 3 | =head1 NAME | ||||||||||
| 4 | |||||||||||
| 5 | Math::DifferenceSet::Planar::Schema::Result::DifferenceSet - | ||||||||||
| 6 | planar difference set database backend result class definition. | ||||||||||
| 7 | |||||||||||
| 8 | =cut | ||||||||||
| 9 | |||||||||||
| 10 | 6 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 11 | 6 | ▶ | use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 12 | |||||||||||
| 13 | 6 | ▶ | use base 'DBIx::Class::Core'; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 14 | |||||||||||
| 15 | =head1 VERSION | ||||||||||
| 16 | |||||||||||
| 17 | This documentation refers to version 0.018 of | ||||||||||
| 18 | Math::DifferenceSet::Planar::Schema::Result::DifferenceSet. | ||||||||||
| 19 | |||||||||||
| 20 | =cut | ||||||||||
| 21 | |||||||||||
| 22 | 6 | our $VERSION = '0.018'; | |||||||||
| 23 | |||||||||||
| 24 | =head1 TABLE: C<difference_set> | ||||||||||
| 25 | |||||||||||
| 26 | =cut | ||||||||||
| 27 | |||||||||||
| 28 | 6 | __PACKAGE__->table("difference_set"); | |||||||||
| 29 | |||||||||||
| 30 | =head1 ACCESSORS | ||||||||||
| 31 | |||||||||||
| 32 | =head2 order | ||||||||||
| 33 | |||||||||||
| 34 | data_type: 'integer' | ||||||||||
| 35 | is_nullable: 0 | ||||||||||
| 36 | |||||||||||
| 37 | =head2 base | ||||||||||
| 38 | |||||||||||
| 39 | data_type: 'integer' | ||||||||||
| 40 | is_nullable: 0 | ||||||||||
| 41 | |||||||||||
| 42 | =head2 exponent | ||||||||||
| 43 | |||||||||||
| 44 | data_type: 'integer' | ||||||||||
| 45 | is_nullable: 0 | ||||||||||
| 46 | |||||||||||
| 47 | =head2 modulus | ||||||||||
| 48 | |||||||||||
| 49 | data_type: 'integer' | ||||||||||
| 50 | is_nullable: 0 | ||||||||||
| 51 | |||||||||||
| 52 | =head2 n_planes | ||||||||||
| 53 | |||||||||||
| 54 | data_type: 'integer' | ||||||||||
| 55 | is_nullable: 0 | ||||||||||
| 56 | |||||||||||
| 57 | =head2 deltas | ||||||||||
| 58 | |||||||||||
| 59 | data_type: 'blob' | ||||||||||
| 60 | is_nullable: 0 | ||||||||||
| 61 | |||||||||||
| 62 | =cut | ||||||||||
| 63 | |||||||||||
| 64 | 6 | __PACKAGE__->add_columns( | |||||||||
| 65 | "order_", | ||||||||||
| 66 | { accessor => "order", data_type => "integer", is_nullable => 0 }, | ||||||||||
| 67 | "base", | ||||||||||
| 68 | { data_type => "integer", is_nullable => 0 }, | ||||||||||
| 69 | "exponent", | ||||||||||
| 70 | { data_type => "integer", is_nullable => 0 }, | ||||||||||
| 71 | "modulus", | ||||||||||
| 72 | { data_type => "integer", is_nullable => 0 }, | ||||||||||
| 73 | "n_planes", | ||||||||||
| 74 | { data_type => "integer", is_nullable => 0 }, | ||||||||||
| 75 | "deltas", | ||||||||||
| 76 | { data_type => "blob", is_nullable => 0 }, | ||||||||||
| 77 | ); | ||||||||||
| 78 | |||||||||||
| 79 | =head2 elements | ||||||||||
| 80 | |||||||||||
| 81 | I<elements> is a wrapper for I<deltas> generating an array of elements | ||||||||||
| 82 | values from the deltas raw data. It returns an array reference if | ||||||||||
| 83 | deltas is defined, otherwise undef. | ||||||||||
| 84 | |||||||||||
| 85 | Unpacking deltas raw data into elements is part of the resultset API, | ||||||||||
| 86 | as different implementations may employ different packing mechanisms. | ||||||||||
| 87 | |||||||||||
| 88 | =cut | ||||||||||
| 89 | |||||||||||
| 90 | sub elements { | ||||||||||
| 91 | 62 | ▶ | my ($this) = @_; | ||||||||
|
Subroutine
elements: called CC=2 SCAR=6.9
Pod
documented
| |||||||||||
| 92 | 62 | my $deltas = $this->deltas; | |||||||||
| 93 | 62 | ▶ | return undef if !defined $deltas; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 94 | 61 | my $sum = 0; | |||||||||
| 95 | 61 | my @elements = map { $sum += $_ } 0, 1, unpack 'w*', $deltas; | |||||||||
| 96 | 61 | return \@elements; | |||||||||
| 97 | } | ||||||||||
| 98 | |||||||||||
| 99 | =head1 PRIMARY KEY | ||||||||||
| 100 | |||||||||||
| 101 | =over 4 | ||||||||||
| 102 | |||||||||||
| 103 | =item * L</order> | ||||||||||
| 104 | |||||||||||
| 105 | =back | ||||||||||
| 106 | |||||||||||
| 107 | =cut | ||||||||||
| 108 | |||||||||||
| 109 | 6 | __PACKAGE__->set_primary_key("order_"); | |||||||||
| 110 | |||||||||||
| 111 | 6 | 1; | |||||||||
| 112 | |||||||||||
| 113 | =head1 SEE ALSO | ||||||||||
| 114 | |||||||||||
| 115 | =over 4 | ||||||||||
| 116 | |||||||||||
| 117 | =item * | ||||||||||
| 118 | |||||||||||
| 119 | L<Math::DifferenceSet::Planar::Schema> - schema class. | ||||||||||
| 120 | |||||||||||
| 121 | =back | ||||||||||
| 122 | |||||||||||
| 123 | =head1 AUTHOR | ||||||||||
| 124 | |||||||||||
| 125 | Martin Becker, E<lt>becker-cpan-mp I<at> cozap.comE<gt> | ||||||||||
| 126 | |||||||||||
| 127 | =head1 COPYRIGHT AND LICENSE | ||||||||||
| 128 | |||||||||||
| 129 | Copyright (c) 2019-2022 by Martin Becker, Blaubeuren. | ||||||||||
| 130 | |||||||||||
| 131 | This library is free software; you can distribute it and/or modify it | ||||||||||
| 132 | under the terms of the Artistic License 2.0 (see the LICENSE file). | ||||||||||
| 133 | |||||||||||
| 134 | =head1 DISCLAIMER OF WARRANTY | ||||||||||
| 135 | |||||||||||
| 136 | This library is distributed in the hope that it will be useful, but | ||||||||||
| 137 | without any warranty; without even the implied warranty of merchantability | ||||||||||
| 138 | or fitness for a particular purpose. | ||||||||||
| 139 | |||||||||||
| 140 | =cut | ||||||||||