示例#1
0
static void
gst_perspective_get_property (GObject * object, guint prop_id,
    GValue * value, GParamSpec * pspec)
{
  GstPerspective *perspective;

  perspective = GST_PERSPECTIVE_CAST (object);

  switch (prop_id) {
    case PROP_MATRIX:
      g_value_set_boxed (value, get_array_from_matrix (perspective));
      break;
    default:
      G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
      break;
  }
}
示例#2
0
文件: lwprmodule.c 项目: mc01104/CTR
static PyObject *PyLWPR_rf_D(PyLWPR *self, PyObject *args) {
   int dim, n;
   LWPR_Model *model = &(self->model);

   if (!PyArg_ParseTuple(args, "ii", &dim, &n))  return NULL;
   
   if (dim<0 || dim>=model->nOut) {
      PyErr_SetString(PyExc_TypeError, "First parameter must indicate output dimension (0 <= dim < model.nOut).");
      return NULL;
   }
   
   if (n<0 || n>=model->sub[dim].numRFS) {
      PyErr_SetString(PyExc_TypeError, "Second parameter must indicate receptive field (0 <= n < model.num_rf[dim]).");
      return NULL;
   }
   
   return get_array_from_matrix(model->nIn, model->nInStore, model->nIn, model->sub[dim].rf[n]->D);
}
示例#3
0
文件: lwprmodule.c 项目: mc01104/CTR
static PyObject *PyLWPR_predict_J(PyLWPR *self, PyObject *args) {
   double cutoff = 0.0;
   LWPR_Model *model = &(self->model);
   PyArrayObject *x;
   PyObject *o1,*o2,*result;

   if (!PyArg_ParseTuple(args, "O!|d", &PyArray_Type, &x, &cutoff))  return NULL;
   if (set_vector_from_array(model->nIn, self->extra_in, x)) return NULL;

   lwpr_predict_J(model,self->extra_in, cutoff, self->extra_out, self->extra_J);

   o1 = get_array_from_vector(model->nOut, self->extra_out);
   o2 = get_array_from_matrix(model->nOut, model->nOut, model->nIn, self->extra_J);

   result = Py_BuildValue("(O,O)",o1,o2);

   Py_DECREF(o1);
   Py_DECREF(o2);

   return result;
}
示例#4
0
文件: lwprmodule.c 项目: mc01104/CTR
static PyObject *PyLWPR_G_init_alpha(PyLWPR *self, void *closure) { 
   return get_array_from_matrix(self->model.nIn, self->model.nInStore, self->model.nIn, self->model.init_alpha);
}