Back to index

texmacs  1.0.7.15
Functions
collection.cpp File Reference
#include "tmfs.hpp"

Go to the source code of this file.

Functions

collection singleton (string s, int eps)
string first (collection c)
collection filter (collection c, bool file_flag)
collection simplify (collection c)
collection invert (collection c)
void merge (collection &c1, collection c2)
collection operator* (collection c1, collection c2)
int total_size (collection c)
collection as_collection (strings a)
strings as_strings (collection c)

Function Documentation

Definition at line 108 of file collection.cpp.

                          {
  collection s;
  for (int i=0; i<N(a); i++)
    s(a[i])= 1;
  return s;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 116 of file collection.cpp.

                          {
  strings a;
  iterator<string> it= iterate (c);
  while (it->busy ()) {
    string s= it->next ();
    if (c[s] > 0) a << s;
  }
  return a;
}

Here is the call graph for this function:

Here is the caller graph for this function:

transaction filter ( collection  c,
bool  file_flag 
)

Definition at line 41 of file collection.cpp.

                                      {
  collection r;
  iterator<string> it= iterate (c);
  while (it->busy ()) {
    string s= it->next ();
    int eps= c[s];
    if ((eps > -3 && eps < 3) ^ file_flag) r(s)= eps;
  }
  return r;
}

Here is the caller graph for this function:

Definition at line 35 of file collection.cpp.

                     {
  iterator<string> it= iterate (c);
  return it->next ();
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 65 of file collection.cpp.

                      {
  collection r;
  iterator<string> it= iterate (c);
  while (it->busy ()) {
    string s= it->next ();
    r(s)= -c[s];
  }
  return r;
}
void merge ( collection c1,
collection  c2 
)

Definition at line 76 of file collection.cpp.

                                      {
  //cout << "Merge " << c1 << ", " << c2 << "\n";
  iterator<string> it= iterate (c2);
  while (it->busy ()) {
    string s= it->next ();
    int eps= c2[s];
    if (eps < -1 || eps > 1) c1= collection ();
    c1(s)= c2[s];
  }
}

Here is the caller graph for this function:

transaction operator* ( collection  c1,
collection  c2 
)

Definition at line 88 of file collection.cpp.

                                          {
  collection r;
  merge (r, c1);
  merge (r, c2);
  return r;
}

Definition at line 53 of file collection.cpp.

                        {
  collection r;
  iterator<string> it= iterate (c);
  while (it->busy ()) {
    string s= it->next ();
    int eps= c[s];
    if (eps > 0) r(s)= eps;
  }
  return r;
}

Here is the caller graph for this function:

collection singleton ( string  s,
int  eps 
)

Definition at line 28 of file collection.cpp.

                              {
  collection c;
  c (s)= eps;
  return c;
}
int total_size ( collection  c)

Definition at line 96 of file collection.cpp.

                          {
  int sz= 1;
  iterator<string> it= iterate (c);
  while (it->busy ()) sz += (N (it->next ()) + 1);
  return sz;
}

Here is the caller graph for this function: