source: git/factory/cf_reval.cc @ e44bd88

fieker-DuValspielwiese
Last change on this file since e44bd88 was 157108, checked in by Hans Schönemann <hannes@…>, 23 years ago
*hannes: fixed memory leaks git-svn-id: file:///usr/local/Singular/svn/trunk@5107 2c84dea3-7e68-4137-9b89-c4e89433aadc
  • Property mode set to 100644
File size: 783 bytes
Line 
1/* emacs edit mode for this file is -*- C++ -*- */
2/* $Id: cf_reval.cc,v 1.3 2001-01-19 18:11:50 Singular Exp $ */
3
4#include <config.h>
5
6#include "assert.h"
7
8#include "cf_defs.h"
9#include "cf_reval.h"
10
11
12REvaluation::REvaluation( const REvaluation & e )
13{
14    if ( e.gen == 0 )
15        gen = 0;
16    else
17        gen = e.gen->clone();
18    values = e.values;
19}
20
21REvaluation::~REvaluation()
22{
23    if ( gen != 0 )
24        delete gen;
25}
26
27REvaluation&
28REvaluation::operator= ( const REvaluation & e )
29{
30    if ( this != &e ) {
31        if (gen!=0)
32          delete gen;
33        values = e.values;
34        if ( e.gen == 0 )
35            gen = 0;
36        else
37            gen = e.gen->clone();
38    }
39    return *this;
40}
41
42void
43REvaluation::nextpoint()
44{
45    int n = values.max();
46    for ( int i = values.min(); i <= n; i++ )
47        values[i] = gen->generate();
48}
Note: See TracBrowser for help on using the repository browser.