updates to UDI package
This commit is contained in:
parent
cc7ff82275
commit
9e8db82391
2
C/udi.c
2
C/udi.c
@ -56,7 +56,7 @@ p_new_udi(void)
|
|||||||
Atom udi_t;
|
Atom udi_t;
|
||||||
void *info;
|
void *info;
|
||||||
|
|
||||||
fprintf(stderr,"new pred babe\n");
|
/* fprintf(stderr,"new pred babe\n");*/
|
||||||
/* get the predicate from the spec, copied from cdmgr.c */
|
/* get the predicate from the spec, copied from cdmgr.c */
|
||||||
if (IsVarTerm(spec)) {
|
if (IsVarTerm(spec)) {
|
||||||
Yap_Error(INSTANTIATION_ERROR,spec,"new user index/1");
|
Yap_Error(INSTANTIATION_ERROR,spec,"new user index/1");
|
||||||
|
7
packages/udi/README
Normal file
7
packages/udi/README
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
This directory contains support for user defined indexers, currently:
|
||||||
|
|
||||||
|
- RTrees
|
||||||
|
|
||||||
|
For Examples and Tests proceed as follows:
|
||||||
|
|
||||||
|
git clone git://yap.dcc.fc.up.pt/udi-examples
|
Binary file not shown.
@ -79,9 +79,9 @@ control_t *RtreeUdiInit (Term spec,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for (i = 0; i < NARGS; i++)
|
/* for (i = 0; i < NARGS; i++)
|
||||||
printf("%d,%p\t",(*control)[i].arg,(*control)[i].tree);
|
printf("%d,%p\t",(*control)[i].arg,(*control)[i].tree);
|
||||||
printf("\n");
|
printf("\n"); */
|
||||||
|
|
||||||
return control;
|
return control;
|
||||||
}
|
}
|
||||||
|
@ -1,15 +0,0 @@
|
|||||||
:- nogc.
|
|
||||||
|
|
||||||
%% {A,B} :-
|
|
||||||
%% {A},{B}.
|
|
||||||
overlap(A,B) :-
|
|
||||||
attributes:get_all_atts(A,C),
|
|
||||||
attributes:put_att_term(A,overlap(C,B)).
|
|
||||||
|
|
||||||
:- udi(rect(+,-)).
|
|
||||||
rect([0,0,2,2],1).
|
|
||||||
rect([5,5,7,7],2).
|
|
||||||
rect([8, 5, 9, 6],3).
|
|
||||||
rect([7, 1, 9, 2],4).
|
|
||||||
|
|
||||||
%:- overlap(R,[6, 4, 10, 6]), rect(R,ID).
|
|
@ -1,14 +0,0 @@
|
|||||||
:- nogc.
|
|
||||||
|
|
||||||
overlap(A,B) :-
|
|
||||||
attributes:get_all_atts(A,C),
|
|
||||||
attributes:put_att_term(A,overlap(C,B)).
|
|
||||||
|
|
||||||
:- udi(rect(-,+)).
|
|
||||||
|
|
||||||
:- ['roads.yap'].
|
|
||||||
|
|
||||||
r(ID1,ID2) :-
|
|
||||||
rect(ID1,R1),
|
|
||||||
overlap(R2,R1),
|
|
||||||
rect(ID2,R2).
|
|
Reference in New Issue
Block a user