Construct a vector object
Construct a vector from an array of integers
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer, | intent(in), | dimension(:) | :: | array | input data |
Construct a vector from an array of single precision reals
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=real32), | intent(in), | dimension(:) | :: | array | input data |
Construct a vector from an array of double precision reals
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=real64), | intent(in), | dimension(:) | :: | array | input data |
Construct a vector by declaring its size Allocate an -dimensional vector and fill its values with 0
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer, | intent(in) | :: | dim |
|
Construct a vector of dimension and fill its values with integer
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer, | intent(in) | :: | dim |
|
||
| integer, | intent(in) | :: | val |
|
Construct a vector of dimension and fill its values with single precision real
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer, | intent(in) | :: | dim |
|
||
| real(kind=real32), | intent(in) | :: | val |
|
Construct a vector of dimension and fill its values with double precision real
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer, | intent(in) | :: | dim |
|
||
| real(kind=real64), | intent(in) | :: | val |
|
Construct a vector from another vector
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(vector), | intent(in) | :: | v1 |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(vector), | intent(inout) | :: | self |
Return the number of elements of the currently allocated vector
Return the number of elements allocated for
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(vector), | intent(in) | :: | self |
|
Deallocate the data, set dim to 0
Deallocate a vector if it is allocated, set the dimension equal to 0
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(vector), | intent(inout) | :: | self |
|
Print diagnostic information about the vector
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(vector), | intent(in) | :: | self |
Print only the data stored in the vector object as a row vector
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(vector), | intent(in) | :: | self |
Return the element
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(vector), | intent(in) | :: | self | |||
| integer, | intent(in) | :: | index |
Set the value of the element at index
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(vector), | intent(inout) | :: | self | |||
| integer, | intent(in) | :: | index | |||
| integer, | intent(in) | :: | val |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(vector), | intent(inout) | :: | self | |||
| integer, | intent(in) | :: | index | |||
| real(kind=real32), | intent(in) | :: | val |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(vector), | intent(inout) | :: | self | |||
| integer, | intent(in) | :: | index | |||
| real(kind=real64), | intent(in) | :: | val |
Calculate the euclidean norm of a vector
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(vector), | intent(in) | :: | self |
Calculate the pnorm of a vector
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(vector), | intent(in) | :: | self | |||
| integer, | intent(in) | :: | p |
Normalize the elements of the passed vector Normalize is a subroutine such that it alters the elements of the passed vector to avoid costs of copying involved with a function
Normalize a vector such that its euclidian norm is 1
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(vector), | intent(inout) | :: | self |
Return a normalized vector pointing in the same direction as
The function normalized is a function such that it returns a normalized version of the passed vector
Orthogonalize a vector against a passed normalized vector
A future version may just check if the passed vector is normalized by testing a "normalized" logical type that will be stored in a vector.
Return a vector that is orthogonalized against a passed normalized vector
This is a function that returns a new vector
Orthogonalize and normalize a vector against a passed normalized vector
This is a subroutine that modifies the passed vector
Return an orthogonalized and normalized vector against a passed normalized vector
This is a function that returns a new vector
Rotate a passed vector about the hyper plane described by the passed normalized vector
This is a subroutine that modifies the passed vector
Construct a vector that is equal to the th column of the Identity matrix The and parameters are both optional. If the parameter is absent, then take the th column from the identity matrix whose dimension is . If the parameter is missing, set its default value to the dimension.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(vector), | intent(in) | :: | self |
|
||
| integer, | intent(in), | optional | :: | dim | Dimension of the Identity matrix |
|
| integer, | intent(in), | optional | :: | col | Column to extract |
th column of the Identity matrix
Check if two vectors are orthogonal within a certain tolerance.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(vector), | intent(in) | :: | self |
|
||
| class(vector), | intent(in) | :: | v2 |
|
||
| real(kind=real64), | intent(in), | optional | :: | eps |
|
True when
Check if a vector is normal. A vector is normal if it's length is equal to 1 (within a tolerance)
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(vector), | intent(in) | :: | self |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(vector), | intent(in) | :: | self |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(vector), | intent(inout) | :: | self | |||
| integer, | intent(in), | optional | :: | dim |
Check if a vector is allocated
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(vector), | intent(in) | :: | self |
Allocate the underlying array containing 's data and set 's dimension to
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(vector), | intent(inout) | :: | self |
|
||
| integer, | intent(in) | :: | dim |
|
Deallocate the underlying array containing 's elements
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(vector), | intent(inout) | :: | self |
|
Assign a vector to an array of integers.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(vector), | intent(inout) | :: | self | |||
| integer, | intent(in), | dimension(:) | :: | array |
Assign a vector to an array of integers.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(vector), | intent(inout) | :: | self | |||
| real(kind=real32), | intent(in), | dimension(:) | :: | array |
Assign a vector to an array of integers.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(vector), | intent(inout) | :: | self | |||
| real(kind=real64), | intent(in), | dimension(:) | :: | array |
Copy the elements of a vector into
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(vector), | intent(inout) | :: | self |
|
||
| class(vector), | intent(in) | :: | v1 |
|
Assign a vector to an int value. If is already allocated, fill the elements with . If is not already allocated, create a new vector of dimension 1 and set the element equal to
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(vector), | intent(inout) | :: | self |
|
||
| integer, | intent(in) | :: | val | Value used to fill |
Assign a vector to single precision value. If is already allocated, fill the elements with . If is not already allocated, create a new vector of dimension 1 and set the element equal to
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(vector), | intent(inout) | :: | self |
|
||
| real(kind=real32), | intent(in) | :: | val | Value used to fill |
Assign a vector to a double precision value. If is already allocated, fill the elements with . If is not already allocated, create a new vector of dimension 1 and set the element equal to
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(vector), | intent(inout) | :: | self |
|
||
| real(kind=real64), | intent(in) | :: | val | Value used to fill |
Find the normal vector about which to rotate a vector when given a destination direction
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(vector), | intent(in) | :: | self | |||
| class(vector), | intent(in) | :: | direction | A Unit vector pointing in the direction that we would like to end up at |
Multiply a vector times an integer scalar
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(vector), | intent(in) | :: | self | |||
| integer, | intent(in) | :: | scalar |
Multiply a vector times an integer scalar
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(vector), | intent(in) | :: | self | |||
| real(kind=real32), | intent(in) | :: | scalar |
Multiply a vector times an integer scalar
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(vector), | intent(in) | :: | self | |||
| real(kind=real64), | intent(in) | :: | scalar |
Multiply a vector times an integer scalar
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(vector), | intent(in) | :: | self | |||
| integer, | intent(in) | :: | scalar |
Multiply a vector times an integer scalar
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(vector), | intent(in) | :: | self | |||
| real(kind=real32), | intent(in) | :: | scalar |
Multiply a vector times an integer scalar
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(vector), | intent(in) | :: | self | |||
| real(kind=real64), | intent(in) | :: | scalar |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(vector), | intent(in) | :: | self | |||
| class(vector), | intent(in) | :: | v2 |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(vector), | intent(in) | :: | self | |||
| class(vector), | intent(in) | :: | v2 |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(vector), | intent(in) | :: | self |
Multiply a vector times an integer scalar
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(vector), | intent(inout) | :: | self | |||
| integer, | intent(in) | :: | scalar |
Multiply a vector times an integer scalar
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(vector), | intent(inout) | :: | self | |||
| real(kind=real32), | intent(in) | :: | scalar |
Multiply a vector times an integer scalar
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(vector), | intent(inout) | :: | self | |||
| real(kind=real64), | intent(in) | :: | scalar |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(vector), | intent(inout) | :: | self | |||
| class(vector), | intent(in) | :: | v2 |
Multiply a vector times an integer scalar
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(vector), | intent(inout) | :: | self | |||
| integer, | intent(in) | :: | scalar |
Multiply a vector times an integer scalar
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(vector), | intent(inout) | :: | self | |||
| real(kind=real32), | intent(in) | :: | scalar |
Multiply a vector times an integer scalar
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(vector), | intent(inout) | :: | self | |||
| real(kind=real64), | intent(in) | :: | scalar |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(vector), | intent(inout) | :: | self | |||
| class(vector), | intent(in) | :: | v2 |