NAME

Math::DifferenceSet::Planar::Data - storage of sample planar difference sets

VERSION

This documentation refers to version 0.014 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::Data->list_databases;
$data = Math::DifferenceSet::Planar::Data->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->()) {
  # ...
}

$min   = $data->min_order;
$max   = $data->max_order;
$count = $data->count;
$path  = $data->path;

$space = $data->get_space(9);
$min   = $data->sp_min_order;
$max   = $data->sp_max_order;
$count = $data->sp_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 VARIABLES

$VERSION

$VERSION is the version number of the module.

$DATABASE_DIR

$DATABASE_DIR is the directory containing databases for this module. It is initialized automatically to refer to the location where its data has been installed. It may be set to another absolute path before calling new.

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 and thus the elements accessor are 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.

iterate_properties

If $data is a Math::DifferenceSet::Planar::Data object, $data->iterate_properties(@args) behaves exactly like $data->iterate(@args), except that the result records have no deltas component and thus no access to elements. Using this method to browse difference set properties is more efficient than fetching complete records.

min_order

If $data is a Math::DifferenceSet::Planar::Data object, $data->min_order returns the order of the smallest sample planar difference set in the database.

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.

path

If $data is a Math::DifferenceSet::Planar::Data object, $data->path returns the full path name of the database.

get_space

If $data is a Math::DifferenceSet::Planar::Data object, $data->get_space($order) fetches a difference set space record from the database with order $order. If the database has no space record of that order, a false value is returned, otherwise an object of type Math::DifferenceSet::Planar::Schema::Result::DifferenceSetSpace.

Databases may contain more or less spaces than difference sets or even none at all. Spaces speed up enumerating difference set planes but are not depended on in the rest of the library.

iterate_spaces

If $data is a Math::DifferenceSet::Planar::Data object, $data->iterate_spaces returns a code reference that, repeatedly called, returns all planar difference set space 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 spaces 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.

sp_min_order

If $data is a Math::DifferenceSet::Planar::Data object, $data->sp_min_order returns the order of the smallest planar difference set space in the database, or undef if no spaces are stored.

sp_max_order

If $data is a Math::DifferenceSet::Planar::Data object, $data->sp_max_order returns the order of the largest planar difference set space in the database, or zero if no spaces are stored.

sp_count

If $data is a Math::DifferenceSet::Planar::Data object, $data->sp_count returns the number of planar difference set spaces in the database. This may be greater or less than the number of sample planar difference sets or even zero.

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

AUTHOR

Martin Becker, <becker-cpan-mp at cozap.com>

COPYRIGHT AND LICENSE

Copyright (c) 2019-2021 by Martin Becker, Blaubeuren.

This library is free software; you can distribute it and/or modify it under the terms of the Artistic License 2.0 (see the LICENSE file).

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.