pub struct VectorComplexF64 { /* private fields */ }

Implementations§

source§

impl VectorComplexF64

source

pub fn new(size: usize) -> Option<Self>

Create a new VectorComplexF64with all elements set to zero

source

pub fn from_slice(slice: &[ComplexF64]) -> Option<Self>

source

pub fn len(&self) -> usize

source

pub fn is_empty(&self) -> bool

source

pub fn as_slice(&self) -> Option<&[f64]>

source

pub fn as_slice_mut(&mut self) -> Option<&mut [f64]>

source

pub fn get(&self, i: usize) -> ComplexF64

This function returns the i-th element of a vector v. If i lies outside the allowed range of 0 to n-1 then the error handler is invoked and 0 is returned.

source

pub fn set(&mut self, i: usize, x: &ComplexF64) -> &Self

This function sets the value of the i-th element of a vector v to x. If i lies outside the allowed range of 0 to n-1 then the error handler is invoked.

source

pub fn set_all(&mut self, x: &ComplexF64) -> &Self

This function sets all the elements of the vector v to the value x.

source

pub fn set_zero(&mut self) -> &VectorComplexF64

This function sets all the elements of the vector v to zero.

source

pub fn set_basis(&mut self, i: usize) -> &Self

This function makes a basis vector by setting all the elements of the vector v to zero except for the i-th element which is set to one.

source

pub fn copy_from(&mut self, other: &VectorComplexF64) -> Result<(), Value>

This function copies the elements of the other vector into the self vector. The two vectors must have the same length.

source

pub fn copy_to(&self, other: &mut VectorComplexF64) -> Result<(), Value>

This function copies the elements of the self vector into the other vector. The two vectors must have the same length.

source

pub fn swap(&mut self, other: &mut VectorComplexF64) -> Result<(), Value>

This function exchanges the elements of the vectors by copying. The two vectors must have the same length.

source

pub fn swap_elements(&mut self, i: usize, j: usize) -> Result<(), Value>

This function exchanges the i-th and j-th elements of the vector v in-place.

source

pub fn reverse(&mut self) -> Result<(), Value>

This function reverses the order of the elements of the vector v.

source

pub fn add(&mut self, other: &VectorComplexF64) -> Result<(), Value>

This function adds the elements of the other vector to the elements of the self vector. The result a_i <- a_i + b_i is stored in self and other remains unchanged. The two vectors must have the same length.

source

pub fn sub(&mut self, other: &VectorComplexF64) -> Result<(), Value>

This function subtracts the elements of the self vector from the elements of the other vector. The result a_i <- a_i - b_i is stored in self and other remains unchanged. The two vectors must have the same length.

source

pub fn mul(&mut self, other: &VectorComplexF64) -> Result<(), Value>

This function multiplies the elements of the self vector a by the elements of the other vector. The result a_i <- a_i * b_i is stored in self and other remains unchanged. The two vectors must have the same length.

source

pub fn div(&mut self, other: &VectorComplexF64) -> Result<(), Value>

This function divides the elements of the self vector by the elements of the other vector. The result a_i <- a_i / b_i is stored in self and other remains unchanged. The two vectors must have the same length.

source

pub fn scale(&mut self, x: &ComplexF64) -> Result<(), Value>

This function multiplies the elements of the self vector by the constant factor x. The result a_i <- a_i is stored in self.

source

pub fn add_constant(&mut self, x: &ComplexF64) -> Result<(), Value>

This function adds the constant value x to the elements of the self vector. The result a_i <- a_i + x is stored in self.

source

pub fn is_null(&self) -> bool

This function returns true if all the elements of the self vector are equal to 0.

source

pub fn is_pos(&self) -> bool

This function returns true if all the elements of the self vector are stricly positive.

source

pub fn is_neg(&self) -> bool

This function returns true if all the elements of the self vector are stricly negative.

source

pub fn is_non_neg(&self) -> bool

This function returns true if all the elements of the self vector are stricly non-negative.

source

pub fn equal(&self, other: &VectorComplexF64) -> bool

source

pub fn clone(&self) -> Option<Self>

Trait Implementations§

source§

impl Debug for VectorComplexF64

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Drop for VectorComplexF64

source§

fn drop(&mut self)

Executes the destructor for this type. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.