Conversation

Euler-37

Fortran 2d array repmat

#685

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.

@milancurcicmilancurcic added enhancementNew feature or requesttopic: linalgLinear algebralabels Nov 12, 2022
@Euler-37Euler-37 mentioned this pull request Nov 13, 2022
@14NGiestas14NGiestas linked an issue Nov 13, 2022that 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 . Already have an account? Sign in to comment
enhancementNew feature or requesttopic: linalgLinear algebra
None yet

Successfully merging this pull request may close these issues.

[stdlib:linalg] repmat