Chemistry-Ring

 view release on metacpan or  search on metacpan

lib/Chemistry/Ring.pm  view on Meta::CPAN

This module is part of the PerlMol project, L<http://www.perlmol.org/>.

=cut

use strict;
use warnings;
use Math::VectorReal qw(:axis vector);
use Statistics::Regression;
use Chemistry::Mol;
use base 'Chemistry::Mol', 'Exporter';
use Scalar::Util 'weaken';

our @EXPORT_OK = qw(aromatize_mol);
our %EXPORT_TAGS = ( all => \@EXPORT_OK ); 

our $N = 0;
our $DEBUG = 0;

=head1 METHODS

=over 4

lib/Chemistry/Ring.pm  view on Meta::CPAN

    $mol->attr("ring/rings", \@rings);
    $_->attr("ring/rings", []) for ($mol->atoms, $mol->bonds);

    for my $ring (@rings) {
        if ($ring->is_aromatic) {
            $_->aromatic(1) for ($ring->atoms, $ring->bonds);
        }
        for ($ring->atoms, $ring->bonds) {
            my $ringlist = $_->attr("ring/rings") || [];
            push @$ringlist, $ring;
            weaken($ringlist->[-1]);
            $_->attr("ring/rings", $ringlist);
        }
    }
    @rings;
}

1;

=back



( run in 1.126 second using v1.01-cache-2.11-cpan-65fba6d93b7 )