Creates a matrix from the intermediate parameters and values of the objective funciton after each iteration.
(&self)
| 147 | /// Creates a matrix from the intermediate parameters and |
| 148 | /// values of the objective funciton after each iteration. |
| 149 | pub fn matrix(&self) -> Matrix<T> { |
| 150 | |
| 151 | if self.fvals.len() == 0 { |
| 152 | return Matrix::new(); |
| 153 | } |
| 154 | |
| 155 | let mut m: Matrix<T> = Matrix::new(); |
| 156 | for &(ref v, f) in self.fvals.iter() { |
| 157 | let mut x = v.clone(); |
| 158 | x.push(f); |
| 159 | m.add_row(&x); |
| 160 | } |
| 161 | m |
| 162 | } |
| 163 | } |
| 164 | |
| 165 | /// Minimizes an objective using gradient descent. |