Changeset 59b329d in tol


Ignore:
Timestamp:
Oct 17, 2012, 4:18:28 PM (14 years ago)
Author:
Víctor de Buen <vdebuen@…>
Branches:
1941-docker-image-to-test, devel, master
Children:
c2d5bcee
Parents:
6ca24fa
Message:

Refs #1136
Fixed bug in RandStationary

git-svn-id: ​https://www.tol-project.org/svn/tolp/trunk@5276 be4846ae-f051-483a-831f-b64e7d08527f

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tol/btol/polynomial_type/polgra.cpp

    r6ca24fa r59b329d  
    510510  BPol p1 = BPol::One();
    511511  BPol p2 = BPol::One();
    512   BUniformDist u(-1,1);
    513512  BDat a, b, d, m1, m2;
    514513  BPol B0 = BPol::One();
    515514  BPol BP = BPol::X() ^ period;
    516515  BPol factor;
     516  BUniformDist u(-1,1);
     517
    517518  if(maxInvRootModule>1-2*DEpsilon()) { maxInvRootModule = 1-2*DEpsilon(); }
    518519  if(maxInvRootModule<  2*DEpsilon()) { maxInvRootModule =   2*DEpsilon(); }
    … …  
    525526  if(n1)
    526527  {
     528    BUniformDist v(0,1);
     529    BDat vr = v.Random();
    527530    BDat ur = u.Random();
    528     a = maxInvRootModule*ur + minInvRootModule*(1-ur);
     531    a = maxInvRootModule*vr + minInvRootModule*(1-vr);
     532    if(ur<0) { a*=-1.0; }
    529533    factor = B0-a*BP;
    530534  //Std(BText("\nRandStationary(")+degree+","+period+","+maxInvRootModule+") monome a="+a+"; factor="+factor.Name());
Note: See TracChangeset for help on using the changeset viewer.