Math::Vector::Real::Random - Generate random real vectors
use Math::Vector::Real qw(V); use Math::Vector::Real::Random; my $v = Math::Vector::Real->random_normal(7); my $v2 = $c->random_normal;
This module extends the Math::Vector::Real package adding some methods for random generation of vectors.
The extra methods are:
When called as a class method, returns a random vector of dimension $dim contained inside the hypercube of the given size.
$dim
When called as an instance method, returns a random vector contained in the box defined by the given vector instance.
Returns random vector inside the hyper-sphere of the given dimension and radio.
Returns a randon vector of norm 1.0.
Returns a random vector in the space of the given dimension, where each component follows a normal distribution with standard deviation $sd (defaults to 1.0).
$sd
Math::Vector::Real, Math::Random.
Salvador Fandino, <salva@>, David Serrano.
Copyright (C) 2011, 2013 by Salvador Fandiño
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.12.3 or, at your option, any later version of Perl 5 you may have available.
To install Math::Vector::Real::Random, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Math::Vector::Real::Random
CPAN shell
perl -MCPAN -e shell install Math::Vector::Real::Random
For more information on module installation, please visit the detailed CPAN module installation guide.