ParaMonte Fortran 2.0.0
Parallel Monte Carlo and Machine Learning Library
See the latest version documentation. |
Generate and return index
, the index of the last element of the input array
such that array(index+1:)
contains only full repetitions of the user-specified pattern
.
More...
Generate and return index
, the index of the last element of the input array
such that array(index+1:)
contains only full repetitions of the user-specified pattern
.
[in] | array | : The input contiguous vector of either
|
[in] | pattern | : The input object of the same type and kind as the input array, of rank similar to or lower than that of array , whose value is to be stripped from the beginning of array . |
iseq | : The external user-specified function that takes either two input assumed-length character arguments (if the input array is also an assumed-length character ) or two array-valued explicit-shape arguments of the same type and kind as the input array .It must return a scalar of type logical of default kind LK that is .true. if all elements of the two input arguments are equivalent (e.g., equal) according to the user-defined criterion, otherwise, it is .false. .The the input array is array-valued, then the last argument to iseq is the length of the input pattern .The following illustrates the generic interface of iseq where pattern is array-valued,function iseq(Segment, pattern, lenPattern) result(equivalent)
integer(IK) , intent(in) :: lenPattern
TYPE(KIND) , intent(in) :: Segment(lenPattern), pattern(lenPattern)
logical(LK) :: equivalent
end function
This module defines the relevant Fortran kind type-parameters frequently used in the ParaMonte librar... Definition: pm_kind.F90:268 integer, parameter LK The default logical kind in the ParaMonte library: kind(.true.) in Fortran, kind(.... Definition: pm_kind.F90:541 integer, parameter IK The default integer kind in the ParaMonte library: int32 in Fortran, c_int32_t in C-Fortran Interoper... Definition: pm_kind.F90:540 TYPE(KIND) represents the type and kind of the input argument array , which can be one of the following,character(*, SK), intent(in) :: Segment(lenPattern), pattern(lenPattern)
integer(IK) , intent(in) :: Segment(lenPattern), pattern(lenPattern)
logical(LK) , intent(in) :: Segment(lenPattern), pattern(lenPattern)
complex(CK) , intent(in) :: Segment(lenPattern), pattern(lenPattern)
real(RK) , intent(in) :: Segment(lenPattern), pattern(lenPattern)
SKG , IKG , LKG , CKG , RK , can refer to any kind type parameter that is supported by the processor.The following illustrates the generic interface of iseq where pattern is scalar-valued (including Fortran scalar strings),function iseq(segment, pattern) result(equivalent)
TYPE(KIND) , intent(in) :: segment, pattern
logical(LK) :: equivalent
end function
TYPE(KIND) represents the type and kind of the input argument array , which can be one of the following,character(*, SK), intent(in) :: segment, pattern
integer(IK) , intent(in) :: segment, pattern
logical(LK) , intent(in) :: segment, pattern
complex(CK) , intent(in) :: segment, pattern
real(RK) , intent(in) :: segment, pattern
integer, parameter RK The default real kind in the ParaMonte library: real64 in Fortran, c_double in C-Fortran Interoperati... Definition: pm_kind.F90:543 integer, parameter CK The default complex kind in the ParaMonte library: real64 in Fortran, c_double_complex in C-Fortran I... Definition: pm_kind.F90:542 integer, parameter SK The default character kind in the ParaMonte library: kind("a") in Fortran, c_char in C-Fortran Intero... Definition: pm_kind.F90:539 SK , IK , LK , CK , RK , can refer to any kind type parameter that is supported by the processor.This user-defined equivalence check is extremely useful where an equivalence test other than exact identity is needed, for example, when the array segments should match the input pattern only within a given threshold or, when the case-sensitivity in character comparisons do not matter.In such cases, user can define a custom equivalence criterion within the user-defined external function iseq to achieve the goal.(optional, the default equivalence operator is .eqv. if the input array is logical , otherwise == ) |
index
: The output scalar integer
of default kind IK representing the index of the last element of the input array
such that array(index+1:)
contains only full repetitions of the user-specified pattern
.
Possible calling interfaces ⛓
impure
when the user-specified external
procedure iseq
is specified as input argument."Fortran" == "Fortran "
yields .true.
.pure
procedure(s) documented herein become impure
when the ParaMonte library is compiled with preprocessor macro CHECK_ENABLED=1
.pure
in release
build and impure
in debug
and testing
builds.
Example usage ⛓
ifort
compiler ⛓ ifort
compiler ⛓ gfortran
compiler ⛓
Final Remarks ⛓
If you believe this algorithm or its documentation can be improved, we appreciate your contribution and help to edit this page's documentation and source file on GitHub.
For details on the naming abbreviations, see this page.
For details on the naming conventions, see this page.
This software is distributed under the MIT license with additional terms outlined below.
This software is available to the public under a highly permissive license.
Help us justify its continued development and maintenance by acknowledging its benefit to society, distributing it, and contributing to it.
Definition at line 6573 of file pm_arrayStrip.F90.