Skip to content

Euler 37 repmat #683

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 14 commits into
base: master
Choose a base branch
from
Next Next commit
Create stdlib_linalg_repmat.fypp
  • Loading branch information
Euler-37 authored Oct 27, 2022
commit f7c5ae9b4c394ce0aa4632bf5f51889aec470cb2
29 changes: 29 additions & 0 deletions src/stdlib_linalg_repmat.fypp
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#:include "common.fypp"
#:set RCI_KINDS_TYPES = REAL_KINDS_TYPES + CMPLX_KINDS_TYPES + INT_KINDS_TYPES
submodule (stdlib_linalg) stdlib_linalg_repmat

implicit none

contains

#:for k1, t1 in RCI_KINDS_TYPES
pure module function repmat_${t1[0]}$${k1}$(a, m, n) result(res)
${t1}$, intent(in) :: a(:,:)
${t1}$, intent(in) :: m,n
${t1}$ :: res(m*size(a,1),n*size(a,2))
associate(ma=>size(a,1),na=>size(a,2))
do j=1,n
do l=1,na
do i=1,m
do k=1,ma
c((i-1)*ma+k,(j-1)*na+l)=a(k,l)
end do
end do
end do
end do
end associate
end function repmat_${t1[0]}$${k1}$

#:endfor

end submodule
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy