1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
//! Module with both safe and unsafe implementations of [elementary row operation] of row multiplication
//!
//! [elementary row operation]: https://www.math.ucdavis.edu/~linear/old/notes3.pdf
use crate::;
use MulAssign;
use ;
/// The type representing the [elementary row operation] of row multiplication, i.e. the operation on
/// a matrix where one row is scaled by the same factor in every entry.
///
/// [Functionally defined], it is one of possible [parameter objects] for
/// [`MatrixReprOfLinSys::perform_elem_row_op`][`crate::MatrixReprOfLinSys::perform_elem_row_op`].
///
/// # Generic arguments
///
/// `'a` - the lifetime of the `factor`;
///
/// `T` - the type of the `factor`.
///
/// # Example
///
/// ```
/// use nalgebra::matrix;
/// use nalgebra_linsys::{
/// MatrixReprOfLinSys,
/// elem_row_ops::RowMul,
/// };
/// // x₁ + 2x₂ = 3
/// // 2x₁ + 4x₂ = 5
/// let mut m = MatrixReprOfLinSys::new(matrix![
/// 1, 2, 3;
/// 2, 4, 5;
/// ]);
///
/// m.perform_elem_row_op(RowMul {
/// row_zbi: 0,
/// factor: &2
/// }).unwrap();
///
/// // 2x₁ + 4x₂ = 6
/// // 2x₁ + 4x₂ = 5
/// assert_eq!(
/// m.0,
/// matrix![
/// 2, 4, 6;
/// 2, 4, 5;
/// ]);
/// ```
///
/// [Parameter object]: http://principles-wiki.net/patterns:parameter_object
/// [elementary row operation]: https://www.math.ucdavis.edu/~linear/old/notes3.pdf
/// [Functionally defined]: https://www.ucfmapper.com/education/various-types-definitions/#:~:text=Functional%20definitions