From b475c4da9ff255dc4e584af8ba340ef9cebcb75a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Crozet?= Date: Tue, 15 Aug 2017 17:04:17 +0200 Subject: [PATCH] Move `set_row`, `set_column` from matrix.rs to edition.rs. --- src/core/edition.rs | 20 ++++++++++++++++++-- src/core/matrix.rs | 16 ---------------- 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/src/core/edition.rs b/src/core/edition.rs index da07555e..43389a24 100644 --- a/src/core/edition.rs +++ b/src/core/edition.rs @@ -2,9 +2,9 @@ use num::{Zero, One}; use std::cmp; use std::ptr; -use core::{DefaultAllocator, Scalar, Matrix, DMatrix, MatrixMN, Vector}; +use core::{DefaultAllocator, Scalar, Matrix, DMatrix, MatrixMN, Vector, RowVector}; use core::dimension::{Dim, DimName, DimSub, DimDiff, DimAdd, DimSum, DimMin, DimMinimum, U1, Dynamic}; -use core::constraint::{ShapeConstraint, DimEq}; +use core::constraint::{ShapeConstraint, DimEq, SameNumberOfColumns, SameNumberOfRows}; use core::allocator::{Allocator, Reallocator}; use core::storage::{Storage, StorageMut}; @@ -91,6 +91,22 @@ impl> Matrix { } } + /// Fills the selected row of this matrix with the content of the given vector. + #[inline] + pub fn set_row(&mut self, i: usize, row: &RowVector) + where S2: Storage, + ShapeConstraint: SameNumberOfColumns { + self.row_mut(i).copy_from(row); + } + + /// Fills the selected column of this matrix with the content of the given vector. + #[inline] + pub fn set_column(&mut self, i: usize, column: &Vector) + where S2: Storage, + ShapeConstraint: SameNumberOfRows { + self.column_mut(i).copy_from(column); + } + /// Sets all the elements of the lower-triangular part of this matrix to `val`. /// /// The parameter `shift` allows some subdiagonals to be left untouched: diff --git a/src/core/matrix.rs b/src/core/matrix.rs index 769007d4..984dfd3d 100644 --- a/src/core/matrix.rs +++ b/src/core/matrix.rs @@ -426,22 +426,6 @@ impl> Matrix { } } - /// Fills the selected row of this matrix with the content of the given vector. - #[inline] - pub fn set_row(&mut self, i: usize, row: &RowVector) - where S2: Storage, - ShapeConstraint: SameNumberOfColumns { - self.row_mut(i).copy_from(row); - } - - /// Fills the selected column of this matrix with the content of the given vector. - #[inline] - pub fn set_column(&mut self, i: usize, column: &Vector) - where S2: Storage, - ShapeConstraint: SameNumberOfRows { - self.column_mut(i).copy_from(column); - } - /// Replaces each component of `self` by the result of a closure `f` applied on it. #[inline] pub fn apply N>(&mut self, mut f: F)