| 528 | |
| 529 | template <typename M1, typename M2> |
| 530 | long pick_initial_vector ( |
| 531 | const M1& x, |
| 532 | const M2& t |
| 533 | ) const |
| 534 | { |
| 535 | scalar_vector_type K_col; |
| 536 | double max_projection = -std::numeric_limits<scalar_type>::infinity(); |
| 537 | long max_idx = 0; |
| 538 | // find the row in the kernel matrix that has the biggest normalized projection onto the t vector |
| 539 | for (long r = 0; r < x.nr(); ++r) |
| 540 | { |
| 541 | get_kernel_colum(r,x,K_col); |
| 542 | double temp = trans(K_col)*t; |
| 543 | temp = temp*temp/length_squared(K_col); |
| 544 | |
| 545 | if (temp > max_projection) |
| 546 | { |
| 547 | max_projection = temp; |
| 548 | max_idx = r; |
| 549 | } |
| 550 | } |
| 551 | |
| 552 | return max_idx; |
| 553 | } |
| 554 | |
| 555 | // ------------------------------------------------------------------------------------ |
| 556 |
nothing calls this directly
no test coverage detected