Math::DifferenceSet::Planar::Data - storage of sample planar difference sets
This documentation refers to version 1.001 of Math::DifferenceSet::Planar::Data.
use Math::DifferenceSet::Planar::Data; $data = Math::DifferenceSet::Planar::Data->new; $data = Math::DifferenceSet::Planar::Data->new('pds.db'); $data = Math::DifferenceSet::Planar::Data->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; $it = $data->iterate_refs('ref_std', $min, $max); while (my $pds = $it->()) { # ... } $min = $data->ref_min_order('ref_std'); $max = $data->ref_max_order('ref_lex'); $count = $data->ref_count('ref_gap'); $space = $data->get_space(9); $min = $data->sp_min_order; $max = $data->sp_max_order; $count = $data->sp_count; ($major, $minor) = $data->get_version; ($major, $minor) = $data->get_space_version;
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.
$VERSION is the version number of the module.
$VERSION
$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.
$DATABASE_DIR
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.
Math::DifferenceSet::Planar::Data->new
Math::DifferenceSet::Planar::Data->list_databases returns a list of filenames currently suitable as arguments for new on your platform.
Math::DifferenceSet::Planar::Data->list_databases
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
$data->get($order)
$order
$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 delta_main column and thus the main_elements accessor are not needed.
$data->get($order, @columns)
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
$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.
$data->iterate($lo, $hi)
$lo
$hi
If $data is a Math::DifferenceSet::Planar::Data object, $data->iterate_properties(@minmax) behaves exactly like $data->iterate(@minmax), except that the result records have no delta_main component and thus no access to elements. Using this method to browse difference set properties is more efficient than fetching complete records.
$data->iterate_properties(@minmax)
$data->iterate(@minmax)
With additional arguments after the minimum and maximum order, these arguments are taken as names of components to fetch, so that the resulting records can be even more tailored to what is needed. Minimum and maximum order can not be omitted in that case, but may be undef.
undef
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.
$data->min_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.
$data->max_order
If $data is a Math::DifferenceSet::Planar::Data object, $data->count returns the number of sample planar difference sets in the database.
$data->count
If $data is a Math::DifferenceSet::Planar::Data object, $data->path returns the full path name of the database.
$data->path
If $data is a Math::DifferenceSet::Planar::Data object, $data->iterate_refs($type) with $type one of 'ref_std', 'ref_lex', or 'ref_gap', returns a code reference that, repeatedly called, returns all reference planar difference set records of the givent type in the database. The iterator returns a false value when it is exhausted.
$data->iterate_refs($type)
$type
'ref_std'
'ref_lex'
'ref_gap'
Optional arguments after the type argument are minimum and maximum order values in like the optional arguments of iterate.
This method takes a type argument like iterate_refs and returns the smallest order of available reference sets of that kind, or undef if none are available.
This method takes a type argument like iterate_refs and returns the largest order of available reference sets of that kind, or undef if none are available.
This method takes a type argument like iterate_refs and returns the number of available reference sets of that kind.
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.
$data->get_space($order)
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.
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_spaces
$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.
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.
$data->sp_min_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 undef if no spaces are stored.
$data->sp_max_order
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.
$data->sp_count
If $data is a Math::DifferenceSet::Planar::Data object, $data->get_version returns a pair of numbers matching the planar difference set collection major and minor version reported in the database. Missing version information is treated as major = minor = 0.
$data->get_version
If $data is a Math::DifferenceSet::Planar::Data object, $data->get_space_version returns a pair of numbers matching the planar difference set spaces collection major and minor version reported in the database. Missing version information is treated as major = minor = 0.
$data->get_space_version
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.
The database could not be accessed. Diagnostics from underlying libraries such as DBI or File::Share are added, if present.
Bug reports and suggestions are welcome. See the main module on how to contribute.
Math::DifferenceSet::Planar - the main module of this library.
Math::DifferenceSet::Planar::Schema::Result::DifferenceSet - the result type for set queries.
Math::DifferenceSet::Planar::Schema::Result::DifferenceSetSpace - the result type for space queries.
File::Spec - file name parsing.
Martin Becker, <becker-cpan-mp at cozap.com>
Copyright (c) 2019-2023 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).
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.
To install Math::DifferenceSet::Planar, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Math::DifferenceSet::Planar
CPAN shell
perl -MCPAN -e shell install Math::DifferenceSet::Planar
For more information on module installation, please visit the detailed CPAN module installation guide.