pub trait MatrixSwaps {
// Required methods
fn swap_entries(
&mut self,
row_0: impl TryInto<i64> + Display,
col_0: impl TryInto<i64> + Display,
row_1: impl TryInto<i64> + Display,
col_1: impl TryInto<i64> + Display,
) -> Result<(), MathError>;
fn swap_rows(
&mut self,
row_0: impl TryInto<i64> + Display,
row_1: impl TryInto<i64> + Display,
) -> Result<(), MathError>;
fn swap_columns(
&mut self,
col_0: impl TryInto<i64> + Display,
col_1: impl TryInto<i64> + Display,
) -> Result<(), MathError>;
}Required Methods§
Sourcefn swap_entries(
&mut self,
row_0: impl TryInto<i64> + Display,
col_0: impl TryInto<i64> + Display,
row_1: impl TryInto<i64> + Display,
col_1: impl TryInto<i64> + Display,
) -> Result<(), MathError>
fn swap_entries( &mut self, row_0: impl TryInto<i64> + Display, col_0: impl TryInto<i64> + Display, row_1: impl TryInto<i64> + Display, col_1: impl TryInto<i64> + Display, ) -> Result<(), MathError>
Swaps two entries of the specified matrix.
Parameters:
row_0: specifies the row, in which the first entry is locatedcol_0: specifies the column, in which the first entry is locatedrow_1: specifies the row, in which the second entry is locatedcol_1: specifies the column, in which the second entry is located
Returns an empty Ok if the action could be performed successfully.
Otherwise, a MathError is returned if one of the specified entries is not part of the matrix.
§Errors and Failures
- Returns a
MathErrorof typeMathError::OutOfBoundsif row or column are greater than the matrix size.
Sourcefn swap_rows(
&mut self,
row_0: impl TryInto<i64> + Display,
row_1: impl TryInto<i64> + Display,
) -> Result<(), MathError>
fn swap_rows( &mut self, row_0: impl TryInto<i64> + Display, row_1: impl TryInto<i64> + Display, ) -> Result<(), MathError>
Swaps two rows of the specified matrix.
Parameters:
row_0: specifies the first row which is swapped with the second onerow_1: specifies the second row which is swapped with the first one
Returns an empty Ok if the action could be performed successfully.
Otherwise, a MathError is returned if one of the specified rows is not part of the matrix.
§Errors and Failures
- Returns a
MathErrorof typeOutOfBoundsif one of the given rows is not in the matrix.
Sourcefn swap_columns(
&mut self,
col_0: impl TryInto<i64> + Display,
col_1: impl TryInto<i64> + Display,
) -> Result<(), MathError>
fn swap_columns( &mut self, col_0: impl TryInto<i64> + Display, col_1: impl TryInto<i64> + Display, ) -> Result<(), MathError>
Swaps two columns of the specified matrix.
Parameters:
col_0: specifies the first column which is swapped with the second onecol_1: specifies the second column which is swapped with the first one
Returns an empty Ok if the action could be performed successfully.
Otherwise, a MathError is returned if one of the specified columns is not part of the matrix.
§Errors and Failures
- Returns a
MathErrorof typeOutOfBoundsif one of the given columns is not in the matrix.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.