vector Interface

public interface vector

Construct a vector object

The following code snippet shows all of the valid ways to construct a new vector

type(vector) :: v1, v2, v3, v4, v5, v6, v7, v8

v1 = vector([1, 2, 3])
v2 = vector([1.0, 2.0, 3.0])
v3 = vector([1.0d0, 2.0d0, 3.0d0])
v4 = vector(4) ! [0, 0, 0, 0]
v5 = vector(5, 3) ! [3, 3, 3, 3, 3]
v6 = vector(2, 2.0) ! [2, 2]
v7 = vector(val=4.7d0, dim=3) ! [4.7, 4.7, 4.7]
v8 = vector(v7)

Contents


Module Procedures

private pure function vector_constructor_int(array) result(this)

Construct a vector from an array of integers

Arguments

Type IntentOptional AttributesName
integer, intent(in), dimension(:):: array

input data

Return Value type(vector)

private pure function vector_constructor_r32(array) result(this)

Construct a vector from an array of single precision reals

Arguments

Type IntentOptional AttributesName
real(kind=real32), intent(in), dimension(:):: array

input data

Return Value type(vector)

private pure function vector_constructor_r64(array) result(this)

Construct a vector from an array of double precision reals

Arguments

Type IntentOptional AttributesName
real(kind=real64), intent(in), dimension(:):: array

input data

Return Value type(vector)

private elemental function vector_constructor_dim(dim) result(this)

Construct a vector by declaring its size Allocate an -dimensional vector and fill its values with 0

Arguments

Type IntentOptional AttributesName
integer, intent(in) :: dim

Return Value type(vector)

private elemental function vector_constructor_dim_value_int(dim, val) result(this)

Construct a vector of dimension and fill its values with integer

Arguments

Type IntentOptional AttributesName
integer, intent(in) :: dim

integer, intent(in) :: val

Return Value type(vector)

private elemental function vector_constructor_dim_value_r32(dim, val) result(this)

Construct a vector of dimension and fill its values with single precision real

Arguments

Type IntentOptional AttributesName
integer, intent(in) :: dim

real(kind=real32), intent(in) :: val

Return Value type(vector)

private elemental function vector_constructor_dim_value_r64(dim, val) result(this)

Construct a vector of dimension and fill its values with double precision real

Arguments

Type IntentOptional AttributesName
integer, intent(in) :: dim

real(kind=real64), intent(in) :: val

Return Value type(vector)

private elemental function vector_constructor_vector(v1) result(v2)

Construct a vector from another vector

Read more…

Arguments

Type IntentOptional AttributesName
class(vector), intent(in) :: v1

Return Value type(vector)