stan-dev/stan — pull request #419 by syclik (2013-11-27 03:23:12+00:00)
Title: Feature/fix ldlt

This is a continuation of #346. I cherry-picked @mbrubake and @syclik's commits in order to identify what's changed for this branch.

### Checklist ###

#### mdivide_left_ldlt ####
- [x] math header file in `src/stan/math/matrix/`
- [x] math test in `src/test/math/matrix/`
- [x] agrad header file in `src/stan/agrad/rev/matrix/`
- [x] agrad test in `src/test/agrad/rev/matrix/`
- [x] agrad derivative tests
- [ ] agrad finite diff tests

#### mdivide_right_ldlt ####
- [x] math header file in `src/stan/math/matrix/`
- [x] math test in `src/test/math/matrix/`
- [x] agrad header file in `src/stan/agrad/rev/matrix/` (don't need header file -- the one in src/stan/math/matrix is templated properly)
- [ ] agrad test in `src/test/agrad/rev/matrix/`
- [ ] agrad derivative tests
- [ ] agrad finite diff tests

#### log_determinant_ldlt ####
- [x] math header file in `src/stan/math/matrix/`
- [ ] math test in `src/test/math/matrix/`
- [x] agrad header file in `src/stan/agrad/rev/matrix/`
- [x] agrad test in `src/test/agrad/rev/matrix/`
- [ ] agrad derivative tests (one of two tests have gradient tests)
- [ ] agrad finite diff tests

#### trace_gen_inv_quad_form_ldlt ####
- [x] math header file in `src/stan/math/matrix/`
- [ ] math test in `src/test/math/matrix/`
- [x] agrad header file in `src/stan/agrad/rev/matrix/`
- [x] agrad test in `src/test/agrad/rev/matrix/`
- [x] agrad derivative tests
- [ ] agrad finite diff tests

#### trace_inv_quad_form_ldlt ####
- [x] math header file in `src/stan/math/matrix/`
- [ ] math test in `src/test/math/matrix/`
- [x] agrad header file in `src/stan/agrad/rev/matrix/`
- [x] agrad test in `src/test/agrad/rev/matrix/`
- [x] agrad derivative tests
- [ ] agrad finite diff tests

This pull request:
* Adds unit tests for LDLT_factor (resolving issue #45). The _ldlt variants of mdivide, log_determinant, trace_inv_quad_form and trace_gen_inv_quad_form are all now directly tested.
* Fixes the gradient bug in trace_inv_quad_form_ldlt
* Reenables the use of trace_inv_quad_form_ldlt in multi_normal
* Uses trace_inv_quad_form_ldlt in multi_student_t_log
* Adds gradient testing on multi_student_t_log