Definition at line 73 of file svm.cpp.
◆ Cache()
Cache::Cache |
( |
int |
l, |
|
|
long int |
size |
|
) |
| |
Definition at line 100 of file svm.cpp.
102 head = (head_t *)calloc(l,
sizeof(head_t));
104 size -= l *
sizeof(head_t) /
sizeof(
Qfloat);
105 size =
max(size, 2 * (
long int) l);
106 lru_head.next = lru_head.prev = &lru_head;
void max(Image< double > &op1, const Image< double > &op2)
◆ ~Cache()
Definition at line 109 of file svm.cpp.
111 for(head_t *h = lru_head.next; h != &lru_head; h=h->next)
◆ get_data()
int Cache::get_data |
( |
const int |
index, |
|
|
Qfloat ** |
data, |
|
|
int |
len |
|
) |
| |
Definition at line 132 of file svm.cpp.
134 head_t *h = &head[
index];
135 if(h->len) lru_delete(h);
136 int more =
len - h->len;
143 head_t *old = lru_head.next;
◆ swap_index()
void Cache::swap_index |
( |
int |
i, |
|
|
int |
j |
|
) |
| |
Definition at line 162 of file svm.cpp.
166 if(head[
i].
len) lru_delete(&head[
i]);
167 if(head[
j].len) lru_delete(&head[
j]);
168 swap(head[
i].data,head[
j].data);
169 swap(head[
i].len,head[
j].len);
170 if(head[
i].len) lru_insert(&head[
i]);
171 if(head[
j].len) lru_insert(&head[
j]);
174 for(head_t *h = lru_head.next; h!=&lru_head; h=h->next)
179 swap(h->data[
i],h->data[
j]);
The documentation for this class was generated from the following file: