Changeset 74802b in git


Ignore:
Timestamp:
Feb 25, 2007, 10:40:24 AM (16 years ago)
Author:
Michael Brickenstein <bricken@…>
Branches:
(u'spielwiese', '0d6b7fcd9813a1ca1ed4220cfa2b104b97a0a003')
Children:
8120f8d31249d952812c48928a245fe445f5abd1
Parents:
d7cb5209bebe803a759d89681cb9177e09e438f8
Message:
*bricken: more structure for profiling


git-svn-id: file:///usr/local/Singular/svn/trunk@9898 2c84dea3-7e68-4137-9b89-c4e89433aadc
File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/tgb_internal.h

    rd7cb52 r74802b  
    55*  Computer Algebra System SINGULAR     *
    66****************************************/
    7 /* $Id: tgb_internal.h,v 1.62 2007-02-25 06:09:43 bricken Exp $ */
     7/* $Id: tgb_internal.h,v 1.63 2007-02-25 09:40:24 bricken Exp $ */
    88/*
    99 * ABSTRACT: tgb internal .h file
     
    762762template<class number_type> SparseRow<number_type>* convert_to_sparse_row(number_type* temp_array,int temp_size,int non_zeros){
    763763SparseRow<number_type>* res=new SparseRow<number_type>(non_zeros);
    764 int pos=0;
     764//int pos=0;
     765number_type* it_coef=res->coef_array;
     766int* it_idx=res->idx_array;
    765767#if 0
    766768for(i=0;i<cache->nIrreducibleMonomials;i++){
     
    797799    const int temp_index=((number_type*)((void*) it))-temp_array;
    798800    const int bound=temp_index+multiple;
     801    number_type c;
    799802    for(small_i=temp_index;small_i<bound;small_i++){
    800       if(temp_array[small_i]!=0){
    801         res->idx_array[pos]=small_i;
    802         res->coef_array[pos]=temp_array[small_i];
    803 
    804         pos++;
     803      if((c=temp_array[small_i])!=0){
     804        //res->idx_array[pos]=small_i;
     805        //res->coef_array[pos]=temp_array[small_i];
     806        (*(it_idx++))=small_i;
     807        (*(it_coef++))=c;
     808        //pos++;
    805809        non_zeros--;
    806810       
    807811      }
    808       if (non_zeros==0) break;
     812      if UNLIKELY(non_zeros==0) break;
    809813    }
    810814   
     
    815819return res;
    816820}
    817 
     821template <class number_type> void add_coef_times_sparse(number_type* temp_array,int temp_size,SparseRow<number_type>* row, number coef){
     822  int j;
     823  for(j=0;j<row->len;j++){
     824    int idx=row->idx_array[j];
     825    assume(!(npIsZero(coef)));
     826    assume(!(npIsZero((number) row->coef_array[j])));
     827    temp_array[idx]=F4mat_to_number_type(npAddM((number) temp_array[idx],npMultM((number) row->coef_array[j],coef)));
     828    assume(idx<temp_size);
     829  }
     830}
    818831template<class number_type> SparseRow<number_type> * noro_red_to_non_poly_t(poly p, int &len, NoroCache<number_type>* cache,slimgb_alg* c){
    819832  assume(len==pLength(p));
     
    860873        int j;
    861874        if (!((coef==(number) 1)||(coef==minus_one))){
    862         for(j=0;j<row->len;j++){
    863           int idx=row->idx_array[j];
    864           assume(!(npIsZero(coef)));
    865           assume(!(npIsZero((number) row->coef_array[j])));
    866           temp_array[idx]=F4mat_to_number_type(npAddM((number) temp_array[idx],npMultM((number) row->coef_array[j],coef)));
    867           assume(idx<temp_size);
    868         }}else{
     875          add_coef_times_sparse(temp_array,temp_size,row,coef);
     876       
     877       
     878       
     879        }else{
    869880          if (coef==(number) 1){
    870881          for(j=0;j<row->len;j++){
Note: See TracChangeset for help on using the changeset viewer.