Matrixis an @(@ n \times n @)@ matrix,
Rhsis an @(@ n x m @)@ matrix, and
Resultis an @(@ n x m @)@ matrix.
The routine LuSolve uses an arbitrary vector type, instead of VecAD , to hold its elements. The pivoting operations for a
ADFunobject corresponding to an
LuVecADsolution will change to be optimal for the matrix being factored.
It is often the case that
LuSolveis faster than
LuSolveuses a simple vector class with elements of type double , but the corresponding ADFun objects have a fixed set of pivoting operations.
Result. It is ok for
mto be zero which is reasonable when you are only interested in the determinant of
Matrixhave been overwritten and are not specified.
Rhshave been overwritten and are not specified. If
Rhsis not used.
Rhscontain the solution of the equation we wish to solve (unless the value returned by
LuVecADis equal to zero). If
Resultis not used.
logdetdoes not matter. On output, it has been set to the log of the determinant of
Matrix(but not quite). To be more specific, if
signdetis the value returned by
LuVecAD, the determinant of
Matrixis given by the formula @[@ det = signdet \exp( logdet ) @]@ This enables
LuVecADto use logs of absolute values.
LuVecAD. It returns true if it succeeds and false otherwise.