1 | /* |
---|
2 | Copyright 2009 Virginia Polytechnic Institute and State University |
---|
3 | |
---|
4 | Licensed under the Apache License, Version 2.0 (the "License"); |
---|
5 | you may not use this file except in compliance with the License. |
---|
6 | You may obtain a copy of the License at |
---|
7 | |
---|
8 | http://www.apache.org/licenses/LICENSE-2.0 |
---|
9 | |
---|
10 | Unless required by applicable law or agreed to in writing, software |
---|
11 | distributed under the License is distributed on an "AS IS" BASIS, |
---|
12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
---|
13 | See the License for the specific language governing permissions and |
---|
14 | limitations under the License. |
---|
15 | */ |
---|
16 | |
---|
17 | // |
---|
18 | // Case-based reasoner |
---|
19 | // |
---|
20 | // |
---|
21 | // TODO REDO THIS FILE |
---|
22 | |
---|
23 | #ifndef CBR_H |
---|
24 | #define CBR_H |
---|
25 | |
---|
26 | #include "sqlite3.h" |
---|
27 | //#define CBR_LEN_FILENAME 64 |
---|
28 | |
---|
29 | #define DATABASENAME "cactus_cbr" |
---|
30 | |
---|
31 | typedef struct cbr_s * cbr; |
---|
32 | |
---|
33 | // create the CBR |
---|
34 | cbr cbr_create(char * _filename, char * _tablename, char * _cols[], unsigned int _len); |
---|
35 | |
---|
36 | // free the CBR |
---|
37 | void cbr_free(cbr _cbr); |
---|
38 | |
---|
39 | // print databse/table |
---|
40 | void cbr_print(cbr _cbr); |
---|
41 | |
---|
42 | #define EQ 0 // equals |
---|
43 | #define NE 1 // not equals |
---|
44 | #define GT 2 // greater than |
---|
45 | #define GE 3 // greater than or equal to |
---|
46 | #define LT 4 // less than |
---|
47 | #define LE 5 // less than or equal to |
---|
48 | int cbr_search(cbr _cbr, char *_names[], int * _ops, float *_vals, unsigned int _n, float *_retvals); |
---|
49 | |
---|
50 | int cbr_add_row(cbr _cbr, char *_cols[], float *_vals, unsigned int _len); |
---|
51 | |
---|
52 | #endif |
---|