Changeset 806c18 in git for factory/facFqFactorizeUtil.cc


Ignore:
Timestamp:
Nov 15, 2010, 4:34:57 PM (13 years ago)
Author:
Hans Schoenemann <hannes@…>
Branches:
(u'jengelh-datetime', 'ceac47cbc86fe4a15902392bdbb9bd2ae0ea02c6')(u'spielwiese', 'ba3e3ef698fa0b7c5867199959cc83330073d3cb')
Children:
7c3bca08c96331a56864c1d35b8c2e8ff2e0be89
Parents:
c840d97af622b4e4da8761738b540e21144f716b
Message:
format

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

Legend:

Unmodified
Added
Removed
  • factory/facFqFactorizeUtil.cc

    rc840d9 r806c18  
    11/*****************************************************************************\
    2  * Computer Algebra System SINGULAR   
     2 * Computer Algebra System SINGULAR
    33\*****************************************************************************/
    44/** @file facFqFactorizeUtil.cc
    5  * 
     5 *
    66 * This file provides utility functions for multivariate factorization
    77 *
     
    1818#include "cf_map.h"
    1919
    20 static inline 
     20static inline
    2121void appendSwap (CFList& factors1, const CFList& factors2, const int
    22                   swapLevel1, const int swapLevel2, const Variable& x) 
     22                  swapLevel1, const int swapLevel2, const Variable& x)
    2323{
    24   for (CFListIterator i= factors2; i.hasItem(); i++) 
    25   { 
    26     if (swapLevel1) 
     24  for (CFListIterator i= factors2; i.hasItem(); i++)
     25  {
     26    if (swapLevel1)
    2727    {
    2828      if (swapLevel2)
    29         factors1.append (swapvar (swapvar (i.getItem(), x,
     29        factors1.append (swapvar (swapvar (i.getItem(), x,
    3030                         Variable (swapLevel2)), Variable (swapLevel1), x));
    3131      else
    32         factors1.append (swapvar (i.getItem(), Variable (swapLevel1), x));
     32        factors1.append (swapvar (i.getItem(), Variable (swapLevel1), x));
    3333    }
    34     else 
     34    else
    3535    {
    3636      if (swapLevel2)
    37         factors1.append (swapvar (i.getItem(), x, Variable (swapLevel2)));
    38       else 
    39         factors1.append (i.getItem());
     37        factors1.append (swapvar (i.getItem(), x, Variable (swapLevel2)));
     38      else
     39        factors1.append (i.getItem());
    4040    }
    4141  }
     
    4545
    4646void swap (CFList& factors, const int swapLevel1, const int swapLevel2, const
    47            Variable& x) 
     47           Variable& x)
    4848{
    49   for (CFListIterator i= factors; i.hasItem(); i++) 
    50   { 
    51     if (swapLevel1) 
     49  for (CFListIterator i= factors; i.hasItem(); i++)
     50  {
     51    if (swapLevel1)
    5252    {
    5353      if (swapLevel2)
    54         i.getItem()= swapvar (swapvar (i.getItem(), x, Variable (swapLevel2)),
     54        i.getItem()= swapvar (swapvar (i.getItem(), x, Variable (swapLevel2)),
    5555                              Variable (swapLevel1), x);
    5656      else
    57         i.getItem()= swapvar (i.getItem(), Variable (swapLevel1), x);
     57        i.getItem()= swapvar (i.getItem(), Variable (swapLevel1), x);
    5858    }
    59     else 
     59    else
    6060    {
    6161      if (swapLevel2)
    62         i.getItem()= swapvar (i.getItem(), x, Variable (swapLevel2));
     62        i.getItem()= swapvar (i.getItem(), x, Variable (swapLevel2));
    6363    }
    6464  }
     
    6666}
    6767
    68 void appendSwapDecompress (CFList& factors1, const CFList& factors2, 
     68void appendSwapDecompress (CFList& factors1, const CFList& factors2,
    6969                             const CFMap& N, const int swapLevel, const
    70                              Variable& x) 
     70                             Variable& x)
    7171{
    72   for (CFListIterator i= factors1; i.hasItem(); i++) 
     72  for (CFListIterator i= factors1; i.hasItem(); i++)
    7373  {
    74     if (swapLevel)   
     74    if (swapLevel)
    7575      i.getItem()= swapvar (i.getItem(), Variable (swapLevel), x);
    7676    i.getItem()= N(i.getItem());
    7777  }
    78   for (CFListIterator i= factors2; i.hasItem(); i++) 
     78  for (CFListIterator i= factors2; i.hasItem(); i++)
    7979  {
    80     if (!i.getItem().inCoeffDomain()) 
     80    if (!i.getItem().inCoeffDomain())
    8181      factors1.append (N (i.getItem()));
    8282  }
     
    8484}
    8585
    86 void appendSwapDecompress (CFList& factors1, const CFList& factors2, 
    87                              const CFMap& N, const int swapLevel1, 
    88                              const int swapLevel2, const Variable& x) 
     86void appendSwapDecompress (CFList& factors1, const CFList& factors2,
     87                             const CFMap& N, const int swapLevel1,
     88                             const int swapLevel2, const Variable& x)
    8989{
    90   for (CFListIterator i= factors1; i.hasItem(); i++) 
     90  for (CFListIterator i= factors1; i.hasItem(); i++)
    9191  {
    92     if (swapLevel1) 
     92    if (swapLevel1)
    9393    {
    94       if (swapLevel2) 
     94      if (swapLevel2)
    9595        i.getItem()=
    9696        N (swapvar (swapvar (i.getItem(), Variable (swapLevel2), x), x,
    9797                    Variable (swapLevel1)));
    98       else 
     98      else
    9999        i.getItem()= N (swapvar (i.getItem(), x, Variable (swapLevel1)));
    100100    }
    101     else 
     101    else
    102102    {
    103103      if (swapLevel2)
     
    107107    }
    108108  }
    109   for (CFListIterator i= factors2; i.hasItem(); i++) 
    110   { 
    111     if (!i.getItem().inCoeffDomain()) 
     109  for (CFListIterator i= factors2; i.hasItem(); i++)
     110  {
     111    if (!i.getItem().inCoeffDomain())
    112112      factors1.append (N (i.getItem()));
    113113  }
     
    115115}
    116116
    117 int* liftingBounds (const CanonicalForm& A, const int& bivarLiftBound) 
     117int* liftingBounds (const CanonicalForm& A, const int& bivarLiftBound)
    118118{
    119119  int j= A.level() - 1;
    120120  int* liftBounds= new int [j];
    121121  liftBounds[0]= bivarLiftBound;
    122   for (int i= 1; i < j; i++) 
     122  for (int i= 1; i < j; i++)
    123123  {
    124     liftBounds[i]= degree (A, Variable (i + 2)) + 1 + 
     124    liftBounds[i]= degree (A, Variable (i + 2)) + 1 +
    125125                            degree (LC (A, 1), Variable (i + 2));
    126126  }
Note: See TracChangeset for help on using the changeset viewer.