Go to the documentation of this file.
12 #define DEFAULT_PARAM "-t 2 -c 100"
46 gdk_colormap_alloc_colors(
47 gdk_colormap_get_system(),
56 gdk_gc_set_foreground(
gc,&
colors[0]);
63 gdk_draw_pixmap(widget->window,
85 gdk_gc_set_foreground(
gc,&
colors[0]);
126 const char *p = gtk_entry_get_text(GTK_ENTRY(
entry_option));
129 while (*p && *p !=
'-')
178 while(*p && !isspace(*p)) ++p;
215 int *j =
new int[
XLEN];
217 for (i = 0; i <
XLEN; i++)
223 gdk_gc_set_foreground(
gc,&
colors[0]);
228 for(i = 1; i <
XLEN; i++)
230 gdk_gc_set_foreground(
gc,&
colors[0]);
234 gdk_gc_set_foreground(
gc,&
colors[5]);
235 gdk_draw_line(
pixmap,
gc,i-1,j[i-1],i,j[i]);
236 gdk_draw_line(
draw_main->window,
gc,i-1,j[i-1],i,j[i]);
240 gdk_gc_set_foreground(
gc,&
colors[2]);
241 gdk_draw_line(
pixmap,
gc,i-1,j[i-1]+p,i,j[i]+p);
242 gdk_draw_line(
draw_main->window,
gc,i-1,j[i-1]+p,i,j[i]+p);
244 gdk_gc_set_foreground(
gc,&
colors[2]);
245 gdk_draw_line(
pixmap,
gc,i-1,j[i-1]-p,i,j[i]-p);
246 gdk_draw_line(
draw_main->window,
gc,i-1,j[i-1]-p,i,j[i]-p);
271 prob.
y[i] = q->value;
281 for (i = 0; i <
XLEN; i++)
282 for (j = 0; j <
YLEN; j++) {
287 gdk_gc_set_foreground(
gc,&
colors[(
int)
d]);
318 GdkEventButton *event,
329 GdkEventExpose *event,
333 event->area.x, event->area.y,
334 event->area.width, event->area.height);
344 gtk_signal_connect_object(
346 "clicked", GTK_SIGNAL_FUNC(gtk_widget_destroy),
349 gtk_signal_connect_object (GTK_OBJECT
351 "clicked", GTK_SIGNAL_FUNC(gtk_widget_destroy),
379 const char *filename = gtk_file_selection_get_filename(GTK_FILE_SELECTION(
fileselection));
383 FILE *fp = fopen(filename,
"w");
385 const char *p = gtk_entry_get_text(GTK_ENTRY(
entry_option));
386 const char* svm_type_str = strstr(p,
"-s ");
387 int svm_type =
C_SVC;
388 if(svm_type_str != NULL)
389 sscanf(svm_type_str,
"-s %d", &svm_type);
396 fprintf(fp,
"%f 1:%f\n", p->y, p->x);
401 fprintf(fp,
"%d 1:%f 2:%f\n", p->value, p->x, p->y);
409 FILE *fp = fopen(filename,
"r");
414 while(fgets(buf,
sizeof(buf),fp))
418 if(sscanf(buf,
"%d%*d:%lf%*d:%lf",&v,&
x,&y)==3)
423 else if(sscanf(buf,
"%lf%*d:%lf",&y,&
x)==2)
void draw_point(const point &p)
void on_button_clear_clicked(GtkButton *button, gpointer user_data)
void on_button_load_clicked(GtkButton *button, gpointer user_data)
void on_filesel_cancel_clicked(GtkButton *button, gpointer user_data)
void on_button_change_clicked(GtkButton *button, gpointer user_data)
def svm_train(arg1, arg2=None, arg3=None)
void on_button_save_clicked(GtkButton *button, gpointer user_data)
static enum @0 fileselection_flag
gboolean on_draw_main_button_press_event(GtkWidget *widget, GdkEventButton *event, gpointer user_data)
void show_fileselection()
def svm_predict(y, x, m, options="")
gboolean on_draw_main_expose_event(GtkWidget *widget, GdkEventExpose *event, gpointer user_data)
void svm_free_and_destroy_model(svm_model **model_ptr_ptr)
void on_filesel_ok_clicked(GtkButton *button, gpointer user_data)
void on_window1_destroy(GtkObject *object, gpointer user_data)
struct svm_node * x_space
void on_button_run_clicked(GtkButton *button, gpointer user_data)
GtkWidget * create_fileselection(void)
void on_fileselection_destroy(GtkObject *object, gpointer user_data)
struct svm_parameter param
void svm_toy_initialize()
GtkWidget * fileselection
void redraw_area(GtkWidget *widget, int x, int y, int w, int h)
haf_grasping
Author(s): David Fischinger
autogenerated on Sat Apr 1 2023 02:23:26