Changeset 38ac8c in git


Ignore:
Timestamp:
May 26, 2011, 7:42:56 PM (13 years ago)
Author:
Martin Lee <martinlee84@…>
Branches:
(u'fieker-DuVal', '117eb8c30fc9e991c4decca4832b1d19036c4c65')(u'spielwiese', '8c6038b526213d378981739e978a9f7b485dab94')
Children:
6e80ab1defd5ab31610bce94c4f375be2fec8d0e
Parents:
f7d7455516e751906e8f7bb3d265fb06b8b3711e
Message:
added new function to get random eval point
added new function to set value of an evaluation point


git-svn-id: file:///usr/local/Singular/svn/trunk@14247 2c84dea3-7e68-4137-9b89-c4e89433aadc
Location:
factory
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • factory/cf_eval.cc

    rf7d745 r38ac8c  
    4747}
    4848
     49void
     50Evaluation::setValue(int i, const CanonicalForm& f)
     51{
     52  if (i < values.min() || i > values.max())
     53    return;
     54  values[i]= f;
     55}
     56
    4957#ifndef NOSTREAMIO
    5058OSTREAM&
  • factory/cf_eval.h

    rf7d745 r38ac8c  
    3737    CanonicalForm operator() ( const CanonicalForm& f ) const;
    3838    CanonicalForm operator() ( const CanonicalForm & f, int i, int j ) const;
     39    void setValue (int i, const CanonicalForm& f);
    3940    virtual void nextpoint();
    4041#ifndef NOSTREAMIO
  • factory/cf_reval.cc

    rf7d745 r38ac8c  
    4949        values[i] = gen->generate();
    5050}
     51
     52void
     53REvaluation::nextpoint (int n)
     54{
     55  int m= values.max();
     56  int t= values.min();
     57  for (int i= t; i <= m; i++)
     58    values [i]= 0;
     59
     60  if (m == t)
     61  {
     62    values [t]= gen->generate();
     63    return;
     64  }
     65  for (int i= 0; i < n; i++)
     66  {
     67    int l= factoryrandom (m - t + 1) + t;
     68    values [l]= gen->generate();
     69  }
     70}
  • factory/cf_reval.h

    rf7d745 r38ac8c  
    2424    REvaluation& operator= ( const REvaluation & e );
    2525    void nextpoint();
     26    void nextpoint(int n);
    2627};
    2728
Note: See TracChangeset for help on using the changeset viewer.