[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
## using Matrix::solve in C++

**From**: |
Søren Hauberg |

**Subject**: |
using Matrix::solve in C++ |

**Date**: |
Mon, 18 Sep 2006 15:43:33 +0200 |

Hi,
I'm working on an .oct file that currently contains code that roughly
look like this:
ColumnVector mGradient(3);
Matrix Hessian(3,3);
ColumnVector x_hat;
for (int iter = 0; iter < max_iter; iter++) {
// ... do some stuff to fill mGradient and Hessian
x_hat = Hessian.solve(mGradient);
// --- do some stuff with x_hat
}
Now, my question is, is this the right way to do this? I'm guessing that
the Matrix::solve method creates a new ColumnVector in each iteration,
which wouldn't be very efficient. I can live with this speed penalty
since I only run the loop a few times, but I was just wondering if there
was a better way...
Thanks,
Søren

[Prev in Thread] |
**Current Thread** |
[Next in Thread] |

**using Matrix::solve in C++**,
*Søren Hauberg* **<=**