My Project
Toggle main menu visibility
Loading...
Searching...
No Matches
factory
cf_eval.cc
Go to the documentation of this file.
1
/* emacs edit mode for this file is -*- C++ -*- */
2
3
4
#include "config.h"
5
6
7
#include "
cf_assert.h
"
8
9
#include "
cf_defs.h
"
10
#include "
cf_eval.h
"
11
12
static
CanonicalForm
evalCF
(
const
CanonicalForm
&
f
,
const
CFArray
& a,
int
m
,
int
n );
13
14
15
Evaluation
&
Evaluation::operator=
(
const
Evaluation
& e )
16
{
17
if
(
this
!= &e ) {
18
values
= e.
values
;
19
}
20
return
*
this
;
21
}
22
23
CanonicalForm
24
Evaluation::operator()
(
const
CanonicalForm
&
f
)
const
25
{
26
if
(
f
.inCoeffDomain() ||
f
.level() <
values
.min() )
27
return
f
;
28
else
if
(
f
.level() <
values
.max() )
29
return
evalCF
(
f
,
values
,
values
.min(),
f
.level() );
30
else
31
return
evalCF
(
f
,
values
,
values
.min(),
values
.max() );
32
}
33
34
CanonicalForm
35
Evaluation::operator()
(
const
CanonicalForm
&
f
,
int
i
,
int
j
)
const
36
{
37
if
(
i
>
j
)
38
return
f
;
39
return
evalCF
(
f
,
values
,
i
,
j
);
40
}
41
42
void
43
Evaluation::nextpoint
()
44
{
45
int
n =
values
.max();
46
for
(
int
i
=
values
.min();
i
<= n;
i
++ )
47
values
[
i
] += 1;
48
}
49
50
void
51
Evaluation::setValue
(
int
i
,
const
CanonicalForm
&
f
)
52
{
53
if
(
i
<
values
.min() ||
i
>
values
.max())
54
return
;
55
values
[
i
]=
f
;
56
}
57
58
#ifndef NOSTREAMIO
59
OSTREAM
&
60
operator<<
(
OSTREAM
&
s
,
const
Evaluation
&e )
61
{
62
e.
values
.
print
(
s
);
63
return
s
;
64
}
65
#endif
/* NOSTREAMIO */
66
67
CanonicalForm
68
evalCF
(
const
CanonicalForm
&
f
,
const
CFArray
& a,
int
m
,
int
n )
69
{
70
if
(
m
> n )
71
return
f
;
72
else
{
73
CanonicalForm
result
=
f
;
74
while
( n >=
m
) {
75
result
=
result
( a[n],
Variable
( n ) );
76
n--;
77
}
78
return
result
;
79
}
80
// iterated method turned out to be faster than
81
// return evalCF( f( a[n], Variable( n ) ), a, m, n-1 );
82
}
CFArray
Array< CanonicalForm > CFArray
Definition
canonicalform.h:397
m
int m
Definition
cfEzgcd.cc:128
i
int i
Definition
cfEzgcd.cc:132
cf_assert.h
assertions for Factory
cf_defs.h
factory switches.
evalCF
static CanonicalForm evalCF(const CanonicalForm &f, const CFArray &a, int m, int n)
Definition
cf_eval.cc:68
operator<<
OSTREAM & operator<<(OSTREAM &s, const Evaluation &e)
Definition
cf_eval.cc:60
cf_eval.h
evaluate polynomials at points
f
FILE * f
Definition
checklibs.c:9
Array::print
void print(OSTREAM &) const
Definition
ftmpl_array.cc:138
CanonicalForm
factory's main class
Definition
canonicalform.h:86
Evaluation::setValue
void setValue(int i, const CanonicalForm &f)
Definition
cf_eval.cc:51
Evaluation::values
CFArray values
Definition
cf_eval.h:34
Evaluation::operator=
Evaluation & operator=(const Evaluation &e)
Definition
cf_eval.cc:15
Evaluation::operator()
CanonicalForm operator()(const CanonicalForm &f) const
Definition
cf_eval.cc:24
Evaluation::nextpoint
virtual void nextpoint()
Definition
cf_eval.cc:43
Evaluation::Evaluation
Evaluation()
Definition
cf_eval.h:36
Variable
factory's class for variables
Definition
factory.h:127
result
return result
Definition
facAbsBiFact.cc:76
s
const CanonicalForm int s
Definition
facAbsFact.cc:51
j
int j
Definition
facHensel.cc:110
OSTREAM
#define OSTREAM
Generated on
for My Project by
doxygen 1.17.0
for
Singular