NAME
Chemistry::Ring::Find
SYNOPSIS
use Chemistry::Ring::Find ':all';
# find the smallest ring containing $atom
my $ring = find_ring($atom);
# find all the rings containing $bond
my @rings = find_ring($bond, all => 1);
# see below for more options
DESCRIPTION
This module implements a simple breadth-first ring finding algorithm. It does not find all the rings in the structure; it only finds the rings that include a starting atom or bond. Future versions may find all the rings in the molecule, or perhaps the Smallest Set of Smallest Rings.
FUNCTIONS
These functions may be exported explicitly, or all by using the :all tag, but nothing is exported by default.
- find_ring($origin, %opts)
-
Find the smallest ring containg $origin, which may be either an atom or a bond. Returns a Chemistry::Ring object. Options:
- all
-
If true, find all the rings containing $origin. If false, return the first ring found. Defaults to false.
- min
-
Only find rings with a the given minimum size. Defaults to zero.
- max
-
Only find rings up to the given maximium size. Defaults to unlimited size.
- size
-
Only find rings with this size. Same as setting min and max to the same size. Default: unspecified.
- exclude
-
An array reference containing a list of atoms that must NOT be present in the ring. Defaults to the empty list.
- mirror
-
If true, find each ring twice (forwards and backwards). Defaults to false.
SEE ALSO
Chemistry::Ring, Chemistry::Mol, Chemistry::Atom, Chemistry::Bond Math::VectorReal.
AUTHOR
Ivan Tubert <itub@cpan.org>
COPYRIGHT
Copyright (c) 2004 Ivan Tubert. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.