| 44 | typedef typename structural_svm_problem::feature_vector_type feature_vector_type; |
| 45 | |
| 46 | void init ( |
| 47 | const structural_svm_problem* prob_, |
| 48 | const long idx |
| 49 | ) |
| 50 | /*! |
| 51 | ensures |
| 52 | - This object will be a cache for the idx-th sample in the given |
| 53 | structural_svm_problem. |
| 54 | !*/ |
| 55 | { |
| 56 | prob = prob_; |
| 57 | sample_idx = idx; |
| 58 | |
| 59 | loss.clear(); |
| 60 | psi.clear(); |
| 61 | lru_count.clear(); |
| 62 | |
| 63 | if (prob->get_max_cache_size() != 0) |
| 64 | { |
| 65 | prob->get_truth_joint_feature_vector(idx, true_psi); |
| 66 | compact_sparse_vector(true_psi); |
| 67 | } |
| 68 | } |
| 69 | |
| 70 | void get_truth_joint_feature_vector_cached ( |
| 71 | feature_vector_type& psi |
no test coverage detected