if (maskObj->nd != 1 || maskObj->descr->type_num != PyArray_INT || maskObj->dimensions[0] != self->dim[0]) {
if (maskObj->nd != 1 || maskObj->descr->type_num != PyArray_LONG || maskObj->dimensions[0] != self->dim[0]) {
LLMat_delete_rowcols(LLMatObject *self, PyObject* args){  PyArrayObject *maskObj;  int newn, newm, newnnz;  int act, old, col, row;  int *shift;    if (!PyArg_ParseTuple(args, "O!", &PyArray_Type, &maskObj))     return NULL;  if (maskObj->nd != 1 || maskObj->descr->type_num != PyArray_INT || maskObj->dimensions[0] != self->dim[0]) {    PyErr_SetString(PyExc_ValueError, "mask must be a 1D integer NumPy array of appropriate length");    return NULL;  }  if (self->dim[0] != self->dim[1]) {    PyErr_SetString(SpMatrix_ErrorObject, "method only allowed for square matrices");    return NULL;  }#define MASK(i) *(int *)(maskObj->data + (i)*maskObj->strides[0])  /* Delete the rows to be cancelled by rearranging the row */  /* array. After having done so, newdim is the new matrix dim. */  newm = 0;  newnnz = self->nnz;  for(row = 0; row < self->dim[0]; row ++){    if (MASK(row)){			       /* This row has to be kept */      self->root[newm] = self->root[row];      newm ++;    } else {				       /* row let out; update free list */      act = self->root[row];      if(act != -1){			       /* only do smth. for non-empty rows */	newnnz --;	while(self->link[act] != -1) {	       /* Walk to the end of the list */	  act = self->link[act];	  newnnz --;	}	self->link[act] = self->free;	       /* Attach end of row to free list */	self->free = self->root[row];	       /* Start free list where row began */      }    }  }  /* Set the new values */  self->dim[0] = newm;  self->nnz = newnnz;  /* Allocate column shift vector (after deletion col[i] is at */  /* col[i] - shift[i]). */  shift = (int*)malloc((self->dim[1])*sizeof(int));  newn = self->dim[1];  if (MASK(0)) shift[0] = 0; else {shift[0] = 1; newn --;}  for (col = 1; col < self->dim[1]; col++){    if (MASK(col))       shift[col] = shift[col-1];     else       {shift[col] = shift[col-1]+1; newn --; }  }      /* Deleteting columns in the remainig rows */  newnnz = self->nnz;  for(row = 0; row < self->dim[0]; row ++) {    old = -1; act = self->root[row];    while (act != -1){      if (MASK(self->col[act])) {	       /* Keep this column */	self->col[act] -= shift[self->col[act]];	old = act; act = self->link[act];      } else {				       /* Drop the column */	newnnz--;                              	if (self->root[row] == act) {	       /* Special case: first row element */	  self->root[row] = self->link[act];	  old = act; act = self->link[act];	  self->link[old] = self->free;	       /* Append element into freelist */	  self->free = old;	} else {			       /* Regular case: element inbetween */	  act = self->link[act];	  self->link[self->link[old]] = self->free;	  self->free = self->link[old];	  self->link[old] = act;	       /* Append element into freelist */	}      }    }  }  /* Set the new values */  self->dim[1] = newn;  self->nnz = newnnz;  /* clean up */  free(shift);  Py_INCREF(Py_None);   return Py_None;#undef MASK}