68 : _powers(other._powers)
69 , _allPermutations(other._allPermutations)
82 for(
unsigned int i=0; i <
_powers.size(); i++){
92 for(
unsigned int i=0; i <
_powers.size()-1; i++){
93 for(
unsigned int j=i+1; j <
_powers.size(); j++){
95 for(
unsigned int k = 0; k < n; k++){
97 swap(ptemp[i],ptemp[j]);
105 std::vector< std::vector<int> >::iterator
115 bool firstTerm(
true);
119 if(! firstTerm ) os <<
" + ";
122 for(
unsigned int j = 0; j < thisPerm.size(); j++){
123 thisSum += thisPerm[j];
124 if(0 == j) os <<
" ";
125 if(0 != thisPerm[j]){
127 if(1 != thisPerm[j]) os <<
"^" << thisPerm[j];
132 if(0 == thisSum) os <<
"1 ";
137 static std::vector<const double* > ptrs(2);
143 std::vector<const double* > ptrs(3);
151 static std::vector<const double* > ptrs(4);
159 ,
double u,
double v)
const{
160 std::vector<const double* > ptrs(5);
169 ,
double u,
double v,
double w)
const{
170 static std::vector<const double* > ptrs(6);
181 if(x.size() !=
_powers.size()){
182 cout <<
"symPolyTerm::eval: size mismatch|!!!" 183 <<
" me: " <<
_powers.size() <<
" vs x: " << x.size()
187 throw "can't deal with this";
194 for(
unsigned int j = 0; j < thisPerm.size(); j++){
195 prod *= pow((x[j]), thisPerm[j]);
203 if(x.size() !=
_powers.size()){
204 cout <<
"symPolyTerm::eval: size mismatch|!!!" 205 <<
" me: " <<
_powers.size() <<
" vs x: " << x.size()
209 throw "can't deal with this";
216 for(
unsigned int j = 0; j < thisPerm.size(); j++){
217 prod *= pow((*(x[j])), thisPerm[j]);
225 if(x.size() !=
_powers.size()){
226 cout <<
"symPolyTerm::eval: size mismatch|!!!" 227 <<
" me: " <<
_powers.size() <<
" vs x: " << x.size()
231 throw "can't deal with this";
238 for(
unsigned int j = 0; j < thisPerm.size(); j++){
239 prod *= pow((*(x[j])), thisPerm[j]);
std::vector< int > _powers
void makeAllPermutations()
std::ostream & operator<<(std::ostream &os, const symPolyTerm &spt)
void print(std::ostream &os=std::cout) const
std::string anythingToString(const T &anything)
double eval(double x, double y) const
std::vector< std::vector< int > > _allPermutations
symPolyTerm(const std::vector< int > &pos)