exvector v(num - 2);
int sign = 1;
ex result;
- for (int i=1; i<num; i++) {
- for (int n=1, j=0; n<num; n++) {
+ for (unsigned i=1; i<num; i++) {
+ for (unsigned n=1, j=0; n<num; n++) {
if (n == i)
continue;
v[j++] = ix[n];
ex prod = _ex1();
for (unsigned i=0; i<e.nops(); i++) {
const ex &o = e.op(i);
- unsigned ti = o.return_type_tinfo();
if (is_clifford_tinfo(o.return_type_tinfo(), rl))
prod *= dirac_trace(o, rl, trONE);
else
num--;
int *iv = new int[num];
ex result;
- for (int i=0; i<num-3; i++) {
+ for (unsigned i=0; i<num-3; i++) {
ex idx1 = ix[i];
- for (int j=i+1; j<num-2; j++) {
+ for (unsigned j=i+1; j<num-2; j++) {
ex idx2 = ix[j];
- for (int k=j+1; k<num-1; k++) {
+ for (unsigned k=j+1; k<num-1; k++) {
ex idx3 = ix[k];
- for (int l=k+1; l<num; l++) {
+ for (unsigned l=k+1; l<num; l++) {
ex idx4 = ix[l];
iv[0] = i; iv[1] = j; iv[2] = k; iv[3] = l;
exvector v;
v.reserve(num - 4);
- for (int n=0, t=4; n<num; n++) {
+ for (unsigned n=0, t=4; n<num; n++) {
if (n == i || n == j || n == k || n == l)
continue;
iv[t++] = n;
exvector v1;
v1.reserve(num - 2);
- for (int i=0; i<num-2; i++)
+ for (unsigned i=0; i<num-2; i++)
v1.push_back(e.op(i));
exvector v2 = v1;
* by the function */
static ex rename_dummy_indices(const ex & e, exvector & global_dummy_indices, exvector & local_dummy_indices)
{
- int global_size = global_dummy_indices.size(),
- local_size = local_dummy_indices.size();
+ unsigned global_size = global_dummy_indices.size(),
+ local_size = local_dummy_indices.size();
// Any local dummy indices at all?
if (local_size == 0)
v.push_back(e.op(0));
v.push_back(e.op(0));
} else {
- for (int i=0; i<e.nops(); i++) {
+ for (unsigned i=0; i<e.nops(); i++) {
ex f = e.op(i);
if (is_ex_exactly_of_type(f, power) && f.op(1).is_equal(_ex2())) {
v.push_back(f.op(0));
} else if (is_ex_exactly_of_type(f, ncmul)) {
// Noncommutative factor found, split it as well
non_commutative = true; // everything becomes noncommutative, ncmul will sort out the commutative factors later
- for (int j=0; j<f.nops(); j++)
+ for (unsigned j=0; j<f.nops(); j++)
v.push_back(f.op(j));
} else
v.push_back(f);
syms.clear();
if (!is_ex_exactly_of_type(l, lst))
return;
- for (int i=0; i<l.nops(); i++) {
+ for (unsigned i=0; i<l.nops(); i++) {
if (is_ex_exactly_of_type(l.op(i), symbol))
syms[ex_to_symbol(l.op(i)).get_name()] = sym_def(l.op(i), true);
}
const matrix &other_matrix = ex_to<matrix>(other->op(0));
if (self->nops() == 2) {
- unsigned self_dim = (self_matrix.col == 1) ? self_matrix.row : self_matrix.col;
if (other->nops() == 2) { // vector * vector (scalar product)
- unsigned other_dim = (other_matrix.col == 1) ? other_matrix.row : other_matrix.col;
if (self_matrix.col == 1) {
if (other_matrix.col == 1) {
// Factorize denominator and compute cofactors
exvector yun = sqrfree_yun(denom, x);
//clog << "yun factors: " << exprseq(yun) << endl;
- int num_yun = yun.size();
+ unsigned num_yun = yun.size();
exvector factor; factor.reserve(num_yun);
exvector cofac; cofac.reserve(num_yun);
for (unsigned i=0; i<num_yun; i++) {
}
}
}
- int num_factors = factor.size();
+ unsigned num_factors = factor.size();
//clog << "factors : " << exprseq(factor) << endl;
//clog << "cofactors: " << exprseq(cofac) << endl;
int max_denom_deg = denom.degree(x);
matrix sys(max_denom_deg + 1, num_factors);
matrix rhs(max_denom_deg + 1, 1);
- for (unsigned i=0; i<=max_denom_deg; i++) {
+ for (int i=0; i<=max_denom_deg; i++) {
for (unsigned j=0; j<num_factors; j++)
sys(i, j) = cofac[j].coeff(x, i);
rhs(i, 0) = red_numer.coeff(x, i);
int symmetry::compare_same_type(const basic & other) const
{
GINAC_ASSERT(is_of_type(other, symmetry));
- const symmetry &o = static_cast<const symmetry &>(other);
// All symmetry trees are equal. They are not supposed to appear in
// ordinary expressions anyway...
static ex symm(const ex & e, exvector::const_iterator first, exvector::const_iterator last, bool asymmetric)
{
// Need at least 2 objects for this operation
- int num = last - first;
+ unsigned num = last - first;
if (num < 2)
return e;
ex symmetrize_cyclic(const ex & e, exvector::const_iterator first, exvector::const_iterator last)
{
// Need at least 2 objects for this operation
- int num = last - first;
+ unsigned num = last - first;
if (num < 2)
return e;
again:
if (self_idx->is_symbolic()) {
- for (int i=1; i<other->nops(); i++) {
+ for (unsigned i=1; i<other->nops(); i++) {
const idx &other_idx = ex_to<idx>(other->op(i));
if (is_dummy_pair(*self_idx, other_idx)) {
again:
if (self_idx->is_symbolic()) {
- for (int i=1; i<other->nops(); i++) {
+ for (unsigned i=1; i<other->nops(); i++) {
const idx &other_idx = ex_to<idx>(other->op(i));
if (is_dummy_pair(*self_idx, other_idx)) {
again:
if (self_idx->is_symbolic()) {
- for (int i=1; i<other->nops(); i++) {
+ for (unsigned i=1; i<other->nops(); i++) {
const idx &other_idx = ex_to<idx>(other->op(i));
if (is_dummy_pair(*self_idx, other_idx)) {
ex apply;
public:
apply_map_function(const ex & a) : apply(a) {}
+ virtual ~apply_map_function() {}
ex operator()(const ex & e) { return apply.subs(wild() == e, true); }
};