Generated by Cython 0.13 on Mon Dec 6 17:15:04 2010

Raw output: matmult.c

 1: # cython: profile=True
  /* "/home/skipper/statsmodels/statsmodels-skipper/scikits/statsmodels/tsa/kalmanf/matmult.pyx":1
 * # cython: profile=True             # <<<<<<<<<<<<<<
 * from numpy cimport float64_t, ndarray, NPY_DOUBLE, npy_intp
 * cimport cython
 */
  __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s____test__, ((PyObject *)__pyx_t_2)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
 2: from numpy cimport float64_t, ndarray, NPY_DOUBLE, npy_intp
 3: cimport cython
 4: from numpy import dot
  /* "/home/skipper/statsmodels/statsmodels-skipper/scikits/statsmodels/tsa/kalmanf/matmult.pyx":4
 * from numpy cimport float64_t, ndarray, NPY_DOUBLE, npy_intp
 * cimport cython
 * from numpy import dot             # <<<<<<<<<<<<<<
 * 
 * ctypedef float64_t DOUBLE
 */
  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__dot));
  PyList_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_n_s__dot));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__dot));
  __pyx_t_2 = __Pyx_Import(((PyObject *)__pyx_n_s__numpy), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  __pyx_t_1 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__dot); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__dot, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 5: 
 6: ctypedef float64_t DOUBLE
 7: 
 8: cdef extern from "numpy/arrayobject.h":
 9:     cdef void import_array()
 10: #    cdef PyArray_EMPTY(int nd, NPY_INTP* dims, int typenum, int fortan)
 11:     cdef object PyArray_SimpleNew(int nd, npy_intp *dims, int typenum)
 12: 
 13: # initialize numpy
 14: import_array()
  /* "/home/skipper/statsmodels/statsmodels-skipper/scikits/statsmodels/tsa/kalmanf/matmult.pyx":14
 * 
 * # initialize numpy
 * import_array()             # <<<<<<<<<<<<<<
 * 
 * @cython.boundscheck(False)
 */
  import_array();
 15: 
 16: @cython.boundscheck(False)
 17: @cython.wraparound(False)
 18: cdef inline object matmult(ndarray[DOUBLE, ndim=2, mode='c'] A,
/* "/home/skipper/statsmodels/statsmodels-skipper/scikits/statsmodels/tsa/kalmanf/matmult.pyx":18
 * @cython.boundscheck(False)
 * @cython.wraparound(False)
 * cdef inline object matmult(ndarray[DOUBLE, ndim=2, mode='c'] A,             # <<<<<<<<<<<<<<
 *                     ndarray[DOUBLE, ndim=2, mode='c'] B):
 *     cdef int lda = A.shape[0]
 */

static CYTHON_INLINE PyObject *__pyx_f_7scikits_11statsmodels_3tsa_7kalmanf_7matmult_matmult(PyArrayObject *__pyx_v_A, PyArrayObject *__pyx_v_B) {
  int __pyx_v_lda;
  int __pyx_v_n;
  npy_intp *__pyx_v_dims;
  PyArrayObject *__pyx_v_out = 0;
  int __pyx_v_i;
  int __pyx_v_j;
  int __pyx_v_k;
  double __pyx_v_s;
  Py_buffer __pyx_bstruct_A;
  Py_ssize_t __pyx_bstride_0_A = 0;
  Py_ssize_t __pyx_bstride_1_A = 0;
  Py_ssize_t __pyx_bshape_0_A = 0;
  Py_ssize_t __pyx_bshape_1_A = 0;
  Py_buffer __pyx_bstruct_B;
  Py_ssize_t __pyx_bstride_0_B = 0;
  Py_ssize_t __pyx_bstride_1_B = 0;
  Py_ssize_t __pyx_bshape_0_B = 0;
  Py_ssize_t __pyx_bshape_1_B = 0;
  Py_buffer __pyx_bstruct_out;
  Py_ssize_t __pyx_bstride_0_out = 0;
  Py_ssize_t __pyx_bstride_1_out = 0;
  Py_ssize_t __pyx_bshape_0_out = 0;
  Py_ssize_t __pyx_bshape_1_out = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_TraceDeclarations
  __Pyx_RefNannySetupContext("matmult");
  __Pyx_TraceCall("matmult", __pyx_f[0], 18);
  __pyx_bstruct_out.buf = NULL;
  __pyx_bstruct_A.buf = NULL;
  __pyx_bstruct_B.buf = NULL;
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_A, (PyObject*)__pyx_v_A, &__Pyx_TypeInfo_nn___pyx_t_7scikits_11statsmodels_3tsa_7kalmanf_7matmult_DOUBLE, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 18; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_bstride_0_A = __pyx_bstruct_A.strides[0]; __pyx_bstride_1_A = __pyx_bstruct_A.strides[1];
  __pyx_bshape_0_A = __pyx_bstruct_A.shape[0]; __pyx_bshape_1_A = __pyx_bstruct_A.shape[1];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_B, (PyObject*)__pyx_v_B, &__Pyx_TypeInfo_nn___pyx_t_7scikits_11statsmodels_3tsa_7kalmanf_7matmult_DOUBLE, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 18; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_bstride_0_B = __pyx_bstruct_B.strides[0]; __pyx_bstride_1_B = __pyx_bstruct_B.strides[1];
  __pyx_bshape_0_B = __pyx_bstruct_B.shape[0]; __pyx_bshape_1_B = __pyx_bstruct_B.shape[1];
 19:                     ndarray[DOUBLE, ndim=2, mode='c'] B):
 20:     cdef int lda = A.shape[0]
  /* "/home/skipper/statsmodels/statsmodels-skipper/scikits/statsmodels/tsa/kalmanf/matmult.pyx":20
 * cdef inline object matmult(ndarray[DOUBLE, ndim=2, mode='c'] A,
 *                     ndarray[DOUBLE, ndim=2, mode='c'] B):
 *     cdef int lda = A.shape[0]             # <<<<<<<<<<<<<<
 *     cdef int n = B.shape[1]
 *     cdef npy_intp *dims = [lda, n]
 */
  __pyx_v_lda = (__pyx_v_A->dimensions[0]);
 21:     cdef int n = B.shape[1]
  /* "/home/skipper/statsmodels/statsmodels-skipper/scikits/statsmodels/tsa/kalmanf/matmult.pyx":21
 *                     ndarray[DOUBLE, ndim=2, mode='c'] B):
 *     cdef int lda = A.shape[0]
 *     cdef int n = B.shape[1]             # <<<<<<<<<<<<<<
 *     cdef npy_intp *dims = [lda, n]
 *     cdef ndarray[DOUBLE, ndim=2] out = PyArray_SimpleNew(2, dims, NPY_DOUBLE)
 */
  __pyx_v_n = (__pyx_v_B->dimensions[1]);
 22:     cdef npy_intp *dims = [lda, n]
  /* "/home/skipper/statsmodels/statsmodels-skipper/scikits/statsmodels/tsa/kalmanf/matmult.pyx":22
 *     cdef int lda = A.shape[0]
 *     cdef int n = B.shape[1]
 *     cdef npy_intp *dims = [lda, n]             # <<<<<<<<<<<<<<
 *     cdef ndarray[DOUBLE, ndim=2] out = PyArray_SimpleNew(2, dims, NPY_DOUBLE)
 *     cdef int i,j,k
 */
  __pyx_t_1[0] = __pyx_v_lda;
  __pyx_t_1[1] = __pyx_v_n;
  __pyx_v_dims = __pyx_t_1;
 23:     cdef ndarray[DOUBLE, ndim=2] out = PyArray_SimpleNew(2, dims, NPY_DOUBLE)
  /* "/home/skipper/statsmodels/statsmodels-skipper/scikits/statsmodels/tsa/kalmanf/matmult.pyx":23
 *     cdef int n = B.shape[1]
 *     cdef npy_intp *dims = [lda, n]
 *     cdef ndarray[DOUBLE, ndim=2] out = PyArray_SimpleNew(2, dims, NPY_DOUBLE)             # <<<<<<<<<<<<<<
 *     cdef int i,j,k
 *     cdef double s
 */
  __pyx_t_2 = PyArray_SimpleNew(2, __pyx_v_dims, NPY_DOUBLE); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_3 = ((PyArrayObject *)__pyx_t_2);
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_out, (PyObject*)__pyx_t_3, &__Pyx_TypeInfo_nn___pyx_t_7scikits_11statsmodels_3tsa_7kalmanf_7matmult_DOUBLE, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {
      __pyx_v_out = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_bstruct_out.buf = NULL;
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    } else {__pyx_bstride_0_out = __pyx_bstruct_out.strides[0]; __pyx_bstride_1_out = __pyx_bstruct_out.strides[1];
      __pyx_bshape_0_out = __pyx_bstruct_out.shape[0]; __pyx_bshape_1_out = __pyx_bstruct_out.shape[1];
    }
  }
  __pyx_t_3 = 0;
  __pyx_v_out = ((PyArrayObject *)__pyx_t_2);
  __pyx_t_2 = 0;
 24:     cdef int i,j,k
 25:     cdef double s
 26:     for i in xrange(lda):
  /* "/home/skipper/statsmodels/statsmodels-skipper/scikits/statsmodels/tsa/kalmanf/matmult.pyx":26
 *     cdef int i,j,k
 *     cdef double s
 *     for i in xrange(lda):             # <<<<<<<<<<<<<<
 *         for j in xrange(n):
 *             s = 0
 */
  __pyx_t_4 = __pyx_v_lda;
  for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
    __pyx_v_i = __pyx_t_5;
 27:         for j in xrange(n):
    /* "/home/skipper/statsmodels/statsmodels-skipper/scikits/statsmodels/tsa/kalmanf/matmult.pyx":27
 *     cdef double s
 *     for i in xrange(lda):
 *         for j in xrange(n):             # <<<<<<<<<<<<<<
 *             s = 0
 *             for k in xrange(A.shape[1]):
 */
    __pyx_t_6 = __pyx_v_n;
    for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
      __pyx_v_j = __pyx_t_7;
 28:             s = 0
      /* "/home/skipper/statsmodels/statsmodels-skipper/scikits/statsmodels/tsa/kalmanf/matmult.pyx":28
 *     for i in xrange(lda):
 *         for j in xrange(n):
 *             s = 0             # <<<<<<<<<<<<<<
 *             for k in xrange(A.shape[1]):
 *                 s += A[i,k] * B[k,j]
 */
      __pyx_v_s = 0.0;
 29:             for k in xrange(A.shape[1]):
      /* "/home/skipper/statsmodels/statsmodels-skipper/scikits/statsmodels/tsa/kalmanf/matmult.pyx":29
 *         for j in xrange(n):
 *             s = 0
 *             for k in xrange(A.shape[1]):             # <<<<<<<<<<<<<<
 *                 s += A[i,k] * B[k,j]
 *             out[i,j] = s
 */
      __pyx_t_8 = (__pyx_v_A->dimensions[1]);
      for (__pyx_t_9 = 0; __pyx_t_9 < __pyx_t_8; __pyx_t_9+=1) {
        __pyx_v_k = __pyx_t_9;
 30:                 s += A[i,k] * B[k,j]
        /* "/home/skipper/statsmodels/statsmodels-skipper/scikits/statsmodels/tsa/kalmanf/matmult.pyx":30
 *             s = 0
 *             for k in xrange(A.shape[1]):
 *                 s += A[i,k] * B[k,j]             # <<<<<<<<<<<<<<
 *             out[i,j] = s
 *     return out
 */
        __pyx_t_10 = __pyx_v_i;
        __pyx_t_11 = __pyx_v_k;
        __pyx_t_12 = __pyx_v_k;
        __pyx_t_13 = __pyx_v_j;
        __pyx_v_s += ((*__Pyx_BufPtrCContig2d(__pyx_t_7scikits_11statsmodels_3tsa_7kalmanf_7matmult_DOUBLE *, __pyx_bstruct_A.buf, __pyx_t_10, __pyx_bstride_0_A, __pyx_t_11, __pyx_bstride_1_A)) * (*__Pyx_BufPtrCContig2d(__pyx_t_7scikits_11statsmodels_3tsa_7kalmanf_7matmult_DOUBLE *, __pyx_bstruct_B.buf, __pyx_t_12, __pyx_bstride_0_B, __pyx_t_13, __pyx_bstride_1_B)));
      }
 31:             out[i,j] = s
      /* "/home/skipper/statsmodels/statsmodels-skipper/scikits/statsmodels/tsa/kalmanf/matmult.pyx":31
 *             for k in xrange(A.shape[1]):
 *                 s += A[i,k] * B[k,j]
 *             out[i,j] = s             # <<<<<<<<<<<<<<
 *     return out
 * 
 */
      __pyx_t_9 = __pyx_v_i;
      __pyx_t_14 = __pyx_v_j;
      *__Pyx_BufPtrStrided2d(__pyx_t_7scikits_11statsmodels_3tsa_7kalmanf_7matmult_DOUBLE *, __pyx_bstruct_out.buf, __pyx_t_9, __pyx_bstride_0_out, __pyx_t_14, __pyx_bstride_1_out) = __pyx_v_s;
    }
  }
 32:     return out
  /* "/home/skipper/statsmodels/statsmodels-skipper/scikits/statsmodels/tsa/kalmanf/matmult.pyx":32
 *                 s += A[i,k] * B[k,j]
 *             out[i,j] = s
 *     return out             # <<<<<<<<<<<<<<
 * 
 * def multAB(ndarray[DOUBLE, ndim=2] A, ndarray[DOUBLE, ndim=2] B):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_out));
  __pyx_r = ((PyObject *)__pyx_v_out);
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_A);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_B);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_out);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("scikits.statsmodels.tsa.kalmanf.matmult.matmult");
  __pyx_r = 0;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_A);
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_B);
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_out);
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_out);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
 33: 
 34: def multAB(ndarray[DOUBLE, ndim=2] A, ndarray[DOUBLE, ndim=2] B):
/* "/home/skipper/statsmodels/statsmodels-skipper/scikits/statsmodels/tsa/kalmanf/matmult.pyx":34
 *     return out
 * 
 * def multAB(ndarray[DOUBLE, ndim=2] A, ndarray[DOUBLE, ndim=2] B):             # <<<<<<<<<<<<<<
 *     for i in xrange(1000000):
 *         C = matmult(A,B)
 */

static PyObject *__pyx_pf_7scikits_11statsmodels_3tsa_7kalmanf_7matmult_multAB(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pf_7scikits_11statsmodels_3tsa_7kalmanf_7matmult_multAB(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyArrayObject *__pyx_v_A = 0;
  PyArrayObject *__pyx_v_B = 0;
  long __pyx_v_i;
  PyObject *__pyx_v_C;
  Py_buffer __pyx_bstruct_A;
  Py_ssize_t __pyx_bstride_0_A = 0;
  Py_ssize_t __pyx_bstride_1_A = 0;
  Py_ssize_t __pyx_bshape_0_A = 0;
  Py_ssize_t __pyx_bshape_1_A = 0;
  Py_buffer __pyx_bstruct_B;
  Py_ssize_t __pyx_bstride_0_B = 0;
  Py_ssize_t __pyx_bstride_1_B = 0;
  Py_ssize_t __pyx_bshape_0_B = 0;
  Py_ssize_t __pyx_bshape_1_B = 0;
  PyObject *__pyx_r = NULL;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__A,&__pyx_n_s__B,0};
  __Pyx_TraceDeclarations
  __Pyx_RefNannySetupContext("multAB");
  __Pyx_TraceCall("multAB", __pyx_f[0], 34);
  __pyx_self = __pyx_self;
  if (unlikely(__pyx_kwds)) {
    Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
    PyObject* values[2] = {0,0};
    switch (PyTuple_GET_SIZE(__pyx_args)) {
      case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      case  0: break;
      default: goto __pyx_L5_argtuple_error;
    }
    switch (PyTuple_GET_SIZE(__pyx_args)) {
      case  0:
      values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__A);
      if (likely(values[0])) kw_args--;
      else goto __pyx_L5_argtuple_error;
      case  1:
      values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__B);
      if (likely(values[1])) kw_args--;
      else {
        __Pyx_RaiseArgtupleInvalid("multAB", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    }
    if (unlikely(kw_args > 0)) {
      if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "multAB") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    }
    __pyx_v_A = ((PyArrayObject *)values[0]);
    __pyx_v_B = ((PyArrayObject *)values[1]);
  } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
    goto __pyx_L5_argtuple_error;
  } else {
    __pyx_v_A = ((PyArrayObject *)PyTuple_GET_ITEM(__pyx_args, 0));
    __pyx_v_B = ((PyArrayObject *)PyTuple_GET_ITEM(__pyx_args, 1));
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("multAB", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("scikits.statsmodels.tsa.kalmanf.matmult.multAB");
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_v_C = Py_None; __Pyx_INCREF(Py_None);
  __pyx_bstruct_A.buf = NULL;
  __pyx_bstruct_B.buf = NULL;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_A), __pyx_ptype_5numpy_ndarray, 1, "A", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_B), __pyx_ptype_5numpy_ndarray, 1, "B", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_A, (PyObject*)__pyx_v_A, &__Pyx_TypeInfo_nn___pyx_t_7scikits_11statsmodels_3tsa_7kalmanf_7matmult_DOUBLE, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_bstride_0_A = __pyx_bstruct_A.strides[0]; __pyx_bstride_1_A = __pyx_bstruct_A.strides[1];
  __pyx_bshape_0_A = __pyx_bstruct_A.shape[0]; __pyx_bshape_1_A = __pyx_bstruct_A.shape[1];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_B, (PyObject*)__pyx_v_B, &__Pyx_TypeInfo_nn___pyx_t_7scikits_11statsmodels_3tsa_7kalmanf_7matmult_DOUBLE, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_bstride_0_B = __pyx_bstruct_B.strides[0]; __pyx_bstride_1_B = __pyx_bstruct_B.strides[1];
  __pyx_bshape_0_B = __pyx_bstruct_B.shape[0]; __pyx_bshape_1_B = __pyx_bstruct_B.shape[1];
 35:     for i in xrange(1000000):
  /* "/home/skipper/statsmodels/statsmodels-skipper/scikits/statsmodels/tsa/kalmanf/matmult.pyx":35
 * 
 * def multAB(ndarray[DOUBLE, ndim=2] A, ndarray[DOUBLE, ndim=2] B):
 *     for i in xrange(1000000):             # <<<<<<<<<<<<<<
 *         C = matmult(A,B)
 *     return C
 */
  for (__pyx_t_1 = 0; __pyx_t_1 < 1000000; __pyx_t_1+=1) {
    __pyx_v_i = __pyx_t_1;
 36:         C = matmult(A,B)
    /* "/home/skipper/statsmodels/statsmodels-skipper/scikits/statsmodels/tsa/kalmanf/matmult.pyx":36
 * def multAB(ndarray[DOUBLE, ndim=2] A, ndarray[DOUBLE, ndim=2] B):
 *     for i in xrange(1000000):
 *         C = matmult(A,B)             # <<<<<<<<<<<<<<
 *     return C
 * 
 */
    __pyx_t_2 = __pyx_f_7scikits_11statsmodels_3tsa_7kalmanf_7matmult_matmult(((PyArrayObject *)__pyx_v_A), ((PyArrayObject *)__pyx_v_B)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_v_C);
    __pyx_v_C = __pyx_t_2;
    __pyx_t_2 = 0;
  }
 37:     return C
  /* "/home/skipper/statsmodels/statsmodels-skipper/scikits/statsmodels/tsa/kalmanf/matmult.pyx":37
 *     for i in xrange(1000000):
 *         C = matmult(A,B)
 *     return C             # <<<<<<<<<<<<<<
 * 
 * def dotAB(ndarray[DOUBLE, ndim=2] A, ndarray[DOUBLE, ndim=2] B):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_C);
  __pyx_r = __pyx_v_C;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_A);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_B);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("scikits.statsmodels.tsa.kalmanf.matmult.multAB");
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_A);
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_B);
  __pyx_L2:;
  __Pyx_DECREF(__pyx_v_C);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
 38: 
 39: def dotAB(ndarray[DOUBLE, ndim=2] A, ndarray[DOUBLE, ndim=2] B):
/* "/home/skipper/statsmodels/statsmodels-skipper/scikits/statsmodels/tsa/kalmanf/matmult.pyx":39
 *     return C
 * 
 * def dotAB(ndarray[DOUBLE, ndim=2] A, ndarray[DOUBLE, ndim=2] B):             # <<<<<<<<<<<<<<
 *     for i in xrange(1000000):
 *         C = dot(A,B)
 */

static PyObject *__pyx_pf_7scikits_11statsmodels_3tsa_7kalmanf_7matmult_dotAB(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pf_7scikits_11statsmodels_3tsa_7kalmanf_7matmult_dotAB(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyArrayObject *__pyx_v_A = 0;
  PyArrayObject *__pyx_v_B = 0;
  long __pyx_v_i;
  PyObject *__pyx_v_C;
  Py_buffer __pyx_bstruct_A;
  Py_ssize_t __pyx_bstride_0_A = 0;
  Py_ssize_t __pyx_bstride_1_A = 0;
  Py_ssize_t __pyx_bshape_0_A = 0;
  Py_ssize_t __pyx_bshape_1_A = 0;
  Py_buffer __pyx_bstruct_B;
  Py_ssize_t __pyx_bstride_0_B = 0;
  Py_ssize_t __pyx_bstride_1_B = 0;
  Py_ssize_t __pyx_bshape_0_B = 0;
  Py_ssize_t __pyx_bshape_1_B = 0;
  PyObject *__pyx_r = NULL;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__A,&__pyx_n_s__B,0};
  __Pyx_TraceDeclarations
  __Pyx_RefNannySetupContext("dotAB");
  __Pyx_TraceCall("dotAB", __pyx_f[0], 39);
  __pyx_self = __pyx_self;
  if (unlikely(__pyx_kwds)) {
    Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
    PyObject* values[2] = {0,0};
    switch (PyTuple_GET_SIZE(__pyx_args)) {
      case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      case  0: break;
      default: goto __pyx_L5_argtuple_error;
    }
    switch (PyTuple_GET_SIZE(__pyx_args)) {
      case  0:
      values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__A);
      if (likely(values[0])) kw_args--;
      else goto __pyx_L5_argtuple_error;
      case  1:
      values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__B);
      if (likely(values[1])) kw_args--;
      else {
        __Pyx_RaiseArgtupleInvalid("dotAB", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    }
    if (unlikely(kw_args > 0)) {
      if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "dotAB") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    }
    __pyx_v_A = ((PyArrayObject *)values[0]);
    __pyx_v_B = ((PyArrayObject *)values[1]);
  } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
    goto __pyx_L5_argtuple_error;
  } else {
    __pyx_v_A = ((PyArrayObject *)PyTuple_GET_ITEM(__pyx_args, 0));
    __pyx_v_B = ((PyArrayObject *)PyTuple_GET_ITEM(__pyx_args, 1));
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("dotAB", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("scikits.statsmodels.tsa.kalmanf.matmult.dotAB");
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_v_C = Py_None; __Pyx_INCREF(Py_None);
  __pyx_bstruct_A.buf = NULL;
  __pyx_bstruct_B.buf = NULL;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_A), __pyx_ptype_5numpy_ndarray, 1, "A", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_B), __pyx_ptype_5numpy_ndarray, 1, "B", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_A, (PyObject*)__pyx_v_A, &__Pyx_TypeInfo_nn___pyx_t_7scikits_11statsmodels_3tsa_7kalmanf_7matmult_DOUBLE, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_bstride_0_A = __pyx_bstruct_A.strides[0]; __pyx_bstride_1_A = __pyx_bstruct_A.strides[1];
  __pyx_bshape_0_A = __pyx_bstruct_A.shape[0]; __pyx_bshape_1_A = __pyx_bstruct_A.shape[1];
  {
    __Pyx_BufFmt_StackElem __pyx_stack[1];
    if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_bstruct_B, (PyObject*)__pyx_v_B, &__Pyx_TypeInfo_nn___pyx_t_7scikits_11statsmodels_3tsa_7kalmanf_7matmult_DOUBLE, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_bstride_0_B = __pyx_bstruct_B.strides[0]; __pyx_bstride_1_B = __pyx_bstruct_B.strides[1];
  __pyx_bshape_0_B = __pyx_bstruct_B.shape[0]; __pyx_bshape_1_B = __pyx_bstruct_B.shape[1];
 40:     for i in xrange(1000000):
  /* "/home/skipper/statsmodels/statsmodels-skipper/scikits/statsmodels/tsa/kalmanf/matmult.pyx":40
 * 
 * def dotAB(ndarray[DOUBLE, ndim=2] A, ndarray[DOUBLE, ndim=2] B):
 *     for i in xrange(1000000):             # <<<<<<<<<<<<<<
 *         C = dot(A,B)
 *     return C
 */
  for (__pyx_t_1 = 0; __pyx_t_1 < 1000000; __pyx_t_1+=1) {
    __pyx_v_i = __pyx_t_1;
 41:         C = dot(A,B)
    /* "/home/skipper/statsmodels/statsmodels-skipper/scikits/statsmodels/tsa/kalmanf/matmult.pyx":41
 * def dotAB(ndarray[DOUBLE, ndim=2] A, ndarray[DOUBLE, ndim=2] B):
 *     for i in xrange(1000000):
 *         C = dot(A,B)             # <<<<<<<<<<<<<<
 *     return C
 * 
 */
    __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__dot); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_INCREF(((PyObject *)__pyx_v_A));
    PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_A));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_A));
    __Pyx_INCREF(((PyObject *)__pyx_v_B));
    PyTuple_SET_ITEM(__pyx_t_3, 1, ((PyObject *)__pyx_v_B));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_B));
    __pyx_t_4 = PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_v_C);
    __pyx_v_C = __pyx_t_4;
    __pyx_t_4 = 0;
  }
 42:     return C
  /* "/home/skipper/statsmodels/statsmodels-skipper/scikits/statsmodels/tsa/kalmanf/matmult.pyx":42
 *     for i in xrange(1000000):
 *         C = dot(A,B)
 *     return C             # <<<<<<<<<<<<<<
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_C);
  __pyx_r = __pyx_v_C;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
    __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_A);
    __Pyx_SafeReleaseBuffer(&__pyx_bstruct_B);
  __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
  __Pyx_AddTraceback("scikits.statsmodels.tsa.kalmanf.matmult.dotAB");
  __pyx_r = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_A);
  __Pyx_SafeReleaseBuffer(&__pyx_bstruct_B);
  __pyx_L2:;
  __Pyx_DECREF(__pyx_v_C);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_TraceReturn(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
 43: