* Implementation of GiNaC's sums of expressions. */
/*
- * GiNaC Copyright (C) 1999 Johannes Gutenberg University Mainz, Germany
+ * GiNaC Copyright (C) 1999-2000 Johannes Gutenberg University Mainz, Germany
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* Interface to GiNaC's sums of expressions. */
/*
- * GiNaC Copyright (C) 1999 Johannes Gutenberg University Mainz, Germany
+ * GiNaC Copyright (C) 1999-2000 Johannes Gutenberg University Mainz, Germany
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* Assertion macro definition. */
/*
- * GiNaC Copyright (C) 1999 Johannes Gutenberg University Mainz, Germany
+ * GiNaC Copyright (C) 1999-2000 Johannes Gutenberg University Mainz, Germany
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* Implementation of GiNaC's ABC. */
/*
- * GiNaC Copyright (C) 1999 Johannes Gutenberg University Mainz, Germany
+ * GiNaC Copyright (C) 1999-2000 Johannes Gutenberg University Mainz, Germany
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
<< ", hash=" << hashvalue << " (0x" << hex << hashvalue << dec << ")"
<< ", flags=" << flags
<< ", nops=" << nops() << endl;
- for (int i=0; i<nops(); ++i) {
+ for (unsigned i=0; i<nops(); ++i) {
op(i).printtree(os,indent+delta_indent);
}
}
return false; // all possible properties are false for basic objects
}
-int basic::nops() const
+unsigned basic::nops() const
{
return 0;
}
GINAC_ASSERT(other.bp!=0);
if (is_equal(*other.bp)) return true;
if (nops()>0) {
- for (int i=0; i<nops(); i++) {
+ for (unsigned i=0; i<nops(); i++) {
if (op(i).has(other)) return true;
}
}
unsigned basic::calchash(void) const
{
unsigned v=golden_ratio_hash(tinfo());
- for (int i=0; i<nops(); i++) {
+ for (unsigned i=0; i<nops(); i++) {
v=rotate_left_31(v);
v ^= (const_cast<basic *>(this))->let_op(i).gethash();
}
}
lst ls;
lst lr;
- for (int i=0; i<e.nops(); i++) {
+ for (unsigned i=0; i<e.nops(); i++) {
if (!e.op(i).info(info_flags::relation_equal)) {
throw(std::invalid_argument("basic::subs(ex): argument must be a list or equations"));
}
* Interface to GiNaC's ABC. */
/*
- * GiNaC Copyright (C) 1999 Johannes Gutenberg University Mainz, Germany
+ * GiNaC Copyright (C) 1999-2000 Johannes Gutenberg University Mainz, Germany
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
virtual void dbgprint(void) const;
virtual void dbgprinttree(void) const;
virtual bool info(unsigned inf) const;
- virtual int nops() const;
+ virtual unsigned nops() const;
virtual ex op(int const i) const;
virtual ex & let_op(int const i);
virtual ex operator[](ex const & index) const;
* No real implementation yet, to be done. */
/*
- * GiNaC Copyright (C) 1999 Johannes Gutenberg University Mainz, Germany
+ * GiNaC Copyright (C) 1999-2000 Johannes Gutenberg University Mainz, Germany
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* Interface to GiNaC's clifford objects. */
/*
- * GiNaC Copyright (C) 1999 Johannes Gutenberg University Mainz, Germany
+ * GiNaC Copyright (C) 1999-2000 Johannes Gutenberg University Mainz, Germany
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* No real implementation yet, to be done. */
/*
- * GiNaC Copyright (C) 1999 Johannes Gutenberg University Mainz, Germany
+ * GiNaC Copyright (C) 1999-2000 Johannes Gutenberg University Mainz, Germany
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
// simplification of sum=sum of simplifications
if (is_ex_exactly_of_type(e_expanded,add)) {
ex sum=_ex0();
- for (int i=0; i<e_expanded.nops(); ++i) {
+ for (unsigned i=0; i<e_expanded.nops(); ++i)
sum += simplify_color(e_expanded.op(i));
- }
+
return sum;
}
// simplification of commutative product=commutative product of simplifications
if (is_ex_exactly_of_type(e_expanded,mul)) {
ex prod=_ex1();
- for (int i=0; i<e_expanded.nops(); ++i) {
+ for (unsigned i=0; i<e_expanded.nops(); ++i)
prod *= simplify_color(e_expanded.op(i));
- }
+
return prod;
}
// simplification of noncommutative product: test if everything is color
if (is_ex_exactly_of_type(e_expanded,ncmul)) {
bool all_color=true;
- for (int i=0; i<e_expanded.nops(); ++i) {
+ for (unsigned i=0; i<e_expanded.nops(); ++i) {
if (!is_ex_exactly_of_type(e_expanded.op(i),color)) {
all_color=false;
break;
* Interface to GiNaC's color objects. */
/*
- * GiNaC Copyright (C) 1999 Johannes Gutenberg University Mainz, Germany
+ * GiNaC Copyright (C) 1999-2000 Johannes Gutenberg University Mainz, Germany
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* Implementation of GiNaC's color indices. */
/*
- * GiNaC Copyright (C) 1999 Johannes Gutenberg University Mainz, Germany
+ * GiNaC Copyright (C) 1999-2000 Johannes Gutenberg University Mainz, Germany
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* Interface to GiNaC's color indices. */
/*
- * GiNaC Copyright (C) 1999 Johannes Gutenberg University Mainz, Germany
+ * GiNaC Copyright (C) 1999-2000 Johannes Gutenberg University Mainz, Germany
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* Implementation of GiNaC's constant types and some special constants. */
/*
- * GiNaC Copyright (C) 1999 Johannes Gutenberg University Mainz, Germany
+ * GiNaC Copyright (C) 1999-2000 Johannes Gutenberg University Mainz, Germany
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* Interface to GiNaC's constant types and some special constants. */
/*
- * GiNaC Copyright (C) 1999 Johannes Gutenberg University Mainz, Germany
+ * GiNaC Copyright (C) 1999-2000 Johannes Gutenberg University Mainz, Germany
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* \$open_bracket=${open_bracket}
* \$close_bracket=${close_bracket}
*
- * GiNaC Copyright (C) 1999 Johannes Gutenberg University Mainz, Germany
+ * GiNaC Copyright (C) 1999-2000 Johannes Gutenberg University Mainz, Germany
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* \$open_bracket=${open_bracket}
* \$close_bracket=${close_bracket}
*
- * GiNaC Copyright (C) 1999 Johannes Gutenberg University Mainz, Germany
+ * GiNaC Copyright (C) 1999-2000 Johannes Gutenberg University Mainz, Germany
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* Utilities needed for debugging only. */
/*
- * GiNaC Copyright (C) 1999 Johannes Gutenberg University Mainz, Germany
+ * GiNaC Copyright (C) 1999-2000 Johannes Gutenberg University Mainz, Germany
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* Implementation of symbolic differentiation in all of GiNaC's classes. */
/*
- * GiNaC Copyright (C) 1999 Johannes Gutenberg University Mainz, Germany
+ * GiNaC Copyright (C) 1999-2000 Johannes Gutenberg University Mainz, Germany
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* Implementation of GiNaC's light-weight expression handles. */
/*
- * GiNaC Copyright (C) 1999 Johannes Gutenberg University Mainz, Germany
+ * GiNaC Copyright (C) 1999-2000 Johannes Gutenberg University Mainz, Germany
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
// polynomial^(int) * polynomial^(int) * ... is in normal form
if (!is_ex_exactly_of_type(*this, mul))
return false;
- for (int i=0; i<nops(); i++) {
+ for (unsigned i=0; i<nops(); i++) {
if (is_ex_exactly_of_type(op(i), power)) {
if (!op(i).op(1).info(info_flags::integer))
return false;
}
}
-int ex::nops() const
+unsigned ex::nops() const
{
GINAC_ASSERT(bp!=0);
return bp->nops();
if (!is_ex_exactly_of_type(n, mul))
return n;
ex res = _ex1();
- for (int i=0; i<n.nops(); i++) {
+ for (unsigned i=0; i<n.nops(); i++) {
if (!is_ex_exactly_of_type(n.op(i), power) || !n.op(i).op(1).info(info_flags::negint))
res *= n.op(i);
}
if (!is_ex_exactly_of_type(n, mul))
return _ex1();
ex res = _ex1();
- for (int i=0; i<n.nops(); i++) {
+ for (unsigned i=0; i<n.nops(); i++) {
if (is_ex_exactly_of_type(n.op(i), power) && n.op(i).op(1).info(info_flags::negint))
res *= power(n.op(i), -1);
}
* Interface to GiNaC's light-weight expression handles. */
/*
- * GiNaC Copyright (C) 1999 Johannes Gutenberg University Mainz, Germany
+ * GiNaC Copyright (C) 1999-2000 Johannes Gutenberg University Mainz, Germany
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
void dbgprint(void) const;
void dbgprinttree(void) const;
bool info(unsigned inf) const;
- int nops() const;
+ unsigned nops() const;
ex expand(unsigned options=0) const;
bool has(ex const & other) const;
int degree(symbol const & s) const;
}
// wrapper functions around member functions
-inline int nops(ex const & thisex)
+inline unsigned nops(ex const & thisex)
{ return thisex.nops(); }
inline ex expand(ex const & thisex, unsigned options = 0)
* Definition of expression pairs (building blocks of expairseq). */
/*
- * GiNaC Copyright (C) 1999 Johannes Gutenberg University Mainz, Germany
+ * GiNaC Copyright (C) 1999-2000 Johannes Gutenberg University Mainz, Germany
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* Implementation of sequences of expression pairs. */
/*
- * GiNaC Copyright (C) 1999 Johannes Gutenberg University Mainz, Germany
+ * GiNaC Copyright (C) 1999-2000 Johannes Gutenberg University Mainz, Germany
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
return basic::info(inf);
}
-int expairseq::nops() const
+unsigned expairseq::nops() const
{
if (overall_coeff.is_equal(default_overall_coeff())) {
return seq.size();
* Interface to sequences of expression pairs. */
/*
- * GiNaC Copyright (C) 1999 Johannes Gutenberg University Mainz, Germany
+ * GiNaC Copyright (C) 1999-2000 Johannes Gutenberg University Mainz, Germany
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
void printraw(ostream & os) const;
void printtree(ostream & os, unsigned indent) const;
bool info(unsigned inf) const;
- int nops() const;
+ unsigned nops() const;
ex op(int const i) const;
ex & let_op(int const i);
ex eval(int level=0) const;
* not automatically generated. */
/*
- * GiNaC Copyright (C) 1999 Johannes Gutenberg University Mainz, Germany
+ * GiNaC Copyright (C) 1999-2000 Johannes Gutenberg University Mainz, Germany
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* obsolete all this stuff ought to be replaced by exceptions. */
/*
- * GiNaC Copyright (C) 1999 Johannes Gutenberg University Mainz, Germany
+ * GiNaC Copyright (C) 1999-2000 Johannes Gutenberg University Mainz, Germany
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* this stuff ought to be replaced by exceptions. */
/*
- * GiNaC Copyright (C) 1999 Johannes Gutenberg University Mainz, Germany
+ * GiNaC Copyright (C) 1999-2000 Johannes Gutenberg University Mainz, Germany
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* Collection of all flags used through the GiNaC framework. */
/*
- * GiNaC Copyright (C) 1999 Johannes Gutenberg University Mainz, Germany
+ * GiNaC Copyright (C) 1999-2000 Johannes Gutenberg University Mainz, Germany
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* Please do not modify it directly, edit the perl script instead!
* function.pl options: \$maxargs=${maxargs}
*
- * GiNaC Copyright (C) 1999 Johannes Gutenberg University Mainz, Germany
+ * GiNaC Copyright (C) 1999-2000 Johannes Gutenberg University Mainz, Germany
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* Please do not modify it directly, edit the perl script instead!
* function.pl options: \$maxargs=${maxargs}
*
- * GiNaC Copyright (C) 1999 Johannes Gutenberg University Mainz, Germany
+ * GiNaC Copyright (C) 1999-2000 Johannes Gutenberg University Mainz, Germany
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* This include file includes all other public GiNaC headers. */
/*
- * GiNaC Copyright (C) 1999 Johannes Gutenberg University Mainz, Germany
+ * GiNaC Copyright (C) 1999-2000 Johannes Gutenberg University Mainz, Germany
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* Implementation of GiNaC's indices. */
/*
- * GiNaC Copyright (C) 1999 Johannes Gutenberg University Mainz, Germany
+ * GiNaC Copyright (C) 1999-2000 Johannes Gutenberg University Mainz, Germany
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
{
GINAC_ASSERT(ls.nops()==lr.nops());
#ifdef DO_GINAC_ASSERT
- for (int i=0; i<ls.nops(); i++) {
+ for (unsigned i=0; i<ls.nops(); i++) {
GINAC_ASSERT(is_ex_exactly_of_type(ls.op(i),symbol)||
is_ex_of_type(ls.op(i),idx));
}
#endif // def DO_GINAC_ASSERT
- for (int i=0; i<ls.nops(); i++) {
+ for (unsigned i=0; i<ls.nops(); i++) {
if (is_equal(*(ls.op(i)).bp)) {
return lr.op(i);
}
* Interface to GiNaC's indices. */
/*
- * GiNaC Copyright (C) 1999 Johannes Gutenberg University Mainz, Germany
+ * GiNaC Copyright (C) 1999-2000 Johannes Gutenberg University Mainz, Germany
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* Implementation of GiNaC's index carrying objects. */
/*
- * GiNaC Copyright (C) 1999 Johannes Gutenberg University Mainz, Germany
+ * GiNaC Copyright (C) 1999-2000 Johannes Gutenberg University Mainz, Germany
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* Interface to GiNaC's index carrying objects. */
/*
- * GiNaC Copyright (C) 1999 Johannes Gutenberg University Mainz, Germany
+ * GiNaC Copyright (C) 1999-2000 Johannes Gutenberg University Mainz, Germany
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* Implementation of GiNaC's initially known functions. */
/*
- * GiNaC Copyright (C) 1999 Johannes Gutenberg University Mainz, Germany
+ * GiNaC Copyright (C) 1999-2000 Johannes Gutenberg University Mainz, Germany
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
if (!eqns.info(info_flags::list)) {
throw(std::invalid_argument("lsolve: 1st argument must be a list"));
}
- for (int i=0; i<eqns.nops(); i++) {
+ for (unsigned i=0; i<eqns.nops(); i++) {
if (!eqns.op(i).info(info_flags::relation_equal)) {
throw(std::invalid_argument("lsolve: 1st argument must be a list of equations"));
}
if (!symbols.info(info_flags::list)) {
throw(std::invalid_argument("lsolve: 2nd argument must be a list"));
}
- for (int i=0; i<symbols.nops(); i++) {
+ for (unsigned i=0; i<symbols.nops(); i++) {
if (!symbols.op(i).info(info_flags::symbol)) {
throw(std::invalid_argument("lsolve: 2nd argument must be a list of symbols"));
}
matrix rhs(eqns.nops(),1);
matrix vars(symbols.nops(),1);
- for (int r=0; r<eqns.nops(); r++) {
+ for (unsigned r=0; r<eqns.nops(); r++) {
ex eq=eqns.op(r).op(0)-eqns.op(r).op(1); // lhs-rhs==0
ex linpart=eq;
- for (int c=0; c<symbols.nops(); c++) {
+ for (unsigned c=0; c<symbols.nops(); c++) {
ex co=eq.coeff(ex_to_symbol(symbols.op(c)),1);
linpart -= co*symbols.op(c);
sys.set(r,c,co);
}
// test if system is linear and fill vars matrix
- for (int i=0; i<symbols.nops(); i++) {
+ for (unsigned i=0; i<symbols.nops(); i++) {
vars.set(i,0,symbols.op(i));
if (sys.has(symbols.op(i))) {
throw(std::logic_error("lsolve: system is not linear"));
// return list of the form lst(var1==sol1,var2==sol2,...)
lst sollist;
- for (int i=0; i<symbols.nops(); i++) {
+ for (unsigned i=0; i<symbols.nops(); i++) {
sollist.append(symbols.op(i)==solution(i,0));
}
* Interface to GiNaC's initially known functions. */
/*
- * GiNaC Copyright (C) 1999 Johannes Gutenberg University Mainz, Germany
+ * GiNaC Copyright (C) 1999-2000 Johannes Gutenberg University Mainz, Germany
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* some related stuff. */
/*
- * GiNaC Copyright (C) 1999 Johannes Gutenberg University Mainz, Germany
+ * GiNaC Copyright (C) 1999-2000 Johannes Gutenberg University Mainz, Germany
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* functions. */
/*
- * GiNaC Copyright (C) 1999 Johannes Gutenberg University Mainz, Germany
+ * GiNaC Copyright (C) 1999-2000 Johannes Gutenberg University Mainz, Germany
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* Implementation of the Zeta-function and some related stuff. */
/*
- * GiNaC Copyright (C) 1999 Johannes Gutenberg University Mainz, Germany
+ * GiNaC Copyright (C) 1999-2000 Johannes Gutenberg University Mainz, Germany
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* No real implementation yet, to be done. */
/*
- * GiNaC Copyright (C) 1999 Johannes Gutenberg University Mainz, Germany
+ * GiNaC Copyright (C) 1999-2000 Johannes Gutenberg University Mainz, Germany
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* Interface to GiNaC's isospin objects. */
/*
- * GiNaC Copyright (C) 1999 Johannes Gutenberg University Mainz, Germany
+ * GiNaC Copyright (C) 1999-2000 Johannes Gutenberg University Mainz, Germany
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* Implementation of GiNaC's lorentz indices. */
/*
- * GiNaC Copyright (C) 1999 Johannes Gutenberg University Mainz, Germany
+ * GiNaC Copyright (C) 1999-2000 Johannes Gutenberg University Mainz, Germany
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* Interface to GiNaC's lorentz indices. */
/*
- * GiNaC Copyright (C) 1999 Johannes Gutenberg University Mainz, Germany
+ * GiNaC Copyright (C) 1999-2000 Johannes Gutenberg University Mainz, Germany
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* No real implementation yet, do be done. */
/*
- * GiNaC Copyright (C) 1999 Johannes Gutenberg University Mainz, Germany
+ * GiNaC Copyright (C) 1999-2000 Johannes Gutenberg University Mainz, Germany
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* Interface to GiNaC´s lortensor objects. */
/*
- * GiNaC Copyright (C) 1999 Johannes Gutenberg University Mainz, Germany
+ * GiNaC Copyright (C) 1999-2000 Johannes Gutenberg University Mainz, Germany
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* not automatically generated. */
/*
- * GiNaC Copyright (C) 1999 Johannes Gutenberg University Mainz, Germany
+ * GiNaC Copyright (C) 1999-2000 Johannes Gutenberg University Mainz, Germany
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* Implementation of symbolic matrices */
/*
- * GiNaC Copyright (C) 1999 Johannes Gutenberg University Mainz, Germany
+ * GiNaC Copyright (C) 1999-2000 Johannes Gutenberg University Mainz, Germany
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
}
/** nops is defined to be rows x columns. */
-int matrix::nops() const
+unsigned matrix::nops() const
{
return row*col;
}
* Interface to symbolic matrices */
/*
- * GiNaC Copyright (C) 1999 Johannes Gutenberg University Mainz, Germany
+ * GiNaC Copyright (C) 1999-2000 Johannes Gutenberg University Mainz, Germany
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
basic * duplicate() const;
void print(ostream & os, unsigned upper_precedence=0) const;
void printraw(ostream & os) const;
- int nops() const;
+ unsigned nops() const;
ex & let_op(int const i);
ex expand(unsigned options=0) const;
bool has(ex const & other) const;
// wrapper functions around member functions
-inline int nops(matrix const & m)
+inline unsigned nops(matrix const & m)
{ return m.nops(); }
inline ex expand(matrix const & m, unsigned options=0)
* Implementation of GiNaC's products of expressions. */
/*
- * GiNaC Copyright (C) 1999 Johannes Gutenberg University Mainz, Germany
+ * GiNaC Copyright (C) 1999-2000 Johannes Gutenberg University Mainz, Germany
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
(ex_to_numeric((*cit).coeff).is_equal(_num1()))) {
positions_of_adds[number_of_adds]=current_position;
add const & expanded_addref=ex_to_add((*cit).rest);
- int addref_nops=expanded_addref.nops();
+ unsigned addref_nops=expanded_addref.nops();
number_of_add_operands[number_of_adds]=addref_nops;
number_of_expanded_terms *= addref_nops;
number_of_adds++;
* Interface to GiNaC's products of expressions. */
/*
- * GiNaC Copyright (C) 1999 Johannes Gutenberg University Mainz, Germany
+ * GiNaC Copyright (C) 1999-2000 Johannes Gutenberg University Mainz, Germany
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* Implementation of GiNaC's non-commutative products of expressions. */
/*
- * GiNaC Copyright (C) 1999 Johannes Gutenberg University Mainz, Germany
+ * GiNaC Copyright (C) 1999-2000 Johannes Gutenberg University Mainz, Germany
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
if ((is_ex_exactly_of_type(e,mul)&&(e.return_type()!=return_types::commutative))||
(is_ex_exactly_of_type(e,ncmul))) {
unsigned factors=0;
- for (int i=0; i<e.nops(); i++) {
+ for (unsigned i=0; i<e.nops(); i++)
factors += count_factors(e.op(i));
- }
+
return factors;
}
return 1;
{
if ((is_ex_exactly_of_type(e,mul)&&(e.return_type()!=return_types::commutative))||
(is_ex_exactly_of_type(e,ncmul))) {
- for (int i=0; i<e.nops(); i++) {
+ for (unsigned i=0; i<e.nops(); i++)
append_factors(v,e.op(i));
- }
+
return;
}
v.push_back(e);
* Interface to GiNaC's non-commutative products of expressions. */
/*
- * GiNaC Copyright (C) 1999 Johannes Gutenberg University Mainz, Germany
+ * GiNaC Copyright (C) 1999-2000 Johannes Gutenberg University Mainz, Germany
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
*/
/*
- * GiNaC Copyright (C) 1999 Johannes Gutenberg University Mainz, Germany
+ * GiNaC Copyright (C) 1999-2000 Johannes Gutenberg University Mainz, Germany
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
x = static_cast<symbol *>(e.bp);
return true;
} else if (is_ex_exactly_of_type(e, add) || is_ex_exactly_of_type(e, mul)) {
- for (int i=0; i<e.nops(); i++)
+ for (unsigned i=0; i<e.nops(); i++)
if (get_first_symbol(e.op(i), x))
return true;
} else if (is_ex_exactly_of_type(e, power)) {
if (is_ex_exactly_of_type(e, symbol)) {
add_symbol(static_cast<symbol *>(e.bp), v);
} else if (is_ex_exactly_of_type(e, add) || is_ex_exactly_of_type(e, mul)) {
- for (int i=0; i<e.nops(); i++)
+ for (unsigned i=0; i<e.nops(); i++)
collect_symbols(e.op(i), v);
} else if (is_ex_exactly_of_type(e, power)) {
collect_symbols(e.op(0), v);
return lcm(ex_to_numeric(e).denom(), l);
else if (is_ex_exactly_of_type(e, add) || is_ex_exactly_of_type(e, mul)) {
numeric c = _num1();
- for (int i=0; i<e.nops(); i++) {
+ for (unsigned i=0; i<e.nops(); i++)
c = lcmcoeff(e.op(i), c);
- }
return lcm(c, l);
} else if (is_ex_exactly_of_type(e, power))
return lcmcoeff(e.op(0), l);
static ex replace_with_symbol(const ex &e, lst &sym_lst, lst &repl_lst)
{
// Expression already in repl_lst? Then return the assigned symbol
- for (int i=0; i<repl_lst.nops(); i++)
+ for (unsigned i=0; i<repl_lst.nops(); i++)
if (repl_lst.op(i).is_equal(e))
return sym_lst.op(i);
* and square-free factorization. */
/*
- * GiNaC Copyright (C) 1999 Johannes Gutenberg University Mainz, Germany
+ * GiNaC Copyright (C) 1999-2000 Johannes Gutenberg University Mainz, Germany
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* of special functions or implement the interface to the bignum package. */
/*
- * GiNaC Copyright (C) 1999 Johannes Gutenberg University Mainz, Germany
+ * GiNaC Copyright (C) 1999-2000 Johannes Gutenberg University Mainz, Germany
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* Makes the interface to the underlying bignum package available. */
/*
- * GiNaC Copyright (C) 1999 Johannes Gutenberg University Mainz, Germany
+ * GiNaC Copyright (C) 1999-2000 Johannes Gutenberg University Mainz, Germany
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* Implementation of GiNaC's overloaded operators. */
/*
- * GiNaC Copyright (C) 1999 Johannes Gutenberg University Mainz, Germany
+ * GiNaC Copyright (C) 1999-2000 Johannes Gutenberg University Mainz, Germany
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* Interface to GiNaC's overloaded operators. */
/*
- * GiNaC Copyright (C) 1999 Johannes Gutenberg University Mainz, Germany
+ * GiNaC Copyright (C) 1999-2000 Johannes Gutenberg University Mainz, Germany
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* Implementation of GiNaC's symbolic exponentiation (basis^exponent). */
/*
- * GiNaC Copyright (C) 1999 Johannes Gutenberg University Mainz, Germany
+ * GiNaC Copyright (C) 1999-2000 Johannes Gutenberg University Mainz, Germany
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
}
}
-int power::nops() const
+unsigned power::nops() const
{
return 2;
}
* Interface to GiNaC's symbolic exponentiation (basis^exponent). */
/*
- * GiNaC Copyright (C) 1999 Johannes Gutenberg University Mainz, Germany
+ * GiNaC Copyright (C) 1999-2000 Johannes Gutenberg University Mainz, Germany
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
void printtree(ostream & os, unsigned indent) const;
void printcsrc(ostream & os, unsigned type, unsigned upper_precedence=0) const;
bool info(unsigned inf) const;
- int nops() const;
+ unsigned nops() const;
ex & let_op(int const i);
int degree(symbol const & s) const;
int ldegree(symbol const & s) const;
* Implementation of relations between expressions */
/*
- * GiNaC Copyright (C) 1999 Johannes Gutenberg University Mainz, Germany
+ * GiNaC Copyright (C) 1999-2000 Johannes Gutenberg University Mainz, Germany
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
return 0;
}
-int relational::nops() const
+unsigned relational::nops() const
{
return 2;
}
* Interface to relations between expressions. */
/*
- * GiNaC Copyright (C) 1999 Johannes Gutenberg University Mainz, Germany
+ * GiNaC Copyright (C) 1999-2000 Johannes Gutenberg University Mainz, Germany
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
void printraw(ostream & os) const;
void printcsrc(ostream & os, unsigned type, unsigned upper_precedence=0) const;
bool info(unsigned inf) const;
- int nops() const;
+ unsigned nops() const;
ex & let_op(int const i);
ex eval(int level=0) const;
ex evalf(int level=0) const;
* methods for series expansion. */
/*
- * GiNaC Copyright (C) 1999 Johannes Gutenberg University Mainz, Germany
+ * GiNaC Copyright (C) 1999-2000 Johannes Gutenberg University Mainz, Germany
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* Interface to class for extended truncated power series. */
/*
- * GiNaC Copyright (C) 1999 Johannes Gutenberg University Mainz, Germany
+ * GiNaC Copyright (C) 1999-2000 Johannes Gutenberg University Mainz, Germany
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* No real implementation yet, to be done. */
/*
- * GiNaC Copyright (C) 1999 Johannes Gutenberg University Mainz, Germany
+ * GiNaC Copyright (C) 1999-2000 Johannes Gutenberg University Mainz, Germany
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
exvector v_contracted;
// collect factors in an exvector, store squares twice
- int n=m.nops();
+ unsigned n=m.nops();
v_contracted.reserve(2*n);
- for (int i=0; i<n; ++i) {
+ for (unsigned i=0; i<n; ++i) {
ex f=m.op(i);
if (is_ex_exactly_of_type(f,power)&&f.op(1).is_equal(_ex2())) {
v_contracted.push_back(f.op(0));
v_contracted.push_back(f.op(0));
} else {
v_contracted.push_back(f);
- }
+ }
}
unsigned replacements;
// simplification of sum=sum of simplifications
if (is_ex_exactly_of_type(e_expanded,add)) {
ex sum=_ex0();
- for (int i=0; i<e_expanded.nops(); ++i) {
+ for (unsigned i=0; i<e_expanded.nops(); ++i)
sum += simplify_simp_lor(e_expanded.op(i),sp);
- }
+
return sum;
}
* Interface to GiNaC's simp_lor objects. */
/*
- * GiNaC Copyright (C) 1999 Johannes Gutenberg University Mainz, Germany
+ * GiNaC Copyright (C) 1999-2000 Johannes Gutenberg University Mainz, Germany
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* Implementation of 'abstract' class structure. */
/*
- * GiNaC Copyright (C) 1999 Johannes Gutenberg University Mainz, Germany
+ * GiNaC Copyright (C) 1999-2000 Johannes Gutenberg University Mainz, Germany
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* Interface to 'abstract' class structure. */
/*
- * GiNaC Copyright (C) 1999 Johannes Gutenberg University Mainz, Germany
+ * GiNaC Copyright (C) 1999-2000 Johannes Gutenberg University Mainz, Germany
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* This file was generated automatically by structure.pl.
* Please do not modify it directly, edit the perl script instead!
*
- * GiNaC Copyright (C) 1999 Johannes Gutenberg University Mainz, Germany
+ * GiNaC Copyright (C) 1999-2000 Johannes Gutenberg University Mainz, Germany
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* This file was generated automatically by STRUCTURE.pl.
* Please do not modify it directly, edit the perl script instead!
*
- * GiNaC Copyright (C) 1999 Johannes Gutenberg University Mainz, Germany
+ * GiNaC Copyright (C) 1999-2000 Johannes Gutenberg University Mainz, Germany
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* Implementation of GiNaC's symbolic objects. */
/*
- * GiNaC Copyright (C) 1999 Johannes Gutenberg University Mainz, Germany
+ * GiNaC Copyright (C) 1999-2000 Johannes Gutenberg University Mainz, Germany
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
{
GINAC_ASSERT(ls.nops()==lr.nops());
#ifdef DO_GINAC_ASSERT
- for (int i=0; i<ls.nops(); i++) {
+ for (unsigned i=0; i<ls.nops(); i++) {
GINAC_ASSERT(is_ex_exactly_of_type(ls.op(i),symbol)||
is_ex_of_type(ls.op(i),idx));
}
#endif // def DO_GINAC_ASSERT
- for (int i=0; i<ls.nops(); i++) {
+ for (unsigned i=0; i<ls.nops(); i++) {
if (is_ex_exactly_of_type(ls.op(i),symbol)) {
if (compare_same_type(ex_to_symbol(ls.op(i)))==0) return lr.op(i);
}
* Interface to GiNaC's symbolic objects. */
/*
- * GiNaC Copyright (C) 1999 Johannes Gutenberg University Mainz, Germany
+ * GiNaC Copyright (C) 1999-2000 Johannes Gutenberg University Mainz, Germany
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* Values for a do-it-yourself typeinfo scheme. */
/*
- * GiNaC Copyright (C) 1999 Johannes Gutenberg University Mainz, Germany
+ * GiNaC Copyright (C) 1999-2000 Johannes Gutenberg University Mainz, Germany
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* but not of any interest to the user of the library. */
/*
- * GiNaC Copyright (C) 1999 Johannes Gutenberg University Mainz, Germany
+ * GiNaC Copyright (C) 1999-2000 Johannes Gutenberg University Mainz, Germany
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* of any interest to the user of the library. */
/*
- * GiNaC Copyright (C) 1999 Johannes Gutenberg University Mainz, Germany
+ * GiNaC Copyright (C) 1999-2000 Johannes Gutenberg University Mainz, Germany
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by