Skip to content
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

Euler 37 repmat #683

Open
wants to merge 14 commits into
base: master
Choose a base branch
from
Open

Conversation

Euler-37
Copy link
Contributor

@Euler-37 Euler-37 commented Oct 27, 2022

Fortran 2d array repmat

#685

Copy link
Member

@milancurcic milancurcic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for this PR. II couldn't find a discussion about repmat in the issues but it's in scope for stdlib. This still needs a spec entry in the stdlib_linalg spec doc. Let me know if you need my help with that.

test/linalg/test_linalg.fypp Outdated Show resolved Hide resolved
src/stdlib_linalg_repmat.fypp Show resolved Hide resolved
@milancurcic milancurcic added enhancement New feature or request topic: linalg Linear algebra labels Nov 12, 2022
Co-authored-by: Milan Curcic <caomaco@gmail.com>
@14NGiestas 14NGiestas linked an issue Nov 13, 2022 that may be closed by this pull request
Comment on lines +100 to +102
!! Creates large matrices from a small array, `repmat()` repeats the given values of the array to create the large matrix.
!! ([Specification](../page/specs/stdlib_linalg.html#
!! repmat-creates-large-matrices-from-a-small-array))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the difference with the intrinsic spread (i.e. "replicates a source array ncopies times along a specified dimension")?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the difference with the intrinsic spread (i.e. "replicates a source array ncopies times along a specified dimension")?

"replicates a source ARRAY ncopies times along a specified dimension", this doesn't quite work for matrices (rank-2) as you will need to do some complicated trickery to reshape it.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually ,Fortran's intrinsic array functions have some strange optimizations. It may generate temporary array and copy. And ifort will be slow if you do some elemental-wise array operation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request topic: linalg Linear algebra
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[stdlib:linalg] repmat
4 participants