src/cmr/series_parallel.c
/**
 * \brief Processes the deletion of a nonzero from the linked-list representation.
 */
\brief Processes the deletion of a nonzero from the linked-list representation.
\ brief Processes the deletion of a nonzero from the linked - list representation .
static
CMR_ERROR processNonzero(
  CMR* cmr,                         
  CMR_LISTHASHTABLE* hashtable,     
  long long hashChange,             
  size_t index,                     
  ListMatrixElement* indexListData, 
  ElementData* indexData,           
  CMR_ELEMENT* queue,               
  size_t* pqueueEnd,                
  size_t queueMemory,               
  bool isRow                        
)
{
  assert(cmr);
  assert(indexData);
  assert(hashtable);
  assert(queue);
  indexListData->numNonzeros--;
  long long newHash = projectSignedHash(indexData->hashValue + hashChange);
  CMRdbgMsg(4, "Processing nonzero. Old hash is %ld, change is %ld, new hash is %ld.\n", indexData->hashValue,
    hashChange, newHash);
  indexData->hashValue = newHash;
  if (!indexData->inQueue)
  {
    queue[*pqueueEnd % queueMemory] = isRow ? CMRrowToElement(index) : CMRcolumnToElement(index);
    indexData->inQueue = true;
    (*pqueueEnd)++;
  }
  if (indexData->hashEntry != SIZE_MAX)
  {
    CMR_CALL( CMRlisthashtableRemove(cmr, hashtable, indexData->hashEntry) );
    indexData->hashEntry = SIZE_MAX;
  }
  return CMR_OKAY;
}
static CMR_ERROR processNonzero ( CMR * cmr , CMR_LISTHASHTABLE * hashtable , long long hashChange , size_t index , ListMatrixElement * indexListData , ElementData * indexData , CMR_ELEMENT * queue , size_t * pqueueEnd , size_t queueMemory , bool isRow ) { assert ( cmr ) ; assert ( indexData ) ; assert ( hashtable ) ; assert ( queue ) ; indexListData -> numNonzeros -- ; long long newHash = projectSignedHash ( indexData -> hashValue + hashChange ) ; CMRdbgMsg ( 4 , " \n " , indexData -> hashValue , hashChange , newHash ) ; indexData -> hashValue = newHash ; if ( ! indexData -> inQueue ) { queue [ * pqueueEnd % queueMemory ] = isRow ? CMRrowToElement ( index ) : CMRcolumnToElement ( index ) ; indexData -> inQueue = true ; ( * pqueueEnd ) ++ ; } if ( indexData -> hashEntry != SIZE_MAX ) { CMR_CALL ( CMRlisthashtableRemove ( cmr , hashtable , indexData -> hashEntry ) ) ; indexData -> hashEntry = SIZE_MAX ; } return CMR_OKAY ; }
\brief Processes the deletion of a nonzero from the linked-list representation.
\ brief Processes the deletion of a nonzero from the linked - list representation .
/**< \ref CMR environment. */ /**< Row/column hashtable. */ /**< Modification of the hash value. */ /**< Index of row/column. */ /**< Row/column list data. */ /**< Other row/column data. */ /**< Queue. */ /**< Pointer to end of queue. */ /**< Memory allocated for queue. */ /**< Whether we are dealing with rows. */ /* Add to queue if necessary. */ /* Remove from hashtable if necessary. */