File tree Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -95,6 +95,12 @@ impl<T: DataType> Mat_<T> {
9595 self . at_2d ( pt. y , pt. x )
9696 }
9797
98+ /// See [Mat::at_row]
99+ #[ inline]
100+ pub fn at_row ( & self , row : i32 ) -> Result < & [ T ] > {
101+ match_indices ( self , & [ row, 0 ] ) . and_then ( |_| unsafe { self . at_row_unchecked ( row) } )
102+ }
103+
98104 /// See [Mat::at_mut]
99105 #[ inline]
100106 pub fn at_mut ( & mut self , i0 : i32 ) -> Result < & mut T > {
@@ -129,6 +135,13 @@ impl<T: DataType> Mat_<T> {
129135 self . at_2d_mut ( pt. y , pt. x )
130136 }
131137
138+ /// See [Mat::at_row_mut]
139+ #[ inline]
140+ pub fn at_row_mut ( & mut self , row : i32 ) -> Result < & mut [ T ] > {
141+ match_indices ( self , & [ row, 0 ] ) ?;
142+ unsafe { self . at_row_unchecked_mut ( row) }
143+ }
144+
132145 /// See [Mat::data_typed]
133146 #[ inline]
134147 pub fn data_typed ( & self ) -> Result < & [ T ] > {
You can’t perform that action at this time.
0 commit comments