Skip to content

Commit 15b214e

Browse files
committed
Add unnecessary clone comment for future optimization
1 parent 04ddbdb commit 15b214e

File tree

3 files changed

+9
-3
lines changed

3 files changed

+9
-3
lines changed

src/matrix.rs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -193,26 +193,29 @@ impl<A: MFloat> Matrix for RcArray<A, Ix2> {
193193
check_layout(self.strides())
194194
}
195195
fn norm_1(&self) -> Self::Scalar {
196-
// TODO remove clone by into_owned()
196+
// XXX unnecessary clone
197197
self.to_owned().norm_1()
198198
}
199199
fn norm_i(&self) -> Self::Scalar {
200-
// TODO remove clone by into_owned()
200+
// XXX unnecessary clone
201201
self.to_owned().norm_i()
202202
}
203203
fn norm_f(&self) -> Self::Scalar {
204-
// TODO remove clone by into_owned()
204+
// XXX unnecessary clone
205205
self.to_owned().norm_f()
206206
}
207207
fn svd(self) -> Result<(Self, Self::Vector, Self), LinalgError> {
208+
// XXX unnecessary clone
208209
let (u, s, v) = self.to_owned().svd()?;
209210
Ok((u.into_shared(), s.into_shared(), v.into_shared()))
210211
}
211212
fn qr(self) -> Result<(Self, Self), LinalgError> {
213+
// XXX unnecessary clone
212214
let (q, r) = self.to_owned().qr()?;
213215
Ok((q.into_shared(), r.into_shared()))
214216
}
215217
fn lu(self) -> Result<(Self::Permutator, Self, Self), LinalgError> {
218+
// XXX unnecessary clone
216219
let (p, l, u) = self.to_owned().lu()?;
217220
Ok((p, l.into_shared(), u.into_shared()))
218221
}

src/square.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ impl<A: MFloat> SquareMatrix for Array<A, Ix2> {
6060

6161
impl<A: MFloat> SquareMatrix for RcArray<A, Ix2> {
6262
fn inv(self) -> Result<Self, LinalgError> {
63+
// XXX unnecessary clone
6364
let i = self.to_owned().inv()?;
6465
Ok(i.into_shared())
6566
}

src/triangular.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,12 @@ impl<A: MFloat> TriangularMatrix for Array<A, Ix2> {
3434

3535
impl<A: MFloat> TriangularMatrix for RcArray<A, Ix2> {
3636
fn solve_upper(&self, b: Self::Vector) -> Result<Self::Vector, LinalgError> {
37+
// XXX unnecessary clone
3738
let x = self.to_owned().solve_upper(b.to_owned())?;
3839
Ok(x.into_shared())
3940
}
4041
fn solve_lower(&self, b: Self::Vector) -> Result<Self::Vector, LinalgError> {
42+
// XXX unnecessary clone
4143
let x = self.to_owned().solve_lower(b.to_owned())?;
4244
Ok(x.into_shared())
4345
}

0 commit comments

Comments
 (0)