madM has asked for the wisdom of the Perl Monks concerning the following question:
any ideas?my %data = ( A => { A => 5, R => -2, N => -1 }, R => { A => -2, R => 7, N => -1 }, N => { A => -1, R => -1, N => 7 }, );
my @aminos= qw(A R N D C Q E G H I L K M F P S T W Y V B Z X); sub multiplyRates { my $M1= @_ ; foreach my $key1 (@aminos) { foreach my $key2 (@aminos) { my $prod; foreach my $key (@aminos) { $prod += $M1->{$key1}->{$key} * $M1->{$key}->{$key2}; } $multiplyrate->{$key1}->{$key2} = $prod; } $multiplyrate1->{$key1} = $newMutationmatrix1->{$key1}; } return \%$multiplyrate; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Multiplying matrices
by moritz (Cardinal) on Mar 10, 2014 at 10:28 UTC | |
|
Re: Multiplying matrices
by zentara (Cardinal) on Mar 10, 2014 at 10:00 UTC | |
by Ea (Chaplain) on Mar 11, 2014 at 10:51 UTC | |
by etj (Priest) on May 20, 2022 at 15:41 UTC | |
|
Re: Multiplying matrices
by Bloodnok (Vicar) on Mar 10, 2014 at 12:44 UTC | |
|
Re: Multiplying matrices
by Lennotoecom (Pilgrim) on Mar 10, 2014 at 14:58 UTC |