NAME
Math::DifferenceSet::Planar::Data - storage of sample planar difference sets
VERSION
This documentation refers to version 0.002 of Math::DifferenceSet::Planar::Data.
SYNOPSIS
use Math::DifferenceSet::Planar::Data;
$data = Math::DifferenceSet::Planar->new;
$data = Math::DifferenceSet::Planar->new('pds.db');
$data = Math::DifferenceSet::Planar->new($full_path);
@databases = Math::DifferenceSet::Planar->list_databases;
$data = Math::DifferenceSet::Planar->new($databases[0]);
$pds = $data->get(9);
@columns = qw(base exponent modulus n_planes);
$pds = $data->get(9, @columns);
$it = $data->iterate($min, $max);
while (my $pds = $it->()) {
# ...
}
$max = $data->max_order;
$count = $data->count;
DESCRIPTION
Math::DifferenceSet::Planar::Data is a class giving access to a local database of sample planar difference sets, hiding its implementation details. It is used internally by Math::DifferenceSet::Planar to populate difference set objects.
CLASS VARIABLE
CLASS METHODS
- new
-
Math::DifferenceSet::Planar::Data->new
creates a handle for access to a database of difference set samples. Without parameter, it finds a suitable database in the distribution-specific share directory. With a filename parameter, it tries to open that particular database. Relative filenames are resolved relative to the share directory. On success, it returns the handle. On failure, it raises an exception. - list_databases
-
Math::DifferenceSet::Planar::Data->list_databases
returns a list of filenames currently suitable as arguments for new on your platform.
OBJECT METHODS
- get
-
If
$data
is a Math::DifferenceSet::Planar::Data object,$data->get($order)
fetches a single record from the database with order$order
. If the database has no record of that order, a false value is returned, otherwise an object of type Math::DifferenceSet::Planar::Schema::Result::DifferenceSet.$data->get($order, @columns)
does the same, but returns a partial record with only the columns that are specified. This is particularly efficient if the deltas column is not needed. - iterate
-
If
$data
is a Math::DifferenceSet::Planar::Data object,$data->iterate
returns a code reference that, repeatedly called, returns all sample planar difference set records in the database, one by one. The iterator returns a false value when it is exhausted.$data->iterate($lo, $hi)
returns an iterator over all samples with orders between $lo and $hi (inclusively), ordered by ascending size. If$lo
is not defined, it is taken as zero. If$hi
is omitted or not defined, it is taken as plus infinity. If$lo
is greater than$hi
, they are swapped and the sequence is reversed, so that it is ordered by descending size. - max_order
-
If
$data
is a Math::DifferenceSet::Planar::Data object,$data->max_order
returns the order of the largest sample planar difference set in the database. - count
-
If
$data
is a Math::DifferenceSet::Planar::Data object,$data->count
returns the number of sample planar difference sets in the database.
DIAGNOSTICS
Most methods of this module do not generate diagnostic output nor raise any exceptions.
The new constructor, however, will fail with an exception if the database specified by the optional filename argument or by default is missing or broken.
- bad database: <reason>
-
The database could not be accessed. Diagnostics from underlying libraries such as DBI or File::Share are added, if present.
BUGS AND LIMITATIONS
Bug reports and suggestions are welcome. See the main module on how to contribute.
SEE ALSO
Math::DifferenceSet::Planar - the main module of this library.
Math::DifferenceSet::Planar::Schema::Result::DifferenceSet - the result type for queries.
File::Spec - file name parsing.
AUTHOR
Martin Becker, <becker-cpan-mp at cozap.com>
COPYRIGHT AND LICENSE
Copyright (c) 2019 by Martin Becker, Blaubeuren. All rights reserved.
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.10.0 or, at your option, any later version of Perl 5 you may have available.
DISCLAIMER OF WARRANTY
This library is distributed in the hope that it will be useful, but without any warranty; without even the implied warranty of merchantability or fitness for a particular purpose.