# \#inplace

**URL:** https://discourse.julialang.org/tag/inplace/1098.md

[Latest](https://discourse.julialang.org/latest.md) · [Categories](https://discourse.julialang.org/categories.md) · [Tags](https://discourse.julialang.org/tags.md)

---

## [In-place mapslices?](https://discourse.julialang.org/t/in-place-mapslices/126415)

<div class="topic-metadata">

**Author:** [@ryofurue](https://discourse.julialang.org/u/ryofurue)\
**Replies:** 5\
**Last updated:** [March 1, 2025, 4:46pm UTC](https://discourse.julialang.org/t/in-place-mapslices/126415 "2025-03-01T16:46:43Z")

</div>

I want to apply a function that operates on a vector, to each column of a matrix. So, I use mapslices(). But, how to modify the matrix in-place? The following is a failed attempt: function f!(xs) a = xs\[1\] @. xs = …

---

## [Inplace modification of Float64](https://discourse.julialang.org/t/inplace-modification-of-float64/118995)

<div class="topic-metadata">

**Author:** [@JADekker](https://discourse.julialang.org/u/JADekker)\
**Replies:** 4\
**Last updated:** [September 3, 2024, 3:45pm UTC](https://discourse.julialang.org/t/inplace-modification-of-float64/118995 "2024-09-03T15:45:55Z")

</div>

Hi, I know that things like Float64 are immutable, so I can’t do inplace modification (in my specific situation: I can’t call clamp! on them). I’m writing some code in which I either want to apply a routine on an entire…

---

## [Efficient weighted sum for arbitrary data types](https://discourse.julialang.org/t/efficient-weighted-sum-for-arbitrary-data-types/113992)

<div class="topic-metadata">

**Author:** [@baxmittens](https://discourse.julialang.org/u/baxmittens)\
**Replies:** 7\
**Last updated:** [May 9, 2024, 11:26am UTC](https://discourse.julialang.org/t/efficient-weighted-sum-for-arbitrary-data-types/113992 "2024-05-09T11:26:58Z")

</div>

Hello all, I have some old Julia code, e.g., DistributedSparseGrids.jl, written in 2016, which uses in-place math operations on custom data types implemented by proprietary in-place operator functions. The task I alw…

---

## [Is there any documentation on "IntegralFunctions"](https://discourse.julialang.org/t/is-there-any-documentation-on-integralfunctions/108970)

<div class="topic-metadata">

**Author:** [@Laura](https://discourse.julialang.org/u/Laura)\
**Replies:** 8\
**Last updated:** [February 3, 2024, 12:36am UTC](https://discourse.julialang.org/t/is-there-any-documentation-on-integralfunctions/108970 "2024-02-03T00:36:50Z")

</div>

I have been trying to solve two integrals at the same time using the Integrals.jl Package. I am following the example in the documentation of Integrals.jl in the link below. My function that I am integrating is an in-…

---

## [How to apply an in-place function to a slice of a vector?](https://discourse.julialang.org/t/how-to-apply-an-in-place-function-to-a-slice-of-a-vector/108520)

<div class="topic-metadata">

**Author:** [@homocomputeris](https://discourse.julialang.org/u/homocomputeris)\
**Replies:** 11\
**Last updated:** [January 9, 2024, 11:02am UTC](https://discourse.julialang.org/t/how-to-apply-an-in-place-function-to-a-slice-of-a-vector/108520 "2024-01-09T11:02:07Z")

</div>

I want to have an in-place function that takes a vector as an argument and applies another in-place function to a subarray (in general sense). How do I do this? function f!(du, u) println("\\nf called") @show u …

---

## [In-place assignment, without allocation](https://discourse.julialang.org/t/in-place-assignment-without-allocation/103811)

<div class="topic-metadata">

**Author:** [@user664303](https://discourse.julialang.org/u/user664303)\
**Replies:** 8\
**Last updated:** [September 13, 2023, 1:17pm UTC](https://discourse.julialang.org/t/in-place-assignment-without-allocation/103811 "2023-09-13T13:17:45Z")

</div>

I’m trying to do y = x\[ind\] in-place, where y, x, ind are all vectors. By in-place, I mean no memory is allocated. I’m able to achieve this using a hand-written for loop (assign2! below). I suspect there is a way to achi…

---

## [Broadcasting with in-place changes](https://discourse.julialang.org/t/broadcasting-with-in-place-changes/91719)

<div class="topic-metadata">

**Author:** [@Eveee](https://discourse.julialang.org/u/Eveee)\
**Replies:** 9\
**Last updated:** [December 16, 2022, 12:18am UTC](https://discourse.julialang.org/t/broadcasting-with-in-place-changes/91719 "2022-12-16T00:18:45Z")

</div>

Hi all, I am learning broadcasting in julia. I would like to adapt one vector in-place by multiplying it with the contents of another vector, without creating a copy. I tried this: function mymultiply!(a,b) a\*=b …

---

## [Preallocating Vectors of NamedTuples](https://discourse.julialang.org/t/preallocating-vectors-of-namedtuples/85105)

<div class="topic-metadata">

**Author:** [@mrVeng](https://discourse.julialang.org/u/mrVeng)\
**Replies:** 3\
**Last updated:** [August 1, 2022, 5:44pm UTC](https://discourse.julialang.org/t/preallocating-vectors-of-namedtuples/85105 "2022-08-01T17:44:19Z")

</div>

Dear all, I hope you are well! I have a question regarding preallocating Vectors of NamedTuples. I have a custom struct that contains a field that is a NamedTuple. mutable struct MyCustomStruct{T\<:NamedTuple} param…
