00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00028 #include <coconut_config.h>
00029 #include <search_node.h>
00030 #include <dbtools.h>
00031 #include <dbtables.h>
00032 #include <print_seq.h>
00033
00034 #include <db_listindex>
00035 #include <db_lexiindex>
00036
00037 using namespace vdbl;
00038
00039 namespace coco {
00040
00041 tableid get_point_table(database* ptr, standard_table*& ptb, userid _uid)
00042 {
00043 ptb = (standard_table*) ptr->get_table("point", _uid);
00044 if(ptb == NULL)
00045 {
00046 ptr->create_table("point", _uid);
00047 ptb = (standard_table*) ptr->get_table("point", _uid);
00048 if(ptb == NULL)
00049 throw api_exception(apiee_internal,
00050 "Database inconsistency: Could not create table \"point\"!");
00051 else
00052 {
00053 ptb->add_col("x", typed_col<std::vector<double> >(std::vector<double>()),
00054 colflags());
00055 ptb->add_col("L_mult",
00056 typed_col<std::vector<double> >(std::vector<double>()),
00057 colflags(true));
00058 ptb->add_col("f", typed_col<double>(COCO_INF), colflags(true));
00059 ptb->add_col("kappa", typed_col<double>(1.), colflags(true));
00060 ptb->add_col("best", typed_col<bool>(false), colflags(true));
00061 ptb->add_col("verified", typed_col<bool>(false), colflags(true));
00062 colid _xi(ptb->get_col_id("x")),
00063 _Li(ptb->get_col_id("L_mult")),
00064 _fi(ptb->get_col_id("f"));
00065 ptb->add_col("feasible", method_col<point_check_feasibility>(
00066 point_check_feasibility(_xi, _Li, _fi)),
00067 colflags(true));
00068 ptb->add_col("optimal", typed_col<bool>(false),
00069 colflags(true));
00070 ptb->add_col("global", typed_col<bool>(false),
00071 colflags(true));
00072 ptb->add_col("relaxation", typed_col<bool>(false),
00073 colflags(true));
00074 ptb->add_col("class", typed_col<unsigned int>(0),
00075 colflags(true));
00076 }
00077 }
00078 return ptr->get_tableid("point", _uid);
00079 }
00080
00081 }