ColConcat
This function concatenates the columns of array (of rank 1 or 2).
Calling examples:
c(:,:) = a(:) .colconcat. b(:)
c(:,:) = a(:,:) .colconcat. b(:)
c(:,:) = a(:) .colconcat. b(:,:)
c(:,:) = a(:,:) .colconcat. b(:,:)
Interface 1
- ܀ Interface
- ️܀ See example
- ↢
MODULE PURE FUNCTION colConcat(a, b) RESULT(ans)
INTEGER(Int8| Int16 | Int32 | Int64) | REAL(Real32| Real64), INTENT(IN) :: a(:)
INTEGER(Int8| Int16 | Int32 | Int64) | REAL(Real32| Real64), INTENT(IN) :: b(:)
INTEGER(Int8| Int16 | Int32 | Int64) | REAL(Real32| Real64), ALLOCATABLE :: ans(:, :)
END FUNCTION colConcat
PROGRAM main
USE easifemBase
IMPLICIT NONE
Concat two integer vectors
call display( MdEnCode(ColConcat(a=[1,2], b=[3,4])), "colconcat="//CHAR_LF//CHAR_LF )
call ok( all( ColConcat(a=[1,2], b=[3,4]) &
& .eq. reshape([1,2,3,4], [2,2])), "colconcat" )
See results
1 | 3 |
2 | 4 |
Concat two integer vectors of different length
call display( MdEnCode(ColConcat(a=[1,2], b=[3,4,5])), "colconcat="//CHAR_LF//CHAR_LF )
call ok( all( ColConcat(a=[1,2], b=[3,4,5]) &
& .eq. reshape([1,2,0,3,4,5], [3,2])), "colconcat" )
See results
1 | 3 |
2 | 4 |
0 | 5 |
Concat two integer vectors of different length.
call display( MdEnCode(ColConcat(a=[3,4,5], b=[1,2])), "colconcat="//CHAR_LF//CHAR_LF )
See results
colconcat=
3 | 1 |
4 | 2 |
5 | 0 |
END PROGRAM main
Interface 2
- ܀ Interface
- ️܀ See example
- ↢
MODULE PURE FUNCTION colConcat(a, b) RESULT(ans)
INTEGER(Int8| Int16 | Int32 | Int64) | REAL(Real32| Real64), INTENT(IN) :: a(:, :)
INTEGER(Int8| Int16 | Int32 | Int64) | REAL(Real32| Real64), INTENT(IN) :: b(:)
INTEGER(Int8| Int16 | Int32 | Int64) | REAL(Real32| Real64), ALLOCATABLE :: ans(:, :)
END FUNCTION colConcat
PROGRAM main
USE easifemBase
IMPLICIT NONE
Concat columns of a rank2 array and rank 1 array.
call display( ColConcat(a=reshape([1,2,3,4], [2,2]), &
& b=[5,6]), "colconcat=" )
See results
colconcat=
----------
1 3 5
2 4 6
ColConcat works fine even when number of rows in rank-2 array is not the same as the size of rank-1 array.
call display( ColConcat(a=reshape([1,2,3,4], [2,2]), &
& b=[5,6, 7]), "colconcat=" )
See results
colconcat=
----------
1 3 5
2 4 6
0 0 7
Concat columns of a rank2 array and rank 1 array.
call display( ColConcat(b=reshape([1,2,3,4], [2,2]), &
& a=[5,6]), "colconcat=" )
See results
colconcat=
----------
5 1 3
6 2 4
ColConcat works fine even when number of rows in rank-2 array is not the same as the size of rank-1 array.
call display( ColConcat(b=reshape([1,2,3,4], [2,2]), &
& a=[5,6, 7]), "colconcat=" )
See results
colconcat=
----------
5 1 3
6 2 4
7 0 0
END PROGRAM main
Interface 3
- ܀ Interface
- ️܀ See example
- ↢
MODULE PURE FUNCTION colConcat(a, b) RESULT(ans)
INTEGER(Int8| Int16 | Int32 | Int64) | REAL(Real32| Real64), INTENT(IN) :: a(:)
INTEGER(Int8| Int16 | Int32 | Int64) | REAL(Real32| Real64), INTENT(IN) :: b(:, :)
INTEGER(Int8| Int16 | Int32 | Int64) | REAL(Real32| Real64), ALLOCATABLE :: ans(:, :)
END FUNCTION colConcat
PROGRAM main
USE easifemBase
IMPLICIT NONE
Concat columns of a rank2 array and rank 1 array.
call display( ColConcat(a=reshape([1,2,3,4], [2,2]), &
& b=[5,6]), "colconcat=" )
See results
colconcat=
----------
1 3 5
2 4 6
ColConcat works fine even when number of rows in rank-2 array is not the same as the size of rank-1 array.
call display( ColConcat(a=reshape([1,2,3,4], [2,2]), &
& b=[5,6, 7]), "colconcat=" )
See results
colconcat=
----------
1 3 5
2 4 6
0 0 7
Concat columns of a rank2 array and rank 1 array.
call display( ColConcat(b=reshape([1,2,3,4], [2,2]), &
& a=[5,6]), "colconcat=" )
See results
colconcat=
----------
5 1 3
6 2 4
ColConcat works fine even when number of rows in rank-2 array is not the same as the size of rank-1 array.
call display( ColConcat(b=reshape([1,2,3,4], [2,2]), &
& a=[5,6, 7]), "colconcat=" )
See results
colconcat=
----------
5 1 3
6 2 4
7 0 0
END PROGRAM main
Interface 4
- ܀ Interface
- ️܀ See example
- ↢
MODULE PURE FUNCTION colConcat(a, b) RESULT(ans)
INTEGER(Int8| Int16 | Int32 | Int64) | REAL(Real32| Real64), INTENT(IN) :: a(:, :)
INTEGER(Int8| Int16 | Int32 | Int64) | REAL(Real32| Real64), INTENT(IN) :: b(:, :)
INTEGER(Int8| Int16 | Int32 | Int64) | REAL(Real32| Real64), ALLOCATABLE :: ans(:, :)
END FUNCTION colConcat
PROGRAM main
USE easifemBase
IMPLICIT NONE
call display( ColConcat(a=reshape([1,2,3,4], [2,2]), &
& b=reshape([5,6,7,8], [2,2]) ), "colconcat=" )
See results
colconcat=
----------
1 3 5 7
2 4 6 8
call display( ColConcat(a=reshape(arange(1,9), [3,3]), &
& b=reshape(arange(10,13), [2,2]) ), "colconcat=" )
See results
colconcat=
------------------
1 4 7 10 12
2 5 8 11 13
3 6 9 0 0
call display( ColConcat(a=reshape(arange(1,4), [2,2]), &
& b=reshape(arange(5,13), [3,3]) ), "colconcat=" )
See results
colconcat=
------------------
1 3 5 8 11
2 4 6 9 12
0 0 7 10 13
END PROGRAM main