.\" -*- mode: troff; coding: utf-8 -*- .\" Automatically generated by Pod::Man 5.01 (Pod::Simple 3.43) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>. .ie n \{\ . ds C` "" . ds C' "" 'br\} .el\{\ . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "Math::GSL::VectorComplex 3pm" .TH Math::GSL::VectorComplex 3pm 2024-03-07 "perl v5.38.2" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH NAME Math::GSL::VectorComplex \- Complex Vectors .SH SYNOPSIS .IX Header "SYNOPSIS" .Vb 5 \& use Math::GSL::VectorComplex qw/:all/; \& my $vec1 = Math::GSL::VectorComplex\->new([1 + 2*i, 7*i, 5, \-3 ]); \& my $vec2 = $vec1 * 5; \& my $vec3 = Math::GSL::Vector>new(10); # 10 element zero vector \& my $vec4 = $vec1 + $vec2; \& \& # set the element at index 1 to \-i \& # and the element at index 3 to i \& $vec3\->set([ 1, \-i ], [ 9, i ]); \& \& my @vec = $vec2\->as_list; # return elements as Perl list \& \& my $dot_product = $vec1 * $vec2; \& my $length = $vec2\->length; \& my $first = $vec1\->get(0); .Ve .SH "Objected Oriented Interface to GSL Math::GSL::VectorComplex" .IX Header "Objected Oriented Interface to GSL Math::GSL::VectorComplex" .SS \fBnew()\fP .IX Subsection "new()" Creates a new Vector of the given size. .PP .Vb 1 \& my $vector = Math::GSL::VectorComplex\->new(3); .Ve .PP You can also create and set directly the values of the vector like this : .PP .Vb 1 \& my $vector = Math::GSL::VectorComplex\->new([2,4,1]); .Ve .SS \fBraw()\fP .IX Subsection "raw()" Get the underlying GSL vector object created by SWIG, useful for using gsl_vector_* functions which do not have an OO counterpart. .PP .Vb 3 \& my $vector = Math::GSL::VectorComplex\->new(3); \& my $gsl_vector = $vector\->raw; \& my $stuff = gsl_vector_get($gsl_vector, 1); .Ve .SS \fBmin()\fP .IX Subsection "min()" Returns the minimum value contained in the vector. .PP .Vb 2 \& my $vector = Math::GSL::VectorComplex\->new([2,4,1]); \& my $minimum = $vector\->min; .Ve .SS \fBmax()\fP .IX Subsection "max()" Returns the minimum value contained in the vector. .PP .Vb 2 \& my $vector = Math::GSL::VectorComplex\->new([2,4,1]); \& my $maximum = $vector\->max; .Ve .SS \fBlength()\fP .IX Subsection "length()" Returns the number of elements contained in the vector. .PP .Vb 2 \& my $vector = Math::GSL::VectorComplex\->new([2,4,1]); \& my $length = $vector\->length; .Ve .SS \fBas_list()\fP .IX Subsection "as_list()" Gets the content of a Math::GSL::Vector object as a Perl list. .PP .Vb 3 \& my $vector = Math::GSL::VectorComplex\->new(3); \& ... \& my @values = $vector\->as_list; .Ve .SS \fBget()\fP .IX Subsection "get()" Gets the value of an of a Math::GSL::Vector object. .PP .Vb 3 \& my $vector = Math::GSL::VectorComplex\->new(3); \& ... \& my @values = $vector\->get(2); .Ve .PP You can also enter an array of indices to receive their corresponding values: .PP .Vb 3 \& my $vector = Math::GSL::VectorComplex\->new(3); \& ... \& my @values = $vector\->get([0,2]); .Ve .SS \fBreverse()\fP .IX Subsection "reverse()" Returns the a vector with the elements in reversed order. .PP .Vb 3 \& use Math::Complex; \& my $v1 = Math::GSL::VectorComplex\->new([ 1, 2, 3*i]); \& my $v2 = $v1\->reverse; .Ve .SS \fBset()\fP .IX Subsection "set()" Sets values of an of a Math::GSL::Vector object. .PP .Vb 2 \& my $vector = Math::GSL::VectorComplex\->new(3); \& $vector\->set([1,2], [8,23]); .Ve .PP This sets the second and third value to 8 and 23. .SS \fBcopy()\fP .IX Subsection "copy()" Returns a copy of the vector, which has the same length and values but resides at a different location in memory. .PP .Vb 2 \& my $vector = Math::GSL::VectorComplex\->new([10 .. 20]); \& my $copy = $vector\->copy; .Ve .SS \fBswap()\fP .IX Subsection "swap()" Exchanges the values in the vectors \f(CW$v\fR with \f(CW$w\fR by copying. .PP .Vb 3 \& my $v = Math::GSL::VectorComplex\->new([1..5]); \& my $w = Math::GSL::VectorComplex\->new([3..7]); \& $v\->swap( $w ); .Ve .SH AUTHORS .IX Header "AUTHORS" Jonathan "Duke" Leto and Thierry Moisan .SH "COPYRIGHT AND LICENSE" .IX Header "COPYRIGHT AND LICENSE" Copyright (C) 2008\-2023 Jonathan "Duke" Leto and Thierry Moisan .PP This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.